/* ---------------------------------------------------------------- tokens
   A card room after dark: warm charcoal walls, brass fittings, cream type.
   Colour still does real work -- green is money coming back, red is money
   going out, amber is a round that's live -- and every game owns one hue so
   you always know where you are. */

:root {
  --bg:      #151210;
  --panel:   #1b1714;
  --surface: #211c18;
  --inset:   #2a2420;
  --raised:  #352e28;
  --rule:    #3b332c;
  --ink:     #f1e8d8;
  --shim:    #b1a48e;
  --dim:     #7c7062;

  --gain:    #7fcf8e;
  --gain-bg: #1e3527;
  --loss:    #e2705f;
  --loss-bg: #46241f;
  --live:    #e8b455;
  --live-bg: #47381a;
  --accent:  #d7a94d;
  --brass:   #d7a94d;
  --brass-2: #b8893a;

  /* one hue per game */
  --c-dice:   #38bdf8;
  --c-limbo:  #a78bfa;
  --c-crash:  #fb923c;
  --c-mines:  #34d399;
  --c-plinko: #f472b6;
  --c-keno:   #60a5fa;
  --c-hilo:   #f87171;
  --c-dragon: #fbbf24;
  --c-wheel:  #c084fc;
  --c-roulette: #ef4444;
  --c-flip:   #facc15;
  --c-diamonds: #2dd4bf;
  --c-horses: #a3e635;
  --c-slots:  #fb7185;
  --c-poker:  #f97316;
  --c-vpoker: #38bdf8;
  --c-scratch: #a3a3a3;
  --c-cases:  #d946ef;
  --c-blackjack: #4ade80;
  --c-baccarat: #f59e0b;
  --gold:     #f0c86a;

  --game: var(--accent);

  --gap:  14px;
  --edge: 3px;
  --r:    6px;

  --sans:  "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --mono:  "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
/* `hidden` wins over every display rule below (a grid frame or a flex
   ticker would otherwise stay on screen with the attribute set). */
[hidden] { display: none !important; }

body {
  margin: 0;
  background-color: var(--bg);
  /* a faint paper grain so big flat areas don't read as a screen */
  background-image:
    radial-gradient(1400px 500px at 50% -200px, rgba(215,169,77,0.10), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 0.9 0 0 0 0 0.75 0 0 0 0.035 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 600; letter-spacing: 0; }
.kicker {
  margin: 0 0 4px; font-size: 11px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--brass);
}

button, input, select { font: inherit; color: inherit; }

.gain { color: var(--gain); }
.loss { color: var(--loss); }

/* ------------------------------------------------------------------ bar */

.bar {
  display: flex;
  flex-wrap: wrap;                 /* on a narrow screen the tools drop to a second line instead of pushing the page wider */
  align-items: center;
  gap: 8px 22px;
  padding: 10px 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule);
  box-shadow: inset 0 -1px 0 rgba(215,169,77,0.18);
}

.brand { display: flex; align-items: center; gap: 11px; color: var(--brass); text-decoration: none; }
.mark { width: 36px; height: 36px; flex: none; }
.mark.big { width: 64px; height: 64px; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.wm-name { font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--ink); letter-spacing: 0.01em; white-space: nowrap; }
.wm-sub { white-space: nowrap; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); margin-top: 3px; }

.ledger { display: flex; align-items: center; gap: 16px; padding-left: 22px; border-left: 1px solid var(--rule); flex-wrap: wrap; row-gap: 6px; }
.tallies { display: flex; align-items: baseline; gap: 18px; }
.tools { display: flex; align-items: center; gap: 6px; padding-left: 14px; border-left: 1px solid var(--rule); }

.bar .spacer { flex: 1; }

.readout { display: flex; align-items: baseline; gap: 7px; }
.readout .label { font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.readout .value { font-size: 20px; font-weight: 600; }
.readout .value.small { font-size: 15px; font-weight: 500; font-family: var(--mono); }
.readout .value.balance { color: var(--ink); font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.streak:not(:empty) {
  color: var(--live);
  font-weight: 600;
}

.tier { display: flex; align-items: center; gap: 8px; min-width: 220px; }
.tier-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  color: #06111c;
  background: var(--tier, #b08d57);
}
.tier[data-tier="Bronze"]   { --tier: #c8865a; }
.tier[data-tier="Silver"]   { --tier: #c9d3dc; }
.tier[data-tier="Gold"]     { --tier: #f5c542; }
.tier[data-tier="Platinum"] { --tier: #9fe1e7; }
.tier[data-tier="Diamond"]  { --tier: #b89cff; }
.tier-bar {
  flex: 1;
  height: 6px;
  background: var(--inset);
  border-radius: 999px;
  overflow: hidden;
}
.tier-fill {
  height: 100%;
  width: 0;
  background: var(--tier, var(--accent));
  border-radius: 999px;
  transition: width .6s ease-out;
}
.tier .label { font-size: 11px; white-space: nowrap; }

.claim {
  white-space: nowrap;
  background: transparent;
  color: var(--shim);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 6px 12px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  align-self: center;
  font-variant-numeric: tabular-nums;
}
.claim.ready {
  background: var(--brass);
  color: var(--bg);
  border-color: var(--brass);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(215,169,77,0.5); }
  50%      { box-shadow: 0 0 0 8px rgba(215,169,77,0); }
}

.icon {
  background: var(--inset);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  font-size: 14px;
  align-self: center;
}
.icon:hover { border-color: var(--ink); }
.icon[aria-pressed="true"] { background: var(--live); border-color: var(--live); }

.live-tag:not(:empty) {
  color: var(--live);
  background: var(--live-bg);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}

/* ----------------------------------------------------------- structure */

.frame {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr) 272px;
  gap: var(--gap);
  padding: var(--gap);
  align-items: start;
}

.block {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r);
  padding: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 10px 30px rgba(0,0,0,0.25);
}

.block > h2 {
  margin: 0 0 10px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--shim);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 7px;
}

#main-block { border-top: var(--edge) solid var(--game); }
#main-block > h2 { color: var(--game); }

.block h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--shim);
}

.hint {
  margin-top: 8px;
  font-size: 11px;
  color: var(--dim);
  text-align: center;
}

/* ------------------------------------------------------------- game nav */

.nav { display: flex; flex-direction: column; gap: 3px; }

.nav button {
  text-align: left;
  padding: 8px 10px;
  background: none;
  border: none;
  border-radius: 6px;
  border-left: var(--edge) solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
}

.nav button::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--game);
  opacity: 0.55;
}

.nav button:hover { background: var(--inset); }

.nav button[aria-current="true"] {
  background: var(--inset);
  border-left-color: var(--game);
  font-weight: 600;
}
.nav button[aria-current="true"]::before {
  opacity: 1;
  box-shadow: 0 0 8px var(--game);
}

/* ------------------------------------------------------------- controls */

.field { margin-bottom: 12px; }

.field label {
  display: block;
  font-size: 12px;
  color: var(--shim);
  margin-bottom: 4px;
}

.field input, .field select {
  width: 100%;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 4px;
}

.field input:focus, .field select:focus {
  outline: 2px solid var(--game);
  outline-offset: -1px;
}

.chips { display: flex; gap: 4px; }

.chips button {
  flex: 1;
  padding: 7px 4px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  color: var(--shim);
}
.chips button:hover { border-color: var(--game); color: var(--ink); }

.chips button.locked {
  opacity: 0.45;
  cursor: not-allowed;
}
.chips button.locked:hover { border-color: var(--rule); color: var(--shim); }

.quick { display: flex; gap: 4px; margin-top: 5px; }
.quick button {
  flex: 1;
  padding: 4px;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 5px;
  color: var(--shim);
  font-size: 12px;
  cursor: pointer;
}
.quick button:hover { border-color: var(--game); color: var(--ink); }

.auto {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px dashed var(--rule);
}
.auto summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--shim);
  font-weight: 600;
  list-style: none;
  display: flex; justify-content: space-between;
}
.auto summary::after { content: "▸"; }
.auto[open] summary::after { content: "▾"; }
.auto .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.auto .field { margin-bottom: 8px; }
.auto .field input { padding: 5px 8px; font-size: 13px; }
.auto .running {
  background: var(--live);
  color: #06111c;
}

.chips button[aria-pressed="true"] {
  background: var(--game);
  color: #06111c;
  border-color: var(--game);
  font-weight: 600;
}

.go {
  width: 100%;
  padding: 13px;
  margin-top: 4px;
  background: var(--game);
  color: #06111c;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .12s, transform .06s;
}

.go:hover:not(:disabled) { filter: brightness(1.12); }
.go:active:not(:disabled) { transform: translateY(1px); }
.go:disabled { opacity: 0.35; cursor: not-allowed; }
.go.cashout { background: var(--gain); }
.go.ghost {
  background: transparent;
  color: var(--shim);
  border: 1px solid var(--rule);
  font-weight: 500;
  margin-top: 10px;
}
.go.ghost:hover:not(:disabled) { color: var(--ink); border-color: var(--brass); filter: none; }
#reset:hover:not(:disabled), #s-reset:hover:not(:disabled), #del-go:hover:not(:disabled) { color: var(--loss); border-color: var(--loss); }
.go.ghost.armed { background: var(--loss); color: var(--ink); border-color: var(--loss); }



/* ---------------------------------------------------------------- board */

.board {
  min-height: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px;
  background: var(--panel);
  border-radius: 8px;
}

