/* Pocket-Games: "Fog Purple" theme. Deep indigo night, drifting violet fog, classic casino accents
   (felt green, card red, chip gold, ivory) on frosted-glass panels. */
:root {
  --bg: #0d0a1c; --bg-2: #1a1233; --ink: #2a1b4a;
  --glass: rgba(42, 27, 74, .42); --glass-2: rgba(58, 40, 102, .55); --line: rgba(185, 166, 255, .16); --line-2: rgba(185, 166, 255, .32);
  --violet: #8a6cff; --lav: #c3b4ff; --glow: rgba(138, 108, 255, .45);
  --felt: #0f5c3a; --felt-2: #0a432a; --felt-hi: #16784d;
  --gold: #d4af37; --gold-hi: #f1d77a; --gold-lo: #9c7c1e;
  --red: #c8102e; --red-hi: #e8344f; --black: #141018; --ivory: #f5f1e6;
  --text: #f3efff; --muted: #a99fc9; --good: #e9c75b; --bad: #ff7a6b; --warn: #f0b429;
  --r: 16px; --tap: 52px;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px); --sar: env(safe-area-inset-right, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); font: 16px/1.45 var(--font); padding-bottom: calc(24px + var(--sab)); overscroll-behavior-y: none;
  background: radial-gradient(120% 70% at 50% -10%, #2a1b4a 0%, #160f2c 45%, var(--bg) 80%) fixed; }
a { color: var(--lav); }
h2 { font: 700 1.3rem/1.2 var(--display); margin: 20px 0 8px; letter-spacing: .2px; color: var(--text); }
h3 { font: 600 1.05rem/1.25 var(--display); margin: 18px 0 6px; color: var(--lav); }
p { margin: 6px 0; }
.muted { color: var(--muted); font-size: .9rem; }
.center { text-align: center; }
.brand { white-space: nowrap; }
.pos { color: var(--good); } .neg { color: var(--bad); } .warn { color: var(--warn); }
em { font-style: normal; }

/* Drifting fog */
.fog { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fog i { position: absolute; width: 140vw; height: 60vh; border-radius: 50%; filter: blur(60px); opacity: .5; }
.fog i:nth-child(1) { top: -10vh; left: -30vw; background: radial-gradient(closest-side, rgba(138,108,255,.35), transparent); animation: drift 38s ease-in-out infinite alternate; }
.fog i:nth-child(2) { top: 35vh; right: -50vw; background: radial-gradient(closest-side, rgba(195,120,255,.22), transparent); animation: drift 46s ease-in-out infinite alternate-reverse; }
.fog i:nth-child(3) { bottom: -20vh; left: -20vw; background: radial-gradient(closest-side, rgba(90,70,200,.28), transparent); animation: drift 54s ease-in-out infinite alternate; }
@keyframes drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(12vw,6vh,0) scale(1.15); } }

/* Top navigation */
.topnav { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 4px;
  padding: calc(6px + var(--sat)) calc(8px + var(--sar)) 6px calc(8px + var(--sal)); background: rgba(13,10,28,.72); border-bottom: 1px solid var(--line); -webkit-backdrop-filter: blur(18px) saturate(140%); backdrop-filter: blur(18px) saturate(140%); }
