/* Callbreak · EverestBuzz Games · Look A "Base Camp Night" (chosen Oct 17, 2026)
   Night navy, green felt, prayer-flag seat colors. A deliberate single dark look. */
:root {
  --navy: #0B1F3A; --navy-2: #0E2546; --deep: #081627; --fg: #F8FAFC; --muted: #AEBBCD; --dim: #7F8FA6;
  --surface: rgba(255,255,255,.06); --surface-2: rgba(255,255,255,.1); --line: rgba(255,255,255,.16);
  --mint: #4BD69C; --mint-ink: #062A1B; --gold: #F2B632; --gold-ink: #2A1C00; --danger: #F87171;
  --felt-a: #11704F; --felt-b: #0C5039; --felt-c: #093D2C; --felt-line: rgba(255,255,255,.12);
  --card: #FFFDF6; --card-ink: #14213A; --card-line: #E5E1D3; --red: #C8283A; --blue-suit: #1D4ED8; --green-suit: #15803D;
  --f0: #16A34A; --f1: #2563EB; --f2: #DC2626; --f3: #CA8A04;
  --display: "Unbounded", "Plus Jakarta Sans", system-ui, sans-serif;
  --body: "Plus Jakarta Sans", "Mukta Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 12px; --cw: 46px; --ch: 64px;
  color-scheme: dark;
}
html[data-table="navy"] { --felt-a: #1E4A7A; --felt-b: #163A62; --felt-c: #102B4A; }
html[data-table="plum"] { --felt-a: #5B2A5E; --felt-b: #46204A; --felt-c: #331638; }
html[data-table="slate"] { --felt-a: #3E4E5E; --felt-b: #313F4D; --felt-c: #24303B; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  background: linear-gradient(180deg, var(--navy-2) 0%, var(--navy) 40%, var(--deep) 100%) fixed;
  background-color: var(--navy);
  color: var(--fg); font: 15px/1.5 var(--body); -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select { font: inherit; color: inherit; }
a { color: var(--mint); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.wrap { width: 100%; max-width: 560px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* top bar */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: max(10px, env(safe-area-inset-top, 0px)); padding-bottom: 8px; padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px)); min-height: 48px; }
.brand { color: var(--fg); text-decoration: none; font-weight: 800; font-size: 14px; letter-spacing: -.01em; }
.topbar .meta { color: var(--muted); font-size: 12.5px; font-weight: 700; text-align: center; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { min-width: 44px; min-height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--muted); font-weight: 700; font-size: 13px; cursor: pointer; }
.icon-btn:hover { color: var(--fg); background: var(--surface); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--r); border: 1.5px solid transparent; font-weight: 700; font-size: 15px; cursor: pointer; text-decoration: none; transition: transform .12s ease, background .12s ease; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--mint); color: var(--mint-ink); }
.btn.primary:hover { background: #63E0AC; }
.btn.secondary { background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--line); }
.btn.gold { background: var(--gold); color: var(--gold-ink); }
.btn.danger { background: transparent; color: var(--danger); border-color: rgba(248,113,113,.4); }
.btn.small { min-height: 38px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: default; transform: none; }
.row { display: flex; gap: 8px; }
.row > * { flex: 1; min-width: 0; }
.stack { display: grid; gap: 10px; }

