:root {
  --bg: #12080c;
  --velvet: #6b1024;
  --gold: #f2c56b;
  --cream: #f7f0e4;
  --ink: #1a0c10;
  --free: #d6ff4a;
  --display: "Anton", Impact, sans-serif;
  --text: "Literata", Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--cream);
}

body {
  min-height: 100%;
  font-family: var(--text);
  background:
    radial-gradient(ellipse 80% 55% at 50% 18%, #3a1520 0%, transparent 58%),
    var(--bg);
  overflow-x: hidden;
}

body.shake {
  animation: shake 0.45s linear;
}

@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-7px, 2px); }
  40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, 3px); }
  80% { transform: translate(3px, -1px); }
}

#fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.beam {
  position: fixed;
  z-index: 1;
  left: 28%;
  top: -30vh;
  width: 42vw;
  height: 150vh;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(242, 197, 107, 0.14), transparent);
  transform-origin: top center;
  animation: sweep 8s ease-in-out infinite alternate;
}

@keyframes sweep {
  from { transform: rotate(-16deg); }
  to { transform: rotate(16deg); }
}

.glow {
  position: fixed;
  z-index: 1;
  width: 320px;
  height: 320px;
  margin: -160px 0 0 -160px;
  left: 50%;
  top: 30%;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle, rgba(242, 197, 107, 0.28), transparent 68%);
  mix-blend-mode: screen;
}

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

.curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent 28%, rgba(0, 0, 0, 0.28)),
    repeating-linear-gradient(90deg, #3d0a16 0px, #8a1c38 14px, #4a1020 22px, #2a0810 36px);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.45);
}

.curtain.left {
  left: 0;
  animation: curtain-left 1.7s cubic-bezier(0.7, 0, 0.2, 1) 0.25s forwards;
}

.curtain.right {
  right: 0;
  animation: curtain-right 1.7s cubic-bezier(0.7, 0, 0.2, 1) 0.25s forwards;
}

@keyframes curtain-left {
  to { transform: translateX(-105%); }
}

@keyframes curtain-right {
  to { transform: translateX(105%); }
}

.stage {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.6rem;
  padding: 7vh 1.1rem 5.5rem;
}

.floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2.4rem;
  height: 90px;
  pointer-events: none;
  background: repeating-linear-gradient(90deg, #3d291c 0 16px, #2a1a10 16px 18px);
  mask-image: linear-gradient(transparent, #000 55%);
  opacity: 0.9;
}

.sign {
  width: min(40rem, 100%);
  padding: 0.7rem 0.75rem 0.85rem;
  background: #1a0c10;
  border-radius: 14px;
  transform-style: preserve-3d;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.45),
    inset 0 0 0 2px #6a4a1e;
  transition: transform 0.12s linear;
}

.sign-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.35rem;
  align-items: stretch;
}

.sign-face {
  text-align: center;
  padding: 0.2rem 0.4rem 0.6rem;
}

.eyebrow {
  margin: 0.35rem 0 0;
  font-family: var(--display);
  letter-spacing: 0.22em;
  font-size: 0.78rem;
  color: var(--gold);
}

h1 {
  margin: 0.1rem 0 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4.6rem, 18vw, 8.4rem);
  line-height: 0.82;
  letter-spacing: 0.04em;
  color: var(--cream);
  text-shadow: 0 0 22px rgba(242, 197, 107, 0.45);
}

.letter {
  display: inline-block;
  animation: drop 0.85s cubic-bezier(0.18, 1.25, 0.4, 1) backwards;
}

.letter:nth-child(1) { animation-delay: 1.55s; }
.letter:nth-child(2) { animation-delay: 1.68s; }
.letter:nth-child(3) { animation-delay: 1.81s; }
.letter:nth-child(4) { animation-delay: 1.94s; }

@keyframes drop {
  0% { opacity: 0; transform: translateY(-70%) rotate(-8deg); }
  100% { opacity: 1; transform: none; }
}

