/* Hub palette so this reads as a sibling of the other game sites. */
:root {
  --bg: #0f1117; --bg-soft: #161923; --card: #1a1e2b; --card-hover: #212636; --line: #2a3042;
  --text: #e8eaf0; --muted: #969db4; --accent: #6ea8fe; --warm: #f0b354;
  --good: #6ee7a8; --bad: #f08c8c; --felt: #1b1420; --radius: 12px;
  --cw: 76px; /* hand card width (phone); = handCardW in js/guards.js */
}
* { box-sizing: border-box; }
a { color: var(--accent); }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow: hidden; overflow-x: clip; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
.app { height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: minmax(0, 1fr); }

/* ------------------------------------------------ header + tabs */
header.top { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid var(--line); min-height: 46px; }
header.top h1 { font-size: 16px; margin: 0; letter-spacing: .01em; display: flex; align-items: center; gap: 8px; }
header.top h1 img { width: 24px; height: 24px; }
header.top .spacer { flex: 1; }
.ver { color: var(--muted); font-size: 11px; }
nav.tabs { display: flex; border-top: 1px solid var(--line); background: var(--bg-soft); padding-bottom: env(safe-area-inset-bottom); }
nav.tabs button { flex: 1; background: none; border: 0; padding: 8px 0 9px; color: var(--muted); font-size: 12px; font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs button[aria-current="page"] { color: var(--accent); }
main { min-height: 0; min-width: 0; position: relative; }
.ingame { height: 100%; min-height: 0; display: flex; flex-direction: column; }
.game > *, .ingame > * { min-width: 0; }
.view { display: none; height: 100%; min-height: 0; }
.view.on { display: flex; flex-direction: column; }
.scroll { overflow-y: auto; min-height: 0; -webkit-overflow-scrolling: touch; }

/* ------------------------------------------------ basics */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--card); border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 16px; font-weight: 650; min-height: 44px; transition: background .12s, transform .08s, opacity .15s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .38; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0d1424; }
.btn.warm { background: var(--warm); border-color: var(--warm); color: #241703; }
.btn.danger { background: #c84a3e; border-color: #c84a3e; color: #fff; }
.btn.ghost { background: transparent; }
/* A disabled coloured button reads as "off", not as a muddy version of itself. */
.btn.primary:disabled, .btn.warm:disabled, .btn.danger:disabled { background: var(--bg-soft); border-color: var(--line); color: var(--muted); opacity: .7; }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.q { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-soft); color: var(--muted); font-size: 12px; font-weight: 700; padding: 0; display: inline-flex; align-items: center; justify-content: center; vertical-align: middle; flex: none; }
.q::after { content: ""; position: absolute; inset: -10px; } /* 40px tap area, same look */
.muted { color: var(--muted); }
.panel { background: var(--card); border-radius: var(--radius); padding: 14px; }
.panel h2 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.seg { display: flex; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 7px; padding: 8px 4px; font-size: 13px; font-weight: 650; color: var(--muted); min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--card-hover); color: var(--text); box-shadow: 0 0 0 1px var(--line); }
.row { display: flex; align-items: center; gap: 10px; }
.row > .grow { flex: 1; min-width: 0; }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; background: #39405a; border-radius: 14px; transition: background .15s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .18s; }
.switch input:checked + span { background: var(--good); }
.switch input:checked + span::after { transform: translateX(18px); }
.list { display: flex; flex-direction: column; }
.list .item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list .item:last-child { border-bottom: 0; }
.list .item .grow { flex: 1; min-width: 0; }
.list .item small { display: block; color: var(--muted); font-size: 12.5px; }

