@font-face {
  font-family: "Lilita One";
  src: url("fonts/LilitaOne-Regular.ttf") format("truetype");
  font-display: swap;
}

/* Layout: the page is the table from the player's seat. The felt deals the
   hero; each band below lays one of the game's objects out on the cloth.
   Colors are the game's own constants (casino_art.gd, card_renderer.gd,
   table_felt_preview.gd); per-object colors arrive with the exported data. */
:root {
  --night: #070d0a;
  --night-2: #0d1612;
  --felt: #094a2b;
  --rail: #4a2716;
  --gold: #f0ba42;
  --gold-deep: #a97a1d;
  --stock: #f7f5eb;
  --stock-edge: #b8ad94;
  --ink-red: #b80e12;
  --ink-black: #0e1013;
  --ink: #ece8dc;
  --muted: #a6afa5;
  --pts: #5fb8ff;
  --mlt: #ff6a5c;
  --display: "Lilita One", "Arial Rounded MT Bold", system-ui, sans-serif;
  --print: "Alfa Slab One", Rockwell, Georgia, serif;
  --body: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;
  --card-w: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--night);
  color: var(--ink);
  font: 17px/1.6 var(--body);
}
img, video { max-width: 100%; display: block; }
a { color: var(--gold); }
h1, h2, h3, .btn { font-family: var(--display); font-weight: 400; text-wrap: balance; }
h1 {
  font-size: clamp(2.6rem, 6.5vw, 4.4rem);
  line-height: .95;
  margin: .35em 0 .1em;
  color: var(--gold);
  text-transform: uppercase;
  text-shadow: 0 3px 0 var(--gold-deep), 0 10px 30px rgba(0,0,0,.6);
}
h2 { font-size: clamp(1.9rem, 4.4vw, 2.7rem); line-height: 1.05; color: var(--gold); margin: 0; }
h3 { margin: 0; }

