/* ==========================================================================
   HOKM — title screen & site (palette/finish per DESIGN.md)
   Carbon black · alabaster · crimson. Nothing else.
   ========================================================================== */

:root {
  --bg: #312325;
  --surface: #3c2a2d;
  --card: #473336;
  --footer: #3f2c2f;

  --accent: #c82838;
  --accent-bright: #e6394a;
  --accent-glow: rgba(200, 40, 56, 0.22);
  --accent-subtle: rgba(200, 40, 56, 0.08);

  --border-subtle: rgba(245, 235, 236, 0.07);
  --border-medium: rgba(245, 235, 236, 0.13);
  --border-accent: rgba(200, 40, 56, 0.55);

  --text: #f5ebec;
  --muted: #987d81;
  --body: #ccbdc0;
  --tertiary: #a48b8f;

  --status: #d63646;
  --alert: #ff4757;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
  --fa: 'Vazirmatn', 'Inter', sans-serif;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);

  --shadow-card: inset 0 1px 0 rgba(245, 235, 236, 0.08), 0 4px 24px rgba(0, 0, 0, 0.55);
  --shadow-card-hover: inset 0 1px 0 rgba(245, 235, 236, 0.12), 0 12px 40px rgba(0, 0, 0, 0.65);
  --shadow-featured: 0 0 0 1px rgba(200, 40, 56, 0.55), 0 0 30px rgba(200, 40, 56, 0.16);

  --gutter: 40px;
  --cw: 96px; /* default card width; containers override and cards inherit */
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font: 400 16px/1.65 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.app-open { overflow: hidden; }
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
kbd { font: inherit; padding: 2px 7px; border-radius: 5px; border: 1px solid var(--border-medium); color: var(--text); }
::selection { background: rgba(200, 40, 56, 0.38); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 6px; }

/* Linen cardstock grain — non-negotiable */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0.04;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%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");
}

.mono { font-family: var(--mono); }
.dim { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.skip {
  position: fixed; top: 12px; left: 12px; z-index: 300;
  padding: 10px 16px; border-radius: 10px; background: var(--card); color: var(--text);
  transform: translateY(-160%); transition: transform 200ms var(--ease-out);
}
.skip:focus { transform: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }

.ico, .pip { flex: none; }
.pip path { fill: var(--pip-fill, none); }
[data-icon], [data-pip] { display: inline-grid; place-items: center; }

.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--text); }
.logo-word { font-weight: 800; font-size: 15px; letter-spacing: 0.16em; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--card); box-shadow: var(--shadow-card);
  color: var(--accent);
}
.logo-mark svg { width: 17px; height: 17px; }

/* ---------- Type ---------- */
.label { display: inline-block; font: 500 13px/1 var(--mono); color: var(--accent); letter-spacing: 0.06em; margin-bottom: 20px; }
.h2 { font-size: clamp(28px, 3vw, 44px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; color: var(--text); }
.h2.xl { font-size: clamp(40px, 5.6vw, 80px); letter-spacing: -0.045em; line-height: 0.98; }
.lead { font-size: 17px; line-height: 1.65; color: var(--body); margin-top: 20px; max-width: 520px; }
.ch-head.center .lead { margin-left: auto; margin-right: auto; }

/* ---------- Buttons ---------- */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 10px;
  border: 1px solid var(--border-medium);
  background: var(--surface);
  color: var(--text);
  font-size: 14px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2;
  white-space: nowrap; user-select: none;
  transition: transform 160ms var(--ease-out), border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, opacity 200ms ease;
}
.btn-sm { padding: 8px 18px; font-size: 13px; }
.btn-lg { padding: 16px 32px; font-size: 16px; }
.btn-block { width: 100%; }
.btn .arr { transition: transform 220ms var(--ease-out); }
.btn .arr svg { width: 16px; height: 16px; }
.btn-primary {
  border-color: var(--border-accent);
  box-shadow: 0 0 8px rgba(200, 40, 56, 0.4), 0 0 20px rgba(200, 40, 56, 0.16), 0 0 40px rgba(200, 40, 56, 0.06);
}
.btn-primary::after {
  content: ""; position: absolute; inset: -1px; z-index: -1;
  border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 8px rgba(200, 40, 56, 0.55), 0 0 20px rgba(200, 40, 56, 0.25), 0 0 40px rgba(200, 40, 56, 0.1);
  opacity: 0;
  animation: glow-breathe 2.8s ease-in-out infinite alternate;
}
@keyframes glow-breathe { to { opacity: 1; } }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.btn-primary:disabled::after { animation: none; opacity: 0; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:not(:disabled):hover {
    border-color: var(--accent-bright); transform: translateY(-1px);
    box-shadow: 0 0 10px rgba(230, 57, 74, 0.7), 0 0 26px rgba(230, 57, 74, 0.34), 0 0 56px rgba(230, 57, 74, 0.16);
  }
  .btn-secondary:not(:disabled):hover { border-color: rgba(245, 235, 236, 0.24); background-color: rgba(245, 235, 236, 0.035); }
  .btn:not(:disabled):hover .arr { transform: translateX(3px); }
  .btn:not(:disabled):active { transform: scale(0.97); }
}

