:root {
  color-scheme: dark;
  --paper: #f2dfb3;
  --paper-muted: #bda982;
  --gold: #d8a83f;
  --gold-light: #ffe299;
  --ink: #0b0707;
  --panel: #17100f;
  --line: rgba(242, 223, 179, 0.22);
  --display: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 20% -10%, rgba(117, 31, 43, 0.34), transparent 34rem), var(--ink);
  color: var(--paper);
  font-family: var(--sans);
}
button, a { font: inherit; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 4px; }

.topbar {
  position: absolute;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: 1.25rem clamp(1.25rem, 5vw, 5rem);
}
.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  color: var(--paper);
  font-family: var(--display);
  text-decoration: none;
  text-transform: uppercase;
}
.wordmark-main { font-size: 1.05rem; font-weight: 800; letter-spacing: 0.08em; }
.wordmark-sub { color: var(--gold); font-size: 0.65rem; letter-spacing: 0.28em; }
.topbar-actions, .hero-actions, .game-toolbar, .game-toolbar > div { display: flex; align-items: center; gap: 1rem; }
.build-label, .availability { color: var(--paper-muted); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }

.button {
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  padding: 0.9rem 1.25rem;
  background: rgba(24, 15, 14, 0.86);
  color: var(--paper);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: 160ms ease;
}
.button:hover { border-color: var(--gold-light); transform: translateY(-2px); }
.button-small { padding: 0.65rem 0.9rem; font-size: 0.76rem; }
.button-primary {
  border-color: #e7c368;
  background: linear-gradient(135deg, #bd8433, #6b3d1e);
  box-shadow: 0 0.8rem 2.8rem rgba(0, 0, 0, 0.32);
  color: #fff9e8;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(18rem, 0.9fr) minmax(30rem, 1.1fr);
  align-items: center;
  min-height: 100svh;
  overflow: hidden;
  padding: 7.5rem clamp(1.25rem, 6vw, 7rem) 4rem;
  background: linear-gradient(90deg, rgba(11, 7, 7, 0.98), rgba(11, 7, 7, 0.82) 42%, rgba(11, 7, 7, 0.12)), radial-gradient(circle at 74% 30%, #7c482d, #301619 32%, #0b0707 70%);
  isolation: isolate;
}
.hero::after { position: absolute; inset: auto 0 0; z-index: -1; height: 24%; background: linear-gradient(transparent, var(--ink)); content: ""; }
.grain {
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0.18;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 4px 4px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}
.hero-copy { position: relative; z-index: 4; max-width: 42rem; }
.eyebrow { margin: 0 0 1rem; color: var(--gold-light); font-size: .72rem; font-weight: 900; letter-spacing: .22em; text-transform: uppercase; }
h1, h2, h3 { margin: 0; font-family: var(--display); }
h1 { max-width: 11ch; font-size: clamp(3.2rem, 7vw, 7.2rem); letter-spacing: -.06em; line-height: .88; text-wrap: balance; }
h2 { font-size: clamp(2.4rem, 5vw, 5.2rem); letter-spacing: -.045em; line-height: .94; }
h3 { font-size: clamp(1.6rem, 3vw, 2.5rem); }
.lead { max-width: 40rem; margin: 2rem 0; color: #dbc9a6; font-size: clamp(1rem, 1.6vw, 1.22rem); line-height: 1.7; }
.text-link { color: var(--paper); font-size: .85rem; font-weight: 700; text-underline-offset: .3rem; }
.availability { margin-top: 1.25rem; }

.hero-cast { position: relative; align-self: stretch; min-height: 38rem; }
.cast-card { position: absolute; bottom: 2%; width: min(28vw, 23rem); margin: 0; filter: drop-shadow(0 2rem 2rem rgba(0,0,0,.5)); }
.cast-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50% 50% 10% 10%;
  object-fit: cover;
  object-position: top center;
  mask-image: linear-gradient(#000 72%, transparent 99%);
}
.cast-card figcaption { position: absolute; right: 0; bottom: 10%; border: 1px solid rgba(255,226,153,.42); padding: .45rem .7rem; background: rgba(11,7,7,.84); color: var(--gold-light); font-family: var(--display); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; }
.cast-card-left { left: 0; z-index: 1; opacity: .62; transform: translate(-12%, -2%) rotate(-4deg) scale(.84); }
.cast-card-center { left: 50%; z-index: 3; transform: translateX(-52%) scale(1.12); }
.cast-card-right { right: -4%; z-index: 2; opacity: .72; transform: translateY(3%) rotate(4deg) scale(.88); }

.game-section, .instructions, .notice { width: min(90rem, calc(100% - 2rem)); margin: 0 auto; }
.game-section { padding: clamp(5rem, 10vw, 9rem) 0; }
.section-heading { display: grid; grid-template-columns: 1fr minmax(18rem, .55fr); align-items: end; gap: 3rem; margin-bottom: 2rem; }
.section-heading > p, .instructions-copy > p:last-child, .notice > p:last-child { color: var(--paper-muted); line-height: 1.65; }
.game-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  min-height: 24rem;
  overflow: hidden;
  border: 1px solid rgba(255,226,153,.33);
  border-radius: .5rem;
  background: linear-gradient(rgba(11,7,7,.68), rgba(11,7,7,.93)), url("./assets/timone.jpg") 50% 28% / cover;
  box-shadow: 0 2rem 7rem rgba(0,0,0,.55);
}
.game-stage:fullscreen { border: 0; border-radius: 0; background: #000; }
.game-placeholder, .game-loading { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; padding: 2rem; text-align: center; }
.game-placeholder > p:not(.eyebrow) { max-width: 35rem; color: var(--paper-muted); line-height: 1.6; }
.sigil { display: grid; width: 5rem; height: 5rem; margin-bottom: 1.5rem; place-items: center; border: 1px solid var(--gold); border-radius: 50%; color: var(--gold-light); font-family: var(--display); font-size: 1.4rem; }
.game-loading { gap: 1rem; background: #0b0707; }
.loader { width: 2.5rem; height: 2.5rem; border: 2px solid rgba(255,226,153,.2); border-top-color: var(--gold-light); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.game-frame { width: 100%; height: 100%; border: 0; background: #000; }
.game-toolbar { position: absolute; inset: auto 0 0; justify-content: space-between; padding: .65rem .9rem; background: rgba(11,7,7,.88); font-size: .72rem; opacity: 0; transition: opacity 160ms ease; }
.game-stage:hover .game-toolbar, .game-stage:focus-within .game-toolbar { opacity: 1; }
.game-toolbar button, .game-toolbar a { border: 0; padding: .35rem; background: transparent; color: var(--paper); cursor: pointer; text-decoration: underline; text-underline-offset: .2rem; }

.instructions { display: grid; grid-template-columns: minmax(18rem, .75fr) 1.25fr; gap: clamp(3rem, 8vw, 8rem); padding: 2rem 0 clamp(5rem, 10vw, 9rem); }
.instructions-copy > p:last-child { max-width: 38rem; }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin: 0; border: 1px solid var(--line); background: var(--line); }
.controls div { min-height: 9rem; padding: 1.5rem; background: var(--panel); }
.controls dt { color: var(--gold-light); font-family: var(--display); font-size: 1.1rem; font-weight: 800; }
.controls dd { margin: .65rem 0 0; color: var(--paper-muted); }
.notice { display: grid; grid-template-columns: 10rem 1fr; gap: 2rem; padding: 2rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
footer { display: flex; justify-content: space-between; gap: 2rem; padding: 3rem clamp(1.25rem, 5vw, 5rem); color: var(--paper-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
[hidden] { display: none !important; }

@media (max-width: 900px) {
  .build-label { display: none; }
  .hero { grid-template-columns: 1fr; align-items: end; padding-top: 9rem; }
  .hero-copy { z-index: 5; padding-top: 28rem; }
  .hero-cast { position: absolute; inset: 5rem 0 auto; min-height: 31rem; }
  .cast-card { width: min(48vw, 20rem); }
  .section-heading, .instructions { grid-template-columns: 1fr; }
  .game-stage { min-height: 0; }
}

@media (max-width: 620px) {
  .topbar { padding: 1rem; }
  .topbar .button { display: none; }
  .hero { padding-inline: 1rem; }
  .hero-copy { padding-top: 20rem; }
  .hero-cast { min-height: 24rem; }
  .cast-card figcaption, .cast-card-left { display: none; }
  .cast-card-center { left: 35%; width: 70vw; }
  .cast-card-right { right: -14%; width: 58vw; }
  .hero-actions, .game-toolbar { align-items: stretch; flex-direction: column; }
  .game-stage { aspect-ratio: 9 / 14; }
  .controls { grid-template-columns: 1fr; }
  .notice { grid-template-columns: 1fr; gap: 0; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
