/* The card room. Shares the pool room's look: dark wood and lamplight, gold
   accents, smoked-glass panels over a full-screen 3D table. */
:root {
  --glass: rgba(14, 12, 10, 0.66);
  --glass-2: rgba(16, 13, 10, 0.86);
  --line: rgba(255, 236, 200, 0.12);
  --line-2: rgba(217, 178, 107, 0.24);
  --ink: #efe6d6;
  --mute: #a99f8f;
  --soft: #d9cfbd;
  --gold: #d9b26b;
  --gold-2: #f1d59a;
  --bad: #f0b39f;
  --good: #a9d8b8;
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--gu-serif);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050403; overflow: hidden; color: var(--ink); font-family: var(--font); overscroll-behavior: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: manipulation; }
body.at-table #view { touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
a { color: var(--gold-2); }
.sr-only, .sr-hand { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sr-hand:focus-within { width: auto; height: auto; clip: auto; margin: 0; left: 50%; bottom: 8px; transform: translateX(-50%); display: flex; gap: 4px; pointer-events: auto; }
.sr-hand button { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--glass-2); font-size: 12px; }
[hidden] { display: none !important; }
.gu-nav { background: linear-gradient(180deg, #050403f2, #0a0806cc); border-bottom-color: rgba(217,178,107,0.18); }
.pulse { animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.nogl-note { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9; max-width: 560px; padding: 10px 16px; border-radius: 10px; background: var(--glass-2); border: 1px solid var(--line); font-size: 13px; color: var(--soft); }

/* ---------------------------------------------------------------- buttons, at the table and on the rules page (the lobby's are room.css's) */
:is(#hud, .page.rules) .go { appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 22px; border-radius: 10px; border: 0; font-size: 15px; font-weight: 600; text-decoration: none;
  color: #1d150a; background: linear-gradient(180deg, #f1d59a, #c99b4f); box-shadow: 0 6px 18px rgba(201,155,79,0.25); }
:is(#hud, .page.rules) .go:hover { filter: brightness(1.06); }
:is(#hud, .page.rules) .go:disabled, :is(#hud, .page.rules) .go[aria-disabled=true] { opacity: .5; cursor: not-allowed; filter: grayscale(.3); }
:is(#hud, .page.rules) .go.quiet { background: transparent; color: var(--gold-2); border: 1px solid rgba(217,178,107,0.45); box-shadow: none; }
:is(#hud, .page.rules) .go.quiet:hover { background: rgba(217,178,107,0.12); }
:is(#hud, .page.rules) .go.small { padding: 7px 14px; font-size: 13px; }
:is(#hud, .page.rules) .go.wide { width: 100%; }
:is(#hud, .page.rules) .go.danger { background: linear-gradient(180deg, #f2b19b, #c9654a); color: #200a05; }
:is(#hud, .page.rules) .btn { appearance: none; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,0.03); color: var(--ink); font-size: 14px; }
:is(#hud, .page.rules) .btn:hover { border-color: rgba(217,178,107,0.5); color: var(--gold-2); }
:is(#hud, .page.rules) .btn:disabled { opacity: .5; cursor: default; }
:is(#hud, .page.rules) .btn.quiet { color: var(--mute); }
:is(#hud, .page.rules) .link { appearance: none; border: 0; background: none; padding: 4px 2px; color: var(--gold-2); font-size: 13px; text-decoration: underline; text-decoration-color: rgba(217,178,107,0.4); text-underline-offset: 3px; }
:is(#hud, .page.rules) .link.danger { color: var(--bad); }
:is(#hud, .page.rules) .go:focus-visible, :is(#hud, .page.rules) .btn:focus-visible, :is(#hud, .page.rules) .link:focus-visible, :is(#hud, .page.rules) .tb:focus-visible, :is(#hud, .page.rules) a:focus-visible, :is(#hud, .page.rules) summary:focus-visible, :is(#hud, .page.rules) .combos li:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
:is(#hud, .page.rules) .row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pcard { display: inline-block; vertical-align: middle; border-radius: 6%; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.is-starter { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px; }
.is-starter .pcard { box-shadow: 0 0 0 2px var(--gold), 0 2px 6px rgba(0,0,0,.45); }
.is-starter small { font-size: 9px; text-transform: uppercase; letter-spacing: .14em; color: var(--gold); }
.eyebrow { margin: 0 0 6px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.peg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.65), transparent 45%), var(--c, #888); box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.5); }

/* ---------------------------------------------------------------- the rules: a page of its own (pages/rules.ts), over the idle table */
/* a page for reading, as the privacy page is: the table dimmed far down behind it, the room's links at the top,
   facts as small tiles, chips to each section, and sections divided by a line rather than a card each */
#lobby:has(> .room-page > .page.rules) { background: linear-gradient(180deg, #04070acc, #04070af0 420px, #04070afa); }
.page.rules { --rules-line: #d7e3e724; width: min(1080px, 100%); margin: 0 auto; padding: calc(60px + 24px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 56px max(24px, env(safe-area-inset-left, 0px)); font-family: var(--gu-sans); color: #f8f0dc; text-align: left; }
.page.rules .room-nav a:not([aria-current]) { color: #d9cfbd; }
.page.rules .room-nav a:not([aria-current]):hover { color: #f8f0dc; }
.page.rules .rules-sec a { color: #f5dfaa; }
.page.rules .rules-sec a:hover { color: #fff; }
.page.rules .rules-hero { display: flex; flex-direction: column; gap: 12px; max-width: 680px; margin: 36px 0 24px; }
.page.rules .rules-hero h1 { margin: 0; font: 400 52px/1.05 var(--gu-serif); letter-spacing: -.01em; color: #f8f0dc; }
.page.rules .rules-lead { margin: 0; font-size: 18px; line-height: 1.6; color: #d9cfbd; }
.page.rules .rules-lead b { color: #f8f0dc; }
/* the facts: small tiles */
.page.rules .facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; max-width: 820px; margin: 0 0 22px; }
.page.rules .facts div { padding: 12px 14px; border-radius: 14px; border: 1px solid #d7e3e73d; background: #0a161ecc; }
.page.rules .facts dt { font-size: 13px; color: #a9babd; }
.page.rules .facts dd { margin: 2px 0 0; font: 400 22px/1.25 var(--gu-serif); color: #f5dfaa; }
.page.rules .facts div:nth-child(2) dd { font-size: 20px; }
/* the sections: chips */
.page.rules .jump { position: sticky; top: calc(60px + env(safe-area-inset-top, 0px)); z-index: 1; display: flex; gap: 8px; flex-wrap: wrap; margin: 0 -24px 8px; padding: 10px 24px; background: linear-gradient(180deg, #04070af2, #04070ad9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.page.rules .jump a { flex: 0 0 auto; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid #d7e3e75c; color: #d9cfbd; text-decoration: none; font-size: 14px; }
.page.rules .jump a:hover { border-color: #dbbc76; color: #f8f0dc; }
.page.rules .jump a:focus-visible, .page.rules .ext:focus-visible { outline: 2px solid #dbbc76; outline-offset: 2px; }
/* the sections themselves */
.page.rules .rules-sec { padding: 36px 0; border-top: 1px solid var(--rules-line); scroll-margin-top: calc(60px + 64px); }
.page.rules .rules-sec > p, .page.rules .split > div > p { max-width: 68ch; }
.page.rules .rules-sec h2 { margin: 0 0 14px; font: 400 30px/1.2 var(--gu-serif); color: #f8f0dc; }
.page.rules .rules-sec p { margin: 0 0 14px; font-size: 17px; line-height: 1.7; color: #e3dccd; }
.page.rules .rules-sec b { color: #f8f0dc; }
.page.rules .rules-note { font-size: 15px !important; color: #b8c5c7 !important; padding-left: 14px; border-left: 2px solid #dbbc7666; }
.page.rules .split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.page.rules .split.reverse > :first-child { order: 2; }
.page.rules .scene { padding: 20px; border-radius: 16px; background: radial-gradient(ellipse at 50% 40%, #1d5a3f, #0f2e20); border: 1px solid #2f6b4f; box-shadow: inset 0 0 40px rgba(0,0,0,.45); text-align: center; }
.page.rules .scene p { display: flex; justify-content: center; gap: 10px; align-items: baseline; margin: 12px 0 0; color: #f8f0dc; font-size: 16px; }
.page.rules .scene p small { font-size: 13px; color: #d8eadf; }
.page.rules .scene p.muted { opacity: .75; }
.page.rules .cardrow { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; align-items: flex-end; }
.page.rules .callout-box { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: #0a161ecc; border: 1px solid #d7e3e73d; }
.page.rules .callout-box.gold { border-color: #dbbc7666; background: #dbbc7612; }
.page.rules .callout-box strong { color: #f5dfaa; font-weight: 600; }
.page.rules .callout-box p { margin: 6px 0 0; font-size: 15px; line-height: 1.6; color: #c7d4d4; }
.page.rules .callout-box .order { margin: 6px 0 0; padding-left: 22px; font-size: 15px; line-height: 1.6; color: #c7d4d4; }
.page.rules .callout-box .order li::marker { color: #dbbc76; }
.page.rules .grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.page.rules .notes > div { padding: 12px 0; border-bottom: 1px solid var(--rules-line); }
.page.rules .notes > div:first-child { padding-top: 0; }
.page.rules .notes b { color: #f5dfaa; font-weight: 600; }
.page.rules .notes p { margin: 4px 0 0; font-size: 15px; line-height: 1.6; color: #c7d4d4; }
.page.rules .examples { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.page.rules .example { padding: 12px; border-radius: 14px; background: #0a161ecc; border: 1px solid #d7e3e73d; display: flex; flex-direction: column; gap: 8px; }
.page.rules .example .cardrow { justify-content: flex-start; }
.page.rules .example-name { font-size: 14px; color: #d9cfbd; }
.page.rules .example strong { margin-left: 8px; color: #f5dfaa; font-size: 18px; }
.page.rules .example p { margin: 4px 0 0; font-size: 14px; line-height: 1.5; color: #a9babd; }
.page.rules .scoretable-wrap { margin: 18px 0; border: 1px solid #d7e3e73d; border-radius: 14px; overflow: hidden; background: #0a161e99; }
.page.rules .scoretable { width: 100%; border-collapse: collapse; }
.page.rules .scoretable th, .page.rules .scoretable td { text-align: left; padding: 12px 16px; border-top: 1px solid #d7e3e71f; font-size: 15px; line-height: 1.5; color: #d9cfbd; vertical-align: top; }
.page.rules .scoretable tr:first-child > * { border-top: 0; }
.page.rules .scoretable th { color: #f8f0dc; font-weight: 600; width: 120px; }
.page.rules .scoretable b { color: #f5dfaa; white-space: nowrap; }
.page.rules .worked { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; padding: 20px; border-radius: 16px; background: #dbbc760d; border: 1px solid #dbbc7647; }
.page.rules .worked h3 { font: 400 21px/1.3 var(--gu-serif); color: #f5dfaa; margin: 0 0 14px; }
.page.rules .worked .cardrow { justify-content: flex-start; }
.page.rules .worked ol { list-style: none; margin: 0; padding: 0; }
.page.rules .worked li { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.2em; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rules-line); font-size: 15px; color: #d9cfbd; }
.page.rules .worked li .kind { color: #a9babd; }
.page.rules .worked li b { color: #f5dfaa; text-align: right; }
.page.rules .worked li.total { grid-template-columns: minmax(0, 1fr) auto; border: 0; font-size: 16px; color: #f8f0dc; }
.page.rules .worked li.total .kind { display: none; }
.page.rules .is-starter small { font-size: 12px; text-transform: none; letter-spacing: 0; color: #f5dfaa; }
.page.rules .values { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 18px; }
.page.rules .values span { font-size: 14px; color: #a9babd; margin-right: 4px; }
.page.rules .values b { padding: 6px 12px; border-radius: 999px; border: 1px solid #d7e3e73d; font-weight: 500; font-size: 14px; color: #d9cfbd; }
.page.rules .cta { text-align: center; }
.page.rules .cta p { margin-left: auto; margin-right: auto; }
.page.rules .cta .row { justify-content: center; margin: 18px 0; }
.page.rules .rules-sec .go { min-height: 50px; padding: 0 28px; border-radius: 999px; background: #dbbc76; color: #081117; box-shadow: none; font-size: 16px; }
.page.rules .rules-sec .go:hover { background: #e8cc8c; color: #081117; filter: none; }
.page.rules .ext { font-size: 14px; color: #a9babd; }
@media (max-width: 760px) {
  .page.rules { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .page.rules .rules-hero { margin: 26px 0 18px; gap: 10px; }
  .page.rules .rules-hero h1 { font-size: 34px; line-height: 1.1; }
  .page.rules .rules-lead { font-size: 16px; line-height: 1.55; }
  .page.rules .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 14px; }
  .page.rules .jump { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px 4px; padding: 10px 16px; scrollbar-width: none; }
  .page.rules .jump::-webkit-scrollbar { display: none; }
  .page.rules .rules-sec { padding: 26px 0; }
  .page.rules .rules-sec h2 { font-size: 25px; }
  .page.rules .rules-sec p { font-size: 16px; line-height: 1.65; }
  .page.rules .split, .page.rules .grid2, .page.rules .worked { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .page.rules .split.reverse > :first-child { order: 0; }
  .page.rules .examples { grid-template-columns: minmax(0, 1fr); }
  .page.rules .scoretable th { width: auto; }
  .page.rules .scoretable th, .page.rules .scoretable td { padding: 10px 12px; }
  .page.rules .cta .go { width: 100%; }
}

/* the table's own bits (the reliability badge, a chip, the drawers' close button) */
.drawer .x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: transparent; color: var(--mute); font-size: 22px; }
.drawer .x:hover { background: rgba(255,255,255,.08); color: var(--ink); }
.rel { display: inline-flex; gap: 4px; align-items: baseline; padding: 2px 8px; border-radius: 999px; font-size: 11px; color: var(--gold-2); border: 1px solid rgba(217,178,107,.35); }
.rel small { color: var(--mute); }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); }

/* ================================================================ at the table */
#hud { position: fixed; inset: 0; z-index: 3; pointer-events: none; user-select: none; -webkit-user-select: none; }
#hud button, #hud input, #hud a, #hud form, #hud .countpanel, #hud .drawer, #hud details, #hud summary, #hud .combos li { pointer-events: auto; }
/* the common room client's HUD (room.css): its menu, table talk, clock bar and the end of a game; the scoreboard and
   the prompts are the table's own (play.ts), so the HUD's are left out */
.crib-play { position: absolute; inset: 0; pointer-events: none; }
#hud .score, #hud .dock-wrap .status, #hud .dock:empty { display: none; }
.labels { position: absolute; inset: 0; overflow: hidden; }
.plate, .callout { position: absolute; left: 0; top: 0; will-change: transform; }

/* toolbar */
.toolbar { position: absolute; left: calc(68px + env(safe-area-inset-left, 0px)); top: calc(14px + env(safe-area-inset-top, 0px)); display: flex; gap: 6px; }
.tb { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: 12.5px; letter-spacing: .04em; }
.tb:hover, .tb.open { border-color: rgba(217,178,107,0.5); color: var(--gold-2); }
.tb-icon { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tb.unread { border-color: var(--gold); color: var(--gold-2); animation: ring 1s ease-in-out 3; }
.tb.unread::after { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
@keyframes ring { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }

/* scoreboard */
.scoreboard { position: absolute; top: calc(12px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); display: flex; align-items: stretch;
  background: var(--glass); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; pointer-events: none; }
.scoreboard .side { display: flex; align-items: center; gap: 10px; padding: 8px 16px; min-width: 220px; transition: background .25s; }
.scoreboard .side.right { flex-direction: row-reverse; text-align: right; }
.scoreboard .side.on { background: linear-gradient(180deg, rgba(217,178,107,0.18), rgba(217,178,107,0.02)); }
.scoreboard .peg { width: 14px; height: 14px; }
.scoreboard .who { flex: 1; min-width: 0; }
.scoreboard .name { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.scoreboard .grp { font-size: 11px; color: var(--mute); letter-spacing: .04em; margin-top: 2px; white-space: nowrap; }
.scoreboard .tally { display: flex; align-items: baseline; gap: 2px; }
.scoreboard .pts { font: 400 30px/1 var(--serif); color: var(--gold-2); font-variant-numeric: tabular-nums; min-width: 1.6em; text-align: right; transition: transform .15s; }
.scoreboard .pts.bump { transform: scale(1.12); }
.scoreboard .tally small { font-size: 12px; color: var(--mute); }
.scoreboard .mid { white-space: nowrap; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 6px 16px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
.scoreboard .mid span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.scoreboard .mid b { font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }

/* the turn clocks */
.timers { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); right: calc(14px + env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.tclock { padding: 6px 12px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tclock i { font-style: normal; color: var(--gold-2); }
.tclock small { margin-left: 6px; color: var(--mute); }
.tclock.urgent { color: #ffd0bd; border-color: rgba(220,90,60,0.7); background: rgba(80,20,10,0.6); }

/* the count dial and the prompt */
.dial { position: absolute; left: calc(18px + env(safe-area-inset-left, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 116px; padding: 12px 10px 10px; border-radius: 16px; text-align: center;
  background: radial-gradient(circle at 50% 30%, rgba(60,44,20,0.92), rgba(16,13,10,0.92)); border: 1px solid rgba(217,178,107,0.45); box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.dial small { display: block; font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.dial b { display: block; font: 400 46px/1.05 var(--serif); color: var(--gold-2); font-variant-numeric: tabular-nums; }
.dial span { font-size: 11px; color: var(--mute); }
.dial .bar { display: block; height: 4px; margin-top: 8px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) var(--p), rgba(255,255,255,.08) var(--p)); }
.actions { position: absolute; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); max-width: min(680px, calc(100vw - 280px));
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 16px; background: rgba(14,11,8,0.84); border: 1px solid var(--line);
  box-shadow: 0 10px 30px rgba(0,0,0,.45); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: border-color .25s, box-shadow .25s; }
.actions:not(:has(.btns)) { padding-right: 18px; }
.actions .msg { margin: 0; padding: 4px 0; font-size: 14px; line-height: 1.4; color: var(--soft); }
.actions .btns { display: flex; gap: 8px; flex: none; }
.actions .go { pointer-events: auto; white-space: nowrap; }
.actions.act { border-color: rgba(217,178,107,0.7); animation: beckon 2.2s ease-in-out infinite; }
.actions.act .msg { color: var(--ink); }
@keyframes beckon { 0%, 100% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 0 rgba(217,178,107,0); } 50% { box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 26px 2px rgba(217,178,107,.35); } }
.sorter { position: absolute; right: calc(18px + env(safe-area-inset-right, 0px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); max-width: min(300px, 26vw);
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.sorter .msg { margin: 0; padding: 9px 14px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); font-size: 13.5px; line-height: 1.4; color: var(--soft); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.sorter .link { background: rgba(10,8,6,.6); border-radius: 8px; padding: 6px 10px; pointer-events: auto; }

/* name plates and callouts on the table */
.plate { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 999px; background: rgba(12,10,8,0.78); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; transition: border-color .2s, box-shadow .2s; }
.plate b { font-weight: 600; }
.plate small { color: var(--mute); font-size: 11px; }
.plate .chip { font-style: normal; padding: 2px 7px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--gold); border-color: rgba(217,178,107,.4); }
.plate em { font-style: normal; color: var(--gold-2); font-size: 12px; }
.plate.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217,178,107,.18), 0 0 18px rgba(217,178,107,.35); }
.callout { display: flex; flex-direction: column; align-items: center; padding: 8px 16px 9px; border-radius: 14px; background: rgba(20,15,8,0.9); border: 1px solid rgba(217,178,107,0.6);
  box-shadow: 0 10px 30px rgba(0,0,0,.5), 0 0 24px rgba(217,178,107,.25); animation: pop .35s cubic-bezier(.2,1.6,.4,1); transition: opacity .6s; white-space: nowrap; }
.callout small { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
.callout strong { font: 400 32px/1.05 var(--serif); color: var(--gold-2); }
.callout span { font-size: 12.5px; color: var(--soft); }
.callout.small strong { font-size: 24px; }
.callout.fading { opacity: 0; }
@keyframes pop { from { opacity: 0; transform: scale(.6); } }

/* the count */
.countpanel { position: absolute; right: calc(14px + env(safe-area-inset-right, 0px)); top: calc(78px + env(safe-area-inset-top, 0px)); bottom: calc(120px + env(safe-area-inset-bottom, 0px)); width: min(310px, 28vw);
  display: flex; flex-direction: column; border-radius: 16px; background: rgba(14,11,8,0.88); border: 1px solid rgba(217,178,107,0.25); box-shadow: 0 20px 60px rgba(0,0,0,.5); overflow: hidden; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.countpanel header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto; align-items: center; }
.countpanel header span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold); }
.countpanel h2 { margin: 2px 0 0; font: 400 22px var(--serif); grid-column: 1; }
.countpanel .starter { grid-column: 2; grid-row: 1 / 3; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.countpanel .starter small { font-size: 9.5px; color: var(--mute); text-align: center; max-width: 90px; }
/* phones: folded to each player's points and "Show scoring" (play.ts) */
.countpanel.folded { bottom: auto; }
.ctotals { padding: 8px 14px 12px; display: grid; gap: 4px; }
.ctotals div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 13px; color: var(--soft); }
.ctotals b { font: 400 18px var(--serif); color: var(--gold-2); }
.count-toggle { justify-self: start; align-self: flex-start; margin-top: 6px; }
.crows .count-toggle { margin: 0 0 2px; flex: none; }
.crows { overflow-y: auto; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.crow { padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255,255,255,.02); transition: border-color .2s, background .2s; }
.crow.active { border-color: var(--gold); background: rgba(217,178,107,.08); }
.crow.uncounted { opacity: .75; }
.crow header { display: flex; justify-content: space-between; align-items: baseline; padding: 0; border: 0; }
.crow header small { color: var(--mute); font-size: 11px; }
.crow .ctotal { font: 400 22px var(--serif); color: var(--gold-2); }
.ccards { display: flex; gap: 4px; margin: 6px 0; }
.combos { list-style: none; margin: 0; padding: 0; }
.combos li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; font-size: 12.5px; color: var(--soft); cursor: default; }
.combos li:hover, .combos li:focus { background: rgba(217,178,107,.12); outline: none; }
.combos .mini { display: flex; gap: 2px; }
.combos .mini .starter { box-shadow: 0 0 0 1.5px var(--gold); }
.combos .clabel { flex: 1; }
.combos b { color: var(--gold-2); }
.nothing { margin: 4px 0 0; font-size: 12.5px; color: var(--mute); }
.crow .note { color: var(--mute); font-size: 11px; }

/* drawers */
.drawer { position: absolute; left: calc(14px + env(safe-area-inset-left, 0px)); top: calc(62px + env(safe-area-inset-top, 0px)); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); width: min(340px, calc(100vw - 28px));
  display: flex; flex-direction: column; padding: 16px; border-radius: 16px; background: rgba(12,10,8,0.94); border: 1px solid rgba(217,178,107,0.25); box-shadow: 0 20px 60px rgba(0,0,0,.55); overflow: hidden; z-index: 2; }
.drawer h2 { margin: 0 0 10px; font: 400 21px var(--serif); }
.drawer > .guide, .drawer > .history { overflow-y: auto; flex: 1; }
.guide { display: flex; flex-direction: column; gap: 8px; }
.guide-row { display: flex; gap: 12px; align-items: center; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.03); border: 1px solid var(--line); }
.guide-cards { display: flex; gap: 2px; flex: none; min-width: 120px; }
.guide-row strong { font-size: 14px; }
.guide-row b { margin-left: 8px; color: var(--gold-2); font-size: 12.5px; }
.guide-row p { margin: 2px 0 0; font-size: 12px; color: var(--mute); }
.hh { border-bottom: 1px solid var(--line); padding: 6px 0; }
.hh summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; }
.hh summary small { color: var(--mute); }
.hh-body { display: flex; flex-direction: column; gap: 8px; padding: 6px 0; }
.hh-starter { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--mute); }
.hh-row header { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--soft); }
.hh-row b { color: var(--gold-2); }
.hh-cards { display: flex; gap: 3px; margin-top: 4px; }
.empty { color: var(--mute); font-size: 13px; }

/* the table's own notes */
.toast { position: fixed; z-index: 8; top: calc(78px + env(safe-area-inset-top, 0px)); left: 50%; transform: translate(-50%, -8px); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none;
  padding: 9px 18px; border-radius: 999px; background: rgba(16,13,10,0.92); border: 1px solid var(--line-2); font-size: 14px; max-width: calc(100vw - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* iPhone Safari can't lock the orientation: in portrait, ask for the phone to be turned */
.rotate { display: none; }
@media (orientation: portrait) and (pointer: coarse) {
  body.at-table .rotate { position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 32px;
    background: #050403; color: var(--ink); text-align: center; font-size: 17px; line-height: 1.5; }
  body.at-table .rotate svg { width: 72px; height: 72px; stroke: var(--gold-2); fill: none; stroke-width: 1.5; animation: tilt 2.4s ease-in-out infinite; }
}
@keyframes tilt { 0%, 30% { transform: rotate(0deg); } 60%, 100% { transform: rotate(-90deg); } }

/* ---------------------------------------------------------------- smaller screens */
@media (max-width: 900px) {
  .page.rules .grid2, .page.rules .split, .page.rules .page-hero.split, .page.rules .worked { grid-template-columns: 1fr; }
  .page.rules .split.reverse > :first-child { order: 0; }
  .page.rules .steps, .page.rules .facts { grid-template-columns: repeat(2, 1fr); }
  .page.rules .examples { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .page.rules .steps { grid-template-columns: 1fr; }
  .page.rules .panel-sec { padding: 20px 18px; }
}
@media (max-width: 1360px) {
  .tb span { display: none; }
  .tb { padding: 8px; }
}
@media (max-height: 560px), (max-width: 760px) {
  .scoreboard .side { min-width: 0; padding: 5px 10px; gap: 7px; }
  .scoreboard .name { max-width: 110px; font-size: 13px; }
  .scoreboard .grp { display: none; }
  .scoreboard .pts { font-size: 22px; }
  .scoreboard .mid { padding: 4px 10px; }
  .dial { width: 86px; padding: 8px 6px; left: 10px; bottom: 10px; }
  .dial b { font-size: 32px; }
  .actions { gap: 10px; padding: 6px 6px 6px 12px; max-width: calc(100vw - 230px); }
  .actions .msg { font-size: 12px; }
  .actions .go { padding: 8px 14px; font-size: 13px; }
  .sorter { right: 10px; bottom: 10px; }
  .countpanel { top: 54px; bottom: 64px; width: 36vw; }
  .crib-play[data-phase=count] .actions .msg { display: none; }
  .sorter { max-width: 25vw; }
  .sorter .msg { font-size: 12px; padding: 7px 10px; }
  .countpanel header { padding: 8px 12px 6px; }
  .countpanel h2 { font-size: 17px; }
  .crow { padding: 7px 9px; }
  .crow .ctotal { font-size: 18px; }
  .drawer { top: 54px; bottom: 12px; }
  .callout strong { font-size: 24px; }
  .plate { font-size: 12px; padding: 4px 9px; }
}
@media (prefers-reduced-motion: reduce) { .pulse, .callout, .tb.unread, .actions.act { animation: none; } .toast { transition: none; } }
