* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  touch-action: none;
  background: #000;
  color: #f4ead2;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
#stage { position: fixed; inset: 0; pointer-events: none; }
#webgl, #css3d { position: absolute; inset: 0; }
#webgl, #webgl canvas, #css3d { pointer-events: none; }
#webgl canvas { display: block; }

#ui {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.top {
  position: absolute;
  top: 22px;
  left: 24px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.6);
}
.kicker {
  letter-spacing: 0.42em;
  font-size: 12px;
  color: #e8c872;
}
#status {
  margin-top: 6px;
  font-size: 18px;
}
#cam {
  position: absolute;
  left: 20px;
  bottom: 118px;
  width: 128px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid rgba(232, 200, 114, 0.45);
  transform: scaleX(-1);
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
}
#cam.on { opacity: 1; }
.dock {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 20px calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.55) 40%);
  text-align: center;
}
#hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: rgba(244, 234, 210, 0.82);
}
.keys { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
button {
  pointer-events: auto;
  border: 1px solid rgba(232, 200, 114, 0.55);
  background: rgba(18, 12, 16, 0.72);
  color: #f4ead2;
  border-radius: 999px;
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
button:hover { background: rgba(48, 28, 24, 0.88); }
.gesture-toggle.is-off {
  border-color: rgba(244, 234, 210, 0.28);
  color: rgba(244, 234, 210, 0.72);
}

.window {
  width: 400px;
  height: 660px;
  border-radius: 18px;
  overflow: hidden;
  pointer-events: auto;
  background: #140e12;
  border: 2px solid rgba(232, 200, 114, 0.9);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.45);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.window-bar {
  height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: linear-gradient(#3a241c, #24160f);
  color: #f4ead2;
  font-size: 14px;
}
.window-bar span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.window-body { position: relative; height: calc(100% - 44px); background: #07060c; }
.poster {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(232, 200, 114, 0.18), transparent 46%),
    #140e12;
}
.poster .icon { font-size: 64px; line-height: 1; }
.poster strong { font-size: 22px; font-weight: 600; }
.poster em {
  font-style: normal;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(244, 234, 210, 0.72);
}
.window iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #000;
  pointer-events: none;
}
.window:not(.is-live) iframe { display: none; }
.window.is-live .poster { display: none; }
.window.kind-quote,
.window.kind-countdown,
.window.kind-together {
  background: rgba(16, 8, 28, 0.72);
  border-color: rgba(232, 200, 114, 0.45);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.35);
}
.window.kind-quote {
  background:
    linear-gradient(180deg, rgba(42, 16, 36, 0.88), rgba(12, 8, 18, 0.82));
  border-color: rgba(255, 158, 196, 0.35);
}
.face {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.face-count { align-items: center; text-align: center; padding: 16px 14px; gap: 4px; }
.face-count .cd-label { font-size: 15px; letter-spacing: 0.06em; color: rgba(244, 234, 210, 0.78); }
.face-count .cd-days { font-size: 28px; font-weight: 700; color: #ff9ec4; }
.face-count .cd-date { font-size: 13px; color: rgba(244, 234, 210, 0.55); }
.face-together {
  align-items: center;
  text-align: center;
  padding: 14px 18px;
  color: #e8c872;
  font-size: 18px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
.face-quote {
  justify-content: space-evenly;
  gap: 8px;
  padding: 18px 18px 16px;
}
.face-quote .quote-line {
  margin: 0;
  font-family: "Iowan Old Style", Palatino, "Songti SC", "STSong", Georgia, serif;
  font-size: 18px;
  line-height: 1.55;
  letter-spacing: 0.03em;
  color: rgba(244, 234, 210, 0.42);
  transition: color 0.45s ease, opacity 0.45s ease;
}
.face-quote .quote-line.on {
  color: #f6efe2;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}
.face-quote .quote-line.on::before {
  content: "“ ";
  color: #ff9ec4;
}
.face-timeline { justify-content: flex-start; padding: 16px 18px 12px; overflow: auto; }
.tl-item { position: relative; padding: 0 0 22px 28px; border-left: 2px solid rgba(232, 200, 114, 0.35); }
.tl-item:last-child { border-left-color: transparent; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ff5c8a;
  box-shadow: 0 0 0 4px rgba(255, 92, 138, 0.18);
}
.tl-date { font-size: 13px; color: #ff9ec4; letter-spacing: 0.05em; }
.tl-title { font-size: 18px; margin: 4px 0 6px; }
.tl-text { font-size: 15px; line-height: 1.7; color: rgba(244, 234, 210, 0.78); white-space: pre-line; }

#boot {
  position: fixed;
  inset: 0;
  z-index: 8;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(120, 30, 40, 0.35), transparent 42%),
    #07060c;
}
#boot.hide { display: none; }
.boot-card { width: min(440px, calc(100% - 40px)); text-align: center; }
.boot-kicker { letter-spacing: 0.38em; color: #e8c872; font-size: 12px; }
.boot-card h1 { margin: 10px 0 8px; font-weight: 600; font-size: 32px; }
.boot-card p { margin: 0 0 22px; line-height: 1.7; color: rgba(244, 234, 210, 0.84); }
.boot-card button { padding: 12px 28px; font-size: 16px; }
.boot-note { min-height: 1.2em; margin-top: 14px !important; font-size: 12px; color: rgba(244, 234, 210, 0.6); }

@media (max-width: 760px) {
  .top { top: 14px; left: 14px; }
  #status { font-size: 16px; }
  #cam { width: 96px; height: 72px; left: 12px; bottom: 132px; }
  #hint { font-size: 12px; }
}
