:root {
  --bg-deep: #0c1412;
  --bg-mid: #143028;
  --ink: #e8f0ea;
  --ink-muted: #9db5a8;
  --accent: #d4a85a;
  --accent-hot: #e07a4f;
  --line: rgba(232, 240, 234, 0.14);
  --choice: rgba(20, 48, 40, 0.72);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "IBM Plex Sans", system-ui, sans-serif;
  --timer-ms: 10000ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg-deep);
  min-height: 100vh;
  overflow-x: hidden;
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 55% at 70% -10%, rgba(212, 168, 90, 0.22), transparent 55%),
    radial-gradient(ellipse 60% 50% at 10% 90%, rgba(224, 122, 79, 0.16), transparent 50%),
    linear-gradient(165deg, #0a1210 0%, #143028 45%, #0c1412 100%);
  animation: drift 18s ease-in-out infinite alternate;
}

.atmosphere::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  mix-blend-mode: soft-light;
}

@keyframes drift {
  from {
    transform: scale(1) translate(0, 0);
  }
  to {
    transform: scale(1.06) translate(-1.5%, 1%);
  }
}

.shell {
  position: relative;
  z-index: 1;
  width: min(560px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(1.5rem, 5vh, 3rem) 0 3rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.75rem;
}

.brand {
  text-align: center;
  animation: fade-up 0.7s ease both;
}

.brand-name {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-tag {
  margin: 0.55rem 0 0;
  color: var(--ink-muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.panel {
  background: linear-gradient(180deg, rgba(16, 32, 28, 0.88), rgba(10, 20, 18, 0.92));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: clamp(1.4rem, 4vw, 2rem);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  animation: fade-up 0.65s ease both;
}

.hidden {
  display: none !important;
}

.start-title,
.end-title {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 4.5vw, 1.85rem);
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.start-copy,
.end-text {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
  line-height: 1.55;
  font-size: 1.02rem;
}

.end-kicker {
  margin: 0 0 0.4rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.play-panel {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.timer-wrap {
  height: 4px;
  border-radius: 999px;
  background: rgba(232, 240, 234, 0.1);
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  background: linear-gradient(90deg, var(--accent), var(--accent-hot));
  border-radius: inherit;
}

.timer-bar.running {
  animation: drain var(--timer-ms) linear forwards;
}

.timer-bar.paused {
  animation-play-state: paused;
}

@keyframes drain {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

.timer-label {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
}

.scene-text {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 4.2vw, 1.7rem);
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: -0.015em;
  min-height: 4.2em;
  white-space: pre-line;
}

.scene-text.enter {
  animation: scene-in 0.45s ease both;
}

@keyframes scene-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.choices {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.35rem;
}

.choices.reveal {
  animation: fade-up 0.4s ease both;
}

.btn {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--choice);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  padding: 0.95rem 1.1rem;
  text-align: left;
  cursor: pointer;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  border-color: rgba(212, 168, 90, 0.55);
  background: rgba(28, 58, 48, 0.9);
  outline: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn.primary {
  background: linear-gradient(135deg, #c9943f, #d46a42);
  border-color: transparent;
  color: #1a120c;
  font-weight: 600;
  text-align: center;
  width: 100%;
}

.btn.primary:hover,
.btn.primary:focus-visible {
  background: linear-gradient(135deg, #d4a85a, #e07a4f);
  border-color: transparent;
}

.btn.choice:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.status {
  margin: 0.25rem 0 0;
  min-height: 1.4em;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 500;
}

.status.timeout {
  color: var(--accent-hot);
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 480px) {
  .shell {
    justify-content: flex-start;
    padding-top: 2rem;
  }

  .brand-name {
    font-size: 2.2rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere,
  .panel,
  .brand,
  .scene-text.enter,
  .choices.reveal,
  .timer-bar.running {
    animation: none !important;
  }

  .timer-bar.running {
    transition: transform var(--timer-ms) linear;
    transform: scaleX(0);
  }
}