.verdict { font-size: 48px; font-weight: 700; letter-spacing: -0.02em; }
.verdict.win  { color: var(--gain); text-shadow: 0 0 22px rgba(34,211,122,0.45); }
.verdict.lose { color: var(--loss); }
.verdict.live { color: var(--live); }
.verdict.near { color: var(--live); animation: wobble .5s ease-in-out; }
@keyframes wobble {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); } 75% { transform: translateX(6px); }
}

.subline { color: var(--shim); font-size: 14px; }

/* tile grids — mines, keno, dragon */

.grid { display: grid; gap: 6px; }
.grid.mines { grid-template-columns: repeat(5, 62px); }
.grid.keno  { grid-template-columns: repeat(8, 52px); }

.tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--raised);
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .08s, background .12s;
}

.tile:hover:not(:disabled) { background: var(--inset); border-color: var(--game); transform: translateY(-1px); }
.tile:disabled { cursor: default; }
.tile.safe   { background: var(--gain-bg); color: var(--gain); border-color: var(--gain); }
.tile.mine   { background: var(--loss-bg); color: var(--loss); border-color: var(--loss); }
.tile.chosen { background: var(--game);  color: #06111c; }
.tile.hit    { background: var(--gain);  color: #06111c; box-shadow: 0 0 12px rgba(34,211,122,0.5); }
.tile.miss   { opacity: 0.3; }

/* dragon tower: stone doors */

.tower-wrap {
  background: linear-gradient(180deg, #1b1512, #12100e);
  border: 1px solid #3a2e26; border-radius: 10px; padding: 10px 16px 14px;
}
.tower-wrap.fell { animation: shake .5s; }
.tower-top {
  display: flex; align-items: center; gap: 10px; justify-content: center;
  color: #d9b779; font-family: Georgia, serif; font-size: 15px; letter-spacing: 0.08em;
  padding-bottom: 8px; border-bottom: 1px solid #3a2e26; margin-bottom: 8px;
}
.tower-crest {
  width: 18px; height: 18px; background: #d9b779;
  clip-path: polygon(50% 0, 62% 35%, 100% 38%, 70% 60%, 80% 100%, 50% 78%, 20% 100%, 30% 60%, 0 38%, 38% 35%);
}
.tower { display: flex; flex-direction: column-reverse; gap: 5px; }
.tower-row { display: flex; gap: 5px; align-items: center; }
.tower-row .mult {
  width: 62px; font-size: 12px; color: #8a7a66; text-align: right; padding-right: 8px;
  font-family: Georgia, serif;
}
.tower-row[data-active="true"] .mult { color: #ffcf6e; font-weight: 700; }
.tower-row[data-cleared="true"] .mult { color: #5c5147; }
.tile.door {
  width: 54px; aspect-ratio: 1.45;
  border-radius: 14px 14px 4px 4px;
  background:
    linear-gradient(90deg, rgba(0,0,0,0.25) 0 2px, transparent 2px 50%, rgba(0,0,0,0.25) 50% calc(50% + 2px), transparent calc(50% + 2px)),
    linear-gradient(180deg, #6b4a2f, #4a3220);
  border: 2px solid #2b1d13;
  box-shadow: inset 0 0 0 2px #7d5a3a, 0 3px 0 #1a120c;
  transition: transform .1s, filter .15s;
}
.tile.door:hover:not(:disabled) { filter: brightness(1.25); transform: translateY(-2px); border-color: #ffcf6e; }
.tower-row[data-active="true"] .tile.door { box-shadow: inset 0 0 0 2px #a6773f, 0 0 12px rgba(255,207,110,0.35); }
.tower-row[data-cleared="true"] .tile.door:not(.opened) { filter: brightness(0.55); }
.tile.door.opened { background: linear-gradient(180deg, #2a2118, #1a1410); box-shadow: inset 0 0 14px #000; }
.tile.door.dragon { background: linear-gradient(180deg, #3a0f0f, #1a0505); border-color: #7f1d1d; box-shadow: inset 0 0 14px #000, 0 0 14px rgba(255,90,60,0.5); }
.tile.door.faint { opacity: 0.45; }
.egg {
  width: 20px; height: 26px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: radial-gradient(circle at 35% 30%, #fff6d5, #f1c65a 55%, #a8781f);
  box-shadow: 0 0 10px rgba(241,198,90,0.6);
}
.flame {
  width: 22px; height: 28px; border-radius: 50% 50% 40% 40% / 70% 70% 30% 30%;
  background: radial-gradient(circle at 50% 80%, #fff3a3, #fb923c 45%, #dc2626 80%);
  transform: rotate(-8deg);
  animation: flicker .18s infinite alternate;
}
@keyframes flicker { to { transform: rotate(8deg) scaleY(1.1); } }

/* plinko + wheel + crash canvases */

canvas { display: block; }

/* payout ladder */

.ladder {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: center;
  max-width: 640px;
}

.ladder span {
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  min-width: 46px;
  text-align: center;
  color: #06111c;
  background: var(--bucket, var(--raised));
}

.ladder span[data-landed="true"] {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  box-shadow: 0 0 12px var(--bucket, var(--ink));
}

.plinko-canvas { max-width: 100%; height: auto; }

/* last few plinko landings, newest first */
.recent-drops { display: flex; gap: 4px; min-height: 24px; }
.recent-drops span {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #06111c;
  background: var(--bucket, var(--raised));
  animation: pop .25s ease-out;
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } }

/* -------------------------------------------------------------- wallet */

.wallet { grid-column: 1 / -1; }

.wallet-grid {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(320px, 1.4fr) minmax(260px, 1fr);
  gap: 18px;
}

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 9px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stat-label { font-size: 11px; color: var(--shim); }
.stat-value { font-size: 16px; font-weight: 600; }
.stat-sub   { font-size: 11px; color: var(--dim); }

.stat.hero {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border-left: var(--edge) solid var(--shim);
}
.stat.hero .stat-value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; }
.stat.hero[data-sign="pos"] { border-left-color: var(--gain); background: linear-gradient(90deg, var(--gain-bg), var(--panel) 60%); }
.stat.hero[data-sign="pos"] .stat-value { color: var(--gain); }
.stat.hero[data-sign="neg"] { border-left-color: var(--loss); background: linear-gradient(90deg, var(--loss-bg), var(--panel) 60%); }
.stat.hero[data-sign="neg"] .stat-value { color: var(--loss); }

.chart-wrap {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 8px;
  padding: 8px;
}
.chart-wrap canvas { width: 100%; height: auto; }

.chart-tip {
  position: absolute;
  pointer-events: none;
  background: var(--raised);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 5px 8px;
  font-size: 12px;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  transform: translate(-50%, -110%);
}
.chart-tip b { display: block; font-size: 13px; }

.scroll { max-height: 220px; overflow: auto; border-radius: 6px; }
.scroll.tall { max-height: 400px; }


.ladder-list { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.ladder-list .rung {
  display: grid;
  grid-template-columns: 74px 1fr auto;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--panel);
  color: var(--shim);
  align-items: center;
}
.ladder-list .rung[data-state="done"] { color: var(--ink); }
.ladder-list .rung[data-state="current"] { color: var(--ink); outline: 1px solid var(--live); }
.ladder-list .rung b { font-weight: 700; }
.ladder-list .rung small { color: var(--dim); }

/* ------------------------------------------------------------ big wins */

.overlay {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  background: rgba(5, 12, 20, 0.6);
  z-index: 50;
  animation: fadein .2s ease-out;
  cursor: pointer;
}
@keyframes fadein { from { opacity: 0; } }
#overlay[hidden], .chart-tip[hidden] { display: none; }
.overlay-card {
  text-align: center;
  padding: 36px 56px;
  border-radius: 18px;
  background: var(--surface);
  border: 2px solid var(--ov, var(--gain));
  box-shadow: 0 0 60px var(--ov, var(--gain)), 0 30px 80px rgba(0,0,0,0.6);
  animation: slam .45s cubic-bezier(.2, 1.6, .4, 1);
}
@keyframes slam { from { transform: scale(0.4); opacity: 0; } }
.overlay-label {
  font-size: 14px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--ov, var(--gain));
}
.overlay-mult { font-size: 84px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); }
.overlay-pay  { font-size: 30px; font-weight: 700; color: var(--ov, var(--gain)); font-variant-numeric: tabular-nums; }
.overlay[data-tier="big"]  { --ov: var(--gain); }
.overlay[data-tier="huge"] { --ov: #f5c542; }
.overlay[data-tier="mega"] { --ov: #ff6ad5; }
.overlay[data-tier="mega"] .overlay-mult { font-size: 110px; }

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

body.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 1px); }
  20%, 80% { transform: translate(3px, -2px); }
  30%, 50%, 70% { transform: translate(-5px, 3px); }
  40%, 60% { transform: translate(5px, -3px); }
}

.toasts {
  position: fixed; right: 16px; bottom: 16px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 55; pointer-events: none;
}
.toast {
  background: var(--raised);
  border-left: 3px solid var(--live);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.45);
  animation: toastin .25s ease-out;
}
.toast.record { border-left-color: #f5c542; }
.toast.near   { border-left-color: var(--live); }
.toast.claim  { border-left-color: var(--gain); }
.toast.tier   { border-left-color: #b89cff; font-weight: 600; }
@keyframes toastin { from { transform: translateX(20px); opacity: 0; } }

/* -------------------------------------------------------------- history */

.log { width: 100%; border-collapse: collapse; font-size: 12px; }
.log th {
  text-align: left;
  font-weight: 500;
  color: var(--shim);
  padding: 4px 7px;
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0;
  background: var(--surface);
}
.log th.num, .log td.num { text-align: right; font-variant-numeric: tabular-nums; }
.log td { padding: 4px 7px; border-bottom: 1px solid var(--inset); }
.log tr:hover td { background: var(--inset); }
.log td.game { display: flex; align-items: center; gap: 7px; }
.log td.game::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--game); flex: none;
}
.log td.pos { color: var(--gain); font-weight: 600; }
.log td.neg { color: var(--loss); }
.log td.zero { color: var(--dim); }
.log td.empty { color: var(--dim); text-align: center; padding: 16px; }

.note {
  font-size: 12px;
  color: var(--shim);
  border-left: var(--edge) solid var(--rule);
  padding-left: 10px;
  margin: 8px 0 10px;
}

.err {
  background: var(--loss-bg);
  color: var(--loss);
  border: 1px solid var(--loss);
  border-radius: 4px;
  padding: 8px 11px;
  font-size: 13px;
  margin-bottom: 10px;
}

/* ---------------------------------------------------------- game hues */

[data-game="dice"]         { --game: var(--c-dice); }
[data-game="limbo"]        { --game: var(--c-limbo); }
[data-game="crash"]        { --game: var(--c-crash); }
[data-game="mines"]        { --game: var(--c-mines); }
[data-game="plinko"]       { --game: var(--c-plinko); }
[data-game="keno"]         { --game: var(--c-keno); }
[data-game="hilo"]         { --game: var(--c-hilo); }
[data-game="dragon_tower"] { --game: var(--c-dragon); }
[data-game="wheel"]        { --game: var(--c-wheel); }
[data-game="roulette"]     { --game: var(--c-roulette); }
[data-game="flip"]         { --game: var(--c-flip); }
[data-game="diamonds"]     { --game: var(--c-diamonds); }
[data-game="horses"]       { --game: var(--c-horses); }
[data-game="slots"]        { --game: var(--c-slots); }
[data-game="blackjack"]    { --game: var(--c-blackjack); }
[data-game="baccarat"]     { --game: var(--c-baccarat); }
[data-game="poker"]        { --game: var(--c-poker); }
[data-game="video_poker"]  { --game: var(--c-vpoker); }
[data-game="scratch"]      { --game: var(--c-scratch); }
[data-game="cases"]        { --game: var(--c-cases); }

@media (max-width: 1100px) {
  .wallet-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1000px) {
  .frame { grid-template-columns: 1fr; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .nav button { border-left: none; border-bottom: var(--edge) solid transparent; }
}
@media (max-width: 720px) {
  .wallet-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ------------------------------------------------------------ header++ */

.icon-btn {
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 14px;
  align-self: center;
}
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--live-bg); border-color: var(--live); }

.tier-pill {
  display: flex; align-items: center; gap: 8px;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  align-self: center;
  color: var(--ink);
}
.tier-pill:hover .tier-name { color: var(--gold); }
.tier-name { font-family: var(--serif); font-weight: 600; font-size: 14px; letter-spacing: 0.02em; }
.tier-bar {
  display: inline-block; width: 90px; height: 6px;
  background: var(--panel); border-radius: 3px; overflow: hidden;
}
.tier-bar > span {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), #ff9f43);
  transition: width .5s ease;
}
.tier-bar.big { width: 100%; height: 10px; }
.tier-next { font-size: 11px; color: var(--shim); }

[data-tier="Bronze"]   .tier-name { color: #d9a066; }
[data-tier="Silver"]   .tier-name { color: #cfd8e3; }
[data-tier="Gold"]     .tier-name { color: var(--gold); }
[data-tier="Platinum"] .tier-name { color: #9be7ff; }
[data-tier="Diamond"]  .tier-name { color: #c6b3ff; }

}

.balance.up   { color: var(--gain); }
.balance.down { color: var(--loss); }

/* ------------------------------------------------------------ controls++ */

.quick { display: flex; gap: 4px; margin-top: 5px; }
.quick button {
  flex: 1; padding: 4px; font-size: 12px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 5px;
  color: var(--shim); cursor: pointer;
}
.quick button:hover { color: var(--ink); border-color: var(--game); }

.chips button.locked { opacity: 0.45; cursor: not-allowed; }
.chips button.locked:hover { border-color: var(--rule); color: var(--shim); }

.auto {
  margin-top: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 10px;
}
.auto summary {
  cursor: pointer; font-size: 12px; color: var(--shim); font-weight: 600;
  list-style: none; display: flex; justify-content: space-between;
}
.auto summary::after { content: "▾"; }
.auto[open] summary::after { content: "▴"; }
.auto .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auto .running { color: var(--live); font-size: 12px; margin-top: 6px; }
.go.stop { background: var(--loss); color: var(--ink); }

.subline.near { color: var(--live); font-weight: 600; }

/* ------------------------------------------------------------- roulette */

.roulette-wrap { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; justify-content: center; }
.rtable { display: grid; grid-template-columns: 36px repeat(12, 36px) 36px; gap: 3px; user-select: none; }
.rcell {
  height: 34px; display: grid; place-items: center;
  border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer;
  position: relative; border: 1px solid transparent; color: var(--ink);
}
.rcell.red   { background: #b91c1c; }
.rcell.black { background: #1f2937; }
.rcell.green { background: #15803d; grid-row: 1 / span 3; }
.rcell.outside { background: var(--raised); }
.rcell.col { background: var(--raised); }
.rcell:hover { border-color: var(--ink); }
.rcell.hit { outline: 3px solid var(--gold); outline-offset: -1px; box-shadow: 0 0 14px var(--gold); }
.rcell .chip {
  position: absolute; right: -5px; top: -7px;
  min-width: 22px; height: 22px; padding: 0 4px; border-radius: 50%;
  background: var(--gold); color: #06111c; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--panel);
}
.rcell.d, .rcell.h { grid-column: span 4; }
.rcell.h { grid-column: span 2; }
.rpocket {
  font-size: 56px; font-weight: 800; width: 100px; height: 100px; border-radius: 50%;
  display: grid; place-items: center; border: 4px solid var(--raised);
}
.rpocket.red { background: #b91c1c; } .rpocket.black { background: #1f2937; } .rpocket.green { background: #15803d; }

/* ----------------------------------------------------------------- flip */


.coin-stage { perspective: 900px; padding: 20px 0 6px; }
.coin3d {
  position: relative; width: 160px; height: 160px;
  transform-style: preserve-3d;
}
.face {
  position: absolute; inset: 0; border-radius: 50%;
  backface-visibility: hidden;
  display: grid; place-items: center;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 14px 30px rgba(0,0,0,0.5);
}
.face.heads {
  background: radial-gradient(circle at 38% 32%, #fff2b3 0%, #f2c94c 35%, #c9962a 70%, #8a5f14 100%);
  color: #5a3d08;
}
.face.tails {
  background: radial-gradient(circle at 38% 32%, #ffffff 0%, #d9e0e7 35%, #9aa7b4 70%, #5b6873 100%);
  color: #2b3742;
  transform: rotateY(180deg);
}
.face .rim {
  position: absolute; inset: 8px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.25);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,0.35), inset 0 0 0 5px rgba(0,0,0,0.15);
}
.face .rim::after {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(0,0,0,0.18) 0 2deg, transparent 2deg 5deg);
  -webkit-mask: radial-gradient(circle, transparent 74px, #000 75px);
  mask: radial-gradient(circle, transparent 74px, #000 75px);
}
.face .glyph {
  font-size: 68px; font-weight: 700; line-height: 1;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5), 0 -1px 0 rgba(0,0,0,0.35);
}
.face .ring {
  position: absolute; bottom: 24px; font-size: 11px; letter-spacing: 0.32em; font-weight: 700;
  opacity: 0.8;
}
.flip-hist { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.flip-hist span {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; color: #06111c; background: var(--c-flip);
}
.flip-hist span.tails { background: #9aa8b5; }

/* ------------------------------------------------------------- diamonds */

.gems { display: flex; gap: 14px; }
.gem {
  width: 72px; height: 72px;
  clip-path: polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%);
  background: var(--raised);
  transition: transform .25s, background .2s;
  transform: scale(0.85);
}
.gem.show { transform: scale(1); box-shadow: 0 0 20px currentColor; }
.gem.match { animation: gemglow 1s ease-in-out infinite alternate; }
@keyframes gemglow { from { filter: brightness(1); } to { filter: brightness(1.5); } }
.paytable { font-size: 12px; margin-top: 8px; border-top: 1px solid var(--rule); }
.paytable div { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--inset); color: var(--shim); }
.paytable div b { color: var(--ink); }

/* ------------------------------------------------------------- vip etc. */

.view[hidden] { display: none; }
.page { padding: var(--gap); max-width: 1180px; margin: 0 auto; --game: var(--brass); }
.auth, .view:not(#view-play) { --game: var(--brass); }
.kv dd { word-break: break-all; }
.page > .block { width: 100%; }
.views {
  display: flex; gap: 2px; padding: 0 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--bg);
}
.views a {
  color: var(--shim); text-decoration: none; font-size: 11px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  padding: 11px 13px 9px; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.views a:hover { color: var(--ink); }
.views a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brass); }
.views a.online-link { color: var(--brass); }
.wallet-grid { grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.4fr) minmax(260px, 1fr); }
.vip-head { display: grid; grid-template-columns: 220px 1fr; gap: 20px; align-items: center; margin-bottom: 12px; }
.vip-current { display: flex; flex-direction: column; gap: 2px; }
.vip-tier { font-size: 30px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
.vip-progress-row { display: flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 600; }
.ladder-table tr.current td { background: var(--inset); }
.ladder-table tr.current td:first-child { border-left: 3px solid var(--gold); font-weight: 700; }
.ladder-table tr.reached td { color: var(--ink); }
.ladder-table tr.future td { color: var(--dim); }
.records-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 20px; }
.log tr.current-session td { background: var(--live-bg); }

/* ------------------------------------------------------------- overlays */

#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

#overlay {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(4, 10, 18, 0.72);
  backdrop-filter: blur(3px);
  animation: fadein .2s;
}
@keyframes fadein { from { opacity: 0; } }
#overlay[hidden], .chart-tip[hidden] { display: none; }
.bigwin {
  text-align: center;
  padding: 36px 56px;
  border-radius: 18px;
  background: linear-gradient(160deg, #1a2a3c, #0f1b2a);
  border: 2px solid var(--gold);
  box-shadow: 0 0 60px rgba(255,209,102,0.35), 0 30px 80px rgba(0,0,0,0.6);
  animation: slam .45s cubic-bezier(.2,1.6,.4,1);
}
@keyframes slam { from { transform: scale(0.3); opacity: 0; } }
.bigwin .kicker { font-size: 13px; letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.bigwin .mult { font-size: 84px; font-weight: 800; line-height: 1; margin: 8px 0; color: var(--gold); text-shadow: 0 0 30px rgba(255,209,102,0.6); }
.bigwin .amount { font-size: 34px; font-weight: 700; color: var(--gain); }
.bigwin.mega .mult { font-size: 120px; background: linear-gradient(90deg, #ffd166, #ff6b6b, #c084fc, #ffd166); -webkit-background-clip: text; background-clip: text; color: transparent; animation: hue 2s linear infinite; }
@keyframes hue { to { filter: hue-rotate(360deg); } }
.bigwin .sub { color: var(--shim); font-size: 13px; margin-top: 10px; }
.bigwin.rankup .mult { font-size: 54px; }

body.shake { animation: shake .5s; }
@keyframes shake {
  10%, 90% { transform: translate(-2px, 0); } 20%, 80% { transform: translate(4px, 0); }
  30%, 50%, 70% { transform: translate(-6px, 0); } 40%, 60% { transform: translate(6px, 0); }
}

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 55; }
.toast {
  background: var(--raised); border: 1px solid var(--gold); border-left-width: 4px;
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: toastin .3s ease-out;
}
.toast b { color: var(--gold); }
@keyframes toastin { from { transform: translateX(30px); opacity: 0; } }

@media (max-width: 900px) {
  .records-grid, .vip-head { grid-template-columns: 1fr; }
  .rtable { grid-template-columns: 28px repeat(12, 28px) 28px; }
  .rcell { height: 28px; font-size: 10px; }
}

/* --------------------------------------------------------------- horses */

.race-canvas { max-width: 100%; height: auto; background: var(--panel); border-radius: 8px; }
.horse-pick {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 6px 9px; margin-bottom: 4px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: 6px;
  cursor: pointer; font-size: 13px; color: var(--shim); text-align: left;
}
.horse-pick .silk { width: 12px; height: 16px; border-radius: 3px 3px 6px 6px; background: var(--h); flex: none; }
.horse-pick .info { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.horse-pick .name { font-weight: 600; color: var(--ink); }
.horse-pick .meta { font-size: 11px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.horse-pick .odds { font-weight: 700; color: var(--ink); }
.horse-pick:hover { border-color: var(--h); color: var(--ink); }
.horse-pick[aria-pressed="true"] { border-color: var(--h); background: var(--inset); color: var(--ink); box-shadow: inset 3px 0 0 var(--h); }

/* ----------------------------------------------------------------- dice */

.dice-track {
  position: relative; width: min(560px, 100%); height: 14px;
  background: var(--raised); border-radius: 7px; margin-top: 8px;
}
.dice-fill { position: absolute; top: 0; height: 100%; border-radius: 7px; }
.dice-fill.win  { background: var(--gain); }
.dice-fill.lose { background: var(--loss); }
.dice-target {
  position: absolute; top: -30px; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--shim);
  background: var(--panel); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--rule);
}
.dice-target::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 8px;
  background: var(--rule); transform: translateX(-50%);
}
.dice-marker {
  position: absolute; top: 50%; width: 30px; height: 30px;
  transform: translate(-50%, -50%);
  background: var(--ink); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  display: grid; place-items: center;
}
.dice-marker::before { content: "⋮⋮"; letter-spacing: -2px; font-size: 12px; color: var(--dim); }
.dice-marker.win  { background: var(--gain); box-shadow: 0 0 18px var(--gain); }
.dice-marker.lose { background: var(--loss); box-shadow: 0 0 18px var(--loss); }
.dice-marker.win::before, .dice-marker.lose::before { color: #06111c; }
.dice-scale { position: relative; width: min(560px, 100%); height: 16px; margin-top: -6px; }
.dice-scale span {
  position: absolute; top: 4px; transform: translateX(-50%);
  font-size: 11px; color: var(--dim);
}


/* ---------------------------------------------------------------- limbo */

.limbo-bar {
  position: relative; width: min(520px, 100%); height: 12px;
  background: var(--raised); border-radius: 6px; margin-top: 10px;
}
.limbo-fill { position: absolute; left: 0; top: 0; height: 100%; width: 0; border-radius: 6px; background: var(--game); }
.limbo-fill.win { background: var(--gain); }
.limbo-fill.lose { background: var(--loss); }
.limbo-target {
  position: absolute; top: -28px; transform: translateX(-50%);
  font-size: 11px; font-weight: 600; color: var(--shim);
  background: var(--panel); padding: 2px 6px; border-radius: 4px; border: 1px solid var(--rule);
}
.limbo-target::after {
  content: ""; position: absolute; left: 50%; top: 100%; width: 2px; height: 8px;
  background: var(--rule); transform: translateX(-50%);
}

/* ---------------------------------------------------------------- crash */

.crash-canvas { max-width: 100%; height: auto; background: var(--panel); border-radius: 8px; }
.crash-readout { font-size: 40px; margin-top: -6px; }

/* ------------------------------------------------------------- roulette */

.roulette-canvas { flex: none; }


/* --------------------------------------------------------------- crash++ */

.crash-hist { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; max-width: 600px; }
.crash-hist span {
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--raised); color: var(--shim);
}
.crash-hist span.low  { color: var(--loss); background: var(--loss-bg); }
.crash-hist span.mid  { color: var(--gain); background: var(--gain-bg); }
.crash-hist span.gold { color: #06111c; background: var(--gold); }
#crash-cashout { font-size: 17px; padding: 16px; animation: pulse 1.2s ease-in-out infinite; }

/* ---------------------------------------------------------------- slots */

.slot-cabinet {
  padding: 14px; border-radius: 14px;
  background: linear-gradient(180deg, #2a1b3d, #14101f);
  border: 2px solid #4c3a6b; box-shadow: 0 16px 40px rgba(0,0,0,0.5), inset 0 0 0 4px #1d1530;
}
.slot-reels { display: flex; gap: 8px; }
.slot-reel {
  width: 100px; height: 252px; overflow: hidden; border-radius: 8px;
  background: linear-gradient(180deg, #f8fafc, #e2e8f0 50%, #cbd5e1);
  box-shadow: inset 0 10px 18px rgba(0,0,0,0.25), inset 0 -10px 18px rgba(0,0,0,0.25);
  position: relative;
}
.slot-reel::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.35), transparent 22%, transparent 78%, rgba(0,0,0,0.35));
}
.slot-strip { display: flex; flex-direction: column; will-change: transform; }
.slot-cell { height: 84px; display: grid; place-items: center; border-bottom: 1px solid rgba(0,0,0,0.08); }
.slot-cell svg { width: 60px; height: 60px; }
.slot-cell.hit { background: rgba(250, 204, 21, 0.45); box-shadow: inset 0 0 0 3px var(--gold); animation: gemglow .5s ease-in-out infinite alternate; }
.paytable svg { width: 22px; height: 22px; vertical-align: middle; margin-right: 4px; }

/* --------------------------------------------------------------- horses++ */

.race-meta { font-size: 12px; color: var(--shim); margin: -4px 0 8px; text-transform: capitalize; }
.commentary {
  min-height: 22px; font-family: Georgia, serif; font-style: italic; font-size: 15px;
  color: var(--ink); text-align: center; max-width: 620px;
}


/* ------------------------------------------------------------ rewards */

.rewards-math { margin: 6px 0 14px; }
.math-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.math-grid div { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.math-grid b { font-size: 13px; color: var(--gold); }
.math-grid span { font-size: 12px; color: var(--shim); line-height: 1.45; }
.claim:not(.ready) { font-variant-numeric: tabular-nums; }
.bigwin.jackpot { border-color: #fff; box-shadow: 0 0 90px rgba(255,209,102,0.7); }
.bigwin.jackpot .mult { font-size: 96px; letter-spacing: 0.04em; }


/* ------------------------------------------------------------ left col */

.left-col { display: flex; flex-direction: column; gap: var(--gap); }
.missions-block .mission { padding: 8px 0; border-bottom: 1px solid var(--inset); }
.missions-block .mission:last-child { border-bottom: none; }
.mission-top { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.mission-text { color: var(--ink); line-height: 1.3; }
.mission-reward { color: var(--gold); font-weight: 700; white-space: nowrap; }
.mission.done .mission-reward { color: var(--gain); }
.mission-bar { height: 5px; background: var(--panel); border-radius: 3px; margin: 6px 0 3px; overflow: hidden; }
.mission-bar span { display: block; height: 100%; background: var(--gold); width: 0; transition: width .4s; }
.mission.done .mission-bar span { background: var(--gain); }
.mission-sub { font-size: 11px; color: var(--dim); }

.today-strip { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--shim); margin-bottom: 8px; }
.today-item.pos { color: var(--gain); } .today-item.neg { color: var(--loss); }

.quick.presets button.on { border-color: var(--game); color: var(--ink); }
.log tr.clickable { cursor: pointer; }

/* --------------------------------------------------------------- cards */

.cards { display: flex; gap: 6px; flex-wrap: wrap; min-height: 84px; }
.card {
  width: 58px; height: 82px; border-radius: 6px; position: relative;
  background: #f8fafc; color: #111827; box-shadow: 0 4px 12px rgba(0,0,0,0.45);
  font-family: Georgia, serif; font-weight: 700;
  animation: dealin .35s ease-out both;
}
.card.red { color: #b91c1c; }
.card .rank { position: absolute; top: 6px; left: 8px; font-size: 18px; }
.card .suit { position: absolute; bottom: 4px; right: 8px; font-size: 26px; }
.card.back {
  background: repeating-linear-gradient(45deg, #1e3a8a 0 6px, #1d4ed8 6px 12px);
  border: 4px solid #f8fafc;
}
@keyframes dealin { from { transform: translateY(-30px) rotate(-6deg); opacity: 0; } }
.card.still { animation: none; }
.card.fly { animation: dealfly .42s cubic-bezier(.2,.8,.3,1) both; }
@keyframes dealfly {
  from { transform: translate(var(--dx), var(--dy)) rotate(12deg) scale(.9); opacity: 0.6; }
  60%  { opacity: 1; }
  to   { transform: none; }
}
.card.sweep { animation: sweep .5s ease-in both; pointer-events: none; }
@keyframes sweep { to { transform: translate(var(--dx), var(--dy)) rotate(-8deg) scale(.7); opacity: 0; } }
.card.mini { width: 34px; height: 48px; border-width: 2px; box-shadow: 0 1px 3px rgba(0,0,0,0.5); animation: none; position: absolute; }
.shoe-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 6px; }
.tray, .shoe { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tray .stack, .shoe .stack { position: relative; width: 40px; height: 54px; }
.tray .stack .card.mini:nth-child(n) { left: 0; top: 0; }
.stack .card.mini:nth-child(2) { top: -2px; left: 1px; } .stack .card.mini:nth-child(3) { top: -4px; left: 2px; }
.stack .card.mini:nth-child(4) { top: -6px; left: 3px; } .stack .card.mini:nth-child(5) { top: -8px; left: 4px; }
.stack .card.mini:nth-child(6) { top: -10px; left: 5px; } .stack .card.mini:nth-child(7) { top: -12px; left: 6px; } .stack .card.mini:nth-child(8) { top: -14px; left: 7px; }
.shoe .stack { background: #3f2a1c; border-radius: 4px; box-shadow: inset 0 0 0 2px #5b3a1e; }
.tray .stack { border: 2px dashed rgba(255,255,255,0.25); border-radius: 4px; }
.tray .lbl, .shoe .lbl { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #bbf7d0; font-weight: 700; }
.shoe-info { display: flex; gap: 12px; font-size: 11px; color: #86efac; opacity: .85; }
.shoe-info .warn { color: var(--live); }

.bj-table { width: min(640px, 100%); background: #14532d; border: 6px solid #3f2a1c; border-radius: 120px / 60px; padding: 24px 40px; box-shadow: inset 0 0 40px rgba(0,0,0,0.4); }
.bj-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.bj-label { font-size: 12px; color: #bbf7d0; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.bj-hands { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 8px; }
.bj-hand { padding: 8px; border-radius: 10px; border: 2px solid transparent; }
.bj-hand.active { border-color: var(--live); background: rgba(255,184,77,0.08); }
.bj-total { font-size: 13px; color: #d1fae5; margin-top: 4px; font-weight: 600; }
.bj-total.win { color: var(--gain); } .bj-total.lose { color: #fca5a5; }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.bj-actions .go { margin-top: 0; padding: 12px; }
.note.advice { color: var(--gold); border-left-color: var(--gold); }
.bj-table.bac { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.bj-row.won .bj-label { color: var(--gold); }
.bj-row.won { background: rgba(255,209,102,0.08); border-radius: 10px; }

/* ------------------------------------------------------------ roulette++ */

.rcell.pending { outline: 2px dashed var(--gold); outline-offset: -2px; }
.rcell .chip.side { top: auto; bottom: -7px; background: #e2e8f0; }

/* ---------------------------------------------------------------- misc */

.recent-drops span.golden { background: #ffd166; box-shadow: 0 0 12px #ffd166; }
.slot-cabinet.free { border-color: var(--gold); box-shadow: 0 0 40px rgba(255,209,102,0.4), inset 0 0 0 4px #3b2a10; }
.tile.marked { border-color: var(--game); color: var(--game); font-size: 13px; }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; }
.badge { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 9px 11px; opacity: 0.45; }
.badge.got { opacity: 1; border-color: var(--gold); background: linear-gradient(160deg, #2a2415, var(--panel) 70%); }
.badge-title { font-weight: 700; font-size: 13px; color: var(--ink); }
.badge.got .badge-title { color: var(--gold); }
.badge-blurb { font-size: 11px; color: var(--shim); line-height: 1.35; margin-top: 2px; }
.badge-when { font-size: 10px; color: var(--dim); margin-top: 4px; }

.bigwin.verify { max-width: min(760px, 92vw); text-align: left; padding: 22px 26px; border-color: var(--rule); box-shadow: 0 30px 80px rgba(0,0,0,0.6); animation: none; }
.bigwin.verify .kicker { color: var(--shim); }
.bigwin.verify .kv { font-size: 12px; margin: 10px 0; }
.bigwin.verify .kv dt { color: var(--shim); margin: 8px 0 2px; }
.bigwin.verify .kv dd { margin: 0; font-family: var(--mono); font-size: 11px; word-break: break-all; line-height: 1.5; color: var(--ink); }
.bigwin.verify .kv dd.plain { font-family: var(--sans); font-size: 12px; }
.bigwin.verify .chips .go { margin-top: 8px; }
.bigwin.report .mult { font-size: 60px; color: var(--gain); }
.bigwin.report .mult.lose { color: var(--loss); }
.bigwin.report .verdict { color: var(--ink); font-style: italic; font-family: Georgia, serif; font-size: 15px; }

/* --------------------------------------------------------------- mobile */

@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 10px 16px; padding: 10px 12px; }
  .bar .spacer { display: none; }
  .readout .value { font-size: 17px; }
  .tier-pill .tier-bar { width: 60px; }
  .views { padding: 6px 10px 0; overflow-x: auto; }
  .frame { padding: 8px; gap: 8px; }
  .left-col { order: 2; }
  .missions-block { display: none; }
  .nav { flex-direction: row; overflow-x: auto; padding: 8px; gap: 4px; scrollbar-width: none; }
  .nav > h2 { display: none; }
  .nav button { flex: none; padding: 8px 12px; border-left: none; white-space: nowrap; }
  .nav button[aria-current="true"] { border-bottom: var(--edge) solid var(--game); }
  .board { min-height: 300px; padding: 10px; gap: 12px; }
  .verdict { font-size: 36px; }
  .grid.mines { grid-template-columns: repeat(5, 52px); }
  .grid.keno { grid-template-columns: repeat(8, 38px); }
  .tile { font-size: 15px; }
  .go { padding: 15px; font-size: 16px; }
  .chips button { padding: 10px 4px; }
  .rtable { grid-template-columns: 24px repeat(12, 24px) 24px; gap: 2px; }
  .rcell { height: 26px; font-size: 9px; }
  .rcell .chip { min-width: 16px; height: 16px; font-size: 8px; }
  .bj-table { padding: 14px 16px; border-radius: 40px / 24px; }
  .bj-table.bac { grid-template-columns: 1fr; }
  .card { width: 46px; height: 66px; }
  .card .rank { font-size: 15px; } .card .suit { font-size: 20px; }
  .wallet-grid, .records-grid, .vip-head { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: 1fr 1fr; }
  .page { padding: 8px; }
  .horse-pick .meta { display: none; }
  .bigwin { padding: 22px 20px; margin: 0 10px; }
  .bigwin .mult { font-size: 56px; } .bigwin.mega .mult { font-size: 72px; }
}


/* -------------------------------------------------------------- library */

.library { padding: 22px var(--gap) 40px; max-width: 1240px; margin: 0 auto; }
.library-head { display: grid; grid-template-columns: 1fr minmax(280px, 360px); gap: 22px; align-items: start; margin-bottom: 8px; }
.lib-intro { padding-top: 6px; }
.lib-title { margin: 0 0 6px; font-size: 40px; font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; font-variation-settings: "opsz" 144; }
.lib-sub { margin: 0 0 18px; color: var(--shim); font-family: var(--serif); font-style: italic; font-size: 16px; }
.lib-featured { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; max-width: 640px; }
.feat {
  display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: var(--ink);
  padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--surface);
  border-left: 3px solid var(--brass); transition: border-color .12s, transform .12s;
}
.feat:hover { transform: translateY(-1px); border-color: var(--brass); }
.feat.poker { border-left-color: var(--c-poker); }
.feat-k { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.feat-t { font-family: var(--serif); font-size: 18px; font-weight: 600; }
.feat-s { font-size: 12px; color: var(--shim); }
.lib-section {
  margin: 26px 0 10px; font-family: var(--serif); font-size: 15px; font-weight: 600; font-style: italic;
  color: var(--shim); display: flex; align-items: center; gap: 12px;
}
.lib-section::before { content: "◆"; font-style: normal; font-size: 8px; color: var(--brass); }
.lib-section::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.lib-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 12px; }
.lib-card {
  --game: var(--accent);
  position: relative; text-align: left; cursor: pointer;
  border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden;
  background: var(--surface); color: var(--ink); padding: 12px 12px 10px;
  transition: transform .12s, box-shadow .12s, border-color .12s;
  display: grid; grid-template-columns: 52px 1fr; grid-template-rows: auto auto; gap: 4px 12px;
}
.lib-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--game); opacity: .55; }
.lib-card:hover { transform: translateY(-2px); border-color: var(--game); box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.lib-card:hover::after { opacity: 1; }
.lib-card:hover .art svg { transform: scale(1.08) rotate(-4deg); }
.lib-card .art {
  grid-row: 1 / 3; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; position: relative;
  background: color-mix(in srgb, var(--game) 16%, var(--panel));
  border: 1px solid color-mix(in srgb, var(--game) 45%, var(--rule));
  box-shadow: inset 0 0 0 3px var(--panel), inset 0 0 0 4px color-mix(in srgb, var(--game) 35%, transparent);
}
.lib-card .art svg { width: 30px; height: 30px; transition: transform .15s; }
.lib-card .art .tag, .lib-card .art .key { display: none; }
.lib-card .body { display: contents; }
.lib-card .name { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.15; display: flex; flex-direction: column; gap: 2px; }
.lib-card .name::before { content: attr(data-idx); font-family: var(--mono); font-size: 9px; color: var(--dim); letter-spacing: 0.1em; text-transform: uppercase; }
.lib-card .line { font-size: 12px; color: var(--shim); line-height: 1.35; grid-column: 2; }
.lib-card .foot { grid-column: 1 / 3; display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 10px; color: var(--dim); margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--rule); font-family: var(--mono); }
.lib-card .foot b { color: var(--ink); font-weight: 500; }
.lib-card .foot b.pos { color: var(--gain); } .lib-card .foot b.neg { color: var(--loss); }
.lib-card .foot .auto { color: var(--dim); font-style: italic; font-family: var(--serif); font-size: 12px; margin-left: auto; }
.lib-card .hot { position: absolute; top: 0; right: 10px; font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--bg); background: var(--brass); padding: 3px 7px 2px; border-radius: 0 0 3px 3px; }

.frame.two { grid-template-columns: minmax(0, 1fr) 280px; }
.table-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.table-head .back { color: var(--shim); text-decoration: none; font-size: 13px; font-weight: 600; padding: 4px 0; }
.table-head .back:hover { color: var(--ink); }
.table-head h2 { flex: 1; }
@media (max-width: 1000px) { .frame.two { grid-template-columns: 1fr; } .library-head { grid-template-columns: 1fr; } }


/* ------------------------------------------------------------ hold'em */

.bj-table.poker { position: relative; }
.bj-table .shoe.deck { position: absolute; right: 26px; top: 14px; }
.paytable div.cur { background: var(--gain-bg); color: var(--gain); border-radius: 4px; padding-left: 4px; padding-right: 4px; }

/* -------------------------------------------------------- video poker */

.vp-table { position: relative; width: min(520px, 100%); background: #1e3a5f; border: 6px solid #0f2540; border-radius: 16px; padding: 44px 18px 22px; }
.vp-table .shoe.deck { position: absolute; right: 14px; top: 8px; }
.vp-cards { justify-content: center; gap: 10px; }
.vp-cards .card { width: 74px; height: 104px; cursor: pointer; transition: transform .12s; }
.vp-cards .card .rank { font-size: 22px; } .vp-cards .card .suit { font-size: 32px; }
.vp-cards .card.ghost { opacity: .25; cursor: default; }
.vp-cards .card.held { transform: translateY(-12px); box-shadow: 0 0 0 3px var(--gold), 0 8px 18px rgba(0,0,0,0.5); }
.vp-cards .card.suggest:not(.held) { outline: 2px dashed rgba(255,255,255,0.6); outline-offset: 2px; }
.hold-tag { position: absolute; left: 50%; bottom: -22px; transform: translateX(-50%); font-size: 10px; font-weight: 800; letter-spacing: .1em; color: var(--gold); display: none; }
.vp-cards .card.held .hold-tag { display: block; }

/* ------------------------------------------------------------ scratch */

.scratch-card { width: 360px; padding: 16px; border-radius: 14px; background: linear-gradient(160deg, #fef3c7, #fbbf24); box-shadow: 0 14px 34px rgba(0,0,0,0.5); color: #78350f; display: flex; flex-direction: column; gap: 12px; align-items: stretch; }
.scratch-card.blank { opacity: .55; }
.scratch-title { text-align: center; font-family: Georgia, serif; font-weight: 800; letter-spacing: .22em; font-size: 15px; }
.scratch-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scratch-panel { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #fffbeb; border: 2px solid #b45309; }
.scratch-panel .under { position: absolute; inset: 0; display: grid; place-items: center; }
.scratch-panel .under svg { width: 64%; height: 64%; }
.scratch-panel .foil { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.scratch-panel.match { box-shadow: 0 0 0 3px var(--gain), 0 0 18px var(--gain); }
.scratch-card .go.ghost { color: #78350f; border-color: #b45309; margin-top: 0; }
.scratch-card .go.ghost:hover:not(:disabled) { color: #fff; background: #b45309; }

/* -------------------------------------------------------------- cases */

.case-wrap { width: 640px; max-width: 100%; }
.case-name { text-align: center; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--shim); font-size: 12px; margin-bottom: 8px; }
.case-window { position: relative; overflow: hidden; height: 120px; border-radius: 12px; background: var(--panel); border: 1px solid var(--rule); box-shadow: inset 0 0 40px rgba(0,0,0,0.6); }
.case-reel { display: flex; height: 100%; will-change: transform; }
.case-tile { flex: none; width: 96px; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border-right: 1px solid rgba(0,0,0,0.3); border-bottom: 5px solid var(--rc); background: linear-gradient(180deg, color-mix(in srgb, var(--rc) 22%, var(--panel)), var(--panel)); }
.case-tile .mult { font-weight: 800; font-size: 18px; color: var(--ink); }
.case-tile .nm { font-size: 10px; color: var(--shim); text-align: center; padding: 0 6px; }
.case-tile.hit { box-shadow: inset 0 0 0 3px var(--gold); animation: gemglow .5s ease-in-out infinite alternate; }
.case-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; background: var(--gold); transform: translateX(-50%); box-shadow: 0 0 10px var(--gold); }
.case-marker::before, .case-marker::after { content: ""; position: absolute; left: 50%; transform: translateX(-50%); border: 7px solid transparent; }
.case-marker::before { top: 0; border-top-color: var(--gold); }
.case-marker::after { bottom: 0; border-bottom-color: var(--gold); }
.r-common { --rc: #94a3b8; } .r-uncommon { --rc: #4ade80; } .r-rare { --rc: #60a5fa; } .r-epic { --rc: #c084fc; } .r-legendary { --rc: #fbbf24; }
.paytable div.r-uncommon b { color: #4ade80; } .paytable div.r-rare b { color: #60a5fa; } .paytable div.r-epic b { color: #c084fc; } .paytable div.r-legendary b { color: #fbbf24; }


/* ------------------------------------------------------------ settings */

.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.set { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.set.wide { grid-column: 1 / -1; }
.set h3 { margin: 0 0 4px; font-size: 18px; color: var(--ink); display: flex; align-items: baseline; gap: 10px; }
.set .note { margin: 0 0 4px; border: none; padding: 0; }
.set .kv { margin: 0; }
.set .field { margin-bottom: 6px; }
.set input.mono { font-family: var(--mono); font-size: 12px; }
.set .chips .go { margin-top: 0; padding: 9px; font-size: 13px; }
.set a.go { display: grid; place-items: center; text-decoration: none; }
.stat-tiles.two { grid-template-columns: 1fr 1fr; }
#s-themes button[aria-pressed="true"] { background: var(--game, var(--accent)); color: #06111c; }
input[type=range] { width: 100%; accent-color: var(--game, var(--accent)); }
.log-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mini-select { background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: 6px; padding: 3px 6px; font-size: 12px; }
.vault-pill { background: var(--gain-bg); color: var(--gain); border: 1px solid var(--gain); border-radius: 999px; padding: 4px 12px; font-size: 12px; cursor: pointer; align-self: center; }
.vault-pill b { font-weight: 700; }

/* themes: only the surfaces change; game colours and win/loss stay */
body[data-theme="felt"] { --bg: #0b1a12; --panel: #10221a; --surface: #152a20; --inset: #1c3529; --raised: #244333; --rule: #2c4d3a; --shim: #9dbba8; --dim: #628a72; }
body[data-theme="noir"] { --bg: #0d0d0d; --panel: #141414; --surface: #1a1a1a; --inset: #232323; --raised: #2c2c2c; --rule: #363636; --shim: #a8a8a8; --dim: #6e6e6e; --accent: #e5e5e5; --brass: #e5e5e5; --gold: #ffffff; }
body[data-theme="sunset"] { --bg: #1a0f14; --panel: #22141b; --surface: #2b1a22; --inset: #37222c; --raised: #442b37; --rule: #533544; --shim: #c7a4b5; --dim: #8a6a7a; --accent: #e8927c; --brass: #e8927c; }
body[data-theme="ivory"] { --bg: #efe7d8; --panel: #f6f0e4; --surface: #fbf7ef; --inset: #e8dfcd; --raised: #ddd2bd; --rule: #d3c7b0; --ink: #1f1a15; --shim: #6d6254; --dim: #9a8e7c; --gain: #2e8b57; --gain-bg: #dcefe2; --loss: #b8433a; --loss-bg: #f5dcd8; --live: #b57d1e; --live-bg: #f3e7cf; --accent: #9a6f1f; --brass: #9a6f1f; --gold: #b8892a; }
body[data-theme="ivory"] { background-image: none; }
body[data-theme="ivory"] .go { color: #fff; }


/* ------------------------------------------------------------ accounts */

.who { display: flex; align-items: center; gap: 6px; background: transparent; border: 1px solid var(--rule); border-radius: 4px; padding: 3px 10px 3px 6px; color: var(--ink); font-weight: 600; font-size: 13px; cursor: pointer; align-self: center; }
.who:hover { border-color: var(--brass); }
.who span:first-child { font-size: 16px; }
.online-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gain); margin-left: 4px; vertical-align: middle; box-shadow: 0 0 6px var(--gain); }
.auth { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: radial-gradient(900px 500px at 50% 0%, rgba(215,169,77,0.12), transparent 60%), rgba(14, 12, 10, 0.97); }
.auth[hidden] { display: none; }
.auth-card { width: min(400px, 92vw); background: var(--surface); border: 1px solid var(--rule); border-radius: var(--r); padding: 28px 26px 22px; box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(215,169,77,0.08); display: flex; flex-direction: column; gap: 12px; position: relative; }
.auth-card::before { content: ""; position: absolute; inset: 6px; border: 1px solid rgba(215,169,77,0.18); border-radius: 3px; pointer-events: none; }
.auth-brand { text-align: center; color: var(--brass); }
.auth-brand h1 { margin: 10px 0 2px; font-size: 28px; font-weight: 600; color: var(--ink); }
.auth-brand p { margin: 0; color: var(--shim); font-size: 14px; font-family: var(--serif); font-style: italic; }
.auth-tabs { display: flex; justify-content: center; gap: 22px; border-bottom: 1px solid var(--rule); }
.auth-tabs button { background: none; border: none; color: var(--shim); font-size: 11px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; padding: 8px 2px; border-bottom: 2px solid transparent; margin-bottom: -1px; cursor: pointer; }
.auth-tabs button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--brass); }
.auth-links { margin: 10px 0 0; text-align: center; font-size: 12px; }
.auth-links a { color: var(--shim); }
.auth-links a:hover { color: var(--brass); }
.logo-dot.big { width: 22px; height: 22px; display: inline-block; }
.auth .err { margin: 0; }
.avatar-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; }
.avatar-grid button { font-size: 20px; padding: 4px 0; background: var(--panel); border: 1px solid var(--rule); border-radius: 6px; cursor: pointer; }
.avatar-grid button[aria-pressed="true"] { border-color: var(--accent); background: var(--inset); box-shadow: 0 0 0 2px var(--accent); }
.auth-live { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--shim); max-height: 110px; overflow: hidden; }
.auth-live div b { color: var(--ink); }
.acct-row { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.acct-avatar { font-size: 28px; }

/* ------------------------------------------------------------- live page */

.live { width: 100%; }
.live-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
.lb-tabs { margin-bottom: 10px; }
.lb-tabs button[aria-pressed="true"] { background: var(--accent); color: #06111c; border-color: var(--accent); }
.log td.who-cell { display: flex; align-items: center; gap: 8px; }
.log td.who-cell .av { font-size: 16px; }
.log td.who-cell .me { color: var(--live); font-size: 10px; font-weight: 700; letter-spacing: .06em; }
.log td.rank { color: var(--dim); width: 28px; }
.live-feed { display: flex; flex-direction: column; gap: 6px; max-height: 480px; overflow: auto; }
.live-item { display: flex; align-items: center; gap: 10px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font-size: 13px; animation: toastin .3s ease-out; }
.live-item .av { font-size: 20px; }
.live-item .what { flex: 1; color: var(--shim); }
.live-item .what b { color: var(--ink); }
.live-item .amt { font-weight: 700; color: var(--gain); }
.live-item .mult { font-size: 11px; color: var(--gold); font-weight: 700; }
.live-item .when { font-size: 11px; color: var(--dim); }
.ticker { display: flex; align-items: center; gap: 12px; margin-bottom: var(--gap); background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 14px; overflow: hidden; }
.ticker-label { font-size: 11px; font-weight: 800; letter-spacing: .1em; color: var(--gain); }
.ticker-track { display: flex; gap: 28px; white-space: nowrap; font-size: 12px; color: var(--shim); animation: tick 40s linear infinite; }
.ticker-track b { color: var(--ink); } .ticker-track .up { color: var(--gain); font-weight: 700; }
@keyframes tick { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (max-width: 900px) { .live-grid { grid-template-columns: 1fr; } }


/* ------------------------------------------------------------- lobbies */

.online-link { color: var(--gold) !important; }
.lobby-bar { display: flex; align-items: center; gap: 14px; padding: 6px 22px; background: linear-gradient(90deg, #3b2a08, #1a1408); border-bottom: 1px solid #6b4e12; font-size: 13px; }
.lobby-bar[hidden] { display: none; }
.lb-code { font-family: var(--mono); font-weight: 700; letter-spacing: .15em; color: var(--gold); background: rgba(0,0,0,0.35); padding: 2px 8px; border-radius: 6px; }
.lb-name { font-weight: 600; }
.lb-clock { font-family: var(--mono); font-weight: 700; font-size: 15px; color: var(--ink); }
.lb-clock.urgent { color: var(--loss); animation: pulse 1s infinite; }
.lb-me { color: var(--shim); } .lb-me b { color: var(--ink); }
.lb-teams { display: flex; gap: 10px; font-weight: 600; }
.lb-teams .t0 { color: #f87171; } .lb-teams .t1 { color: #60a5fa; }
.lb-link { color: var(--gold); text-decoration: none; font-weight: 600; }
.lb-link:hover { color: var(--ink); }

.online-page { width: 100%; }
.online-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.online-grid .set h3 { font-size: 14px; }
.lobby-list { display: flex; flex-direction: column; gap: 6px; }
.lobby-row { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; font-size: 13px; }
.lobby-row .nm { font-weight: 700; flex: 1; }
.lobby-row .meta { color: var(--shim); font-size: 12px; }
.lobby-row .go { width: auto; margin: 0; padding: 7px 14px; font-size: 13px; }
.room-code { text-align: center; padding: 14px; background: var(--panel); border: 1px dashed var(--gold); border-radius: 12px; }
.room-code .code { font-family: var(--mono); font-size: 40px; font-weight: 800; letter-spacing: .25em; color: var(--gold); }
.room-code .hint { color: var(--shim); font-size: 12px; }
.room-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.team-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-col { background: var(--panel); border: 1px solid var(--rule); border-radius: 10px; padding: 10px; border-top: 3px solid var(--tc); }
.team-col.t0 { --tc: #f87171; } .team-col.t1 { --tc: #60a5fa; }
.team-col h4 { margin: 0 0 6px; font-size: 13px; color: var(--tc); display: flex; justify-content: space-between; }
.plist { display: flex; flex-direction: column; gap: 4px; }
.prow { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 5px 8px; border-radius: 6px; background: rgba(255,255,255,0.03); }
.prow .av { font-size: 18px; } .prow .nm { flex: 1; font-weight: 600; }
.prow .host { font-size: 10px; color: var(--gold); font-weight: 800; letter-spacing: .08em; }
.prow .me { font-size: 10px; color: var(--live); font-weight: 800; letter-spacing: .08em; }
.prow .away { opacity: .45; }
.standings .log td.rank { width: 30px; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 10px 0 16px; }
.podium .step { text-align: center; background: var(--panel); border: 1px solid var(--rule); border-radius: 10px 10px 4px 4px; padding: 10px 14px; min-width: 120px; }
.podium .step.p1 { border-color: var(--gold); padding-top: 22px; box-shadow: 0 0 30px rgba(255,209,102,0.25); }
.podium .step .av { font-size: 34px; } .podium .step .nm { font-weight: 800; }
.podium .step .amt { color: var(--gain); font-weight: 700; }
.minutes-row { display: flex; align-items: center; gap: 10px; } .minutes-row b { min-width: 60px; }

/* ---------------------------------------------------------- poker table */

.poker-page { padding: var(--gap); max-width: 1240px; margin: 0 auto; }
.poker-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; }
.poker-head h2 { margin: 0; }
.poker-head .back { color: var(--shim); text-decoration: none; font-weight: 600; }
.go.small { width: auto; padding: 7px 14px; font-size: 13px; margin: 0; }
.poker-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: var(--gap); }
.poker-felt { position: relative; height: 560px; border-radius: 280px / 200px; background: radial-gradient(ellipse at 50% 40%, #1f6b3a, #14532d 60%, #0f3d22); border: 14px solid #3f2a1c; box-shadow: inset 0 0 60px rgba(0,0,0,0.5), 0 20px 60px rgba(0,0,0,0.5); }
.felt-center { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.felt-center .cards { min-height: 82px; justify-content: center; flex-wrap: nowrap; }
.felt-center .card.slot { background: rgba(255,255,255,0.06); box-shadow: none; border: 1px dashed rgba(255,255,255,0.2); animation: none; }
.pot { background: rgba(0,0,0,0.4); color: var(--gold); font-weight: 800; padding: 4px 14px; border-radius: 999px; font-size: 14px; }
.stage-tag { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #bbf7d0; }
.seat { position: absolute; width: 150px; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.seat .plate { display: flex; align-items: center; gap: 7px; background: rgba(6,17,28,0.9); border: 2px solid var(--rule); border-radius: 999px; padding: 4px 10px 4px 6px; font-size: 12px; min-width: 140px; }
.seat.acting .plate { border-color: var(--live); box-shadow: 0 0 16px rgba(255,184,77,0.6); }
.seat.folded { opacity: .5; }
.seat.me .plate { border-color: var(--gain); }
.seat .av { font-size: 18px; }
.seat .nm { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .stk { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.seat .hole { display: flex; gap: 3px; }
.seat .hole .card { width: 34px; height: 48px; animation: none; }
.seat .hole .card .rank { font-size: 12px; top: 3px; left: 4px; } .seat .hole .card .suit { font-size: 14px; bottom: 2px; right: 4px; }
.seat .hole .card.mini { position: static; }
.seat .bet-chip { position: absolute; background: var(--gold); color: #06111c; font-weight: 800; font-size: 11px; padding: 2px 8px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,0.5); }
.seat .act { font-size: 11px; color: var(--shim); background: rgba(0,0,0,0.4); padding: 1px 8px; border-radius: 999px; }
.seat .won { color: var(--gain); font-weight: 800; font-size: 12px; }
.seat .timer { width: 120px; height: 4px; background: rgba(0,0,0,0.5); border-radius: 2px; overflow: hidden; }
.seat .timer > span { display: block; height: 100%; background: var(--live); }
.dealer-btn { position: absolute; width: 20px; height: 20px; border-radius: 50%; background: #f8fafc; color: #06111c; font-weight: 800; font-size: 10px; display: grid; place-items: center; border: 2px solid #94a3b8; }
.empty-seat { position: absolute; transform: translate(-50%, -50%); }
.empty-seat button { background: rgba(0,0,0,0.35); border: 1px dashed rgba(255,255,255,0.35); color: #bbf7d0; border-radius: 999px; padding: 6px 14px; font-size: 12px; cursor: pointer; }
.empty-seat button:hover { border-color: var(--gold); color: var(--gold); }
.poker-side { display: flex; flex-direction: column; gap: 10px; }
.poker-actions { background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.poker-actions .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.poker-actions .go { margin: 0; padding: 11px; font-size: 14px; }
.poker-actions .go.fold { background: var(--loss); color: var(--ink); }
.poker-actions .go.call { background: var(--gain); color: #06111c; }
.poker-actions .go.raise { background: var(--gold); color: #06111c; }
.poker-actions .quick { display: flex; gap: 4px; }
.poker-actions .quick button { flex: 1; font-size: 11px; padding: 4px; }
.poker-actions .waiting { color: var(--shim); font-size: 13px; text-align: center; padding: 20px 0; }
.mycards { display: flex; gap: 8px; justify-content: center; margin-bottom: 4px; }
.mycards .card { width: 66px; height: 92px; animation: none; }
.mycards .card .rank { font-size: 20px; } .mycards .card .suit { font-size: 28px; }
.poker-log { background: var(--panel); border: 1px solid var(--rule); border-radius: 8px; padding: 8px 10px; font-size: 12px; color: var(--shim); display: flex; flex-direction: column; gap: 3px; max-height: 260px; overflow: auto; }
.poker-log div b { color: var(--ink); }
.turn-bar { height: 5px; background: var(--panel); border-radius: 3px; overflow: hidden; }
.turn-bar > span { display: block; height: 100%; background: var(--live); transition: width .3s linear; }
.showdown-banner { position: absolute; left: 50%; top: 72%; transform: translateX(-50%); background: rgba(6,17,28,0.9); border: 1px solid var(--gold); color: var(--gold); font-weight: 800; padding: 6px 16px; border-radius: 999px; font-size: 13px; white-space: nowrap; animation: slam .4s; }
@media (max-width: 1000px) { .poker-layout { grid-template-columns: 1fr; } .poker-felt { height: 460px; } .online-grid, .room-grid { grid-template-columns: 1fr; } }


/* ------------------------------------------------------------- account */

.acct-meta { font-size: 12px; color: var(--dim); }
.fold { border-top: 1px solid var(--rule); padding-top: 8px; margin-top: 4px; }
.fold summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--shim); list-style: none; display: flex; align-items: center; gap: 8px; }
.fold summary::before { content: "›"; font-family: var(--serif); font-size: 16px; color: var(--brass); transition: transform .12s; }
.fold[open] summary::before { transform: rotate(90deg); }
.fold summary:hover { color: var(--ink); }
.fold form, .fold > .note { margin-top: 10px; }
.fold.danger summary::before { color: var(--loss); }
.fold-tag { font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--rule); padding: 1px 6px; border-radius: 3px; }
.strength { height: 3px; margin-top: 6px; border-radius: 2px; background: var(--inset); position: relative; font-size: 10px; color: var(--dim); text-align: right; line-height: 16px; }
.strength::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; border-radius: 2px; width: 0; background: var(--loss); transition: width .2s, background .2s; }
.strength[data-level="1"]::before { width: 25%; }
.strength[data-level="2"]::before { width: 50%; background: var(--live); }
.strength[data-level="3"]::before { width: 75%; background: var(--gain); }
.strength[data-level="4"]::before { width: 100%; background: var(--gain); }
.code-card { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 12px; background: var(--bg); border: 1px dashed var(--brass); border-radius: 4px; font-size: 12px; color: var(--shim); }
.code-card .code { font-family: var(--mono); font-size: 20px; letter-spacing: 0.12em; color: var(--ink); flex: 1; }
.code-card .go { width: auto; margin: 0; padding: 7px 12px; }
.logins { display: flex; flex-direction: column; font-size: 12px; }
.login-row { display: grid; grid-template-columns: 72px 1fr auto; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--inset); color: var(--shim); }
.login-row .when { color: var(--dim); font-family: var(--mono); font-size: 11px; }
.login-row .how { color: var(--dim); }
.login-row.bad .how { color: var(--loss); }
.host-table-wrap { overflow-x: auto; }
.host-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.host-table th { text-align: left; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); padding: 6px 8px; border-bottom: 1px solid var(--rule); font-weight: 600; }
.host-table td { padding: 7px 8px; border-bottom: 1px solid var(--inset); vertical-align: middle; }
.host-table td.num { font-family: var(--mono); text-align: right; }
.host-table tr.off td { opacity: .5; }
.host-table .who-cell i { font-style: italic; color: var(--dim); font-family: var(--serif); }
.host-table .acts { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.host-table .dim { color: var(--dim); font-style: italic; font-family: var(--serif); }
.dot.on { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--gain); vertical-align: middle; box-shadow: 0 0 6px var(--gain); }
button.mini { background: transparent; border: 1px solid var(--rule); border-radius: 3px; color: var(--shim); font-size: 11px; padding: 3px 8px; cursor: pointer; white-space: nowrap; }
button.mini:hover { border-color: var(--brass); color: var(--ink); }
button.mini.armed { background: var(--loss); border-color: var(--loss); color: #fff; }
.toast.bad { border-left: 3px solid var(--loss); }
.chit { position: relative; }
.chit::before { content: ""; position: absolute; inset: 5px; border: 1px dashed rgba(215,169,77,0.22); border-radius: 3px; pointer-events: none; }
code { font-family: var(--mono); font-size: 12px; background: var(--bg); padding: 1px 5px; border-radius: 3px; border: 1px solid var(--rule); }
@media (max-width: 1100px) {
  .tallies { display: none; }
  .wm-sub { display: none; }
  .readout .value.balance { font-size: 22px; }
  .bar { gap: 8px 14px; padding: 8px 14px; }
  .ledger { padding-left: 14px; gap: 10px; }
  .tools { padding-left: 10px; }
}
/* Nothing on the page may widen it; tables and boards scroll inside their own boxes. */
body { overflow-x: clip; }
@media (max-width: 760px) {
  .bar { flex-wrap: wrap; gap: 10px 16px; }
  .ledger { border-left: none; padding-left: 0; flex-wrap: wrap; gap: 10px; }
  .lib-title { font-size: 30px; }
}

/* monograms: the one identity mark, derived from the name, never picked */
.mono-av {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  font-family: var(--serif); font-weight: 600; font-size: 12px; line-height: 1; color: var(--bg);
  background: hsl(var(--h) 38% 62%); flex: none; vertical-align: middle; margin-right: 6px;
}
.mono-av.big { width: 36px; height: 36px; font-size: 18px; }
.acct-avatar .mono-av { width: 40px; height: 40px; font-size: 20px; margin: 0; }
td.rank { font-family: var(--serif); color: var(--dim); font-size: 14px; width: 28px; }
.icon-btn { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--shim); }
.icon-btn[aria-pressed="true"] { color: var(--ink); }