/* ---------- Reveal (cards dealt onto felt) ---------- */
html.js [data-reveal] {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 600ms var(--ease-out), transform 600ms var(--ease-out);
  transition-delay: calc(var(--i, 0) * 90ms);
}
html.js [data-reveal="card"] { transform: translateY(28px) rotate(-1.5deg); transform-origin: 0% 100%; }
html.js [data-reveal].is-in { opacity: 1; transform: none; }
html.js [data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.12em; margin-bottom: -0.12em; }
html.js [data-split] .w > span { display: inline-block; transform: translateY(110%); transition: transform 800ms var(--ease-out); transition-delay: calc(var(--wi, 0) * 45ms); }
html.js [data-split].is-in .w > span { transform: none; }

/* ==========================================================================
   Playing cards — matte obsidian stock
   ========================================================================== */
.pcard {
  --suit: var(--text);
  --suit-line: rgba(245, 235, 236, 0.16);
  --pip-fill: rgba(245, 235, 236, 0.04);
  position: relative;
  width: var(--cw);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--cw) * 0.085);
  background: linear-gradient(155deg, #523b3f 0%, #473336 46%, #3c2b2e 100%);
  box-shadow: inset 0 1px 0 rgba(245, 235, 236, 0.1), inset 0 0 0 1px rgba(245, 235, 236, 0.035), 0 8px 24px rgba(0, 0, 0, 0.55);
  color: var(--suit);
  user-select: none; -webkit-user-select: none;
  overflow: hidden;
}
.pcard.is-red { --suit: var(--accent-bright); --suit-line: rgba(230, 57, 74, 0.3); --pip-fill: rgba(200, 40, 56, 0.1); }
.pcard::before {
  content: ""; position: absolute;
  inset: calc(var(--cw) * 0.06);
  border: 1px solid rgba(245, 235, 236, 0.05);
  border-radius: calc(var(--cw) * 0.05);
  pointer-events: none;
}
.pcard::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 0%), rgba(230, 57, 74, 0.22), rgba(245, 235, 236, 0.06) 28%, transparent 58%);
  opacity: var(--sheen, 0);
  transition: opacity 400ms ease;
}
.pc-idx { position: absolute; display: flex; flex-direction: column; align-items: center; gap: calc(var(--cw) * 0.025); line-height: 1; }
.pc-idx b { font-weight: 700; font-size: calc(var(--cw) * 0.19); letter-spacing: -0.05em; }
.pc-idx .pip { width: calc(var(--cw) * 0.13); height: calc(var(--cw) * 0.13); }
.pc-tl { top: calc(var(--cw) * 0.1); left: calc(var(--cw) * 0.1); }
.pc-br { bottom: calc(var(--cw) * 0.1); right: calc(var(--cw) * 0.1); transform: rotate(180deg); }
.pc-center { position: absolute; inset: 0; display: grid; place-items: center; }
.pc-pip-lg { width: calc(var(--cw) * 0.44); height: calc(var(--cw) * 0.44); }
.pc-ace {
  display: grid; place-items: center;
  width: calc(var(--cw) * 0.64); height: calc(var(--cw) * 0.64);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--suit-line), inset 0 0 0 calc(var(--cw) * 0.035) transparent, inset 0 0 0 calc(var(--cw) * 0.035 + 1px) var(--suit-line);
}
.pc-pip-xl { width: calc(var(--cw) * 0.38); height: calc(var(--cw) * 0.38); }
.pc-face { display: flex; flex-direction: column; align-items: center; gap: calc(var(--cw) * 0.02); }
.pc-face-rank { font-weight: 800; font-size: calc(var(--cw) * 0.4); letter-spacing: -0.05em; line-height: 0.9; }
.pc-crown { width: calc(var(--cw) * 0.22); height: calc(var(--cw) * 0.22); margin-bottom: calc(var(--cw) * -0.01); }
.pc-pip-sm { width: calc(var(--cw) * 0.16); height: calc(var(--cw) * 0.16); }

