:root {
  --ink: #fff7ed;
  --muted: #fed7aa;
  --warm: #f97316;
  --rose: #e11d48;
  --gold: #facc15;
  --deep: #07070b;
  --panel: rgba(8, 8, 14, 0.6);
  --line: rgba(255, 247, 237, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
  background:
    linear-gradient(rgba(7, 7, 11, 0.2), rgba(7, 7, 11, 0.82)),
    url("assets/cinema-glow.png") center / cover no-repeat,
    var(--deep);
  overflow-x: hidden;
}

button {
  font-family: inherit;
}

.stage {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
}

.film-bars::before,
.film-bars::after {
  content: "";
  position: fixed;
  left: 0;
  z-index: 4;
  width: 100%;
  height: clamp(54px, 10vh, 96px);
  background: rgba(0, 0, 0, 0.86);
  pointer-events: none;
  animation: filmBarSlide 1500ms ease both;
}

.film-bars::before {
  top: 0;
}

.film-bars::after {
  bottom: 0;
}

.grain-layer {
  position: fixed;
  inset: 0;
  z-index: 2;
  opacity: 0.18;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  mix-blend-mode: soft-light;
  animation: grainDrift 9000ms linear infinite;
}

.light-beam {
  position: fixed;
  top: -20vh;
  z-index: 1;
  width: 42vw;
  height: 140vh;
  pointer-events: none;
  opacity: 0.22;
  filter: blur(18px);
  transform-origin: top center;
  background: linear-gradient(90deg, transparent, rgba(255, 247, 237, 0.6), transparent);
  animation: beamSweep 7600ms ease-in-out infinite;
}

.beam-one {
  left: 8vw;
  transform: rotate(18deg);
}

.beam-two {
  right: 2vw;
  animation-delay: -3200ms;
  transform: rotate(-16deg);
  background: linear-gradient(90deg, transparent, rgba(251, 113, 133, 0.52), transparent);
}

.particle-field {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: var(--size);
  height: var(--size);
  border-radius: 999px;
  background: rgba(255, 247, 237, 0.9);
  box-shadow: 0 0 18px rgba(253, 186, 116, 0.82);
  opacity: 0;
  animation: particleFloat var(--duration) linear infinite;
  animation-delay: var(--delay);
}

.panel {
  position: relative;
  z-index: 3;
  width: min(920px, 100%);
  min-height: min(660px, calc(100vh - 64px));
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: clamp(28px, 6vw, 72px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    radial-gradient(circle at 70% 18%, rgba(249, 115, 22, 0.16), transparent 30%),
    var(--panel);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(12px);
}

.intro-panel,
.final-panel {
  animation: enterPanel 900ms ease both;
}

.countdown-panel {
  align-items: center;
  text-align: center;
  animation: enterPanel 620ms ease both;
}

.is-hidden {
  display: none;
}

.kicker,
.scene-label,
.scene-tag {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.scene-topline {
  width: min(620px, 100%);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.scene-tag {
  color: rgba(255, 247, 237, 0.66);
}

h1,
h2 {
  max-width: 790px;
  margin: 22px 0 0;
  font-size: clamp(38px, 8vw, 88px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  font-size: clamp(34px, 7vw, 76px);
}

.intro-copy,
.final-copy,
.answer-line,
.scene-copy,
.typewriter-line {
  max-width: 720px;
  margin: 24px 0 0;
  color: rgba(255, 247, 237, 0.9);
  font-size: clamp(18px, 2.5vw, 24px);
  line-height: 1.76;
  overflow-wrap: anywhere;
}

.final-copy {
  max-width: 760px;
}

.answer-line {
  color: #fff;
  font-weight: 900;
}

.count-number {
  color: #fff;
  font-size: clamp(118px, 26vw, 238px);
  font-weight: 950;
  line-height: 0.82;
  letter-spacing: 0;
  text-shadow:
    0 0 26px rgba(250, 204, 21, 0.62),
    0 0 58px rgba(249, 115, 22, 0.76),
    0 28px 90px rgba(225, 29, 72, 0.62);
}

.scene-copy {
  max-width: 790px;
  min-height: 104px;
  font-size: clamp(24px, 4vw, 40px);
  font-weight: 900;
  line-height: 1.34;
}

.typewriter-line {
  min-height: 44px;
  margin-top: 10px;
  color: var(--muted);
  font-size: clamp(16px, 2.2vw, 22px);
}

.progress-track {
  width: min(620px, 100%);
  height: 4px;
  margin-top: 34px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 247, 237, 0.16);
}

.progress-fill {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--warm), var(--rose));
  box-shadow: 0 0 18px rgba(249, 115, 22, 0.75);
}

.progress-running {
  animation: progressFill var(--total-duration) linear forwards;
}

.button-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 34px;
}

.primary-button,
.ghost-button {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 26px;
  border: 0;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  margin-top: 34px;
  color: #21070a;
  background: linear-gradient(135deg, #fff7ed, #fdba74 48%, #fb7185);
  box-shadow: 0 16px 38px rgba(249, 115, 22, 0.36);
}

.button-row .primary-button {
  margin-top: 0;
}

.ghost-button {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 247, 237, 0.3);
}

.breathing {
  animation: buttonBreath 2100ms ease-in-out infinite;
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.primary-button:focus-visible,
.ghost-button:focus-visible {
  outline: 3px solid rgba(253, 186, 116, 0.72);
  outline-offset: 4px;
}

.scene-enter .count-number {
  animation: numberPulse 1200ms cubic-bezier(.2,.8,.2,1) both;
}

.scene-enter .scene-copy {
  animation: subtitleReveal 1000ms ease 180ms both;
}

.scene-enter .typewriter-line {
  animation: subtitleReveal 900ms ease 520ms both;
}

.final-panel.final-burst {
  animation: finalBurst 1200ms ease both;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.spark {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #fff7ed;
  box-shadow: 0 0 18px rgba(255, 247, 237, 0.92);
  animation: floatSpark 1600ms ease-out forwards;
}

@keyframes enterPanel {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes filmBarSlide {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes grainDrift {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 88px 44px;
  }
}

@keyframes beamSweep {
  0%, 100% {
    opacity: 0.12;
    transform: translateX(-8vw) rotate(18deg);
  }
  45% {
    opacity: 0.36;
    transform: translateX(12vw) rotate(10deg);
  }
}

@keyframes particleFloat {
  0% {
    opacity: 0;
    transform: translate3d(0, 18vh, 0) scale(0.5);
  }
  15%, 78% {
    opacity: 0.75;
  }
  100% {
    opacity: 0;
    transform: translate3d(var(--drift), -105vh, 0) scale(1.1);
  }
}

@keyframes numberPulse {
  0% {
    opacity: 0;
    transform: scale(0.68);
    filter: blur(10px);
  }
  52% {
    opacity: 1;
    transform: scale(1.08);
    filter: blur(0);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes subtitleReveal {
  from {
    opacity: 0;
    transform: translateY(18px);
    filter: blur(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes buttonBreath {
  0%, 100% {
    box-shadow: 0 16px 38px rgba(249, 115, 22, 0.28);
    transform: translateY(0);
  }
  50% {
    box-shadow: 0 20px 54px rgba(251, 113, 133, 0.48);
    transform: translateY(-1px);
  }
}

@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

@keyframes finalBurst {
  0% {
    opacity: 0;
    transform: scale(0.94);
    box-shadow: 0 0 0 rgba(249, 115, 22, 0);
  }
  45% {
    opacity: 1;
    transform: scale(1.015);
    box-shadow: 0 0 120px rgba(249, 115, 22, 0.34);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes floatSpark {
  from {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  to {
    opacity: 0;
    transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(0.18);
  }
}

@media (max-width: 680px) {
  .stage {
    padding: 18px;
    place-items: stretch;
  }

  .film-bars::before,
  .film-bars::after {
    height: 44px;
  }

  .panel {
    min-height: calc(100vh - 36px);
    padding: 58px 22px;
  }

  .scene-topline {
    flex-direction: column;
    gap: 6px;
    align-items: center;
  }

  .button-row,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    justify-content: center;
  }

  .scene-copy {
    min-height: 152px;
  }
}