/* home */
.home { padding-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.art { position: relative; height: 150px; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))); overflow: hidden; }
.art .peaks { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 92px; color: #14315A; }
.art.hero { height: 214px; }
.hero3d { position: absolute; left: 50%; bottom: 6px; width: 240px; height: 132px; transform: translateX(-50%); perspective: 900px; }
.hero3d .f { position: absolute; left: 50%; bottom: 0; animation: float 6s ease-in-out infinite; }
.hero3d .f2 { animation-delay: -2s; } .hero3d .f3 { animation-delay: -4s; }
.hero3d .card { --cw: 76px; --ch: 106px; font-size: 21px; transform-origin: 50% 110%; box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 14px 26px rgba(0,0,0,.45); }
.hero3d .card i { font-size: 17px; }
.hero3d .card .pip { font-size: 36px; }
.hero3d .f1 .card { transform: translateX(-118%) rotate(-16deg) rotateY(22deg); }
.hero3d .f2 .card { transform: translateX(-50%) rotate(-2deg) translateZ(20px); }
.hero3d .f3 .card { transform: translateX(16%) rotate(14deg) rotateY(-20deg) translateZ(40px); }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
.bunting span { transform-origin: 50% 0; animation: wave 5s ease-in-out infinite; }
.bunting span:nth-child(2) { animation-delay: -1s; } .bunting span:nth-child(3) { animation-delay: -2s; } .bunting span:nth-child(4) { animation-delay: -3s; } .bunting span:nth-child(5) { animation-delay: -4s; }
@keyframes wave { 0%, 100% { rotate: -2.5deg; } 50% { rotate: 2.5deg; } }
.bunting { display: flex; justify-content: space-between; gap: 6px; padding: 8px 10px 0; position: relative; }
.bunting::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: rgba(255,255,255,.35); }
.bunting span { position: relative; flex: 1; height: 62px; clip-path: polygon(0 0,100% 0,100% 82%,50% 100%,0 82%); display: grid; place-items: center; padding-bottom: 10px; font-size: 11.5px; font-weight: 800; color: #fff; transition: transform .45s cubic-bezier(.2,.8,.2,1.2), opacity .3s ease; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bunting span.down { opacity: .2; transform: translateY(10px); }
.bunting .fw { background: #E8EEF5; color: var(--navy); }
.title { font: 700 clamp(34px, 9vw, 44px)/1 var(--display); letter-spacing: -.01em; margin: 4px 0 0; }
.lead { color: var(--muted); margin: 0; max-width: 40ch; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; cursor: pointer; color: var(--fg); min-height: 64px; }
.tile:hover { background: var(--surface-2); }
.tile b { display: block; font-size: 14px; }
.tile small { color: var(--muted); font-size: 12px; }
.resume { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: var(--r); border: 1px solid rgba(75,214,156,.45); background: rgba(75,214,156,.08); }
.resume b { display: block; font-size: 14px; }
.resume small { color: var(--muted); }
.resume .acts { display: flex; gap: 6px; flex-shrink: 0; }
.links { display: flex; flex-wrap: wrap; gap: 4px 2px; justify-content: center; }
.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; color: var(--dim); font-size: 12.5px; padding-top: 14px; padding-bottom: max(18px, env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); margin-top: auto; }
.foot a { color: var(--muted); }

/* forms */
.panel { display: flex; flex-direction: column; gap: 12px; padding-bottom: 24px; }
.panel h1 { font: 700 24px/1.15 var(--display); margin: 6px 0 0; text-wrap: balance; }
.panel .sub { color: var(--muted); margin: 0; }
.label { display: block; font-size: 12.5px; font-weight: 700; color: var(--muted); margin: 0 0 6px; }
.input { width: 100%; min-height: 48px; border-radius: var(--r); border: 1.5px solid var(--line); background: rgba(255,255,255,.04); padding: 0 14px; color: var(--fg); font-size: 16px; }
.input:focus { border-color: var(--mint); outline: none; }
.field { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.field .label { grid-column: 1 / -1; margin: 0; }
.check { display: flex; gap: 10px; align-items: center; font-size: 14px; cursor: pointer; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--mint); }
.note { font-size: 12.5px; color: var(--muted); margin: 0; }
.error { color: var(--danger); font-weight: 700; font-size: 13.5px; margin: 0; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card-box b.big { display: block; font-size: 17px; margin-bottom: 2px; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills span { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 4px 10px; background: var(--surface); border: 1px solid var(--line); }
.code { font: 600 clamp(38px, 12vw, 48px)/1 "IBM Plex Mono", ui-monospace, monospace; letter-spacing: .16em; text-align: center; padding: 16px 0; border-radius: var(--r); background: var(--surface); border: 1.5px dashed var(--line); user-select: all; }
.link { text-align: center; font: 13px/1.3 "IBM Plex Mono", ui-monospace, monospace; color: var(--muted); margin: -4px 0 0; word-break: break-all; }
.qr { display: grid; place-items: center; padding: 14px; background: #fff; border-radius: var(--r); width: fit-content; margin: 0 auto; }
.qr canvas { display: block; width: 200px; height: 200px; image-rendering: pixelated; }
.dots { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); display: inline-block; }
.dots i.on { background: var(--mint); }

/* waiting room */
.seats { display: grid; gap: 8px; }
.wseat { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); min-height: 60px; }
.wseat.open { border-style: dashed; background: transparent; }
.wseat .who b { display: block; font-size: 15px; }
.wseat .who small { color: var(--muted); font-size: 12.5px; }
.wseat .acts { display: flex; gap: 6px; align-items: center; }
.wseat select { min-height: 38px; border-radius: 10px; background: var(--deep); border: 1px solid var(--line); padding: 0 8px; }
.tag { font-size: 11.5px; font-weight: 800; color: var(--mint); }
.tag.wait { color: var(--muted); }
.av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; color: #fff; flex: 0 0 auto; position: relative; }
.av.open { background: transparent; border: 1.5px dashed var(--line); color: var(--muted); }
.s0 { background: var(--f0); } .s1 { background: var(--f1); } .s2 { background: var(--f2); } .s3 { background: var(--f3); }

/* ---------------- game ---------------- */
.game { flex: 1; display: flex; flex-direction: column; min-height: 0; height: 100vh; height: 100dvh; }
.game .topbar { padding-bottom: 4px; min-height: 44px; }
.game-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto auto; min-height: 0; padding: 0 max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-bottom, 0px)); gap: 6px; max-width: 1180px; width: 100%; margin: 0 auto; }
.felt { position: relative; min-height: 210px; isolation: isolate; container-type: size; }
/* The table top: tilted back in 3D like a real table seen from your chair, with a dark rim, a brass
   line and a lamp-lit center. "3D table" off in Settings (or reduced motion) lays it flat. */