.pback {
  --bw: 22px;
  width: var(--bw);
  aspect-ratio: 5 / 7;
  border-radius: calc(var(--bw) * 0.12);
  background:
    repeating-linear-gradient(45deg, rgba(200, 40, 56, 0.22) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(-45deg, rgba(200, 40, 56, 0.22) 0 1px, transparent 1px 5px),
    #473336;
  box-shadow: inset 0 0 0 1px rgba(245, 235, 236, 0.07), inset 0 0 0 3px #473336, inset 0 1px 0 rgba(245, 235, 236, 0.1), 0 2px 6px rgba(0, 0, 0, 0.5);
}

/* ==========================================================================
   TITLE SCREEN
   ========================================================================== */
.title {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  overflow: hidden;
  isolation: isolate;
}

/* 3D table scene */
.scene { position: absolute; inset: 0; z-index: -1; perspective: 1000px; perspective-origin: 50% 20%; overflow: hidden; }
.scene-glow {
  position: absolute; left: 50%; top: 72%;
  width: 1100px; height: 620px; margin: -310px 0 0 -550px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 40, 56, 0.24), rgba(200, 40, 56, 0.06) 55%, transparent);
  animation: orb-breathe 8s ease-in-out infinite alternate;
}
@keyframes orb-breathe { from { transform: scale(1); } to { transform: scale(1.08); } }
.table3d {
  --tw: min(1400px, 135vw);
  position: absolute;
  left: 50%; top: 88%;
  width: var(--tw);
  aspect-ratio: 2.1 / 1;
  margin-left: calc(var(--tw) / -2);
  margin-top: calc(var(--tw) / -4.2);
  transform-style: preserve-3d;
  transform: rotateX(64deg) rotateZ(-2deg);
  animation: table-in 1800ms var(--ease-out) both, table-drift 16s ease-in-out 1800ms infinite alternate;
}
@keyframes table-in { from { transform: translateY(40vh) rotateX(72deg) rotateZ(-8deg); opacity: 0; } to { transform: rotateX(64deg) rotateZ(-2deg); opacity: 1; } }
@keyframes table-drift { from { transform: rotateX(64deg) rotateZ(-2deg); } to { transform: rotateX(62deg) rotateZ(2deg); } }
.t-rim {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 40%, #4b3639, #38272a 72%);
  box-shadow:
    inset 0 0 0 2px rgba(245, 235, 236, 0.05),
    0 0 0 16px #402e31,
    0 0 0 17px rgba(200, 40, 56, 0.5),
    0 0 0 30px #37272a,
    0 0 90px 30px rgba(200, 40, 56, 0.2),
    0 80px 140px rgba(0, 0, 0, 0.9);
}
.t-felt {
  position: absolute; inset: 6%; border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(230, 57, 74, 0.16), rgba(200, 40, 56, 0.07) 45%, transparent 75%),
    #4b2c31;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(200, 40, 56, 0.3);
  overflow: hidden;
}
.t-inlay {
  position: absolute; inset: 10%; border-radius: 50%;
  border: 1px solid rgba(245, 235, 236, 0.07);
  background: repeating-radial-gradient(ellipse at center, rgba(200, 40, 56, 0.1) 0 1px, transparent 1px 16px);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%);
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 72%);
  animation: inlay-spin 120s linear infinite;
}
@keyframes inlay-spin { to { transform: rotate(360deg); } }
.t-seat {
  position: absolute;
  width: 8%; height: 4.4%;
  margin: -2.2% 0 0 -4%;
  border-radius: 999px;
  background: rgba(200, 40, 56, 0.1);
  box-shadow: 0 0 0 1px rgba(200, 40, 56, 0.35);
  transition: background-color 400ms ease, box-shadow 400ms ease;
}
.t-seat.on { background: rgba(230, 57, 74, 0.35); box-shadow: 0 0 0 1px var(--accent-bright), 0 0 40px 6px rgba(230, 57, 74, 0.5); }
.t-seat[data-seat="n"] { left: 50%; top: 3.5%; }
.t-seat[data-seat="s"] { left: 50%; top: 96.5%; }
.t-seat[data-seat="w"] { left: 3%; top: 50%; }
.t-seat[data-seat="e"] { left: 97%; top: 50%; }
.t-cards { position: absolute; inset: 0; transform-style: preserve-3d; }
.t-card { position: absolute; left: 50%; top: 50%; }
.t-card .pcard, .t-card .pback { box-shadow: inset 0 1px 0 rgba(245, 235, 236, 0.12), 0 18px 30px rgba(0, 0, 0, 0.7); }
.t-card .pcard { transition: box-shadow 300ms ease; }
.t-card .pcard.win { box-shadow: inset 0 1px 0 rgba(245, 235, 236, 0.14), 0 0 0 2px var(--accent-bright), 0 0 60px rgba(230, 57, 74, 0.7); }

.embers { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.scene-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(49, 35, 37, 0.92) 0%, rgba(49, 35, 37, 0.55) 34%, rgba(49, 35, 37, 0) 58%, rgba(49, 35, 37, 0.75) 100%),
    radial-gradient(ellipse at 50% 60%, transparent 45%, rgba(49, 35, 37, 0.85) 100%);
}