/* ------------------------------------------------ setup */
.dealbar { padding: 10px 14px 12px; border-top: 1px solid var(--line); display: flex; gap: 10px; max-width: 560px; margin: 0 auto; width: 100%; }
.dealbar .btn { flex: 1; }
.setup { padding: 14px; gap: 12px; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; width: 100%; }
.hero { display: flex; align-items: center; gap: 14px; }
.hero .art { width: 64px; flex: none; transform: rotate(-6deg); }
.hero h2 { margin: 0; font-size: 22px; }
.hero p { margin: 2px 0 0; color: var(--muted); font-size: 13.5px; }
.roomcode { font-size: 44px; font-weight: 800; letter-spacing: 8px; color: var(--warm); font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; }
.seats { display: flex; flex-direction: column; gap: 6px; }
.seat { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; background: var(--bg-soft); border-radius: 10px; padding: 5px 6px 5px 10px; }
.seat .n { color: var(--muted); font-weight: 700; font-size: 13px; }
.seat select { -webkit-appearance: none; appearance: none; background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23969db4' fill='none' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 9px center / 10px 6px; padding-right: 26px !important; color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 14px; min-height: 36px; }
.seat input { background: transparent; border: 0; color: var(--text); font: inherit; font-size: 16px; min-width: 0; width: 100%; padding: 6px 0; }
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.stepper button { width: 40px; height: 38px; border: 0; background: var(--bg-soft); font-size: 20px; }
.stepper b { width: 40px; text-align: center; font-size: 17px; }

/* ------------------------------------------------ table (in game) */
.game { flex: 1; min-height: 0; display: grid; grid-template-rows: auto 1fr auto auto auto; grid-template-columns: minmax(0, 1fr); }
.opps { display: flex; gap: 6px; padding: 8px 10px 4px; overflow-x: auto; scrollbar-width: none; }
.opps::-webkit-scrollbar { display: none; }
.opp { flex: 1 0 74px; max-width: 140px; padding: 0 2px; position: relative; display: flex; flex-direction: column; align-items: center; gap: 5px; transition: opacity .3s; }
.opp.out { opacity: .75; }
/* name plate, like a place card on the table */
.opp .nm { max-width: 100%; font-size: 12.5px; line-height: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  padding: 1px 8px; border-radius: 4px; color: #f6efdc; background: linear-gradient(#3b2a1a, #24180d); border: 1px solid #7a5a2e;
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, .25), 0 2px 4px rgba(0, 0, 0, .4); transition: border-color .2s, box-shadow .2s; }
.opp .nm .lvl { font-weight: 500; font-size: 11px; color: #c9b48a; }
.opp.turn .nm { border-color: #f0c35a; animation: oppturn 1.8s ease-in-out infinite; box-shadow: 0 0 0 2px rgba(240, 195, 90, .45), 0 2px 4px rgba(0, 0, 0, .4); }
@keyframes oppturn { 50% { box-shadow: 0 0 0 3px rgba(240, 195, 90, .6), 0 0 14px rgba(240, 195, 90, .5); } }
.opp.out .nm { opacity: .6; }
.opp .meta { display: flex; align-items: flex-end; gap: 5px; font-size: 12px; color: #e6dcc6; min-height: 30px; }
.opp .meta .cnt { font-weight: 700; font-variant-numeric: tabular-nums; text-shadow: 0 1px 2px #000; }
.opp .meta .du { color: #d9c9a6; text-shadow: 0 1px 2px #000; }
/* the backs of their held cards, fanned */
.opp .mini { --bw: 17px; --step: 4.5px; position: relative; display: inline-block; height: calc(var(--bw) * 1.4 + 4px); width: calc(var(--bw) + (var(--n, 1) - 1) * var(--step) + 6px); }
.opp .mini i { position: absolute; left: calc(3px + var(--i) * var(--step)); bottom: 0; width: var(--bw); aspect-ratio: 100 / 140; border-radius: 2.5px; transform-origin: 50% 120%; transform: rotate(var(--r));
  background: radial-gradient(circle at 50% 50%, #e8b45a 0 18%, transparent 20%), radial-gradient(#7a2a2e, #4a181b); box-shadow: inset 0 0 0 1px #e8b45a99, inset 0 0 0 2px #4a181b, 0 1px 2px rgba(0, 0, 0, .55); }
.opp .outcard { width: 22px; display: inline-block; transform: rotate(-8deg); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .6)); }
.opp .outcard .cardsvg { display: block; width: 100%; height: auto; }
.opp .badge { position: absolute; top: -7px; right: -4px; z-index: 2; background: var(--warm); color: #241703; font-size: 11px; font-weight: 800; border-radius: 8px; padding: 0 6px; }
.opp .think { position: absolute; bottom: 4px; right: 2px; display: none; gap: 2px; }
.opp.turn .think { display: flex; }
.opp .think i { width: 4px; height: 4px; border-radius: 50%; background: var(--warm); animation: blink 1s infinite; }
.opp .think i:nth-child(2) { animation-delay: .2s; } .opp .think i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.opp .peek { display: flex; flex-wrap: wrap; gap: 2px; margin-top: 3px; }
/* seats round the far side: the outer ones sit a little lower, like at a real table */
.opp { margin-top: calc(var(--arc, 0px) * .25); }
/* a crowded table (6+ players on a phone): every seat stays on screen, smaller */
.opps.crowd { gap: 3px; padding-left: 6px; padding-right: 6px; overflow: visible; }
.opps.crowd .opp { flex: 1 1 0; min-width: 0; max-width: 76px; padding: 0; }
.opps.crowd .opp .nm { font-size: 11px; line-height: 16px; padding: 1px 4px; }
.opps.crowd .opp .nm .lvl, .opps.crowd .opp .meta .du { display: none; }
.opps.crowd .opp .meta { position: relative; min-height: 26px; }
.opps.crowd .opp .mini { --bw: 13px; --step: 3px; }
.opps.crowd .opp .meta .cnt { position: absolute; right: -4px; bottom: -3px; font-size: 12px; line-height: 15px; padding: 0 4px; border-radius: 7px; background: rgba(12, 14, 20, .86); }
.opps.crowd .opp .badge { right: -2px; font-size: 10px; padding: 0 4px; }
/* a very big hand slides sideways instead of squeezing cards too thin to tap */
.hand.scrolls { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; overscroll-behavior-x: contain; }
.hand.scrolls::-webkit-scrollbar { display: none; }
.opp .peek span { font-size: 9.5px; padding: 0 3px; border-radius: 3px; color: #17130f; font-weight: 700; }

/* The piles and the dial take the biggest size the felt's height allows (cqh = felt height). */
.felt { container-type: size; --pw: 84px; --ring: 132px; --proom: 34px; --droom: 62px; }
.felt .pile { width: min(var(--pw), (100cqh - var(--proom)) / 1.4); }
.felt .dial { --rs: min(var(--ring), 100cqh - var(--droom)); }
.felt .dial .ring { width: var(--rs); height: var(--rs); }
.felt .dial .pct b { font-size: calc(var(--rs) * .27); }
.felt { min-height: 0; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; padding: 6px 10px; gap: 8px; }
.pile { width: 84px; position: relative; }
.pile .stack { position: relative; width: 100%; aspect-ratio: 100 / 140; border-radius: 10% / 7.14%; }
.pile .stack .cardsvg { display: block; width: 100%; height: auto; }
/* draw pile: card edges under the top card, as thick as the cards left in it */
.deck .stack { box-shadow: var(--stk); transform: translateY(var(--rise, 0)); }
/* an empty pile is just bare table: a faint worn patch where the cards were */
.deck.empty .stack, .discard.empty .stack { background: radial-gradient(closest-side, rgba(0, 0, 0, .16), rgba(0, 0, 0, .06) 70%, transparent); }
/* discard: a messy face-up pile */
.discard { container-type: inline-size; }
.discard .stack .pc { position: absolute; inset: 0; }
/* a Nope chain in progress: each Nope a card-name lower, so the chain can be counted */
/* step = enough to show a card's name, less when the felt has no room for it; the cascade stays centred */
.discard { --cs: min(26cqw, max(6px, (100cqh - 140cqw - 34px) / var(--k, 1))); }
.discard .stack .pc.chain { translate: calc(var(--j) * 2cqw) calc(var(--j) * var(--cs)); }
.discard.chain .stack { translate: 0 calc(var(--k) * var(--cs) / -2); }
.discard.chain .lbl { translate: 0 calc(var(--k) * var(--cs) / 2); }
.discard .stack .pc .cardsvg { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)) drop-shadow(0 3px 5px rgba(0, 0, 0, .3)); }
.pile .lbl { text-align: center; font-size: 12px; color: #e6dcc6; text-shadow: 0 1px 2px #000; margin-top: 8px; font-variant-numeric: tabular-nums; }
.pile .ikup { position: absolute; left: -6px; right: -6px; height: 4px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px #7fd0ff; }
.discard .stack .pc.land { animation: land .35s ease-out; }
.flyback { border-radius: 10% / 7.14%; }
.flyback .cardsvg { display: block; width: 100%; height: auto; }
@keyframes land { from { transform: translateY(-40px) rotate(-8deg) scale(1.1); opacity: 0; } }
.dial { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 120px; }
/* the odds dial sits on the table like a dark coaster, so it stays readable on wood */
.dial .ring { width: 132px; height: 132px; position: relative; border-radius: 50%; background: radial-gradient(closest-side, rgba(12, 14, 20, .82) 0 92%, rgba(12, 14, 20, 0)); }
.dial .ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dial .ring .pct { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dial .pct b { font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums; }
.dial .pct small { font-size: 11px; color: var(--muted); margin-top: 3px; }
.dial .cap { font-size: 12.5px; color: #e6dcc6; text-shadow: 0 1px 2px #000; display: flex; align-items: center; gap: 5px; }
.future { display: flex; gap: 4px; margin-top: 4px; min-height: 30px; }
.future span { width: 32px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; background: rgba(12, 14, 20, .82); border: 1px solid var(--line); }
.future span.E { background: #e0523f; color: #fff; border-color: #e0523f; }
.future span.U { background: #3f8ee0; color: #fff; }
.future span.S { background: #2a5a3f; color: #c8f5da; border-color: #2a5a3f; }

.status { padding: 6px 12px; font-size: 14px; display: flex; align-items: center; gap: 8px; min-height: 40px; background: rgba(12, 14, 20, .62); }
.status .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.status b.you { color: var(--warm); }
/* Your turn: a warm edge on the status line and a slow glow on Draw (no layout change). */
.status { transition: background .25s, box-shadow .25s; }
.game.myturn .status { background: linear-gradient(90deg, #f0b35426, rgba(12, 14, 20, .62) 70%); box-shadow: inset 3px 0 var(--warm); }
.game.myturn .acts [data-draw]:not(:disabled) { animation: drawglow 2.4s ease-in-out infinite; }
@keyframes drawglow { 50% { box-shadow: 0 0 0 3px #6ea8fe40, 0 0 18px #6ea8fe55; } }
@media (prefers-reduced-motion: reduce) { .game.myturn .acts [data-draw], .opp.turn { animation: none; } }

/* your hand, held fanned at the bottom edge (positions from the table kit's fanLayout) */
.hand { position: relative; height: var(--hand-h, 132px); padding: 0 8px; overflow: hidden; }
.hand .fanbox { position: relative; height: 100%; margin: 0 auto; }
.hand .card { position: absolute; left: 0; bottom: 4px; width: var(--cw); border: 0; padding: 0; background: none; transform-origin: 50% 100%;
  transform: translate(var(--x, 0), calc(var(--y, 0px) - var(--up, 0px))) rotate(var(--r, 0deg)); transition: transform .2s cubic-bezier(.3,1.5,.5,1), filter .16s; }
.hand .card .cardsvg { display: block; width: 100%; height: auto; filter: drop-shadow(-1px 1px 1px rgba(0, 0, 0, .35)) drop-shadow(-2px 3px 4px rgba(0, 0, 0, .35)); }
.hand .card.sel { --up: 18px; }
.hand .card.sel .cardsvg { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 0 6px var(--accent)) drop-shadow(0 10px 10px rgba(0, 0, 0, .45)); }
@media (hover: hover) { .hand:not(.notmine) .card:not(.sel):hover { --up: 7px; } }
.hand .card.hint::after { content: ""; position: absolute; inset: -3px; border-radius: 12px; border: 2px dashed var(--warm); }
.hand.notmine .card { filter: saturate(.75); }
.hand .outme { width: 66px; padding-top: 10px; transform: rotate(-6deg); }
.hand .outme .cardsvg { display: block; width: 100%; filter: drop-shadow(0 3px 5px #0009); }
.hand > .muted { display: flex; height: 100%; align-items: center; justify-content: center; }
.acts { display: grid; grid-template-columns: auto 1fr 1fr; gap: 8px; padding: 6px 12px 10px; }
/* fixed height: picking a card never makes the row taller (Nope risk goes on a second line) */
.acts .btn { height: 48px; white-space: nowrap; }
.acts [data-play] { flex-direction: column; gap: 0; line-height: 1.15; }
.acts [data-play] small { font-size: 11.5px; }
.game .acts .btn:not(.primary):not(.warm) { background: rgba(26, 30, 43, .92); }
.hint-text { text-shadow: 0 1px 2px #000; }
.acts .btn { min-height: 48px; }
.hint-text { font-size: 13px; color: var(--warm); padding: 0 12px; min-height: 0; }

/* ------------------------------------------------ sheets & overlays */
.sheet-wrap { position: fixed; inset: 0; background: #0009; display: flex; align-items: flex-end; justify-content: center; z-index: 20; animation: fade .18s; }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--card); width: 100%; max-width: 480px; border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out; max-height: 85dvh; overflow-y: auto; }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet h3 { margin: 0 0 4px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.sheet p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.sheet .btns { display: flex; gap: 10px; margin-top: 12px; }
.sheet .btns .btn { flex: 1; }
.sheet .choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(110px, 100%), 1fr)); gap: 8px; }
.sheet .choices .btn { flex-direction: column; gap: 2px; }
.sheet .cards-pick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sheet .cards-pick button { width: 70px; border: 0; padding: 0; background: none; border-radius: 10px; transition: transform .12s; }
.sheet .cards-pick button.on { transform: translateY(-6px); outline: 2px solid var(--accent); }
.sheet .cards-pick .cardsvg { width: 100%; display: block; }
.sheet .cards-pick.big { gap: 12px; }
.sheet .cards-pick.big button { width: min(108px, 27vw); }
.slider { width: 100%; accent-color: var(--warm); height: 32px; }
.spot { font-size: 22px; font-weight: 800; text-align: center; margin: 4px 0; }
.cover { position: fixed; inset: 0; background: var(--bg); z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; }
.cover h2 { margin: 0; font-size: 24px; }
.boom { position: fixed; inset: 0; pointer-events: none; z-index: 25; background: radial-gradient(circle, #ffb02e 0%, #e0523f 35%, transparent 70%); animation: boom .7s ease-out forwards; }
@keyframes boom { from { opacity: .95; transform: scale(.3); } to { opacity: 0; transform: scale(2.2); } }
/* Sound & effects settings (js/fx.js): Animations off = instant; Fast = shorter */
.fx-noanim *, .fx-noanim *::before, .fx-noanim *::after { animation: none !important; transition: none !important; }
.fx-fast .discard .stack .pc.land { animation-duration: .2s; }
.fx-fast .sheet-wrap { animation-duration: .1s; }
.fx-fast .sheet { animation-duration: .12s; }
.fx-fast .boom { animation-duration: .4s; }
#fxbox .fx-row { padding: 11px 0; border-top-color: var(--line); }
.toast { position: fixed; left: 50%; top: 56px; transform: translateX(-50%); background: var(--card-hover); border: 1px solid var(--line); padding: 8px 14px; border-radius: 10px; z-index: 40; font-size: 14px; animation: fade .2s; max-width: 90vw; }

/* ------------------------------------------------ side info (cards tracker / log) */
.side { display: none; }
.tracker table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.tracker th { text-align: right; color: var(--muted); font-weight: 600; font-size: 11.5px; padding: 3px 4px; }
.tracker th:first-child, .tracker td:first-child { text-align: left; }
.tracker td { padding: 4px; text-align: right; border-top: 1px solid var(--line); }
.tracker td .dot { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; }
.log { font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.log div { color: var(--muted); }
.log div b { color: var(--text); font-weight: 600; }

/* ------------------------------------------------ table companion & learn */
.pad { padding: 12px; display: flex; flex-direction: column; gap: 10px; max-width: 900px; margin: 0 auto; width: 100%; }
.bigodds { display: flex; align-items: center; gap: 12px; }
.bigodds .dial { min-width: 0; }
.bigodds .dial .ring { width: 112px; height: 112px; }
.bigodds .dial .pct b { font-size: 30px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font-size: 11px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.kv b { font-variant-numeric: tabular-nums; }
.drill .ans { font-size: 28px; font-weight: 800; text-align: center; }
details.rules summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
details.rules p, details.rules li { color: #c9cde0; font-size: 14px; }
.review li { margin-bottom: 6px; font-size: 14px; }

/* ------------------------------------------------ laptop */
@media (min-width: 900px) {
  :root { --cw: 112px; }
  .app { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: auto 1fr; }
  header.top { grid-column: 1 / -1; }
  nav.tabs { grid-row: 2; grid-column: 1; flex-direction: column; border-top: 0; border-right: 1px solid var(--line); padding: 10px 8px; gap: 4px; }
  nav.tabs button { flex: none; flex-direction: row; justify-content: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; font-size: 14px; }
  nav.tabs button[aria-current="page"] { background: var(--card); }
  main { grid-row: 2; grid-column: 2; }
  .ingame { display: grid; grid-template-columns: minmax(0, 1fr) 320px; }
  .side { display: flex; flex-direction: column; gap: 10px; border-left: 1px solid var(--line); padding: 12px; min-height: 0; overflow-y: auto; }
  .side .log { max-height: 260px; overflow-y: auto; }
  .opps { justify-content: center; align-items: flex-start; }
  .opp { flex: 0 1 170px; max-width: 190px; margin-top: var(--arc, 0px); }
  .opp .mini { --bw: 26px; --step: 7px; }
  .opps.crowd .opp { max-width: 100px; }
  .opps.crowd .opp .mini { --bw: 20px; --step: 4.5px; }
  .opps.crowd .opp .nm { font-size: 13px; line-height: 19px; padding: 1px 6px; }
  .opps.crowd .opp .meta .cnt { font-size: 13px; line-height: 17px; }
  .opp .outcard { width: 32px; }
  .opp .meta { min-height: 42px; }
  .felt { --pw: clamp(150px, 22vh, 210px); --ring: clamp(180px, 27vh, 260px); --proom: 46px; --droom: 76px; }
  .dial .pct small { font-size: 14px; }
  .dial .cap { font-size: 14px; }
  .future span { width: 38px; height: 38px; font-size: 13px; }
  .felt { gap: 40px; padding: 10px 40px; }
  .opps { padding: 12px 16px 6px; gap: 10px; }
  .opp .nm { font-size: 14px; line-height: 22px; padding: 1px 12px; }
  .opp .meta { font-size: 13px; }
  .status { font-size: 15px; padding: 8px 16px; }
  .acts { max-width: 560px; margin: 0 auto; width: 100%; }
  .phone-only { display: none !important; }
  .sheet-wrap { align-items: center; }
  .sheet { border-radius: 16px; max-width: 460px; }
  .sheet .cards-pick.big button { width: 120px; }
  .bigodds .dial .ring { width: 160px; height: 160px; }
  .bigodds .dial .pct b { font-size: 42px; }
  .bigodds .kv > span { white-space: nowrap; }
  .pad.wide { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 899px) { .laptop-only { display: none !important; } }
@media (max-width: 360px) { :root { --cw: 68px; } .felt { --pw: 72px; --ring: 100px; } .opp .mini { --bw: 14px; --step: 3.5px; } }
@media (max-height: 700px) and (max-width: 899px) { .felt { padding: 2px 10px; } }
/* phone turned sideways: the piles on the left, your hand on the right (handFan in app.js matches) */
@media (max-height: 500px) and (max-width: 899px) and (orientation: landscape) {
  .game { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-template-rows: auto minmax(0, 1fr) auto auto;
    grid-template-areas: "opps opps" "felt hw" "status hw" "hint hw"; }
  .game > .opps { grid-area: opps; padding-top: 4px; }
  .game > .felt { grid-area: felt; padding: 0 6px; gap: 4px; }
  .game > .status { grid-area: status; height: 52px; }
  .game > .hint-text { grid-area: hint; }
  .game > div:last-child { grid-area: hw; align-self: end; }
  .felt { --pw: 68px; --ring: 88px; --proom: 26px; --droom: 52px; }
  .pile .lbl { margin-top: 4px; font-size: 11.5px; }
  .dial { min-width: 0; }
  .dial .pct small { font-size: 9.5px; }
  .dial .cap { font-size: 11px; }
  .future { margin-top: 2px; min-height: 22px; }
  .future span { width: 28px; height: 24px; font-size: 12px; }
}