.btn {
  display: inline-block;
  padding: .65em 1.4em;
  border-radius: 12px;
  font-size: 1.15rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  transition: transform .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:focus-visible, button:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.btn-gold {
  background: linear-gradient(#f6d37a, var(--gold));
  color: #2a1a05;
  box-shadow: 0 4px 0 var(--gold-deep), 0 12px 24px rgba(0,0,0,.4);
}
.btn-ghost {
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(236,232,220,.35);
}
.linkish { all: unset; cursor: pointer; color: var(--gold); text-decoration: underline; }

/* ---------------------------------------------------------------- hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 470px);
  gap: clamp(28px, 5vw, 64px);
  align-items: center;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 72px) 20px;
}
.hero-copy { min-width: 0; }
.hero-icon { border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.tagline {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--muted);
  margin: 0 0 1.1em;
}
.lede { font-size: 1.12rem; max-width: 32em; margin: 0; }
.cta { display: flex; flex-wrap: wrap; gap: 14px; margin: 1.5em 0 .9em; }
.status { color: var(--muted); font-size: .95rem; margin: 0; }

/* The felt: the cloth, a printed arc, the dealer above and the player below,
   the way the game lays a Hand out. */
.felt {
  --card-w: 66px;
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 18px 16px 22px;
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(255,255,255,.10), transparent 60%),
    radial-gradient(ellipse at 50% 120%, rgba(0,0,0,.45), transparent 60%),
    var(--felt-color, var(--felt));
  box-shadow: inset 0 0 0 2px rgba(240,186,66,.22), inset 0 0 60px rgba(0,0,0,.45),
    0 24px 60px rgba(0,0,0,.55);
  min-height: 560px;
  transition: background-color .4s ease;
}
.felt-print { width: 92%; height: auto; margin-bottom: -26px; }
.felt-print text {
  font-family: var(--print);
  font-size: 22px;
  letter-spacing: .06em;
  fill: rgba(240,230,200,.78);
}
.felt-rule {
  margin: 0 0 6px;
  font-family: var(--print);
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(240,230,200,.6);
}
.hand { display: flex; justify-content: center; min-height: calc(var(--card-w) * 1.4); }
.hand .card + .card { margin-left: calc(var(--card-w) * -0.42); }
.outcome {
  margin: 0;
  min-height: 1.4em;
  font-family: var(--display);
  font-size: 1.6rem;
  color: var(--gold);
  text-shadow: 0 2px 0 var(--gold-deep), 0 0 24px rgba(240,186,66,.5);
  text-transform: uppercase;
}
.score-pill {
  display: grid;
  justify-items: center;
  padding: 4px 14px 6px;
  border-radius: 10px;
  background: #0b1210;
  box-shadow: inset 0 0 0 2px #2fd47a55;
  font-variant-numeric: tabular-nums;
}
.pill-label { font-family: var(--display); font-size: .62rem; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
.pill-math { font-family: var(--display); font-size: 1.7rem; line-height: 1.1; display: flex; gap: .3em; align-items: baseline; }
.pill-math i { font-style: normal; color: var(--muted); font-size: 1.1rem; }
.pts { color: var(--pts); }
.mlt { color: var(--mlt); }
.tot { color: #fff; }
.score-pill.bump { animation: bump .25s ease; }
@keyframes bump { 50% { transform: scale(1.08); } }
.rack { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.rack .chip { --size: 54px; }
.rack .chip.fire { animation: fire .5s ease; }
@keyframes fire { 40% { transform: translateY(-10px) scale(1.12); filter: brightness(1.3); } }
.score-line {
  margin: 0;
  min-height: 1.6em;
  font-size: .9rem;
  color: rgba(236,232,220,.85);
  text-align: center;
}

/* --------------------------------------------------------------- cards */
.card {
  --w: var(--card-w);
  position: relative;
  flex: none;
  width: var(--w);
  aspect-ratio: 96 / 134;
  border-radius: calc(var(--w) * .085);
  background: var(--card-stock, var(--stock));
  box-shadow: inset 0 0 0 1.5px var(--card-edge, var(--stock-edge)), 0 5px 10px rgba(0,0,0,.45);
  color: var(--ink-black);
  font-family: var(--body);
  font-weight: 700;
}
.card.red { color: var(--ink-red); }
.card .corner {
  position: absolute;
  top: 5%;
  left: 8%;
  display: grid;
  justify-items: center;
  line-height: .95;
  font-size: calc(var(--w) * .22);
}
.card .corner small { font-size: .8em; }
.card .corner.bottom { top: auto; left: auto; bottom: 5%; right: 8%; transform: rotate(180deg); }
.card .pip {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: calc(var(--w) * .5);
  line-height: 1;
}
.card.face .pip { font-family: var(--display); font-weight: 400; font-size: calc(var(--w) * .46); }
/* Backs: the Table's design colors, hatched like the house lattice. */
.card.back {
  background:
    radial-gradient(circle, var(--back-trim) 0 9%, var(--back-body) 9.5% 16%, var(--back-trim) 16.5% 19%, transparent 19.5%),
    repeating-linear-gradient(45deg, transparent 0 5px, color-mix(in srgb, var(--back-trim) 22%, transparent) 5px 6px),
    repeating-linear-gradient(-45deg, transparent 0 5px, color-mix(in srgb, var(--back-trim) 22%, transparent) 5px 6px),
    var(--back-body);
  box-shadow: inset 0 0 0 3px var(--back-body), inset 0 0 0 4.5px var(--back-trim), 0 5px 10px rgba(0,0,0,.45);
}
.deal-in { animation: deal .32s cubic-bezier(.2,.8,.2,1) both; }
@keyframes deal { from { transform: translate(40px, -160px) rotate(-14deg); opacity: 0; } }
.flip { animation: flip .3s ease both; }
@keyframes flip { 0% { transform: scaleX(1); } 50% { transform: scaleX(0); } 100% { transform: scaleX(1); } }

/* --------------------------------------------------------------- chips */
.chip {
  --size: 64px;
  --b: #126140; --b2: #1a7a52; --a: #f2c240; --t: #ebe3c7;
  position: relative;
  flex: none;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  background:
    radial-gradient(circle, #090b0c 0 36%, var(--a) 36.5% 38.5%, var(--b2) 39% 60%, var(--t) 60.5% 62%, transparent 62.5%),
    radial-gradient(circle, transparent 0 84%, var(--a) 84.5% 90%, transparent 90.5%),
    repeating-conic-gradient(var(--t) 0 15deg, transparent 15deg 30deg),
    var(--b);
  box-shadow: 0 4px 0 color-mix(in srgb, var(--b) 40%, black), 0 8px 14px rgba(0,0,0,.5);
  display: grid;
  place-items: center;
  font-family: var(--display);
  color: #f7f5e6;
  font-size: calc(var(--size) * .26);
  text-shadow: 0 1px 2px #000, 0 0 2px #000;
}
.chip .tier {
  position: absolute;
  bottom: 9%;
  font-size: .42em;
  letter-spacing: .06em;
}

/* --------------------------------------------------------------- bands */
.band { max-width: 1120px; margin: 0 auto; padding: clamp(48px, 7vw, 88px) 20px 0; }
.band-head { display: grid; gap: 10px; max-width: 40em; margin-bottom: 28px; }
.band-head p { margin: 0; color: var(--muted); font-size: 1.08rem; }

.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.table-tile {
  --card-w: 34px;
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px 18px 20px;
  border-radius: 20px;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(255,255,255,.1), transparent 70%),
    var(--tile-felt);
  box-shadow: inset 0 0 0 2px rgba(240,186,66,.2), inset 0 0 40px rgba(0,0,0,.4);
  text-align: center;
  cursor: pointer;
}
.table-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.table-tile:hover { filter: brightness(1.08); }
.table-tile[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--gold), inset 0 0 40px rgba(0,0,0,.4); }
.table-tile h3 { font-family: var(--print); font-weight: 400; font-size: 1.35rem; color: var(--gold); letter-spacing: .04em; text-transform: uppercase; }
.shoe { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; min-height: 52px; align-content: center; }
.shoe .card { box-shadow: inset 0 0 0 2px var(--back-body), inset 0 0 0 3px var(--back-trim), 0 3px 5px rgba(0,0,0,.4); }
.rules { list-style: none; margin: 0; padding: 0; font-family: var(--print); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(240,230,200,.8); }
.table-tile p { margin: 0; font-size: .92rem; color: rgba(236,232,220,.85); }

.ladder { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ladder li {
  display: grid;
  gap: 2px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--night-2);
  box-shadow: inset 0 0 0 1px rgba(240,186,66,.18);
}
.ladder .name { font-family: var(--display); font-size: 1.25rem; }
.ladder .math { font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.ladder .math i { font-style: normal; color: var(--muted); font-size: 1rem; margin: 0 .25em; }
.ladder li.top { box-shadow: inset 0 0 0 2px var(--gold); }
.ladder li.top .name { color: var(--gold); }

.tier-switch { display: flex; gap: 8px; margin-bottom: 22px; }
.tier-switch button {
  all: unset;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--display);
  background: var(--night-2);
  box-shadow: inset 0 0 0 2px var(--tc);
}
.tier-switch button[aria-checked="true"] { background: var(--tc); color: var(--tcf); }
.chip-groups { display: grid; gap: 26px; }
.chip-group h3 { font-family: var(--display); font-weight: 400; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.chip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px 20px; }
.chip-item { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; min-width: 0; }
.chip-item b { display: block; font-weight: 700; }
.chip-item span { color: var(--muted); font-size: .95rem; }

.treatments { --card-w: 72px; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px 20px; }
.treat { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; min-width: 0; }
.treat .card .tag {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  font-family: var(--display);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--card-edge);
}
.treat b { display: block; }
.treat span { color: var(--muted); font-size: .95rem; }

.traits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.family { display: grid; gap: 10px; align-content: start; }
.family h3 { font-family: var(--display); font-weight: 400; font-size: 1rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.trait {
  padding: 12px 14px;
  border-radius: 12px;
  background: #121513;
  box-shadow: inset 0 0 0 1px #2b302d;
}
.trait b { display: flex; justify-content: space-between; gap: 8px; color: #ff9b8f; font-family: var(--display); font-weight: 400; font-size: 1.05rem; text-transform: uppercase; letter-spacing: .03em; }
.trait p { margin: 4px 0 0; font-size: .92rem; color: var(--ink); }
.pressure { display: inline-flex; gap: 3px; align-items: center; }
.pressure i { width: 8px; height: 8px; border-radius: 50%; background: #3a403c; }
.pressure i.on { background: #ff6a5c; }

.plaques { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.plaque {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 18px;
  border-radius: 14px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--pa) 18%, #17140e), #100e0a);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--pa) 65%, transparent), 0 10px 24px rgba(0,0,0,.35);
}
.plaque .badge {
  justify-self: start;
  padding: 3px 12px;
  border-radius: 6px;
  font-family: var(--display);
  letter-spacing: .1em;
  color: #120f08;
  background: var(--pa);
}
.plaque h3 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; color: var(--ink); }
.plaque p { margin: 0; color: var(--muted); font-size: .95rem; }
.plaque ol { margin: 0; padding-left: 1.6em; font-size: .9rem; display: grid; gap: 4px; }
.plaque ol li::marker { font-family: var(--display); color: var(--pa); }

/* ---------------------------------------------------------------- play */
.play {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  max-width: 1120px;
  margin: clamp(56px, 8vw, 96px) auto 0;
  padding: 0 20px;
}
.play-copy { display: grid; gap: 12px; align-content: start; min-width: 0; }
.play-copy p { margin: 0; color: var(--muted); }
.watch { margin: 18px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: end; }
.watch video { height: min(360px, 60vh); width: auto; aspect-ratio: 720 / 1560; border-radius: 14px; background: #000; }
.watch figcaption { color: var(--muted); font-size: .92rem; max-width: 18em; }
/* The game draws its own rail, so the frame adds none. */
.play-frame {
  height: min(820px, 88vh);
  aspect-ratio: 9 / 19.5;
  max-width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
}
.play-frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.play-frame:fullscreen { height: 100%; width: 100%; border-radius: 0; }
.play-start { all: unset; cursor: pointer; position: relative; display: grid; place-items: center; width: 100%; height: 100%; }
.play-start img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: brightness(.4) saturate(.85); }
.play-start .btn { position: relative; font-size: 1.4rem; }
.play-note { position: absolute; bottom: 22px; color: var(--muted); font-size: .9rem; }

footer { text-align: center; color: var(--muted); padding: 56px 16px 32px; font-size: .9rem; }

@media (max-width: 820px) {
  .hero { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .hero-icon { margin: 0 auto; }
  .lede { margin: 0 auto; }
  .cta { justify-content: center; }
  .felt { --card-w: 58px; min-height: 0; }
  .play { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; }
  .watch { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .watch figcaption { text-align: center; }
  .play-frame { height: auto; width: min(100%, 400px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .deal-in, .flip, .chip.fire, .score-pill.bump { animation: none; }
  .btn { transition: none; }
}

.outro { text-align: center; padding-bottom: 24px; }
.outro .cta { justify-content: center; }