.topnav h1 { margin: 0; font: 700 1.05rem var(--display); text-align: center; letter-spacing: 1.5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body[data-game="home"] .topnav h1 { letter-spacing: .45px; }
  background: linear-gradient(90deg, var(--gold-hi), var(--lav)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-btn { min-width: var(--tap); min-height: 46px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: none; border: 0; color: var(--text); text-decoration: none; font-size: .68rem; padding: 2px 8px; border-radius: 12px; }
.nav-btn .ico { font-size: 1.25rem; line-height: 1.1; }
#nav-home { background: var(--glass); border: 1px solid var(--line-2); color: var(--gold-hi); }
#view { padding: 10px calc(14px + var(--sar)) 0 calc(14px + var(--sal)); max-width: 560px; margin: 0 auto; outline: none; animation: rise .22s ease-out; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 10px 16px; border-radius: var(--r); border: 1px solid var(--line-2); font: 700 1rem/1.1 var(--font); text-decoration: none; cursor: pointer; color: var(--text); background: var(--glass-2); text-align: center; touch-action: manipulation; user-select: none; transition: transform .08s, box-shadow .2s; }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .38; pointer-events: none; }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: #241a02; border-color: rgba(255,240,190,.5); box-shadow: 0 6px 20px rgba(212,175,55,.25); }
.btn.red { background: linear-gradient(180deg, var(--red-hi), var(--red) 60%, #8d0b20); border-color: rgba(255,180,190,.35); box-shadow: 0 6px 22px rgba(200,16,46,.35); }
.btn.green { background: linear-gradient(180deg, var(--felt-hi), var(--felt) 60%, var(--felt-2)); border-color: rgba(160,255,200,.25); }
.btn.ghost { background: transparent; border-color: var(--line-2); }
.btn.danger { background: rgba(200,16,46,.22); border-color: rgba(255,122,107,.45); color: #ffd3cc; }
.btn.big { min-height: 56px; width: 100%; }
.btn.huge { min-height: 64px; width: 100%; font-size: 1.15rem; letter-spacing: 1.5px; margin: 10px 0; }
.btn.wide { width: 100%; margin: 8px 0; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: .9rem; }
.link { background: none; border: 0; color: var(--lav); font: inherit; min-height: 44px; padding: 0 6px; }
.row { display: flex; align-items: center; } .row.gap { gap: 8px; margin: 8px 0; } .row.wrap { flex-wrap: wrap; } .row > .btn { flex: 1; }

/* Glass surfaces */
.statbar > div, .kv > div, .hist li, .bubble, .callout, details.rules, .betlist, .stratbar, .strat-card, .step, .result, .game-card, .pill, .sheet-panel, .hero {
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }

/* Home */
.hero { text-align: center; padding: 18px 12px 14px; margin: 4px 0 14px; border-radius: 22px; background: linear-gradient(160deg, rgba(138,108,255,.22), rgba(42,27,74,.35)); border: 1px solid var(--line); }
.hero h2 { margin: 6px 0 4px; font-size: 1.6rem; white-space: nowrap; background: linear-gradient(90deg, var(--gold-hi), #fff 50%, var(--lav)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); margin: 0; font-size: .92rem; }
.hero-mark { letter-spacing: 8px; font-size: 1.1rem; color: var(--lav); } .hero-mark::first-letter { color: var(--lav); }
.game-card { position: relative; overflow: hidden; border-radius: 22px; padding: 16px; margin-bottom: 14px; background: var(--glass); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.game-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, transparent, var(--accent, var(--gold)), transparent); }
.game-card.bj { --accent: var(--felt-hi); } .game-card.rl { --accent: var(--red-hi); } .game-card.cr { --accent: var(--gold); } .game-card.mj { --accent: #e7c56a; }
.mj-icon { background: linear-gradient(160deg, #fffdf8, #f3e2b0); color: #8e1228; font: 800 .95rem/1 var(--display); letter-spacing: .5px; }
.gc-head { display: flex; align-items: center; gap: 12px; }
.gc-head h2 { margin: 0; font-size: 1.5rem; }
.gc-icon { font-size: 1.6rem; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: var(--ivory); background: radial-gradient(circle at 35% 30%, var(--felt-hi), var(--felt-2)); border: 2px solid var(--gold); box-shadow: 0 0 18px var(--glow); }
.wheel-icon { background: conic-gradient(var(--red) 0 10%, var(--black) 0 20%, var(--red) 0 30%, var(--black) 0 40%, var(--felt) 0 45%, var(--red) 0 55%, var(--black) 0 65%, var(--red) 0 75%, var(--black) 0 85%, var(--red) 0 95%, var(--felt) 0); }
.gc-sub { color: var(--muted); font-size: .9rem; margin: 8px 0 12px; }
.gc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gc-actions .btn { min-height: 54px; }
.settings-link { display: block; text-align: center; padding: 14px; color: var(--muted); }

/* Sub tabs */
.subtabs { display: flex; gap: 4px; margin: 2px 0 12px; padding: 4px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); }
.subtabs a, .subtabs button { flex: 1; min-height: 44px; display: grid; place-items: center; border-radius: 11px; background: none; color: var(--muted); text-decoration: none; border: 0; font: 600 .9rem var(--font); }
.subtabs .on { background: linear-gradient(180deg, rgba(138,108,255,.55), rgba(90,64,190,.55)); color: #fff; box-shadow: 0 0 16px var(--glow); }
.subtabs button { color: #ffc2b8; flex: .7; }

/* Shared */
.statbar { display: flex; gap: 6px; margin-bottom: 10px; }
.statbar > div { flex: 1; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 7px 4px; text-align: center; }
.statbar b { display: block; font: 700 1.1rem var(--display); font-variant-numeric: tabular-nums; } .statbar span { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.felt { position: relative; background: radial-gradient(130% 100% at 50% 0%, var(--felt-hi), var(--felt) 45%, var(--felt-2)); border: 2px solid rgba(212,175,55,.65); border-radius: 26px; box-shadow: inset 0 0 0 6px rgba(0,0,0,.18), inset 0 0 40px rgba(0,0,0,.35), 0 12px 30px rgba(0,0,0,.45), 0 0 40px rgba(138,108,255,.15); padding: 12px; margin: 8px 0; }
.pill { padding: 9px 12px; border-radius: 12px; font-weight: 600; margin: 6px 0; font-size: .9rem; }
.pill ul { margin: 6px 0; padding-left: 18px; font-weight: 400; }
.pill.warn { background: rgba(240,180,41,.12); color: #ffd98a; border: 1px solid rgba(240,180,41,.4); }
.pill.good { background: rgba(233,199,91,.12); color: var(--good); border: 1px solid rgba(233,199,91,.4); }
.pill.bad { background: rgba(255,122,107,.12); color: var(--bad); border: 1px solid rgba(255,122,107,.4); }
.pill.info { background: rgba(138,108,255,.16); color: var(--lav); border: 1px solid var(--line-2); }
.pill.big { font-size: 1rem; padding: 12px; }
.bubble { border-radius: 18px; padding: 12px 14px; margin: 10px 0; background: var(--glass-2); border: 1px solid var(--line); border-left: 5px solid var(--violet); animation: pop .2s ease-out; }
.bubble.good { border-left-color: var(--good); box-shadow: 0 0 24px rgba(233,199,91,.12); } .bubble.bad { border-left-color: var(--bad); } .bubble.warn { border-left-color: var(--warn); } .bubble.info { border-left-color: var(--violet); }
.bubble-head { font: 800 1.15rem var(--display); }
.bubble.good .bubble-head { color: var(--good); } .bubble.bad .bubble-head { color: var(--bad); } .bubble.warn .bubble-head { color: var(--warn); }
.cost { color: #ffd3cc; font-size: .92rem; }
details.math { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 6px; }
details.math summary { color: var(--lav); font-weight: 700; min-height: 32px; display: flex; align-items: center; }
.tip { color: var(--lav); font-size: .92rem; border-top: 1px dashed var(--line); padding-top: 6px; margin-top: 8px; }
.callout { background: linear-gradient(160deg, rgba(212,175,55,.12), rgba(42,27,74,.4)); border: 1px solid rgba(212,175,55,.4); border-radius: 14px; padding: 11px 13px; margin: 10px 0; }
.tbl { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .9rem; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 8px 6px; text-align: left; vertical-align: top; }
.tbl th { color: var(--lav); font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 8px 0; }
.kv > div { background: var(--glass); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.kv span { display: block; font-size: .74rem; color: var(--muted); } .kv b { font-size: .98rem; font-variant-numeric: tabular-nums; }
.hist { list-style: none; padding: 0; margin: 6px 0; }
.hist li { padding: 10px 11px; border-radius: 12px; background: var(--glass); margin-bottom: 6px; font-size: .9rem; border: 1px solid var(--line); border-left: 4px solid var(--line-2); }
.hist li.correct { border-left-color: var(--good); } .hist li.incorrect { border-left-color: var(--bad); }
.hist .num { color: var(--muted); }
.mini { display: inline-block; background: var(--ivory); color: #111; border-radius: 5px; padding: 0 4px; margin-right: 2px; font-weight: 700; }
.mini.red { color: var(--red); }
details.rules { margin: 10px 0; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
details.rules summary { font-weight: 700; color: var(--lav); min-height: 32px; }
select, input[type=number] { font: inherit; font-size: 16px; min-height: 44px; border-radius: 12px; background: rgba(13,10,28,.6); color: var(--text); border: 1px solid var(--line-2); padding: 6px 10px; }
label { color: var(--muted); font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
label.field { display: flex; justify-content: space-between; margin: 10px 0 6px; color: var(--text); } label.field input, label.field select { width: 46%; }
label.field.half { flex: 1; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; } label.field.half input { width: 100%; }
label.toggle { display: flex; min-height: 50px; color: var(--text); font-size: 1rem; }
label.toggle input { width: 24px; height: 24px; accent-color: var(--violet); }
.small-controls { margin-top: 12px; }
.page { padding-bottom: 24px; }
.page ol, .page ul { padding-left: 20px; } .page li { margin: 4px 0; }
.ruleline { columns: 2; font-size: .85rem; color: var(--muted); }

/* Sit-down */
.pickrow { display: flex; gap: 6px; margin: 4px 0 6px; }
.pk { flex: 1; min-height: 44px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text); font: 700 .95rem var(--font); }
.pk.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #241a02; border-color: transparent; }
.limits { text-align: center; color: var(--muted); font-size: .82rem; margin: 0 0 6px; letter-spacing: .3px; }

/* Blackjack */
.bj-felt { text-align: center; padding-top: 14px; }
.felt-arc { font: 600 .66rem var(--font); letter-spacing: 1.6px; text-transform: uppercase; color: rgba(241,215,122,.75); margin: 2px 0 8px; }
.hand-label { color: #d9f1e3; font-size: .9rem; margin: 2px 0; } .hand-label b { color: var(--gold-hi); font-size: 1.15rem; }
.cards { display: flex; justify-content: center; gap: 10px; margin: 6px 0 8px; }
.card { position: relative; width: 82px; height: 116px; border-radius: 11px; background: linear-gradient(160deg, #fffdf6, var(--ivory)); color: #141018; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 14px rgba(0,0,0,.45); font-weight: 800; }
.fresh .card { animation: deal .32s cubic-bezier(.2,.8,.3,1.2) both; animation-delay: calc(var(--i) * 70ms); }
.card .cr { position: absolute; top: 6px; left: 8px; font-size: 1.3rem; line-height: 1; } .card .cr2 { position: absolute; bottom: 6px; right: 8px; font-size: 1.3rem; line-height: 1; transform: rotate(180deg); }
.card .cs { font-size: 2.6rem; line-height: 1; }
.card.red { color: var(--red); }
.card.back { background: repeating-linear-gradient(45deg, #3a2470 0 6px, #2a1b4a 6px 12px); border: 5px solid var(--ivory); }
.card.back::after { content: "♠"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--gold); font-size: 1.6rem; opacity: .8; }
.bj-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.bj-actions.n3 .act:last-child, .bj-actions.n5 .act:last-child { grid-column: span 2; }
.btn.act { min-height: 64px; font-size: 1.12rem; letter-spacing: 1px; }
.btn.act.hit { background: linear-gradient(180deg, var(--felt-hi), var(--felt) 60%, var(--felt-2)); }
.btn.act.stand { background: linear-gradient(180deg, var(--red-hi), var(--red) 60%, #8d0b20); }
.btn.act.double { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-lo)); color: #241a02; }
.btn.act.split { background: linear-gradient(180deg, #9d84ff, var(--violet) 60%, #5b3fd0); }
.btn.act.surrender { background: rgba(255,255,255,.07); }
.chart-scroll { overflow-x: auto; margin: 0 -4px; }
.chart { border-collapse: separate; border-spacing: 2px; font-size: .78rem; width: 100%; }
.chart th { color: var(--lav); font-weight: 700; padding: 3px; }
.chart td { text-align: center; padding: 6px 0; border-radius: 6px; font-weight: 800; min-width: 26px; }
.c-h { background: rgba(200,16,46,.55); } .c-s { background: rgba(212,175,55,.75); color: #241a02; } .c-d, .c-ds { background: rgba(138,108,255,.75); }
.c-p { background: var(--felt-hi); } .c-rh, .c-rs, .c-rp { background: rgba(255,255,255,.85); color: #141018; }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: .78rem; color: var(--muted); margin: 8px 0; }
.legend i { display: inline-block; min-width: 26px; text-align: center; border-radius: 5px; margin-right: 6px; font-style: normal; font-weight: 800; color: #fff; }
.legend i.c-s, .legend i.c-rh, .legend i.c-rs, .legend i.c-rp { color: #141018; }

/* Roulette */
.stratbar { background: var(--glass-2); border: 1px solid rgba(212,175,55,.45); border-radius: 16px; padding: 10px 12px; margin: 6px 0; font-size: .92rem; }
.sb-top { display: flex; justify-content: space-between; align-items: center; color: var(--gold-hi); }
.result { display: flex; gap: 12px; align-items: center; background: var(--glass-2); border-radius: 16px; padding: 10px; margin: 8px 0; border: 1px solid var(--line); animation: pop .22s ease-out; }
.result .ball { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font: 800 1.7rem var(--display); border: 3px solid var(--gold); flex: none; box-shadow: 0 0 20px var(--glow); }
.result.red .ball, .ballmini.red { background: var(--red); } .result.black .ball, .ballmini.black { background: var(--black); } .result.green .ball, .ballmini.green { background: var(--felt); }
.wheel { position: relative; width: 64px; height: 64px; border-radius: 50%; flex: none; border: 3px solid var(--gold); animation: spin 1.1s cubic-bezier(.2,.6,.3,1) both;
  background: conic-gradient(var(--felt) 0 2.6%, var(--red) 0 7.9%, var(--black) 0 13.2%, var(--red) 0 18.4%, var(--black) 0 23.7%, var(--red) 0 28.9%, var(--black) 0 34.2%, var(--red) 0 39.5%, var(--black) 0 44.7%, var(--red) 0 50%, var(--felt) 0 52.6%, var(--black) 0 57.9%, var(--red) 0 63.2%, var(--black) 0 68.4%, var(--red) 0 73.7%, var(--black) 0 78.9%, var(--red) 0 84.2%, var(--black) 0 89.5%, var(--red) 0 94.7%, var(--black) 0); }
.ballspin { position: absolute; top: 4px; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: #fff; box-shadow: 0 0 6px #fff; }
.rdet { font-size: .9rem; } .rdet .big { font: 800 1.2rem var(--display); }
.ballmini { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 800; font-size: .8rem; margin-right: 4px; }
.seg { display: flex; background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 3px; gap: 3px; margin-top: 8px; }
.seg button { flex: 1; min-height: 44px; border: 0; border-radius: 11px; background: none; color: var(--muted); font: 600 .8rem var(--font); }
.seg button.on { background: linear-gradient(180deg, rgba(138,108,255,.6), rgba(90,64,190,.6)); color: #fff; }
.hint { font-size: .84rem; color: var(--muted); margin: 6px 2px; } .hint.bad { color: var(--bad); }
.rl-felt { padding: 8px; }
.zeros { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 4px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.num { position: relative; min-height: 44px; border: 1px solid rgba(255,255,255,.22); border-radius: 9px; font: 800 1.05rem var(--display); color: #fff; touch-action: manipulation; }
.num.red { background: linear-gradient(180deg, var(--red-hi), var(--red)); } .num.black { background: linear-gradient(180deg, #2a2430, var(--black)); } .num.green { background: linear-gradient(180deg, var(--felt-hi), var(--felt)); }
.num.cov { box-shadow: inset 0 0 0 3px var(--gold); }
.num.sel { outline: 3px solid var(--lav); outline-offset: -3px; transform: scale(.95); }
.num.last { box-shadow: 0 0 0 3px #fff, 0 0 16px var(--glow), inset 0 0 0 3px var(--gold); }
.cols, .dozens { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin-top: 4px; }
.evens { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 4px; }
.outside { position: relative; min-height: 48px; border: 1px solid rgba(241,215,122,.45); border-radius: 9px; background: rgba(0,0,0,.18); color: #fff; font: 700 .85rem var(--font); padding: 2px; touch-action: manipulation; }
.dia { display: inline-block; width: 18px; height: 18px; transform: rotate(45deg); } .dia.red { background: var(--red); } .dia.black { background: #000; border: 1px solid #888; }
.chip-badge { position: absolute; top: -7px; right: -5px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--gold); color: #241a02; font: 800 .7rem/18px var(--font); font-style: normal; padding: 0 4px; border: 2px solid #fff; z-index: 2; }
.chips { display: flex; justify-content: space-between; gap: 6px; margin: 12px 0; }
.chip { width: 52px; height: 52px; border-radius: 50%; border: 4px dashed rgba(255,255,255,.8); font: 800 .85rem var(--font); color: #fff; background: #555; flex: none; touch-action: manipulation; box-shadow: inset 0 0 0 3px rgba(0,0,0,.18), 0 4px 10px rgba(0,0,0,.4); transition: transform .12s; }
.chip.c1 { background: #e9e5f5; color: #222; } .chip.c5 { background: var(--red); } .chip.c10 { background: #3c64c8; } .chip.c25 { background: var(--felt-hi); } .chip.c50 { background: #d4772b; } .chip.c100 { background: #141018; }
.craps .chip { background: var(--ink); }
.chip.on { transform: translateY(-5px); box-shadow: 0 0 0 3px var(--gold), 0 0 18px var(--glow), 0 8px 12px rgba(0,0,0,.5); }
.betlist { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 6px 10px; }
.betrow { display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.betrow span { flex: 1; } .betrow.total { border: 0; font-weight: 700; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--glass-2); color: var(--text); font-size: 1.3rem; }
.strat-card { display: flex; flex-direction: column; gap: 2px; padding: 14px; margin: 8px 0; border-radius: 16px; background: var(--glass); border: 1px solid var(--line-2); color: var(--text); text-decoration: none; min-height: 60px; }
.strat-card b { font-family: var(--display); font-size: 1.02rem; } .strat-card span { color: var(--muted); font-size: .86rem; }
.config { margin: 8px 0; } .config label { margin: 6px 0; }
.midpick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 6px 0; } .midpick span { width: 100%; color: var(--muted); font-size: .9rem; }
.mn { width: 48px; height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--glass); color: var(--text); font-weight: 700; }
.mn.on { background: var(--gold); color: #241a02; }
.keypad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.keypad .num:nth-child(1), .keypad .num:nth-child(2) { grid-column: span 3; }

/* Craps */
.cr-felt { position: relative; padding: 10px; }
.points { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 12px; }
.pbox { position: relative; border: 2px solid rgba(255,255,255,.65); border-radius: 8px; text-align: center; padding: 10px 0; font: 800 .9rem var(--display); color: #fff; }
.pbox.on { background: rgba(212,175,55,.22); border-color: var(--gold); }
.puck { position: absolute; top: -16px; right: -6px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 800 .62rem var(--font); font-style: normal; background: #fff; color: #111; border: 3px solid #111; }
.puck.off { position: absolute; top: 4px; right: 8px; background: #111; color: #fff; border-color: #fff; }
.dice { display: flex; justify-content: center; align-items: center; gap: 14px; margin: 18px 0 12px; }
.die { width: 60px; height: 60px; background: linear-gradient(160deg, #fff, var(--ivory)); border-radius: 13px; display: grid; grid-template-columns: repeat(3, 1fr); padding: 8px; gap: 2px; box-shadow: 0 6px 12px rgba(0,0,0,.5); }
.die span { display: block; } .die .pip { background: #141018; border-radius: 50%; width: 11px; height: 11px; margin: auto; }
.die.rolling { animation: tumble .45s ease-in-out; }
.dtotal { font: 800 1.8rem var(--display); color: var(--gold-hi); min-width: 34px; }
.odds-zone { border: 2px dashed rgba(255,255,255,.5); border-radius: 12px; text-align: center; padding: 8px; margin-bottom: 6px; position: relative; font-weight: 700; color: #e8f3ea; }
.odds-zone.has { border-color: var(--gold); }
.passline { position: relative; border: 3px solid #fff; border-radius: 14px; text-align: center; padding: 14px; font-weight: 900; letter-spacing: 3px; color: #fff; }
.passline.hl { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(212,175,55,.45); }
.oddsbar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 8px 0 0; } .oddsbar .btn { padding: 8px 6px; font-size: .92rem; }
.progress { height: 10px; border-radius: 5px; background: var(--glass); overflow: hidden; } .progress div { height: 100%; background: linear-gradient(90deg, var(--violet), var(--gold)); }
.step { display: flex; gap: 12px; background: var(--glass); border-radius: 16px; padding: 12px; margin: 8px 0; border: 1px solid var(--line); }
.step.done { border-color: rgba(233,199,91,.55); }
.step-n { flex: none; width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #241a02; display: grid; place-items: center; font-weight: 800; }

/* Sheet + toast */
.sheet[hidden] { display: none; }
.sheet { position: fixed; inset: 0; z-index: 50; background: rgba(8,5,20,.6); display: flex; align-items: flex-end; }
.sheet-panel { width: 100%; max-width: 560px; margin: 0 auto; max-height: 85vh; overflow-y: auto; background: rgba(26,18,51,.92); border-radius: 22px 22px 0 0; padding: 8px 16px calc(18px + var(--sab)); border-top: 1px solid var(--line-2); box-shadow: 0 -10px 40px rgba(138,108,255,.2); transform: translateY(24px); transition: transform .2s; }
.sheet.open .sheet-panel { transform: none; }
.sheet-grab { width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 8px; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; } .sheet-title { font: 700 1.1rem var(--display); color: var(--lav); }
.toast { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: calc(100px + var(--sab)); transform: translate(-50%, 20px); background: rgba(26,18,51,.95); color: var(--text); border: 1px solid var(--line-2); padding: 10px 16px; border-radius: 14px; z-index: 60; transition: transform .2s, opacity .2s; max-width: 90vw; font-size: .92rem; box-shadow: 0 8px 30px rgba(0,0,0,.5); }
.toast.show { transform: translate(-50%, 0); visibility: visible; opacity: 1; }

.spinbar { position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px; align-items: center; padding: 10px 0 calc(10px + var(--sab)); background: linear-gradient(180deg, rgba(13,10,28,0), rgba(13,10,28,.92) 30%); margin-top: 8px; }
.spinbar .wag { flex: none; min-width: 84px; text-align: center; } .spinbar .wag b { display: block; font: 800 1.2rem var(--display); } .spinbar .wag span { font-size: .7rem; color: var(--muted); }
.spinbar .btn.huge { margin: 0; flex: 1; }

@keyframes pop { from { transform: scale(.96); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes rise { from { transform: translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes deal { from { transform: translateY(-40px) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes spin { from { transform: rotate(0); } to { transform: rotate(1080deg); } }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 30% { transform: rotate(160deg) translateY(-14px); } 60% { transform: rotate(300deg) translateY(4px); } 100% { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 360px) { .chip { width: 46px; height: 46px; } .card { width: 72px; height: 104px; } .ruleline { columns: 1; } }
.spinbar .btn[disabled] { opacity: 1; filter: grayscale(.6) brightness(.55); }
.spinbar { background: linear-gradient(180deg, rgba(13,10,28,0), rgba(13,10,28,.97) 22%); }
.phands { display: flex; justify-content: center; gap: 10px; }
.phands.n2 .phand { flex: 1; min-width: 0; }
.phands.n2 .card { width: 62px; height: 88px; } .phands.n2 .card .cs { font-size: 1.9rem; } .phands.n2 .card .cr, .phands.n2 .card .cr2 { font-size: 1rem; }
.phands.n2 .cards { gap: 0; } .phands.n2 .cards .card + .card { margin-left: -30px; }
.phand { border-radius: 16px; padding: 4px 2px; border: 2px solid transparent; transition: border-color .2s; }
.phand.on { border-color: var(--lav); box-shadow: 0 0 18px var(--glow); }
.phand-tag { font-size: .68rem; text-transform: uppercase; letter-spacing: 1px; color: rgba(241,215,122,.85); }
.cards .card + .card { margin-left: -18px; }
.tagx { display: inline-block; font-size: .72rem; font-weight: 800; padding: 1px 7px; border-radius: 8px; background: rgba(0,0,0,.3); margin-left: 4px; }
.tagx.pos { color: var(--good); } .tagx.neg { color: var(--bad); }
.next-q { margin: 10px 2px 0; color: var(--lav); }
.note { color: #ffe29a; font-size: .9rem; }

/* American Mahjong */
.mj-mode { margin: 2px 0 8px; }
.mj-home .hero-mark { letter-spacing: .2px; font-size: .68rem; white-space: nowrap; }
.mj-felt { padding: 6px 8px 8px; }
.mj-felt .felt-arc { margin: 0 0 2px; }
.mj-opp { display: flex; gap: 8px; align-items: center; padding: 3px 0; border-bottom: 1px solid rgba(255,255,255,.14); min-width: 0; }
.mj-opp-body { min-width: 0; flex: 1; }
.mj-wind { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #241a02; font: 800 .8rem var(--display); }
.mj-melds, .mj-discards, .mj-legend, .mj-line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.mj-legend > * { flex: 0 0 auto; }
.mj-discards { flex-wrap: nowrap; overflow-x: auto; padding: 2px 0 4px; }
.mj-meld { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; background: rgba(0,0,0,.28); }
.mj-pool { margin-top: 4px; }
.mj-rack { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; margin: 6px 0; }
.mj-tile { min-width: 0; width: 100%; aspect-ratio: 3 / 4; min-height: 0; border: 0; border-radius: 8px; padding: 2px 1px 3px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(165deg, #fffdf8, #f4ead4); color: #1a1028; box-shadow: 0 1px 0 #c9b48a, 0 3px 6px rgba(0,0,0,.35); font-family: var(--display); line-height: 1; overflow: hidden; touch-action: manipulation; }
.mj-dock .btn.huge { min-height: 52px; margin: 4px 0; font-size: 1.02rem; }
.mj-dock .btn[disabled] { opacity: 1; filter: grayscale(.2) brightness(.72); }
.mj-tile b { font-size: clamp(1rem, 4.4vw, 1.3rem); font-weight: 800; }
.mj-tile small { font-size: .62rem; font-weight: 800; letter-spacing: .2px; margin-top: 2px; }
.mj-tile.crak, .mj-grp.a, .mj-tile.d-r, .mj-grp.r { color: #8e1228; }
.mj-tile.bam, .mj-grp.b, .mj-tile.d-g, .mj-grp.g { color: #0c6a38; }
.mj-tile.dot, .mj-grp.c, .mj-tile.d-0, .mj-grp.s { color: #143e86; }
.mj-tile.wind, .mj-grp.w { color: #1a1028; }
.mj-tile.d-0 { background: linear-gradient(165deg, #fff, #e7f0ff); }
.mj-tile.flower, .mj-grp.f { color: #8a2f62; }
.mj-grp.d { color: #5b3fd0; }
.mj-tile.joker { color: #5c4200; background: linear-gradient(165deg, #fff6d0, #f0d36a); }
.mj-tile.sel { transform: translateY(-6px); box-shadow: 0 0 0 3px var(--gold), 0 8px 14px rgba(0,0,0,.45); }
.mj-tile.hinted { outline: 2px dashed var(--lav); outline-offset: -3px; }
.mj-tile.sel.hinted { outline-color: var(--gold-hi); }
.mj-tile.last { box-shadow: 0 0 0 2px #fff, 0 0 10px var(--glow); }
.mj-tile.mini { width: 32px; height: 44px; min-height: 0; aspect-ratio: auto; flex: none; }
.mj-tile.mini b { font-size: .85rem; }
.mj-tile.mini small { font-size: .42rem; letter-spacing: 0; }
.mj-called { display: flex; gap: 10px; align-items: center; margin: 6px 0; }
.mj-called .mj-tile { width: 74px; height: 100px; aspect-ratio: auto; flex: none; }
.mj-called .mj-tile b { font-size: 1.6rem; }
.mj-hand { background: var(--glass); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; margin: 8px 0; }
.mj-hand header { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mj-hand header b { flex: 1; min-width: 8rem; }
.mj-pts, .mj-cx, .mj-legend .mj-grp, .mj-line .mj-grp {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 26px; line-height: 1; flex: none; border-radius: 8px;
}
.mj-pts { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #241a02; padding: 0 8px; font: 800 .8rem/1 var(--display); }
.mj-cx { min-width: 26px; padding: 0 7px; font: 800 .8rem/1 var(--display); white-space: nowrap; }
.mj-key { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font: 700 .82rem/1 var(--font); }
.mj-cx.c { background: rgba(233,199,91,.2); color: var(--gold-hi); }
.mj-cx.ex { background: rgba(22,120,77,.55); color: #e7fff1; }
.mj-grp { background: #fffdf8; padding: 0 8px; font: 800 .85rem/1 var(--display); letter-spacing: .3px; }
.mj-shape { margin: 4px 0; color: var(--lav); font-size: .86rem; font-weight: 700; }
.mj-legend { margin: 8px 0; align-items: center; }
.mj-callgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 0; }
.mj-grade { display: inline-grid; place-items: center; min-width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #241a02; font-weight: 800; }
.mj-grade-row { margin: 8px 0; }
.strat-card.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(212,175,55,.45); }
.row.wrap { flex-wrap: wrap; }
.mj-home .btn.huge, .mj-table .btn.huge, .mj-card .btn { max-width: 100%; }
@media (max-width: 389px) {
  .mj-tile small { font-size: .55rem; }
  .mj-tile.mini { width: 28px; height: 38px; }
}
