:root {
  --night: #0F1122;
  --night-2: #171A33;
  --velvet: #20233F;
  --velvet-deep: #141630;
  --marigold: #D9AC4F;
  --marigold-soft: #F2D58A;
  --gold-deep: #9C7524;
  --sindoor: #C8283E;
  --ivory: #F6F0E4;
  --ink: #1A1408;
  --text: #EFEBE0;
  --muted: #A9A9C4;
  --line: rgba(176, 180, 214, 0.14);
  --gold-line: rgba(217, 172, 79, 0.32);
  --leaf: #3FB37F;

  --font-display: 'Playfair Display', 'Lora', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', 'Inter Display', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.8125rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.5625rem;
  --step-3: 2.4414rem;
  --step-4: 3.0518rem;

  --nav-h: 64px;
  --back-bg:
    radial-gradient(circle at 50% 50%, #F4D98C 0 8%, #8E1B2E 9% 14%, #F4D98C 15% 17%, transparent 18%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(217, 172, 79, .3) 0 9deg, transparent 9deg 18deg),
    radial-gradient(ellipse at 50% 45%, #4A39C0 0%, #2B2283 55%, #19144F 100%);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--night);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--marigold); outline-offset: 2px; border-radius: 6px; }
a { color: var(--marigold-soft); }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ------------------------------------------------------------ chips amount */
.amt { font-variant-numeric: tabular-nums; white-space: nowrap; }
.amt::before {
  content: '';
  display: inline-block;
  width: 0.78em; height: 0.78em;
  margin-right: 0.3em;
  vertical-align: -0.06em;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, var(--marigold) 0 38%, #C9830A 39% 48%, var(--marigold) 49% 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25) inset;
}

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4em;
  min-height: 44px; padding: 0 1.1rem;
  border: 0; border-radius: 12px;
  background: var(--night-2); color: var(--text);
  font-weight: 600; letter-spacing: 0.01em;
  transition: transform 80ms ease, filter 120ms ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.38; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--marigold); color: var(--ink); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { background: transparent; border: 1px solid var(--line); }
.btn-danger { background: transparent; border: 1px solid rgba(215, 38, 61, .6); color: #FF9AA6; }
.btn-block { width: 100%; }
.btn small { font-weight: 500; opacity: .8; }

/* ------------------------------------------------------------------- inputs */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: var(--step--1); color: var(--muted); font-weight: 500; }
.field input {
  min-height: 48px; padding: 0 14px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px;
}
.field input:focus { border-color: var(--marigold); outline: none; box-shadow: 0 0 0 3px rgba(217,172,79,.25); }
.field .hint { font-size: var(--step--1); color: var(--muted); }
.form-error { color: #FF9AA6; font-size: var(--step--1); min-height: 1.4em; margin: -4px 0 8px; }

/* ------------------------------------------------------------------ game buttons */
.gbtn {
  --top: #3A3480; --bot: #26215E; --edge: #15123A; --fg: #FFFFFF;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 18px;
  border: 0; border-radius: 14px;
  color: var(--fg); font-weight: 700; font-size: 1rem; line-height: 1.1;
  background: linear-gradient(180deg, var(--top), var(--bot));
  box-shadow: 0 4px 0 var(--edge), 0 10px 20px rgba(5, 2, 25, .45), inset 0 1px 0 rgba(255, 255, 255, .38), inset 0 -2px 0 rgba(0, 0, 0, .12);
  text-shadow: 0 1px 0 rgba(0, 0, 0, .18);
  transition: transform 90ms ease, box-shadow 90ms ease, filter 150ms ease;
}
.gbtn:hover:not(:disabled) { filter: brightness(1.08); }
.gbtn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 4px 10px rgba(5, 2, 25, .4), inset 0 1px 0 rgba(255, 255, 255, .3); }
.gbtn:disabled { cursor: not-allowed; filter: saturate(.25) brightness(.55); box-shadow: 0 2px 0 var(--edge), inset 0 1px 0 rgba(255,255,255,.12); }
.gbtn .gb-ic { display: grid; place-items: center; flex: none; }
.gbtn .gb-ic svg { width: 20px; height: 20px; }
.gbtn .gb-tx { display: grid; text-align: left; }
.gbtn small { font-weight: 600; font-size: .78rem; opacity: .9; margin-top: 2px; }
.gbtn small .amt::before { width: .85em; height: .85em; }
.gbtn.sm { min-height: 42px; padding: 0 14px; font-size: .92rem; border-radius: 12px; }
.gbtn.gold { --top: #F4D98C; --bot: #D9AC4F; --edge: #A06400; --fg: #1A1408; text-shadow: 0 1px 0 rgba(255, 255, 255, .35); }
.gbtn.orange { --top: #FFA066; --bot: #E8590C; --edge: #943300; }
.gbtn.red { --top: #F2607A; --bot: #C21D36; --edge: #7A0C1F; }
.gbtn.teal { --top: #45D6B4; --bot: #149178; --edge: #0A5646; }
.gbtn.violet { --top: #AE8CFF; --bot: #6A3FE0; --edge: #3A1D90; }
.gbtn.blue { --top: #78AEFF; --bot: #3266D9; --edge: #1A3A8C; }
.gbtn.dim { --top: #3A3480; --bot: #2B2668; --edge: #17133F; --fg: var(--muted); }

/* ------------------------------------------------------------------ chips */
.chip-disc {
  --c: var(--marigold);
  display: inline-block; width: 22px; height: 22px; border-radius: 50%; flex: none;
  background:
    radial-gradient(circle, var(--c) 0 36%, rgba(255, 246, 230, .95) 37% 42%, var(--c) 43% 60%, transparent 61%),
    repeating-conic-gradient(from 8deg, var(--c) 0 30deg, #FFF6E6 30deg 45deg);
  box-shadow: 0 1.5px 0 rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(0, 0, 0, .18);
}
.stack { position: relative; display: inline-block; width: 22px; }
.stack .chip-disc { position: absolute; left: 0; }

/* ------------------------------------------------------------------ cards */
.card {
  --w: 54px;
  width: var(--w); height: calc(var(--w) * 1.4);
  border-radius: calc(var(--w) * 0.09);
  position: relative; flex: none; overflow: hidden;
  color: #1C1733;
  background: linear-gradient(165deg, #FFFEFA 0%, #FCF5E6 55%, #F3E6C8 100%);
  box-shadow: inset 0 0 0 1px rgba(120, 90, 40, .18), 0 2px 0 rgba(0, 0, 0, .22), 0 8px 18px rgba(6, 3, 30, .45);
  font-family: var(--font-body); font-weight: 700; line-height: 1;
}
.card.red { color: #C8102E; }
.card svg { display: block; fill: currentColor; }
.card .ci {
  position: absolute; display: grid; justify-items: center; gap: calc(var(--w) * 0.02);
  font-size: calc(var(--w) * 0.21); letter-spacing: -0.07em;
}
.card .ci b { font-weight: 700; }
.card .ci svg { width: calc(var(--w) * 0.14); height: calc(var(--w) * 0.14); }
.card .ci.tl { top: 4.5%; left: 5%; }
.card .ci.br { bottom: 4.5%; right: 5%; transform: rotate(180deg); }

.card .center {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: calc(var(--w) * 0.52); height: calc(var(--w) * 0.52);
}
.card.ace .center { width: calc(var(--w) * 0.66); height: calc(var(--w) * 0.66); }
.card.court .center { width: calc(var(--w) * 0.62); height: calc(var(--w) * 0.62); }
.card .center svg { width: 100%; height: 100%; filter: drop-shadow(0 1.5px 0 rgba(0, 0, 0, .14)); }
.card .center .cl {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  font-family: var(--font-display); font-weight: 400; line-height: 1;
  font-size: calc(var(--w) * 0.27); color: #FFF8EC; letter-spacing: 0;
}
.card.s-H .center .cl { top: 42%; }
.card.s-S .center .cl { top: 54%; }
.card.s-C .center .cl { top: 47%; }
.card.court { background: linear-gradient(165deg, #FFFDF4 0%, #FBF0D6 55%, #F0DDB0 100%); box-shadow: inset 0 0 0 1px rgba(138, 90, 0, .35), inset 0 0 0 calc(var(--w) * 0.035) rgba(255, 254, 250, .8), inset 0 0 0 calc(var(--w) * 0.045) rgba(201, 150, 47, .45), 0 2px 0 rgba(0, 0, 0, .22), 0 8px 18px rgba(6, 3, 30, .45); }
.card .sm-suit { display: none; }

.card.back {
  background: var(--back-bg);
  border: calc(var(--w) * 0.06) solid #FFF6E6;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .22), 0 8px 18px rgba(6, 3, 30, .45);
}
.card.back::after {
  content: ''; position: absolute; inset: 5%;
  border-radius: calc(var(--w) * 0.05);
  border: 1px solid rgba(217, 172, 79, .75);
}

/* Small cards (other players, history): large index plus one big suit */
.hand.sm .card .center, .hand.sm .card .ci.br { display: none; }
.hand.sm .card .ci.tl { top: 6%; left: 9%; font-size: calc(var(--w) * 0.4); gap: 0; }
.hand.sm .card .ci.tl svg { display: none; }
.hand.sm .card .sm-suit { display: block; position: absolute; right: 8%; bottom: 7%; width: calc(var(--w) * 0.48); height: calc(var(--w) * 0.48); }

.hand { display: flex; }
.hand .card + .card { margin-left: calc(var(--w, 54px) * -0.42); }
.hand .card { transform: var(--rest, none); }
.hand.fan .card + .card { margin-left: calc(var(--w, 54px) * -0.3); }
.hand.fan .card:nth-child(1) { --rest: rotate(-11deg) translateY(6px); }
.hand.fan .card:nth-child(3) { --rest: rotate(11deg) translateY(6px); }

/* ------------------------------------------------------------------ auth */
.auth {
  min-height: 100%;
  display: grid; place-items: center;
  padding: 32px 20px calc(32px + var(--safe-b));
}
.auth-inner { width: 100%; max-width: 380px; }
.brand { text-align: center; margin-bottom: 28px; }
.brand .hand { justify-content: center; margin-bottom: 18px; }
.brand .hand .card { --w: 76px; }
.wordmark { font-family: var(--font-display); font-weight: 400; font-size: var(--step-4); color: var(--marigold); letter-spacing: 0.01em; }
.brand p { color: var(--muted); margin: 4px 0 0; }
.logo { display: block; flex: none; }
.logo-hero { width: 96px; height: 96px; margin: 0 auto 16px; border-radius: 22px; box-shadow: 0 14px 34px rgba(0, 0, 0, .45), 0 0 0 1px rgba(217, 172, 79, .25); }
.logo-mid { width: 60px; height: 60px; margin: 0 auto 10px; border-radius: 14px; box-shadow: 0 8px 20px rgba(0, 0, 0, .4); }
.logo-sm { width: 30px; height: 30px; border-radius: 8px; box-shadow: 0 0 0 1px rgba(217, 172, 79, .3); }
.brandline { display: inline-flex; align-items: center; gap: 9px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: rgba(255,255,255,.05); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.tabs button { border: 0; background: transparent; min-height: 40px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.tabs button[aria-selected="true"] { background: var(--velvet); color: var(--text); }
.bonus-note { font-size: var(--step--1); color: var(--muted); text-align: center; margin-top: 14px; }

/* ------------------------------------------------------------------ shell */
.shell { min-height: 100%; padding-bottom: calc(var(--nav-h) + var(--safe-b) + 12px); }
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  background: rgba(15, 17, 34, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar .wordmark { font-size: var(--step-2); }
.balance-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(217, 172, 79, .12); color: var(--marigold-soft);
  font-weight: 700; font-size: var(--step-0);
}
.page { max-width: 720px; margin: 0 auto; padding: 20px 16px; }
.page h1 { font-size: var(--step-2); margin-bottom: 4px; }
.page .sub { color: var(--muted); margin: 0 0 20px; }
.section-title { font-size: var(--step-1); margin: 28px 0 10px; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--night-2); border-top: 1px solid var(--line);
}
.bottom-nav button {
  border: 0; background: transparent; color: var(--muted);
  display: grid; place-items: center; align-content: center; gap: 2px;
  font-size: 0.75rem; font-weight: 600;
}
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav button[aria-current="page"] { color: var(--marigold); }

@media (min-width: 900px) {
  .bottom-nav { top: 0; bottom: auto; left: auto; right: 0; width: auto; height: auto; grid-template-columns: repeat(4, auto); background: transparent; border: 0; padding: 10px 16px; gap: 4px; }
  .bottom-nav button { grid-auto-flow: column; gap: 8px; padding: 8px 14px; border-radius: 10px; font-size: var(--step--1); }
  .bottom-nav button[aria-current="page"] { background: rgba(217,172,79,.12); }
  .bottom-nav svg { width: 18px; height: 18px; }
  .shell { padding-bottom: 24px; }
  .topbar { padding-right: 460px; }
}

/* ------------------------------------------------------------------ lobby */
.lobby-hero { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.lobby-hero h1 { font-family: var(--font-display); font-weight: 400; color: var(--marigold); font-size: var(--step-3); line-height: 1.1; }
.lobby-hero .sub { margin: 6px 0 0; }

.daily {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 12px 14px; margin-bottom: 8px; border-radius: 16px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(135deg, #2A2268, #1E1955) padding-box,
    linear-gradient(120deg, rgba(217,172,79,.35), rgba(215,38,61,.25), rgba(217,172,79,.35)) border-box;
}
.daily.ready {
  background:
    linear-gradient(135deg, #3A2A6E, #241C5E) padding-box,
    linear-gradient(120deg, #F4D98C, #D7263D, #F4D98C) border-box;
}
.daily-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: rgba(217,172,79,.14); color: var(--marigold); }
.daily-icon svg { width: 24px; height: 24px; }
.daily-text { display: grid; line-height: 1.3; }
.daily-text span { color: var(--muted); font-size: var(--step--1); }

/* Custom bonuses: a ticket with a tear-off stub */
.promos { display: grid; gap: 8px; margin-bottom: 8px; }
.promo {
  --notch: 9px;
  position: relative; display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 14px;
  padding-right: 14px; min-height: 76px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(120deg, #4A2470, #2A1D63 55%, #22195A);
  box-shadow: inset 0 0 0 1.5px rgba(255, 216, 120, .55), 0 10px 24px rgba(0, 0, 0, .3);
}
.promo-stub {
  align-self: stretch; display: grid; place-content: center; justify-items: center; gap: 1px; padding: 8px 4px;
  background: linear-gradient(160deg, #FFE29A, #D9AC4F 60%, #C9820F); color: #1A1408; text-align: center;
  border-right: 2px dashed rgba(42, 24, 0, .35);
}
.promo-stub span svg { width: 18px; height: 18px; display: block; }
.promo-stub b { font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; line-height: 1.05; }
.promo-stub small { font-size: .66rem; font-weight: 700; opacity: .75; }
/* the two notches where the stub tears off */
.promo::before, .promo::after {
  content: ''; position: absolute; left: calc(84px - var(--notch)); width: calc(var(--notch) * 2); height: calc(var(--notch) * 2);
  border-radius: 50%; background: var(--night);
}
.promo::before { top: calc(var(--notch) * -1); }
.promo::after { bottom: calc(var(--notch) * -1); }
.promo-body { display: grid; gap: 2px; min-width: 0; padding: 10px 0; line-height: 1.3; }
.promo-body strong { color: #FFE29A; font-size: 1.02rem; }
.promo-body p { margin: 0; color: rgba(233, 228, 255, .85); font-size: var(--step--1); }
.promo-exp { color: var(--muted); font-size: .76rem; font-weight: 600; }
.promo-exp.soon { color: #FF9AA8; }
@media (max-width: 380px) { .promo { grid-template-columns: 70px 1fr auto; gap: 10px; } .promo::before, .promo::after { left: calc(70px - var(--notch)); } .promo-stub b { font-size: 1.1rem; } }

.table-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.table-card {
  --tier: var(--marigold);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px;
  padding: 14px; border-radius: 18px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--tier) 26%, #221D5C) 0%, #201A57 55%, #1C174E 100%);
  border: 1px solid color-mix(in srgb, var(--tier) 45%, transparent);
  box-shadow: 0 10px 24px rgba(5, 2, 25, .35), inset 0 1px 0 rgba(255,255,255,.06);
}
.mini-table { position: relative; width: 76px; height: 54px; flex: none; }
.mini-felt {
  position: absolute; inset: 7px; border-radius: 50%;
  background: radial-gradient(ellipse at 50% 38%, color-mix(in srgb, var(--tier) 80%, white 12%), color-mix(in srgb, var(--tier) 55%, #0C0828));
  box-shadow: 0 0 0 3px #4A2414, 0 0 0 4.5px #C9962F, 0 6px 12px rgba(0,0,0,.4);
}
.mini-seat { position: absolute; width: 10px; height: 10px; border-radius: 50%; transform: translate(-50%, -50%); background: #3A3480; box-shadow: 0 0 0 2px #1C174E; }
.mini-seat.on { background: #F4D98C; box-shadow: 0 0 0 2px #1C174E, 0 0 8px rgba(255, 216, 120, .7); }
.tc-body { min-width: 0; }
.tc-body h3 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); line-height: 1.15; }
.tc-boot { display: flex; align-items: center; gap: 6px; margin-top: 3px; }
.tc-boot .chip-disc { width: 18px; height: 18px; }
.tc-boot b { font-size: var(--step-1); font-variant-numeric: tabular-nums; }
.tc-boot span { color: var(--muted); font-size: var(--step--1); }
.tc-meta { display: flex; flex-wrap: wrap; gap: 2px 12px; color: var(--muted); font-size: var(--step--1); margin-top: 2px; }
@media (max-width: 400px) {
  .table-card { grid-template-columns: auto 1fr; }
  .table-card .gbtn { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ table */
.game {
  position: fixed; inset: 0; z-index: 30; overflow: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  --horizon: 40%;
  background: linear-gradient(180deg, #070A26 0%, #0E1440 22%, #1E1F5E 33%, #4A2C6E calc(var(--horizon) - 2%), #7A3D6A var(--horizon), #1A1036 calc(var(--horizon) + .5%), #120B2C 70%, #0B0720 100%);
}
.game > :not(.room) { position: relative; z-index: 1; }
.game > .actions { z-index: 4; }
.room { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* Sky */
.room .stars {
  position: absolute; left: 0; right: 0; top: 0; height: var(--horizon);
  background-image:
    radial-gradient(1.2px 1.2px at 20px 30px, #FFF, transparent),
    radial-gradient(1px 1px at 90px 80px, #FFF, transparent),
    radial-gradient(1.4px 1.4px at 150px 20px, #FFF6D8, transparent),
    radial-gradient(1px 1px at 60px 140px, #FFF, transparent),
    radial-gradient(1.2px 1.2px at 180px 120px, #E6EBFF, transparent),
    radial-gradient(.9px .9px at 120px 170px, #FFF, transparent),
    radial-gradient(1px 1px at 10px 100px, #FFF, transparent);
  background-size: 200px 200px;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(180deg, #000 0%, #000 55%, transparent 100%);
  opacity: .8;
}
.room .stars.two {
  background-image:
    radial-gradient(1.6px 1.6px at 50px 60px, #FFF, transparent),
    radial-gradient(1.3px 1.3px at 230px 150px, #FFE9B0, transparent),
    radial-gradient(1px 1px at 270px 30px, #FFF, transparent),
    radial-gradient(1.5px 1.5px at 140px 250px, #DDE4FF, transparent);
  background-size: 300px 300px;
  animation: twinkle 5s ease-in-out infinite;
}
@keyframes twinkle { 50% { opacity: .35; } }
.room .moon {
  position: absolute; right: 9%; top: 8%; width: 78px; height: 78px; border-radius: 50%;
  background:
    radial-gradient(circle at 62% 38%, rgba(190, 170, 120, .35) 0 7%, transparent 8%),
    radial-gradient(circle at 38% 62%, rgba(190, 170, 120, .3) 0 10%, transparent 11%),
    radial-gradient(circle at 70% 70%, rgba(190, 170, 120, .25) 0 5%, transparent 6%),
    radial-gradient(circle at 40% 35%, #FFFBEF 0%, #F6EAC6 55%, #E2CD94 100%);
  box-shadow: 0 0 40px 10px rgba(255, 240, 200, .28), 0 0 140px 50px rgba(255, 220, 160, .12);
}
.room .skyline {
  position: absolute; left: 0; width: 100%; height: 200px;
  bottom: calc(100% - var(--horizon) - 1px);
}
.room .terrace {
  /* the terrace floor: soft marble tiles fading into the dark */
  position: absolute; left: 0; right: 0; top: var(--horizon); bottom: 0;
  background:
    radial-gradient(ellipse 70% 40% at 50% 0%, rgba(255, 170, 120, .18), transparent 70%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 90px),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 60px);
  -webkit-mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, .3));
          mask-image: linear-gradient(180deg, #000, rgba(0, 0, 0, .3));
}
.room::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 95% 85% at 50% 45%, transparent 60%, rgba(3, 2, 16, .55) 100%);
}
.sky-lantern {
  position: absolute; left: var(--x); bottom: -40px; width: 14px; height: 18px;
  border-radius: 40% 40% 30% 30%;
  background: radial-gradient(ellipse at 50% 70%, #FFF1C2 0%, #FFB547 45%, #D2561A 100%);
  box-shadow: 0 0 14px 5px rgba(255, 170, 70, .45), 0 0 40px 12px rgba(255, 140, 40, .15);
  transform: scale(var(--s));
  animation: rise-lantern var(--t) linear var(--d) infinite;
  opacity: 0;
}
@keyframes rise-lantern {
  0% { transform: translate(0, 0) scale(var(--s)); opacity: 0; }
  8% { opacity: .95; }
  50% { transform: translate(18px, -55vh) scale(calc(var(--s) * .8)); }
  85% { opacity: .7; }
  100% { transform: translate(-6px, -105vh) scale(calc(var(--s) * .55)); opacity: 0; }
}

/* Table */
.rug {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(98%, 1180px); height: 84%;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 58%, rgba(0, 0, 0, .25) 70%),
    repeating-conic-gradient(from 0deg at 50% 50%, rgba(233, 190, 91, .08) 0 4deg, transparent 4deg 8deg),
    radial-gradient(ellipse at 50% 50%, #7A1230 0%, #5A0C24 60%, #3E0718 100%);
  box-shadow: inset 0 0 0 3px rgba(233, 190, 91, .55), inset 0 0 0 10px rgba(62, 7, 24, .9), inset 0 0 0 12px rgba(233, 190, 91, .35), 0 20px 60px rgba(0, 0, 0, .5);
  opacity: .9;
}
.table-shadow {
  position: absolute; left: 50%; top: 80%; width: min(82%, 1000px); height: 50px; transform: translate(-50%, -50%);
  border-radius: 50%; background: radial-gradient(ellipse, rgba(3, 1, 15, .75), transparent 70%); filter: blur(8px);
}
.table-rim {
  position: absolute; inset: 12% max(6%, calc(50% - 520px)) 22%;
  border-radius: 50% / 47%;
  background:
    radial-gradient(ellipse 60% 16% at 50% 2%, rgba(255, 255, 255, .7), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='turbulence' baseFrequency='.012 .03' numOctaves='4' seed='7'/%3E%3CfeColorMatrix values='0 0 0 0 .45  0 0 0 0 .42  0 0 0 0 .38  0 0 0 -1.6 1.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E"),
    linear-gradient(180deg, #FFFDF7 0%, #F1EADB 45%, #DCD1BA 100%);
  box-shadow:
    0 0 0 2px #7A5418, 0 0 0 4px #E9BE5B, 0 0 0 5px #FFF1C4, 0 0 0 7px #9A6A1E, 0 0 0 9px rgba(10, 6, 30, .55),
    0 36px 70px rgba(3, 1, 15, .8), 0 0 120px rgba(255, 200, 140, .14),
    inset 0 -8px 14px rgba(120, 100, 70, .35), inset 0 3px 0 rgba(255, 255, 255, .9);
}
.inlay { position: absolute; width: 13px; height: 13px; transform: translate(-50%, -50%); z-index: 0; }
.inlay svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 .5px 0 rgba(0, 0, 0, .3)); }
.table-felt {
  position: absolute; inset: 20px; overflow: hidden; z-index: 1;
  border-radius: 50% / 47%;
  background:
    radial-gradient(ellipse 55% 40% at 50% 30%, rgba(140, 255, 215, .2), transparent 70%),
    radial-gradient(ellipse at 50% 45%, #17957F 0%, #0E6E60 40%, #0A4F47 75%, #073A35 100%);
  box-shadow:
    0 0 0 2px #9A6A1E, 0 0 0 3.5px #E9BE5B,
    inset 0 0 0 2px rgba(0, 0, 0, .25), inset 0 18px 44px rgba(0, 0, 0, .5), inset 0 -10px 30px rgba(0, 0, 0, .35);
}
.table-felt::before {
  content: ''; position: absolute; inset: 0; opacity: .3; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.felt-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.felt-lines ellipse { fill: none; vector-effect: non-scaling-stroke; }
.felt-lines .zari { stroke: #F3CF76; stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0 9; opacity: .75; }
.felt-lines .ring { stroke: rgba(243, 207, 118, .5); stroke-width: 1.5; }
.felt-lines .ring.thin { stroke: rgba(243, 207, 118, .22); stroke-width: 1; stroke-dasharray: 5 6; }
.pot-well {
  position: absolute; left: 50%; top: 50%; width: min(32%, 180px); aspect-ratio: 1.5; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 30, 26, .45) 0%, rgba(0, 30, 26, .2) 55%, transparent 72%);
}
.rangoli { position: absolute; left: 50%; top: 50%; width: min(58%, 290px); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: .2; color: #F3CF76; pointer-events: none; }
.felt-title {
  position: absolute; left: 50%; top: 62%; width: min(52%, 320px); transform: translateX(-50%);
  fill: rgba(243, 207, 118, .5); font-family: var(--font-display); font-size: 40px;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .4));
}
.pot-amt { background: rgba(4, 30, 27, .7); }
.stake-amt { background: rgba(4, 30, 27, .8); }
.plate { background: rgba(8, 6, 26, .82); }

@media (max-width: 700px) {
  .game { --horizon: 27%; }
  .room .skyline { height: 120px; }
  .room .moon { width: 46px; height: 46px; top: 76px; right: 6%; }
  .rug { height: 80%; width: 100%; }
  .inlay { width: 10px; height: 10px; }
  .felt-title { top: 64%; width: 62%; }
}

.game-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(8, 5, 30, .7), rgba(8, 5, 30, 0));
}
.game-head .title { text-align: center; line-height: 1.2; min-width: 0; }
.game-head .title strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); color: var(--marigold); }
.game-head .title span { color: var(--muted); font-size: var(--step--1); }
.game-head .title span i { display: inline-block; width: 4px; height: 4px; margin: 0 8px; border-radius: 50%; background: rgba(217,172,79,.6); vertical-align: middle; }
.round-btn {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  border: 1px solid rgba(217, 172, 79, .4); background: rgba(8, 5, 30, .55); color: var(--marigold-soft);
  box-shadow: 0 4px 12px rgba(0,0,0,.35);
}
.round-btn svg { width: 20px; height: 20px; }
.balance-pill { border: 1px solid rgba(217,172,79,.35); }

.felt-wrap { position: relative; min-height: 0; }
.pot {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 4px; z-index: 2; text-align: center;
}
.pot-pile { display: flex; align-items: flex-end; gap: 3px; min-height: 24px; }
.pot-amt {
  min-width: 104px; padding: 3px 18px 2px;
  font-family: var(--font-display); font-size: var(--step-2); line-height: 1.2; color: #F4D98C;
  border-radius: 999px; background: rgba(8, 5, 30, .62);
  border: 1px solid rgba(217, 172, 79, .5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.08), 0 6px 16px rgba(0,0,0,.35);
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.pot-amt.bump { animation: bump 320ms ease; }
@keyframes bump { 40% { transform: scale(1.12); } }
.pot-meta { color: #CFC9F2; font-size: var(--step--1); font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

.stake { position: absolute; z-index: 2; transform: translate(-50%, -50%); display: flex; align-items: flex-end; gap: 5px; pointer-events: none; }
.stake-amt { font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: rgba(8, 5, 30, .7); color: #F4D98C; }

.seat {
  position: absolute; z-index: 3;
  width: 124px; transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 4px; text-align: center;
}
.seat .avatar {
  --h: 250;
  position: relative; width: 58px; height: 58px; padding: 3px; border-radius: 50%;
  background: conic-gradient(from 210deg, #FFE7A8, #C9962F, #FFF3CC, #A8721A, #FFE7A8);
  box-shadow: 0 8px 18px rgba(4, 2, 20, .6);
}
.seat .avatar .face {
  width: 100%; height: 100%; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, hsl(var(--h) 80% 66%), hsl(var(--h) 62% 40%) 62%, hsl(var(--h) 60% 28%));
  font-family: var(--font-display); font-size: 1.55rem; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: inset 0 -4px 8px rgba(0,0,0,.25);
}
.seat .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.seat .ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.seat .ring circle[data-deadline] { stroke: #F4D98C; transition: stroke-dashoffset 250ms linear, stroke 300ms; filter: drop-shadow(0 0 3px rgba(255, 216, 120, .8)); }
.seat .ring .ring-track { stroke: rgba(8, 5, 30, .55); }
.seat .dealer {
  position: absolute; top: -3px; right: -7px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: #FFF6E6; color: #8E1B2E; font-weight: 800; font-size: 11px;
  box-shadow: 0 0 0 2px #C9962F, 0 2px 4px rgba(0,0,0,.5);
}
.badge-status {
  position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); z-index: 2;
  padding: 1px 9px; border-radius: 999px; white-space: nowrap;
  font-size: .66rem; font-weight: 700; letter-spacing: .01em;
  background: #2C2768; color: #CFC9F2; border: 1px solid rgba(255, 255, 255, .14);
}
.badge-status.blind { background: #3B2E8F; color: #E4DFFF; }
.badge-status.seen { background: #12705A; color: #C9F7E6; border-color: rgba(201,247,230,.3); }
.badge-status.win { background: linear-gradient(180deg, #F4D98C, #D9AC4F); color: #1A1408; border-color: #FFF0C2; }
.plate {
  display: grid; margin-top: 8px; padding: 3px 12px 4px; min-width: 94px; max-width: 120px;
  border-radius: 10px; line-height: 1.25;
  background: rgba(8, 5, 30, .78); border: 1px solid rgba(217, 172, 79, .25);
  box-shadow: 0 4px 10px rgba(0,0,0,.35);
}
.plate .name { font-weight: 600; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plate .bal { font-size: .72rem; font-weight: 700; color: #F4D98C; }
.hand-wrap { position: relative; display: grid; justify-items: center; }
.hand-name {
  margin-top: 3px; padding: 1px 9px; border-radius: 999px; white-space: nowrap;
  font-size: .7rem; font-weight: 700; color: #1A1408;
  background: linear-gradient(180deg, #F4D98C, #D9AC4F);
}
.seat .hand .card { --w: 32px; }
.seat.turn .avatar { animation: turnglow 1.6s ease-in-out infinite; }
.seat.packed .avatar, .seat.packed .plate { filter: grayscale(.85) brightness(.6); }
.seat.offline .avatar .face { filter: grayscale(.7); }
.seat.winner .avatar { animation: winpulse 1.1s ease-in-out infinite; }
.seat.winner .plate { border-color: #F4D98C; box-shadow: 0 0 18px rgba(255, 216, 120, .45); }
.seat.empty .avatar { background: none; padding: 0; box-shadow: none; border: 2px dashed rgba(207, 201, 242, .3); }
.seat.empty .avatar .face { background: rgba(8, 5, 30, .3); box-shadow: none; font-family: var(--font-body); font-size: .72rem; font-weight: 600; color: var(--muted); }

/* Your own seat: anchored to the bottom of the table area so it never
   slides under the buttons; cards on top, avatar and name plate below. */
.seat.me { top: auto !important; bottom: 10px; transform: translateX(-50%); }
.seat.me {
  width: 230px;
  grid-template-columns: auto auto; grid-template-areas: "hand hand" "av plate";
  justify-content: center; align-items: center; column-gap: 12px; row-gap: 8px;
}
.seat.me .hand-wrap { grid-area: hand; }
.seat.me .avatar { grid-area: av; width: 52px; height: 52px; }
.seat.me .plate { grid-area: plate; margin-top: 0; justify-items: start; text-align: left; }
.seat.me .hand .card { --w: 62px; }
.seat.me .hand-name { font-size: .78rem; margin-top: 6px; }

.result-banner { position: absolute; left: 50%; top: 3%; transform: translateX(-50%); z-index: 5; filter: drop-shadow(0 12px 22px rgba(0,0,0,.5)); max-width: 94%; }
.result-banner .rb {
  display: grid; justify-items: center; padding: 10px 40px 12px;
  color: #1A1408; text-align: center;
  background: linear-gradient(180deg, #FFE59A 0%, #D9AC4F 62%, #D98E00 100%);
  clip-path: polygon(0 0, 100% 0, 95% 50%, 100% 100%, 0 100%, 5% 50%);
}
.rb-title { font-family: var(--font-display); font-size: var(--step-2); line-height: 1.1; white-space: nowrap; }
.rb-sub { white-space: nowrap; }
.rb-sub { font-size: .8rem; font-weight: 700; opacity: .85; }
@keyframes drop { from { transform: translate(-50%, -24px); opacity: 0; } }

.actions {
  position: relative; z-index: 4;
  padding: 10px 12px calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(20, 16, 52, .9), rgba(8, 6, 26, .97));
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-top: 1px solid rgba(233, 190, 91, .45);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -14px 34px rgba(4, 2, 20, .55);
}
/* The action bar always has the same height, so the table never resizes
   when buttons appear or disappear. */
.actions-inner {
  max-width: 640px; margin: 0 auto;
  display: grid; grid-template-rows: 20px 46px 58px; gap: 10px;
  height: calc(20px + 46px + 58px + 20px);
}
.turn-info {
  margin: 0; text-align: center; line-height: 20px;
  color: var(--muted); font-size: var(--step--1); font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.turn-info.mine { color: #F4D98C; }
.act-idle {
  grid-row: 1 / -1; margin: 0; padding: 0 12px;
  display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: var(--step-0); font-weight: 600;
  border: 1px dashed rgba(183, 177, 222, .2); border-radius: 16px;
}
.act-row { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 10px; min-height: 0; }
.act-row .gbtn { padding: 0 10px; min-height: 0; height: 100%; }
.act-row.secondary .gbtn { font-size: .92rem; }
.act-row.primary .gbtn { font-size: 1.08rem; }
.act-row.primary .gbtn .gb-ic svg { width: 22px; height: 22px; }

.log-toggle { position: absolute; right: 12px; bottom: 10px; z-index: 6; }
.log {
  position: absolute; right: 12px; bottom: 62px; z-index: 6;
  width: min(300px, calc(100% - 24px)); max-height: 50%; overflow: auto;
  background: rgba(16, 12, 48, .97); border: 1px solid rgba(217, 172, 79, .3); border-radius: 14px;
  padding: 10px 14px; font-size: var(--step--1);
}
.log ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.log li { color: var(--muted); }
.log li:last-child { color: var(--text); }

@media (max-width: 420px) {
  .seat { width: 100px; }
  .seat .avatar { width: 50px; height: 50px; }
  .seat .avatar .face { font-size: 1.3rem; }
  .plate { min-width: 84px; max-width: 100px; padding: 2px 10px 3px; }
  .seat.me { width: 220px; }
  .seat.me .hand .card { --w: 58px; }
  .seat .hand .card { --w: 28px; }
  .table-rim { inset: 13% 4% 22%; }
  .table-felt { inset: 16px; }
  .pot-amt { font-size: var(--step-1); min-width: 88px; }
  .felt-mark { display: none; }
  .result-banner { top: 24%; }
  .result-banner .rb { padding: 7px 26px 9px; }
  .rb-title { font-size: var(--step-1); }
  .rb-sub { font-size: .72rem; }
}
@media (min-width: 900px) {
  .seat { width: 140px; }
  .seat .avatar { width: 66px; height: 66px; }
  .seat .hand .card { --w: 38px; }
  .seat.me .hand .card { --w: 72px; }
}

/* ------------------------------------------------------------------ modal */
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(8, 5, 30, .6); display: grid; place-items: end center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: var(--night-2); border-radius: 18px; padding: 20px; border: 1px solid var(--line); margin-bottom: var(--safe-b); }
.modal h2 { font-size: var(--step-1); margin-bottom: 6px; }
.modal p { color: var(--muted); margin: 0 0 16px; }
.modal .row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (min-width: 640px) { .modal-backdrop { place-items: center; } }

/* ------------------------------------------------------------------ wallet */
.wallet-hero { padding: 22px 0 8px; }
.wallet-hero .big { font-family: var(--font-display); font-size: var(--step-4); color: var(--marigold); line-height: 1; }
.wallet-hero .big.amt::before { width: 0.6em; height: 0.6em; }
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx .what { font-weight: 600; }
.tx .when { color: var(--muted); font-size: var(--step--1); grid-column: 1; }
.tx .delta { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.tx .delta.plus { color: #8FE3BA; }
.tx .after { color: var(--muted); font-size: var(--step--1); text-align: right; grid-column: 2; grid-row: 2; }
.empty { color: var(--muted); padding: 28px 0; text-align: center; }

/* ------------------------------------------------------------------ invite */
.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 18px; border-radius: 16px;
  background: var(--velvet); border: 1px solid rgba(217,172,79,.35);
}
.code-box .code { font-family: var(--font-display); font-size: var(--step-3); color: var(--marigold); letter-spacing: 0.08em; line-height: 1; }
.steps { padding-left: 1.2em; color: var(--muted); }
.steps li { margin: 6px 0; }
.steps strong { color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.stat { padding: 12px; border-radius: 14px; background: var(--night-2); }
.stat b { display: block; font-size: var(--step-1); }
.stat span { color: var(--muted); font-size: var(--step--1); }
.people { list-style: none; margin: 0; padding: 0; }
.people li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.people li span { color: var(--muted); font-size: var(--step--1); }

/* ------------------------------------------------------------------ profile */
.hist { list-style: none; margin: 0; padding: 0; }
.hist li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.hist .hand .card { --w: 28px; }
.hist .info span { display: block; color: var(--muted); font-size: var(--step--1); }
.rank { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.rank li { counter-increment: r; display: grid; grid-template-columns: 2em 1fr auto; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank li::before { content: counter(r); color: var(--muted); font-weight: 700; }
.rank li.me { color: var(--marigold-soft); }
.profile-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ------------------------------------------------------------------ toasts */
#toasts { position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--ivory); color: var(--ink); font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: drop2 220ms ease; }
.toast.error { background: var(--sindoor); color: #fff; }
@keyframes drop2 { from { opacity: 0; transform: translateY(-8px); } }

.loading { min-height: 100%; display: grid; place-items: center; color: var(--muted); }

/* ------------------------------------------------------------------ motion */
#fx { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.fx-chip {
  position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle, var(--marigold) 0 34%, #C9830A 35% 46%, var(--marigold) 47% 100%);
  box-shadow: 0 0 0 1.5px rgba(255, 246, 230, .7) inset, 0 3px 6px rgba(5, 2, 25, .5);
  will-change: transform, opacity;
}
.fx-label { position: absolute; left: 0; top: 0; font-weight: 700; font-size: var(--step-0); color: var(--marigold-soft); text-shadow: 0 2px 6px rgba(5,2,25,.7); white-space: nowrap; will-change: transform, opacity; }
.fx-label.win { font-family: var(--font-display); font-weight: 400; font-size: var(--step-3); color: var(--marigold); }

.card[data-anim="deal"] { animation: deal 420ms cubic-bezier(.2,.75,.3,1) both; }
@keyframes deal {
  from { transform: translate(var(--fx, 0px), var(--fy, 0px)) rotate(-150deg) scale(.5); opacity: 0; }
  15% { opacity: 1; }
  to { transform: var(--rest, none); opacity: 1; }
}
.card[data-anim="flip"] { animation: flip 520ms ease-in-out both; }
.card[data-anim="flip"]::before {
  content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit;
  border: calc(var(--w) * 0.06) solid #FFF6E6;
  background: var(--back-bg);
  animation: flipcover 520ms linear both; animation-delay: inherit;
}
@keyframes flip {
  0% { transform: var(--rest, none) translateY(0) scaleX(1); }
  50% { transform: var(--rest, none) translateY(-10px) scaleX(0); }
  100% { transform: var(--rest, none) translateY(0) scaleX(1); }
}
@keyframes flipcover { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
.card[data-anim="fold"] { animation: fold 520ms cubic-bezier(.55,0,.75,.4) both; }
@keyframes fold {
  from { transform: var(--rest, none); opacity: 1; }
  to { transform: translate(calc(var(--fx, 0px) * .7), calc(var(--fy, 0px) * .7)) rotate(35deg) scale(.5); opacity: 0; }
}

.seat .avatar { transition: border-color 200ms ease, box-shadow 200ms ease, background-color 300ms ease; }
.seat.turn .avatar { animation: turnglow 1.6s ease-in-out infinite; }
@keyframes turnglow { 50% { box-shadow: 0 0 0 7px rgba(217,172,79,.1), 0 0 18px 2px rgba(217,172,79,.35); } }
.seat.winner .avatar { animation: winpulse 1.1s ease-in-out infinite; }
@keyframes winpulse { 50% { box-shadow: 0 0 0 8px rgba(217,172,79,.15), 0 0 30px 8px rgba(217,172,79,.55); transform: scale(1.06); } }
.seat { transition: opacity 400ms ease; }

.game[data-anim="enter"] { animation: gameIn 380ms ease-out both; }
@keyframes gameIn { from { opacity: 0; transform: scale(1.04); } }
.result-banner[data-anim="drop"] { animation: drop 400ms cubic-bezier(.2,.9,.3,1.3) both; }
.modal[data-anim="pop"] { animation: pop 300ms cubic-bezier(.2,.9,.3,1.25) both; }
@keyframes pop { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.modal-backdrop { animation: fadeIn 200ms ease both; }
@keyframes fadeIn { from { opacity: 0; } }
.page[data-anim="in"] { animation: fadeIn 200ms ease-out both; }
.btn { transition: transform 80ms ease, filter 120ms ease, background-color 150ms ease, opacity 150ms ease; }

html.reduce-motion *, html.reduce-motion *::before, html.reduce-motion *::after { animation: none !important; transition: none !important; }

.code-box .btn { white-space: nowrap; }
@media (max-width: 420px) { .code-box .code { font-size: var(--step-2); } }

/* ------------------------------------------------------------------ table ornament */
.rug svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.rug ellipse { fill: none; vector-effect: non-scaling-stroke; }
.rug .fringe { stroke: #D9B15A; stroke-width: 8; stroke-dasharray: 1.4 2.6; opacity: .85; }
.rug .band { stroke: #E9BE5B; stroke-width: 2.2; }
.rug .band.thin { stroke-width: 1.3; opacity: .8; }
.rug .medal { stroke: #F3CF76; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 0 22; }
.rug .medal-core { stroke: #5A0C24; stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0 22; }
.rug { box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }

.rim-vine { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); overflow: visible; }
.rim-vine ellipse { fill: none; stroke: #C99A3A; stroke-width: 1.4; opacity: .55; vector-effect: non-scaling-stroke; }
.inlay { width: 15px; height: 15px; }
.inlay svg { filter: drop-shadow(0 0 0 #C99A3A) drop-shadow(0 .6px .4px rgba(0, 0, 0, .35)); }

.table-felt {
  background:
    radial-gradient(ellipse 50% 36% at 46% 28%, rgba(160, 255, 225, .24), transparent 70%),
    conic-gradient(from 200deg at 50% 50%, rgba(255, 255, 255, .03), rgba(0, 0, 0, .06), rgba(255, 255, 255, .04), rgba(0, 0, 0, .05), rgba(255, 255, 255, .03)),
    radial-gradient(ellipse at 50% 46%, #19A088 0%, #0F7565 38%, #0A5249 72%, #063530 100%);
}
.rangoli { width: min(64%, 330px); opacity: .32; color: #F3CF76; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, .35)); }

/* Pot: a gold-framed plaque with diamond ornaments */
.pot-amt {
  position: relative;
  border: 2px solid transparent;
  background:
    linear-gradient(180deg, #074A42, #03241F) padding-box,
    linear-gradient(135deg, #FFE9A8, #B07A1C 35%, #FFE9A8 55%, #8A5A00) border-box;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .1);
}
.pot-amt::before, .pot-amt::after {
  content: ''; position: absolute; top: 50%; width: 9px; height: 9px;
  background: linear-gradient(135deg, #FFE9A8, #B07A1C);
  transform: translateY(-50%) rotate(45deg); box-shadow: 0 1px 2px rgba(0, 0, 0, .5);
}
.pot-amt::before { left: -16px; }
.pot-amt::after { right: -16px; }
.pot-meta { color: #E8F5EF; }

/* Seats: gold-dotted halo around avatars, ornate name plates */
.seat .avatar::before {
  content: ''; position: absolute; inset: -8px; border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, #E9BE5B 0 3deg, transparent 3deg 15deg);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 2.5px), #000 calc(50% - 2.5px) 50%, transparent 50%);
          mask: radial-gradient(circle, transparent calc(50% - 2.5px), #000 calc(50% - 2.5px) 50%, transparent 50%);
  opacity: .8;
}
.seat.empty .avatar::before { display: none; }
.plate {
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(48, 12, 34, .94), rgba(18, 6, 20, .94)) padding-box,
    linear-gradient(90deg, rgba(138, 90, 0, .7), #FFE7A3, rgba(138, 90, 0, .7)) border-box;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .45);
}
.plate .name { color: #FFF6E6; }
.seat.winner .plate { box-shadow: 0 0 20px rgba(255, 216, 120, .55); }

/* Header ornament */
.game-head { background: linear-gradient(180deg, rgba(4, 4, 20, .75), rgba(4, 4, 20, 0)); }
.game-head::after {
  content: ''; position: absolute; left: 12%; right: 12%; bottom: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 190, 91, .55), transparent);
}

/* Fireflies drifting around the terrace */
.firefly {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: #FFF3B0; box-shadow: 0 0 8px 3px rgba(255, 220, 110, .6);
  animation: firefly-drift var(--t) ease-in-out var(--d) infinite, firefly-blink calc(var(--t) * .45) ease-in-out var(--d) infinite;
}
@keyframes firefly-drift {
  0%, 100% { transform: translate(0, 0); }
  25% { transform: translate(22px, -18px); }
  50% { transform: translate(-10px, -34px); }
  75% { transform: translate(-24px, -8px); }
}
@keyframes firefly-blink { 0%, 100% { opacity: .15; } 50% { opacity: 1; } }

@media (min-width: 701px) {
  .game { --horizon: 33%; }
  .room .skyline { height: 290px; }
}
@media (max-width: 700px) {
  .rug .medal { stroke-width: 6; stroke-dasharray: 0 15; }
  .rug .medal-core { stroke-width: 2.5; stroke-dasharray: 0 15; }
  .rug .fringe { stroke-width: 6; }
  .seat .avatar::before { inset: -7px; }
}

/* ================================================================== clean table v2 */
.game[data-table] { --felt-hi: #22B38E; --felt-1: #13886A; --felt-2: #0B5E4A; --felt-3: #063A2E;
  --leather-hi: #6B4330; --leather-1: #4A2A1C; --leather-2: #26140C; --stitch: rgba(255, 214, 150, .55); }
.game[data-table="ruby"] { --felt-hi: #D23A55; --felt-1: #A61E38; --felt-2: #7A1028; --felt-3: #4A0818;
  --leather-hi: #3A3A40; --leather-1: #222226; --leather-2: #0E0E11; --stitch: rgba(255, 214, 150, .5); }
.game[data-table="midnight"] { --felt-hi: #3D63D6; --felt-1: #2645A8; --felt-2: #182F7A; --felt-3: #0D1B4D;
  --leather-hi: #3A3A40; --leather-1: #222226; --leather-2: #0E0E11; --stitch: rgba(210, 220, 255, .45); }

.room .moon, .sky-lantern, .firefly, .rug, .inlay, .rim-vine, .rim-studs, .pot-well, .rangoli { display: none !important; }
.room .stars { opacity: .45; }
.room .skyline { opacity: .7; }
.room .bokeh {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 8% 70%, rgba(255, 190, 110, .10) 0 40px, transparent 41px),
    radial-gradient(circle at 92% 62%, rgba(255, 190, 110, .08) 0 60px, transparent 61px),
    radial-gradient(circle at 15% 92%, rgba(255, 170, 90, .07) 0 70px, transparent 71px),
    radial-gradient(circle at 86% 94%, rgba(255, 210, 140, .07) 0 50px, transparent 51px);
  filter: blur(6px);
}

.table-glow {
  position: absolute; left: 50%; top: 45%; width: min(110%, 1250px); height: 95%; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 220, 160, .14), rgba(255, 220, 160, .04) 45%, transparent 70%);
}
.table-shadow { top: 81%; height: 56px; background: radial-gradient(ellipse, rgba(0, 0, 0, .8), transparent 70%); }

.table-rim {
  background:
    radial-gradient(ellipse 62% 20% at 50% 3%, rgba(255, 255, 255, .28), transparent 70%),
    radial-gradient(ellipse 40% 10% at 50% 97%, rgba(255, 255, 255, .06), transparent 70%),
    linear-gradient(180deg, var(--leather-hi) 0%, var(--leather-1) 30%, var(--leather-2) 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 0 3px #B8862E, 0 0 0 4px #FFE29A, 0 0 0 6px #9A6A1E,
    0 38px 70px rgba(0, 0, 0, .75), 0 6px 0 rgba(0, 0, 0, .35),
    inset 0 2px 1px rgba(255, 255, 255, .25), inset 0 -6px 14px rgba(0, 0, 0, .55), inset 0 0 22px rgba(0, 0, 0, .35);
}
.rim-stitch { position: absolute; inset: 9px; width: calc(100% - 18px); height: calc(100% - 18px); overflow: visible; }
.rim-stitch ellipse { fill: none; stroke: var(--stitch); stroke-width: 1.4; stroke-dasharray: 7 5; vector-effect: non-scaling-stroke; }

.table-felt {
  inset: 22px;
  background:
    radial-gradient(ellipse 55% 42% at 50% 34%, color-mix(in srgb, var(--felt-hi) 70%, transparent), transparent 72%),
    radial-gradient(ellipse at 50% 48%, var(--felt-1) 0%, var(--felt-2) 62%, var(--felt-3) 100%);
  box-shadow:
    0 0 0 2px #7A5418, 0 0 0 4px #E9BE5B, 0 0 0 5px #FFF0C0, 0 0 0 6px #8A5A10,
    inset 0 20px 40px rgba(0, 0, 0, .45), inset 0 -12px 30px rgba(0, 0, 0, .35), inset 0 0 0 1px rgba(0, 0, 0, .3);
}
.table-felt::before { opacity: .18; }
.felt-lines .zari { display: none; }
.felt-lines .ring { stroke: rgba(255, 226, 154, .35); stroke-width: 1.5; stroke-dasharray: none; }
.felt-title { top: 63%; fill: rgba(255, 226, 154, .32); }
.pot-amt {
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .7)) padding-box,
    linear-gradient(135deg, #FFE9A8, #B07A1C 35%, #FFE9A8 55%, #8A5A00) border-box;
}
.stake-amt { background: rgba(0, 0, 0, .6); }
@media (max-width: 420px) { .table-felt { inset: 18px; } .rim-stitch { inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); } }

/* Table colour picker in Profile */
.tabs.three { grid-template-columns: repeat(3, 1fr); }
.tabs button .swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; box-shadow: 0 0 0 1.5px #E9BE5B; }
.sw-green { background: #13886A; } .sw-ruby { background: #A61E38; } .sw-midnight { background: #2645A8; }

/* Stitching and inner gold line drawn with CSS so they follow any table shape */
.table-rim::after {
  content: ''; position: absolute; inset: 10px; pointer-events: none;
  border-radius: 50% / 47%; border: 1.5px dashed var(--stitch);
}
.table-rim::before { display: none; }
.table-felt::after {
  content: ''; position: absolute; inset: 14px; pointer-events: none;
  border-radius: 50% / 47%; border: 1.5px solid rgba(255, 226, 154, .3);
}
/* Portrait phones: a capsule-shaped table with a thicker padded rim */
@media (max-width: 700px) and (orientation: portrait) {
  .table-rim { inset: 12% 3% 21%; border-radius: 170px; }
  .table-rim::after { inset: 11px; border-radius: 160px; }
  .table-felt { inset: 25px; border-radius: 146px; }
  .table-felt::after { inset: 12px; border-radius: 136px; }
  .table-shadow { width: 92%; }
}

/* ------------------------------------------------------------------ player card */
.seat[data-action="player"] { cursor: pointer; }
.seat[data-action="player"]:hover .avatar { filter: brightness(1.08); }
.seat[data-action="player"]:focus-visible { outline: none; }
.seat[data-action="player"]:focus-visible .avatar { box-shadow: 0 0 0 3px var(--marigold); }
.note-badge {
  position: absolute; left: -6px; top: -4px; z-index: 3;
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(180deg, #FFE08A, #E9A51E); color: #FFF8E6;
  box-shadow: 0 0 0 2px #1A1408, 0 2px 4px rgba(0,0,0,.5);
}
.note-badge svg { width: 13px; height: 13px; color: #FFFDF5; }
.rank li[data-action="player"] { cursor: pointer; }
.rank li[data-action="player"]:hover span { text-decoration: underline; }

#overlay .modal-backdrop { z-index: 80; place-items: center; }
.player-card {
  position: relative; max-width: 380px; padding: 22px 20px 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #221C5A, #120E36) padding-box,
    linear-gradient(160deg, #FFE7A3, #8A5A00 40%, #FFE7A3 70%, #8A5A00) border-box;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6);
  animation: pop 260ms cubic-bezier(.2,.9,.3,1.25) both;
}
.pc-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; }
.pc-close svg { width: 16px; height: 16px; }
.pc-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; padding-right: 40px; }
.pc-head h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); color: var(--marigold); margin: 0; overflow-wrap: anywhere; }
.pc-head p { margin: 2px 0 0; color: var(--muted); font-size: var(--step--1); }
.pc-avatar {
  --h: 250; flex: none; width: 64px; height: 64px; padding: 3px; border-radius: 50%;
  background: conic-gradient(from 210deg, #FFE7A8, #C9962F, #FFF3CC, #A8721A, #FFE7A8);
}
.pc-avatar span {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, hsl(var(--h) 80% 66%), hsl(var(--h) 62% 40%) 62%, hsl(var(--h) 60% 28%));
  font-family: var(--font-display); font-size: 1.7rem; color: #fff;
}
.pc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.pc-stats div { display: grid; gap: 2px; padding: 10px 6px; border-radius: 12px; text-align: center; background: rgba(255, 255, 255, .05); border: 1px solid rgba(233, 190, 91, .18); }
.pc-stats b { font-size: var(--step-0); font-variant-numeric: tabular-nums; }
.pc-stats span { font-size: .72rem; color: var(--muted); }
.pc-label { display: block; font-size: var(--step--1); color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.pc-best { margin-bottom: 16px; }
.pc-best-row { display: flex; align-items: center; gap: 12px; }
.pc-best-row .hand .card { --w: 44px; }
.pc-muted { margin: 0; color: var(--muted); font-size: var(--step--1); }
.pc-note textarea {
  width: 100%; resize: vertical; min-height: 76px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05);
  font: inherit; color: var(--text); line-height: 1.4;
}
.pc-note textarea:focus { outline: none; border-color: var(--marigold); box-shadow: 0 0 0 3px rgba(217,172,79,.25); }
.pc-note-foot { display: flex; justify-content: space-between; margin: 6px 0 12px; font-size: .75rem; color: var(--muted); }
.pc-note .gbtn { width: 100%; }
@media (max-width: 380px) { .pc-stats { grid-template-columns: repeat(2, 1fr); } }

/* ------------------------------------------------------------------ winner popup */
.result-banner { display: none !important; }
.win-pop {
  position: absolute; left: 50%; top: 45%; z-index: 7; pointer-events: none;
  width: min(300px, 82%); transform: translate(-50%, -50%);
  animation: winpop 4600ms cubic-bezier(.2, .9, .3, 1) both;
}
.win-pop[data-static] { animation: none; }
@keyframes winpop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4); }
  9% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  14% { transform: translate(-50%, -50%) scale(1); }
  86% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(.92); }
}
.wp-rays {
  position: absolute; left: 50%; top: 42%; width: 190%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 214, 120, .38) 0 8deg, transparent 8deg 22deg);
  -webkit-mask: radial-gradient(circle, #000 15%, transparent 65%);
          mask: radial-gradient(circle, #000 15%, transparent 65%);
  animation: rays-spin 14s linear infinite;
}
@keyframes rays-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.wp-card {
  position: relative; display: grid; justify-items: center; gap: 4px;
  padding: 40px 18px 16px; margin-top: 30px; border-radius: 22px; text-align: center;
  border: 2px solid transparent;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(255, 214, 120, .25), transparent 70%) padding-box,
    linear-gradient(180deg, #2A1A55, #140C30) padding-box,
    linear-gradient(160deg, #FFF0B8, #C68612 35%, #FFE08A 60%, #8A5A00) border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .65), 0 0 50px rgba(255, 200, 90, .35);
}
.win-pop.mine .wp-card { box-shadow: 0 24px 60px rgba(0, 0, 0, .65), 0 0 70px rgba(255, 200, 90, .6); }
.wp-avatar {
  --h: 250; position: absolute; left: 50%; top: 0; transform: translate(-50%, -55%);
  width: 72px; height: 72px; padding: 3px; border-radius: 50%;
  background: conic-gradient(from 210deg, #FFE7A8, #C9962F, #FFF3CC, #A8721A, #FFE7A8);
  box-shadow: 0 0 0 4px rgba(20, 12, 48, .9), 0 0 30px rgba(255, 200, 90, .7);
}
.wp-avatar span {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 28%, hsl(var(--h) 80% 66%), hsl(var(--h) 62% 40%) 62%, hsl(var(--h) 60% 28%));
  font-family: var(--font-display); font-size: 2rem; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
}
.wp-crown { position: absolute; left: 50%; top: -30px; width: 52px; transform: translateX(-50%) rotate(-6deg); filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .5)); }
.wp-crown svg { display: block; width: 100%; }
.wp-title { font-family: var(--font-display); font-size: var(--step-2); color: #FFE08A; line-height: 1.1; text-shadow: 0 2px 0 rgba(0, 0, 0, .4); }
.wp-names { font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.wp-amount {
  font-family: var(--font-display); font-size: var(--step-4); line-height: 1;
  background: linear-gradient(180deg, #FFF6CF 10%, #FFC63D 55%, #D98A00 90%);
  -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  filter: drop-shadow(0 3px 0 rgba(60, 30, 0, .6));
  animation: amount-pulse 1.4s ease-in-out infinite;
}
@keyframes amount-pulse { 50% { transform: scale(1.06); } }
.wp-hand { display: grid; justify-items: center; gap: 6px; margin-top: 6px; }
.wp-hand .hand .card { --w: 46px; }
.wp-hand .hand .card + .card { margin-left: -6px; }
.wp-how { margin-top: 4px; font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.wp-spark {
  position: absolute; width: 10px; height: 10px; pointer-events: none;
  background: radial-gradient(circle, #FFF6CF 0 20%, transparent 60%), conic-gradient(from 45deg, transparent 0 20%, #FFE08A 20% 30%, transparent 30% 45%, #FFE08A 45% 55%, transparent 55% 70%, #FFE08A 70% 80%, transparent 80% 95%, #FFE08A 95%);
  border-radius: 50%; animation: spark 1.6s ease-in-out infinite;
}
.wp-spark.s1 { left: -4%; top: 30%; animation-delay: -.2s; }
.wp-spark.s2 { right: -2%; top: 22%; animation-delay: -.7s; width: 14px; height: 14px; }
.wp-spark.s3 { left: 8%; bottom: 6%; animation-delay: -1.1s; }
.wp-spark.s4 { right: 6%; bottom: 14%; animation-delay: -.4s; width: 12px; height: 12px; }
.wp-spark.s5 { left: 22%; top: 2%; animation-delay: -.9s; }
.wp-spark.s6 { right: 20%; top: 6%; animation-delay: -1.4s; width: 8px; height: 8px; }
@keyframes spark { 0%, 100% { transform: scale(.3) rotate(0deg); opacity: .2; } 50% { transform: scale(1.3) rotate(90deg); opacity: 1; } }
@media (max-width: 420px) {
  .win-pop { width: min(270px, 80%); }
  .wp-amount { font-size: var(--step-3); }
}

/* ------------------------------------------------------------------ spectators */
.tc-actions { display: grid; gap: 8px; }
.watch-btn .gb-ic svg { width: 16px; height: 16px; }
@media (max-width: 400px) { .tc-actions { grid-column: 1 / -1; grid-template-columns: 2fr 1fr; } }
.spec-toggle { position: absolute; left: 12px; bottom: 10px; z-index: 6; }
.spec-count {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  display: grid; place-items: center; font-size: .7rem; font-weight: 700;
  background: #E9BE5B; color: #1A1408; box-shadow: 0 0 0 2px #120E36;
}
.seat.empty.can-sit { cursor: pointer; }
.seat.empty.can-sit .avatar { border-color: rgba(233, 190, 91, .7); animation: sit-pulse 2s ease-in-out infinite; }
.seat.empty.can-sit .avatar .face { color: #FFE08A; font-weight: 700; }
@keyframes sit-pulse { 50% { box-shadow: 0 0 0 6px rgba(233, 190, 91, .15); } }
.modal.sheet {
  position: relative; max-width: 380px; padding: 22px 20px 20px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, #221C5A, #120E36) padding-box,
    linear-gradient(160deg, #FFE7A3, #8A5A00 40%, #FFE7A3 70%, #8A5A00) border-box;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .6);
  animation: pop 260ms cubic-bezier(.2,.9,.3,1.25) both;
}
.modal.sheet h2 { font-family: var(--font-display); font-weight: 400; color: var(--marigold); font-size: var(--step-2); margin-bottom: 4px; padding-right: 40px; }
.sheet-actions { display: grid; gap: 12px; }
.sheet-actions .gbtn { width: 100%; justify-content: flex-start; padding: 0 18px; min-height: 56px; }
.sheet-actions .gbtn.dim { justify-content: center; min-height: 46px; }
.spec-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 50vh; overflow: auto; }
.spec-list li { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.spec-list li[data-action] { cursor: pointer; }
.spec-list li[data-action]:hover .sp-name { text-decoration: underline; }
.sp-avatar {
  --h: 250; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at 35% 28%, hsl(var(--h) 80% 66%), hsl(var(--h) 62% 40%) 62%, hsl(var(--h) 60% 28%));
  box-shadow: 0 0 0 2px #C9962F; font-family: var(--font-display); color: #fff;
}
.sp-name { font-weight: 600; flex: 1; }
.sp-off { font-size: .72rem; color: var(--muted); }

/* ------------------------------------------------------------------ avatars & frames */
.avatar.framed { position: relative; border-radius: 50%; padding: 3px; }
.avatar.framed .face.art { padding: 0; overflow: hidden; background: #1A1450; }
.avatar.framed .face.art .av-art { width: 100%; height: 100%; display: block; }
.frame-deco { position: absolute; left: -14%; top: -26%; width: 128%; height: 140%; pointer-events: none; z-index: 2; overflow: visible; }
.avatar.framed.fr-shimmer { background-size: 100% 100%; }
.avatar.framed.fr-shimmer::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(255, 255, 255, .75) 78%, transparent 86%);
  -webkit-mask: radial-gradient(circle, transparent calc(50% - 3.5px), #000 calc(50% - 3px));
          mask: radial-gradient(circle, transparent calc(50% - 3.5px), #000 calc(50% - 3px));
  animation: shimmer-spin 3.2s linear infinite;
}
@keyframes shimmer-spin { to { transform: rotate(360deg); } }
.avatar.framed.fr-glow { box-shadow: 0 0 18px 4px rgba(255, 200, 90, .55), 0 8px 18px rgba(4, 2, 20, .6); animation: frame-glow 2.4s ease-in-out infinite; }
@keyframes frame-glow { 50% { box-shadow: 0 0 28px 8px rgba(255, 200, 90, .75), 0 8px 18px rgba(4, 2, 20, .6); } }
.seat .avatar.framed::before { display: none; }
.avatar.framed { padding: 4px; }
.avatar.framed > .face {
  position: relative; z-index: 1;
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 35% 28%, hsl(var(--h) 80% 66%), hsl(var(--h) 62% 40%) 62%, hsl(var(--h) 60% 28%));
  font-family: var(--font-display); color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, .35);
}
.avatar.framed > .face.art { background: #1A1450; }
.avatar.framed .frame-deco { z-index: 2; }

/* ------------------------------------------------------------------ levels */
.seat .ring { z-index: 3; }
.lvl {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-right: 5px;
  border-radius: 6px; font-style: normal; font-size: .66rem; font-weight: 800; vertical-align: 1px;
  background: linear-gradient(180deg, #FFE08A, #D99A1E); color: #1A1408;
}
.plate .name .lvl { height: 16px; min-width: 16px; font-size: .62rem; }
.lvl-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; white-space: nowrap;
  background: linear-gradient(180deg, #FFE08A, #D99A1E); color: #1A1408;
}
.lvl-pill.big { font-size: .85rem; padding: 3px 12px; }
.top-right { display: inline-flex; align-items: center; gap: 8px; }

.me-head { display: flex; align-items: center; gap: 18px; margin-bottom: 8px; }
.me-av { width: 96px; height: 96px; flex: none; }
.me-av .face { font-size: 2.4rem; }
.me-info { flex: 1; min-width: 0; }
.me-info .sub { margin-bottom: 10px; }
.level-bar { display: grid; gap: 6px; }
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.lb-track { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .08); overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.4); }
.lb-track span { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #D9AC4F, #FFE08A); box-shadow: 0 0 10px rgba(255, 200, 90, .6); }
.lb-next { margin: 0; font-size: .78rem; color: var(--muted); }

.look-tabs { max-width: 320px; }
.look-level { margin-top: 14px; }
.look-level h3 { display: flex; align-items: center; gap: 6px; font-size: var(--step--1); color: var(--marigold-soft); font-weight: 700; margin-bottom: 8px; }
.look-level h3 svg { width: 14px; height: 14px; }
.look-level.locked h3 { color: var(--muted); }
.look-items { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.look-item {
  position: relative; aspect-ratio: 1; padding: 6px; border-radius: 16px; border: 2px solid transparent;
  background: rgba(255, 255, 255, .04); display: grid; place-items: center;
}
.look-item .avatar.framed { width: 100%; height: 100%; }
.look-item .avatar.framed .face { font-size: 1.3rem; }
.look-item:hover:not(:disabled) { background: rgba(255, 255, 255, .08); }
.look-item.selected { border-color: #F4D98C; background: rgba(255, 216, 120, .12); }
.look-item:disabled { cursor: not-allowed; }
.look-item:disabled .avatar { filter: grayscale(.9) brightness(.45); }
.look-check { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: #F4D98C; color: #1A1408; z-index: 3; }
.look-check svg { width: 12px; height: 12px; }
@media (min-width: 640px) { .look-items { grid-template-columns: repeat(10, 1fr); } }

.pc-av { width: 70px; height: 70px; flex: none; }
.pc-av .face { font-size: 1.8rem; }
.pc-head p .lvl-pill { margin-right: 6px; }
.sp-av { width: 38px; height: 38px; flex: none; padding: 3px !important; }
.sp-av .face { font-size: 1rem; }
.rk-who { display: flex; align-items: center; gap: 10px; }
.rk-av { width: 34px; height: 34px; flex: none; padding: 3px !important; }
.rk-av .face { font-size: .95rem; }
.rank li { align-items: center; }

.wp-avatar { background: none !important; padding: 0 !important; box-shadow: none !important; width: 78px !important; height: 78px !important; }
.wp-avatar .avatar.framed { width: 100%; height: 100%; box-shadow: 0 0 0 4px rgba(20, 12, 48, .9), 0 0 30px rgba(255, 200, 90, .7); }
.wp-avatar .avatar.framed .face { font-size: 2rem; }
.wp-crown { z-index: 4; }

.modal.levelup { overflow: hidden; text-align: center; }
.modal.levelup > :not(.wp-rays) { position: relative; z-index: 1; }
.modal.levelup .wp-rays { top: 30%; width: 160%; opacity: .7; }
.lu-kicker { margin: 0; color: var(--marigold-soft); font-weight: 700; letter-spacing: .02em; }
.modal.levelup h2 { font-size: var(--step-4); padding: 0; margin: 0; }
.lu-reward { font-family: var(--font-display); font-size: var(--step-2); color: #FFE08A; margin: 4px 0 8px; }
.lu-preview { display: flex; justify-content: center; gap: 8px; margin: 14px 0 18px; }
.lu-preview .avatar.framed { width: 52px; height: 52px; }
.lu-preview .avatar.framed .face { font-size: 1.2rem; }
.levelup .sheet-actions .gbtn { justify-content: center; }
.toast.level { background: linear-gradient(180deg, #FFE59A, #D9AC4F); color: #1A1408; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.4), 0 0 24px rgba(255, 200, 90, .6); }

/* one look per level */
.look-items { grid-template-columns: repeat(4, 1fr) !important; gap: 12px; }
@media (min-width: 640px) { .look-items { grid-template-columns: repeat(5, 1fr) !important; } }
.look-item { aspect-ratio: auto; padding: 10px 8px 8px; gap: 6px; }
.look-item .avatar.framed { width: 72%; height: auto; aspect-ratio: 1; }
.look-lv { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: var(--marigold-soft); }
.look-lv svg { width: 11px; height: 11px; }
.look-item.locked .look-lv { color: var(--muted); }
.look-check { top: 6px; right: 6px; bottom: auto; }
.lu-preview figure { margin: 0; display: grid; justify-items: center; gap: 8px; }
.lu-preview .avatar.framed { width: 84px; height: 84px; }
.lu-preview .avatar.framed .face { font-size: 2rem; }
.lu-preview figcaption { font-size: .78rem; font-weight: 700; color: var(--marigold-soft); }
.lu-preview { gap: 28px; }

.look-lv { white-space: nowrap; }

/* ------------------------------------------------------------------ private tables */
.friends {
  display: grid; gap: 12px; margin: 12px 0 4px; padding: 14px; border-radius: 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, #22285E, #1C174E) padding-box,
    linear-gradient(120deg, rgba(120, 174, 255, .5), rgba(233, 190, 91, .35)) border-box;
}
.fr-head { display: flex; align-items: center; gap: 12px; }
.fr-head > div { display: grid; line-height: 1.3; }
.fr-head span:not(.fr-icon) { color: var(--muted); font-size: var(--step--1); }
.fr-icon { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: rgba(120, 174, 255, .15); color: #9CC2FF; }
.fr-icon svg { width: 22px; height: 22px; }
.code-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.code-form input {
  min-height: 42px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05);
  font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
}
.code-form input::placeholder { letter-spacing: normal; text-transform: none; font-weight: 500; }
.code-form input:focus { outline: none; border-color: var(--marigold); box-shadow: 0 0 0 3px rgba(217,172,79,.25); }
.fr-create { width: 100%; }
.fr-create .gb-ic svg { width: 16px; height: 16px; }
.fr-label { margin: 2px 0 0; font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.my-rooms { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.my-rooms li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; background: rgba(255,255,255,.05); }
.my-rooms li > span { display: grid; line-height: 1.3; min-width: 0; }
.my-rooms li > span span { font-size: .75rem; color: var(--muted); letter-spacing: .02em; }

.cp-form { display: grid; gap: 8px; }
.cp-form > input {
  min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.05); margin-bottom: 6px;
}
.cp-form > input:focus { outline: none; border-color: var(--marigold); }
.cp-form .gbtn { margin-top: 8px; width: 100%; }
.chip-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.chip-pick label { position: relative; }
.chip-pick input { position: absolute; opacity: 0; inset: 0; }
.chip-pick span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255,255,255,.05); font-weight: 700;
}
.chip-pick input:checked + span { border-color: #F4D98C; background: rgba(255, 216, 120, .15); color: #FFE08A; }
.chip-pick input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 2px; }

.room-title { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 2px 8px; border-radius: 10px; }
.room-title:hover { background: rgba(255, 255, 255, .06); }
.room-title strong svg { width: 14px; height: 14px; vertical-align: -1px; }
.room-title span b { color: #FFE08A; letter-spacing: .12em; }
.room-title span svg { width: 13px; height: 13px; vertical-align: -2px; margin-left: 4px; color: #FFE08A; }
.friends { min-width: 0; }
.friends > * { min-width: 0; }
.fr-head > div { min-width: 0; }
.code-form input { min-width: 0; width: 100%; }

.version-warning {
  position: fixed; left: 0; right: 0; top: 0; z-index: 200; padding: 12px 16px; text-align: center;
  background: #C21D36; color: #fff; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.5);
}

/* ------------------------------------------------------------------ deposits & withdrawals */
.wallet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 6px 0 18px; }
.wallet-actions .gbtn { min-height: 54px; font-size: 1.05rem; }
.pay-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 8px; }
.pay { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--night-2); border-left: 4px solid #E9BE5B; }
.pay.approved { border-left-color: #2BB59A; }
.pay.rejected { border-left-color: #D7263D; }
.pay-kind { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(255,255,255,.06); color: #FFE08A; }
.pay-kind svg { width: 18px; height: 18px; }
.pay-main { display: grid; line-height: 1.3; min-width: 0; }
.pay-main span { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay-main .pay-note { color: var(--muted, #b9b3d6); white-space: normal; }
.pay.rejected .pay-main .pay-note { color: #FFB3BF; }
.pay-status { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: rgba(233,190,91,.15); color: #FFE08A; white-space: nowrap; }
.pay.approved .pay-status { background: rgba(43,181,154,.18); color: #9CEBD6; }
.pay.rejected .pay-status { background: rgba(215,38,61,.18); color: #FFB3BF; }
.pay-sheet { max-height: 88vh; overflow: auto; }
.cp-form > input[type=number] { appearance: textfield; }
.method-list { display: grid; gap: 8px; margin-bottom: 6px; }
.method { position: relative; display: block; cursor: pointer; }
.method input { position: absolute; opacity: 0; }
.method > span { display: grid; gap: 2px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.method > span span { color: var(--muted); font-size: .82rem; }
.method > span .acct { color: var(--text); font-weight: 700; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.method > span em { font-style: normal; font-size: .78rem; color: #FFE08A; }
.method input:checked + span { border-color: #F4D98C; background: rgba(255,216,120,.1); }
.method input:focus-visible + span { outline: 3px solid var(--marigold); outline-offset: 2px; }
.pay-hint { margin: 0; font-size: .78rem; color: var(--muted); }

/* ---------------------------------------------------------------- sound toggle */
.sound-toggle { position: absolute; right: 12px; bottom: 62px; z-index: 6; }
.sound-toggle[aria-pressed="true"] { opacity: .65; }

/* ================================================================ premium tables by stake */
.rim-trim, .rim-shine, .gem, .felt-crest { display: none; }

/* ---- Classic: walnut rim, burgundy velvet, brass */
.game[data-tier="classic"] {
  --felt-hi: #B8324E; --felt-1: #8C1A33; --felt-2: #5E0C22; --felt-3: #330412;
  --brass-1: #F3D48A; --brass-2: #B9893A; --brass-3: #6E4A14;
}
.game[data-tier="classic"] .table-rim {
  background:
    radial-gradient(ellipse 60% 18% at 50% 3%, rgba(255, 230, 190, .28), transparent 70%),
    repeating-linear-gradient(97deg, rgba(0, 0, 0, .09) 0 2px, transparent 2px 11px),
    repeating-linear-gradient(83deg, rgba(255, 220, 170, .06) 0 1px, transparent 1px 13px),
    linear-gradient(180deg, #9A6338 0%, #6B3E1E 34%, #43230E 70%, #2A1407 100%);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .8),
    0 0 0 3px var(--brass-3), 0 0 0 4px var(--brass-1), 0 0 0 6px var(--brass-2), 0 0 0 7px #2A1407,
    0 40px 74px rgba(0, 0, 0, .8), 0 7px 0 rgba(0, 0, 0, .35),
    inset 0 2px 1px rgba(255, 230, 190, .35), inset 0 -8px 16px rgba(0, 0, 0, .55);
}
.game[data-tier="classic"] .table-rim::after { border: 0; inset: 9px; box-shadow: inset 0 0 0 1px rgba(243, 212, 138, .55), 0 0 0 1px rgba(0, 0, 0, .35); }
.game[data-tier="classic"] .table-felt {
  background:
    radial-gradient(ellipse 55% 42% at 50% 34%, rgba(214, 70, 100, .45), transparent 72%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255, 255, 255, .018) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 50% 48%, var(--felt-1) 0%, var(--felt-2) 62%, var(--felt-3) 100%);
  box-shadow:
    0 0 0 2px var(--brass-3), 0 0 0 4px var(--brass-1), 0 0 0 5px #FFF3D0, 0 0 0 6px var(--brass-3),
    inset 0 22px 44px rgba(0, 0, 0, .5), inset 0 -12px 30px rgba(0, 0, 0, .4);
}
.game[data-tier="classic"] .table-felt::after { border: 1px solid rgba(243, 212, 138, .38); box-shadow: 0 0 0 5px transparent, 0 0 0 6px rgba(243, 212, 138, .16); }
.game[data-tier="classic"] .felt-title { fill: rgba(243, 212, 138, .38); }
.game[data-tier="classic"] .table-glow { background: radial-gradient(ellipse at 50% 50%, rgba(255, 170, 120, .16), rgba(255, 150, 110, .05) 45%, transparent 70%); }

/* ---- Pro: black lacquer, onyx felt with a gold lattice */
.game[data-tier="pro"] { --felt-hi: #4A4E5A; --felt-1: #2C2F37; --felt-2: #191B21; --felt-3: #090A0D; }
.game[data-tier="pro"] .table-rim {
  background:
    radial-gradient(ellipse 64% 16% at 50% 2%, rgba(255, 255, 255, .42), transparent 70%),
    radial-gradient(ellipse 30% 8% at 50% 98%, rgba(255, 255, 255, .1), transparent 70%),
    linear-gradient(180deg, #44454C 0%, #17171B 30%, #0A0A0D 70%, #000 100%);
  box-shadow:
    0 0 0 1px #000,
    0 0 0 2px #7A5418, 0 0 0 3px #FFE29A, 0 0 0 5px #C9962F, 0 0 0 6px #5A3A08, 0 0 0 8px #0A0A0D, 0 0 0 9px rgba(233, 190, 91, .5),
    0 44px 80px rgba(0, 0, 0, .85), 0 0 60px rgba(233, 190, 91, .12),
    inset 0 2px 1px rgba(255, 255, 255, .45), inset 0 -8px 16px rgba(0, 0, 0, .7);
}
.game[data-tier="pro"] .table-rim::after { border: 3px double rgba(233, 190, 91, .75); inset: 8px; }
.game[data-tier="pro"] .rim-trim {
  display: block; position: absolute; inset: 4px; pointer-events: none; border-radius: 50% / 47%;
  border: 2px dotted rgba(255, 226, 154, .55);
}
.game[data-tier="pro"] .table-felt {
  background:
    radial-gradient(ellipse 50% 38% at 50% 36%, rgba(140, 146, 165, .38), transparent 72%),
    repeating-linear-gradient(60deg, rgba(233, 190, 91, .085) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(-60deg, rgba(233, 190, 91, .085) 0 1px, transparent 1px 26px),
    radial-gradient(ellipse at 50% 48%, var(--felt-1) 0%, var(--felt-2) 62%, var(--felt-3) 100%);
  box-shadow:
    0 0 0 1px #000, 0 0 0 3px #C9962F, 0 0 0 4px #FFF0C0, 0 0 0 5px #7A5418,
    inset 0 22px 44px rgba(0, 0, 0, .6), inset 0 -12px 30px rgba(0, 0, 0, .5), inset 0 0 80px rgba(0, 0, 0, .4);
}
.game[data-tier="pro"] .table-felt::after { border: 1px solid rgba(233, 190, 91, .5); }
.game[data-tier="pro"] .felt-title { fill: rgba(233, 190, 91, .5); letter-spacing: .12em; }
.game[data-tier="pro"] .table-glow { background: radial-gradient(ellipse at 50% 50%, rgba(233, 190, 91, .16), rgba(233, 190, 91, .04) 45%, transparent 70%); }
.game[data-tier="pro"] .room .stars { opacity: .25; }

/* ---- High Roller: gold-plated rim with gem studs, royal velvet, gold glow */
.game[data-tier="vip"] { --felt-hi: #8A3FD0; --felt-1: #5A1E9A; --felt-2: #3A0F6E; --felt-3: #1C0538; }
.game[data-tier="vip"] .table-rim {
  background:
    radial-gradient(ellipse 60% 16% at 50% 3%, rgba(255, 255, 240, .75), transparent 70%),
    radial-gradient(ellipse 34% 9% at 50% 97%, rgba(255, 240, 190, .35), transparent 70%),
    linear-gradient(180deg, #FFF3C2 0%, #F1C95A 14%, #B98221 36%, #E9C266 55%, #9C6512 78%, #5E3A05 100%);
  box-shadow:
    0 0 0 1px #3E2600, 0 0 0 3px #FFE9A8, 0 0 0 4px #7A4E08,
    0 46px 84px rgba(0, 0, 0, .85), 0 0 90px rgba(255, 200, 90, .32), 0 0 30px rgba(255, 210, 120, .25),
    inset 0 2px 2px rgba(255, 255, 255, .8), inset 0 -8px 14px rgba(80, 45, 0, .6);
}
.game[data-tier="vip"] .table-rim::after { border: 1px solid rgba(80, 45, 0, .55); inset: 6px; box-shadow: inset 0 1px 0 rgba(255, 245, 210, .7), 0 1px 0 rgba(255, 245, 210, .5); }
.game[data-tier="vip"] .rim-shine {
  display: block; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; overflow: hidden;
}
.game[data-tier="vip"] .rim-shine::before {
  content: ''; position: absolute; inset: -50% -20%;
  background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, .7) 49%, rgba(255, 255, 255, .0) 58%);
  animation: rimShine 5.5s ease-in-out infinite;
}
@keyframes rimShine { 0% { transform: translateX(-60%); } 55%, 100% { transform: translateX(60%); } }
.reduce-motion .game[data-tier="vip"] .rim-shine::before { animation: none; opacity: 0; }

.game[data-tier="vip"] .gem {
  display: block; position: absolute; z-index: 2; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px;
  transform: rotate(45deg); border-radius: 2px;
  box-shadow: 0 0 0 2px #FFE29A, 0 0 0 3px #7A4E08, 0 2px 4px rgba(0, 0, 0, .6), inset 0 0 3px rgba(255, 255, 255, .5);
}
.game[data-tier="vip"] .gem::after { content: ''; position: absolute; left: 2px; top: 2px; width: 4px; height: 4px; border-radius: 50%; background: rgba(255, 255, 255, .85); filter: blur(.5px); }
.gem-ruby { background: linear-gradient(135deg, #FF8FA3, #D7143A 45%, #6E0018); }
.gem-sapphire { background: linear-gradient(135deg, #9FC3FF, #1F55D6 45%, #0B1F66); }
.gem-emerald { background: linear-gradient(135deg, #9FF0C8, #10A36A 45%, #04452B); }
.gem-diamond { background: linear-gradient(135deg, #FFFFFF, #CFE6FF 40%, #8FAFD6 70%, #F4FAFF); }
/* gems sit on the middle of the rim (rim is 22px thick on wide screens) */
.game[data-tier="vip"] .gem.g0 { left: calc(100% - 11px); top: 50%; }
.game[data-tier="vip"] .gem.g1 { left: calc(50% + .7071 * (50% - 11px)); top: calc(50% + .7071 * (50% - 11px)); }
.game[data-tier="vip"] .gem.g2 { left: 50%; top: calc(100% - 11px); }
.game[data-tier="vip"] .gem.g3 { left: calc(50% - .7071 * (50% - 11px)); top: calc(50% + .7071 * (50% - 11px)); }
.game[data-tier="vip"] .gem.g4 { left: 11px; top: 50%; }
.game[data-tier="vip"] .gem.g5 { left: calc(50% - .7071 * (50% - 11px)); top: calc(50% - .7071 * (50% - 11px)); }
.game[data-tier="vip"] .gem.g6 { left: 50%; top: 11px; }
.game[data-tier="vip"] .gem.g7 { left: calc(50% + .7071 * (50% - 11px)); top: calc(50% - .7071 * (50% - 11px)); }

.game[data-tier="vip"] .table-felt {
  background:
    radial-gradient(ellipse 55% 42% at 50% 34%, rgba(170, 100, 255, .4), transparent 72%),
    radial-gradient(circle at 50% 50%, rgba(255, 215, 120, .07) 1.5px, transparent 2px) 0 0 / 22px 22px,
    radial-gradient(circle at 50% 50%, rgba(255, 215, 120, .05) 1px, transparent 1.5px) 11px 11px / 22px 22px,
    radial-gradient(ellipse at 50% 48%, var(--felt-1) 0%, var(--felt-2) 62%, var(--felt-3) 100%);
  box-shadow:
    0 0 0 1px #3E2600, 0 0 0 3px #E9BE5B, 0 0 0 4px #FFF6D6, 0 0 0 6px #A8721A, 0 0 0 7px #3E2600,
    inset 0 22px 44px rgba(0, 0, 0, .5), inset 0 -12px 30px rgba(0, 0, 0, .45), inset 0 0 60px rgba(20, 0, 40, .5);
}
.game[data-tier="vip"] .table-felt::after { border: 1.5px solid rgba(255, 220, 140, .5); box-shadow: 0 0 0 4px transparent, 0 0 0 5px rgba(255, 220, 140, .2); }
.game[data-tier="vip"] .felt-crest {
  display: block; position: absolute; left: 50%; top: 22%; width: 54px; height: 40px; transform: translateX(-50%); opacity: .55; pointer-events: none;
  background: linear-gradient(180deg, #FFE9A8, #B98221);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 40'%3E%3Cpath d='M4 34 L2 8 L15 20 L27 2 L39 20 L52 8 L50 34 Z M4 36 H50 V40 H4 Z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 54 40'%3E%3Cpath d='M4 34 L2 8 L15 20 L27 2 L39 20 L52 8 L50 34 Z M4 36 H50 V40 H4 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.game[data-tier="vip"] .felt-title { fill: rgba(255, 220, 140, .55); letter-spacing: .1em; }
.game[data-tier="vip"] .table-glow {
  background: radial-gradient(ellipse at 50% 50%, rgba(255, 200, 90, .28), rgba(200, 120, 255, .08) 45%, transparent 70%);
  animation: vipGlow 4s ease-in-out infinite alternate;
}
@keyframes vipGlow { from { opacity: .75; } to { opacity: 1; } }
.reduce-motion .game[data-tier="vip"] .table-glow { animation: none; }
.game[data-tier="vip"] .room::after {
  content: ''; position: absolute; left: 50%; top: -10%; width: 90%; height: 80%; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(ellipse 50% 60% at 50% 0%, rgba(255, 220, 150, .16), transparent 70%);
}
.game[data-tier="vip"] .pot-amt, .game[data-tier="pro"] .pot-amt { color: #FFE29A; }

@media (max-width: 420px) {
  .game[data-tier="vip"] .gem.g0 { left: calc(100% - 9px); }
  .game[data-tier="vip"] .gem.g2 { top: calc(100% - 9px); }
  .game[data-tier="vip"] .gem.g4 { left: 9px; }
  .game[data-tier="vip"] .gem.g6 { top: 9px; }
}
/* Portrait capsule: gems on the straight sides instead of the diagonals */
@media (max-width: 700px) and (orientation: portrait) {
  .game[data-tier="vip"] .gem.g0 { left: calc(100% - 12.5px); top: 50%; }
  .game[data-tier="vip"] .gem.g4 { left: 12.5px; top: 50%; }
  .game[data-tier="vip"] .gem.g2 { left: 50%; top: calc(100% - 12.5px); }
  .game[data-tier="vip"] .gem.g6 { left: 50%; top: 12.5px; }
  .game[data-tier="vip"] .gem.g1 { left: calc(100% - 12.5px); top: 64%; }
  .game[data-tier="vip"] .gem.g7 { left: calc(100% - 12.5px); top: 36%; }
  .game[data-tier="vip"] .gem.g3 { left: 12.5px; top: 64%; }
  .game[data-tier="vip"] .gem.g5 { left: 12.5px; top: 36%; }
  .game[data-tier="pro"] .rim-trim { border-radius: 166px; }
}

/* ---------------------------------------------------------------- sign up / log in */
.auth .field select, .phone-row select {
  min-height: 48px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.04); color: var(--text); font: inherit; font-weight: 600;
}
.phone-row { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.phone-row select { width: 112px; }
.phone-row select option { background: var(--night-2); color: var(--text); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: #FF6F86; box-shadow: 0 0 0 3px rgba(215, 38, 61, .2); }
.seg-mini { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 3px; margin: 0 0 14px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid var(--line); }
.seg-mini button { border: 0; background: none; color: var(--muted); font: 600 .85rem var(--font-body); min-height: 34px; border-radius: 8px; cursor: pointer; }
.seg-mini button[aria-pressed="true"] { background: rgba(217,172,79,.16); color: var(--marigold-soft); }
.pw-wrap { position: relative; }
.pw-wrap input { width: 100%; padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.pw-eye svg { width: 20px; height: 20px; }
.pw-eye.on { color: var(--marigold); }
.link-btn { border: 0; background: none; padding: 6px 0; color: var(--marigold-soft); font: 600 .88rem var(--font-body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.forgot-link { display: block; margin: -6px 0 10px auto; }
.back-link { display: block; margin: 14px auto 0; color: var(--muted); }
.brand.small { margin-bottom: 18px; }
.brand.small .wordmark { font-size: var(--step-3); }
.reset-resume {
  display: block; width: 100%; text-align: left; margin-bottom: 14px; padding: 12px 14px; border-radius: 12px; cursor: pointer;
  background: rgba(217,172,79,.1); border: 1px solid rgba(217,172,79,.4); color: var(--marigold-soft); font: 500 .88rem var(--font-body);
}
.reset-resume span { display: block; margin-top: 4px; font-weight: 700; }
.reset-card {
  display: grid; justify-items: center; gap: 8px; padding: 22px 16px; margin-bottom: 18px; border-radius: 18px; text-align: center;
  background: radial-gradient(100% 120% at 50% 0%, rgba(217,172,79,.18), transparent 70%), rgba(255,255,255,.04); border: 1px solid rgba(217,172,79,.45);
}
.rc-label { color: var(--muted); font-size: var(--step--1); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.rc-code { font: 800 2.2rem ui-monospace, Menlo, Consolas, monospace; letter-spacing: .14em; color: #FFE7A8; }
.reset-steps { margin: 0 0 16px; padding-left: 20px; display: grid; gap: 8px; line-height: 1.5; }
.waiting { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text); font-weight: 600; margin: 0 0 10px; }
.waiting .muted { color: var(--muted); font-weight: 400; font-size: var(--step--1); width: 100%; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(217,172,79,.25); border-top-color: var(--marigold); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.reset-ok { padding: 12px 14px; margin-bottom: 16px; border-radius: 12px; background: rgba(63,179,127,.14); border: 1px solid rgba(63,179,127,.4); color: #A6EBC9; }
.small-note { font-size: var(--step--1); color: var(--muted); text-align: center; }
.acct-card { display: grid; gap: 10px; padding: 16px; border-radius: 16px; background: rgba(255,255,255,.04); border: 1px solid var(--line); max-width: 520px; }
.acct-card > div:not(.acct-actions) { display: flex; justify-content: space-between; gap: 12px; }
.acct-card span { color: var(--muted); }
.acct-card b { text-align: right; overflow-wrap: anywhere; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.phone-row input { min-width: 0; width: 100%; }
.field[hidden] { display: none; }

/* ================================================================ homepage */
.back-games { display: inline-flex; align-items: center; gap: 4px; margin: -4px 0 12px; color: var(--muted); font-weight: 600; text-decoration: none; }
.back-games svg { width: 18px; height: 18px; }
.back-games:hover { color: var(--text); }

.banners { position: relative; margin: 0 0 18px; }
.bn-track {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; border-radius: 22px;
  box-shadow: 0 18px 40px rgba(6, 4, 30, .55);
}
.bn-track::-webkit-scrollbar { display: none; }
.banner {
  position: relative; flex: 0 0 100%; scroll-snap-align: start; overflow: hidden; isolation: isolate;
  min-height: 188px; aspect-ratio: 16 / 7; display: flex; align-items: flex-end;
  --b1: #F7C55C; --b2: #B86A08; --b3: #4A2300; --ink: #2A1500;
  background: radial-gradient(120% 90% at 100% 0%, var(--b1), transparent 60%), linear-gradient(135deg, var(--b2), var(--b3));
}
.banner.theme-ruby { --b1: #FF6B81; --b2: #A3122C; --b3: #3A0510; }
.banner.theme-emerald { --b1: #59E0B0; --b2: #0E7A58; --b3: #032A1E; }
.banner.theme-royal { --b1: #A98BFF; --b2: #4B2BB8; --b3: #170A45; }
.banner.theme-midnight { --b1: #5C8BFF; --b2: #1B2A6B; --b3: #060B24; }
.banner.theme-sunset { --b1: #FFC36B; --b2: #E0475C; --b3: #4B0D3A; }
.bn-deco { position: absolute; right: -4%; top: 50%; transform: translateY(-50%) rotate(-12deg); width: 52%; max-width: 300px; aspect-ratio: 1; z-index: -1; opacity: .28; }
.bn-deco .bn-suit { width: 100%; height: 100%; fill: #fff; }
.banner::after { content: ''; position: absolute; inset: 0; z-index: -1; background: repeating-linear-gradient(115deg, rgba(255,255,255,.05) 0 2px, transparent 2px 14px); mix-blend-mode: overlay; }
.bn-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
.banner.has-img::after { background: linear-gradient(90deg, rgba(10, 6, 30, .82), rgba(10, 6, 30, .35) 55%, transparent 80%); mix-blend-mode: normal; }
.bn-text { padding: 20px 22px 26px; max-width: 68%; color: #fff; }
.bn-text h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: clamp(1.45rem, 5.4vw, 2.3rem); line-height: 1.05; text-shadow: 0 2px 12px rgba(0,0,0,.35); text-wrap: balance; }
.bn-text p { margin: 8px 0 0; font-size: var(--step--1); line-height: 1.45; color: rgba(255,255,255,.88); max-width: 34ch; }
.bn-cta {
  margin-top: 14px; min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; cursor: pointer;
  background: #FFF6E2; color: #2A1500; font: 700 .9rem var(--font-body); box-shadow: 0 4px 0 rgba(0,0,0,.25);
}
.bn-cta:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.bn-hit { position: absolute; inset: 0; border: 0; background: none; cursor: pointer; }
.bn-dots { position: absolute; left: 0; right: 0; bottom: 9px; display: flex; justify-content: center; gap: 6px; pointer-events: none; }
.bn-dots button { pointer-events: auto; width: 7px; height: 7px; padding: 0; border: 0; border-radius: 4px; background: rgba(255,255,255,.45); cursor: pointer; transition: width .25s; }
.bn-dots button[aria-current] { width: 20px; background: #fff; }

.games-title { margin-top: 6px; }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 760px) { .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } .banner { min-height: 240px; } }
.game-tile {
  position: relative; display: grid; grid-template-rows: auto auto auto 1fr; justify-items: start; gap: 2px; text-align: left;
  padding: 10px 12px 14px; border-radius: 18px; cursor: pointer; overflow: hidden; color: #fff; font: inherit;
  border: 1px solid rgba(255,255,255,.12); --g1: #13886A; --g2: #063A2E;
  background: radial-gradient(130% 80% at 50% 0%, var(--g1), var(--g2) 75%);
  box-shadow: inset 0 0 0 4px rgba(0,0,0,.12), inset 0 0 0 5px rgba(255, 226, 154, .28), 0 10px 22px rgba(6, 4, 30, .45);
  transition: transform .15s ease;
}
.game-tile:hover { transform: translateY(-2px); }
.game-tile:active { transform: translateY(1px); }
.game-tile:focus-visible { outline: 3px solid var(--marigold); outline-offset: 3px; }
.game-tile.tone-pk { --g1: #2C6E55; --g2: #0B1C17; }
.game-tile.tone-rm { --g1: #B22A47; --g2: #3C0716; }
.game-tile.tone-pl { --g1: #1C7FB8; --g2: #06263D; }
.game-tile.tone-sn { --g1: #2E8A3E; --g2: #0B2A12; }
.gt-art { width: 100%; aspect-ratio: 4 / 3; display: block; filter: drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.gt-art svg { width: 100%; height: 100%; display: block; }
.gt-name { font-family: var(--font-display); font-size: 1.28rem; line-height: 1.1; margin-top: 2px; }
.gt-sub { font-size: .78rem; color: rgba(255,255,255,.75); }
.gt-live, .gt-soon { align-self: end; margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.gt-live { background: rgba(0,0,0,.3); color: #B8F5D8; }
.gt-live i { width: 7px; height: 7px; border-radius: 50%; background: #4CD7A0; box-shadow: 0 0 0 3px rgba(76,215,160,.25); }
.gt-soon { background: rgba(255,255,255,.14); color: #FFE7A8; }
.game-tile.soon .gt-art { opacity: .8; filter: saturate(.8) drop-shadow(0 8px 10px rgba(0,0,0,.35)); }
.bn-cta { display: inline-flex; align-items: center; }

/* top up from the balance, leave notices, reconnecting */
button.balance-pill { font: inherit; cursor: pointer; color: inherit; }
.balance-pill.topup { display: inline-flex; align-items: center; gap: 6px; }
.balance-pill.topup i { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--marigold); color: #1A1408; font-style: normal; font-weight: 800; font-size: .85rem; line-height: 1; }
.balance-pill.topup:hover { border-color: var(--marigold); }
.badge-status.recon { background: #5B4A00; color: #FFE08A; animation: reconPulse 1.2s ease-in-out infinite; }
@keyframes reconPulse { 50% { opacity: .55; } }
.reduce-motion .badge-status.recon { animation: none; }
.seat.reconnecting .avatar { filter: grayscale(.7) brightness(.8); }
.turn-info.low { color: #FFB3BF; }
.fx-label.left { background: rgba(215, 38, 61, .92); color: #fff; }
.toast.info { border-left: 3px solid #8C7CF0; }
.fx-label.left { padding: 3px 10px; border-radius: 999px; font-size: .85rem; text-shadow: none; }

/* ================================================================ poker */
.tabs.four { grid-template-columns: repeat(4, 1fr); }
.pk-tabs { margin: 4px 0 16px; }
.pk-list { display: grid; gap: 12px; }
.pk-card {
  position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; padding: 16px; border-radius: 18px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(44, 110, 85, .45), transparent 60%), rgba(255,255,255,.04); border: 1px solid var(--line);
}
.pk-card.tier-classic { background: radial-gradient(120% 140% at 0% 0%, rgba(166, 30, 56, .45), transparent 60%), rgba(255,255,255,.04); }
.pk-card.tier-pro { background: radial-gradient(120% 140% at 0% 0%, rgba(233, 190, 91, .22), transparent 60%), rgba(0,0,0,.25); }
.pk-card.tier-vip { background: radial-gradient(120% 140% at 0% 0%, rgba(138, 63, 208, .5), transparent 60%), rgba(255,255,255,.04); border-color: rgba(233,190,91,.4); }
.pk-card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--step-1); color: var(--marigold-soft); }
.pk-blinds { margin: 4px 0 2px; font-size: var(--step-0); }
.pk-blinds b { color: #F4D98C; }
.pk-meta { margin: 0; color: var(--muted); font-size: var(--step--1); }
.pk-variant { position: absolute; top: 12px; right: 14px; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: rgba(0,0,0,.35); color: #CFC9F2; }
.pk-card .gbtn { grid-column: 2; grid-row: 1; align-self: end; min-height: 44px; padding: 0 22px; }

.pk-pot { gap: 6px; top: 44%; }
.pk-board { display: flex; gap: 5px; margin-top: 4px; }
.pk-board .card { --w: 44px; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.pk-slot { width: 44px; height: 61.6px; border-radius: 5px; border: 1.5px dashed rgba(255, 226, 154, .25); }
@media (min-width: 700px) { .pk-board .card { --w: 56px; } .pk-slot { width: 56px; height: 78.4px; } }
.pk-pot .pot-amt { font-size: var(--step-1); min-width: 84px; }
.seat .hand.pk-h4 .card, .seat .hand.pk-h5 .card, .seat .hand.pk-h6 .card { --w: 26px; }
.seat .hand.sm.pk-h4 .card + .card, .seat .hand.sm.pk-h5 .card + .card, .seat .hand.sm.pk-h6 .card + .card { margin-left: -8px; }
.seat.me .hand.fan.pk-h2 .card { --w: 62px; }
.seat.me .hand.fan.pk-h4 .card { --w: 50px; }
.seat.me .hand.fan.pk-h5 .card { --w: 46px; }
.seat.me .hand.fan.pk-h6 .card { --w: 42px; }
.seat.me .hand.fan.pk-h4 .card + .card, .seat.me .hand.fan.pk-h5 .card + .card, .seat.me .hand.fan.pk-h6 .card + .card { margin-left: calc(var(--w) * -0.42); }
.seat.me .hand.fan[class*="pk-h"] .card { --rest: none; }
.pk-backs .card + .card { margin-left: -14px; }
.badge-status.allin { background: #8E1B2E; color: #FFE0E5; border-color: rgba(255,224,229,.35); }
.badge-status.act-fold { background: #3A3550; color: #A9A3C8; }
.badge-status.act-raise, .badge-status.act-bet { background: #9A5A00; color: #FFE7B0; }
.badge-status.act-call, .badge-status.act-check { background: #1E5E8C; color: #D8EEFF; }
.pk-myhand { text-align: center; margin: 6px 0 0; color: #F4D98C; font-weight: 700; }
.pk-raise { display: grid; gap: 8px; margin-bottom: 8px; }
.pk-presets { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pk-presets .chip-btn { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(217,172,79,.4); background: rgba(217,172,79,.1); color: var(--marigold-soft); font: 700 .82rem var(--font-body); cursor: pointer; }
.pk-slider { display: grid; grid-template-columns: auto 1fr auto 96px; gap: 8px; align-items: center; }
.pk-slider input[type="range"] { width: 100%; accent-color: var(--marigold); }
.pk-slider input[type="number"] { min-height: 38px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--text); font: 700 1rem var(--font-body); text-align: center; width: 100%; }
.round-btn.sm { width: 34px; height: 34px; font-size: 1.2rem; font-weight: 700; }

.pk-acts .gbtn small { display: block; font-size: .78rem; opacity: .9; }
.pk-actions .act-row.primary { min-height: 56px; }
.pk-buyin { display: grid; gap: 10px; justify-items: center; margin: 8px 0 2px; }
.pk-buyin b { font-family: var(--font-display); font-weight: 400; font-size: var(--step-3); color: #F4D98C; }
.pk-buyin input { width: 100%; accent-color: var(--marigold); }
.pk-buyin-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: var(--step--1); margin-bottom: 10px; }
.pk-hero h1 { margin-bottom: 4px; }
.pk-actions { grid-template-rows: 20px 84px 58px; height: calc(20px + 84px + 58px + 20px); }
.pk-actions .act-idle.pk-idle { grid-row: 1 / 3; }
.pk-actions .pk-row3 { grid-row: 3; }
.pk-actions .act-idle .pk-myhand { display: block; margin-top: 4px; font-size: var(--step--1); }
.pk-raise { margin: 0; align-content: center; }
@media (max-width: 480px) {
  .pk-board { gap: 3px; }
  .pk-board .card { --w: 38px; }
  .pk-slot { width: 38px; height: 53.2px; }
}
.pk-actions > .act-row.secondary:not(.pk-row3) { align-self: end; height: 46px; }
/* ------------------------------------------------------------------ poker on phones
   Clean layout: each seat is name, avatar, stack. The table gets the room,
   the action bar is one row and sizing a raise opens a panel above it. */
.pk-narrow .felt-title, .pk-narrow .table-glow { display: none; }
@media (max-width: 700px) and (orientation: portrait) {
  .pk-narrow .table-rim { inset: 10% 4% 19%; }
}
.pk-narrow .pk-pot { top: 46%; gap: 8px; }
.pk-narrow .pk-pot .pot-amt { min-width: 0; padding: 2px 14px; font-size: var(--step-0); font-family: var(--font-body); font-weight: 800; font-variant-numeric: tabular-nums; }
.pk-narrow .pk-pot .pot-amt small { font-weight: 600; font-size: .78em; color: rgba(255, 226, 154, .7); margin-right: 2px; }
.pk-narrow .pk-pot .pot-meta { order: 3; font-size: .72rem; opacity: .85; }
.pk-narrow .pk-board { gap: 4px; margin: 0; }
.pk-narrow .pk-board .card { --w: 40px; }
.pk-narrow .pk-slot { width: 40px; height: 56px; border-color: rgba(255, 226, 154, .14); }
@media (max-width: 360px) { .pk-narrow .pk-board .card { --w: 36px; } .pk-narrow .pk-slot { width: 36px; height: 50.4px; } }

.seat.pkm { width: 76px; gap: 0; }
.seat.pkm .avatar { width: 46px; height: 46px; padding: 3px; }
.seat.pkm .avatar .face { font-size: 1.2rem; }
.seat.pkm .dealer { width: 17px; height: 17px; font-size: 9px; top: auto; bottom: -2px; right: -6px; }
.seat.pkm.side-r .dealer { right: auto; left: -6px; }
.pkm-line {
  max-width: 76px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .7rem; font-weight: 600; line-height: 1.2; color: rgba(255, 255, 255, .82);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.pkm-line.act-fold { color: #B7B1DE; }
.pkm-line.act-check { color: #9FE8CF; }
.pkm-line.act-call { color: #8FC2FF; }
.pkm-line.act-bet, .pkm-line.act-raise { color: #FFB86B; }
.pkm-line.act-allin { color: #FF8A8A; font-weight: 800; }
.pkm-line.win { color: #F4D98C; font-weight: 800; font-size: .8rem; }
.pkm-line.hand { color: #FFE7A8; }
.pkm-line.recon { color: #FFB86B; }
.pkm-av { position: relative; }
.pkm-stack {
  position: relative; z-index: 6; margin-top: -8px; padding: 1px 8px;
  border-radius: 999px; background: rgba(6, 4, 20, .88); border: 1px solid rgba(217, 172, 79, .3);
  font-size: .72rem; font-weight: 700; color: #F4D98C; font-variant-numeric: tabular-nums; white-space: nowrap;
}
/* Two small card backs tucked beside the avatar, on the side facing the middle. */
.pkm-backs { position: absolute; top: 4px; right: -15px; width: 22px; height: 26px; pointer-events: none; }
.side-r .pkm-backs { right: auto; left: -15px; }
.side-t .pkm-backs { right: -17px; }
.pkm-backs i {
  position: absolute; top: 0; left: 0; width: 15px; height: 21px; border-radius: 2.5px;
  background: repeating-linear-gradient(45deg, #8E1B2E 0 2px, #B02A42 2px 4px);
  box-shadow: 0 0 0 1px #F3E1B8, 0 2px 4px rgba(0, 0, 0, .5); transform: rotate(-8deg);
}
.pkm-backs i + i { left: 7px; top: 2px; transform: rotate(8deg); }
/* Cards shown at showdown sit over the avatar. */
.pkm-shown { position: absolute; left: 50%; top: 52%; transform: translate(-50%, -50%); z-index: 3; }
.pkm-shown .hand .card { --w: 26px; }
.pkm-shown .hand.pk-h4 .card, .pkm-shown .hand.pk-h5 .card, .pkm-shown .hand.pk-h6 .card { --w: 22px; }
.pkm-shown .hand .card + .card { margin-left: -9px !important; }
.pkm-shown .hand.pk-h5 .card + .card, .pkm-shown .hand.pk-h6 .card + .card { margin-left: -12px !important; }
.seat.pkm.packed .avatar, .seat.pkm.packed .pkm-stack { filter: grayscale(.8) brightness(.6); }
.seat.pkm.packed .pkm-line:not([class*="act-"]) { opacity: .6; }
.seat.pkm.winner .pkm-stack { border-color: #F4D98C; box-shadow: 0 0 12px rgba(255, 216, 120, .5); }
.seat.pkm.empty .avatar { width: 40px; height: 40px; border-width: 1.5px; opacity: .55; }
.seat.pkm.empty.can-sit .avatar { opacity: 1; border-color: rgba(255, 216, 120, .55); }
.pkm-stake { gap: 3px; }
.pkm-stake .stake-amt { font-size: .68rem; padding: 0 6px; }

/* Your seat: avatar and stack on the left, your cards beside it. */
.seat.pkm.me {
  width: auto; bottom: 8px; display: flex; align-items: flex-end; gap: 10px;
  grid-template-areas: none;
}
.seat.pkm.me .pkm-id { display: grid; justify-items: center; }
.seat.pkm.me .avatar { width: 50px; height: 50px; }
.pkm-mine { display: grid; justify-items: center; gap: 4px; }
.seat.pkm.me .hand .card { --w: 60px; }
.seat.pkm.me .hand.pk-h4 .card { --w: 50px; }
.seat.pkm.me .hand.pk-h5 .card { --w: 46px; }
.seat.pkm.me .hand.pk-h6 .card { --w: 44px; }
.pkm-strength {
  max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: .74rem; font-weight: 700; color: #FFE7A8; text-shadow: 0 1px 2px rgba(0, 0, 0, .8);
}
.pkm-strength.win { padding: 1px 10px; border-radius: 999px; color: #1A1408; text-shadow: none; background: linear-gradient(180deg, #F4D98C, #D9AC4F); }
.seat.pkm.me.packed .hand { filter: grayscale(.7) brightness(.55); }

/* One-row action bar */
.pk-narrow .actions { padding: 8px 10px calc(10px + var(--safe-b)); border-radius: 18px 18px 0 0; }
.pkm-actions { grid-template-rows: 50px; height: 50px; gap: 0; position: relative; }
.pkm-actions .pkm-row { grid-row: 1; gap: 8px; }
.pkm-actions .act-row .gbtn { font-size: 1rem; border-radius: 14px; }
.pkm-actions .act-row .gbtn small { display: block; font-size: .74rem; font-weight: 700; opacity: .9; }
.pkm-actions .act-row .gbtn.wide { grid-column: span 2; }
.pkm-note { grid-row: 1; margin: 0; align-self: center; text-align: center; color: var(--muted); font-weight: 600; }
.pkm-note + .pkm-row { display: none; }
.pkm-actions:has(.pkm-note + .pkm-row) .pkm-note { position: absolute; left: 0; right: 0; bottom: calc(100% + 12px); font-size: .8rem; }
.pkm-actions:has(.pkm-note + .pkm-row) .pkm-row { display: grid; }
/* Pre-actions: outlined toggles so they never look like your turn. */
.gbtn.pre {
  --top: transparent; --bot: transparent; --edge: transparent; --fg: #CFC9F2;
  background: rgba(255, 255, 255, .04); border: 1.5px solid rgba(207, 201, 242, .28); box-shadow: none; font-size: .88rem !important;
}
.gbtn.pre.on { --fg: #FFE7A8; border-color: #D9AC4F; background: rgba(217, 172, 79, .16); }
.gbtn.pre.on::before { content: '✓ '; }
/* Raise sizing panel floats over the bottom of the table. */
.pkm-sizer {
  position: absolute; left: -10px; right: -10px; bottom: calc(100% + 8px); z-index: 5;
  display: grid; gap: 10px; padding: 12px 12px 10px;
  border-radius: 18px 18px 0 0; background: rgba(14, 10, 40, .97);
  border-top: 1px solid rgba(233, 190, 91, .45); box-shadow: 0 -12px 28px rgba(4, 2, 20, .55);
}
.pkm-sizer .pk-presets { flex-wrap: nowrap; justify-content: space-between; }
.pkm-sizer .pk-presets .chip-btn { flex: 1; padding: 0 4px; min-height: 34px; }
.pkm-sizer .pk-slider { grid-template-columns: auto 1fr auto 84px; }
.pk-narrow .log { bottom: 12px; cursor: pointer; }
.pkm-actions .gb-tx { text-align: center; justify-items: center; }
.seat.pkm.me .avatar, .seat.pkm.me .hand-wrap, .seat.pkm.me .plate { grid-area: auto; }
.seat.pkm.me .pkm-stack { margin-top: -8px; }
.leave-opt .lo-ic svg { width: 20px; height: 20px; }
/* Poker table menu */
.leave-sheet { max-width: 400px; }
.leave-sheet h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); color: var(--marigold); }
.leave-sheet > p { margin: 0 0 14px; color: var(--muted); font-size: var(--step--1); }
.leave-opts { display: grid; gap: 8px; }
.leave-opt {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 14px; text-align: left;
  border-radius: 14px; border: 1px solid rgba(233, 190, 91, .2); background: rgba(255, 255, 255, .04);
  color: var(--text); font: inherit; cursor: pointer;
}
.leave-opt:hover { background: rgba(255, 255, 255, .08); }
.leave-opt:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }
.leave-opt .lo-ic { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(217, 172, 79, .12); color: var(--marigold-soft); }
.leave-opt > span:last-child { display: grid; min-width: 0; }
.leave-opt b { font-weight: 700; font-size: .95rem; }
.leave-opt small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leave-opt.danger .lo-ic { background: rgba(242, 96, 122, .15); color: #FF8A9C; }
.leave-opt.danger b { color: #FF9AAA; }
.leave-opts .gbtn { margin-top: 6px; width: 100%; }

/* ================================================================== rummy
   A seat at a real card table: felt fills the screen, a padded leather rail
   curves across the top where the other players sit, your cards lie on the
   felt in front of you. Always landscape; phones held upright are turned. */
.rm-tabs { margin: 4px 0 16px; }
html.rm-rotate, html.rm-rotate body { overflow: hidden; }
html.rm-rotate body {
  position: fixed; left: 0; top: 0; margin: 0;
  width: var(--rot-w); height: var(--rot-h);
  transform-origin: 0 0; transform: rotate(90deg) translateY(-100%);
}
html.rm-rotate #toasts { width: min(70%, 420px); }

.rm-game {
  --pw: 60px;
  grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr);
  background: radial-gradient(120% 90% at 50% 0%, #241A52 0%, #120C30 55%, #08051A 100%);
}
.rm-game > * { min-width: 0; }
.rm-stage { position: relative; z-index: 1; grid-row: 1; }
.rm-bottom { position: relative; z-index: 3; grid-row: 2; display: grid; gap: 2px; padding: 0 14px calc(8px + var(--safe-b)); }

/* The rail: a very wide ellipse whose top edge is the curve you see. */
.rm-rail {
  position: absolute; left: -24%; width: 148%; top: 12%; height: 276%;
  border-radius: 50%; padding: 15px; pointer-events: none;
  background:
    radial-gradient(ellipse 30% 3% at 50% 1%, rgba(255, 255, 255, .22), transparent 70%),
    linear-gradient(180deg, var(--leather-hi) 0%, var(--leather-1) 6%, var(--leather-2) 14%);
  box-shadow:
    0 0 0 2px #8A5A10, 0 0 0 3.5px #FFE29A, 0 0 0 5px #9A6A1E,
    0 -10px 40px rgba(0, 0, 0, .55), inset 0 2px 1px rgba(255, 255, 255, .22), inset 0 -4px 10px rgba(0, 0, 0, .4);
}
.rm-rail::before {
  content: ''; position: absolute; inset: 7px; border-radius: 50%;
  border: 1.5px dashed var(--stitch);
}
.rm-felt {
  position: absolute; inset: 15px; border-radius: 50%; overflow: hidden;
  background:
    radial-gradient(ellipse 34% 9% at 50% 7%, color-mix(in srgb, var(--felt-hi) 75%, transparent), transparent 80%),
    radial-gradient(ellipse 60% 16% at 50% 11%, var(--felt-1), var(--felt-2) 60%, var(--felt-3) 100%);
  box-shadow: 0 0 0 2px #7A5418, 0 0 0 3.5px #E9BE5B, inset 0 18px 36px rgba(0, 0, 0, .45);
}
.rm-felt::after { /* faint woven texture */
  content: ''; position: absolute; inset: 0; opacity: .08;
  background-image: repeating-linear-gradient(45deg, #fff 0 1px, transparent 1px 4px), repeating-linear-gradient(-45deg, #fff 0 1px, transparent 1px 4px);
}

/* Header floats in the top corners, outside the rail */
.rm-head {
  position: absolute; top: 0; left: 0; right: 0; z-index: 6; pointer-events: none;
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
}
.rm-head > * { pointer-events: auto; }
.rm-head .round-btn { width: 38px; height: 38px; }
.rm-title { display: grid; line-height: 1.15; margin-right: auto; text-shadow: 0 1px 3px rgba(0, 0, 0, .8); }
.rm-title strong { font-family: var(--font-display); font-weight: 400; font-size: var(--step-0); color: var(--marigold); }
.rm-title span { font-size: .72rem; color: var(--muted); }

/* Opponents on the rail */
.rm-seat {
  position: absolute; z-index: 3; transform: translate(-50%, -26px);
  display: grid; justify-items: center; width: 92px; text-align: center;
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
}
.rm-seat[data-action] { cursor: pointer; }
.rs-av { position: relative; width: 52px; height: 52px; display: grid; place-items: center; }
.rm-seat .avatar {
  --h: 250; position: relative; width: 52px; height: 52px; padding: 3px; border-radius: 50%;
  background: conic-gradient(from 210deg, #FFE7A8, #C9962F, #FFF3CC, #A8721A, #FFE7A8);
  box-shadow: 0 6px 14px rgba(4, 2, 20, .65);
}
.rm-seat .avatar .face { font-size: 1.25rem; }
.rm-seat .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; z-index: 3; }
.rm-seat .ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.rm-seat .ring circle[data-deadline] { stroke: #F4D98C; transition: stroke-dashoffset 250ms linear, stroke 300ms; filter: drop-shadow(0 0 3px rgba(255, 216, 120, .8)); }
.rm-seat .ring .ring-track { stroke: rgba(8, 5, 30, .55); }
.rm-seat.turn .avatar { animation: turnglow 1.6s ease-in-out infinite; }
.rm-seat.out .avatar { filter: grayscale(.85) brightness(.6); }
.rm-seat.winner .avatar { animation: winpulse 1.1s ease-in-out infinite; }
.rs-cards { position: absolute; right: -16px; bottom: 2px; width: 26px; height: 24px; z-index: 2; }
.rs-cards i {
  position: absolute; bottom: 0; left: 0; width: 15px; height: 21px; border-radius: 2.5px;
  background: repeating-linear-gradient(45deg, #8E1B2E 0 2px, #B02A42 2px 4px);
  box-shadow: 0 0 0 1px #F3E1B8, 0 2px 4px rgba(0, 0, 0, .5); transform-origin: 50% 100%;
}
.rs-cards i:nth-child(1) { transform: rotate(-14deg); }
.rs-cards i:nth-child(2) { left: 5px; }
.rs-cards i:nth-child(3) { left: 10px; transform: rotate(14deg); }
.rs-tag {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); z-index: 4; white-space: nowrap;
  padding: 1px 8px; border-radius: 999px; font-size: .62rem; font-weight: 800;
  background: #2C2768; color: #E4DFFF; border: 1px solid rgba(255, 255, 255, .15);
}
.rs-tag.win { background: linear-gradient(180deg, #F4D98C, #D9AC4F); color: #1A1408; border-color: #FFF0C2; }
.rs-tag.ok { background: #12705A; color: #C9F7E6; }
.rs-tag.bad { background: #8E1B2E; color: #FFD9DF; }
.rs-tag.warn { background: #8A4B00; color: #FFE2B8; }
.rs-tag.mute { background: #2A2550; color: #A9A3D6; }
.rs-name { margin-top: 9px; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .74rem; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .9); }
.rs-score { margin-top: 1px; padding: 0 8px; border-radius: 999px; background: rgba(6, 4, 20, .78); font-size: .7rem; font-weight: 700; color: #F4D98C; font-variant-numeric: tabular-nums; }
.rs-score b { color: #fff; }
.rm-seat.empty .rs-av { width: 44px; height: 44px; border-radius: 50%; border: 1.5px dashed rgba(207, 201, 242, .3); background: rgba(8, 5, 30, .35); font-size: .72rem; font-weight: 700; color: var(--muted); }
.rm-seat.empty.can .rs-av { border-color: rgba(255, 216, 120, .7); color: #FFE08A; }
.rm-seat.empty { transform: translate(-50%, -22px); }

/* Middle of the table */
.rm-center {
  position: absolute; left: 50%; top: 64%; transform: translate(-50%, -50%); z-index: 2;
  display: grid; justify-items: center; gap: 10px;
}
.rm-piles { display: flex; align-items: flex-end; gap: calc(var(--pw) * .32); }
.rm-pile, .rm-jokerslot { position: relative; display: grid; justify-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; }
.rm-pile:disabled { opacity: 1; cursor: default; }
.rm-pile.can, .rm-pile.drop { cursor: pointer; }
.rm-pile .card, .rm-slot, .rm-deck { --w: var(--pw); width: var(--pw); height: calc(var(--pw) * 1.4); }
.rm-slot { display: block; border-radius: 6px; border: 1.5px dashed rgba(255, 226, 154, .3); }
.rm-deck { position: relative; display: block; }
.rm-deck .card { position: absolute; left: 0; top: 0; }
.rm-deck .card:nth-child(2) { left: 2px; top: -2px; }
.rm-deck .card:nth-child(3) { left: 4px; top: -4px; }
.rm-pile.can .rm-deck .card:last-child, .rm-pile.open.can > .card, .rm-pile.drop > .card, .rm-pile.drop > .rm-slot {
  box-shadow: 0 0 0 3px #F4D98C, 0 0 22px rgba(255, 216, 120, .65), 0 8px 18px rgba(6, 3, 30, .45);
  animation: rm-pulse 1.4s ease-in-out infinite;
}
@keyframes rm-pulse { 50% { box-shadow: 0 0 0 3px #F4D98C, 0 0 6px rgba(255, 216, 120, .2), 0 8px 18px rgba(6, 3, 30, .45); } }
@media (prefers-reduced-motion: reduce) { .rm-pile .card { animation: none !important; } }
.rm-jk-card { display: block; transform: rotate(-9deg); }
.rm-jk-card .card { --w: calc(var(--pw) * .82); }
.rm-pl { font-size: .68rem; font-weight: 700; color: rgba(255, 238, 200, .7); text-shadow: 0 1px 2px rgba(0, 0, 0, .7); }
.rm-jokerslot .rm-pl { color: #E2B8FF; }
.rm-pile.can .rm-pl, .rm-pile.drop .rm-pl { color: #F4D98C; }
.rm-status {
  margin: 0; padding: 4px 14px; border-radius: 999px; white-space: nowrap;
  background: rgba(4, 20, 16, .55); color: #E9F5EF; font-size: .8rem; font-weight: 600;
}
.rm-status.mine { background: rgba(20, 10, 0, .62); color: #F4D98C; box-shadow: 0 0 0 1px rgba(255, 216, 120, .55); }
.rm-status b { font-variant-numeric: tabular-nums; }
.rm-center.idle { gap: 4px; }
.rm-stakes { margin: 0; font-family: var(--font-display); font-size: var(--step-2); color: #FFE7A8; text-shadow: 0 2px 6px rgba(0, 0, 0, .5); }
.rm-kind { margin: 0 0 8px; color: rgba(233, 245, 239, .75); font-size: .8rem; font-weight: 600; }

/* Jokers */
.card.rm-joker { display: grid; place-items: center; align-content: center; gap: 2px; background: linear-gradient(160deg, #FFFDF6, #F4E2BC); color: #7A1D8E; }
.card.rm-joker { position: relative; padding-top: calc(var(--w) * .04); }
.card.rm-joker .jk-art { width: 72%; height: auto; display: block; filter: drop-shadow(0 1px 1px rgba(80, 20, 60, .25)); }
.card.rm-joker .jk-corner { position: absolute; left: 5%; top: 5%; font-style: normal; font-weight: 800; font-size: calc(var(--w) * .11); line-height: 1; color: #7A1D8E; text-align: center; }
.mc.jk .jk-art { width: 1.25em; height: 1.4em; vertical-align: -.35em; }
.card.rm-joker b { font-size: calc(var(--w) * .13); letter-spacing: .08em; font-family: var(--font-display); }
.rm-wbadge {
  position: absolute; left: 2px; bottom: 2px; z-index: 3; font-style: normal;
  width: max(13px, calc(var(--w) * .28)); height: max(13px, calc(var(--w) * .28)); border-radius: 50%;
  display: grid; place-items: center; font-size: max(9px, calc(var(--w) * .16)); font-weight: 900;
  background: #7A1D8E; color: #FFE7A8; box-shadow: 0 0 0 1.5px #FFE7A8;
}

/* Bar above your cards: hand points on the left, the moves you can make on the right */
.rm-bar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; min-height: 38px; }
.rm-bar > :first-child { justify-self: start; }
.rm-bar .rm-btns { justify-self: end; }
.rm-bar.center { display: flex; justify-content: center; }
.rm-bar .rm-status { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.rm-bar.center { justify-content: center; }
.rm-pts { padding: 3px 12px; border-radius: 999px; background: rgba(4, 20, 16, .6); color: #FFC2C2; font-size: .78rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rm-pts.zero { background: #12705A; color: #D6FFF0; }
.rm-btns { display: flex; gap: 8px; align-items: center; }
.rm-btn {
  height: 36px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  font: 800 .88rem var(--font-body); color: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform 90ms ease, filter 150ms ease;
}
.rm-btn:active { transform: translateY(2px); }
.rm-btn:hover { filter: brightness(1.08); }
.rm-btn:focus-visible { outline: 2px solid #FFE7A8; outline-offset: 2px; }
.rm-btn.gold { background: linear-gradient(180deg, #F4D98C, #D9AC4F); color: #1A1408; }
.rm-btn.teal { background: linear-gradient(180deg, #45D6B4, #149178); }
.rm-btn.red { background: linear-gradient(180deg, #F2607A, #C21D36); }
.rm-btn.blue { background: linear-gradient(180deg, #78AEFF, #3266D9); }
.rm-btn.ghost { background: rgba(4, 20, 16, .55); box-shadow: inset 0 0 0 1.5px rgba(233, 245, 239, .35); color: #E9F5EF; }
.rm-btn.big { height: 46px; padding: 0 36px; font-size: 1rem; }
.rm-note { color: rgba(233, 245, 239, .8); font-size: .82rem; font-weight: 600; }

/* Your hand */
.rm-hand {
  --cw: 56px;
  display: flex; flex-wrap: nowrap; justify-content: center; align-items: flex-end; gap: 12px;
  padding-top: 14px;
}
.rm-hand.is-out { opacity: .55; filter: grayscale(.5); }
.rm-group { display: grid; justify-items: center; gap: 4px; }
.rm-cards { display: flex; }
.rm-cbtn { position: relative; padding: 0; border: 0; background: none; cursor: pointer; transition: transform 130ms ease; border-radius: calc(var(--cw) * .09); }
.rm-cbtn:disabled { cursor: default; }
.rm-cbtn + .rm-cbtn { margin-left: calc(var(--cw) * -0.5); }
.rm-cbtn .card { --w: var(--cw); box-shadow: inset 0 0 0 1px rgba(120, 90, 40, .2), -3px 0 6px rgba(0, 0, 0, .18), 0 6px 14px rgba(0, 0, 0, .4); }
.rm-cbtn.sel { transform: translateY(-14px); }
.rm-cbtn.sel .card { box-shadow: 0 0 0 2.5px #F4D98C, 0 0 16px rgba(255, 216, 120, .55), 0 10px 18px rgba(0, 0, 0, .5); }
.rm-cbtn.new .card::before {
  content: ''; position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border-radius: 50%;
  background: #2BB59A; box-shadow: 0 0 0 1.5px #fff; z-index: 3;
}
.rm-cbtn:focus-visible { outline: none; }
.rm-cbtn:focus-visible .card { box-shadow: 0 0 0 3px var(--marigold); }
.rm-tag { min-height: 17px; padding: 1px 9px; border-radius: 999px; font-size: .64rem; font-weight: 800; white-space: nowrap; line-height: 15px; }
.rm-tag.pure { background: #1E9E6E; color: #fff; }
.rm-tag.seq { background: #157A8C; color: #fff; }
.rm-tag.set { background: #3A55C8; color: #fff; }
.rm-tag.none { color: rgba(233, 245, 239, .6); font-weight: 700; }
.rm-tag.move { border: 1px dashed #F4D98C; background: rgba(20, 10, 0, .55); color: #F4D98C; cursor: pointer; font-family: var(--font-body); }
/* Drag and drop */
.rm-hand { position: relative; touch-action: none; user-select: none; -webkit-user-select: none; }
.rm-pile.can { touch-action: none; }
.rm-cbtn:not(:disabled) { cursor: grab; }
html.rm-dragging, html.rm-dragging * { cursor: grabbing !important; }
.rm-cbtn.dragging { opacity: .28; }
.rm-pile.lifting .rm-deck .card:last-child, .rm-pile.open.lifting > .card { opacity: .35; }
.rm-ghost {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; will-change: transform;
}
.rm-ghost .rm-cards { display: flex; transform: rotate(-4deg) scale(1.06); transform-origin: 30% 80%; }
.rm-ghost .rm-cbtn { display: block; border-radius: calc(var(--cw) * .09); }
.rm-ghost .rm-cbtn + .rm-cbtn { margin-left: calc(var(--cw) * -0.5); }
.rm-ghost .card { --w: var(--cw); width: var(--cw); height: calc(var(--cw) * 1.4); box-shadow: 0 0 0 2px #F4D98C, 0 18px 30px rgba(0, 0, 0, .55); }
.rm-ins {
  position: absolute; z-index: 5; width: 4px; margin-left: -2px; border-radius: 3px; pointer-events: none;
  background: #F4D98C; box-shadow: 0 0 10px rgba(255, 216, 120, .9);
}
.rm-ins.new { width: 12px; margin-left: 0; background: rgba(255, 216, 120, .14); border: 2px dashed #F4D98C; box-shadow: none; }
.rm-ins[hidden] { display: none; }
.rm-pile.open.hot > .card, .rm-pile.open.hot > .rm-slot { box-shadow: 0 0 0 3px #F4D98C, 0 0 22px rgba(255, 216, 120, .8); transform: translateY(-4px); }
.rm-bottom.hot .rm-hand { filter: drop-shadow(0 0 10px rgba(255, 216, 120, .55)); }

/* Result: big readable card chips per player */
.rm-result {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20;
  width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); overflow: auto;
  border-radius: 18px; padding: 14px 16px 12px;
  background: linear-gradient(180deg, rgba(30, 22, 74, .98), rgba(14, 10, 40, .98));
  border: 1px solid rgba(233, 190, 91, .5); box-shadow: 0 24px 60px rgba(0, 0, 0, .7);
  animation: pop 260ms cubic-bezier(.2, .9, .3, 1.2) both;
}
.rm-result.won { border-color: #F4D98C; box-shadow: 0 0 0 1px #F4D98C, 0 0 60px rgba(255, 200, 90, .3), 0 24px 60px rgba(0, 0, 0, .7); }
.rm-result header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.rm-result h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); color: var(--marigold); line-height: 1.1; }
.rm-result header p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.rm-result header p b { color: #FFE7A8; }
.rm-result header .round-btn { width: 36px; height: 36px; flex: none; }
.rr-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rr-list li {
  display: grid; grid-template-columns: 112px minmax(0, 1fr) 46px 74px; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 12px; background: rgba(255, 255, 255, .04);
}
.rr-list li.win { background: rgba(217, 172, 79, .12); box-shadow: inset 0 0 0 1px rgba(255, 216, 120, .5); }
.rr-who { display: grid; min-width: 0; }
.rr-who b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .86rem; }
.rr-list li.me .rr-who b { color: #FFE7A8; }
.rr-note { font-size: .68rem; color: var(--muted); font-weight: 700; }
.rr-note.w { color: #F4D98C; }
.rr-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.rr-g { display: inline-flex; gap: 2px; padding: 3px; border-radius: 7px; background: rgba(255, 255, 255, .04); box-shadow: inset 0 0 0 1px rgba(255, 120, 140, .25); }
.rr-g.pure { background: rgba(30, 158, 110, .3); box-shadow: inset 0 0 0 1px rgba(80, 220, 160, .55); }
.rr-g.impure { background: rgba(21, 122, 140, .3); box-shadow: inset 0 0 0 1px rgba(80, 200, 220, .5); }
.rr-g.set { background: rgba(58, 85, 200, .3); box-shadow: inset 0 0 0 1px rgba(130, 150, 255, .5); }
.mc {
  display: inline-grid; place-items: center; align-content: center; width: 24px; height: 33px; border-radius: 4px;
  background: #FFFDF6; color: #1C1733; box-shadow: 0 1px 2px rgba(0, 0, 0, .4); line-height: 1;
}
.mc b { font-size: .8rem; font-weight: 800; }
.mc i { font-style: normal; font-size: .78rem; margin-top: 1px; }
.mc.red { color: #C8102E; }
.mc.wild { box-shadow: 0 0 0 2px #9C3BC0, 0 1px 2px rgba(0, 0, 0, .4); }
.mc.jk { background: linear-gradient(160deg, #3A1450, #7A1D8E); color: #FFE7A8; }
.mc.jk i { font-size: .5rem; font-weight: 800; letter-spacing: .04em; }
.rr-dropped { font-size: .78rem; color: var(--muted); font-style: italic; }
.rr-pts { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.rr-pts small { margin-left: 2px; font-size: .64rem; color: var(--muted); font-weight: 600; }
.rr-money { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; color: #CFC9F2; }
.rr-money.up { color: #9FE8CF; } .rr-money.down { color: #FF9AAA; }
.rr-next { margin: 10px 0 0; text-align: center; color: var(--muted); font-size: .76rem; }
.rm-result.narrow .rr-list li { grid-template-columns: 1fr auto auto; }
.rm-result.narrow .rr-cards { grid-column: 1 / -1; grid-row: 2; }

.rm-game .log { right: 12px; top: 54px; bottom: auto; max-height: 60%; cursor: pointer; z-index: 8; }
.rm-rules ul { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; color: var(--muted); font-size: .86rem; }
.rm-rules p { font-size: .86rem; }
.rm-rules b { color: var(--text); }
.rm-rules .gbtn { width: 100%; margin-top: 4px; }
.rm-game > .rm-head { position: absolute; z-index: 6; }
.rm-game > .rm-result { position: absolute; z-index: 20; }
.rm-game > .rm-bottom { z-index: 3; }

/* ================================================================== 8 ball pool
   Landscape like Rummy: players bar on top, the table in the middle, the cue
   power bar on the left and spin / fine aim on the right. */
.pl-game {
  grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  background: radial-gradient(120% 100% at 50% 40%, #1E1546 0%, #0E0A28 60%, #07041A 100%);
}
.pl-game > * { min-width: 0; }
.pl-hud {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 6px 10px; background: linear-gradient(180deg, rgba(8, 5, 30, .85), rgba(8, 5, 30, .4));
}
.pl-hud .round-btn { width: 38px; height: 38px; }
.pl-pcard { display: flex; align-items: center; gap: 9px; min-width: 0; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid transparent; transition: background 200ms, border-color 200ms; }
.pl-pcard.right { flex-direction: row-reverse; padding: 4px 4px 4px 10px; text-align: right; }
.pl-pcard.turn { background: rgba(217, 172, 79, .14); border-color: rgba(255, 216, 120, .55); }
.pl-pcard.won { background: rgba(31, 158, 110, .2); border-color: rgba(120, 230, 180, .6); }
.pl-pcard.empty { justify-content: flex-start; }
.pl-pcard.empty.right { justify-content: flex-end; }
.pl-wait { color: var(--muted); font-size: .78rem; }
.pl-av { position: relative; flex: none; }
.pl-av .avatar {
  --h: 250; position: relative; width: 40px; height: 40px; padding: 3px; border-radius: 50%;
  background: conic-gradient(from 210deg, #FFE7A8, #C9962F, #FFF3CC, #A8721A, #FFE7A8);
}
.pl-av .avatar .face { font-size: 1rem; }
.pl-av .ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; z-index: 3; }
.pl-av .ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.pl-av .ring circle[data-deadline] { stroke: #F4D98C; transition: stroke-dashoffset 250ms linear, stroke 300ms; }
.pl-av .ring .ring-track { stroke: rgba(8, 5, 30, .55); }
.pl-pinfo { display: grid; gap: 3px; min-width: 0; }
.pl-pinfo b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-pinfo b em { font-style: normal; font-size: .68rem; color: #FFB86B; }
.pl-balls { display: flex; gap: 3px; align-items: center; min-height: 13px; }
.pl-pcard.right .pl-balls { justify-content: flex-end; }
.pl-bd { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: inset -2px -2px 3px rgba(0, 0, 0, .35), 0 0 0 1px rgba(255, 255, 255, .25); }
.pl-bd.st { background: linear-gradient(180deg, #FAF7EE 0 22%, var(--c) 22% 78%, #FAF7EE 78%); }
.pl-bd.gone { opacity: .18; }
.pl-bd.eight { opacity: .35; }
.pl-bd.eight.next { opacity: 1; box-shadow: 0 0 0 2px #F4D98C, inset -2px -2px 3px rgba(255, 255, 255, .2); }
.pl-open { font-size: .7rem; color: var(--muted); font-weight: 600; }
.pl-mid { display: grid; justify-items: center; gap: 1px; text-align: center; min-width: 120px; }
.pl-prize { font-weight: 800; font-size: .86rem; color: #F4D98C; }
.pl-status { font-size: .74rem; color: #E4DFFF; white-space: nowrap; }
.pl-game.my-turn .pl-status { color: #F4D98C; font-weight: 700; }

.pl-main { display: grid; grid-template-columns: 62px minmax(0, 1fr) 70px; gap: 8px; padding: 4px 10px calc(8px + var(--safe-b)); min-height: 0; }
.pl-table-wrap { position: relative; min-height: 0; min-width: 0; }
.pl-canvas { position: absolute; inset: 0; touch-action: none; display: block; }

/* Cue power: a slot with the cue tip that you pull down */
.pl-power { display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 6px; touch-action: none; cursor: grab; opacity: .45; transition: opacity 200ms; }
.pl-game.my-turn .pl-power { opacity: 1; }
.pl-power > span, .pl-side > span { font-size: .66rem; font-weight: 700; color: var(--muted); }
.pl-power-track {
  position: relative; width: 34px; height: 100%; max-height: 300px; align-self: center; border-radius: 17px; overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); box-shadow: inset 0 0 0 1.5px rgba(255, 226, 154, .35), inset 0 6px 12px rgba(0, 0, 0, .5);
}
.pl-power-fill { position: absolute; left: 0; right: 0; top: 0; height: 0%; background: linear-gradient(180deg, #45D6B4, #F2C21B 55%, #E8452C); }
.pl-power-cue {
  position: absolute; left: 50%; top: 0; width: 8px; height: 130%; margin-left: -4px; border-radius: 4px;
  background: linear-gradient(180deg, #EDEDED 0 8px, #2A5DB0 8px 10px, #F4D9A6 10px, #C98E4A 70%, #5A2E12);
}
.pl-side { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; justify-items: center; gap: 6px; align-content: start; }
.pl-spin {
  position: relative; width: 52px; height: 52px; border-radius: 50%; touch-action: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, #fff, #E8E3D6 60%, #BDB6A6); box-shadow: 0 4px 10px rgba(0, 0, 0, .5);
}
.pl-spin-dot { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: #D7263D; box-shadow: 0 0 0 2px rgba(255, 255, 255, .8); transition: transform 120ms; }
.pl-fine {
  width: 40px; height: 100%; max-height: 220px; min-height: 80px; border-radius: 12px; touch-action: none; cursor: ns-resize; overflow: hidden;
  background: linear-gradient(90deg, #2A1A0E, #6B3B1F 50%, #2A1A0E); box-shadow: inset 0 0 0 1.5px rgba(255, 226, 154, .35), inset 0 8px 12px rgba(0, 0, 0, .6), inset 0 -8px 12px rgba(0, 0, 0, .6);
}
.pl-fine-lines { width: 100%; height: 100%; background-image: repeating-linear-gradient(180deg, rgba(255, 230, 190, .35) 0 2px, transparent 2px 9px); }

.pl-overlay:empty { display: none; }
.pl-over {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 5;
  min-width: min(360px, 90%); padding: 18px 22px; border-radius: 18px; text-align: center;
  background: rgba(14, 10, 40, .94); border: 1px solid rgba(233, 190, 91, .5); box-shadow: 0 20px 50px rgba(0, 0, 0, .6);
  animation: pop 240ms cubic-bezier(.2, .9, .3, 1.2) both;
}
.pl-over.won { border-color: #F4D98C; box-shadow: 0 0 0 1px #F4D98C, 0 0 50px rgba(255, 200, 90, .3), 0 20px 50px rgba(0, 0, 0, .6); }
.pl-over h2 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 400; font-size: var(--step-2); color: var(--marigold); }
.pl-over p { margin: 0; color: var(--muted); font-size: .86rem; }
.pl-over .pl-next { margin-top: 8px; color: #E4DFFF; }
.pl-over-btns { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.pl-over-btns:empty { display: none; }
.pl-flash {
  position: absolute; left: 50%; top: 10px; transform: translate(-50%, -8px); z-index: 4; opacity: 0; pointer-events: none;
  padding: 5px 14px; border-radius: 999px; background: rgba(6, 4, 20, .82); color: #E9F5EF; font-size: .8rem; font-weight: 700; white-space: nowrap;
  transition: opacity 200ms, transform 200ms;
}
.pl-flash.show { opacity: 1; transform: translate(-50%, 0); }
.pl-flash.foul { background: rgba(142, 27, 46, .92); color: #FFE2E7; }
.pl-game .log { right: 90px; top: 64px; bottom: auto; max-height: 60%; cursor: pointer; z-index: 8; }
.pl-card .pk-blinds b { color: #F4D98C; }
.pl-game.pl-short .pl-hud { padding: 4px 8px; }
.pl-game.pl-short .pl-av .avatar { width: 34px; height: 34px; }
.pl-game.pl-short .pl-main { grid-template-columns: 54px minmax(0, 1fr) 60px; }
.pl-game.pl-short .pl-spin { width: 44px; height: 44px; }
.pl-power { grid-template-rows: auto auto; align-content: center; }
.pl-power-track { height: min(300px, 70vh); }
html.rm-rotate .pl-power-track { height: calc(var(--rot-h) - 130px); max-height: 300px; }
.pl-side { align-content: center; grid-template-rows: auto auto auto auto; }
.pl-fine { height: min(220px, 45vh); }
html.rm-rotate .pl-fine { height: calc(var(--rot-h) - 230px); max-height: 220px; }
.pl-over .pl-hint { margin-top: 8px; font-size: .74rem; color: var(--muted); opacity: .8; }

/* Levels per game */
.game-levels { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 2px; }
.game-levels .gl {
  display: inline-flex; align-items: baseline; gap: 5px; padding: 3px 10px 3px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(233, 190, 91, .22); font-size: .76rem; color: var(--muted);
}
.game-levels .gl b { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 999px; background: rgba(217, 172, 79, .18); color: #F4D98C; font-size: .78rem; }
.game-levels .gl.on { border-color: #F4D98C; color: var(--text); }
.game-tabs { margin: 6px 0 12px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.game-tabs button { font-size: .78rem; padding-left: 2px; padding-right: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#game-level { margin-bottom: 14px; }
.player-card .game-levels { margin: -6px 0 14px; }
.pl-start { min-width: min(380px, 90%); }
.pl-start .pl-vs { display: flex; justify-content: center; align-items: baseline; gap: 12px; margin: 0 0 6px; color: var(--text); font-size: 1rem; }
.pl-start .pl-vs span { color: var(--muted); font-size: .8rem; }
.pl-start h2 { font-size: var(--step-2); }
.pl-count { display: inline-block; min-width: 1.2em; color: #F4D98C; font-variant-numeric: tabular-nums; }

/* ================================================================== Ludo
   Ludo King's layout: the board in the middle, a player in each corner with
   their dice beside them, your colour always at the bottom left. */
.game-tile.tone-ld { --g1: #2F6FE0; --g2: #0A1E5E; }
.ld-dots { display: inline-flex; gap: 4px; }
.ld-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.14); box-shadow: inset 0 0 0 1.5px var(--c); }
.ld-dots i.on { background: var(--c); }

.ld-game {
  grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  background: radial-gradient(120% 90% at 50% 45%, #2C5BD0 0%, #173A9E 45%, #0B1F63 80%, #081548 100%);
  --bs: min(calc(100vw - 20px), calc(100dvh - 248px), 620px);
  --cell: calc(var(--bs) / 15.4);
}
.ld-game > * { min-width: 0; }
.ld-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 10px calc(4px); }
.ld-head .round-btn { width: 38px; height: 38px; }
.ld-title { display: grid; justify-items: center; line-height: 1.15; min-width: 0; }
.ld-title strong { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ld-prize { display: inline-flex; align-items: center; gap: 4px; margin-top: 2px; padding: 1px 10px; border-radius: 999px; background: rgba(0,0,0,.28); color: #FFE29A; font-size: .78rem; font-weight: 700; }
.ld-area { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 0 10px calc(10px + var(--safe-b, 0px)); min-height: 0; }
.ld-row { width: var(--bs); display: flex; justify-content: space-between; gap: 8px; min-height: 64px; }
.ld-slot { flex: 1 1 0; min-width: 0; display: flex; }
.ld-slot[data-corner="tr"], .ld-slot[data-corner="br"] { justify-content: flex-end; }

.ld-board { position: relative; width: var(--bs); aspect-ratio: 1; border-radius: calc(var(--cell) * .5); box-shadow: 0 18px 40px rgba(0, 0, 20, .55), 0 0 0 4px rgba(255,255,255,.12); }
.ld-board-svg { width: 100%; height: 100%; display: block; }
.ld-tokens { position: absolute; inset: calc(var(--cell) * .2); }
.ld-tok {
  position: absolute; width: calc(var(--cell) * .95); height: calc(var(--cell) * 1.24); padding: 0; border: 0; background: none;
  transform: translate(-50%, -76%); transition: left 150ms ease-out, top 150ms ease-out, transform 150ms;
  -webkit-tap-highlight-color: transparent;
}
.ld-tok svg { width: 100%; height: 100%; display: block; overflow: visible; pointer-events: none; }
.ld-tok:disabled { cursor: default; }
.ld-tok.small { transform: translate(-50%, -76%) scale(.74); }
.ld-tok.home { transform: translate(-50%, -62%) scale(.62); }
.ld-tok.can { cursor: pointer; z-index: 80 !important; animation: ld-bob .7s ease-in-out infinite; }
.ld-tok.can::before {
  content: ''; position: absolute; left: 50%; bottom: -2%; width: 120%; height: 40%; transform: translateX(-50%);
  border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 0 10px #fff, 0 0 18px rgba(255,255,255,.6); animation: ld-ring .7s ease-in-out infinite;
}
.ld-tok.hop svg { animation: ld-hop 150ms ease-out; }
@keyframes ld-bob { 0%, 100% { transform: translate(-50%, -76%); } 50% { transform: translate(-50%, -92%); } }
@keyframes ld-ring { 0%, 100% { opacity: .95; } 50% { opacity: .45; } }
@keyframes ld-hop { 0% { transform: translateY(0); } 45% { transform: translateY(-30%) scale(1.06); } 100% { transform: translateY(0); } }

/* Players in the corners */
.ld-p { display: flex; align-items: center; gap: 8px; padding: 5px; border-radius: 16px; background: rgba(5, 14, 52, .55); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.1); min-width: 0; max-width: 100%; transition: box-shadow 200ms, background 200ms; }
.ld-p.right { flex-direction: row-reverse; }
.ld-p.turn { background: rgba(5, 14, 52, .78); box-shadow: inset 0 0 0 2.5px var(--c), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent); }
.ld-p.out { opacity: .5; }
.ld-p.empty { background: none; box-shadow: none; }
.ld-who { display: flex; align-items: center; gap: 7px; min-width: 0; cursor: pointer; }
.ld-p.right .ld-who { flex-direction: row-reverse; text-align: right; }
.ld-av { position: relative; flex: none; }
.ld-av .avatar { width: 46px; height: 46px; }
.ld-av::after { content: ''; position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; }
.ld-p.right .ld-av::after { right: auto; left: -2px; }
.ld-crown { position: absolute; left: 50%; top: -16px; transform: translateX(-50%); font-size: 20px; }
.ld-name { display: grid; gap: 3px; min-width: 0; line-height: 1.15; }
.ld-name b { font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 96px; }
.ld-name em { font-style: normal; font-size: .68rem; color: #FFB4BF; }
.ld-p.right .ld-name { justify-items: end; }
.ld-rdy { font-size: .7rem; font-weight: 700; color: rgba(255,255,255,.6); }
.ld-rdy.yes { color: #7CF0B0; }
.ld-out { font-size: .7rem; color: #FFB4BF; font-weight: 700; }
.ld-home-dots { display: inline-flex; gap: 3px; }
.ld-home-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.18); }
.ld-home-dots i.on { background: var(--c); box-shadow: 0 0 0 1.5px #fff; }
.ld-miss { margin-left: 6px; color: #FFB4BF; font-weight: 800; font-size: .72rem; letter-spacing: 1px; }
.ld-sit { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 2px dashed color-mix(in srgb, var(--c) 80%, #fff); background: rgba(5, 14, 52, .45); color: #fff; font: inherit; font-weight: 700; font-size: .84rem; cursor: pointer; }
.ld-sit span { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--c); font-size: 1.2rem; }
.ld-empty { align-self: center; color: rgba(255,255,255,.55); font-size: .78rem; padding: 0 8px; }

/* Dice */
.ld-dice-wrap { flex: none; }
.ld-dice-slot { width: 50px; height: 50px; }
.ld-dice {
  width: 50px; height: 50px; padding: 0; border: 0; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(145deg, #FFFFFF, #E4E2F0); box-shadow: 0 4px 0 #A9A5C4, 0 8px 14px rgba(0,0,0,.35);
}
.ld-dice:disabled { cursor: default; }
.ld-dice.can { cursor: pointer; box-shadow: 0 4px 0 #A9A5C4, 0 0 0 3px var(--c), 0 0 22px var(--c); animation: ld-dice-pulse 1s ease-in-out infinite; }
.ld-dice.rolling { animation: ld-dice-roll 560ms cubic-bezier(.3, .7, .4, 1); }
@keyframes ld-dice-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.08) rotate(-4deg); } }
@keyframes ld-dice-roll { 0% { transform: rotate(0) scale(.8); } 35% { transform: rotate(250deg) scale(1.15) translateY(-8px); } 70% { transform: rotate(390deg) scale(1); } 100% { transform: rotate(360deg); } }
.ld-face { width: 74%; height: 74%; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); place-items: center; }
.ld-face i { width: 64%; aspect-ratio: 1; border-radius: 50%; }
.ld-face i.on { background: radial-gradient(circle at 35% 35%, #4A4470, #15112E); }
.ld-face[data-v="1"] i.on { background: radial-gradient(circle at 35% 35%, #FF6B7D, #B0102C); width: 80%; }

.ld-status { min-height: 1.3em; margin: 0; text-align: center; font-weight: 600; font-size: .92rem; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4); }
.ld-game.my-turn .ld-status { color: #FFE29A; }

/* Overlays on the board */
.ld-overlay { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 100; }
.ld-over {
  pointer-events: auto; width: min(86%, 340px); padding: 18px 18px 16px; border-radius: 20px; text-align: center;
  background: linear-gradient(180deg, rgba(20, 30, 92, .96), rgba(10, 16, 58, .96)); color: #fff;
  box-shadow: 0 20px 50px rgba(0,0,0,.55), inset 0 0 0 1.5px rgba(255,255,255,.14);
}
.ld-over h2 { margin: 4px 0 6px; font-size: 1.25rem; line-height: 1.2; }
.ld-over p { margin: 0 0 10px; color: rgba(233, 236, 255, .82); font-size: .88rem; }
.ld-over .rm-btn { margin: 4px auto 0; }
.ld-over.won h2 { color: #FFE29A; }
.ld-trophy { font-size: 46px; line-height: 1; animation: ld-pop 600ms cubic-bezier(.2, 1.6, .4, 1); }
@keyframes ld-pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ld-next, .ld-hint { font-size: .78rem !important; }
.ld-pot { margin: 10px 0 0 !important; color: #FFE29A !important; font-weight: 700; font-size: .82rem !important; }
.ld-count { position: relative; width: 64px; height: 64px; margin: 0 auto 4px; display: grid; place-items: center; }
.ld-count .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.ld-count b { font-size: 1.5rem; }
.ld-rlist { list-style: none; margin: 4px 0 12px; padding: 0; display: grid; gap: 6px; text-align: left; }
.ld-rlist li { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.06); font-size: .88rem; }
.ld-rlist li i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff; }
.ld-rlist li span { margin-left: auto; font-size: .76rem; font-weight: 700; color: rgba(255,255,255,.55); }
.ld-rlist li span.yes { color: #7CF0B0; }
@media (max-width: 420px) {
  .ld-av .avatar { width: 40px; height: 40px; }
  .ld-name b { max-width: 70px; font-size: .78rem; }
  .ld-dice, .ld-dice-slot { width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .ld-tok.can, .ld-dice.can { animation: none; } }
.ld-av .ring, .ld-count .ring { position: absolute; inset: -6px; width: calc(100% + 12px); height: calc(100% + 12px); transform: rotate(-90deg); pointer-events: none; }
.ld-count .ring { inset: 0; width: 100%; height: 100%; }
.ld-av .ring circle, .ld-count .ring circle { fill: none; stroke-width: 4.5; stroke-linecap: round; }
.ld-av .ring circle[data-deadline], .ld-count .ring circle[data-deadline] { stroke: #F4D98C; transition: stroke-dashoffset 250ms linear, stroke 300ms; }
.ld-av .ring .ring-track, .ld-count .ring .ring-track { stroke: rgba(8, 5, 30, .55); }

/* ================================================================== Table talk
   A chat button on every table, speech bubbles over pictures, and throwables. */
.soc-fab {
  position: absolute; right: 10px; top: 64px; z-index: 60; width: 42px; height: 42px; border-radius: 50%; padding: 0;
  display: grid; place-items: center; border: 0; color: #1A1408; cursor: pointer;
  background: linear-gradient(180deg, #FFE29A, #D9AC4F); box-shadow: 0 4px 0 #A8721A, 0 8px 16px rgba(0,0,0,.4);
}
.soc-fab svg { width: 22px; height: 22px; }
.soc-fab:active { transform: translateY(2px); box-shadow: 0 2px 0 #A8721A, 0 4px 10px rgba(0,0,0,.4); }
.soc-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: #E8384F; color: #fff; font-style: normal; font-size: .66rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 0 0 2px #1C1846; }
.game > .soc-fab { position: absolute; z-index: 60; } /* beats .game > :not(.room) */
.pk-game .soc-fab, .pl-game .soc-fab { top: 58px; }
.ld-game .soc-fab { top: 62px; }

.soc-sheet { width: min(460px, calc(100vw - 20px)); max-width: none; padding-top: 14px; box-sizing: border-box; }
.soc-tabs { margin-bottom: 12px; grid-template-columns: repeat(3, 1fr); }
.soc-emojis { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 420px) { .soc-emojis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.soc-emojis button { min-width: 0; aspect-ratio: 1; border: 0; border-radius: 12px; background: rgba(255,255,255,.06); font-size: 1.6rem; cursor: pointer; padding: 0; }
.soc-emojis button:hover { background: rgba(255,255,255,.14); }
.soc-phrases { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.soc-phrases button { padding: 11px 10px; border: 0; border-radius: 12px; background: rgba(255,255,255,.07); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.soc-phrases button:hover { background: rgba(217,172,79,.18); }
.soc-log { list-style: none; margin: 0; padding: 8px; max-height: 42vh; min-height: 120px; overflow: auto; display: grid; align-content: start; gap: 6px; border-radius: 12px; background: rgba(0,0,0,.2); }
.soc-log li { display: grid; gap: 1px; font-size: .9rem; line-height: 1.3; }
.soc-log li b { font-size: .74rem; color: var(--marigold); }
.soc-log li.me b { color: #7CF0B0; }
.soc-log li .soc-th { color: var(--muted); font-style: italic; }
.soc-log li.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.soc-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 10px; }
.soc-form input { min-height: 42px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--text); font: inherit; }
.soc-off { color: var(--muted); font-size: .84rem; margin: 10px 0 0; }
.soc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: .78rem; color: var(--muted); }
.soc-mute { border: 0; background: none; color: var(--marigold); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 0; white-space: nowrap; }

/* Throw row in the player card */
.soc-throws { margin: 14px 0 4px; }
.soc-throw-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.soc-throw { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border: 0; border-radius: 12px; background: rgba(255,255,255,.07); color: var(--text); cursor: pointer; font: inherit; }
.soc-throw .ic { font-size: 1.55rem; line-height: 1.1; }
.soc-throw small { font-size: .6rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.soc-throw:hover { background: rgba(217,172,79,.2); }
.soc-throw.locked { opacity: .45; filter: grayscale(1); }
.soc-throw.locked small { color: #FFB4BF; }

/* Effects layer */
#soc-fx { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.soc-bubble {
  position: absolute; transform: translate(-50%, -100%); width: max-content; max-width: 200px; padding: 7px 12px; border-radius: 14px 14px 14px 4px;
  background: #FFFFFF; color: #221C3B; font-weight: 700; font-size: .86rem; line-height: 1.25; box-shadow: 0 8px 18px rgba(0,0,0,.35);
  animation: soc-pop 260ms cubic-bezier(.2, 1.5, .4, 1); word-break: break-word; text-align: center;
}
.soc-bubble.emoji { padding: 2px 8px; font-size: 2rem; background: rgba(255,255,255,.92); border-radius: 18px; }
.soc-bubble.out { opacity: 0; transition: opacity 300ms; }
@keyframes soc-pop { from { transform: translate(-50%, -80%) scale(.4); opacity: 0; } to { transform: translate(-50%, -100%) scale(1); opacity: 1; } }
.soc-fly { position: absolute; font-size: 36px; line-height: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
.soc-part { position: absolute; line-height: 1; transform: translate(-50%, -50%); }
.soc-big { position: absolute; font-size: 46px; line-height: 1; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 8px rgba(0,0,0,.35)); }
.soc-big.small { font-size: 26px; }
.soc-big.crown { font-size: 34px; }
.soc-big.out, .soc-splat.out { opacity: 0; transition: opacity 400ms; }
.soc-splat { position: absolute; transform: translate(-50%, -50%); animation: soc-splat 260ms cubic-bezier(.2, 1.6, .4, 1); }
.soc-splat svg { width: 100%; height: 100%; display: block; }
.soc-splat .yolk { position: absolute; left: 50%; top: 50%; width: 38%; height: 38%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle at 38% 35%, #FFE07A, #F5A300); box-shadow: inset 0 -3px 0 rgba(0,0,0,.12); }
@keyframes soc-splat { from { transform: translate(-50%, -50%) scale(.2); } to { transform: translate(-50%, -50%) scale(1); } }
.soc-flash { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(circle, rgba(255,240,180,.95), rgba(255,140,40,.6) 45%, transparent 70%); animation: soc-flash 600ms ease-out forwards; }
@keyframes soc-flash { from { transform: translate(-50%, -50%) scale(.3); opacity: 1; } to { transform: translate(-50%, -50%) scale(1.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .soc-bubble, .soc-splat { animation: none; } }
.rm-game > .soc-fab { right: auto; left: 10px; top: 62px; }

/* Big countdown before a deal */
.count-pop {
  position: absolute; left: 50%; top: 46%; z-index: 40; transform: translate(-50%, -50%); pointer-events: none;
  display: grid; justify-items: center; gap: 2px; padding: 14px 30px 12px; border-radius: 22px;
  background: radial-gradient(circle at 50% 30%, rgba(46, 34, 110, .95), rgba(14, 10, 40, .95));
  box-shadow: 0 18px 44px rgba(0,0,0,.55), inset 0 0 0 2px rgba(255, 216, 120, .55);
  animation: cp-in 320ms cubic-bezier(.2, 1.5, .4, 1);
}
.count-pop span { font-size: .9rem; font-weight: 700; color: rgba(255,255,255,.8); letter-spacing: .02em; }
.count-pop b { font-family: var(--font-display); font-weight: 400; font-size: 4.2rem; line-height: 1; color: #FFE29A; text-shadow: 0 4px 0 #A8721A, 0 0 24px rgba(255, 216, 120, .5); }
.count-pop b.tick { animation: cp-tick 600ms cubic-bezier(.2, 1.6, .4, 1); }
@keyframes cp-in { from { transform: translate(-50%, -50%) scale(.5); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
@keyframes cp-tick { 0% { transform: scale(1.6); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
.rm-game .count-pop { top: 42%; }

/* Flying cards (Rummy) */
.rm-fly { position: absolute; z-index: 35; pointer-events: none; }
.rm-fly .card { --w: inherit; width: 100%; height: 100%; box-shadow: 0 8px 16px rgba(0,0,0,.45); }

/* Empty seats you can take: glowing so they're easy to spot */
.seat.empty.can-sit .avatar, .rm-seat.empty.can .rs-av {
  border: 2px solid #F4D98C !important; background: radial-gradient(circle, rgba(255, 216, 120, .28), rgba(255, 216, 120, .08)) !important;
  box-shadow: 0 0 0 4px rgba(255, 216, 120, .18), 0 0 22px rgba(255, 216, 120, .65);
  animation: seat-glow 1.6s ease-in-out infinite;
}
.seat.empty.can-sit .avatar .face, .rm-seat.empty.can .rs-av { color: #FFE29A !important; font-weight: 800; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.seat.empty.can-sit, .rm-seat.empty.can { cursor: pointer; }
.seat.empty.can-sit:hover .avatar, .rm-seat.empty.can:hover .rs-av { transform: scale(1.08); }
@keyframes seat-glow { 0%, 100% { box-shadow: 0 0 0 4px rgba(255, 216, 120, .18), 0 0 14px rgba(255, 216, 120, .45); } 50% { box-shadow: 0 0 0 7px rgba(255, 216, 120, .10), 0 0 30px rgba(255, 216, 120, .85); } }
.ld-sit { animation: seat-glow 1.6s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .seat.empty.can-sit .avatar, .rm-seat.empty.can .rs-av, .ld-sit { animation: none; } }
.game > .count-pop { position: absolute; z-index: 40; } /* beats .game > :not(.room) */
.game > .rm-fly { position: absolute; z-index: 35; } /* beats .game > :not(.room) */
/* Rummy: my own picture at the left of the action bar */
.rm-mine { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rm-mine-av { position: relative; flex: none; }
.rm-mine-av .avatar { width: 40px; height: 40px; }
.rm-mine-av .ring { position: absolute; inset: -5px; width: calc(100% + 10px); height: calc(100% + 10px); transform: rotate(-90deg); pointer-events: none; z-index: 3; }
.rm-mine-av .ring circle { fill: none; stroke-width: 5; stroke-linecap: round; }
.rm-mine-av .ring circle[data-deadline] { stroke: #F4D98C; transition: stroke-dashoffset 250ms linear, stroke 300ms; }
.rm-mine-av .ring .ring-track { stroke: rgba(8, 5, 30, .55); }
.rm-mine.turn .rm-mine-av .avatar { box-shadow: 0 0 0 2px #F4D98C, 0 0 16px rgba(255, 216, 120, .7); }

/* ---------- Pool modes and snooker ---------- */
.pl-modes { display: flex; gap: 6px; margin: 0 0 14px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .06); width: max-content; max-width: 100%; }
.pl-modes button { border: 0; background: none; color: var(--muted); font: inherit; font-weight: 700; font-size: .86rem; padding: 8px 16px; border-radius: 999px; cursor: pointer; }
.pl-modes button[aria-selected="true"] { background: linear-gradient(180deg, #F4D98C, #E9A21C); color: #2A1A00; }
.pl-modes button:focus-visible { outline: 2px solid #F4D98C; outline-offset: 2px; }
.pl-mode-tag { margin: 0 0 2px !important; font-size: .74rem !important; font-weight: 800; color: #F4D98C !important; letter-spacing: .02em; }
.pl-on { font-size: .66rem; font-weight: 700; color: var(--muted); margin-right: 1px; }
.pl-fouls { display: inline-flex; gap: 2px; margin-left: 4px; }
.pl-fouls i { width: 7px; height: 7px; border-radius: 50%; background: #FF5A6E; box-shadow: 0 0 0 1px rgba(255, 255, 255, .3); }
.sn-score { font-weight: 800; font-size: 1rem; line-height: 1; color: #fff; font-variant-numeric: tabular-nums; min-width: 1.6em; }
.sn-run { font-size: .66rem; font-weight: 700; color: #F4D98C; margin-left: 6px; }
.sn-left { display: inline; font-weight: 600; font-size: .7rem; color: var(--muted); margin-left: 4px; }
.sn-final { margin-top: 6px !important; color: #E4DFFF !important; font-size: .95rem !important; }
.sn-final b { color: #F4D98C; font-size: 1.1rem; }
/* The player cards hug their content, so the turn highlight doesn't stretch across the bar. */
.pl-seat0, .pl-seat1 { display: flex; min-width: 0; }
.pl-seat1 { justify-content: flex-end; }
.pl-seat0 > .pl-pcard, .pl-seat1 > .pl-pcard { max-width: 100%; }

/* ---------- Snakes & Ladders ---------- */
.game-tile.tone-sl { --g1: #3FA34D; --g2: #0E3D1C; }
.sl-game {
  --cell: calc(var(--bs) / 10.36);
  background:
    radial-gradient(60% 50% at 50% 48%, rgba(255, 214, 140, .14), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 22px),
    radial-gradient(120% 90% at 50% 45%, #1F5C3A 0%, #133F28 50%, #0A2618 85%, #06180F 100%);
}
.sl-board { border-radius: calc(var(--cell) * .3); }
.sl-board-svg { width: 100%; height: 100%; display: block; border-radius: inherit; }
.sl-board-art { position: absolute; inset: 0; }
.sl-board-art svg { width: 100%; height: 100%; display: block; }
.sl-num { font: 600 .3px/1 var(--font-display, Georgia, serif); letter-spacing: -.005px; }
.sl-lbl { font: 700 .12px/1 var(--font-body, system-ui), sans-serif; fill: #0F4A2E; opacity: .75; letter-spacing: .02px; }
.sl-tokens { position: absolute; inset: 0; pointer-events: none; }
.sl-tok { width: calc(var(--cell) * .62); height: calc(var(--cell) * .8); transition: left 170ms ease-out, top 170ms ease-out, transform 150ms; }
.sl-tok.sliding { transition: none; }
.sl-tok.waiting { opacity: .9; transform: translate(-50%, -70%) scale(.8); }
.sl-tok.small.waiting { transform: translate(-50%, -70%) scale(.66); }
.sl-tok.mine svg { filter: drop-shadow(0 0 3px rgba(255, 255, 255, .9)); }
.sl-sq { font-size: .72rem; color: var(--muted); font-weight: 600; }
.sl-sq b { color: #FFE29A; font-size: .86rem; }
.sl-flash {
  position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%) scale(.6); opacity: 0; pointer-events: none; z-index: 120;
  padding: 8px 18px; border-radius: 999px; font-weight: 800; font-size: clamp(.95rem, 4vw, 1.3rem); white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45); transition: opacity 200ms, transform 250ms cubic-bezier(.2, 1.4, .4, 1);
}
.sl-flash.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.sl-flash.ladder { background: linear-gradient(180deg, #FFE38A, #E9A21C); color: #3A2300; }
.sl-flash.snake { background: linear-gradient(180deg, #FF7A8A, #C0233C); color: #fff; }
@media (prefers-reduced-motion: reduce) { .sl-flash { transition: none; } }
/* Dice before a roll: a prompt on your turn, three soft dots while waiting. */
.ld-face.idle { display: flex; align-items: center; justify-content: center; gap: 9%; grid-template-columns: none; }
.ld-face.idle i.dot { width: 13%; aspect-ratio: 1; border-radius: 50%; background: #B9B3D6; animation: dice-wait 1.2s ease-in-out infinite; }
.ld-face.idle i.dot:nth-child(2) { animation-delay: .15s; }
.ld-face.idle i.dot:nth-child(3) { animation-delay: .3s; }
.ld-face.idle.go em { font-style: normal; font-weight: 800; font-size: clamp(.62rem, 2.4vw, .82rem); letter-spacing: .02em; color: #2A1F5C; text-transform: none; }
@keyframes dice-wait { 0%, 100% { opacity: .35; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-20%); } }
@media (prefers-reduced-motion: reduce) { .ld-face.idle i.dot { animation: none; opacity: .7; } }

/* Wide screens: players beside the board, so the board can use the full height. */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .sl-game { --bs: min(calc(100dvh - 120px), calc(100vw - 520px), 820px); }
  .sl-game .ld-area { display: grid; grid-template-columns: 1fr var(--bs) 1fr; grid-template-rows: 1fr 1fr auto; column-gap: 22px; row-gap: 8px; align-items: center; justify-items: center; }
  .sl-game .ld-row { display: contents; }
  .sl-game .ld-slot[data-corner="tl"] { grid-area: 1 / 1; align-self: start; justify-content: flex-end; width: 100%; }
  .sl-game .ld-slot[data-corner="bl"] { grid-area: 2 / 1; align-self: end; justify-content: flex-end; width: 100%; }
  .sl-game .ld-slot[data-corner="tr"] { grid-area: 1 / 3; align-self: start; justify-content: flex-start; width: 100%; }
  .sl-game .ld-slot[data-corner="br"] { grid-area: 2 / 3; align-self: end; justify-content: flex-start; width: 100%; }
  .sl-game .ld-board { grid-area: 1 / 2 / 3 / 3; }
  .sl-game .ld-status { grid-area: 3 / 1 / 4 / 4; margin: 0; }
  .sl-game .ld-p { min-width: 210px; }
}

/* ---------- Lobby cards: a little table with seats that glow when taken ---------- */
.pk-card.has-mini { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 14px; }
.pk-card.has-mini .gbtn { grid-column: 3; }
.pk-card.has-mini .mini-table { --tier: #2BB59A; }
.mini-seat.on::after { content: ''; position: absolute; inset: -7px; border-radius: 50%; background: radial-gradient(circle, rgba(244, 217, 140, .75), rgba(244, 217, 140, 0) 70%); animation: seat-on 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes seat-on { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.mini-table.mt-pool .mini-felt { inset: 10px 9px; border-radius: 5px; box-shadow: 0 0 0 3.5px #5A2E14, 0 0 0 5px #C9962F, 0 6px 12px rgba(0,0,0,.4); background: radial-gradient(ellipse at 50% 40%, color-mix(in srgb, var(--tier) 85%, white 10%), color-mix(in srgb, var(--tier) 55%, #0C0828)); }
.mini-table.mt-board .mini-felt { inset: 6px 13px; border-radius: 6px; box-shadow: 0 0 0 3px #4A2414, 0 0 0 4.5px #C9962F, 0 6px 12px rgba(0,0,0,.4);
  background: conic-gradient(from 45deg, #E8384F 0 25%, #23A95A 0 50%, #F5BD1F 0 75%, #2F7FE0 0); }
.sl-card .mini-table.mt-board .mini-felt { background: repeating-conic-gradient(#FBF4E2 0 25%, #13916A 0 50%) 0 0 / 12px 12px; }
@media (max-width: 400px) { .pk-card.has-mini .mini-table { width: 60px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .mini-seat.on::after { animation: none; opacity: .7; } }

/* ---------- Type: an elegant serif for names and amounts, a clean sans for the rest ---------- */
body { font-optical-sizing: auto; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
.wordmark, .lobby-hero h1, .section-title, h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.lobby-hero h1 { font-weight: 600; }
.pk-card h3, .tc-body h3 { font-weight: 600; letter-spacing: -.005em; }

/* ---------- Teen Patti & Poker room: a private card room instead of a night sky ---------- */
.game:has(> .room) { background: radial-gradient(120% 75% at 50% 42%, #2C2033 0%, #1A1220 42%, #0E0A13 72%, #070509 100%); }
.room .stars, .room .skyline { display: none !important; }
.room .terrace {
  top: 0;
  background:
    radial-gradient(55% 42% at 50% 44%, rgba(255, 210, 150, .16), rgba(255, 210, 150, .05) 55%, transparent 75%),
    radial-gradient(circle at 50% 100%, transparent 0 9px, rgba(233, 190, 91, .09) 9px 10px, transparent 10px 15px, rgba(233, 190, 91, .07) 15px 16px, transparent 16px) 0 0 / 36px 18px;
  -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(0, 0, 0, .55) 35%, #000 75%);
          mask-image: radial-gradient(ellipse 80% 70% at 50% 45%, rgba(0, 0, 0, .55) 35%, #000 75%);
}
/* A soft pool of light from a lamp above the table. */
.room .bokeh {
  background:
    radial-gradient(ellipse 30% 9% at 50% 0%, rgba(255, 226, 170, .35), transparent 70%),
    radial-gradient(circle at 6% 78%, rgba(255, 190, 110, .07) 0 50px, transparent 51px),
    radial-gradient(circle at 94% 70%, rgba(255, 190, 110, .06) 0 60px, transparent 61px);
  filter: blur(4px);
}
.wd-lock { margin: -4px 0 10px; padding: 10px 12px; border-radius: 12px; background: rgba(217, 172, 79, .12); border: 1px solid rgba(255, 216, 120, .35); color: #FFE29A; font-size: .86rem; }

/* ---------- Win moments ---------- */
.fx-confetti { position: absolute; display: block; will-change: transform, opacity; box-shadow: 0 0 0 .5px rgba(0, 0, 0, .15); }
.fx-bigwin {
  position: absolute; left: 50%; top: 24%; display: grid; justify-items: center; gap: 2px; padding: 14px 34px; border-radius: 999px;
  background: radial-gradient(120% 160% at 50% 0%, #FFE9A8, #E9A21C 70%); color: #3A2300; box-shadow: 0 16px 40px rgba(0, 0, 0, .45), 0 0 0 3px rgba(255, 244, 207, .8), 0 0 40px rgba(255, 216, 120, .6);
  white-space: nowrap; will-change: transform, opacity;
}
.fx-bigwin b { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 6vw, 2.4rem); line-height: 1; letter-spacing: -.01em; }
.fx-bigwin span { font-weight: 800; font-size: clamp(1rem, 3.6vw, 1.3rem); font-variant-numeric: tabular-nums; }
.plate .streak, .pkm-stack .streak, .pl-pinfo .streak { font-style: normal; margin-left: 5px; font-size: .72em; font-weight: 800; color: #FFB347; letter-spacing: -.02em; animation: streak-glow 1.6s ease-in-out infinite; }
@keyframes streak-glow { 0%, 100% { text-shadow: 0 0 2px rgba(255, 150, 50, .4); } 50% { text-shadow: 0 0 10px rgba(255, 150, 50, .95); } }
.fx-label.flame { font-size: 1.1rem; text-shadow: none; }
.fx-shout {
  position: absolute; left: 50%; top: 22%; display: flex; align-items: center; gap: 10px; padding: 10px 20px 10px 14px; border-radius: 999px;
  background: linear-gradient(90deg, #3A1A05, #7A2E08); color: #FFE8C4; border: 1px solid rgba(255, 190, 90, .6); box-shadow: 0 14px 34px rgba(0, 0, 0, .5), 0 0 30px rgba(255, 140, 40, .35);
  font-size: 1rem; white-space: nowrap; will-change: transform, opacity;
}
.fx-shout b { color: #F4D98C; font-family: var(--font-display); font-size: 1.15rem; }
.fx-shout small { color: #FFB347; font-weight: 700; margin-left: 4px; }
.fx-shout-ic { font-size: 1.5rem; animation: streak-bob .6s ease-in-out infinite alternate; }
@keyframes streak-bob { from { transform: scale(1) rotate(-6deg); } to { transform: scale(1.15) rotate(6deg); } }
.rs-move { position: absolute; left: 50%; top: -14px; transform: translate(-50%, 0); padding: 3px 9px; border-radius: 999px; background: rgba(8, 5, 30, .9); color: #FFF4CF; font-size: .72rem; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); pointer-events: none; z-index: 12; }
.rs-move.open { background: linear-gradient(90deg, #1E8C78, #146A5A); }
.rs-move.threw { background: linear-gradient(90deg, #7A1D8E, #5A1068); }
.rm-btn.gold.ready { animation: declare-ready 1.1s ease-in-out infinite; }
@keyframes declare-ready { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 216, 120, .6); } 50% { box-shadow: 0 0 0 7px rgba(255, 216, 120, 0), 0 0 22px rgba(255, 216, 120, .8); } }
/* Ludo: where each movable token would land */
.ld-previews { position: absolute; inset: calc(var(--cell) * .2); pointer-events: none; }
.ld-prev { position: absolute; width: calc(var(--cell) * 1.05); height: calc(var(--cell) * 1.05); transform: translate(-50%, -50%); border-radius: 50%; border: 3px dashed #fff; box-shadow: 0 0 0 2px var(--c), 0 0 16px var(--c); animation: ld-prev-spin 3s linear infinite; }
.ld-prev::after { content: ''; position: absolute; inset: 18%; border-radius: 50%; background: var(--c); opacity: .55; animation: ld-prev-breathe 1s ease-in-out infinite alternate; }
@keyframes ld-prev-breathe { from { transform: scale(.85); opacity: .4; } to { transform: scale(1); opacity: .7; } }
.ld-prev.capture { border-color: #FF3B5C; border-style: solid; box-shadow: 0 0 0 3px rgba(255, 59, 92, .35), 0 0 14px rgba(255, 59, 92, .9); animation: ld-prev-pulse .7s ease-in-out infinite alternate; }
.ld-prev.capture::after { background: #FF3B5C; opacity: .5; }
.ld-prev.home { border-color: #F4D98C; border-style: solid; box-shadow: 0 0 14px rgba(255, 216, 120, .9); }
.ld-prev.home::after { background: #F4D98C; opacity: .55; }
@keyframes ld-prev-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes ld-prev-pulse { from { transform: translate(-50%, -50%) scale(.92); } to { transform: translate(-50%, -50%) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .ld-prev { animation: none; } }

/* ---------- Home: today's winners ---------- */
.winners { margin: 4px 0 18px; }
.wn-head { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.wn-head strong { font-family: var(--font-display); font-weight: 600; font-size: var(--step-1); color: var(--marigold); }
.wn-head span { color: var(--muted); font-size: var(--step--1); }
.wn-track { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; scrollbar-width: none; }
.wn-track::-webkit-scrollbar { display: none; }
.wn-card {
  position: relative; flex: none; display: grid; justify-items: center; gap: 4px; width: 104px; padding: 12px 8px 10px; border-radius: 16px; scroll-snap-align: start;
  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02)); border: 1px solid var(--line); color: inherit; font: inherit; cursor: pointer;
}
.wn-card.top { background: linear-gradient(180deg, rgba(255, 216, 120, .18), rgba(255, 216, 120, .04)); border-color: rgba(255, 216, 120, .5); box-shadow: 0 0 24px rgba(255, 200, 90, .18); }
.wn-crown { position: absolute; top: -10px; left: 50%; transform: translateX(-50%) rotate(-12deg); font-size: 1.2rem; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .5)); }
.wn-rank { position: absolute; top: 6px; left: 8px; font-size: .68rem; font-weight: 800; color: var(--muted); }
.wn-av { width: 46px; height: 46px; }
.wn-av .face { font-size: .95rem; }
.wn-name { font-size: .78rem; font-weight: 700; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wn-net { font-size: .82rem; font-weight: 800; color: #7EE8B5; font-variant-numeric: tabular-nums; }
.pl-flash.great { background: linear-gradient(90deg, #FFE38A, #E9A21C); color: #3A2300; font-size: 1.05rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 0 30px rgba(255, 216, 120, .6); }
.pl-flash.great b { font-family: var(--font-display); font-size: 1.25rem; margin-right: 6px; }

/* ================================================================ 2.11 The Club
   One idea runs through every screen: a private card room. Dark velvet
   surfaces, brass hairlines instead of filled boxes, a serif with real
   presence for names and money, a quiet sans for everything else.
   Gold is spent on two things only: chips and the primary action. */

/* ---------- Type ---------- */
:root {
  --step--2: 0.72rem;
  --step--1: 0.8125rem;
  --step-0: 0.9375rem;
  --step-1: 1.1875rem;
  --step-2: 1.5rem;
  --step-3: 2rem;
  --step-4: 2.625rem;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
}
body { font-size: var(--step-0); line-height: 1.5; letter-spacing: 0; font-feature-settings: 'cv05', 'cv11'; }
h1, h2, h3, .wordmark, .lobby-hero h1, .section-title { font-family: var(--font-display); font-weight: 600; letter-spacing: 0; line-height: 1.15; }
.page h1 { font-size: var(--step-3); color: var(--ivory); margin-bottom: 6px; }
.page .sub { font-size: var(--step-0); line-height: 1.5; max-width: 58ch; }
.section-title { font-size: var(--step-1); color: var(--ivory); margin: 28px 0 12px; }
.lobby-hero h1 { color: var(--ivory); font-size: var(--step-3); }
.pk-hero h1 { color: var(--ivory); }
.amt, .tx .delta, .tx .after, .tc-boot b, .pk-blinds b, .stat b, .wn-net, .plate .bal, .balance-pill { font-variant-numeric: tabular-nums lining-nums; }
.btn, .gbtn, .tabs button, .seg-mini button, .bottom-nav button { letter-spacing: .005em; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; }

/* ---------- Shell ---------- */
.topbar {
  padding: 9px 18px;
  background: linear-gradient(180deg, #111327, #0F1122);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-bottom: 1px solid var(--gold-line);
}
.topbar .wordmark { font-size: 1.3rem; font-weight: 600; color: var(--marigold-soft); white-space: nowrap; }
.topbar .brandline { min-width: 0; }
@media (max-width: 420px) { .lvl-pill { max-width: 96px; overflow: hidden; text-overflow: ellipsis; } .topbar { padding: 9px 12px; } }
.logo-sm { box-shadow: 0 0 0 1px var(--gold-line); }
.balance-pill, .balance-pill.topup {
  padding: 6px 12px 6px 10px; border: 1px solid var(--gold-line); background: rgba(217, 172, 79, .08);
  color: var(--marigold-soft); font-weight: 600; font-size: var(--step-0);
}
.balance-pill.topup i { background: var(--marigold); color: var(--ink); }
.lvl-pill { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .72rem; padding: 3px 10px; }
.lvl-pill.big { background: linear-gradient(180deg, #F2D58A, #D9AC4F); color: var(--ink); border: 0; }
.bottom-nav { background: #0F1122; border-top: 1px solid var(--gold-line); }
.bottom-nav button { font-size: .7rem; font-weight: 500; gap: 3px; }
.bottom-nav button[aria-current="page"] { color: var(--marigold-soft); }
@media (min-width: 900px) {
  .topbar { padding-right: 420px; }
  .bottom-nav { border: 0; background: transparent; padding: 8px 18px; }
  .bottom-nav button { font-weight: 500; font-size: var(--step--1); padding: 8px 14px; border-radius: 999px; }
  .bottom-nav button[aria-current="page"] { background: rgba(217, 172, 79, .1); color: var(--marigold-soft); box-shadow: inset 0 0 0 1px var(--gold-line); }
  .page { padding: 28px 24px 40px; }
}
.back-games { font-weight: 500; font-size: var(--step--1); margin: 0 0 16px; }

/* ---------- Buttons & fields ---------- */
.btn { border-radius: var(--r-md); font-weight: 600; }
.btn-primary { background: linear-gradient(180deg, #F2D58A, #D9AC4F); color: var(--ink); }
.gbtn { --top: #2B2E54; --bot: #1E2140; --edge: #0F1126; border-radius: var(--r-md); font-weight: 600; box-shadow: 0 3px 0 var(--edge), 0 10px 20px rgba(5, 5, 20, .4), inset 0 1px 0 rgba(255, 255, 255, .18), inset 0 -2px 0 rgba(0, 0, 0, .12); text-shadow: none; }
.gbtn.gold { --top: #F4DA92; --bot: #D4A43E; --edge: #8A5F14; --fg: var(--ink); }
.gbtn.blue { --top: #6C86D6; --bot: #3A52A8; --edge: #1F2E6A; }
.gbtn.dim { --top: #262948; --bot: #1D2039; --edge: #0F1126; --fg: var(--muted); }
.gbtn.sm { border-radius: 12px; font-weight: 600; }
.gbtn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--edge), 0 4px 10px rgba(5, 5, 20, .4), inset 0 1px 0 rgba(255, 255, 255, .15); }
.field label { font-weight: 500; color: var(--muted); }
.field input, .auth .field select, .phone-row select, .code-form input, .pk-slider input[type="number"] { border-radius: 12px; background: rgba(255, 255, 255, .035); border-color: rgba(176, 180, 214, .2); }
.field input:focus, .code-form input:focus { border-color: var(--marigold); box-shadow: 0 0 0 3px rgba(217, 172, 79, .18); }
.tabs { background: rgba(255, 255, 255, .04); border: 1px solid var(--line); border-radius: 12px; padding: 3px; }
.tabs button { font-weight: 500; min-height: 38px; border-radius: 9px; }
.tabs button[aria-selected="true"] { background: var(--velvet); color: var(--ivory); font-weight: 600; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.seg-mini button[aria-pressed="true"] { background: rgba(217, 172, 79, .14); color: var(--marigold-soft); }
.link-btn { font-weight: 500; }

/* ---------- Panels: one surface, hairline edges ---------- */
.daily, .friends, .promo, .modal, .stat, .acct-card, .reset-card, .my-rooms li, .wn-card {
  border-radius: var(--r-lg);
}
.daily { background: var(--night-2); border: 1px solid var(--line); padding: 12px 14px; margin: 0 0 12px; }
.daily.ready { background: linear-gradient(135deg, #1E1F3B, #171A33); border-color: var(--gold-line); box-shadow: 0 0 0 1px rgba(217, 172, 79, .08), 0 14px 30px rgba(0, 0, 0, .25); }
.daily-icon { background: rgba(217, 172, 79, .12); color: var(--marigold-soft); border-radius: 12px; }
.daily-text strong { font-weight: 600; }
.friends { background: var(--night-2); border: 1px solid var(--line); padding: 16px; margin: 0 0 8px; }
.fr-icon { background: rgba(217, 172, 79, .1); color: var(--marigold-soft); }
.fr-head strong { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; }
.my-rooms li { border-radius: 12px; background: rgba(255, 255, 255, .04); }
.modal { background: var(--night-2); border: 1px solid var(--gold-line); padding: 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.modal h2 { font-size: var(--step-2); color: var(--ivory); margin-bottom: 6px; }
.modal-backdrop { background: rgba(6, 6, 16, .7); }
.stat { background: var(--night-2); border: 1px solid var(--line); padding: 14px; }
.stat b { font-family: var(--font-display); font-weight: 600; font-size: var(--step-2); color: var(--ivory); line-height: 1.1; }
.stat span { font-weight: 500; }
.toast { border-radius: 12px; font-weight: 500; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); }
.empty { font-weight: 500; }

/* ---------- Home: the invitation ---------- */
.bn-track { border-radius: var(--r-lg); box-shadow: 0 30px 70px rgba(0, 0, 0, .55); }
.banner {
  --b1: #F2D58A; --b2: #9C7524; --b3: #0F1122;
  min-height: 200px; aspect-ratio: 16 / 7;
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--b2) 48%, transparent), transparent 58%),
    linear-gradient(135deg, #1D1F3C 0%, #141630 55%, #0F1122 100%);
}
.banner.theme-gold { --b1: #F2D58A; --b2: #B08A33; }
.banner.theme-ruby { --b1: #FF8A9A; --b2: #8E1A2F; }
.banner.theme-emerald { --b1: #7EE3BE; --b2: #11684C; }
.banner.theme-royal { --b1: #BBA6FF; --b2: #4B2FA8; }
.banner.theme-midnight { --b1: #8EB0FF; --b2: #1F3A86; }
.banner.theme-sunset { --b1: #FFC98A; --b2: #B4384C; }
/* a double hairline frame, like a club invitation */
.banner::before {
  content: ''; position: absolute; inset: 10px; z-index: 1; pointer-events: none; border-radius: 12px;
  border: 1px solid rgba(217, 172, 79, .55); outline: 1px solid rgba(217, 172, 79, .16); outline-offset: 3px;
}
.banner::after { background: radial-gradient(60% 80% at 20% 100%, rgba(0, 0, 0, .35), transparent 70%); mix-blend-mode: normal; }
.banner.has-img::after { background: linear-gradient(90deg, rgba(10, 10, 24, .86), rgba(10, 10, 24, .42) 55%, rgba(10, 10, 24, .1) 85%); }
.bn-deco { right: -2%; width: 48%; max-width: 290px; opacity: 1; transform: translateY(-50%) rotate(-10deg); }
.bn-deco .bn-suit { fill: color-mix(in srgb, var(--b1) 16%, transparent); }
.bn-text { padding: 26px 28px 30px; max-width: 70%; }
.bn-text h2 { font-size: clamp(1.6rem, 5.2vw, 2.6rem); font-weight: 600; color: var(--ivory); text-shadow: none; letter-spacing: -.01em; }
.bn-text p { margin-top: 10px; font-size: var(--step-0); color: rgba(239, 235, 224, .78); max-width: 38ch; }
.bn-cta { margin-top: 18px; min-height: 40px; padding: 0 18px; background: linear-gradient(180deg, #F4DA92, #D4A43E); color: var(--ink); font-weight: 600; box-shadow: 0 3px 0 #8A5F14, 0 8px 18px rgba(0, 0, 0, .35); }
.bn-cta:active { transform: translateY(2px); box-shadow: 0 1px 0 #8A5F14; }
.bn-dots { bottom: 16px; }
.bn-dots button { background: rgba(242, 213, 138, .35); }
.bn-dots button[aria-current] { background: var(--marigold-soft); }
@media (max-width: 480px) { .banner { min-height: 236px; } .banner::before { inset: 8px; border-radius: 10px; } .bn-text { padding: 24px 20px 30px; max-width: 78%; } .bn-text h2 { font-size: clamp(1.5rem, 7vw, 2rem); } }

.games-title { margin-top: 10px; }
.games-grid { gap: 14px; }
.game-tile {
  padding: 12px 14px 14px; border-radius: var(--r-lg); gap: 3px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: radial-gradient(130% 80% at 50% 0%, color-mix(in srgb, var(--g1) 70%, #0F1122), color-mix(in srgb, var(--g2) 80%, #0F1122) 78%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 14px 30px rgba(4, 4, 16, .45);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.game-tile:hover { transform: translateY(-3px); border-color: rgba(217, 172, 79, .45); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 18px 36px rgba(4, 4, 16, .55); }
.gt-name { font-size: 1.32rem; font-weight: 600; margin-top: 6px; color: var(--ivory); }
.gt-sub { font-size: .8rem; color: rgba(239, 235, 224, .66); line-height: 1.35; }
.gt-live, .gt-soon { padding: 0; background: none; font-weight: 500; font-size: .78rem; color: #9FE3C3; margin-top: 10px; }
.gt-live i { width: 6px; height: 6px; box-shadow: 0 0 0 3px rgba(76, 215, 160, .18); }
.gt-soon { color: var(--muted); }
.wn-head strong { color: var(--ivory); }
.wn-card { border-radius: 16px; }

/* ---------- Lobbies: one framed list, rows parted by hairlines ---------- */
.table-list, .pk-list { gap: 0; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--night-2); overflow: hidden; }
.table-card, .pk-card { border: 0; border-radius: 0; background: transparent; box-shadow: none; padding: 14px 16px; transition: background .15s; }
.table-card + .table-card, .pk-card + .pk-card { border-top: 1px solid var(--line); }
.table-card:hover, .pk-card:hover { background: rgba(255, 255, 255, .025); }
.pk-card.tier-classic, .pk-card.tier-pro, .pk-card.tier-vip { background: transparent; border-color: var(--line); }
.pk-card.tier-vip { background: linear-gradient(90deg, rgba(217, 172, 79, .07), transparent 60%); }
.tc-body h3, .pk-card h3 { font-weight: 600; font-size: 1.12rem; color: var(--ivory); }
.tc-boot b { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; color: var(--marigold-soft); line-height: 1; }
.tc-boot span, .tc-meta, .pk-meta { font-size: var(--step--1); color: var(--muted); }
.tc-boot { margin-top: 5px; }
.pk-blinds { margin: 5px 0 2px; }
.pk-blinds b { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: var(--marigold-soft); }
.pk-variant { background: transparent; border: 1px solid var(--line); color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.mini-felt { box-shadow: 0 0 0 3px #4A2414, 0 0 0 4px #B8903A, 0 6px 12px rgba(0, 0, 0, .4); }
.mini-seat { background: #2B2E54; box-shadow: 0 0 0 2px var(--night-2); }
.mini-seat.on { background: #F4D98C; }
.table-list .empty, .pk-list .empty { padding: 28px 16px; }
.pk-tabs { margin: 6px 0 18px; }

/* ---------- Wallet: the chip tray ---------- */
.wallet-hero {
  position: relative; padding: 24px 24px 22px; margin: 6px 0 16px; border-radius: 18px;
  border: 1px solid var(--gold-line); outline: 1px solid rgba(217, 172, 79, .12); outline-offset: 3px;
  background: radial-gradient(90% 120% at 100% 0%, rgba(217, 172, 79, .12), transparent 55%), var(--night-2);
}
.wallet-hero .sub { font-weight: 500; }
.wallet-hero .big { font-weight: 600; font-size: clamp(2.3rem, 8vw, 3rem); color: var(--marigold-soft); letter-spacing: -.01em; }
.wallet-actions { margin-bottom: 14px; }
.tx { padding: 13px 0; }
.tx .what { font-weight: 500; }
.tx .delta { font-weight: 600; font-family: var(--font-display); font-size: 1.1rem; }
.tx .delta.plus { color: #8FE3BA; }
.wd-lock { border-radius: 12px; background: rgba(217, 172, 79, .1); border-color: var(--gold-line); color: var(--marigold-soft); }

/* ---------- Profile ---------- */
.me-head { gap: 20px; margin-bottom: 10px; }
.me-info h1 { font-size: var(--step-2); }
.lb-track { background: rgba(255, 255, 255, .07); height: 8px; }
.lb-track span { background: linear-gradient(90deg, #D9AC4F, #F2D58A); box-shadow: none; }
.look-item.selected { border-color: var(--marigold); background: rgba(217, 172, 79, .1); }
.look-check { background: var(--marigold); color: var(--ink); }

/* ---------- Sign in ---------- */
.auth { background: radial-gradient(80% 50% at 50% 0%, rgba(217, 172, 79, .1), transparent 70%); }
.wordmark { font-weight: 600; color: var(--marigold-soft); }
.brand p { font-size: var(--step-0); max-width: 34ch; margin: 6px auto 0; }
.logo-hero { box-shadow: 0 20px 44px rgba(0, 0, 0, .5), 0 0 0 1px var(--gold-line); }
.rc-label { text-transform: none; letter-spacing: 0; font-weight: 500; }
.rc-code { font-family: var(--font-display); font-weight: 600; letter-spacing: .12em; }

/* ---------- Card tables (Teen Patti, Poker) ---------- */
.game-head { padding: 10px 14px; background: linear-gradient(180deg, rgba(6, 5, 10, .72), rgba(6, 5, 10, 0)); }
.game-head .title strong { font-weight: 600; font-size: 1.25rem; color: var(--marigold-soft); letter-spacing: 0; }
.game-head .title span { font-size: .8rem; color: rgba(239, 235, 224, .62); font-weight: 500; }
.game-head .title span i { background: rgba(217, 172, 79, .55); }
.round-btn { border-color: var(--gold-line); background: rgba(8, 6, 12, .55); color: var(--marigold-soft); }
.game .balance-pill { background: rgba(8, 6, 12, .55); }
.plate { background: rgba(10, 8, 16, .84); border: 1px solid rgba(217, 172, 79, .28); border-radius: 11px; padding: 4px 12px 5px; box-shadow: 0 6px 14px rgba(0, 0, 0, .4); }
.plate .name { font-weight: 600; font-size: .8rem; color: var(--ivory); }
.plate .bal { font-weight: 600; font-size: .76rem; color: var(--marigold-soft); }
.pot-amt { font-weight: 600; color: var(--marigold-soft); background: rgba(8, 6, 12, .66); border-color: rgba(217, 172, 79, .45); }
.pot-meta { font-weight: 500; }
.stake-amt { font-weight: 600; color: var(--marigold-soft); }
.hand-name { font-weight: 600; background: linear-gradient(180deg, #F4DA92, #D4A43E); color: var(--ink); }
.badge-status { font-weight: 600; letter-spacing: 0; }
.seat.empty .avatar { border: 1px solid rgba(239, 235, 224, .22); }
.seat.empty .avatar .face { background: rgba(8, 6, 12, .35); font-weight: 500; font-size: .7rem; color: rgba(239, 235, 224, .6); }
.seat .avatar { background: conic-gradient(from 210deg, #F2D58A, #B8903A, #F6E3A8, #9C7524, #F2D58A); }
.seat .ring circle[data-deadline] { stroke: #F4D98C; }
.actions {
  padding: 10px 14px calc(12px + var(--safe-b));
  background: linear-gradient(180deg, rgba(10, 8, 16, .82), rgba(8, 6, 12, .98) 38%);
  -webkit-backdrop-filter: none; backdrop-filter: none;
  border-top: 1px solid var(--gold-line); border-radius: 0; box-shadow: 0 -20px 40px rgba(0, 0, 0, .35);
}
.turn-info { font-weight: 500; }
.turn-info.mine { color: var(--marigold-soft); font-weight: 600; }
.act-idle { border: 0; border-radius: 0; font-weight: 500; font-size: var(--step-0); color: rgba(239, 235, 224, .62); gap: 10px; grid-auto-flow: column; justify-content: center; }
.act-idle::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--marigold); animation: idle-dot 1.8s ease-in-out infinite; }
@keyframes idle-dot { 50% { opacity: .35; } }
.reduce-motion .act-idle::before { animation: none; }
.act-row.primary .gbtn { font-size: 1.05rem; }
.log { background: rgba(10, 8, 16, .97); border-color: var(--gold-line); border-radius: 14px; }
.result-banner .rb { background: linear-gradient(180deg, #F6E3A8 0%, #D9AC4F 62%, #B8903A 100%); color: var(--ink); }
.rb-title { font-weight: 600; }
.pk-slot { border-color: rgba(242, 213, 138, .28); }
.pk-presets .chip-btn { border-color: var(--gold-line); background: rgba(217, 172, 79, .1); color: var(--marigold-soft); font-weight: 600; }
.pk-buyin b { font-weight: 600; color: var(--marigold-soft); }
.pk-myhand { color: var(--marigold-soft); font-weight: 600; }

/* The seat at the head of the table hangs from its avatar, so a hand of cards
   never pushes it up into the title. */
.seat.top { transform: translate(-50%, -33px); }
@media (max-width: 420px) { .seat.top { transform: translate(-50%, -25px); } }
.act-idle { display: flex; flex-wrap: wrap; align-items: center; align-content: center; justify-content: center; gap: 6px 10px; }
.act-idle .pk-myhand { flex-basis: 100%; }

/* ---------- Board & cue rooms: same velvet, their own light ---------- */
.ld-game {
  background:
    radial-gradient(60% 50% at 50% 46%, rgba(255, 220, 160, .1), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 22px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, .02) 0 2px, transparent 2px 22px),
    radial-gradient(120% 90% at 50% 45%, #2449A8 0%, #17307E 45%, #0E1C52 80%, #0A1238 100%);
}
.ld-p { background: rgba(6, 10, 32, .62); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); }
.ld-prize { background: rgba(6, 10, 32, .5); color: var(--marigold-soft); font-weight: 600; }
.ld-title strong { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; color: var(--ivory); }
.ld-status { font-weight: 500; }
.rm-game { background: radial-gradient(120% 90% at 50% 0%, #211C44 0%, #120F2C 55%, #09071A 100%); }
.pl-game { background: radial-gradient(120% 100% at 50% 40%, #1B1740 0%, #0F0C28 60%, #08061A 100%); }
.rm-game .round-btn, .pl-game .round-btn, .ld-game .round-btn, .sl-game .round-btn { background: rgba(8, 6, 16, .5); }

/* ---------- Last fifth of the clock: red ring, pulsing seat, ticking ---------- */
.seat.hurry .avatar, .rm-mine.hurry .rm-mine-av, .rm-seat.hurry .avatar, .pl-pcard.hurry .avatar, .ld-p.hurry .avatar { animation: hurry-pulse .5s ease-in-out infinite alternate; }
.ld-count.hurry b, .game.hurry-me .turn-info.mine, .game.hurry-me .rm-status.mine, .game.hurry-me .pl-status, .game.hurry-me .ld-status { color: #FF8A9A; }
.game.hurry-me [data-countdown] { color: #FF8A9A; font-weight: 700; }
.ld-count.hurry { animation: hurry-pulse .5s ease-in-out infinite alternate; }
@keyframes hurry-pulse { from { transform: scale(1); filter: brightness(1); } to { transform: scale(1.06); filter: brightness(1.18) drop-shadow(0 0 10px rgba(255, 80, 110, .7)); } }
.seat .ring circle[data-deadline] { transition: stroke-dashoffset 250ms linear, stroke 300ms; }
@media (prefers-reduced-motion: reduce) { .seat.hurry .avatar, .rm-mine.hurry .rm-mine-av, .rm-seat.hurry .avatar, .pl-pcard.hurry .avatar, .ld-p.hurry .avatar, .ld-count.hurry { animation: none; } }

/* ---------- Private rooms in every game: the code chip on the table ---------- */
.game > .room-chip {
  position: absolute; right: 10px; top: 114px; z-index: 60;
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 999px;
  border: 1px solid var(--gold-line); background: rgba(10, 8, 16, .82); color: var(--marigold-soft);
  font: 600 .78rem var(--font-body); letter-spacing: .08em; cursor: pointer; box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}
.game > .room-chip svg { width: 13px; height: 13px; }
.game > .room-chip b { font-weight: 700; }
.pk-game > .room-chip, .pl-game > .room-chip { top: 108px; }
.ld-game > .room-chip { top: 112px; }
.rm-game > .room-chip { right: auto; left: 10px; top: 112px; }
.friends .fr-head span:not(.fr-icon) { line-height: 1.35; }
.pc-muted { margin: -4px 0 6px; color: var(--muted); font-size: var(--step--1); }
@media (max-width: 700px) and (orientation: portrait) { .pk-game > .room-chip { top: 56px; right: auto; left: 10px; } }
[hidden] { display: none !important; }

/* ---------- Deposit: payment screenshot ---------- */
.receipt-drop {
  position: relative; display: grid; place-items: center; min-height: 112px; padding: 14px; border-radius: 14px; cursor: pointer; overflow: hidden;
  border: 1.5px dashed rgba(217, 172, 79, .5); background: rgba(217, 172, 79, .06); color: var(--marigold-soft); text-align: center;
}
.receipt-drop:focus-within, .receipt-drop:hover { border-color: var(--marigold); background: rgba(217, 172, 79, .1); }
.receipt-drop .rd-empty { display: grid; justify-items: center; gap: 4px; }
.receipt-drop .rd-empty svg { width: 26px; height: 26px; }
.receipt-drop .rd-empty b { font-weight: 600; color: var(--ivory); }
.receipt-drop .rd-empty small { color: var(--muted); font-size: var(--step--1); }
.receipt-drop.has { padding: 6px; border-style: solid; border-color: var(--gold-line); }
.receipt-drop .rd-img { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; }
.receipt-drop .rd-change { position: absolute; right: 10px; bottom: 10px; padding: 4px 12px; border-radius: 999px; background: rgba(10, 8, 16, .85); color: var(--marigold-soft); font-size: .78rem; font-weight: 600; }
.receipt-drop.busy { opacity: .6; pointer-events: none; }
.tx .delta.rejected { color: #FF9AA8; font-family: var(--font-body); font-size: .85rem; font-weight: 600; }

/* ---------- Deposit: bank and UPI methods ---------- */
.method .m-tag { display: inline-block; margin-right: 7px; padding: 1px 7px; border-radius: 6px; font-style: normal; font-size: .66rem; font-weight: 700; letter-spacing: .03em; vertical-align: 2px; background: rgba(91, 141, 239, .2); color: #A9C4FF; }
.method .m-tag.bank { background: rgba(217, 172, 79, .16); color: var(--marigold-soft); }
.method .m-copy { margin-left: 6px; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--gold-line); background: transparent; color: var(--marigold-soft); font: 600 .7rem var(--font-body); letter-spacing: 0; vertical-align: 1px; }
.method .m-qr { display: block; width: min(220px, 70%); aspect-ratio: 1; object-fit: contain; margin: 8px auto 4px; padding: 8px; border-radius: 12px; background: #fff; }
.method .m-upi-app { justify-self: start; margin-top: 4px; padding: 6px 12px; border-radius: 999px; background: rgba(91, 141, 239, .18); color: #CFDDFF; font-size: .8rem; font-weight: 600; text-decoration: none; }
.method:not(:has(input:checked)) .m-qr, .method:not(:has(input:checked)) .m-upi-app { display: none; }
@media (min-width: 760px) { .method .m-upi-app { display: none !important; } }
a.brandline { text-decoration: none; color: inherit; border-radius: 10px; } a.brandline:hover .wordmark { color: var(--ivory); }

/* ---------- Wallet: deposits, withdrawals and game history in tabs ---------- */
.wallet-tabs { grid-template-columns: repeat(3, 1fr); margin: 18px 0 12px; }
.wallet-tabs .wt-n:not(:empty) { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 9px; background: var(--marigold); color: var(--ink); font-size: .7rem; font-weight: 700; }
.pay-when { color: var(--muted); font-size: .76rem; }
.tx .tx-tag { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 6px; font-style: normal; font-size: .7rem; font-weight: 600; vertical-align: 1px;
  background: rgba(217, 172, 79, .12); color: var(--marigold-soft); border: 1px solid var(--gold-line); }
.tx-game .what { font-weight: 600; }
.bottom-nav { grid-template-columns: repeat(5, 1fr); }
@media (min-width: 900px) { .bottom-nav { grid-template-columns: repeat(5, auto); } .topbar { padding-right: 520px; } }
.wallet-tabs button { white-space: nowrap; font-size: .86rem; padding: 0 6px; }
.hist-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; margin: 0 0 6px; scrollbar-width: none; }
.hist-chips::-webkit-scrollbar { display: none; }
.hist-chips button { flex: none; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--muted); font-weight: 500; font-size: .86rem; }
.hist-chips button[aria-selected="true"] { background: rgba(217, 172, 79, .14); border-color: var(--gold-line); color: var(--marigold-soft); font-weight: 600; }
@media (min-width: 760px) { .hist-chips { flex-wrap: wrap; overflow: visible; } }

/* ---------- Turn timer: a slim ring just outside the frame, green → gold → red, with a glowing head ---------- */
.ring { inset: -9px !important; width: calc(100% + 18px) !important; height: calc(100% + 18px) !important; overflow: visible; }
.ring circle { stroke-width: 3.2 !important; }
.ring .ring-track { stroke: rgba(8, 6, 16, .55) !important; stroke-width: 4.6 !important; }
.ring circle[data-deadline] { filter: drop-shadow(0 0 2.5px currentColor); transition: stroke-dashoffset 250ms linear, stroke 400ms linear !important; }
.ring .ring-head { stroke: #fff; stroke-width: 1.2; filter: drop-shadow(0 0 4px rgba(255, 255, 255, .8)); transition: cx 250ms linear, cy 250ms linear; }
.seat.turn .avatar { animation: none !important; box-shadow: 0 0 0 2px rgba(255, 255, 255, .08), 0 0 22px rgba(244, 217, 140, .35), 0 8px 18px rgba(4, 2, 20, .6); }

/* ---------- Help and support ---------- */
.help-btn { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--muted); }
.help-btn:hover { color: var(--marigold-soft); border-color: var(--gold-line); }
.help-btn svg { width: 18px; height: 18px; }
.auth-help { display: inline-flex; align-items: center; gap: 6px; margin: 18px auto 0; color: var(--muted); text-decoration: none; }
.auth-help svg { width: 16px; height: 16px; }
.auth-inner > .auth-help { display: flex; justify-content: center; width: 100%; }
.profile-actions .btn svg { width: 16px; height: 16px; }
.support-sheet p b { color: var(--ivory); }
.sp-options { display: grid; gap: 10px; margin-top: 4px; }
.sp-opt { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: var(--text); text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.sp-opt b { display: block; font-size: 1.02rem; }
.sp-opt small { color: var(--muted); font-size: .84rem; }
.sp-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; flex: none; }
.sp-ic svg { width: 24px; height: 24px; }
.sp-opt.wa .sp-ic { background: #25D366; color: #fff; }
.sp-opt.wa:hover { border-color: rgba(37, 211, 102, .6); }
.sp-opt.lc .sp-ic { background: rgba(217, 172, 79, .16); color: var(--marigold-soft); }
.sp-opt.lc:hover { border-color: var(--gold-line); }
@media (max-width: 380px) { .help-btn { width: 32px; height: 32px; } }

@media (max-width: 370px) { .topbar .lvl-pill { display: none; } .topbar .wordmark { font-size: 1.15rem; } }


/* ================= Home: the casino lobby (2.17) ================= */
/* black with a faint gold damask, only on the home page */
.shell[data-view="home"] {
  min-height: 100vh; min-height: 100dvh;
  background:
    radial-gradient(110% 45% at 50% 0%, rgba(201, 150, 46, .16), transparent 70%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='64' height='64' viewBox='0 0 64 64'%3E%3Cg fill='none' stroke='%23F2D58A' stroke-opacity='.07' stroke-width='1.2'%3E%3Cpath d='M32 4C38 16 48 22 60 32 48 42 38 48 32 60 26 48 16 42 4 32 16 22 26 16 32 4z'/%3E%3Cpath d='M32 18c3 6 8 10 14 14-6 4-11 8-14 14-3-6-8-10-14-14 6-4 11-8 14-14z'/%3E%3Ccircle cx='0' cy='0' r='4'/%3E%3Ccircle cx='64' cy='0' r='4'/%3E%3Ccircle cx='0' cy='64' r='4'/%3E%3Ccircle cx='64' cy='64' r='4'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(140% 100% at 50% 30%, #15120C 0%, #0B0A07 60%, #050403 100%);
}
.shell[data-view="home"] .topbar { background: linear-gradient(180deg, #14110B, #0A0806); border-bottom-color: rgba(242, 201, 100, .35); }
.shell[data-view="home"] .bottom-nav { background: #0A0806; border-top-color: rgba(242, 201, 100, .35); }
@media (min-width: 900px) { .shell[data-view="home"] .bottom-nav { background: transparent; } }

.lobby { --gold: linear-gradient(180deg, #FFF4C4 0%, #F4C957 22%, #A86C12 50%, #F8D978 74%, #7A4A0A 100%); }

/* banners get a gold frame */
.lobby .banners { margin-bottom: 18px; }
.lobby .banner { box-shadow: 0 0 0 2px #C9963A, 0 0 0 4px #0A0806, 0 14px 30px rgba(0, 0, 0, .55); }

/* shortcuts: gold medallions */
.medals { display: flex; justify-content: space-around; gap: 6px; margin: 4px 0 22px; }
.medal { flex: 1 1 0; min-width: 0; max-width: 96px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font: inherit; color: #F6E7C6; cursor: pointer; }
.md-ring { position: relative; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; padding: 3px; background: var(--gold, linear-gradient(180deg, #FFF4C4, #F4C957 22%, #A86C12 50%, #F8D978 74%, #7A4A0A)); box-shadow: 0 6px 14px rgba(0, 0, 0, .5); transition: transform .15s ease; }
.md-face { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(80% 80% at 40% 30%, #2A2418, #0E0C08 70%, #050403); color: #F2C95C; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .5); }
.md-face svg { width: 24px; height: 24px; }
.md-tx { font-size: .74rem; font-weight: 600; line-height: 1.2; text-align: center; }
.medal:hover .md-ring { transform: translateY(-2px); }
.medal:active .md-ring { transform: translateY(1px); }
.medal:focus-visible { outline: none; } .medal:focus-visible .md-ring { outline: 3px solid #F4C957; outline-offset: 3px; }
.medal.ready .md-face { background: radial-gradient(80% 80% at 40% 30%, #FFF0B0, #F2C14E 55%, #B07A1E); color: #4A1A04; }
.medal.ready .md-ring { box-shadow: 0 0 0 4px rgba(244, 201, 87, .22), 0 0 22px rgba(244, 201, 87, .45), 0 6px 14px rgba(0, 0, 0, .5); }
.medal.ready .md-tx { color: #FBD978; }
.medal[aria-disabled="true"] .md-face { color: #C9A88A; }
.medal[aria-disabled="true"] .md-tx { color: rgba(246, 231, 198, .6); }
.md-dot { position: absolute; top: 1px; right: 1px; width: 13px; height: 13px; border-radius: 50%; background: #2BD46B; border: 2px solid #0B0A07; }

/* online counts */
.online { display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; padding: 3px 9px 3px 7px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: #9CF2B9; font-size: .74rem; font-weight: 600; line-height: 1.3; }
.online svg { width: 12px; height: 12px; fill: currentColor; }

/* the main table: Teen Patti, a photo-like picture with the name in gold */
.main-table { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; min-height: 200px; margin: 0 0 8px; padding: 0; border: 0; border-radius: 24px; overflow: hidden; cursor: pointer; text-align: left; font: inherit; color: #F6E7C6; isolation: isolate;
  background: #0B0906;
  box-shadow: inset 0 0 0 2px #E2B04A, 0 0 0 1px #5A3C0A, 0 18px 40px rgba(0, 0, 0, .7);
  transition: transform .16s ease; }
.main-table::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px #E2B04A, inset 0 0 0 4px rgba(11, 9, 6, .9), inset 0 0 0 5px rgba(242, 201, 100, .4); pointer-events: none; }
.main-table:hover { transform: translateY(-2px); }
.main-table:active { transform: translateY(1px); }
.main-table:focus-visible { outline: 3px solid #F4C957; outline-offset: 4px; }
.mt-art { position: absolute; inset: 0; z-index: -1; display: block; pointer-events: none; }
.mt-art img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; display: block; }
.mt-art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent 38%, rgba(8, 7, 5, .7) 62%, rgba(8, 7, 5, .92)); }
.mt-text { position: absolute; top: 0; bottom: 0; right: 0; width: 46%; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 16px 18px 16px 0; }
.mt-name { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.6rem, 7.4vw, 2.6rem); line-height: 1; margin-top: 4px;
  background: linear-gradient(180deg, #FFF6D2 10%, #F0C95C 50%, #C08A2A 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-box-decoration-break: clone; box-decoration-break: clone;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8)); }
.mt-sub { font-size: .78rem; color: rgba(246, 231, 198, .78); }
.play-btn { margin-top: 10px; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 22px; border-radius: 999px; font-weight: 800; font-size: .98rem; color: #2A1604;
  background: linear-gradient(180deg, #FFF0B0 0%, #F6CC5A 45%, #D79B2C 55%, #F2C14E 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .7), 0 3px 0 #7A4A0A, 0 8px 18px rgba(0, 0, 0, .55); }
.main-table:hover .play-btn { filter: brightness(1.06); }

/* ornamental section title */
.orn-title { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; color: #F0C95C; }
.orn-title::before, .orn-title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(244, 201, 87, .65)); }
.orn-title::after { background: linear-gradient(90deg, rgba(244, 201, 87, .65), transparent); }
.orn-title span { display: inline-flex; align-items: center; gap: 10px; }
.orn-title span::before, .orn-title span::after { content: ""; width: 6px; height: 6px; background: #F4C957; transform: rotate(45deg); }

/* the gold-framed game icons */
.icon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.icon-grid > :last-child:nth-child(3n+1) { grid-column: 2; } /* a lone last icon sits in the middle */
.game-icon { position: relative; display: block; aspect-ratio: 1; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 22%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .8)); transition: transform .15s ease; }
.game-icon > svg { display: block; width: 100%; height: 100%; }
.game-icon:hover { transform: translateY(-3px) scale(1.02); }
.game-icon:active { transform: scale(.97); }
.game-icon:focus-visible { outline: 3px solid #F4C957; outline-offset: 3px; }
.game-icon .online.sm { position: absolute; top: 9%; left: 9%; padding: 2px 7px 2px 5px; font-size: .68rem; }
.hot-tag { position: absolute; top: 7%; right: 7%; padding: 2px 8px; border-radius: 999px; background: linear-gradient(180deg, #FF7A3D, #E0262F); color: #fff; font-size: .66rem; font-weight: 800; box-shadow: 0 2px 6px rgba(0, 0, 0, .45); }
.game-icon.soon { cursor: default; }
.game-icon.soon > svg { filter: grayscale(.85) brightness(.75); }
.soon-tag { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); white-space: nowrap; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .7); color: #F6E7C6; font-size: .68rem; font-weight: 700; }

/* winners on the black lobby */
.lobby .winners { margin-top: 26px; }
.lobby .wn-card { background: #13100B; border-color: rgba(242, 201, 100, .25); }
.lobby .wn-head strong { color: #F4D27A; }

/* join-a-room sheet */
.code-form.big { display: flex; gap: 10px; margin: 14px 0 6px; }
.code-form.big input { flex: 1; min-width: 0; height: 50px; font-size: 1.25rem; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.code-form.big .gbtn { min-height: 50px; }
.jc-alt { font-size: .85rem; color: var(--muted); margin: 10px 0 0; }

@media (max-width: 360px) {
  .icon-grid { gap: 9px; }
  .md-ring { width: 52px; height: 52px; }
  .md-tx { font-size: .68rem; }
  .mt-text { width: 50%; padding-right: 12px; }
  .play-btn { padding: 0 16px; }
}
@media (min-width: 600px) {
  .icon-grid { gap: 18px; }
  .medals { justify-content: center; gap: 28px; }
}
@media (prefers-reduced-motion: reduce) { .game-icon, .main-table, .md-ring { transition: none; } .game-icon:hover, .main-table:hover, .medal:hover .md-ring { transform: none; } }