/* HUD frame */
.hud-corners i {
  position: absolute; width: 30px; height: 30px; z-index: 2;
  border: 0 solid var(--accent);
  opacity: 0.75;
  animation: corner-in 900ms var(--ease-out) 300ms both;
}
.hud-corners i:nth-child(1) { top: 20px; left: 20px; border-top-width: 1.5px; border-left-width: 1.5px; }
.hud-corners i:nth-child(2) { top: 20px; right: 20px; border-top-width: 1.5px; border-right-width: 1.5px; }
.hud-corners i:nth-child(3) { bottom: 20px; left: 20px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.hud-corners i:nth-child(4) { bottom: 20px; right: 20px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
@keyframes corner-in { from { opacity: 0; transform: scale(1.8); } }
.hud-top, .hud-bottom {
  position: absolute; left: 64px; right: 64px; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  font-size: 11px; letter-spacing: 0.12em; color: var(--tertiary);
  animation: fade-in 1000ms ease 900ms both;
}
.hud-top { top: 30px; }
.hud-bottom { bottom: 32px; }
.hud-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--body); font-size: 11px; letter-spacing: 0.14em; }
.press { color: var(--body); animation: blink 2.2s steps(1, end) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }
@keyframes fade-in { from { opacity: 0; } }

/* Wordmark + menu */
.title-inner {
  position: relative; z-index: 1;
  height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: clamp(80px, 12vh, 140px) 20px 0;
  text-align: center;
}
.title-fa {
  font-family: var(--fa); font-weight: 900;
  font-size: clamp(30px, 4vw, 52px); line-height: 1;
  color: var(--accent-bright);
  text-shadow: 0 0 30px rgba(230, 57, 74, 0.55);
  animation: fa-in 1200ms var(--ease-out) 100ms both;
}
@keyframes fa-in { from { opacity: 0; transform: translateY(14px) scale(0.9); filter: blur(8px); } }
.wordmark {
  position: relative;
  margin-top: 4px;
  font-size: clamp(104px, 17vw, 250px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 0.82;
  color: var(--text);
  text-shadow: 0 0 80px rgba(200, 40, 56, 0.35), 0 12px 40px rgba(0, 0, 0, 0.6);
  perspective: 600px;
}
.wordmark span {
  display: inline-block;
  animation: letter-in 1300ms var(--ease-out) both;
  animation-delay: calc(250ms + var(--l) * 110ms);
  transform-origin: 50% 100%;
}
.wordmark span:nth-child(1) { --l: 0; }
.wordmark span:nth-child(2) { --l: 1; }
.wordmark span:nth-child(3) { --l: 2; }
.wordmark span:nth-child(4) { --l: 3; }
@keyframes letter-in { from { opacity: 0; transform: translateY(38%) rotateX(-75deg); filter: blur(14px); } }
/* Light sweeping across the letters */
.wordmark::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  color: transparent;
  text-shadow: none;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.85) 48%, rgba(230, 57, 74, 0.95) 51%, transparent 60%);
  background-size: 300% 100%;
  background-position: 120% 0;
  -webkit-background-clip: text;
  background-clip: text;
  animation: glint 7s ease-in-out 2.2s infinite;
  pointer-events: none;
}
@keyframes glint { 0% { background-position: 120% 0; } 30%, 100% { background-position: -40% 0; } }
.title-tag { margin-top: 18px; font-size: 12px; letter-spacing: 0.32em; color: var(--body); animation: fade-in 1000ms ease 900ms both; }

