/* MSRX Teen Patti — a card night at home, not a casino.
   Peacock-teal cloth, rosewood rim, brass inlay, marigold for "your move", sindoor for loss.
   One signature: the jaali lattice, on the card backs, the cloth and the pot plate. */

@font-face { font-family: "Bricolage"; src: url(/play/teen-patti/fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: "Inter"; src: url(/play/teen-patti/fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #0a1418;
  --ink-2: #0f1e23;
  --cloth: #0e3b43;
  --cloth-deep: #072a30;
  --cloth-edge: #04181c;
  --rosewood: #3b1a12;
  --rosewood-2: #6a3420;
  --brass: #d9a441;
  --brass-deep: #8f6618;
  --brass-light: #f2d28a;
  --marigold: #f4a62a;
  --sindoor: #d63a2f;
  --jade: #3fbf9a;
  --ivory: #f7f0e1;
  --muted: #9fb3af;
  --line: rgba(217, 164, 65, .22);
  --panel: rgba(15, 30, 35, .86);
  --display: "Bricolage", "Inter", system-ui, sans-serif;
  --ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --soft: #cfdcd8;
  --shade: rgba(0, 0, 0, .28);
  --tint: rgba(255, 255, 255, .05);
  --hair: rgba(255, 255, 255, .09);
  --field: rgba(0, 0, 0, .32);
  --c-gold: #e6bd57;
  --c-green: #34c98c;
  --c-amber: #e6a14d;
  --c-red: #e2414f;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --jaali: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44'%3E%3Cg fill='none' stroke='%23D9A441' stroke-width='1'%3E%3Ccircle cx='0' cy='0' r='22'/%3E%3Ccircle cx='44' cy='0' r='22'/%3E%3Ccircle cx='0' cy='44' r='22'/%3E%3Ccircle cx='44' cy='44' r='22'/%3E%3Ccircle cx='22' cy='22' r='22'/%3E%3C/g%3E%3Cg fill='%23D9A441'%3E%3Ccircle cx='22' cy='22' r='1.6'/%3E%3Ccircle cx='0' cy='0' r='1.6'/%3E%3Ccircle cx='44' cy='0' r='1.6'/%3E%3Ccircle cx='0' cy='44' r='1.6'/%3E%3Ccircle cx='44' cy='44' r='1.6'/%3E%3C/g%3E%3C/svg%3E");
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--ink); color: var(--ivory); font-family: var(--ui); font-size: 16px; -webkit-text-size-adjust: 100%; }
body { background: radial-gradient(900px 520px at 50% -8%, rgba(14, 59, 67, .9), transparent 70%), var(--ink); }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--brass-light); }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--marigold); outline-offset: 2px; border-radius: 10px; }
h1, h2, h3 { margin: 0; }
.display { font-family: var(--display); font-weight: 800; font-stretch: 75%; letter-spacing: -.01em; line-height: .92; }

/* ── Cards ─────────────────────────────────────────────────────────────── */
.card { --cw: 72px; width: var(--cw); aspect-ratio: 338 / 489; perspective: 800px; flex: none; position: relative; }
.card .ci { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .6s cubic-bezier(.25, .9, .3, 1); }
.card.down .ci { transform: rotateY(180deg); }
.card .cf, .card .cb { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; filter: drop-shadow(0 calc(var(--cw) * .05) calc(var(--cw) * .08) rgba(0,0,0,.5)) drop-shadow(0 1px 1px rgba(0,0,0,.45)); }
.card .cb { transform: rotateY(180deg); }
.card svg, .card img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.card.sm { --cw: 34px; }
.card.lg { --cw: 96px; }
.card.pick { cursor: pointer; }
.card.dim .cf img { filter: grayscale(.5) brightness(.55); }
.card.drop::after { content: ""; position: absolute; inset: 0; border-radius: calc(var(--cw) * .06); z-index: 2;
  background: linear-gradient(135deg, transparent 46%, rgba(214,58,47,.95) 46% 54%, transparent 54%), rgba(10,20,24,.25); }
.card.ghost .cf { opacity: .8; filter: drop-shadow(0 0 0 var(--marigold)) drop-shadow(0 0 5px rgba(244,166,42,.9)); }
.card.ghost .cf img { filter: saturate(.7); }
.card.keep .cf { filter: drop-shadow(0 0 2px var(--brass-light)) drop-shadow(0 0 7px rgba(242,210,138,.8)); }
.chip { display: block; filter: drop-shadow(0 2px 2px rgba(0,0,0,.5)); }

/* ── Header ────────────────────────────────────────────────────────────── */
.top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: calc(10px + var(--safe-t)) 16px 10px; background: rgba(10, 20, 24, .86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ivory); min-width: 0; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 21px; letter-spacing: .01em; white-space: nowrap; }
.brand small { display: block; font-family: var(--mono); font-size: 9.5px; letter-spacing: .16em; color: var(--muted); }
.tabs { display: flex; gap: 2px; margin-left: auto; background: var(--shade); border: 1px solid var(--line); border-radius: 14px; padding: 3px; }
.tab { background: none; border: 0; padding: 8px 14px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--brass); color: #2a1b05; }
.iconbtn { background: var(--tint); border: 1px solid var(--line); width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 17px; flex: none; }
.iconbtn:active { transform: scale(.96); }
@media (max-width: 640px) {
  .tabs { order: 3; width: 100%; margin: 0; }
  .tab { flex: 1; padding: 9px 4px; font-size: 13px; }
  #h-theme { margin-left: auto; }
}

main { max-width: 1080px; margin: 0 auto; padding: 18px 16px 64px; }
footer { text-align: center; padding: 24px 16px calc(36px + var(--safe-b)); color: var(--muted); font-size: 12.5px; line-height: 1.6; }
footer .tag { font-family: var(--mono); letter-spacing: .24em; font-size: 10.5px; color: var(--brass); margin-bottom: 6px; }

