:root {
  --bg: #070707;
  --panel: rgba(14, 12, 12, 0.88);
  --red: #d1122b;
  --red-bright: #ff2a45;
  --red-deep: #6e0613;
  --text: #f3ecec;
  --text-dim: #b9a9ab;
  --line: rgba(209, 18, 43, 0.45);

  --font-display: "Bebas Neue", "Impact", "Arial Narrow", sans-serif;
  --font-body: "Zen Maru Gothic", "Segoe UI", system-ui, sans-serif;
  --font-brush: "Yuji Syuku", "Noto Serif JP", serif;
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  color: inherit;
}

/* ---------- Background layers ---------- */

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

.bg__glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 45% at 50% 110%, rgba(209, 18, 43, 0.45), transparent 70%),
    radial-gradient(ellipse 50% 35% at 85% -10%, rgba(110, 6, 19, 0.55), transparent 70%),
    radial-gradient(ellipse 40% 30% at 0% 20%, rgba(110, 6, 19, 0.35), transparent 70%);
  animation: glow-breathe 9s ease-in-out infinite alternate;
}

@keyframes glow-breathe {
  from { opacity: 0.75; }
  to { opacity: 1; }
}

.bg__halftone {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(209, 18, 43, 0.22) 1px, transparent 1.4px);
  background-size: 14px 14px;
  mask-image: linear-gradient(160deg, transparent 35%, #000 100%);
  -webkit-mask-image: linear-gradient(160deg, transparent 35%, #000 100%);
  opacity: 0.7;
}

.bg__watermark {
  position: absolute;
  right: max(2vw, 8px);
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  font-family: var(--font-brush);
  font-size: clamp(5rem, 22vh, 13rem);
  line-height: 1;
  color: rgba(209, 18, 43, 0.09);
  letter-spacing: 0.08em;
  user-select: none;
}

.bg__particles {
  position: absolute;
  inset: 0;
}

.petal {
  position: absolute;
  top: 0;
  left: 0;
  width: 14px;
  height: 10px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, var(--red-bright), var(--red-deep));
  opacity: 0.75;
  will-change: transform;
}

.petal--ember {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #ff5a3c;
  box-shadow: 0 0 8px 2px rgba(255, 60, 40, 0.7);
}

.bg__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 45%, rgba(0, 0, 0, 0.85) 100%);
}

/* ---------- HUD ---------- */

.hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 18px 0;
  pointer-events: none;
}

.progress {
  display: flex;
  gap: 6px;
}

.progress__seg {
  width: 26px;
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  transform: skewX(-25deg);
  transition: background 0.4s, box-shadow 0.4s;
}

.progress__seg.is-active {
  background: var(--red);
  box-shadow: 0 0 10px rgba(209, 18, 43, 0.8);
}

.music-toggle {
  position: absolute;
  top: max(10px, env(safe-area-inset-top));
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(10, 10, 10, 0.7);
  display: grid;
  place-items: center;
  cursor: pointer;
  pointer-events: auto;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.music-toggle[hidden] {
  display: none;
}

.music-toggle:hover {
  border-color: var(--red-bright);
  box-shadow: 0 0 14px rgba(209, 18, 43, 0.6);
}

.eq {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 16px;
}

.eq i {
  width: 3px;
  height: 100%;
  background: var(--red-bright);
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}

.eq i:nth-child(2) { animation-delay: -0.3s; }
.eq i:nth-child(3) { animation-delay: -0.6s; }
.eq i:nth-child(4) { animation-delay: -0.15s; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.25); }
  50% { transform: scaleY(1); }
}

.music-toggle.is-muted .eq i {
  animation: none;
  transform: scaleY(0.2);
  background: var(--text-dim);
}

/* ---------- Screens ---------- */

.app {
  position: relative;
  z-index: 10;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 64px 18px max(24px, env(safe-area-inset-bottom));
  overflow-y: auto;
}

.screen {
  position: relative;
  width: min(560px, 100%);
  padding: clamp(22px, 5vw, 38px) clamp(20px, 5vw, 40px) clamp(26px, 5vw, 40px);
  background: var(--panel);
  border: 1px solid var(--line);
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 26px 100%, 0 calc(100% - 26px));
  text-align: center;
}

/* Red corner accents on the panel. */
.screen::before,
.screen::after {
  content: "";
  position: absolute;
  width: 46px;
  height: 46px;
  pointer-events: none;
}

.screen::before {
  top: 0;
  left: 0;
  border-top: 3px solid var(--red);
  border-left: 3px solid var(--red);
}