.menu::after {
  content: ""; position: absolute; inset: -40px -90px; z-index: -2; pointer-events: none;
  background: radial-gradient(closest-side, rgba(49, 35, 37, 0.78), transparent);
}
.menu {
  position: relative;
  isolation: isolate;
  width: min(420px, 100%);
  margin-top: clamp(28px, 6vh, 64px);
  display: flex; flex-direction: column; gap: 2px;
  text-align: left;
}
.menu-item {
  position: relative;
  isolation: isolate;
  display: flex; justify-content: center; align-items: center;
  padding: 12px 18px;
  text-align: center;
  border-radius: 12px;
  color: var(--body);
  transition: color 220ms ease, transform 320ms var(--ease-out);
  animation: menu-in 800ms var(--ease-out) both;
  animation-delay: calc(1000ms + var(--m, 0) * 90ms);
}
.menu-item:nth-of-type(1) { --m: 0; } .menu-item:nth-of-type(2) { --m: 1; } .menu-item:nth-of-type(3) { --m: 2; } .menu-item:nth-of-type(4) { --m: 3; }
@keyframes menu-in { from { opacity: 0; transform: translateX(-24px); } }
.menu-item::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1;
  background: linear-gradient(90deg, transparent, rgba(200, 40, 56, 0.2) 25%, rgba(200, 40, 56, 0.2) 75%, transparent);
  opacity: 0;
  transition: opacity 260ms ease;
}
.menu-item.is-sel { color: var(--text); }
.menu-item.is-sel::before { opacity: 1; }
.mi-idx { display: none; }
.menu-item.is-sel .mi-idx { color: var(--accent); }
.mi-text { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mi-label { position: relative; }
.mi-label::before, .mi-label::after {
  content: ""; position: absolute; top: 50%;
  width: 16px; height: 16px; margin-top: -8px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 C9 7 4.5 9.6 4.5 13.4 C4.5 15.8 6.3 17.4 8.4 17.4 C9.7 17.4 10.8 16.8 11.4 15.9 Q11.1 18.9 9.6 20.8 L14.4 20.8 Q12.9 18.9 12.6 15.9 C13.2 16.8 14.3 17.4 15.6 17.4 C17.7 17.4 19.5 15.8 19.5 13.4 C19.5 9.6 15 7 12 3 Z' fill='rgba(230,57,74,0.3)' stroke='%23e6394a' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 0 6px rgba(230, 57, 74, 0.8));
  opacity: 0;
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
}
.mi-label::before { left: -30px; transform: translateX(8px); }
.mi-label::after { right: -30px; transform: translateX(-8px); }
.menu-item.is-sel .mi-label::before, .menu-item.is-sel .mi-label::after { opacity: 1; transform: none; }
.mi-label { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; text-transform: uppercase; line-height: 1.1; }
.mi-sub { font-size: 10.5px; letter-spacing: 0.1em; color: var(--tertiary); text-transform: uppercase; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 300ms var(--ease-out), opacity 260ms ease; }
.menu-item.is-sel .mi-sub { max-height: 20px; opacity: 1; }
.menu-item:focus-visible { outline: none; }
.menu-marker {
  display: none;
  position: absolute; left: 14px; top: 0;
  width: 22px; height: 22px;
  color: var(--accent-bright);
  filter: drop-shadow(0 0 8px rgba(230, 57, 74, 0.8));
  transition: transform 340ms var(--ease-out);
  animation: fade-in 600ms ease 1300ms both;
  pointer-events: none;
  z-index: 1;
}
.menu-marker svg { width: 20px; height: 20px; --pip-fill: rgba(200, 40, 56, 0.35); }

.status { display: inline-flex; align-items: center; gap: 10px; }
.status-dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--status); opacity: 0; }
.status-text { font-size: 11px; letter-spacing: 0.12em; color: var(--body); }
.status.is-live .status-dot { background: var(--status); }
.status.is-live .status-dot::after { animation: dot-ping 1.8s var(--ease-out) infinite; }
.status.is-live .status-text { color: var(--accent); }
.status.is-off .status-dot { background: var(--alert); }
.status.is-off .status-text { color: var(--alert); }
@keyframes dot-ping { 0% { transform: scale(1); opacity: 0.7; } 100% { transform: scale(3); opacity: 0; } }

/* Floating HUD bar after the title screen */
.hud-float {
  position: fixed; top: 14px; left: 50%; z-index: 40;
  display: flex; align-items: center; gap: 28px;
  padding: 8px 8px 8px 16px;
  border-radius: 14px;
  background: rgba(59, 42, 45, 0.82);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-card), 0 0 0 1px var(--border-subtle);
  transform: translate(-50%, -150%);
  transition: transform 500ms var(--ease-out);
}
.hud-float.on { transform: translate(-50%, 0); }
.hud-float .hud-logo { color: var(--text); }
.hud-float .logo-mark { width: 26px; height: 26px; }
.hud-float .logo-mark svg { width: 15px; height: 15px; }

/* ==========================================================================
   Chapters
   ========================================================================== */
.chapter { position: relative; padding: 150px 0; }
.chapter--alt { background: var(--surface); }
.ch-head { max-width: 760px; margin-bottom: 72px; }
.ch-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* Flip cards */
.flip-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.flip { display: block; width: 100%; aspect-ratio: 5 / 7; perspective: 1400px; border-radius: 20px; }
.flip-inner {
  position: relative; display: block; width: 100%; height: 100%;
  transform-style: preserve-3d;
  transition: transform 900ms var(--ease-out);
}
.flip[aria-pressed="true"] .flip-inner { transform: rotateY(180deg); }
@media (hover: hover) and (pointer: fine) {
  .flip:hover .flip-inner { transform: rotateY(180deg); }
}
.flip-face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  border-radius: 20px;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
}
.flip-front {
  align-items: center; justify-content: center; gap: 8px;
  background:
    repeating-linear-gradient(45deg, rgba(200, 40, 56, 0.13) 0 1px, transparent 1px 9px),
    repeating-linear-gradient(-45deg, rgba(200, 40, 56, 0.13) 0 1px, transparent 1px 9px),
    radial-gradient(ellipse at 50% 40%, #4b3639, #402e31 70%);
  box-shadow: var(--shadow-card), inset 0 0 0 1px rgba(245, 235, 236, 0.05);
}
.flip-front::before, .flip-front::after { content: ""; position: absolute; border-radius: 14px; pointer-events: none; }
.flip-front::before { inset: 12px; border: 1px solid rgba(200, 40, 56, 0.35); }
.flip-front::after { inset: 18px; border: 1px solid rgba(245, 235, 236, 0.05); }
.ff-num {
  position: relative;
  font-size: clamp(64px, 7vw, 104px); font-weight: 900; letter-spacing: -0.04em; line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--text);
  text-shadow: 0 0 40px rgba(200, 40, 56, 0.4);
}
.ff-title { position: relative; font-size: 18px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text); }
.ff-hint { position: absolute; bottom: 30px; font-size: 10px; letter-spacing: 0.2em; color: var(--accent); }
.flip-back {
  transform: rotateY(180deg);
  padding: 30px 26px;
  background: linear-gradient(155deg, #523b3f, #473336 46%, #3c2b2e);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(200, 40, 56, 0.45), 0 0 40px rgba(200, 40, 56, 0.18);
}
.fb-idx { font-size: 11px; letter-spacing: 0.08em; color: var(--accent); }
.fb-title { margin-top: 14px; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--text); }
.fb-text { margin-top: 12px; font-size: 14px; line-height: 1.6; color: var(--body); }
.fb-pip { margin-top: auto; align-self: flex-end; color: var(--accent); }
.fb-pip svg { width: 28px; height: 28px; }