.surface { position: absolute; inset: 4px 2px 0; z-index: 0; border-radius: 30px; overflow: hidden; transform-origin: 50% 100%; transform: perspective(1100px) rotateX(18deg); transform: perspective(290cqh) rotateX(18deg);
  background: radial-gradient(70% 55% at 50% 42%, rgba(255,255,255,.11), transparent 70%), radial-gradient(120% 90% at 50% 0%, var(--felt-a) 0%, var(--felt-b) 60%, var(--felt-c) 100%);
  box-shadow: 0 0 0 7px #0A1A30, 0 0 0 8.5px rgba(242,182,50,.45), 0 0 0 13px #071224, 0 28px 40px rgba(0,0,0,.55), inset 0 -18px 30px rgba(0,0,0,.28), inset 0 2px 0 rgba(255,255,255,.08); }
.surface::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, rgba(255,255,255,.018) 0 2px, transparent 2px 5px), repeating-linear-gradient(-45deg, rgba(0,0,0,.035) 0 2px, transparent 2px 5px); pointer-events: none; }
.surface::after { content: ""; position: absolute; inset: 12px; border-radius: 22px; border: 1.5px dashed rgba(255,255,255,.11); pointer-events: none; }
.surface .peaks { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 42%; color: rgba(255,255,255,.05); pointer-events: none; }
html.flat .surface { transform: none; }
.emblem { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; color: rgba(255,255,255,.14); font-size: 11px; font-weight: 800; letter-spacing: .08em; pointer-events: none; }
.emblem span { display: block; font-size: 44px; line-height: 1; }
.seat { position: absolute; display: flex; align-items: center; gap: 7px; padding: 5px 10px 5px 5px; border-radius: 14px; background: rgba(8,22,39,.84); border: 1.5px solid rgba(255,255,255,.12); font-size: 12px; line-height: 1.2; z-index: 3; max-width: 46%; }
.seat .av { width: 32px; height: 32px; font-size: 13px; }
.seat b { display: block; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 11ch; }
.seat em { font-style: normal; color: var(--muted); white-space: nowrap; }
.seat em strong { color: var(--fg); }
.seat.p0 { bottom: 8px; left: 50%; transform: translateX(-50%); max-width: 84%; }
.seat.p2 { top: 8px; left: 50%; transform: translateX(-50%); max-width: 84%; }
.seat.p1, .seat.p3 { top: 40%; transform: translateY(-50%); flex-direction: column; text-align: center; padding: 6px 6px 7px; gap: 3px; width: 80px; }
.seat.p1 { right: 6px; } .seat.p3 { left: 6px; }
.seat.p1 b, .seat.p3 b { max-width: 9ch; margin: 0 auto; }
.seat.turn { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(242,182,50,.35); }
.seat.won-trick { border-color: var(--mint); }
.seat .flagtab { position: absolute; top: -1.5px; right: 10px; width: 12px; height: 9px; clip-path: polygon(0 0,100% 0,100% 100%,50% 70%,0 100%); }
.seat .dealer { position: absolute; top: -8px; left: -6px; background: var(--gold); color: var(--gold-ink); border-radius: 999px; font-size: 10px; font-weight: 900; padding: 1px 5px; }
.seat .net { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--mint); margin-left: 4px; vertical-align: middle; }
.seat .net.off { background: var(--danger); }
.ring { position: absolute; inset: -4px; border-radius: 50%; background: conic-gradient(var(--gold) calc(var(--p, 1) * 360deg), rgba(255,255,255,.12) 0); -webkit-mask: radial-gradient(circle, transparent 17px, #000 18px); mask: radial-gradient(circle, transparent 17px, #000 18px); }
.bubble { position: absolute; z-index: 6; background: var(--gold); color: var(--gold-ink); font-size: 12.5px; font-weight: 800; padding: 6px 10px; border-radius: 999px; white-space: nowrap; animation: pop .25s ease-out; pointer-events: none; }
.bubble.b0 { bottom: 64px; left: 50%; transform: translateX(-50%); }
.bubble.b2 { top: 58px; left: 50%; transform: translateX(-50%); }
.bubble.b1 { right: 12px; top: calc(40% - 74px); }
.bubble.b3 { left: 12px; top: calc(40% - 74px); }
@keyframes pop { from { opacity: 0; scale: .8; } to { opacity: 1; scale: 1; } }

.trick { position: absolute; left: 50%; top: 55%; width: 0; height: 0; z-index: 2; }
.trick .pc { position: absolute; transition: transform .32s ease, opacity .32s ease; }
.trick .pc.q0 { transform: translate(-50%, 6%) rotate(2deg); }
.trick .pc.q2 { transform: translate(-50%, -106%) rotate(-3deg); }
.trick .pc.q1 { transform: translate(14%, -50%) rotate(8deg); }
.trick .pc.q3 { transform: translate(-114%, -50%) rotate(-9deg); }
.trick .pc.enter { animation: enter .3s ease-out; }
.trick .pc.q2 .who { bottom: auto; top: -16px; }
.trick .pc .who { position: absolute; left: 50%; bottom: -16px; transform: translateX(-50%); font-size: 10.5px; font-weight: 800; color: rgba(255,255,255,.78); white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.trick .pc.win .card { box-shadow: 0 0 0 3px var(--mint), 0 0 18px rgba(75,214,156,.55), 0 8px 16px rgba(0,0,0,.35); }
.stack { display: inline-flex; align-items: center; margin-left: 2px; }
.stack i { width: 13px; height: 19px; border-radius: 3px; border: 1px solid rgba(242,182,50,.75); background: repeating-linear-gradient(135deg, #14315A 0 3px, #0E2546 3px 6px); margin-left: -8px; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.stack i:first-child { margin-left: 0; transform: rotate(-8deg); }
.stack i:nth-child(3) { transform: rotate(8deg); }
.stack b { font-size: 11px; color: var(--gold); margin-left: 5px; font-weight: 800; }
.seat.p1 .stack, .seat.p3 .stack { margin: 2px auto 0; }
@keyframes enter { from { opacity: 0; margin-top: var(--fy, 0); margin-left: var(--fx, 0); } to { opacity: 1; margin: 0; } }
.trick.sweep .pc { opacity: 0; }
.trick.sweep-0 .pc { margin-top: 90px; } .trick.sweep-2 .pc { margin-top: -90px; } .trick.sweep-1 .pc { margin-left: 110px; } .trick.sweep-3 .pc { margin-left: -110px; }
.trick .pc { transition: transform .32s ease, opacity .32s ease, margin .32s ease; }

/* cards */
.card { width: var(--cw); height: var(--ch); border-radius: 7px; background: linear-gradient(165deg, #FFFEF9 0%, #FBF7EC 55%, #F3EDDC 100%); color: var(--card-ink); border: 1px solid var(--card-line); display: flex; flex-direction: column; padding: 3px 4px; font: 800 15px/1 var(--body); box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 2px 6px rgba(0,0,0,.22); position: relative; user-select: none; }
.card .pip.court { display: grid; justify-items: center; gap: 0; }
.card .pip.court svg { width: 0.95em; height: 0.75em; fill: currentColor; opacity: .9; }
.card .pip.court small { font-size: .5em; line-height: 1; }
.card .pip.ace { font-size: 1.45em; }
.card.back3d { background: repeating-linear-gradient(135deg, #14315A 0 5px, #0E2546 5px 10px); border: 2px solid rgba(242,182,50,.8); box-shadow: inset 0 0 0 4px #0B1F3A, inset 0 0 0 5px rgba(242,182,50,.45), 0 8px 18px rgba(0,0,0,.4); }
.card i { font-style: normal; font-size: 13px; margin-top: 1px; }
.card .pip { margin: auto; font-size: 22px; line-height: 1; }
.card.r { color: var(--red); }
html.four-color .card.sD { color: var(--blue-suit); }
html.four-color .card.sC { color: var(--green-suit); }
.trick .card { --cw: 54px; --ch: 76px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.85), 0 8px 14px rgba(0,0,0,.35); transform: perspective(700px) rotateX(16deg); transform-origin: 50% 100%; }
.trick .pc.enter .card { animation: flipin .38s cubic-bezier(.2,.8,.3,1); }
@keyframes flipin { from { transform: perspective(700px) rotateX(16deg) rotateY(-110deg) scale(.82); filter: brightness(.6); } to { transform: perspective(700px) rotateX(16deg) rotateY(0) scale(1); filter: none; } }
html.flat .trick .card { transform: none; }
.hand-wrap { min-height: 0; }
.hand { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; perspective: 900px; }
.hand .card { width: auto; height: var(--ch); cursor: pointer; transition: transform .16s ease, opacity .12s ease, box-shadow .16s ease; border-width: 1.5px; transform: rotateX(9deg); transform-origin: 50% 100%; }
html.flat .hand .card { transform: none; }
.hand button.card { padding: 4px 5px; text-align: left; }
.hand .card[disabled] { cursor: default; }
.hand .card.illegal { opacity: .42; filter: saturate(.7); }
.hand .card.legal { border-color: var(--mint); box-shadow: 0 0 0 1.5px var(--mint), 0 2px 6px rgba(0,0,0,.22); }
.hand .card.legal { transform: rotateX(0) translateY(-2px); }
.hand .card.legal:hover { transform: rotateX(0) translateY(-6px); }
.hand .card.hint { box-shadow: 0 0 0 3px var(--gold), 0 2px 6px rgba(0,0,0,.22); }
.hand .card.picked { transform: rotateX(0) translateY(-10px) scale(1.04); box-shadow: 0 0 0 3px var(--mint), 0 6px 12px rgba(0,0,0,.35); }
.hand.dealing .card { animation: deal .35s ease-out backwards; }
@keyframes deal { from { opacity: 0; transform: translateY(18px); } }
html.large-cards { --ch: 76px; }
html.large-cards .hand { grid-template-columns: repeat(6, minmax(0, 1fr)); }
html.large-cards .hand .card { font-size: 18px; }
html.large-cards .hand .card .pip { font-size: 26px; }
.back { width: 26px; height: 36px; border-radius: 5px; border: 1.5px solid rgba(242,182,50,.7); background: repeating-linear-gradient(135deg, #14315A 0 4px, #0E2546 4px 8px); display: inline-grid; place-items: center; font-size: 11px; font-weight: 800; color: var(--gold); }
html[data-back="weave"] .back { background: repeating-linear-gradient(45deg, #14315A 0 3px, transparent 3px 6px), repeating-linear-gradient(-45deg, #1C3F6E 0 3px, #0E2546 3px 6px); }

.statusbar { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.status { flex: 1; min-width: 0; padding: 9px 12px; border-radius: var(--r); font-size: 13.5px; font-weight: 700; background: var(--surface); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status.mine { background: rgba(75,214,156,.14); color: var(--mint); }
.statusbar .btn { min-height: 42px; }

.callsheet { position: absolute; left: 8px; right: 8px; bottom: 6px; z-index: 5; background: rgba(8,22,39,.98); border: 1px solid var(--line); border-radius: 18px; padding: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.4); }
.callsheet h2 { font-size: 15px; margin: 0 0 2px; }
.callsheet p { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; }
.callgrid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
.callgrid.wide { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.callgrid button { min-height: 44px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; font-size: 16px; cursor: pointer; }
.callgrid button:hover { background: var(--surface-2); }
.callgrid button.sug { border-color: var(--gold); color: var(--gold); }

.react-pop { position: absolute; right: 8px; bottom: 58px; z-index: 6; display: grid; grid-template-columns: repeat(3, auto); gap: 6px; background: rgba(8,22,39,.96); border: 1px solid var(--line); border-radius: 16px; padding: 8px; }
.react-pop button { min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 13px; cursor: pointer; }
.banner { position: absolute; left: 50%; top: 52px; transform: translateX(-50%); z-index: 6; background: rgba(248,113,113,.95); color: #2A0A0A; font-weight: 800; font-size: 12.5px; padding: 6px 12px; border-radius: 999px; white-space: nowrap; }

/* overlays: round end, game over */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(4,10,20,.6); display: flex; align-items: flex-end; justify-content: center; padding: 0 max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-bottom, 0px)); }
.sheet .in { width: 100%; max-width: 620px; max-height: 88vh; overflow: auto; background: var(--navy); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 -10px 40px rgba(0,0,0,.4); }
.sheet h2 { font: 700 22px/1.2 var(--display); margin: 0 0 6px; text-wrap: balance; }
.eyebrow { color: var(--mint); font-size: 12px; font-weight: 800; letter-spacing: .06em; margin: 0 0 4px; }
.scroll-x { overflow-x: auto; }
table.scores { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 10px 0; }
.scores th, .scores td { padding: 7px 6px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.scores th { color: var(--muted); font-size: 12px; }
.scores td small { display: block; color: var(--dim); font-size: 11px; }
.scores .neg { color: var(--danger); } .scores .pos { color: var(--mint); }
.scores tr.total td { font-weight: 800; color: var(--gold); border-bottom: 0; }
.winner-row { display: flex; gap: 8px; align-items: center; margin: 8px 0; }

/* dialogs */
dialog { border: 1px solid var(--line); border-radius: 20px; background: var(--navy); color: var(--fg); padding: 0; width: min(560px, calc(100vw - 24px)); max-height: 86vh; }
dialog::backdrop { background: rgba(4,10,20,.65); }
.dlg { padding: 18px; overflow: auto; max-height: 86vh; }
.dlg h2 { font: 700 20px/1.2 var(--display); margin: 0 0 10px; }
.dlg h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); }
.dlg p, .dlg li { color: #DCE3EC; }
.dlg .close { float: right; }
.opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); min-height: 52px; }
.opt span small { display: block; color: var(--muted); font-size: 12px; }
.opt select, .opt input[type="text"] { min-height: 40px; border-radius: 10px; background: var(--deep); border: 1px solid var(--line); padding: 0 8px; max-width: 50%; }
.switch { position: relative; width: 48px; height: 28px; flex: 0 0 auto; }
.switch input { opacity: 0; position: absolute; inset: 0; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); pointer-events: none; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + i { background: var(--mint); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--gold); outline-offset: 2px; }
.presets { display: flex; gap: 8px; margin: 4px 0 8px; }
.tracker { display: grid; grid-template-columns: auto repeat(13, minmax(0, 1fr)); gap: 3px; font-size: 12px; align-items: center; }
.tracker span { text-align: center; padding: 4px 0; border-radius: 5px; background: var(--surface); font-weight: 700; }
.tracker span.gone { opacity: .25; text-decoration: line-through; }
.tracker span.mine { background: rgba(75,214,156,.22); }
.tracker b { padding-right: 4px; }
.hist { display: grid; gap: 6px; }
.hist div { display: flex; gap: 6px; align-items: center; font-size: 13px; flex-wrap: wrap; }
.hist .card { --cw: 32px; --ch: 44px; font-size: 12px; }
.hist .card .pip { font-size: 14px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stats div { background: var(--surface); border-radius: var(--r); padding: 10px 12px; }
.stats b { display: block; font: 700 22px/1.1 var(--display); }
.stats small { color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); opacity: 0; visibility: hidden; background: var(--fg); color: var(--navy); font-weight: 700; font-size: 14px; padding: 10px 16px; border-radius: 999px; z-index: 50; transition: transform .25s ease, opacity .25s ease, visibility .25s; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; visibility: visible; }
.steps { display: grid; gap: 10px; counter-reset: s; }
.steps li { list-style: none; position: relative; padding-left: 34px; }
.steps li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--mint); color: var(--mint-ink); display: grid; place-items: center; font-weight: 800; font-size: 13px; }

/* wider screens */
@media (min-width: 700px) {
  :root { --cw: 54px; --ch: 76px; }
  .hand { grid-template-columns: repeat(13, minmax(0, 1fr)); gap: 6px; }
  html.large-cards { --ch: 92px; }
  html.large-cards .hand { grid-template-columns: repeat(13, minmax(0, 1fr)); }
  .trick .card { --cw: 62px; --ch: 86px; }
  .seat.p1, .seat.p3 { width: auto; flex-direction: row; text-align: left; padding: 5px 10px 5px 5px; }
  .seat.p1 b, .seat.p3 b { margin: 0; }
  .trick .pc.q1 { transform: translate(24%, -50%) rotate(8deg); }
  .trick .pc.q3 { transform: translate(-124%, -50%) rotate(-9deg); }
  .callsheet { left: 50%; right: auto; transform: translateX(-50%); width: min(560px, calc(100% - 16px)); }
}
/* Tall screens (iPad upright, big laptops): bigger cards and seat plates so the table doesn't feel empty. */
@media (min-width: 700px) and (min-height: 900px) {
  :root { --ch: 84px; }
  .trick .card { --cw: 78px; --ch: 108px; font-size: 20px; }
  .trick .card i { font-size: 17px; }
  .trick .card .pip { font-size: 34px; }
  .trick .pc .who { font-size: 12.5px; bottom: -20px; }
  .trick .pc.q2 .who { top: -20px; }
  .seat { font-size: 13.5px; padding: 7px 12px 7px 7px; }
  .seat .av { width: 40px; height: 40px; font-size: 16px; }
  .seat b { font-size: 15px; }
  .felt .peaks { height: 34%; }
}
@media (min-width: 1000px) {
  .game-body { grid-template-columns: minmax(0, 1fr) 260px; grid-template-rows: minmax(0, 1fr) auto auto; column-gap: 14px; }
  .game-body .felt { grid-column: 1; grid-row: 1; }
  .game-body .statusbar { grid-column: 1; grid-row: 2; }
  .game-body .hand-wrap { grid-column: 1; grid-row: 3; }
  .game-body .side { grid-column: 2; grid-row: 1 / span 3; display: flex; }
}
.side { display: none; flex-direction: column; gap: 8px; min-height: 0; overflow: auto; }
.side h3 { font-size: 12px; color: var(--muted); margin: 6px 0 0; letter-spacing: .04em; }
.side .tool { text-align: left; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 12px; font-weight: 700; font-size: 13.5px; cursor: pointer; }
.side .mini-scores { font-size: 13px; display: grid; gap: 4px; }
.side .mini-scores div { display: flex; justify-content: space-between; gap: 8px; }
.side .reacts { display: flex; flex-wrap: wrap; gap: 6px; }
.side .reacts button { min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; font-size: 12.5px; cursor: pointer; }
@media (max-height: 640px) and (max-width: 699px) {
  :root { --cw: 42px; --ch: 56px; }
  .felt { min-height: 190px; }
  .card .pip { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
html.no-motion * { animation: none !important; transition: none !important; }
.card-box.down { border-color: color-mix(in srgb, var(--danger) 55%, var(--line)); display: grid; gap: 8px; }
.card-box.down .row { margin: 0; }