.screen::after {
  right: 0;
  bottom: 0;
  border-right: 3px solid var(--red);
  border-bottom: 3px solid var(--red);
}

.lottie-slot {
  width: clamp(130px, 36vw, 200px);
  aspect-ratio: 1;
  margin: 0 auto 10px;
  background: radial-gradient(circle, rgba(209, 18, 43, 0.22) 0%, transparent 65%);
}

.line {
  display: block;
}

.line:empty {
  height: 0.9em;
}

.kicker {
  display: inline-block;
  margin: 0 0 12px;
  padding: 3px 14px 1px;
  font-family: var(--font-display);
  font-size: 1rem;
  letter-spacing: 0.28em;
  color: var(--text);
  background: var(--red);
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.6rem, 9vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 3px 3px 0 var(--red-deep), 0 0 24px rgba(209, 18, 43, 0.55);
}

h2.title {
  font-size: clamp(2.1rem, 8vw, 3rem);
}

.text {
  margin: 0 0 18px;
  font-size: clamp(1rem, 3.6vw, 1.12rem);
  line-height: 1.75;
  color: var(--text-dim);
  white-space: pre-line;
}

.question {
  margin: 0 0 24px;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  white-space: pre-line;
}

.question::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 14px auto 0;
  background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.hint {
  margin: 16px 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(185, 169, 171, 0.6);
}

/* ---------- Buttons ---------- */

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 14px 18px;
}

.btn {
  position: relative;
  min-width: 150px;
  padding: 14px 28px 12px;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.12em;
  cursor: pointer;
  isolation: isolate;
  touch-action: manipulation;
  user-select: none;
}

/* Skewed background drawn on a pseudo-element so GSAP transforms on the button stay clean. */
.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  transform: skewX(-12deg);
  transition: background 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.btn--primary::before {
  background: linear-gradient(135deg, var(--red-bright), var(--red));
  box-shadow: 0 0 0 1px rgba(255, 80, 100, 0.4), 0 8px 26px rgba(209, 18, 43, 0.45);
}

.btn--primary:hover::before,
.btn--primary:focus-visible::before {
  box-shadow: 0 0 0 1px rgba(255, 120, 135, 0.7), 0 0 34px rgba(255, 42, 69, 0.75);
}

.btn--ghost::before {
  background: rgba(10, 10, 10, 0.6);
  border: 1px solid var(--line);
}

.btn--ghost:hover::before,
.btn--ghost:focus-visible::before {
  border-color: var(--red-bright);
  background: rgba(209, 18, 43, 0.15);
}

.btn:focus-visible {
  outline: none;
}

.btn--big {
  font-size: 1.6rem;
  padding: 16px 34px 14px;
}

.btn--runaway {
  z-index: 50;
}

/* Once the "no" button starts running it is moved to <body> as a fixed element. */
.btn--runaway.is-free {
  position: fixed;
  top: 0;
  left: 0;
  margin: 0;
  white-space: nowrap;
}

.runaway-placeholder {
  display: inline-block;
  visibility: hidden;
}

.link-btn {
  display: inline-block;
  margin-top: 22px;
  text-decoration: none;
  color: var(--text);
}

/* ---------- Transition wipe ---------- */

.wipe {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
  overflow: hidden;
}

.wipe__bar {
  position: absolute;
  left: -25%;
  width: 150%;
  height: 60%;
  transform: scaleX(0);
}

.wipe__bar--a {
  top: -5%;
  background: var(--red);
}

.wipe__bar--b {
  bottom: -5%;
  background: #0d0d0d;
  border-top: 4px solid var(--red-bright);
}

/* ---------- Heart burst ---------- */

.burst {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}

.burst__heart {
  position: absolute;
  top: 0;
  left: 0;
  font-size: 22px;
  line-height: 1;
  color: var(--red-bright);
  text-shadow: 0 0 10px rgba(255, 42, 69, 0.8);
  will-change: transform, opacity;
}

/* ---------- Small screens ---------- */

@media (max-width: 480px) {
  .btn {
    min-width: 130px;
    font-size: 1.2rem;
    padding: 12px 22px 10px;
  }

  .btn--big {
    font-size: 1.35rem;
  }

  .text {
    line-height: 1.6;
  }

  .progress__seg {
    width: 18px;
  }

  .bg__watermark {
    opacity: 0.7;
  }
}

@media (max-height: 640px) {
  .lottie-slot {
    width: clamp(100px, 24vh, 150px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bg__glow,
  .eq i {
    animation: none;
  }
}