/* Trump demo */
.showcase { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 72px; align-items: center; margin-top: 140px; }
.suit-picker { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 36px; }
.suit-btn {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 18px 0 14px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-card);
  color: var(--body);
  transition: transform 220ms var(--ease-out), box-shadow 260ms ease, color 220ms ease;
}
.suit-btn .pip { width: 30px; height: 30px; transition: transform 400ms var(--ease-out); }
.suit-btn span { font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; }
.suit-btn[aria-pressed="true"] { color: var(--text); box-shadow: var(--shadow-card), var(--shadow-featured); }
.suit-btn[aria-pressed="true"] .pip { color: var(--accent-bright); transform: scale(1.08); --pip-fill: rgba(200, 40, 56, 0.14); }
@media (hover: hover) and (pointer: fine) {
  .suit-btn:hover { transform: translateY(-2px); color: var(--text); box-shadow: var(--shadow-card-hover); }
  .suit-btn[aria-pressed="true"]:hover { box-shadow: var(--shadow-card-hover), var(--shadow-featured); }
}
.suit-btn:active { transform: scale(0.97); }
.hokm-ind {
  position: relative;
  margin-top: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 20px 24px;
  border-radius: 16px;
  background: var(--card);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(200, 40, 56, 0.28);
}
.hokm-ind::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 0 1px var(--accent-bright), 0 0 32px rgba(230, 57, 74, 0.35);
  opacity: 0;
}
.hokm-ind.pulse::after { animation: ind-pulse 900ms var(--ease-out); }
@keyframes ind-pulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.04); } }
.hokm-ind-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.hokm-ind-label { font-size: 11px; color: var(--accent); letter-spacing: 0.06em; }
.hokm-ind-name { display: block; overflow: hidden; font-size: 28px; font-weight: 800; letter-spacing: -0.03em; color: var(--text); line-height: 1.15; }
.hokm-ind-name span { display: inline-block; }
.hokm-ind-icon {
  flex: none; width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--accent-bright); background: var(--accent-subtle);
  box-shadow: inset 0 0 0 1px rgba(200, 40, 56, 0.35);
}
.hokm-ind-icon svg { width: 28px; height: 28px; --pip-fill: rgba(200, 40, 56, 0.12); }
.trick-demo { border-radius: 20px; background: var(--card); box-shadow: var(--shadow-card); padding: 28px; }
.td-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: 0.06em; color: var(--tertiary); }
.td-head span:last-child { color: var(--accent); }
.td-felt {
  --cw: clamp(64px, 7vw, 92px);
  position: relative;
  height: calc(var(--cw) * 4.2);
  margin-top: 20px;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 50%, rgba(200, 40, 56, 0.16), transparent 65%), var(--surface);
  box-shadow: inset 0 0 0 1px rgba(245, 235, 236, 0.04), inset 0 0 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.td-ring { position: absolute; inset: 14% 12%; border-radius: 50%; border: 1px solid rgba(200, 40, 56, 0.18); box-shadow: 0 0 0 10px rgba(245, 235, 236, 0.012); }
.td-slot { position: absolute; left: 50%; top: 50%; }
.td-slot .pcard { position: absolute; left: calc(var(--cw) / -2); top: calc(var(--cw) * -0.7); transition: transform 500ms var(--ease-out), filter 400ms ease, box-shadow 400ms ease; }
.td-slot[data-pos="north"] { transform: translate(0, calc(var(--cw) * -1.18)) rotate(3deg); }
.td-slot[data-pos="south"] { transform: translate(0, calc(var(--cw) * 1.18)) rotate(-2deg); }
.td-slot[data-pos="west"] { transform: translate(calc(var(--cw) * -1.45), 0) rotate(-6deg); }
.td-slot[data-pos="east"] { transform: translate(calc(var(--cw) * 1.45), 0) rotate(5deg); }
.td-slot .pcard.is-lose { filter: brightness(0.55) saturate(0.6); }
.td-slot .pcard.is-win {
  transform: translateY(-8px) scale(1.07);
  box-shadow: inset 0 1px 0 rgba(245, 235, 236, 0.14), 0 0 0 1px rgba(230, 57, 74, 0.75), 0 0 34px rgba(200, 40, 56, 0.35), 0 18px 34px rgba(0, 0, 0, 0.6);
}
.td-tag { position: absolute; left: 50%; top: calc(var(--cw) * 0.78); transform: translateX(-50%); font: 500 10px/1 var(--mono); letter-spacing: 0.08em; color: var(--tertiary); white-space: nowrap; }
.td-lead { color: var(--accent); }
.td-caption { margin-top: 18px; min-height: 52px; font-size: 15px; color: var(--text); line-height: 1.6; }
.td-caption b { color: var(--accent-bright); font-weight: 600; }