.with {
  margin: 0.35rem 0 0;
  font-size: 1.15rem;
  color: #eadcc8;
  animation: rise 0.8s ease 2.15s backwards;
}

.with em { color: var(--gold); }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.bulbs {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}

.bulbs.side {
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0;
}

.bulbs i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff6d0;
  box-shadow: 0 0 8px 2px rgba(242, 197, 107, 0.85);
  animation: blink 0.9s steps(2, end) infinite;
}

@keyframes blink {
  0%, 40% { opacity: 1; background: #fff6d0; }
  50%, 100% { opacity: 0.28; background: #6a5428; box-shadow: none; }
}

.lower {
  width: min(56rem, 100%);
  display: grid;
  gap: 1.4rem;
  justify-items: center;
  align-items: center;
}

@media (min-width: 860px) {
  .lower {
    grid-template-columns: 1fr minmax(15rem, auto) 1fr;
  }
}

@media (max-width: 520px) {
  h1 { font-size: clamp(3.5rem, 24vw, 5.2rem); }
  .stage { padding-left: 0.7rem; padding-right: 0.7rem; }
  .receipt { width: 100%; }
  .receipt li { font-size: 0.92rem; }
}

.receipt {
  width: min(20rem, 100%);
  background: var(--cream);
  color: var(--ink);
  padding: 0.9rem 1rem 1rem;
  transform: rotate(-1.4deg);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  background-image: radial-gradient(circle at 8px 0, transparent 7px, #f7f0e4 8px);
  background-size: 16px 12px;
  background-repeat: repeat-x;
}

.receipt-shop {
  margin: 0.35rem 0 0;
  text-align: center;
  font-family: var(--display);
  letter-spacing: 0.14em;
  font-size: 0.95rem;
}

.receipt-rule {
  margin: 0.15rem 0 0.45rem;
  text-align: center;
  font-style: italic;
  border-bottom: 1px dashed #1a0c10;
  padding-bottom: 0.35rem;
}

.receipt ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.receipt li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.18rem 0;
  font-size: 0.98rem;
}

.receipt li.total {
  margin-top: 0.25rem;
  border-top: 1px solid #1a0c10;
  font-weight: 700;
  font-size: 1.15rem;
}

body.live .line {
  opacity: 0;
  transform: translateY(8px);
}

body.live .line.on {
  opacity: 1;
  transform: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.receipt-foot {
  margin: 0.55rem 0 0;
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
}

.book-block {
  display: grid;
  justify-items: center;
  gap: 0.8rem;
  perspective: 900px;
}

.book {
  width: 148px;
  height: 200px;
  position: relative;
}

.page, .cover {
  position: absolute;
  inset: 0;
  border-radius: 2px 6px 6px 2px;
}

.page {
  background: #f3ead8;
  color: #3a2418;
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
  font-style: italic;
  font-size: 0.95rem;
  box-shadow: inset 0 0 0 8px #e4d7c0;
}

.cover {
  background:
    linear-gradient(90deg, #3d0a16 0 12px, transparent 12px),
    linear-gradient(#7a1830, #4a0d1c);
  color: var(--gold);
  transform-origin: left center;
  transform: rotateY(-148deg);
  transition: transform 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-shadow: 8px 12px 24px rgba(0, 0, 0, 0.35);
  backface-visibility: hidden;
}

.book.shut .cover { transform: rotateY(0deg); }

.cover strong {
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 400;
  letter-spacing: 0.06em;
}

.cover-kicker, .cover-foot {
  font-family: var(--display);
  letter-spacing: 0.16em;
  font-size: 0.62rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
}

button {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  color: var(--ink);
  background: var(--gold);
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

button:active { transform: translateY(1px); }

#flute {
  background: transparent;
  color: var(--gold);
  box-shadow: inset 0 0 0 1.5px var(--gold);
}

a.tome-link {
  font-family: var(--display);
  letter-spacing: 0.08em;
  font-size: 0.95rem;
  color: var(--free);
  text-decoration: none;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  box-shadow: inset 0 0 0 1.5px var(--free);
}

a.tome-link:hover {
  background: rgba(214, 255, 74, 0.12);
}

.free-block { text-align: center; max-width: 26rem; }

.free {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.2rem, 10vw, 5.2rem);
  line-height: 0.85;
  letter-spacing: 0.04em;
  color: var(--free);
  text-shadow: 0 0 18px rgba(214, 255, 74, 0.45);
  animation: pop 0.7s cubic-bezier(0.18, 1.3, 0.4, 1) 2.4s backwards;
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.6) rotate(-4deg); }
  to { opacity: 1; transform: none; }
}

.free-note {
  margin: 0.45rem 0 0.8rem;
  font-size: 0.95rem;
  color: #eadcc8;
  animation: rise 0.7s ease 2.7s backwards;
}

.cast {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 0;
}

@media (min-width: 860px) {
  .cast { flex-wrap: nowrap; }
}

.cast li {
  font-family: var(--display);
  letter-spacing: 0.08em;
  background: #1a0c10;
  color: var(--gold);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  box-shadow: 0 0 0 1px #6a4a1e, 0 0 12px rgba(242, 197, 107, 0.25);
  animation: flicker 0.35s steps(2, end) backwards;
}

.cast li:nth-child(1) { animation-delay: 3.1s; }
.cast li:nth-child(2) { animation-delay: 3.35s; }
.cast li:nth-child(3) { animation-delay: 3.6s; }
.cast li:nth-child(4) { animation-delay: 3.85s; }

@keyframes flicker {
  0% { opacity: 0; }
  40% { opacity: 1; }
  55% { opacity: 0.2; }
  100% { opacity: 1; }
}

.quote {
  margin: 0.4rem 0 0;
  text-align: center;
  min-height: 4.5rem;
}

.quote p {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  font-style: italic;
}

.quote footer {
  margin-top: 0.25rem;
  font-family: var(--display);
  letter-spacing: 0.16em;
  font-size: 0.78rem;
  color: var(--gold);
}

.quote.hide p,
.quote.hide footer {
  animation: quote-out 0.35s ease forwards;
}

@keyframes quote-out {
  to { opacity: 0; transform: translateY(-8px); }
}

.roll {
  position: relative;
  z-index: 2;
  height: 100vh;
  display: grid;
  place-items: center;
  padding-bottom: 2.4rem;
}

.roll-window {
  height: min(70vh, 36rem);
  overflow: hidden;
  mask-image: linear-gradient(transparent, #000 12%, #000 88%, transparent);
}

.roll-track {
  text-align: center;
  animation: roll 22s linear 1.2s both;
}

.roll-track p {
  margin: 0.35rem 0;
  font-family: var(--display);
  letter-spacing: 0.14em;
  font-size: clamp(1.4rem, 4vw, 2.1rem);
}

.roll-gap { margin-top: 2rem !important; color: var(--gold); }
.roll-end { margin-top: 2.2rem !important; color: var(--free); font-size: clamp(2.4rem, 7vw, 4rem) !important; }

@keyframes roll {
  from { transform: translateY(70%); }
  to { transform: translateY(-80%); }
}

.ticker {
  position: fixed;
  z-index: 30;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.15rem;
  overflow: hidden;
  background: var(--gold);
  color: var(--ink);
  display: flex;
  align-items: center;
}

.ticker-track {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  width: max-content;
  height: 100%;
  align-items: center;
  animation: ticker 18s linear infinite;
}

.ticker span {
  font-family: var(--display);
  letter-spacing: 0.12em;
  font-size: 1rem;
  white-space: nowrap;
  padding-left: 0.2rem;
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
  .curtains { display: none; }
  .letter, .with, .free, .free-note, .cast li, .line { opacity: 1; transform: none; }
  .book .cover { transform: rotateY(0deg); }
  .roll-track { transform: none; }
}