/* ── Buttons & fields ──────────────────────────────────────────────────── */
.btn { border: 0; border-radius: 14px; padding: 12px 18px; min-height: 48px; font-weight: 700; font-size: 15px; color: #2a1b05;
  background: linear-gradient(180deg, var(--brass-light), var(--brass) 48%, #b9852a); box-shadow: 0 1px 0 rgba(255,255,255,.55) inset, 0 -2px 0 rgba(0,0,0,.18) inset, 0 8px 18px -8px rgba(0,0,0,.7);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .1s, filter .15s; text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .38; cursor: not-allowed; }
.btn.green { color: #04261c; background: linear-gradient(180deg, #8ae6c8, var(--jade) 50%, #26936f); }
.btn.ruby { color: #fff; background: linear-gradient(180deg, #ee6a5f, var(--sindoor) 50%, #a3241b); }
.btn.violet { color: #fff; background: linear-gradient(180deg, #6f86d6, #3c56b0 50%, #2a3f86); }
.btn.ghost, .btn.teal { color: var(--ivory); background: var(--tint); box-shadow: inset 0 0 0 1px var(--line); }
.btn.sm { padding: 8px 12px; min-height: 38px; font-size: 13px; border-radius: 11px; }
.btn small { display: block; font-family: var(--mono); font-weight: 600; font-size: 11px; opacity: .8; }
.btn .two { display: grid; text-align: center; line-height: 1.15; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.field { display: grid; gap: 6px; }
.field > span, .lbl { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; color: var(--muted); text-transform: uppercase; }
input[type="text"], textarea, select { font: inherit; color: var(--ivory); background: var(--field); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; width: 100%; font-size: 16px; }
textarea { font-family: var(--mono); font-size: 12.5px; min-height: 88px; resize: vertical; word-break: break-all; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--brass) 50%), linear-gradient(135deg, var(--brass) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 18px; }
.pill { font-family: var(--mono); font-size: 10.5px; letter-spacing: .08em; padding: 5px 10px; border-radius: 999px; background: var(--shade); border: 1px solid var(--line); color: var(--ivory); white-space: nowrap; }
.hint { font-size: 12.5px; color: var(--muted); }
.note { color: var(--muted); font-size: 12.5px; line-height: 1.5; margin: 10px 0 0; }
.sec-h { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(32px, 7vw, 52px); line-height: .95; margin: 8px 0 8px; letter-spacing: -.01em; }
.lede { color: var(--muted); max-width: 64ch; line-height: 1.55; margin: 0 0 18px; }

/* ── Home ──────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; border-radius: 26px; padding: 26px 20px 22px; isolation: isolate;
  background: radial-gradient(120% 90% at 50% 0%, #15515b 0%, var(--cloth) 40%, var(--cloth-deep) 100%);
  box-shadow: 0 0 0 1px rgba(217,164,65,.35), 0 0 0 7px var(--rosewood), 0 0 0 8px rgba(217,164,65,.45), 0 30px 60px -28px #000; margin: 8px 8px 0; }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--jaali); background-size: 44px; opacity: .07; z-index: -1; }
.hero-grid { display: grid; gap: 18px; }
.hero h1 { font-size: clamp(64px, 19vw, 132px); color: var(--ivory); text-shadow: 0 4px 0 rgba(0,0,0,.25); }
.hero h1 em { display: block; font-style: normal; color: var(--brass-light); font-size: .36em; letter-spacing: .01em; margin-top: .25em; font-stretch: 85%; }
.hero p { color: #cfe0db; font-size: 16px; line-height: 1.5; margin: 12px 0 0; max-width: 36ch; }
.fan { position: relative; height: 150px; display: grid; place-items: center; margin-top: -4px; }
.fan .card { position: absolute; --cw: 92px; transform-origin: 50% 140%; }
.fan .card:nth-child(1) { transform: rotate(-16deg); }
.fan .card:nth-child(2) { transform: rotate(0) translateY(-6px); z-index: 2; }
.fan .card:nth-child(3) { transform: rotate(16deg); }
@keyframes fanIn { from { transform: rotate(0) translateY(30px); opacity: 0; } }
.fan .card { animation: fanIn .8s cubic-bezier(.2,.9,.3,1) both; }
.fan .card:nth-child(2) { animation-delay: .08s; }
.fan .card:nth-child(3) { animation-delay: .16s; }
.cta { display: grid; gap: 10px; margin-top: 18px; }
.cta .btn { width: 100%; min-height: 56px; font-size: 17px; border-radius: 16px; }
.cta .link { background: none; border: 0; color: var(--brass-light); font-weight: 600; padding: 10px; font-size: 15px; }
.who { margin-top: 16px; display: grid; gap: 10px; }
.avatars { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.avatars::-webkit-scrollbar { display: none; }
.avatars button { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--shade); font-size: 22px; }
.avatars button[aria-pressed="true"] { border-color: var(--marigold); box-shadow: 0 0 0 2px var(--marigold); background: rgba(244,166,42,.15); }
.learn { display: grid; gap: 8px; margin-top: 22px; }
.learn button { display: grid; grid-template-columns: 44px 1fr 18px; align-items: center; gap: 12px; text-align: left; padding: 14px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.learn .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(217,164,65,.12); font-size: 20px; }
.learn b { display: block; font-size: 15.5px; }
.learn small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.learn i { font-style: normal; color: var(--brass); font-size: 20px; }
@media (min-width: 860px) {
  .hero { padding: 44px 44px 40px; }
  .hero-grid { grid-template-columns: 1.1fr 1fr; align-items: center; }
  .fan { height: 260px; order: 2; }
  .fan .card { --cw: 150px; }
  .cta { grid-template-columns: 1fr 1fr; max-width: 520px; }
  .cta .link { grid-column: span 2; justify-self: start; padding-left: 0; }
  .learn { grid-template-columns: repeat(3, 1fr); }
}

/* ── Ranks ─────────────────────────────────────────────────────────────── */
.rank { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 18px; border-radius: 20px; margin-bottom: 12px; background: var(--panel); border: 1px solid var(--line); }
.rank .no { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 34px; line-height: 1; color: var(--brass); }
.rank h3 { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 26px; }
.rank .meta { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px; }
.rank p { margin: 0 0 8px; color: var(--soft); line-height: 1.55; font-size: 15px; }
.rank .ex { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-top: 10px; }
.hand { display: grid; gap: 6px; justify-items: start; }
.hand .cards { display: flex; }
.hand .cards .card { --cw: 54px; margin-right: -20px; }
.hand .cards .card:last-child { margin-right: 0; }
.hand .cap { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.ladder { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: var(--mono); font-size: 12.5px; margin: 6px 0; }
.ladder b { padding: 5px 9px; border-radius: 8px; background: var(--shade); border: 1px solid var(--line); font-weight: 600; }
.ladder i { color: var(--brass); font-style: normal; }
.var { display: grid; gap: 12px; margin-top: 12px; }
.vcard { padding: 18px; border-radius: 20px; background: var(--panel); border: 1px solid var(--line); }
.vcard h3 { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 22px; }
.vcard p { color: var(--soft); font-size: 14.5px; line-height: 1.5; margin: 6px 0 12px; }
.vcard .cards { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.vcard .cards .card { --cw: 50px; }
.vcard .arrow { color: var(--brass); font-size: 20px; padding: 0 4px; }
@media (min-width: 860px) {
  .rank { grid-template-columns: 56px 1fr; padding: 22px; }
  .rank .no { grid-row: span 2; font-size: 46px; }
  .var { grid-template-columns: repeat(3, 1fr); }
}

/* ── Win calculator ────────────────────────────────────────────────────── */
.odds { display: grid; gap: 14px; }
.seg { display: inline-flex; background: var(--shade); border: 1px solid var(--line); border-radius: 14px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 9px 12px; border-radius: 11px; color: var(--muted); font-weight: 600; font-size: 13.5px; min-height: 40px; }
.seg button[aria-pressed="true"] { background: var(--brass); color: #2a1b05; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper b { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: 40px; min-width: 2ch; text-align: center; color: var(--brass-light); }
.stepper .btn { width: 48px; padding: 0; font-size: 22px; }
.seatsdots { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 8px; }
.seatsdots i { width: 22px; height: 22px; border-radius: 50%; background: var(--tint); display: grid; place-items: center; font-style: normal; font-size: 9.5px; color: var(--muted); }
.seatsdots i.on { background: var(--cloth); box-shadow: inset 0 0 0 1px var(--jade); color: #fff; }
.seatsdots i.me { background: var(--marigold); color: #2a1b05; font-weight: 700; }
.board { display: grid; gap: 6px; margin-top: 12px; }
.board .suit { display: grid; grid-template-columns: 18px repeat(13, minmax(0, 1fr)); gap: 3px; align-items: center; }
.board .suit > svg { width: 15px; height: 15px; }
.cell { aspect-ratio: 338 / 489; border: 0; padding: 0; border-radius: 4px; background: none; position: relative; transition: transform .12s; }
.cell .card { --cw: 100%; width: 100%; }
.cell[aria-pressed="true"] { transform: translateY(-6px); }
.cell[aria-pressed="true"]::after { content: ""; position: absolute; inset: -2px; border: 2px solid var(--marigold); border-radius: 5px; }
.cell:disabled { opacity: .3; cursor: not-allowed; }
.slots { display: flex; gap: 10px; flex-wrap: wrap; margin: 6px 0; min-height: 104px; align-items: center; }
.slot { --cw: 72px; width: var(--cw); aspect-ratio: 338 / 489; border-radius: 9px; border: 2px dashed rgba(217,164,65,.38); display: grid; place-items: center; color: rgba(217,164,65,.55); font-size: 22px; background: rgba(0,0,0,.2); }
.gauge { position: relative; width: min(210px, 64vw); aspect-ratio: 1; margin: 4px auto 0; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge .num b { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(46px, 12vw, 60px); line-height: 1; }
.gauge .num span { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--muted); margin-top: 6px; }
.verdict { text-align: center; font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 26px; margin: 8px 0 2px; }
.verdict small { display: block; font-family: var(--ui); font-weight: 400; font-size: 14px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.bars { display: grid; gap: 9px; margin-top: 14px; }
.bar { display: grid; grid-template-columns: 92px 1fr 52px; gap: 10px; align-items: center; font-size: 13.5px; }
.bar > i { height: 10px; border-radius: 99px; background: var(--hair); overflow: hidden; position: relative; }
.bar > i > u { position: absolute; inset: 0 auto 0 0; border-radius: 99px; transition: width .5s cubic-bezier(.3,.8,.3,1); }
.bar b { text-align: right; font-family: var(--mono); font-weight: 600; font-size: 13px; }
.curve { margin-top: 16px; }
.curve svg { width: 100%; height: auto; display: block; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.tbl th, .tbl td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--hair); }
.tbl th { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.tbl td.n, .tbl th.n { text-align: right; font-family: var(--mono); }
@media (min-width: 900px) { .odds { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; } .board { gap: 7px; } .board .suit { gap: 4px; grid-template-columns: 22px repeat(13, minmax(0, 1fr)); } }

/* ── Rules ─────────────────────────────────────────────────────────────── */
.rules { display: grid; gap: 12px; }
.rules .panel h3 { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 22px; margin-bottom: 8px; }
.rules .panel p, .rules .panel li { color: var(--soft); font-size: 15px; line-height: 1.55; }
.rules .panel ul, .rules .panel ol { padding-left: 20px; margin: 8px 0 0; display: grid; gap: 6px; }
.rules dt { font-weight: 700; color: var(--brass-light); margin-top: 10px; }
.rules dd { margin: 2px 0 0; color: var(--soft); font-size: 14.5px; line-height: 1.5; }
@media (min-width: 860px) { .rules { grid-template-columns: repeat(2, 1fr); } }

/* ── Game screen ───────────────────────────────────────────────────────── */
#game { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(120% 70% at 50% 30%, #11313a 0%, var(--ink) 70%); }
.gtop { display: flex; align-items: center; gap: 8px; padding: calc(8px + var(--safe-t)) 10px 6px; z-index: 5; }
.gtop .room { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.gtop .room .info { font-family: var(--mono); font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.35; }
.gtop .room .info b { color: var(--ivory); font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 15px; display: block; letter-spacing: .01em; }
.stage { position: relative; flex: 1; min-height: 0; }
.felt { position: absolute; inset: 0; }
.rail { position: absolute; inset: 2% 4% 3%; border-radius: 46% / 40%;
  background: radial-gradient(90% 70% at 50% 42%, #145560 0%, var(--cloth) 45%, var(--cloth-deep) 85%, var(--cloth-edge) 100%);
  box-shadow: 0 0 0 2px rgba(217,164,65,.55), 0 0 0 9px var(--rosewood), 0 0 0 10px #8a4a2a, 0 0 0 11px rgba(217,164,65,.5), 0 26px 60px rgba(0,0,0,.75), inset 0 0 60px rgba(0,0,0,.5); }
.rail::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--jaali); background-size: 44px; background-position: center; opacity: .06; -webkit-mask: radial-gradient(closest-side, #000 55%, transparent 100%); mask: radial-gradient(closest-side, #000 55%, transparent 100%); }
.rail::after { content: ""; position: absolute; inset: 9%; border-radius: inherit; border: 1px solid rgba(217,164,65,.18); }
.center { position: absolute; left: 50%; top: 51%; transform: translate(-50%, -50%); z-index: 2; display: grid; justify-items: center; }
.plate { position: relative; width: clamp(104px, 30vw, 150px); aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: radial-gradient(circle at 40% 32%, rgba(242,210,138,.32), transparent 55%), radial-gradient(circle, #a77a24 0 60%, #6f4f12 61% 100%);
  box-shadow: 0 0 0 2px rgba(242,210,138,.6), inset 0 0 0 7px rgba(0,0,0,.18), inset 0 0 0 8px rgba(242,210,138,.35), 0 14px 26px rgba(0,0,0,.55); }
.plate::before { content: ""; position: absolute; inset: 11px; border-radius: 50%; background: var(--jaali); background-size: 22px; opacity: .28; mix-blend-mode: multiply; }
.plate > * { position: relative; }
.plate small { font-family: var(--mono); font-size: 9.5px; letter-spacing: .24em; color: #2a1b05; font-weight: 600; }
.plate .pot { font-family: var(--display); font-weight: 800; font-stretch: 75%; font-size: clamp(28px, 8vw, 40px); line-height: .95; color: #fffaf0; text-shadow: 0 2px 0 rgba(60,35,0,.55); }
.stake { margin-top: 8px; font-family: var(--mono); font-size: 10.5px; padding: 4px 10px; border-radius: 99px; background: rgba(0,0,0,.42); color: #e6efe9; white-space: nowrap; }
.stake:empty { display: none; }

/* Opponent seats */
.seat { position: absolute; transform: translate(-50%, -50%); display: grid; justify-items: center; z-index: 3; width: var(--sw, 74px); transition: opacity .3s, filter .3s; }
.seat .av { position: relative; width: var(--av, 46px); height: var(--av, 46px); border-radius: 50%; display: grid; place-items: center; font-size: calc(var(--av, 46px) * .55);
  background: radial-gradient(circle at 38% 30%, #275a62, #0b252a); box-shadow: 0 0 0 2px var(--ring, rgba(217,164,65,.55)), 0 6px 12px rgba(0,0,0,.5); }
.seat .tm { position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--marigold) var(--t, 0%), rgba(244,166,42,.18) 0); -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%); mask: radial-gradient(circle, transparent 64%, #000 66%); opacity: 0; transition: opacity .2s; }
.seat.turn .tm { opacity: 1; }
.seat.turn .av { --ring: var(--marigold); }
.seat .dlr { position: absolute; left: -6px; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: #f7f0e1; color: #2a1b05; font: 800 10px/18px var(--ui); text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,.5); }
.seat .tag { position: absolute; bottom: -7px; left: 50%; transform: translateX(-50%); font: 600 8.5px/1 var(--mono); letter-spacing: .08em; padding: 3px 5px; border-radius: 99px; background: #0b252a; color: var(--muted); box-shadow: 0 0 0 1px rgba(217,164,65,.35); white-space: nowrap; }
.seat .tag.seen { color: var(--brass-light); }
.seat .tag.packed { color: #ff9a90; box-shadow: 0 0 0 1px rgba(214,58,47,.5); }
.seat .tag.allin { color: #2a1b05; background: var(--marigold); }
.seat .tag:empty { display: none; }
.seat .np { margin-top: 11px; display: grid; justify-items: center; max-width: 100%; padding: 3px 7px 4px; border-radius: 9px; background: rgba(4, 20, 23, .78); box-shadow: inset 0 0 0 1px rgba(217,164,65,.18); }
.seat .nm { font-size: 11px; font-weight: 700; max-width: calc(var(--sw, 74px) - 10px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seat .ch { font-family: var(--mono); font-size: 10.5px; font-weight: 600; color: var(--brass-light); }
.seat .hand-mini { position: absolute; left: calc(50% + var(--av, 46px) * .32); top: calc(var(--av, 46px) * -.18); display: flex; z-index: -1; }
.seat .hand-mini .card { --cw: var(--mc, 18px); margin-left: calc(var(--mc, 18px) * -.62); transform: rotate(calc((var(--k, 0) - 1) * 9deg)); transform-origin: 50% 120%; }
.seat .hand-mini .card:first-child { margin-left: 0; }
.seat.reveal .hand-mini { position: static; margin-top: 6px; z-index: 1; }
.seat.reveal .hand-mini .card { --cw: var(--rc, 30px); transform: none; margin-left: calc(var(--rc, 30px) * -.3); }
.seat .act { position: absolute; top: calc(100% + 2px); left: 50%; transform: translateX(-50%); font: 600 10px/1 var(--mono); color: var(--brass-light); white-space: nowrap; opacity: 0; transition: opacity .3s; pointer-events: none; }
.seat .act.on { opacity: 1; }
.seat.packed, .seat.out { opacity: .4; filter: saturate(.3); }
.seat.off .av { filter: grayscale(1); opacity: .6; }
.seat.won .av { --ring: var(--brass-light); animation: glow 1.2s ease-in-out 3; }
.seat.asked .av { --ring: var(--jade); }
@keyframes glow { 50% { box-shadow: 0 0 0 3px var(--brass-light), 0 0 26px 8px rgba(242,210,138,.65); } }
.seat .say { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%) scale(.6); font-size: 22px; background: #f7f0e1; border-radius: 14px; padding: 1px 7px; opacity: 0; pointer-events: none; transition: .2s; z-index: 6; }
.seat .say.on { opacity: 1; transform: translateX(-50%) scale(1); }
.bet { position: absolute; transform: translate(-50%, -50%); z-index: 2; display: flex; align-items: center; gap: 3px; font: 600 10.5px/1 var(--mono); background: rgba(0,0,0,.45); border-radius: 99px; padding: 2px 7px 2px 2px; }
.bet .chip { width: 16px; height: 16px; }
.crowd { --av: 38px; --mc: 13px; --sw: 64px; --rc: 22px; }
.crowd .seat .tag { display: none; }
.crowd .seat .np { margin-top: 5px; }
.crowd .seat .nm::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, #6f8581); margin-right: 4px; vertical-align: 1px; }
.seat[data-st="seen"] { --dot: var(--brass-light); }
.seat[data-st="allin"] { --dot: var(--marigold); }
.seat[data-st="packed"] { --dot: var(--sindoor); }
.crowd .bet { display: none; }
.crowd .seat .np { padding: 2px 5px 3px; }
.crowd .seat .nm { font-size: 10px; }
.crowd .seat .ch { font-size: 9.5px; }
.fx { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.fx .fly { position: absolute; left: 0; top: 0; will-change: transform; }
@keyframes dealIn { from { transform: translate(var(--dx, 0), var(--dy, -120px)) scale(.5) rotate(-160deg); opacity: 0; } 60% { opacity: 1; } to { opacity: 1; } }
.dealing .card { animation: dealIn .55s cubic-bezier(.2, .85, .3, 1) both; animation-delay: calc(var(--i, 0) * var(--gap, 85ms)); }

/* Result banner (top of the table) */
.sheet { position: absolute; left: 10px; right: 10px; top: 6px; z-index: 12; max-height: calc(100% - 12px); overflow: auto; border-radius: 20px; padding: 12px 14px 14px;
  background: linear-gradient(180deg, rgba(20, 44, 50, .97), rgba(7, 22, 26, .98)); box-shadow: 0 0 0 1px rgba(217,164,65,.45), 0 20px 50px rgba(0,0,0,.6); animation: drop .45s cubic-bezier(.2,.9,.3,1); }
@keyframes drop { from { transform: translateY(-24px); opacity: 0; } }
.sheet .head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.sheet .wav { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: radial-gradient(circle at 38% 30%, #275a62, #0b252a); box-shadow: 0 0 0 2px var(--brass-light), 0 0 20px rgba(242,210,138,.45); }
.sheet h3 { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 24px; line-height: 1; }
.sheet h3 em { font-style: normal; color: var(--brass-light); }
.sheet .sub { font-size: 13px; color: var(--muted); margin-top: 3px; }
.sheet .wcards { display: flex; gap: 4px; justify-content: center; margin: 12px 0 2px; }
.sheet .wcards .card { --cw: 50px; }
.sheet .more { background: none; border: 0; color: var(--brass-light); font: 600 12px var(--mono); letter-spacing: .06em; padding: 8px 4px; }
.res { display: grid; gap: 6px; margin-top: 8px; }
.rrow { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: var(--tint); }
.rrow.win { background: rgba(217,164,65,.14); box-shadow: inset 0 0 0 1px rgba(217,164,65,.45); }
.rrow .av { font-size: 22px; text-align: center; }
.rrow .who { font-weight: 700; font-size: 13.5px; }
.rrow .who small { display: block; font-family: var(--mono); font-weight: 400; font-size: 10.5px; color: var(--muted); }
.rrow .hc { display: flex; align-items: center; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.rrow .hc .card { --cw: 32px; }
.rrow .amt { font-family: var(--mono); font-weight: 600; color: var(--brass-light); text-align: right; }
.rrow .amt.neg { color: #ff9a90; }

/* Side-show reveal (both players only) */
.peek { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 30; width: min(340px, calc(100% - 28px)); border-radius: 22px; padding: 16px; text-align: center; isolation: isolate;
  background: linear-gradient(180deg, #16363d, #08191d); box-shadow: 0 0 0 1px rgba(63,191,154,.55), 0 26px 60px rgba(0,0,0,.7); animation: pop .4s cubic-bezier(.2,.9,.3,1.2); }
@keyframes pop { from { transform: translate(-50%, -46%) scale(.94); opacity: 0; } }
.peek .lbl { color: var(--jade); }
.peek h3 { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 30px; margin: 4px 0 10px; }
.peek .vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.peek .side b { display: block; font-size: 12.5px; margin-bottom: 6px; }
.peek .side small { display: block; font-family: var(--mono); font-size: 10.5px; color: var(--muted); margin-top: 6px; }
.peek .cards { display: flex; justify-content: center; }
.peek .cards .card { --cw: 40px; margin-left: -12px; }
.peek .cards .card:first-child { margin-left: 0; }
.peek .side.lost { opacity: .5; }
.peek .x { font-family: var(--display); font-weight: 800; color: var(--brass); }

/* ── Dock: me, my cards, my moves ──────────────────────────────────────── */
.dock { position: relative; z-index: 6; padding: 4px 12px calc(12px + var(--safe-b)); display: grid; gap: 8px; justify-items: center;
  background: linear-gradient(180deg, rgba(10,20,24,0), rgba(10,20,24,.92) 26%); }
.me-row { width: 100%; max-width: 560px; display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.me-av { position: relative; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: radial-gradient(circle at 38% 30%, #275a62, #0b252a); box-shadow: 0 0 0 2px var(--ring, rgba(217,164,65,.6)); }
.me-row.turn .me-av { --ring: var(--marigold); }
.me-row .tm { position: absolute; inset: -5px; border-radius: 50%; background: conic-gradient(var(--marigold) var(--t, 0%), rgba(244,166,42,.18) 0); -webkit-mask: radial-gradient(circle, transparent 64%, #000 66%); mask: radial-gradient(circle, transparent 64%, #000 66%); opacity: 0; }
.me-row.turn .tm.on { opacity: 1; }
.me-row .dlr { position: absolute; right: -6px; bottom: -4px; width: 17px; height: 17px; border-radius: 50%; background: #f7f0e1; color: #2a1b05; font: 800 10px/17px var(--ui); text-align: center; }
.me-name { font-weight: 700; font-size: 14px; line-height: 1.2; }
.me-name small { display: block; font-family: var(--mono); font-weight: 600; font-size: 12px; color: var(--brass-light); }
.me-st { font: 600 10px/1 var(--mono); letter-spacing: .1em; padding: 6px 9px; border-radius: 99px; background: var(--shade); box-shadow: inset 0 0 0 1px var(--line); color: var(--muted); }
.turnmsg { font-size: 13px; color: var(--muted); text-align: center; min-height: 18px; line-height: 1.35; }
.turnmsg b { color: var(--ivory); }
.turnmsg .hn { font-family: var(--display); font-weight: 800; font-stretch: 80%; font-size: 17px; color: var(--brass-light); letter-spacing: .01em; }
.turnmsg.go b { color: var(--marigold); }
.mine { position: relative; display: flex; align-items: flex-end; justify-content: center; min-height: 112px; padding-top: 4px; }
.mine .card { --cw: clamp(76px, 22vw, 104px); margin: 0 calc(var(--cw) * -.08); transform: rotate(var(--rot, 0deg)) translateY(var(--lift, 0px)); transform-origin: 50% 110%; transition: transform .25s; }
.mine .card.pick:active { --lift: -6px; }
.mine.blind .card { cursor: pointer; }
.mine.blind::after { content: "Tap to look"; position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); font: 600 11px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ivory); background: rgba(0,0,0,.55); padding: 6px 10px; border-radius: 99px; pointer-events: none; }
.acts { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr 1fr 1fr 1.45fr; gap: 8px; min-height: 56px; }
.acts .btn { min-height: 56px; padding: 6px 4px; font-size: 14.5px; border-radius: 15px; }
.acts .btn.wide { grid-column: span 2; font-size: 16.5px; }
.acts .btn.full { grid-column: 1 / -1; }
.acts .btn.pack { color: #ffb0a8; background: rgba(214,58,47,.1); box-shadow: inset 0 0 0 1.5px rgba(214,58,47,.65); }
.acts .btn.alt { color: var(--ivory); background: rgba(63,191,154,.1); box-shadow: inset 0 0 0 1.5px rgba(63,191,154,.6); }
.acts .btn.up { color: var(--brass-light); background: rgba(217,164,65,.1); box-shadow: inset 0 0 0 1.5px rgba(217,164,65,.6); }
.acts .btn.look { color: var(--ivory); background: rgba(255,255,255,.06); box-shadow: inset 0 0 0 1px var(--line); }
.dock-foot { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; }
.emotes { display: flex; gap: 2px; }
.emotes button { background: none; border: 0; border-radius: 99px; width: 36px; height: 34px; font-size: 18px; opacity: .8; }
.emotes button:active { transform: scale(1.2); opacity: 1; }

/* Side-show question (to the player asked) */
.ask { position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; padding: 16px 16px calc(16px + var(--safe-b)); border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #14353b, #08191d); box-shadow: 0 -1px 0 rgba(63,191,154,.6), 0 -24px 50px rgba(0,0,0,.6); animation: up .35s cubic-bezier(.2,.9,.3,1); }
@keyframes up { from { transform: translateY(100%); } }
.ask .head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; max-width: 560px; margin: 0 auto; }
.ask .who { font-size: 28px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 38% 30%, #275a62, #0b252a); box-shadow: 0 0 0 2px var(--jade); }
.ask h3 { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 24px; line-height: 1.05; }
.ask p { margin: 4px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.ask .ring { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--mono); background: conic-gradient(var(--jade) var(--t, 100%), rgba(63,191,154,.15) 0); position: relative; }
.ask .ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #0d2a2f; }
.ask .ring span { position: relative; }
.ask .btns { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; max-width: 560px; margin: 14px auto 0; }
.ask .btns .btn { min-height: 56px; font-size: 16px; }

/* ── Lobby ─────────────────────────────────────────────────────────────── */
.lobby { flex: 1; overflow: auto; padding: 6px 14px calc(24px + var(--safe-b)); }
.lobby .wrap { max-width: 860px; margin: 0 auto; display: grid; gap: 14px; }
.seatsgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lseat { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px; background: var(--tint); border: 1px solid rgba(217,164,65,.22); min-height: 60px; text-align: left; color: var(--ivory); }
.lseat .av { font-size: 24px; }
.lseat b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100px; }
.lseat small { font-family: var(--mono); font-size: 10px; color: var(--muted); display: block; }
.lseat.empty { border-style: dashed; color: rgba(247,240,225,.28); justify-content: center; font-size: 12.5px; }
.lseat.pending { border-color: rgba(244,166,42,.6); background: rgba(244,166,42,.07); cursor: pointer; }
.lseat.off { opacity: .55; }
.settings { display: grid; gap: 12px; }
.lobby .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; bottom: 0; padding: 10px 0 4px; background: linear-gradient(180deg, transparent, var(--ink) 30%); }
.lobby .actions .btn { min-height: 52px; }
.lobby .actions .btn.green { grid-column: 1 / -1; min-height: 58px; font-size: 17px; }
.codebox { display: grid; gap: 8px; }
.codebox .code { font-family: var(--mono); font-size: 11px; line-height: 1.4; background: var(--field); border: 1px dashed rgba(217,164,65,.5); border-radius: 12px; padding: 10px 12px; word-break: break-all; max-height: 92px; overflow: auto; user-select: all; }
.steps { counter-reset: s; display: grid; gap: 14px; padding: 0; margin: 0; list-style: none; }
.steps > li { counter-increment: s; display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: start; font-size: 14.5px; line-height: 1.45; }
.steps > li::before { content: counter(s); width: 28px; height: 28px; border-radius: 50%; background: var(--brass); color: #2a1b05; font-weight: 800; display: grid; place-items: center; font-size: 13px; }
@media (min-width: 700px) { .seatsgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } .settings { grid-template-columns: repeat(3, 1fr); } .lobby .actions { grid-template-columns: auto auto 1fr; } .lobby .actions .btn.green { grid-column: auto; } }

/* ── Modal & toast ─────────────────────────────────────────────────────── */
.scrim { position: fixed; inset: 0; z-index: 80; display: grid; align-items: end; justify-items: center; background: rgba(0,0,0,.6); backdrop-filter: blur(3px); }
.modal { width: min(560px, 100%); max-height: 92vh; overflow: auto; background: linear-gradient(180deg, #13323a, #0a1a1e); border-top: 1px solid rgba(217,164,65,.45); border-radius: 24px 24px 0 0; padding: 20px 18px calc(20px + var(--safe-b)); box-shadow: 0 -30px 60px rgba(0,0,0,.6); display: grid; gap: 14px; animation: up .3s cubic-bezier(.2,.9,.3,1); }
.modal h2 { font-family: var(--display); font-weight: 800; font-stretch: 78%; font-size: 28px; line-height: 1; }
.modal p { margin: 0; color: var(--soft); font-size: 14.5px; line-height: 1.55; }
@media (min-width: 700px) { .scrim { align-items: center; padding: 16px; } .modal { border-radius: 24px; border: 1px solid rgba(217,164,65,.35); } }
.toast { position: fixed; left: 50%; top: calc(64px + var(--safe-t)); transform: translateX(-50%); z-index: 90; background: var(--ivory); color: #14211f; padding: 10px 16px; border-radius: 14px; font-weight: 600; font-size: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.5); max-width: 90vw; text-align: center; animation: toastIn .3s ease-out; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 95; pointer-events: none; }

@media (min-width: 900px) {
  #game { --av: 58px; --mc: 26px; --sw: 116px; --rc: 38px; }
  .crowd { --av: 48px; --mc: 22px; --sw: 100px; --rc: 32px; }
  .crowd .bet { display: flex; }
  .crowd .seat .tag { display: inline-block; }
  .crowd .seat .np { margin-top: 11px; }
  .crowd .seat .nm::before { display: none; }
  .seat .nm { font-size: 13px; }
  .seat .ch { font-size: 12px; }
  .rail { inset: 4% 7% 4%; border-radius: 50%; }
  .mine { min-height: 150px; }
  .sheet { left: 50%; right: auto; width: 520px; transform: translateX(-50%); }
  @keyframes drop { from { transform: translate(-50%, -24px); opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.chk { display: grid; grid-template-columns: 26px 1fr; gap: 12px; align-items: start; padding: 12px 14px; border-radius: 14px; background: var(--shade); border: 1px solid var(--line); font-size: 15px; line-height: 1.4; cursor: pointer; }
.chk input { width: 22px; height: 22px; accent-color: var(--brass); margin: 0; }
.legalnote { max-width: 560px; margin: 18px auto 0; text-align: center; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.legalnote b { color: var(--ivory); }
.agepill { font-family: var(--mono); font-weight: 600; font-size: 11px; letter-spacing: .1em; color: #2a1b05; background: var(--marigold); border-radius: 99px; padding: 4px 9px; }

/* ── Themes ─────────────────────────────────────────────────────────────────
   theme.js sets data-theme to "light" or "dark" from the device, or from the player's choice.
   The table, the hero and the nameplates are always dark teal; the light theme changes the
   page, panels, sheets and the dock around them. */
.hero { --ivory: #f7f0e1; --muted: #b4c7c2; --line: rgba(217,164,65,.22); --brass-light: #f2d28a; --soft: #cfdcd8; --tint: rgba(255,255,255,.05); --shade: rgba(0,0,0,.28); }
#felt { color: #f7f0e1; }
.theme-opt { display: grid; grid-template-columns: 44px 1fr 22px; gap: 12px; align-items: center; width: 100%; text-align: left; padding: 12px 14px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line); color: var(--ivory); }
.theme-opt .sw { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; box-shadow: inset 0 0 0 1px var(--line); }
.theme-opt .sw.sys { background: linear-gradient(90deg, #f6f0e2 50%, #0a1418 50%); }
.theme-opt .sw.lt { background: #f6f0e2; }
.theme-opt .sw.dk { background: #0a1418; }
.theme-opt b { display: block; font-size: 15.5px; }
.theme-opt small { color: var(--muted); font-size: 13px; }
.theme-opt .tick { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); }
.theme-opt[aria-checked="true"] { border-color: var(--marigold); box-shadow: 0 0 0 2px var(--marigold); }
.theme-opt[aria-checked="true"] .tick { background: var(--marigold); border-color: var(--marigold); box-shadow: inset 0 0 0 4px var(--ink); }

html[data-theme="light"] { color-scheme: light; --ink: #f6f0e2; --ivory: #12282d; --muted: #4f6469; --line: rgba(14,59,67,.24); --panel: rgba(255,255,255,.9); --brass-light: #8a5f10; --soft: #34494e; --shade: rgba(14,59,67,.07); --tint: rgba(14,59,67,.05); --hair: rgba(14,59,67,.12); --field: #fff; --c-gold: #94650f; --c-green: #0f7a55; --c-amber: #a9600c; --c-red: #bf2f39; }
html[data-theme="dark"] { color-scheme: dark; }
html[data-theme="light"] body { background: radial-gradient(900px 520px at 50% -8%, #fffdf6, transparent 70%), var(--ink); }
html[data-theme="light"] .top { background: rgba(246,240,226,.92); }
html[data-theme="light"] .btn.ghost, html[data-theme="light"] .btn.teal { box-shadow: inset 0 0 0 1px rgba(14,59,67,.3); }
html[data-theme="light"] .btn { box-shadow: 0 1px 0 rgba(255,255,255,.6) inset, 0 -2px 0 rgba(0,0,0,.14) inset, 0 8px 16px -8px rgba(60,40,0,.45); }
html[data-theme="light"] .avatars button { background: #fff; }
html[data-theme="light"] .seatsdots i.on { color: #fff; }
html[data-theme="light"] .slot { background: rgba(255,255,255,.6); }
html[data-theme="light"] .rank, html[data-theme="light"] .vcard, html[data-theme="light"] .panel, html[data-theme="light"] .learn button, html[data-theme="light"] .learn a { box-shadow: 0 10px 24px -18px rgba(14,59,67,.5); }
html[data-theme="light"] #game { background: radial-gradient(120% 70% at 50% 30%, #fffdf7 0%, #efe6d0 78%); }
html[data-theme="light"] .dock { background: linear-gradient(180deg, rgba(246,240,226,0), rgba(246,240,226,.96) 26%); }
html[data-theme="light"] .sheet, html[data-theme="light"] .peek { background: linear-gradient(180deg, #fffdf7, #f3ead6); box-shadow: 0 0 0 1px rgba(14,59,67,.28), 0 20px 50px rgba(14,59,67,.35); }
html[data-theme="light"] .ask { background: linear-gradient(180deg, #fffdf7, #f1e8d3); box-shadow: 0 -1px 0 rgba(15,122,85,.6), 0 -24px 50px rgba(14,59,67,.3); }
html[data-theme="light"] .ask .ring::before { background: #fffdf7; }
html[data-theme="light"] .modal { background: linear-gradient(180deg, #fffdf7, #f1e8d3); border-top-color: rgba(14,59,67,.3); box-shadow: 0 -30px 60px rgba(14,59,67,.3); }
html[data-theme="light"] .scrim { background: rgba(14,40,46,.5); }
html[data-theme="light"] .rrow.win { background: rgba(217,164,65,.2); box-shadow: inset 0 0 0 1px rgba(160,110,20,.5); }
html[data-theme="light"] .rrow .amt { color: #8a5f10; }
html[data-theme="light"] .rrow .amt.neg { color: #bf2f39; }
html[data-theme="light"] .sheet h3 em, html[data-theme="light"] .sheet .more { color: #8a5f10; }
html[data-theme="light"] .acts .btn.pack { color: #b3261c; background: rgba(214,58,47,.08); box-shadow: inset 0 0 0 1.5px rgba(179,38,28,.7); }
html[data-theme="light"] .acts .btn.alt { background: rgba(15,122,85,.1); box-shadow: inset 0 0 0 1.5px rgba(15,122,85,.65); }
html[data-theme="light"] .acts .btn.up { color: #7a5410; background: rgba(185,133,42,.14); box-shadow: inset 0 0 0 1.5px rgba(138,95,16,.7); }
html[data-theme="light"] .acts .btn.look { background: rgba(14,59,67,.06); box-shadow: inset 0 0 0 1px rgba(14,59,67,.3); }
html[data-theme="light"] .lseat.empty { color: rgba(14,59,67,.38); }
html[data-theme="light"] .lseat { background: rgba(255,255,255,.7); }
html[data-theme="light"] .lseat.pending { background: rgba(244,166,42,.14); }
html[data-theme="light"] .toast { background: #12282d; color: #f7f0e1; }
html[data-theme="light"] .turnmsg b { color: #12282d; }
html[data-theme="light"] .turnmsg.go b { color: #a9600c; }
html[data-theme="light"] .mine.blind::after { background: rgba(14,40,46,.78); color: #f7f0e1; }
html[data-theme="light"] .tab[aria-selected="true"], html[data-theme="light"] .seg button[aria-pressed="true"] { color: #2a1b05; }
html[data-theme="light"] .gtop .room .info { color: var(--muted); }
html[data-theme="light"] .brand small { color: var(--muted); }
html[data-theme="light"] .peek .x { color: #8a5f10; }
html[data-theme="light"] .peek .lbl { color: #0f7a55; }
html[data-theme="light"] .steps > li::before { color: #2a1b05; }
html[data-theme="light"] .legalnote b { color: #12282d; }

.bigcode { font-family: var(--mono); font-weight: 600; font-size: clamp(26px, 8vw, 36px); letter-spacing: .14em; text-align: center; padding: 16px 10px; border-radius: 16px; background: var(--field); border: 1.5px dashed rgba(217,164,65,.6); color: var(--ivory); user-select: all; -webkit-user-select: all; }
input.codein { font-family: var(--mono); font-size: 20px; letter-spacing: .12em; text-transform: uppercase; }
input.codein::placeholder { text-transform: none; letter-spacing: .08em; opacity: .45; }

.hostn { color: var(--brass-light); font-weight: 600; }
.namebtn { background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; line-height: 1.2; }
.namebtn i { font-style: normal; color: var(--muted); font-size: 12px; }
.namebtn small { display: block; font-family: var(--mono); font-weight: 600; font-size: 12px; color: var(--brass-light); }
.who-av { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 34px; background: radial-gradient(circle at 38% 30%, #275a62, #0b252a); box-shadow: 0 0 0 2px rgba(217,164,65,.6); }
.seat { cursor: pointer; }

.msrxbar { display: flex; align-items: center; justify-content: center; gap: 8px; padding: calc(7px + var(--safe-t)) 14px 7px; background: #07110f; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 12.5px; text-decoration: none; text-align: center; }
.msrxbar b { color: var(--brass-light); letter-spacing: .08em; }
.msrxbar u { color: var(--ivory); text-decoration-color: var(--brass); text-underline-offset: 3px; }
.msrxbar i { font-style: normal; color: var(--brass); }
.msrxbar:hover u, .msrxbar:focus-visible u { color: var(--brass-light); }
.top { top: 0; }
.msrxcta { display: grid; grid-template-columns: 40px 1fr 18px; align-items: center; gap: 12px; max-width: 520px; margin: 0 auto 20px; padding: 14px; text-align: left; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); text-decoration: none; color: var(--ivory); }
.msrxcta img { border-radius: 10px; }
.msrxcta b { display: block; font-size: 15.5px; }
.msrxcta small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.msrxcta i { font-style: normal; color: var(--brass); font-size: 20px; }
.msrxcta:hover { border-color: var(--brass); }
html[data-theme="light"] .msrxbar { background: #e9efec; }
html[data-theme="light"] .msrxbar b { color: #8a5a10; }
html[data-theme="light"] .msrxbar u, html[data-theme="light"] .msrxcta { color: #12282d; }