/* Collectible title cards */
.collect { display: grid; grid-template-columns: repeat(3, minmax(0, 320px)); justify-content: center; gap: 32px; }
.ccard {
  position: relative;
  display: flex; flex-direction: column; align-items: center; text-align: center;
  aspect-ratio: 5 / 7;
  padding: 34px 28px 54px;
  border-radius: 22px;
  background: linear-gradient(160deg, #523b3f, #463235 50%, #3a292c);
  box-shadow: var(--shadow-card), 0 30px 60px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  transition: transform 600ms var(--ease-out), box-shadow 300ms ease;
  transform-style: preserve-3d;
}
.ccard::before, .ccard::after { content: ""; position: absolute; pointer-events: none; }
.ccard::before { inset: 10px; border-radius: 15px; border: 1px solid rgba(245, 235, 236, 0.07); }
.ccard::after { inset: 15px; border-radius: 11px; border: 1px solid rgba(200, 40, 56, 0.22); }
.ccard.is-rare { box-shadow: var(--shadow-card), 0 0 0 1px rgba(200, 40, 56, 0.6), 0 0 50px rgba(200, 40, 56, 0.22), 0 30px 60px rgba(0, 0, 0, 0.5); animation: rare-glow 4s ease-in-out infinite alternate; }
@keyframes rare-glow { to { box-shadow: var(--shadow-card), 0 0 0 1px rgba(230, 57, 74, 0.7), 0 0 80px rgba(200, 40, 56, 0.34), 0 30px 60px rgba(0, 0, 0, 0.5); } }
.ccard.is-tilting { transition: transform 140ms linear, box-shadow 300ms ease; }
.cc-foil {
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, transparent 25%, rgba(230, 57, 74, 0.2) 42%, rgba(245, 235, 236, 0.16) 50%, rgba(230, 57, 74, 0.2) 58%, transparent 75%);
  background-size: 260% 260%;
  background-position: var(--fx, 100%) var(--fy, 50%);
  mix-blend-mode: screen;
  opacity: 0.35;
  transition: opacity 300ms ease;
  animation: foil-drift 7s ease-in-out infinite alternate;
}
.ccard.is-tilting .cc-foil { opacity: 1; animation: none; }
@keyframes foil-drift { from { background-position: 100% 50%; } to { background-position: 0% 50%; } }
.cc-corner { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text); line-height: 1; }
.cc-corner b { font-size: 22px; font-weight: 800; letter-spacing: -0.04em; }
.cc-corner svg { width: 16px; height: 16px; }
.cc-corner.tl { top: 26px; left: 26px; }
.cc-corner.br { bottom: 26px; right: 26px; transform: rotate(180deg); }
.is-rare .cc-corner { color: var(--accent-bright); }
.cc-fa { font-family: var(--fa); font-weight: 900; font-size: 26px; color: var(--accent-bright); text-shadow: 0 0 20px rgba(230, 57, 74, 0.5); line-height: 1.2; }
.cc-art { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.cc-letter {
  font-size: clamp(110px, 11vw, 160px); font-weight: 900; line-height: 0.9; letter-spacing: -0.05em;
  color: #473336;
  -webkit-text-stroke: 3px var(--text); /* half hidden under the fill → 1.5px outline, no glyph overlaps */
  paint-order: stroke fill;
  filter: drop-shadow(0 0 30px rgba(200, 40, 56, 0.35));
}
.is-rare .cc-letter { -webkit-text-stroke-color: var(--accent-bright); font-size: clamp(92px, 9vw, 128px); }
.cc-crown { position: static; color: var(--accent-bright); filter: drop-shadow(0 0 10px rgba(230, 57, 74, 0.7)); }
.cc-crown svg { width: 36px; height: 36px; }
.cc-name { font-size: 30px; font-weight: 900; letter-spacing: -0.04em; color: var(--text); line-height: 1; text-transform: uppercase; }
.cc-role { margin-top: 8px; font-size: 11px; letter-spacing: 0.2em; color: var(--accent); }
.cc-flavor { margin-top: 12px; font-size: 13.5px; line-height: 1.55; color: var(--body); max-width: 230px; }
.cc-meta { margin-top: 16px; font-size: 10.5px; letter-spacing: 0.12em; color: var(--tertiary); }
.is-rare .cc-meta { color: var(--accent); }
.cc-rarity { display: flex; gap: 6px; margin-top: 16px; color: var(--accent-bright); }
.cc-rarity svg { width: 14px; height: 14px; --pip-fill: rgba(200, 40, 56, 0.4); filter: drop-shadow(0 0 6px rgba(230, 57, 74, 0.6)); }
.cc-rarity .off { color: var(--muted); filter: none; --pip-fill: none; }

/* Deal me in */
.dealin { position: relative; padding: 170px 0 150px; overflow: hidden; }
.dealin-orb {
  position: absolute; left: 50%; top: 50%;
  width: 900px; height: 500px; margin: -250px 0 0 -450px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(200, 40, 56, 0.24), rgba(200, 40, 56, 0.07) 55%, transparent);
  animation: orb-breathe 8s ease-in-out infinite alternate;
  pointer-events: none;
}
.dealin-inner { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.deck { --cw: 120px; --sx: 40px; --ra: 1deg; position: relative; width: var(--cw); height: calc(var(--cw) * 1.4); margin-bottom: 112px; }
.deck .d-card {
  position: absolute; left: 0; top: 0;
  transform-origin: 50% 120%;
  transform: translateY(calc(var(--k) * -2px)) rotate(0deg);
  transition: transform 700ms var(--ease-out);
  transition-delay: calc(var(--k) * 30ms);
}
.deck.fanned .d-card { transform: translateX(calc((var(--k) - 3) * var(--sx))) translateY(calc(var(--a) * var(--a) * 0.08px)) rotate(calc(var(--a) * var(--ra))); }
.dealin-title { font-size: clamp(44px, 6.6vw, 100px); font-weight: 900; letter-spacing: -0.05em; line-height: 0.96; color: var(--text); max-width: 1000px; }
.dealin-ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 44px; }

.foot {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border-subtle);
  font-size: 11px; letter-spacing: 0.1em; color: var(--tertiary);
}
.foot > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.foot .logo-mark { width: 24px; height: 24px; }
.foot .logo-mark svg { width: 14px; height: 14px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .flip-row { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }
  .showcase { grid-template-columns: 1fr; gap: 56px; }
  .collect { grid-template-columns: minmax(0, 320px); }
}
@media (max-width: 640px) {
  :root { --gutter: 20px; }
  .hud-top, .hud-bottom { left: 28px; right: 28px; }
  .hud-bottom span:first-child { display: none; }
  .hud-bottom { justify-content: center; }
  .hud-corners i { width: 20px; height: 20px; }
  .hud-corners i:nth-child(1), .hud-corners i:nth-child(2) { top: 12px; }
  .hud-corners i:nth-child(3), .hud-corners i:nth-child(4) { bottom: 12px; }
  .hud-corners i:nth-child(1), .hud-corners i:nth-child(3) { left: 12px; }
  .hud-corners i:nth-child(2), .hud-corners i:nth-child(4) { right: 12px; }
  .title-inner { padding-top: 92px; }
  .wordmark { font-size: 27vw; }
  .title-tag { font-size: 10px; letter-spacing: 0.22em; }
  .mi-label { font-size: 20px; }
  .menu-item { padding: 10px 14px; }
  .menu-marker { left: 12px; }
  .table3d { --tw: 230vw; top: 80%; }
  .press { display: none; }
  .chapter { padding: 100px 0; }
  .flip-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .flip-back { padding: 18px 14px; }
  .fb-title { font-size: 15px; margin-top: 8px; }
  .fb-text { font-size: 12px; margin-top: 8px; line-height: 1.5; }
  .ff-title { font-size: 13px; }
  .ff-hint { bottom: 20px; }
  .suit-picker { gap: 8px; }
  .trick-demo { padding: 20px; }
  .td-felt { --cw: 56px; }
  .hud-float { gap: 16px; }
  .dealin { padding: 110px 0 96px; }
  .deck { --cw: 76px; --sx: 26px; --ra: 0.6deg; margin-bottom: 76px; }
  .dealin-title { font-size: clamp(40px, 12vw, 56px); }
  .dealin-ctas { flex-direction: column; width: 100%; max-width: 320px; margin-top: 36px; }
  .dealin-ctas .btn { width: 100%; }
}

/* Reduced motion: fewer, gentler — keep fades, drop movement */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js [data-reveal], html.js [data-reveal="card"] { transform: none; transition: opacity 400ms ease; }
  html.js [data-split] .w > span { transform: none; transition: none; }
  .table3d { animation: none; transform: rotateX(64deg); }
  .wordmark span, .title-fa, .menu-item { animation-name: fade-in; }
  .scene-glow, .dealin-orb, .t-inlay, .ccard.is-rare, .cc-foil, .wordmark::after, .press { animation: none; }
  .flip-inner { transition-duration: 1ms; }
  .deck .d-card { transition: none; }
}
