/* Playful & bold: cream paper, thick ink outlines, hard offset shadows, one accent colour per game.
   Colours that carry text are chosen for contrast on cream/white; the bright fills are for backgrounds only. */
:root {
  --bg: #fff4e0;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #ffebcb;
  --text: #1b1340;
  --muted: #5b5575;
  --edge: #1b1340;   /* outlines */
  --pop: #1b1340;    /* hard shadows */
  --accent: #ff5a5f;
  --accent-2: #ffc93c;
  --good: #0b7a68;   /* teal as text */
  --good-fill: #19c3a8;
  --bad: #c62e34;
  --violet: #7b61ff;
  --radius: 20px;
  --display: "Fredoka", ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --g-imposter: #ff5a5f;
  --g-pincode: #19c3a8;
  --g-dungeon: #ffc93c;
  --g-delve: #7b61ff;
  --g-categories: #ff8fb8;
  --g-whoami: #4da3ff;
  --g-thinkandsink: #19c3a8;
  --g-lastletter: #ff9f43;
  --g-tictactoe: #5ad1e6;
  --g-mostlikely: #c58bff;
  --g-wouldyourather: #5fd38d;
  --g-twotruths: #ff7a59;
  --g-letterduel: #ff6fb5;
  --g-magnetring: #ff7a59;
  --g-shutthebox: #d9a066;
  --g-werewolf: #8f7bd6;
  --g-drawguess: #ff8a3d;
  --g-telephone: #4fc3f7;
  --g-fakeartist: #b388ff;
  --g-twelveletters: #ffb347;
  --g-poker: #2fb36d;
  --g-liarsdeck: #e0556b;
  --g-spycards: #4fb3a5;
  --g-blackjack: #2f9e6e;
}

/* Night themes: dark paper + lighter outlines. Fills (coral/yellow/teal) and the ink text on them stay the same. */
:root[data-theme="midnight"], :root[data-theme="graphite"], :root[data-theme="forest"], :root[data-theme="ember"], :root[data-theme="crimson"], :root[data-theme="oled"], :root[data-theme="violet"] {
  color-scheme: dark; --pop: #05030f; --good: #5ff0d0; --bad: #ff8d98;
}
:root[data-theme="midnight"] { --bg: #0b1526; --bg-2: #101f38; --card: #15284a; --card-2: #1e3560; --text: #eaf2ff; --muted: #9fb3d6; --edge: #5b8fd6; }
:root[data-theme="graphite"] { --bg: #121212; --bg-2: #1b1b1d; --card: #232326; --card-2: #2e2e33; --text: #f2f2f2; --muted: #a9a9b2; --edge: #8a8a94; --pop: #000; }
:root[data-theme="forest"] { --bg: #0d1f17; --bg-2: #132a20; --card: #183528; --card-2: #214636; --text: #e9f7ee; --muted: #9cc4ab; --edge: #4fae83; }
:root[data-theme="ember"] { --bg: #1c1210; --bg-2: #261a16; --card: #2f211b; --card-2: #402d24; --text: #fff1e6; --muted: #d0b09c; --edge: #c9825a; }
:root[data-theme="crimson"] { --bg: #1f0c10; --bg-2: #2a1117; --card: #351821; --card-2: #4a2230; --text: #ffeef0; --muted: #dfaab2; --edge: #e0525e; --good: #6ff0cf; }
:root[data-theme="oled"] { --bg: #000; --bg-2: #0d0d0f; --card: #151517; --card-2: #232327; --text: #f5f5f7; --muted: #a0a0aa; --edge: #6b6b75; --pop: #2a2a30; }
:root[data-theme="violet"] { --bg: #120e2b; --bg-2: #1b1540; --card: #221a49; --card-2: #2f2563; --text: #f3efff; --muted: #b7b0dc; --edge: #8f83e6; }
:root[data-theme="midnight"] #toast, :root[data-theme="graphite"] #toast, :root[data-theme="forest"] #toast, :root[data-theme="ember"] #toast, :root[data-theme="crimson"] #toast, :root[data-theme="oled"] #toast, :root[data-theme="violet"] #toast { background: var(--text); color: #1b1340; }
.themewrap { position: relative; display: inline-flex; }
.thememenu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 40; display: flex; flex-direction: column; gap: 2px; min-width: 170px; padding: 6px; background: var(--card); color: var(--text); border: 2.5px solid var(--edge); border-radius: 16px; box-shadow: 4px 4px 0 var(--pop); }
.themeopt { font: inherit; font-family: var(--display); font-weight: 600; display: flex; align-items: center; gap: 10px; background: transparent; color: var(--text); border: 0; border-radius: 10px; padding: 8px 10px; min-height: 44px; cursor: pointer; text-align: left; }
.themeopt i { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--edge); flex: none; }
.themeopt.on { background: var(--card-2); }
@media (max-width: 480px) {
  .topbar:has(.code-big) { flex-wrap: wrap; }
  .topbar:has(.code-big) .grow { flex: 1 0 100%; }
  .topbar:has(.code-big) > .btn.small { margin-right: auto; }
}
.av.pic { object-fit: cover; background: #fff; }
.av.xl { width: 84px; height: 84px; font-size: 2.2rem; }
.profilebtn .av { border-width: 0; width: 100%; height: 100%; border-radius: 12px; }
.card.whoami {  flex-direction: row; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: var(--text); cursor: pointer; padding: 10px 14px; }
.card.whoami .grow { flex: 1; min-width: 0; }
.card.whoami b { display: block; font-family: var(--display); font-size: 1.1rem; }
.acc-body { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 8px; }
.acc-form { display: flex; flex-direction: column; gap: 12px; }
.acc-head { display: flex; align-items: center; gap: 14px; }
.acc-id b { display: block; font-family: var(--display); font-size: 1.3rem; }
.acc-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.acc-row .btn { width: auto; }
.acc-error { color: var(--bad); font-weight: 600; min-height: 1.2em; font-size: 0.9rem; }
.seg-row { display: flex; gap: 8px; }
.seg-row .seg { flex: 1; }
.filebtn { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.btn.danger { color: var(--bad); }
.g-btn { display: flex; justify-content: center; min-height: 44px; }
.homebar { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 4px; }
.langbtn { font-family: var(--display); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.02em; }
.langtag { display: inline-grid; place-items: center; width: 28px; height: 24px; border: 2px solid var(--edge); border-radius: 8px; font-size: 0.7rem; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.4;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Dice Delve keeps its dark, realm-coloured look: its page uses a dark scheme for the shared chrome. */
body:has(.delve) {
  --text: #f4f2ff; --muted: #c4c0ea; --edge: rgba(255, 255, 255, 0.28); --pop: rgba(0, 0, 0, 0.45);
  --card: rgba(0, 0, 0, 0.32); --card-2: rgba(255, 255, 255, 0.12); --bg-2: rgba(0, 0, 0, 0.35);
  --good: #7ef0c6; --bad: #ff8d98; --accent-2: #ffe27a;
}

#app { max-width: 520px; margin: 0 auto; padding: 20px 16px 28px; display: flex; flex-direction: column; gap: 14px; }

h1, h2, h3, p { margin: 0; }
h2 { font-family: var(--display); font-size: 1.2rem; font-weight: 600; letter-spacing: 0.01em; }
small, .muted { color: var(--muted); }
.center { text-align: center; }

/* ---- Buttons & inputs ---- */
.btn {
  font: inherit; font-family: var(--display); font-weight: 600; font-size: 1.05rem; color: var(--text);
  background: var(--card); border: 2.5px solid var(--edge); border-radius: 16px; box-shadow: 3px 3px 0 var(--pop);
  min-height: 52px; padding: 10px 18px; cursor: pointer; width: 100%;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn.primary:disabled { opacity: 1; background: color-mix(in srgb, var(--accent-2) 30%, var(--card)); color: var(--muted); border-style: dashed; }
.btn.primary { background: var(--accent-2); color: #1b1340; box-shadow: 4px 4px 0 var(--pop); }
.btn.hot { background: var(--accent); color: #1b1340; }
.btn.big { min-height: 58px; font-size: 1.3rem; border-radius: 18px; }
.btn.small { min-height: 40px; padding: 6px 14px; font-size: 0.95rem; width: auto; border-radius: 14px; border-width: 2px; box-shadow: none; }
.btn.ghost { background: transparent; border-width: 2px; box-shadow: none; color: var(--text); }
.btn.danger { background: #ffe1e1; color: var(--bad); }

.iconbtn {
  position: relative; width: 44px; height: 44px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--text); border: 2px solid var(--edge); border-radius: 14px; flex: none;
}
.iconbtn:active { transform: translate(1px, 1px); }
.iconbtn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

input[type="text"], input[type="password"], input:not([type]) {
  font: inherit; color: var(--text); background: var(--bg-2);
  border: 2.5px solid var(--edge); border-radius: 16px; min-height: 52px;
  padding: 10px 14px; width: 100%; outline: none;
}
input::placeholder { color: var(--muted); opacity: 0.8; }
input:focus-visible, .btn:focus-visible, .iconbtn:focus-visible, .gtile:focus-visible, .mode:focus-visible, .seg:focus-visible {
  outline: 3px solid var(--violet); outline-offset: 2px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 0.75rem; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; }

/* ---- Home ---- */
.home { display: flex; flex-direction: column; gap: 14px; padding-top: 6vh; }
.logo { font-family: var(--display); font-size: clamp(3rem, 16vw, 4.2rem); line-height: 0.95; font-weight: 700; letter-spacing: -0.01em; }
.logo span { display: block; color: var(--accent); text-shadow: 3px 3px 0 var(--pop); transform: rotate(-2deg); transform-origin: left; }
.home .sub { color: var(--muted); margin-bottom: 8px; font-size: 1.05rem; }
.or { text-align: center; color: var(--muted); font-size: 0.9rem; margin: 4px 0; font-weight: 600; }
.join-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.join-row input { text-transform: uppercase; letter-spacing: 0.4em; text-align: center; font-family: var(--display); font-weight: 700; font-size: 1.4rem; }
.join-row .btn { width: 110px; }
.homecols, .homemain { display: flex; flex-direction: column; gap: 14px; }
@media (min-width: 1000px) {
  .home { padding-top: 2vh; }
  .homecols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
  .publist { margin-top: 56px; }
  .publist-rows { max-height: calc(100dvh - 300px); }
}
.vishelp { display: block; margin-top: -6px; }
.ownrooms { gap: 8px; width: 100%; }
.ownrooms h2 { font-size: 1.05rem; }
.ownrooms .publist-rows { max-height: 28vh; }
.ownrooms-row { display: flex; gap: 8px; flex-wrap: wrap; }
.publist { gap: 8px; }
.publist h2 { font-size: 1.05rem; }
.publist-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 38vh; overflow-y: auto; }
.pubroom { display: flex; align-items: center; gap: 10px; }
.pubroom .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pubroom small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pubroom .btn { width: auto; }

/* ---- Cards & layout ---- */
.card { background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card.center { align-items: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topbar .actions { display: flex; gap: 8px; }
.topbar .grow { flex: 1; min-width: 0; }
.roomcode { font-family: var(--display); font-weight: 700; font-size: 1.25rem; letter-spacing: 0.18em; }
.code-big { font-family: var(--display); font-size: clamp(1.7rem, 8vw, 2.4rem); font-weight: 700; letter-spacing: 0.14em; color: var(--text); line-height: 1.05; }
.eyebrow { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; }
.count { background: var(--edge); color: var(--bg); border-radius: 999px; padding: 1px 9px; font-size: 0.85rem; margin-left: 6px; font-family: var(--font); font-weight: 600; }
body:has(.delve) .count { background: rgba(255, 255, 255, 0.2); color: var(--text); }
.banner { background: var(--accent-2); color: #1b1340; border: 2px solid var(--edge); border-radius: 12px; padding: 8px 12px; font-size: 0.85rem; font-weight: 600; text-align: center; }
.sect-title { font-family: var(--display); font-weight: 600; font-size: 1.15rem; }

/* ---- Players (avatars) ---- */
.av { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--edge); display: grid; place-items: center; font-family: var(--display); font-weight: 700; font-size: 1.35rem; color: #1b1340; position: relative; flex: none; }
.av.sm { width: 36px; height: 36px; font-size: 0.95rem; }
.av.xs { width: 26px; height: 26px; font-size: 0.75rem; border-width: 1.5px; }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 14px 16px; }
.pl { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 62px; position: relative; font-size: 0.8rem; font-weight: 600; text-align: center; }
.pl .nm { max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl.away { opacity: 0.45; }
.pl .tag { position: absolute; top: -8px; right: -4px; background: var(--accent-2); color: #1b1340; border: 2px solid var(--edge); border-radius: 8px; font-size: 0.55rem; font-weight: 800; padding: 1px 4px; letter-spacing: 0.04em; }
.pl .tag.bot { background: var(--card-2); color: var(--text); }
.pl .x { position: absolute; top: -6px; left: -4px; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--edge); background: var(--card); color: var(--text); font: 700 0.7rem/1 var(--font); cursor: pointer; padding: 0; }
.pl .x:hover { background: #ffe1e1; color: #1b1340; }
.addbot { width: 54px; height: 54px; border-radius: 50%; border: 2px dashed var(--edge); background: transparent; color: var(--text); display: grid; place-items: center; cursor: pointer; padding: 0; }
.addbot svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }

/* ---- Game picker (tiles) ---- */
.games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .games { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.gtile { --g: var(--accent); text-align: left; background: color-mix(in srgb, var(--g) 30%, var(--card)); border: 2px solid var(--edge); border-radius: 14px; padding: 7px 10px; color: var(--text); font: inherit; min-height: 52px; display: flex; flex-direction: row; align-items: center; gap: 8px; width: 100%; position: relative; }
button.gtile { cursor: pointer; }
.gtile .ico { flex: none; width: 22px; height: 22px; stroke: var(--edge); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gtile > span { min-width: 0; }
.gtile strong { display: block; font-family: var(--display); font-weight: 700; font-size: 0.95rem; line-height: 1.1; }
.gtile small { font-size: 0.68rem; font-weight: 600; }
.gtile.selected { background: var(--g); border: 2.5px solid var(--edge); box-shadow: 3px 3px 0 var(--pop); color: #1b1340; }
.gtile.selected small { color: #1b1340; }
.gtile .tick { position: absolute; top: 5px; right: 6px; width: 16px; height: 16px; display: none; }
.gtile.selected .tick { display: block; }
.gtile .tick circle { fill: #fff; stroke: var(--edge); stroke-width: 2.5; }
.gtile .tick path { fill: none; stroke: var(--edge); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.g-imposter { --g: var(--g-imposter); } .g-pincode { --g: var(--g-pincode); } .g-dungeon { --g: var(--g-dungeon); } .g-delve { --g: var(--g-delve); } .g-categories { --g: var(--g-categories); } .g-whoami { --g: var(--g-whoami); } .g-thinkandsink { --g: #b6e35a; } .g-lastletter { --g: var(--g-lastletter); } .g-tictactoe { --g: var(--g-tictactoe); } .g-mostlikely { --g: var(--g-mostlikely); } .g-wouldyourather { --g: var(--g-wouldyourather); } .g-twotruths { --g: var(--g-twotruths); } .g-letterduel { --g: var(--g-letterduel); } .g-drawguess { --g: var(--g-drawguess); } .g-telephone { --g: var(--g-telephone); } .g-fakeartist { --g: var(--g-fakeartist); } .g-twelveletters { --g: var(--g-twelveletters); } .g-poker { --g: var(--g-poker); } .g-liarsdeck { --g: var(--g-liarsdeck); } .g-spycards { --g: var(--g-spycards); } .g-blackjack { --g: var(--g-blackjack); } .g-magnetring { --g: var(--g-magnetring); } .g-shutthebox { --g: var(--g-shutthebox); } .g-werewolf { --g: var(--g-werewolf); }
.g-delve.selected, .g-delve.selected small { color: #fff; }
.g-delve.selected .ico { stroke: #fff; }
.hint { color: var(--muted); font-size: 0.9rem; text-align: center; }

/* ---- Mode presets ---- */
.modes { display: flex; flex-wrap: wrap; gap: 8px; }
.mode { height: 42px; padding: 0 16px; border: 2px solid var(--edge); border-radius: 999px; background: var(--card); color: var(--text); font-family: var(--display); font-weight: 600; font-size: 1rem; }
button.mode { cursor: pointer; }
.mode.selected { background: var(--edge); color: var(--bg); }
.mode.custom { border-style: dashed; background: transparent; }
.mode.custom.selected { border-style: solid; background: var(--edge); color: var(--bg); }
.modedesc { border: 2px solid var(--edge); border-radius: 16px; background: var(--bg-2); padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; font-size: 0.92rem; color: var(--text); }
.quick { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--display); font-weight: 600; }
.quick small { display: block; font-family: var(--font); font-weight: 500; }
.sw { width: 50px; height: 30px; border-radius: 999px; border: 2px solid var(--edge); background: var(--card-2); position: relative; padding: 0; flex: none; }
button.sw { cursor: pointer; }
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--edge); transition: transform 0.12s ease; }
.sw.on { background: var(--good-fill); }
.sw.on::after { transform: translateX(20px); }

/* ---- Lobby settings ---- */
.opt { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.opt-label { font-weight: 700; font-family: var(--display); font-size: 1.02rem; }
.segs { display: flex; gap: 6px; flex-wrap: wrap; }
.seg { flex: 1; min-width: 64px; text-align: center; padding: 10px 10px; border-radius: 12px; border: 2px solid var(--edge); background: var(--card); color: var(--text); font: inherit; font-weight: 700; font-size: 0.92rem; }
button.seg { cursor: pointer; }
.seg.selected { background: var(--accent-2); color: #1b1340; box-shadow: 2px 2px 0 var(--pop); }
.group { border-top: 2px dashed var(--card-2); margin-top: 8px; padding-top: 4px; }
.group:first-of-type { border-top: none; }
.group-head { width: 100%; display: flex; justify-content: space-between; align-items: center; background: none; border: none; color: var(--text); font-family: var(--display); font-weight: 600; font-size: 1.05rem; padding: 10px 0; cursor: pointer; }

/* ---- Pinned action bar: sticks to the bottom of the screen while its natural spot is below the fold ---- */
.dock { position: sticky; bottom: 0; z-index: 5; display: flex; flex-direction: column; gap: 10px; margin: 0 -16px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 2px solid var(--edge); }
body:has(.delve) .dock { background: transparent; border-top: none; }

/* ---- Imposter ---- */
.timer { display: inline-block; font-family: var(--display); font-size: 2.2rem; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--accent-2); color: #1b1340; border: 2px solid var(--edge); border-radius: 14px; padding: 0 14px; line-height: 1.3; }
.timer.low { background: var(--accent); }
.gamehead { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { background: var(--accent-2); color: #1b1340; border: 2px solid var(--edge); font-weight: 700; font-size: 0.8rem; padding: 4px 12px; border-radius: 999px; }
.pill.alt { background: var(--card); color: var(--text); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.steps li { flex: 1; display: flex; flex-direction: column; gap: 4px; align-items: center; font-size: 0.65rem; font-weight: 700; color: var(--muted); }
.steps i { width: 100%; height: 10px; border-radius: 5px; background: var(--card); border: 2px solid var(--edge); }
.steps li.done i { background: var(--edge); opacity: 0.55; }
.steps li.now { color: var(--text); }
.steps li.now i { background: var(--edge); }
.board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.board li { display: flex; align-items: center; gap: 10px; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 14px; padding: 7px 12px; font-weight: 600; }
.board li .who { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; }
.board .what { color: var(--muted); font-weight: 600; text-align: right; overflow-wrap: anywhere; font-size: 0.9rem; }
.board li.done .what { color: var(--good); }
.board li.now { background: var(--accent-2); box-shadow: 3px 3px 0 var(--pop); border-width: 2.5px; }
.board li.now .what { color: #1b1340; }
.turn-banner { width: 100%; text-align: center; }
.turn-banner .big { font-family: var(--display); font-size: 2.1rem; font-weight: 700; line-height: 1.1; margin: 4px 0; }
.turn-banner p { margin: 4px 0 0; }
.card:has(.turn-banner.mine) { background: var(--accent); box-shadow: 5px 5px 0 var(--pop); border-width: 2.5px; }
.card:has(.turn-banner.mine) .eyebrow { color: #1b1340; }
.clue-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; width: 100%; }
.card .clue-form { margin-top: 12px; }
.clue-form .btn { width: 96px; }
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(27, 19, 64, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.overlay-card { width: 100%; max-width: 520px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; background: var(--card); color: var(--text); border: 2.5px solid var(--edge); border-bottom: none; border-radius: 24px 24px 0 0; padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); }
.overlay-card .sheet-head { position: sticky; top: 0; background: var(--card); padding-left: 0; padding-right: 0; }
.rules h3 { margin: 16px 0 6px; font-family: var(--display); font-size: 1.1rem; font-weight: 600; color: var(--accent); }
.rules p, .rules li { line-height: 1.45; }
.rules ol, .rules ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.category { font-family: var(--display); font-size: 1.7rem; font-weight: 700; }
.secret {
  width: 100%; min-height: 150px; border: 3px dashed var(--edge); background: var(--bg-2);
  color: var(--text); border-radius: var(--radius); font-family: var(--display); font-weight: 600; font-size: 1.2rem; cursor: pointer;
}
.reveal { width: 100%; border: 2.5px solid var(--edge); border-radius: 24px; padding: 22px 14px; text-align: center; box-shadow: 5px 5px 0 var(--pop); color: #1b1340; }
.reveal.crew { background: var(--good-fill); }
.reveal.fake { background: var(--accent); }
.reveal .big { font-family: var(--display); font-size: 3rem; font-weight: 700; line-height: 1.1; margin: 6px 0; }
.reveal .muted, .reveal small { color: #1b1340; }
.order { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: turn; width: 100%; }
.order li { counter-increment: turn; display: flex; align-items: center; gap: 12px; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 14px; padding: 10px 14px; font-weight: 600; }
.order li::before { content: counter(turn); background: var(--accent-2); color: #1b1340; border: 2px solid var(--edge); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 0.85rem; font-weight: 700; flex: none; }
.votes { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.vote-btn { display: flex; align-items: center; justify-content: space-between; text-align: left; gap: 10px; }
.vote-btn.picked { background: var(--accent-2); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; }
.result-banner { border: 2.5px solid var(--edge); border-radius: 24px; padding: 22px 16px; text-align: center; font-weight: 700; box-shadow: 5px 5px 0 var(--pop); color: #1b1340; }
.result-banner.win { background: var(--good-fill); }
.result-banner.lose { background: var(--accent); }
.result-banner .title { font-family: var(--display); font-size: 2.1rem; line-height: 1.1; }
.result-banner .why { font-weight: 500; font-size: 0.95rem; margin-top: 6px; }
.facts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.fact { display: flex; justify-content: space-between; gap: 12px; }
.fact b { color: var(--text); font-family: var(--display); font-size: 1.05rem; }
.tally { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.tally-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-weight: 600; }
.bar { grid-column: 1 / -1; height: 10px; border-radius: 5px; background: var(--card-2); border: 1.5px solid var(--edge); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--violet); }
.tally-row.imp .bar > i { background: var(--accent); }
.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.chaos { background: #ece7ff; border-color: var(--violet); }
.chaos b { font-family: var(--display); }

/* ---- Chat ---- */
.badge {
  position: absolute; top: -7px; right: -7px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: #1b1340; border: 2px solid var(--edge); font: 700 0.7rem/1 var(--font); display: grid; place-items: center;
}
.badge[hidden] { display: none; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; max-width: 520px; margin: 0 auto;
  height: min(70vh, 520px); height: min(70dvh, 520px);
  background: var(--card); color: var(--text); border: 2.5px solid var(--edge); border-bottom: none; border-radius: 24px 24px 0 0;
  display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom);
}
.sheet[hidden] { display: none; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 6px; font-family: var(--display); font-size: 1.1rem; }
.chat-list { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 8px; overscroll-behavior: contain; }
.msg { align-self: flex-start; max-width: 85%; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 14px; padding: 6px 12px; }
.msg.me { align-self: flex-end; background: var(--accent-2); }
.msg small { color: var(--muted); font-weight: 700; font-size: 0.7rem; }
.msg.me small { color: #1b1340; }
.msg p { margin: 2px 0 0; overflow-wrap: anywhere; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 10px 12px 12px; }
.chat-form .btn { min-height: 52px; }

/* ---- Toast ---- */
#toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px);
  background: #1b1340; color: #fff4e0; padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 0.9rem;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; max-width: 90vw; text-align: center; z-index: 50;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Question mode: the question is a sentence, not a single word */
.big.q { font-size: 1.35rem; font-weight: 800; line-height: 1.25; margin: 6px 0 10px; }
.reveal .big.q { font-size: 1.5rem; }

/* ---- Pincode ---- */
.pin-form { grid-template-columns: 1fr auto; }
.pin-input { font-size: 1.6rem; font-weight: 900; letter-spacing: 0.35em; text-align: center; font-variant-numeric: tabular-nums; min-width: 0; }
.pin-big { font-family: var(--display); font-size: 2.6rem; font-weight: 700; letter-spacing: 0.3em; color: var(--text); font-variant-numeric: tabular-nums; padding-left: 0.3em; }
.pin-small { letter-spacing: 0.2em; color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }
.center-text { text-align: center; }
.guesses { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow-y: auto; }
.guess { border: 2px solid var(--edge); display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 2px 12px; background: var(--card-2); border-radius: 12px; padding: 10px 14px; }
.guess.mine { background: #fff3cf; }
.guess .pin { font-size: 1.4rem; font-weight: 900; letter-spacing: 0.2em; font-variant-numeric: tabular-nums; }
.guess .fbs { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.guess small { grid-column: 1 / -1; color: var(--muted); font-weight: 700; }
.fb { background: var(--bg-2); border: 1.5px solid var(--edge); border-radius: 999px; padding: 4px 10px; font-size: 0.8rem; font-weight: 800; color: var(--muted); }
.fb.some { color: #8a5a00; background: #fff3cf; }
.fb.full { background: var(--good-fill); color: #08362e; }

/* ---- Pencil Dungeon ---- */
.dungeon-board { width: 100%; max-width: 420px; display: block; margin: 0 auto; border-radius: 12px; background: #f6f1e3; border: 2px solid var(--edge); }
.dungeon-board .d-ico { font-size: 13px; text-anchor: middle; dominant-baseline: central; }
.dungeon-board .d-badge { font-size: 7px; font-weight: 900; fill: #fff; text-anchor: middle; dominant-baseline: central; }
.dungeon-board .d-x { font-size: 9px; font-weight: 900; fill: #241c00; text-anchor: middle; dominant-baseline: central; }
.dtab { border-collapse: separate; border-spacing: 4px; width: 100%; max-width: 420px; align-self: stretch; margin: 0 auto; table-layout: fixed; font-variant-numeric: tabular-nums; }
.dtab th:first-child { width: 27%; }
.dtab thead th { color: var(--muted); font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 0; text-align: center; }
.dtab tbody th { text-align: left; font-family: var(--display); font-weight: 600; font-size: 0.95rem; white-space: nowrap; padding: 0; }
.dtab td { background: var(--bg-2); border: 2px solid var(--edge); border-radius: 10px; padding: 4px 2px; white-space: nowrap; height: 32px; text-align: center; font-weight: 700; font-size: 0.95rem; }
.dtab td:empty { border-style: dashed; background: transparent; opacity: 0.45; }
.dtab td:last-child { background: var(--accent-2); color: #1b1340; box-shadow: 2px 2px 0 var(--pop); font-size: 1.1rem; }
.dtab td:last-child small { color: #1b1340; opacity: 0.7; font-size: 0.6em; }
.dtab .neg { color: #b3122b; }
.tally small { color: var(--muted); }
.neg { color: var(--bad); }
.gear { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.evts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; width: 100%; }
.evts li { background: var(--bg-2); border: 1.5px solid var(--edge); border-radius: 10px; padding: 7px 12px; font-weight: 700; font-size: 0.9rem; }
.evts li.up { color: var(--good); }
.evts li.down { color: var(--bad); }
.dpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 270px; }
.dkey, .die { aspect-ratio: 1; border-radius: 16px; display: flex; align-items: center; justify-content: center; font: inherit; font-size: 1.8rem; font-weight: 900; border: 2px solid transparent; }
.dkey { background: var(--card); color: var(--text); border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--pop); }
.dkey:active { transform: scale(0.95); }
.dkey.selected { background: var(--accent-2); color: #1b1340; }
.dkey:disabled { opacity: 0.25; }
.dkey.blocked { opacity: 0.5; position: relative; }
.dkey.blocked::after { content: "🧱"; position: absolute; right: 6px; bottom: 4px; font-size: 0.9rem; }
.dkey.blocked.selected { opacity: 0.9; border-color: var(--bad); color: var(--bad); background: rgba(255, 93, 108, 0.14); }
.dkey.ghost { background: transparent; pointer-events: none; }
.die { background: #fff; color: #241c00; font-size: 2.2rem; border: 2px solid var(--edge); box-shadow: 2px 2px 0 var(--pop); }
.btn.stairs { background: var(--good-fill); color: #08362e; }
.shop { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shop-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 12px; padding: 10px 12px; }
.shop-item small { display: block; color: var(--muted); font-weight: 600; }
.legend { margin: 0; font-size: 0.8rem; }

/* ---- Dice Delve ---- */
.delve { display: flex; flex-direction: column; gap: 14px; --paper: #f3efe2; --ink: #231c10; }
.realm-meadow { --rbg1: #0f2a1d; --rbg2: #245a3a; --card: #1b3a2a; --card-2: #25503a; --accent: #9be37a; --accent-2: #ffe27a; --muted: #a8cdb4; --path: #6fa56b; --tile: #f2f3df; --start: #b6ecc6; --act: #cbd2bd; --room: #26402f; }
.realm-crypt { --rbg1: #0b1626; --rbg2: #1f4468; --card: #16304d; --card-2: #1f4468; --accent: #86d4ff; --accent-2: #ffe58a; --muted: #a8c6de; --path: #5f93bb; --tile: #eaf2fa; --start: #b3ecd0; --act: #c3ccd8; --room: #1e3350; }
.realm-pyramid { --rbg1: #2a1e0b; --rbg2: #6a4d22; --card: #4a3516; --card-2: #5f4720; --accent: #f6c25a; --accent-2: #fff1a8; --muted: #dcc89a; --path: #b48a45; --tile: #f6ecd0; --start: #bfe7b2; --act: #d3c8ad; --room: #45321a; }
.realm-badlands { --rbg1: #260f0b; --rbg2: #6b2f1d; --card: #48201a; --card-2: #5e2c22; --accent: #ff9b5e; --accent-2: #ffe08a; --muted: #e0b9a6; --path: #b2694a; --tile: #f5e6d4; --start: #bfe6b0; --act: #d6c4b4; --room: #4a2218; }
body:has(.realm-meadow) { background: radial-gradient(900px 520px at 90% -10%, rgba(155, 227, 122, 0.22), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(255, 226, 122, 0.1), transparent 60%), #0e2218; }
body:has(.realm-crypt) { background: radial-gradient(900px 520px at 90% -10%, rgba(134, 212, 255, 0.22), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(120, 140, 255, 0.12), transparent 60%), #0a1422; }
body:has(.realm-pyramid) { background: radial-gradient(900px 520px at 90% -10%, rgba(246, 194, 90, 0.24), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(255, 140, 90, 0.1), transparent 60%), #221808; }
body:has(.realm-badlands) { background: radial-gradient(900px 520px at 90% -10%, rgba(255, 155, 94, 0.26), transparent 60%), radial-gradient(700px 500px at -10% 110%, rgba(255, 70, 70, 0.12), transparent 60%), #200d09; }
.delve .btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #1c1608; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); }
.delve .hint { color: var(--muted); }

.dhead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius); background: linear-gradient(120deg, var(--rbg2), var(--rbg1)); border: 1.5px solid color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); }
.dhead-ico { font-size: 2rem; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5)); }
.dhead-t { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.15; }
.dhead-t strong { font-size: 1.25rem; font-weight: 900; letter-spacing: 0.01em; }
.dhead-t span { color: var(--muted); font-size: 0.8rem; font-weight: 700; }
.dhead-round { font-size: 0.85rem; color: var(--muted); font-weight: 700; text-align: right; }
.dhead-round b { display: block; font-size: 1.6rem; color: var(--accent); line-height: 1; }

.hud { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.hearts { display: flex; gap: 3px; flex-wrap: wrap; max-width: 100%; }
.heart { width: 17px; height: 15px; background: #ff5d7a; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21S2 14.5 2 7.8C2 4.6 4.5 2 7.6 2c1.8 0 3.5 1 4.4 2.6C12.900 3 14.600 2 16.400 2 19.500 2 22 4.600 22 7.800 22 14.500 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 22'%3E%3Cpath d='M12 21S2 14.5 2 7.8C2 4.6 4.5 2 7.6 2c1.8 0 3.5 1 4.4 2.6C12.900 3 14.600 2 16.400 2 19.500 2 22 4.600 22 7.800 22 14.500 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; display: inline-block; filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.4)); }
.heart.gone { background: rgba(255, 255, 255, 0.16); filter: none; }
.hudstats, .statrow { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.statrow { justify-content: center; }
.stat { background: rgba(0, 0, 0, 0.28); border-radius: 999px; padding: 4px 11px; font-weight: 800; font-size: 0.88rem; }
.stat.bad { color: #ff8d98; }

.dicerow { display: flex; gap: 9px; justify-content: center; padding: 6px 0 2px; }
.ddie { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(145deg, #fffdf6, #e6dfc9); box-shadow: 0 4px 0 #b9b095, 0 8px 14px rgba(0, 0, 0, 0.4), inset 0 1px 0 #fff; }
.ddie.black { background: linear-gradient(145deg, #3a3550, #17151f); box-shadow: 0 4px 0 #09080d, 0 8px 14px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.18); }
.ddie.used { opacity: 0.28; transform: translateY(3px); box-shadow: none; }
.pips { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); width: 28px; height: 28px; }
.pips i { place-self: center; width: 7px; height: 7px; border-radius: 50%; background: transparent; }
.pips i.on { background: #241d12; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5); }
.ddie.black .pips i.on { background: #f4efe0; box-shadow: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: flex; flex-direction: column; align-items: center; min-width: 64px; padding: 8px 10px 7px; border-radius: 14px; border: 2px solid transparent; background: rgba(0, 0, 0, 0.26); color: var(--text); font: inherit; box-shadow: 0 3px 0 rgba(0, 0, 0, 0.3); }
.chip b { font-size: 1.35rem; line-height: 1.05; }
.chip small { color: var(--muted); font-weight: 800; font-size: 0.68rem; }
.chip.blk { background: rgba(8, 6, 16, 0.55); }
.chip.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 24%, transparent); transform: translateY(2px); box-shadow: none; }
.chip.on b { color: var(--accent-2); }

.zoombar { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; }
.dscroll { width: 100%; max-height: 74vh; max-height: 74dvh; overflow: auto; -webkit-overflow-scrolling: touch; border-radius: 16px; padding: 10px; box-sizing: border-box; border: 2px solid color-mix(in srgb, var(--accent) 40%, transparent); box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55), 0 10px 26px rgba(0, 0, 0, 0.4);
  background:
    radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1.5px) 0 0 / 14px 14px,
    radial-gradient(120% 100% at 25% 15%, var(--rbg2), var(--rbg1)); }
.dmap { position: relative; margin: 0 auto; }
.dlinks { position: absolute; inset: 0; pointer-events: none; }
.dlinks line { stroke: var(--path); stroke-width: calc(var(--u, 40px) * 0.16); stroke-linecap: round; opacity: 0.85; }
.dtile { position: absolute; box-sizing: border-box; border-radius: calc(var(--u) * 0.24); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; color: var(--ink); border: 0; font: inherit; padding: 0; overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.6), rgba(0, 0, 0, 0.06)), var(--tile);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.42), 0 6px 10px rgba(0, 0, 0, 0.28), inset 0 0 0 1.5px rgba(0, 0, 0, 0.1); }
.dtile .num { font-size: calc(var(--u) * 0.46); font-weight: 900; line-height: 1; letter-spacing: -0.02em; }
.dtile.k-doubles .num { font-size: calc(var(--u) * 0.3); white-space: nowrap; letter-spacing: 0; }
.dtile.k-fist .num { font-size: calc(var(--u) * 0.36); white-space: nowrap; letter-spacing: -0.04em; }
.dtile small { font-size: calc(var(--u) * 0.26); font-weight: 800; color: rgba(35, 28, 16, 0.7); white-space: nowrap; line-height: 1.05; }
.dtile.k-start { background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(0, 60, 20, 0.08)), var(--start); box-shadow: 0 3px 0 rgba(10, 70, 30, 0.55), 0 6px 10px rgba(0, 0, 0, 0.28), inset 0 0 0 2px rgba(20, 110, 55, 0.45); }
.dtile.k-act, .dtile.k-claw { background: linear-gradient(160deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.12)), var(--act); }
.dtile.k-claw { background: linear-gradient(160deg, rgba(255, 255, 255, 0.25), rgba(0, 0, 0, 0.15)), #b79a7b; }
.dtile.k-fist { background: linear-gradient(160deg, rgba(255, 255, 255, 0.5), rgba(120, 50, 0, 0.08)), #f9d2a3; }
.dtile.k-fist.unl { background: linear-gradient(160deg, rgba(255, 255, 255, 0.35), rgba(0, 0, 0, 0.12)), var(--act); }
.dtile.k-rubble { background: linear-gradient(160deg, rgba(255, 255, 255, 0.3), rgba(0, 0, 0, 0.14)), #d4ccbc; }
.dtile.k-doubles { background: linear-gradient(160deg, rgba(255, 255, 255, 0.6), rgba(0, 40, 120, 0.07)), #e0ebfb; }
.dtile.k-cloud { background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(90, 40, 140, 0.1)), #e5d6f6; }
.dtile.chest { background: linear-gradient(160deg, rgba(255, 255, 255, 0.55), rgba(140, 90, 0, 0.12)), #fbe08e; box-shadow: 0 3px 0 rgba(120, 80, 0, 0.55), 0 6px 10px rgba(0, 0, 0, 0.28), inset 0 0 0 2px rgba(190, 130, 10, 0.5); }
.dtile.mon { background: linear-gradient(170deg, rgba(255, 255, 255, 0.12), rgba(0, 0, 0, 0.25)), var(--room); color: #fff; gap: calc(var(--u) * 0.06); padding: 2px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 8px 14px rgba(0, 0, 0, 0.35), inset 0 0 0 2px color-mix(in srgb, var(--accent) 55%, transparent); }
.dtile.mon.boss { box-shadow: 0 3px 0 rgba(0, 0, 0, 0.5), 0 0 22px color-mix(in srgb, var(--accent) 60%, transparent), inset 0 0 0 3px var(--accent); }
.dtile .mnums { font-size: calc(var(--u) * 0.3); font-weight: 900; color: #fff; letter-spacing: 0.01em; }
.dtile .mnums .locked { color: rgba(255, 255, 255, 0.4); text-decoration: line-through; }
.dtile .micon { font-size: calc(var(--u) * 0.66); line-height: 1; text-shadow: 0 3px 3px rgba(0, 0, 0, 0.55); } /* text-shadow, not filter: iPhone Safari paints big emoji with a drop-shadow filter as blank */
.dtile .mboxes { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; max-width: 94%; }
.dtile .mboxes i { width: calc(var(--u) * 0.2); height: calc(var(--u) * 0.2); border: 1.5px solid rgba(255, 255, 255, 0.7); border-radius: 3px; display: inline-block; }
.dtile .mboxes.grp, .boxes.grp { display: grid; grid-template-columns: repeat(var(--gpr, 2), auto); gap: calc(var(--u, 40px) * 0.1) calc(var(--u, 40px) * 0.04); justify-content: center; max-width: none; }
.mboxes.grp .g, .boxes.grp .g { display: flex; flex-direction: column; gap: 2px; }
.dtile .mboxes.grp i { width: calc(var(--u) * 0.19); height: calc(var(--u) * 0.19); }
.dtile.mon.boss .micon { font-size: calc(var(--u) * 0.5); }
.dtile .mboxes i.x { background: #ff5d6c; border-color: #ff5d6c; }
.dtile .mdone { position: absolute; inset: 0; display: grid; place-items: center; font-size: calc(var(--u) * 0.8); background: rgba(0, 0, 0, 0.45); }
.dtile.visited { filter: saturate(0.5) brightness(0.82); }
.dtile.visited .num, .dtile.visited small { opacity: 0.55; }
.dtile.mon.visited { filter: grayscale(1) brightness(0.7); }
.xmark { position: absolute; inset: 6%; width: 88%; height: 88%; pointer-events: none; }
.xmark path { fill: none; stroke: #2a2530; stroke-width: 3.4; stroke-linecap: round; opacity: 0.88; }
.dtile.ok { z-index: 3; cursor: pointer; outline: 3px solid var(--accent-2); outline-offset: 1px; animation: dglow 1.3s ease-in-out infinite; }
@keyframes dglow { 50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent-2) 55%, transparent), 0 0 20px var(--accent-2); } }
@media (prefers-reduced-motion: reduce) { .dtile.ok { animation: none; } }

.monsters { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mon-row { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, 0.26); border-radius: 14px; padding: 10px 12px; border-left: 4px solid var(--accent); }
.mon-row.done { opacity: 0.45; border-left-color: var(--muted); }
.mon-row .micon { font-size: 2rem; text-shadow: 0 3px 3px rgba(0, 0, 0, 0.5); }
.minfo { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.boxes { display: flex; gap: 3px; flex-wrap: wrap; }
.boxes i { width: 13px; height: 13px; border-radius: 3px; border: 2px solid var(--muted); display: inline-block; }
.boxes i.x { background: #ff5d6c; border-color: #ff5d6c; }
.mnums { display: flex; gap: 5px; flex-wrap: wrap; }
.mon-row .mnum { padding: 2px 9px; border-radius: 999px; font-weight: 800; font-size: 0.8rem; }
.mnum.open { background: color-mix(in srgb, var(--accent) 25%, transparent); color: var(--accent); }
.mnum.locked { background: rgba(0, 0, 0, 0.3); color: var(--muted); }
.board li.dead { opacity: 0.5; }

/* ---- Responsive: phone (default) -> tablet -> desktop ---- */
.dlayout { display: flex; flex-direction: column; gap: 14px; }
.dgrid, .gmap, .gcorner, .dextra { display: contents; }
.gside, .gstrip { order: 4; }
.only-wide { display: none; }
.dboard { display: flex; flex-direction: column; gap: 10px; order: 2; }
.dlayout .ord3 { order: 3; } .dlayout .ord4 { order: 4; } .dlayout .ord5 { order: 5; } .dlayout .ord6 { order: 6; } .dlayout .ord7 { order: 7; } .dlayout .ord8 { order: 8; }
.dlayout .dstatus { order: 1; }
.dlayout .dend { order: 3; }
.pgrid, .pside { display: flex; flex-direction: column; gap: 14px; }

@media (min-width: 700px) {
  #app { max-width: 780px; padding: 28px 24px 40px; gap: 16px; }
  .dock { margin: 0 -24px; padding-left: 24px; padding-right: 24px; }
  .overlay { align-items: center; }
  .overlay-card { max-width: 640px; border-radius: 22px; max-height: 84dvh; }
  .dscroll { max-height: none; overflow: auto; }
  .dungeon-board { max-width: 560px; }
  /* Dice Delve: the paper sheet. Map top-left, yellow panel top-right, score strip bottom-left, dice bottom-right. */
  .dgrid { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 12px; align-items: stretch; }
  .gmap { display: block; grid-column: 1; grid-row: 1; min-width: 0; }
  .gside { display: block; grid-column: 2; grid-row: 1; order: 0; }
  .gstrip { display: block; grid-column: 1; grid-row: 2; order: 0; }
  .gcorner { display: flex; flex-direction: column; gap: 10px; grid-column: 2; grid-row: 2; min-width: 0; }
  .dextra { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; align-items: start; }
  .only-phone { display: none; }
  .only-wide { display: block; }
  .gcorner .dstatus, .gcorner .dend { order: 0; }
  .tally { max-width: 560px; }
  .delve.narrow { max-width: 640px; margin: 0 auto; width: 100%; }
}

@media (min-width: 1000px) {
  html { font-size: 14px; }
  #app { max-width: 1040px; padding-top: 14px; padding-bottom: 16px; gap: 12px; }
  body:has(.delve:not(.narrow)) #app, body:has(.pgrid) #app { max-width: 1560px; }
  .dscroll { padding: 6px; }
  .pgrid { display: grid; grid-template-columns: min(calc(100dvh - 178px), 820px) minmax(0, 500px); gap: 18px; justify-content: center; align-items: start; }
  .pboard { padding: 10px; }
  .pboard .dungeon-board { width: 100%; max-width: none; }
  .pside { position: sticky; top: 12px; max-height: calc(100dvh - 24px); overflow-y: auto; gap: 10px; scrollbar-width: thin; }
  .dboard, .dlayout .ord3, .dlayout .ord4, .dlayout .ord5, .dlayout .ord6, .dlayout .ord7, .dlayout .ord8, .dlayout .dstatus, .dlayout .dend { order: 0; }
  .zoombar, .dboard .legend { display: none; }
  .dscroll { max-height: none; }
  .sheet { left: auto; right: 24px; bottom: 24px; width: 380px; max-width: none; margin: 0; border: 2.5px solid var(--edge); border-radius: 22px; height: min(560px, 70dvh); }
}

/* Desktop is denser than a phone: smaller touch targets and type (a mouse needs less room, and Windows
   display scaling of 125-150% already makes CSS pixels big). */
@media (min-width: 700px) {
  /* editor screen: no yellow panel, so the map gets the whole column */
  .dgrid.editgrid { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1000px) {
  .btn { min-height: 42px; padding: 8px 14px; border-radius: 12px; }
  .btn.big { min-height: 48px; font-size: 1rem; }
  .btn.small { min-height: 34px; padding: 6px 12px; font-size: 0.8rem; }
  input[type="text"], input:not([type]) { min-height: 42px; }
  .card { padding: 14px; gap: 10px; }
  .dhead { padding: 8px 12px; }
  .dhead-ico { font-size: 1.6rem; }
  .dhead-t strong { font-size: 1.1rem; }
  .ddie { width: 38px; height: 38px; }
  .chip { min-width: 54px; padding: 5px 8px; }
  .chip b { font-size: 1.15rem; }
  .mon-row { padding: 5px 10px; gap: 10px; }
  .mon-row .micon { font-size: 1.5rem; }
  .minfo { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 8px; align-items: center; }
  .minfo > small { white-space: nowrap; text-align: right; }
  .minfo .boxes { justify-content: flex-end; }
  .boxes i { width: 11px; height: 11px; }
  .minfo > small { font-size: 0.72rem; }
  .monsters { gap: 5px; }
  .heart { width: 15px; height: 13px; }
}

@media (min-width: 1200px) {
  .dlayout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; align-items: start; }
  .dextra { display: flex; flex-direction: column; gap: 10px; position: sticky; top: 12px; max-height: calc(100dvh - 152px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
}
@media (min-width: 1500px) {
  body:has(.delve:not(.narrow)) #app { max-width: 1800px; }
  .dlayout { grid-template-columns: minmax(0, 1fr) 402px; }
}


/* Lobby: phone stays one column (players, game, settings, start); desktop is two columns */
.lgrid, .lleft, .lactions { display: flex; flex-direction: column; gap: 14px; }
.lright { display: contents; }
.lgrid { order: 0; }
@media (max-width: 999px) {
  .lgrid { display: flex; }
  .lleft { display: contents; }
  .lleft > .card:nth-child(1) { order: 1; }
  .lleft > .card:nth-child(2) { order: 2; }
  .lleft > .card:nth-child(3) { order: 2; }
  .lright { display: flex; flex-direction: column; order: 3; }
  .lactions { order: 4; }
}
@media (min-width: 1000px) {
  body:has(.lgrid) #app { max-width: 1180px; }
  .lgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .lleft { gap: 12px; }
  .lright { display: block; max-height: calc(100dvh - 120px); overflow-y: auto; scrollbar-width: thin; }
  .lright > .card { margin: 0 0 12px; }
  .gtile { min-height: 52px; }
  .iconbtn { width: 38px; height: 38px; border-radius: 12px; }
  .iconbtn svg { width: 18px; height: 18px; }
  .dock { margin: 0; padding-left: 0; padding-right: 0; }
  body:has(.lgrid) .lactions.dock { padding: 4px 0 0; background: none; border: none; bottom: 12px; }
  .seg { padding: 7px 10px; }
  .opt { margin-top: 8px; }
  .players { gap: 10px 14px; }
}

/* Secret Category */
.cat-big { font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 1.2; margin: 6px 0; overflow-wrap: anywhere; }
.stack-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.fb.no { background: var(--bg-2); color: var(--text); }
.guess .pin.entry-text { font-size: 1.05rem; font-weight: 600; letter-spacing: 0; overflow-wrap: anywhere; min-width: 0; }

/* Who Am I? */
.board .wai { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 10px; }
.board .wai .what { flex: 1 0 100%; color: var(--muted); font-weight: 700; }
.board .wai .what:empty { display: none; }
.wordchip { font-weight: 800; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 999px; padding: 4px 12px; overflow-wrap: anywhere; }
.wordchip.hidden { color: var(--muted); }
.wai-word { font-size: 2rem; overflow-wrap: anywhere; }
.wai .pts { color: var(--text); }
.wordchip.match { background: var(--good-fill); color: #08362e; }
.fbs.tries { flex-direction: column; align-items: flex-start; } .guess .fbs.tries { justify-content: flex-start; }
.guess.own-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; } .own-row .btn { flex: 0 0 auto; min-width: 40px; }

/* Last Letter */
.ll-letter { font-family: var(--display); font-weight: 800; font-size: 4.5rem; line-height: 1; margin: 4px 0; }
.twist { font-weight: 800; }

/* ---- Letter Duel: two cards, a race to a word ---- */
.ld-score { list-style: none; margin: 0 auto 4px; padding: 0; display: flex; gap: 8px; justify-content: center; width: 100%; max-width: 440px; }
.ld-score li { flex: 1 1 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 6px 4px 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); font-weight: 700; min-width: 0; }
.ld-score .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ld-score .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-score b { font-family: var(--display); font-size: 1.4rem; min-width: 1.8rem; text-align: center; border-radius: 999px; background: var(--g); color: #1b1340; padding: 0 6px; }
.ld-goal { margin: 0 0 8px; font-size: 0.9rem; }
.ld-cards { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; max-width: 440px; margin: 4px auto 8px; }
.ld-card { border: 2.5px solid var(--edge); border-radius: 18px; background: var(--card-2); box-shadow: 4px 4px 0 var(--pop); padding: 8px 6px 10px; text-align: center; min-width: 0; }
.ld-card.mine { outline: 3px solid var(--g); outline-offset: 2px; }
.ld-card.back { background: repeating-linear-gradient(45deg, var(--card-2) 0 9px, var(--card) 9px 18px); }
.ld-card.flip { animation: ld-flip 0.35s ease-out; }
@keyframes ld-flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
@media (prefers-reduced-motion: reduce) { .ld-card.flip { animation: none; } }
.ld-kind { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ld-card .ld-letter { font-family: var(--display); font-weight: 800; font-size: 5.2rem; line-height: 1.05; margin: 0; }
.ld-owner { display: flex; align-items: center; justify-content: center; gap: 6px; font-weight: 700; font-size: 0.9rem; min-width: 0; }
.ld-owner .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ld-dots { font-weight: 800; font-size: 1.6rem; color: var(--muted); letter-spacing: 2px; }
.ld-task { font-weight: 700; margin: 0 0 4px; }
.ld-fits { margin: 8px 0 0; }
.ld-word { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1.1; margin: 8px 0 2px; overflow-wrap: anywhere; }
.ld-wins { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; }
.ld-wins li { display: flex; flex-direction: column; padding: 6px 10px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); min-width: 0; }
.ld-wonword { font-family: var(--display); font-weight: 800; font-size: 1.15rem; overflow-wrap: anywhere; }
.ld-wins small { color: var(--muted); }
@media (min-width: 1000px) { .ld-wins { max-height: calc(100dvh - 400px); overflow-y: auto; } }
.ld-hit { font-weight: 800; text-decoration: underline; text-decoration-thickness: 4px; text-underline-offset: 5px; }
.ld-examples { margin: 6px 0 0; font-size: 0.9rem; font-weight: 600; }
@media (min-width: 1000px) { .ld-card .ld-letter { font-size: clamp(3.4rem, 11dvh, 5rem); } }
.notice { margin: 8px 0 0; font-weight: 700; color: var(--muted); }
.guess.struck .pin { text-decoration: line-through; opacity: 0.6; }
.board li.out { opacity: 0.55; }

/* ---- Dice Delve: tap two dice to make a pair ---- */
.dcol { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.dwrap, .dbtn { position: relative; display: block; }
.dbtn { border: 0; background: none; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.dbtn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.ddie { transition: transform 0.12s, opacity 0.12s; }
.ddie.dim { opacity: 0.3; }
.ddie.can { outline: 3px dashed var(--accent-2); outline-offset: 2px; }
.ddie.sel { transform: translateY(-5px); outline: 3px solid var(--accent-2); outline-offset: 2px; }
.dbadge { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px; display: grid; place-items: center; font: 800 0.82rem/1 var(--font); background: var(--accent-2); color: #1b1340; box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35); pointer-events: none; }
.dtag { font-weight: 800; font-size: 0.66rem; color: var(--muted); line-height: 1; }
.dtag.pay { color: var(--accent-2); }
.pslots { display: flex; gap: 8px; margin: 8px 0 2px; }
.pslot { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 8px; border-radius: 12px; border: 2px dashed rgba(255, 255, 255, 0.18); min-width: 0; }
.pslot.now { border-style: solid; border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.pslot.done { border-style: solid; border-color: transparent; background: rgba(0, 0, 0, 0.26); }
.pslot .pn { font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.pslot .pst { font-weight: 700; font-size: 0.95rem; }
.pslot .pst.muted { font-size: 0.78rem; font-weight: 600; }
.pslot.done .pst { color: var(--accent-2); }
.pslot .eq b { color: var(--accent-2); font-size: 1.1rem; }

/* ---- Dice Delve: the yellow panel on the right of the sheet and the score strip ---- */
/* Dice Delve side panel and score row, drawn after the printed board: gold chest panel + blue ribbon, paper score sheet. */
.ypanel { height: 100%; display: flex; flex-direction: row; gap: 8px; padding: 10px; }
.vtrack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; width: 46px; flex: none; }
.vtrack li { flex: 1 1 0; min-height: 24px; display: grid; place-items: center; font-weight: 800; font-size: 0.74rem; border-radius: 7px; background: var(--c); color: #1b1340; position: relative; }
.vtrack li:last-child { color: #f4efe0; }
.vtrack li.past { opacity: 0.35; text-decoration: line-through; }
.vtrack li.here { outline: 3px solid var(--text); outline-offset: 1px; transform: translateX(3px); }
.vtrack li.here::before { content: "❤️"; position: absolute; left: -17px; top: 50%; transform: translateY(-50%); font-size: 0.7rem; }
.ybody { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0; color: #3a2705; border-radius: 14px; border: 2px solid #b98512; overflow: hidden;
  background: linear-gradient(180deg, #f8cf45, #eaa91d); box-shadow: inset 0 0 0 2px rgba(255, 244, 190, 0.55); }
.yhead { display: grid; place-items: center; padding: 8px 0 2px; }
.chest { width: 54px; height: 42px; filter: drop-shadow(0 2px 0 rgba(58, 39, 5, 0.35)); }
.yrow { flex: 1 1 0; display: grid; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto auto; gap: 5px 8px; align-content: center; padding: 8px 10px; border-top: 2px dashed rgba(58, 39, 5, 0.32); }
.yrow:first-of-type { border-top: 0; }
.yrow .yboxes { grid-column: 1 / -1; }
.yic { display: flex; align-items: center; gap: 4px; font-size: 1.35rem; line-height: 1; }
.yic b { font-size: 1.1rem; }
.heart.big { width: 24px; height: 21px; background: #e0344f; filter: drop-shadow(0 1px 0 rgba(58, 39, 5, 0.5)); }
.bigdie { display: inline-block; width: 26px; height: 26px; border-radius: 7px; box-shadow: 0 0 0 3px #8a46c4, 0 0 0 5px #3a2705;
  background: radial-gradient(circle at 26% 26%, #fff 0 11%, transparent 12%), radial-gradient(circle at 50% 50%, #fff 0 11%, transparent 12%), radial-gradient(circle at 74% 74%, #fff 0 11%, transparent 12%), #2a1740; }
.yboxes { display: flex; gap: 6px; }
.ybox { flex: 1 1 0; max-width: 38px; height: 26px; border-radius: 5px; border: 2px solid #3a2705; display: grid; place-items: center; font-style: normal; font-size: 0.95rem; font-weight: 800; background: #9dc43f; color: #7a1626; }
.ybox.o { background: #f0643a; }
.ybox.die { background: #17151f; border-color: #3a2705; }
.ybox.locked { opacity: 0.5; }
.ybox.spent { opacity: 0.3; }
.ybox.lit { box-shadow: 0 0 0 2px #fff6c4; }
.chk { width: 24px; height: 24px; border-radius: 5px; border: 2px solid #3a2705; display: grid; place-items: center; font-style: normal; font-size: 0.85rem; font-weight: 900; background: #fffaf0; color: #1d7a34; }
.yribbon { position: relative; margin-top: auto; padding: 8px 10px 26px; text-align: center; color: #e8f1ff;
  background: linear-gradient(180deg, #4a90e0, #2a66bb); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 14px), 0 100%); }
.yribbon h3 { margin: 0 0 6px; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 800; }
.bdots { display: flex; gap: 6px; justify-content: center; align-items: center; }
.bdot { width: 26px; height: 26px; border-radius: 6px; border: 2px solid #0f2a52; display: inline-block; background: radial-gradient(circle at 50% 50%, #fff 0 12%, transparent 13%), #17151f; }
.bdot.spent { background: rgba(10, 30, 70, 0.35); opacity: 0.6; }

.dstrip { display: flex; flex-direction: column; gap: 10px; justify-content: center; height: 100%;
  background: linear-gradient(180deg, #f3ead2, #e8dcba); border: 2px solid #8a7650; color: #2d2108; }
.strip-end .btn { width: 100%; }
.dstrip .hud { justify-content: flex-start; gap: 14px; margin: 0; }
.dstrip .lifelabel { color: #6b5a38; }
.dstrip .lifelabel b { color: #2d2108; }
.dstrip .heart.gone { background: rgba(60, 40, 10, 0.2); }
.dstrip .heart.spare:not(.gone) { background: #f29ab4; }
.dstrip .stat { background: rgba(60, 40, 10, 0.12); color: #2d2108; }
.score { display: flex; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.sgrp { position: relative; display: flex; align-items: center; gap: 6px; min-width: 0; }
.sgrp .op { font-weight: 900; font-size: 1.4rem; color: #5a4a2a; }
.sgrp.gold { flex: 0 1 112px; }
.sgrp.gems { flex: 1 1 200px; }
.sgrid { flex: 1; min-width: 0; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 1.5px; border: 2px solid #6b5a38; border-radius: 4px; background: #8a7650; position: relative; z-index: 1; overflow: hidden; }
.sgrid i { height: 22px; background: #fffcf0; position: relative; }
.sgrid i.on::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe27a, #d6970f); border: 1.5px solid #7a5208; }
.sgrid.m i.on::after { border-radius: 2px; clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%); border: 0; background: linear-gradient(135deg, #b4f0ff, #2a9fd6); inset: 2px 3px; }
.wm { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-size: 2.2rem; opacity: 0.16; z-index: 2; pointer-events: none; }
.sgrp.gems .wm { left: calc(50% + 14px); }
.mult { position: absolute; right: 2px; bottom: -13px; font-size: 0.68rem; font-weight: 800; color: #5a4a2a; }
.sbox2 { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 54px; height: 100%; min-height: 50px; padding: 4px 8px; border: 2px solid #6b5a38; border-radius: 6px; background: rgba(255, 252, 240, 0.85); font-weight: 800; }
.sbox2 b { font-size: 1.35rem; line-height: 1.1; }
.sbox2 .heart { width: 18px; height: 16px; background: #e0344f; }
.sbox2.bad b { color: #b3202f; }
.sbox2 small { font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; color: #5a4a2a; }
.sbox2.total { min-width: 64px; background: #fffaf0; }
.gcorner .dicerow { gap: 6px; justify-content: center; }
.gcorner .ddie { width: 38px; height: 38px; }
.dextra > div:empty { display: none; }

/* ---- Tic-Tac-Toe ---- */
.ttt-p0 { --pc: #e03e45; } .ttt-p1 { --pc: #1a8fb0; } .ttt-p2 { --pc: #c98a00; } .ttt-p3 { --pc: #3f9a1c; }
:root[data-theme] .ttt-p0 { --pc: #ff7a80; } :root[data-theme] .ttt-p1 { --pc: #5ad1e6; } :root[data-theme] .ttt-p2 { --pc: #ffd166; } :root[data-theme] .ttt-p3 { --pc: #a6e35a; }
.ttt-badge { display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; border-radius: 50%; background: color-mix(in srgb, var(--pc) 25%, transparent); color: var(--pc); font-weight: 800; }
.ttt-score { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ttt-score li { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid transparent; background: color-mix(in srgb, var(--text) 6%, transparent); }
.ttt-score li.now { border-color: var(--pc, currentColor); }
.ttt-score .n { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ttt-board { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 6px; width: min(100%, 460px); margin: 0 auto; aspect-ratio: 1; }
.ttt-cell { display: grid; place-items: center; border-radius: 10px; border: 2px solid color-mix(in srgb, var(--text) 22%, transparent); background: color-mix(in srgb, var(--text) 5%, transparent); color: var(--pc, inherit); font: inherit; font-weight: 800; font-size: clamp(1.2rem, calc(34vw / var(--n)), 2.6rem); padding: 0; min-width: 0; min-height: 0; overflow: hidden; line-height: 1; }
.ttt-cell.open { cursor: pointer; border-style: dashed; }
.ttt-cell.open:hover, .ttt-cell.open:focus-visible { background: color-mix(in srgb, var(--g) 22%, transparent); }
.ttt-cell.filled { border-color: var(--pc); background: color-mix(in srgb, var(--pc) 14%, transparent); }
.ttt-cell.old .mark { opacity: .4; }
.ttt-cell.old { border-style: dashed; }
.ttt-cell.last { box-shadow: 0 0 0 3px color-mix(in srgb, var(--pc) 55%, transparent); }
.ttt-cell.gone { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.ttt-cell.win { background: color-mix(in srgb, var(--pc, #fff) 45%, transparent); transform: scale(1.04); }
.ttt-sym { margin-top: 8px; }
@media (min-width: 1000px) { .ttt-cell { font-size: clamp(1rem, calc((100dvh - 440px) / var(--n) * .5), 2.6rem); } .ttt-board { width: min(100%, calc(100dvh - 440px), 520px); } }

/* ---- Most Likely To / Would You Rather / Two Truths and a Lie ---- */
.btn.picked { background: var(--g); color: #1b1340; border-color: var(--edge); }
.sg-grid { display: grid; grid-template-columns: 1fr; gap: 8px; width: 100%; margin-top: 12px; }
.btn.sg-who { display: flex; align-items: center; justify-content: flex-start; gap: 10px; min-height: 52px; text-align: left; overflow-wrap: anywhere; }
.sg-tally { display: grid; gap: 10px; }
.sg-res { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.sg-res .sg-bar { grid-column: 1 / -1; }
.sg-res.top .sg-n { color: var(--text); }
.sg-n { font-family: var(--display); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.sg-bar { display: block; height: 12px; border-radius: 999px; background: var(--bg-2); border: 2px solid var(--edge); overflow: hidden; width: 100%; box-sizing: border-box; }
.sg-bar i { display: block; height: 100%; background: var(--g); border-radius: 999px; }
.sg-res.top .sg-bar { border-width: 3px; }
.sg-by { grid-column: 1 / -1; color: var(--muted); font-weight: 700; overflow-wrap: anywhere; }
.sg-row { display: flex; align-items: center; gap: 12px; }
.wyr-pair { display: grid; gap: 10px; margin: 12px 0; }
.wyr-opt { display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; min-height: 84px; padding: 14px 16px; background: var(--card-2); color: var(--text); border: 3px solid var(--edge); border-radius: 18px; font: inherit; font-weight: 700; font-size: 1.1rem; cursor: pointer; }
.wyr-opt.picked { background: var(--g); color: #1b1340; }
.wyr-opt:disabled { cursor: default; opacity: .8; }
.wyr-tag { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--edge); background: var(--card); color: var(--text); font-family: var(--display); font-weight: 700; }
.wyr-text { overflow-wrap: anywhere; }
.wyr-or { text-align: center; font-family: var(--display); color: var(--muted); font-weight: 700; margin: -2px 0; }
.wyr-results { display: grid; gap: 12px; }
.wyr-res { border: 3px solid var(--edge); border-radius: 16px; padding: 12px; display: grid; gap: 8px; background: var(--card-2); }
.wyr-res.top { border-color: var(--g); }
.wyr-res.mine { box-shadow: inset 0 0 0 3px var(--g); }
.wyr-head { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.wyr-who { display: flex; flex-wrap: wrap; gap: 6px; }
.wyr-recap { overflow-wrap: anywhere; }
.ttl-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; text-align: left; }
.ttl-st { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 12px; border: 3px solid var(--edge); border-radius: 14px; padding: 12px 14px; background: var(--card-2); }
.ttl-st.lie { background: #ffd9d6; color: #4a0f0d; border-color: #c93a35; }
.ttl-st.truth { background: var(--good-fill, #bdf3e6); color: #08362e; }
.ttl-st .ttl-who { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.ttl-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--edge); background: var(--card); color: var(--text); font-family: var(--display); font-weight: 700; }
.ttl-text { overflow-wrap: anywhere; font-weight: 600; }
.ttl-tag { font-size: .75rem; letter-spacing: .08em; }
.ttl-pick { display: grid; gap: 8px; margin-top: 12px; }
.btn.ttl-btn { display: flex; align-items: center; justify-content: flex-start; gap: 12px; min-height: 60px; text-align: left; height: auto; }
.guess.own-row.lie { background: #ffd9d6; color: #4a0f0d; }
.own-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.guess.own-row { align-items: center; }
@media (min-width: 700px) {
  .sg-grid { grid-template-columns: repeat(2, 1fr); }
  .wyr-pair { grid-template-columns: 1fr auto 1fr; align-items: stretch; }
  .wyr-or { align-self: center; }
  .wyr-results { grid-template-columns: 1fr 1fr; }
  .wyr-results .eyebrow { grid-column: 1 / -1; }
}
.sgwrap { display: contents; }
.board .sg-res { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 12px; }
.board .sg-res .sg-bar { grid-column: 1 / -1; }
.board .sg-res .sg-by { grid-column: 1 / -1; text-align: left; }
.ttl-row { flex-wrap: wrap; }
.guess.ttl-row .entry-text { flex: 1 1 100%; text-align: left; }
.ttl-row .own-btns { margin-left: auto; }
@media (min-width: 700px) {
  .sgwrap .board { display: grid; grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .ttl-st { padding: 8px 12px; }
  .ttl-st .ttl-who { grid-column: 2 / -1; }
  .wyr-res { padding: 8px 12px; gap: 6px; }
  .wyr-opt { min-height: 72px; }
  .sgwrap .result-banner { padding-top: 12px; padding-bottom: 12px; }
}
.ttl-num { flex-shrink: 0; }


/* ---- Visual revamp (2026-11-11): Imposter, Pincode, Pencil Dungeon ---- */
/* Imposter: phone keeps one column in DOM order; desktop puts the action left and the private card / player list right. */
.igrid { display: flex; flex-direction: column; gap: 14px; }
.imain { display: contents; }
.scard.compact .secret { min-height: 62px; font-size: 1rem; border-width: 2.5px; }
.scard.compact .reveal { padding: 12px 12px; box-shadow: 3px 3px 0 var(--pop); border-radius: 18px; }
.scard.compact .reveal .big { font-size: 2rem; margin: 2px 0; }
.scard.compact .reveal .big.q { font-size: 1.1rem; }
.scard.compact .reveal p { margin: 4px 0 0; font-size: 0.82rem; line-height: 1.3; }
.scard .btn.small { margin-top: 8px; }
@media (min-width: 1000px) {
  body:has(.igrid) #app { max-width: 1180px; }
  .igrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 12px; align-items: start; }
  .igrid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .igrid.even > :nth-child(3) { grid-column: 1 / -1; }
  .imain { display: flex; flex-direction: column; gap: 12px; }
  .iside { position: sticky; top: 12px; }
  .board.many { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .igrid .board li { padding: 5px 10px; }
  .igrid .votes { flex-direction: row; flex-wrap: wrap; }
  .igrid .votes .vote-btn { flex: 1 1 200px; }
  .result-banner { padding: 14px 16px; }
  .result-banner .title { font-size: 1.8rem; }
}

/* Pincode: one tile per digit; desktop shows the guess history beside the controls */
.pin-tiles { display: inline-flex; gap: 5px; letter-spacing: 0; }
.pin-tiles i, .guess .pin i { font-style: normal; font-family: var(--display); font-weight: 700; display: inline-grid; place-items: center; width: 1.45em; height: 1.65em; border: 2px solid var(--edge); border-radius: 9px; background: var(--card); box-shadow: 2px 2px 0 var(--pop); letter-spacing: 0; color: var(--text); }
.pin-big.pin-tiles { padding-left: 0; font-size: 2rem; justify-content: center; }
.pin-small.pin-tiles { font-size: 0.85rem; gap: 3px; vertical-align: middle; }
.pin-small.pin-tiles i { box-shadow: none; border-radius: 6px; width: 1.4em; height: 1.5em; }
.guess .pin { display: flex; gap: 5px; letter-spacing: 0; font-size: 1.15rem; }
.guess .pin.entry-text { display: block; }
.pcgrid { display: flex; flex-direction: column; gap: 14px; }
.pcmain, .pcside { display: contents; }
.pcforce { order: 9; }
@media (min-width: 1000px) {
  body:has(.pcgrid) #app { max-width: 1100px; }
  .pcgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .pcmain, .pcside { display: flex; flex-direction: column; gap: 10px; }
  .pcforce { order: 0; }
  .pcside .guesses { max-height: calc(100dvh - 270px); }
  .pcgrid.even .pcside .guesses { max-height: calc(100dvh - 330px); }
}

/* Pencil Dungeon: chunkier direction keys */
.dkey { font-family: var(--display); box-shadow: 3px 3px 0 var(--pop); transition: transform 0.08s ease, box-shadow 0.08s ease; }
.dkey:active, .dkey.selected { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--pop); }
.die { background: var(--violet); color: #fff; font-family: var(--display); }

/* Short desktop windows: Dice Delve's dice panel gets a little tighter so the whole sheet still fits */
@media (min-width: 1000px) and (max-height: 800px) {
  .gcorner { gap: 6px; }
  .gcorner .hint { font-size: 0.75rem; line-height: 1.2; margin: 0; }
  .gcorner .ddie { width: 34px; height: 34px; }
}

/* Dutch card game: the theme's terms as chips, the secret one stands out */
.terms { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 10px; }
.term { background: rgba(255, 255, 255, 0.5); border: 1.5px solid var(--edge); border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 700; color: #1b1340; }
.term.on { background: #fff; font-weight: 800; box-shadow: 2px 2px 0 #1b1340; transform: translateY(-1px); }
.scard.compact .terms { margin-top: 6px; gap: 4px; }
.scard.compact .term { font-size: 0.7rem; padding: 1px 8px; }

/* Dice Delve: life is shown once as hearts with a number; points lost for life use a broken heart */
.lifebox { display: flex; align-items: center; gap: 8px 10px; flex-wrap: wrap; }
.lifelabel { font-weight: 800; font-size: 0.9rem; color: var(--muted); white-space: nowrap; }
.lifelabel b { color: var(--text); font-size: 1.15rem; }
.lifelabel .of { opacity: 0.7; }
.heart.spare:not(.gone) { background: #ffb3c7; }
.delve .board li .what { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 2px 8px; flex: 1 1 100%; text-align: left; }
.delve .board li { flex-wrap: wrap; }


/* ---- Drawing games (Draw & Guess, Drawing Telephone, Fake Artist): shared canvas + screens ---- */
.cv-board { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.cv-canvas { display: block; width: min(100%, calc(var(--cvh, 9999px) * 4 / 3)); height: auto; aspect-ratio: 4 / 3; background: #fff; border: 2.5px solid var(--edge); border-radius: 14px; box-shadow: 4px 4px 0 var(--pop); touch-action: auto; }
.cv-canvas.can-draw { touch-action: none; cursor: crosshair; outline: 3px solid var(--g, var(--accent)); outline-offset: 2px; }
.cv-tools { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.cv-tools[hidden] { display: none; }
.cv-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.cv-sw { width: 32px; height: 32px; border-radius: 50%; border: 2.5px solid var(--edge); background: var(--sw); padding: 0; cursor: pointer; }
.cv-sw.eraser { background: #fff repeating-linear-gradient(45deg, transparent 0 4px, #d9d6e8 4px 6px); }
.cv-sw.on { outline: 3px solid var(--text); outline-offset: 2px; }
.cv-sz { width: 40px; height: 36px; border-radius: 12px; border: 2.5px solid var(--edge); background: var(--card-2); display: grid; place-items: center; padding: 0; cursor: pointer; }
.cv-sz i { width: var(--d); height: var(--d); border-radius: 50%; background: var(--text); display: block; }
.cv-sz.on { background: var(--accent-2); }
.cv-sz.on i { background: #1b1340; }
.cv-btn { height: 36px; padding: 0 12px; border-radius: 12px; border: 2.5px solid var(--edge); background: var(--card-2); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.cv-btn:active { transform: translateY(1px); }

.dg-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; }
.dg-top .timer { font-size: 1.6rem; }
.dg-grid, .fa-grid { display: flex; flex-direction: column; gap: 14px; }
.dg-main, .fa-main { align-items: center; }
.dg-aside, .fa-aside { display: flex; flex-direction: column; gap: 12px; }
.dg-score, .fa-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dg-score li, .fa-legend li { display: flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border-radius: 999px; background: color-mix(in srgb, var(--text) 8%, transparent); font-weight: 700; font-size: 0.9rem; min-width: 0; }
.dg-score .av.sm, .fa-legend .av.sm { width: 26px; height: 26px; font-size: 0.75rem; }
.dg-score .n, .fa-legend .n { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-score b, .fa-legend b { font-family: var(--display); }
.dg-score li.drawing, .fa-legend li.now { background: var(--g); color: #1b1340; }
.dg-score li.got { box-shadow: inset 0 0 0 2px var(--good); }
.fa-legend i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--edge); flex: none; }
.dg-hint { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.dg-cell { width: 26px; height: 34px; border-bottom: 4px solid var(--text); font-family: var(--display); font-weight: 800; font-size: 1.5rem; line-height: 34px; text-align: center; text-transform: uppercase; }
.dg-cell.on { color: var(--g); }
.dg-gap { width: 16px; }
.dg-reveal { font-family: var(--display); font-size: 1.5rem; text-align: center; }
.dg-reveal b { color: var(--g); font-size: 1.9rem; }
.dg-picks, .fa-picks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; }
.dg-picks .btn { width: auto; min-width: 120px; }
.dg-feed { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; width: 100%; }
.dg-feed li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; background: color-mix(in srgb, var(--text) 6%, transparent); min-width: 0; }
.dg-feed li.ok { background: var(--good-fill, #bff3e6); color: #08362e; }
.dg-feed .av.sm { width: 26px; height: 26px; font-size: 0.75rem; }
.dg-feed .n { font-weight: 700; flex: none; max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-said { overflow-wrap: anywhere; min-width: 0; }
.dg-side .clue-form { margin-top: 0; }

.fa-secret { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 14px; border-radius: 14px; background: var(--card-2); border: 2px solid var(--edge); width: 100%; text-align: center; }
.fa-secret > span:first-child { font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.fa-secret b { font-family: var(--display); font-size: 1.7rem; }
.fa-secret.fake { background: var(--accent); color: #1b1340; border-color: var(--pop); }
.fa-secret.fake span { color: #1b1340; text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 600; }
.fa-turn { margin: 0; font-weight: 700; text-align: center; }
.fa-turn.mine { color: var(--g); font-size: 1.15rem; }
.fa-votes { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.fa-vote { width: 100%; }
.fa-picks .btn { width: auto; }

.tp-prompt { font-family: var(--display); font-weight: 700; font-size: 1.35rem; text-align: center; margin: 0; padding: 8px 12px; border-radius: 14px; background: var(--accent-2); color: #1b1340; border: 2px solid var(--edge); width: 100%; overflow-wrap: anywhere; }
.tp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.tp-entry { background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.tp-entry.new { border-color: var(--g); box-shadow: 4px 4px 0 var(--pop); }
.tp-by { display: flex; align-items: center; gap: 8px; font-weight: 700; align-self: flex-start; }
.tp-by .av.sm { width: 28px; height: 28px; font-size: 0.8rem; }
.tp-by small { color: var(--muted); font-weight: 600; }
.tp-text { margin: 0; text-align: center; overflow-wrap: anywhere; font-weight: 600; }
.tp-text.big { font-family: var(--display); font-size: 1.4rem; }
.tp-head .stack-row { display: flex; gap: 10px; }

@media (min-width: 700px) {
  .tp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .dg-picks .btn { min-width: 160px; }
}
@media (min-width: 1000px) {
  .dg-grid, .fa-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
  .dg-main, .fa-main { --cvh: calc(100dvh - 330px); gap: 8px; }
  .cv-tools { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
  .fa-main { --cvh: calc(100dvh - 360px); }
  .fa-secret { flex-direction: row; justify-content: center; align-items: baseline; gap: 10px; padding: 4px 12px; }
  .fa-secret b { font-size: 1.3rem; }
  .dg-feed { max-height: calc(100dvh - 330px); }
  .tp-list { grid-template-columns: repeat(3, minmax(0, 1fr)); max-height: calc(100dvh - 250px); overflow-y: auto; scrollbar-width: thin; }
  .tp-entry { padding: 8px; }
}

/* ---- Streamer mode (body.streamer, toggled by the eye button). Private things are wrapped in .sec-wrap by games/common.js sec().
   Normally the wrapper is invisible to layout; in streamer mode the content is removed (not just blurred, so nothing can be
   read back from the video) and a "Hold to reveal" panel stands in until the player presses and holds on it (body.peek). */
.sec-wrap, .sec { display: contents; }
.sec-hint { display: none; }
.streambtn.on { background: var(--accent-2); color: #1b1340; }
body.streamer .sec-wrap {
  display: flex; align-items: center; justify-content: center; position: relative;
  min-height: 2rem; margin: 2px 0; padding: 2px 10px;
  border: 2.5px dashed var(--edge); border-radius: 16px;
  background: repeating-linear-gradient(135deg, var(--card-2) 0 10px, transparent 10px 20px);
  cursor: pointer; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: manipulation;
}
body.streamer .sec-wrap.sec-inline {
  display: inline-block; min-height: 0; min-width: 3.4em; margin: 0; padding: 0 .35em; border-width: 2px; border-radius: 8px; vertical-align: middle; line-height: 1.25;
}
body.streamer .sec-wrap.sec-inline::before { content: "••••"; letter-spacing: .18em; font-weight: 700; color: var(--muted); }
body.streamer .sec { display: none; }
body.streamer .sec-hint { display: block; font-family: var(--display); font-weight: 700; font-size: .9rem; line-height: 1.2; color: var(--text); text-align: center; }
body.streamer.peek .sec-wrap { display: block; min-height: 0; margin: 0; padding: 0; border-color: transparent; background: none; }
body.streamer.peek .sec-wrap.sec-inline { display: inline; padding: 0; }
body.streamer.peek .sec-wrap.sec-inline::before { content: none; }
body.streamer.peek .sec { display: contents; }
body.streamer.peek .sec-hint { display: none; }
/* Phones: the header carries up to six buttons (with the streamer-mode eye), so make them a little smaller and let the code shrink. */
@media (max-width: 480px) {
  .topbar { gap: 5px; }
  .topbar .iconbtn { width: 38px; height: 38px; border-radius: 12px; }
  .topbar .iconbtn svg { width: 18px; height: 18px; }
  .roomcode .sec-inline { min-width: 0; padding: 0 .3em; }
}

/* ---- feedback / bug report */
.feedback-fab {
  position: fixed; left: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 30;
  width: 40px; height: 40px; padding: 0; display: grid; place-items: center; cursor: pointer;
  background: var(--card); color: var(--text); border: 2px solid var(--edge); border-radius: 50%; opacity: 0.7;
}
.feedback-fab:hover, .feedback-fab:focus-visible { opacity: 1; }
.feedback-fab svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.fb-body { display: flex; flex-direction: column; gap: 12px; padding-top: 4px; }
.fb-body textarea {
  font: inherit; color: var(--text); background: var(--bg-2); border: 2.5px solid var(--edge); border-radius: 16px;
  padding: 10px 14px; width: 100%; outline: none; resize: vertical; min-height: 110px;
}
.fb-body textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.fb-body input:not([type]), .fb-body input[type="text"] { min-height: 48px; }
.fb-check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.88rem; color: var(--muted); cursor: pointer; }
.fb-check input { width: 20px; height: 20px; margin-top: 1px; flex: none; accent-color: var(--accent); }
.fb-error { margin: 0; color: var(--bad); font-weight: 600; }
.fb-done { text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 18px 0 8px; }
.fb-done h3 { margin: 0; font-family: var(--display); font-size: 1.4rem; }
.fb-done p { margin: 0 0 8px; }
.fb-big { font-size: 2.6rem; }
@media (min-width: 700px) {
  #feedback-root .overlay { align-items: center; }
  #feedback-root .overlay-card { border-radius: 24px; border-bottom: 2.5px solid var(--edge); max-width: 460px; }
}
.sheet-actions { display: flex; gap: 8px; }
/* On a phone the in-room screens use the whole bottom edge (sticky start bar, game controls), so the floating button
   hides there; players reach the form from the chat sheet instead. */
@media (max-width: 699px) { body.in-room .feedback-fab { display: none; } }
.codehead { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lfeedback { flex: none; }
@media (min-width: 700px) { .lfeedback { display: none; } }
.fb-item { border: 2px solid var(--edge); border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 6px; background: var(--bg-2); }
.fb-meta { display: flex; align-items: center; gap: 10px; }
.fb-meta .btn { margin-left: auto; min-height: 34px; padding: 2px 10px; }
.fb-text { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.fb-ctx { overflow-wrap: anywhere; }
.acc-uid code { user-select: all; overflow-wrap: anywhere; }
.admin-stats { border: 2px solid var(--edge); border-radius: 16px; padding: 12px; background: var(--bg-2); display: flex; flex-direction: column; gap: 12px; }
.admin-stats p { margin: 0; }
.stat-head { display: flex; align-items: center; gap: 8px; }
.stat-head strong { font-family: var(--display); font-size: 1.1rem; margin-right: auto; white-space: nowrap; }
.stat-head small { font-size: 0.72rem; white-space: nowrap; }
/* Each topic is its own framed block with a small heading */
.stat-sec { background: var(--card); border: 2px solid var(--edge); border-radius: 14px; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.stat-sec h4 { margin: 0; font-family: var(--display); font-size: 0.95rem; letter-spacing: 0.02em; display: flex; align-items: center; gap: 6px; padding-bottom: 6px; border-bottom: 2px dashed color-mix(in srgb, var(--edge) 35%, transparent); }
.stat-sec .sub { font-size: 0.75rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 2px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--bg-2); border: 2px solid var(--edge); border-radius: 12px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; }
.stat.hero { background: var(--accent-2); color: #1b1340; box-shadow: 3px 3px 0 var(--pop); }
.stat.hero small { color: #1b1340; opacity: 0.8; }
.stat b { font-family: var(--display); font-size: 1.5rem; line-height: 1.1; }
.stat.hero b { font-size: 1.9rem; }
.stat small { color: var(--muted); font-size: 0.72rem; }
.schips { display: flex; flex-wrap: wrap; gap: 6px; }
.schip { border: 2px solid var(--edge); border-radius: 999px; padding: 2px 10px; font-size: 0.78rem; font-weight: 700; background: var(--bg-2); white-space: nowrap; }
.schips.now .schip { background: color-mix(in srgb, var(--good, #1f9d6e) 18%, var(--bg-2)); }
.stat-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.stat-table th, .stat-table td { text-align: right; padding: 6px 4px; }
.stat-table th { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 2px solid var(--edge); }
.stat-table td { border-bottom: 1px solid color-mix(in srgb, var(--edge) 25%, transparent); font-variant-numeric: tabular-nums; }
.stat-table tbody tr:last-child td { border-bottom: 0; }
.stat-table th:first-child, .stat-table td:first-child { text-align: left; font-weight: 700; }
.sbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sbars li { display: grid; grid-template-columns: minmax(70px, 38%) 1fr 2ch; align-items: center; gap: 8px; font-size: 0.82rem; }
.sbars .bl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.sbars .bt { height: 12px; border: 2px solid var(--edge); border-radius: 999px; background: var(--bg-2); overflow: hidden; }
.sbars .bt i { display: block; height: 100%; background: var(--accent); }
.sbars b { text-align: right; font-variant-numeric: tabular-nums; }
.ssplit { display: flex; height: 14px; border: 2px solid var(--edge); border-radius: 999px; overflow: hidden; background: var(--bg-2); }
.ssplit i { background: var(--accent-2); }
.ssplit i.b { background: var(--accent); }
.ssplit-l { display: flex; gap: 14px; font-size: 0.78rem; font-weight: 700; }
.ssplit-l .k { display: inline-block; width: 10px; height: 10px; border-radius: 3px; background: var(--accent-2); border: 1.5px solid var(--edge); margin-right: 5px; }
.ssplit-l .k.b { background: var(--accent); }
@media (min-width: 420px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }

/* Lobby game filter: one scrollable row of small chips above the game tiles */
.tagbar { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; scrollbar-width: none; }
.tagbar::-webkit-scrollbar { display: none; }
.tagchip { flex: none; height: 32px; padding: 0 12px; border: 2px solid var(--edge); border-radius: 999px; background: var(--card); color: var(--text); font-family: var(--display); font-weight: 600; font-size: 0.85rem; cursor: pointer; white-space: nowrap; }
.tagchip.on { background: var(--edge); color: var(--bg); }
.tagchip:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
/* Lobby: selected-game card and the host's game browser (2026-11-15) */
.gcard { border-top: 6px solid var(--g, var(--accent)); }
.gcard-top { display: flex; align-items: center; gap: 10px; }
.gcard-top .ico { flex: none; width: 34px; height: 34px; padding: 6px; border-radius: 12px; background: var(--g, var(--accent)); border: 2px solid var(--edge); stroke: var(--edge); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; box-sizing: border-box; }
.gcard-name { flex: 1; min-width: 0; }
.gcard-name h2 { margin: 0; }
.gcard-name small { font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.gcard-blurb { margin: 10px 0 12px; line-height: 1.4; }
.gcard-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gcard-start { width: 100%; margin-top: 12px; }
.gcard .hint { margin: 8px 0 0; text-align: center; }
.lactions .gcard-browse { width: 100%; }
.gcard-tags { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gcard-tags .pill { font-size: 0.72rem; padding: 2px 10px; background: var(--card-2); color: var(--text); }
.favbtn { flex: none; width: 36px; height: 36px; border: 2px solid var(--edge); border-radius: 12px; background: var(--card); color: var(--text); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0; }
.favbtn.on { background: var(--accent-2); color: #1b1340; }
.favbtn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.gpick { position: relative; min-width: 0; }
.gpick .gtile { padding-right: 34px; }
.gpick .favbtn { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 9px; font-size: 0.95rem; border-width: 1.5px; }
.gtile.nofit { opacity: 0.55; }
.picker .overlay-card.pickcard { display: flex; flex-direction: column; height: 92dvh; max-height: 92dvh; overflow: hidden; }
.gsearch { width: 100%; box-sizing: border-box; height: 44px; margin: 4px 0 10px; padding: 0 14px; border: 2.5px solid var(--edge); border-radius: 14px; background: var(--card-2); color: var(--text); font: inherit; }
.pickcard .tagbar { flex: none; }
.pickres { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 2px 12px; scrollbar-width: thin; }
.picksec { margin: 10px 0 6px; font-family: var(--display); font-size: 0.95rem; font-weight: 600; }
.picksec:first-child { margin-top: 2px; }
@media (min-width: 700px) {
  .picker .overlay-card.pickcard { max-width: 780px; height: 84dvh; max-height: 84dvh; padding-bottom: 16px; }
}
@media (min-width: 1000px) {
  .picker .overlay-card.pickcard { max-width: 920px; }
  .pickcard .games { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Admin stats: collapsible account list */
.plist { margin: 6px 0; }
.plist summary { cursor: pointer; font-weight: 700; font-size: 0.85rem; }
.plist ul { list-style: none; margin: 6px 0; padding: 0; max-height: 220px; overflow-y: auto; border: 2px solid var(--edge); border-radius: 10px; }
.plist li { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 5px 8px; font-size: 0.8rem; border-bottom: 1px solid color-mix(in srgb, var(--edge) 25%, transparent); }
.plist li:last-child { border-bottom: 0; }
.plist .pn { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist .pm, .plist .pd { color: var(--muted, inherit); opacity: 0.75; white-space: nowrap; }
.plist .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: color-mix(in srgb, var(--edge) 30%, transparent); }
.plist .dot.on { background: #1f9d6e; }

/* Who Am I? typed questions */
.wai-q { font-size: 1.35rem; line-height: 1.2; overflow-wrap: anywhere; }
.wai-log { list-style: none; margin: 6px 0 0; padding: 0; text-align: left; font-size: 0.88rem; display: grid; gap: 4px; }
.wai-log li { overflow-wrap: anywhere; }

/* Who Am I?: the latest wrong guess and the "That was right!" button, loud enough to notice */
.wai-guessed { margin-top: 12px; width: 100%; box-sizing: border-box; text-align: center; background: #ffd23f; color: #1b1340; border: 3px solid var(--edge); border-radius: 16px; padding: 12px; box-shadow: 4px 4px 0 var(--edge); display: grid; gap: 8px; }
.wai-guessed .eyebrow { color: #1b1340; }
.wai-guessed .wai-q { font-size: 1.5rem; line-height: 1.2; overflow-wrap: anywhere; }
.wai-guessed .btn.big { width: 100%; min-height: 56px; font-size: 1.15rem; }
.dstrip .btn.ghost { color: #2d2108; border-color: #6b5a38; background: rgba(255, 252, 240, 0.6); }
.dstrip .btn.primary { box-shadow: none; }

/* Score row like the printed sheet: one row, a life/end box on the left, tall grids, big sum signs (wide screens). */
@media (min-width: 700px) {
  .dstrip { flex-direction: row; align-items: stretch; gap: 14px; padding: 12px; }
  .dstrip .score { flex: 1; min-width: 0; flex-wrap: nowrap; }
  .sgrp { align-items: stretch; }
  .sgrp .op { align-self: center; font-size: 1.8rem; }
  .sgrid { grid-template-rows: repeat(2, minmax(34px, 1fr)); }
  .sgrid i { height: auto; }
  .sgrp.gold { flex: 0 1 130px; }
  .sbox2 { justify-content: space-between; padding: 6px 8px; }
  .sbox2 b { font-size: 1.7rem; }
}
@media (min-width: 700px) {
  .dstrip .score { flex-wrap: wrap; row-gap: 14px; align-content: center; }
  .sgrp.gold { flex: 0 0 112px; }
  .sgrp.gems { flex: 1 1 230px; min-width: 200px; }
  .sgrid { min-height: 76px; }
}
@media (min-width: 700px) {
  .dstrip { padding: 10px; gap: 10px; }
  .dstrip .score { gap: 6px; }
  .sgrp { gap: 4px; }
  .sgrp .op { font-size: 1.4rem; }
  .sgrp.gold { flex: 0 0 84px; }
  .sgrp.gems { flex: 1 1 150px; min-width: 140px; }
  .sbox2 { min-width: 44px; padding: 5px 5px; }
  .sbox2.total { min-width: 54px; }
  .sbox2 b { font-size: 1.45rem; }
}
@media (min-width: 1000px) and (max-width: 1199px), (min-width: 1200px) {
  .score { column-gap: 5px; }
}

/* Score row, final: flat paper sheet like the printed board's bottom row. Bonus boxes, gold grid, gem grid, - heart = TOTAL. */
.dstrip { flex-direction: row; align-items: stretch; flex-wrap: wrap; gap: 8px; padding: 8px 10px; border-radius: 12px; background: linear-gradient(180deg, #f1e8cd, #e7dbb9); border: 2px solid #a89468; }
.dstrip .score { flex: 1 1 300px; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: stretch; }
.abox { flex: 0 0 auto; display: flex; flex-direction: column; border: 2px solid #6b5a38; border-radius: 6px; background: #fbf6e6; overflow: hidden; min-width: 64px; }
.acells { flex: 1; display: grid; grid-template-columns: repeat(3, 20px); gap: 4px; justify-content: center; align-content: center; padding: 6px; }
.acells i { width: 20px; height: 20px; border: 2px solid #2a7a2a; border-radius: 3px; background: #fff; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 0.8rem; color: #2a7a2a; line-height: 1; }
.acells i.on { background: #bfe39a; }
.abox.done { background: #e6f3cf; }
.acap { border-top: 2px solid #6b5a38; padding: 3px 4px; text-align: center; font-weight: 800; font-size: 0.72rem; color: #4a3a1a; white-space: nowrap; }
.sbox2 { justify-content: flex-start; padding: 0; overflow: hidden; gap: 0; }
.sbox2 .bh { width: 100%; min-height: 24px; display: grid; place-items: center; border-bottom: 2px solid #6b5a38; font-size: 0.62rem; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 800; color: #5a4a2a; padding: 2px 4px; }
.sbox2 b { flex: 1; display: grid; place-items: center; width: 100%; }
.sbox2 .bh .heart { width: 15px; height: 13px; }
.lifeline { display: flex; justify-content: space-between; gap: 8px; font-weight: 800; font-size: 0.85rem; color: var(--muted); }
.lifeline b { color: var(--text); }
@media (min-width: 700px) {
  .dstrip { padding: 8px 10px; gap: 8px; }
  .sgrp.gold { flex: 0 0 84px; }
  .sgrp.gems { flex: 1 1 150px; min-width: 130px; }
  .sgrid { min-height: 66px; }
}

.dstrip { height: auto; align-self: start; }
@media (min-width: 700px) {
  .gstrip { display: flex; flex-direction: column; gap: 10px; }
  .strip-actions.only-wide { display: flex; align-items: center; gap: 14px; }
  .strip-actions .lifeline { flex: 0 0 auto; gap: 14px; }
  .strip-actions .btn { flex: 1; }
}
.dstrip { align-self: auto; flex: none; width: 100%; box-sizing: border-box; }

/* Delve score row, third pass: fist box, path box, 3x15 gem grid, minus hearts, equals total */
.sgrp.gold { flex: 0 0 auto; }
.sgrp.gold .sbox2 { min-width: 54px; }
.sgrid { grid-template-rows: repeat(3, 1fr); }
.sgrid i { height: 17px; }
.abox .acells { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; grid-template-columns: none; }
.acount { font-size: 0.74rem; font-weight: 800; color: #4a3a1a; line-height: 1; }
.acg { display: grid; grid-template-columns: repeat(3, 18px); gap: 3px; }
.acg i { width: 18px; height: 18px; border: 2px solid #2a7a2a; border-radius: 3px; background: #fff; display: grid; place-items: center; font-style: normal; font-weight: 900; font-size: 0.75rem; color: #2a7a2a; line-height: 1; }
.acg i.on { background: #bfe39a; }
.abox.path .pchain { flex: 1; display: flex; align-items: center; justify-content: center; gap: 3px; padding: 6px 8px; font-size: 0.62rem; font-weight: 900; color: #6b5a38; letter-spacing: -0.05em; }
.pchain i.big { width: 22px; height: 22px; border: 2px solid #2a7a2a; background: #8fd070; border-radius: 3px; flex: none; }
.pchain.done i.big { background: #4fae3a; }
.pchain.done span { color: #2a7a2a; }
@media (min-width: 700px) { .sgrid { grid-template-rows: repeat(3, minmax(24px, 1fr)); } .sgrid i { height: auto; } }
.dstrip { justify-content: flex-start; }

/* dice: spent = faded and pressed down, nothing to play = darkened grey (clearly different shades) */
.ddie.used { opacity: 0.22; }
.ddie.dim { opacity: 0.75; filter: grayscale(1) brightness(0.55); }

/* Delve feedback layer: dice roll, round banner, deaths, toasts. Everything ignores taps. */
.dfx { position: fixed; inset: 0; pointer-events: none; z-index: 60; overflow: hidden; }
.fx-round { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); text-align: center; padding: 14px 40px; border-radius: 18px; background: rgba(12, 28, 18, 0.88); border: 2px solid var(--accent-2); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55); animation: fx-pop 1.9s both; }
.fx-round small { display: block; font-size: 0.9rem; letter-spacing: 0.25em; text-transform: uppercase; opacity: 0.8; }
.fx-round b { font-size: 4rem; line-height: 1; color: var(--accent-2); }
.fx-dead { position: absolute; left: 50%; top: 22%; transform: translate(-50%, 0); max-width: 90vw; text-align: center; padding: 12px 24px; border-radius: 14px; background: rgba(60, 8, 16, 0.92); border: 2px solid #e0344f; color: #ffd9de; font-weight: 900; font-size: 1.3rem; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6); animation: fx-drop 3.2s both; }
.fx-flash { position: absolute; inset: 0; box-shadow: inset 0 0 90px 20px rgba(224, 52, 79, 0.75); animation: fx-flash 0.8s both; }
.fx-toasts { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; width: min(92vw, 420px); }
.fx-toast { padding: 8px 14px; border-radius: 12px; background: rgba(14, 30, 22, 0.94); border: 1.5px solid rgba(255, 255, 255, 0.25); font-weight: 700; font-size: 0.92rem; text-align: center; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45); animation: fx-toast 4.2s both; }
.fx-toast.me { border-color: var(--accent-2); }
.fx-toast.bad { border-color: #e0344f; color: #ffd9de; }
.fx-toast.event { border-color: #f6c63a; }
.ddie.rolling { animation: fx-roll 0.9s cubic-bezier(0.3, 0.7, 0.4, 1) both; }
@keyframes fx-roll { 0% { transform: translateY(-40px) rotate(0deg) scale(0.8); opacity: 0; } 35% { opacity: 1; } 60% { transform: translateY(4px) rotate(540deg) scale(1.08); } 80% { transform: translateY(-6px) rotate(660deg); } 100% { transform: translateY(0) rotate(720deg); } }
@keyframes fx-pop { 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); } 25% { transform: translate(-50%, -50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.05); } }
@keyframes fx-drop { 0% { opacity: 0; transform: translate(-50%, -30px); } 10% { opacity: 1; transform: translate(-50%, 0); } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-flash { 0% { opacity: 0; } 20% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-toast { 0% { opacity: 0; transform: translateY(12px); } 6% { opacity: 1; transform: translateY(0); } 85% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ddie.rolling, .fx-round, .fx-dead, .fx-flash, .fx-toast { animation-duration: 0.01s; } }

/* Dice Delve: rulebook visuals (10-box life track with the skull in the last box, green extra-life hearts, cloud numbers, writing phase) */
.vtrack li .skull { font-style: normal; font-size: 0.7rem; margin-left: 2px; }
.heart.extra:not(.gone) { background: #8bdc4a; }
.dstrip .heart.extra:not(.gone) { background: #4fae3a; }
.ybox.g.spent { background: #9dc43f; text-decoration: line-through; }
.dtile.k-cloud .num { font-size: 1.05em; }
.dtile.k-cloud.sel { outline-color: #fff; background: #c9a8f0; transform: scale(1.06); z-index: 4; }
.writecard { display: flex; flex-direction: column; gap: 8px; }
.writecard h2 { margin: 0; font-size: 1.05rem; }

/* Dice Delve on a scanned sheet: the scan is the map, tiles are invisible tap areas with marks on top */
.dmap.art { background-size: 100% 100%; background-repeat: no-repeat; border-radius: 8px; }
.atile, .amon { position: absolute; display: block; box-sizing: border-box; margin: 0; padding: 0; border: 0; background: transparent; appearance: none; -webkit-appearance: none; color: inherit; font: inherit; text-align: left; border-radius: 9px; }
.atile.ok, .amon.ok { z-index: 3; cursor: pointer; background: rgba(255, 244, 160, 0.3); box-shadow: 0 0 0 3px var(--accent-2, #ffd84a), 0 0 16px 4px rgba(255, 216, 74, 0.8); animation: aglow 1.3s ease-in-out infinite; }
@keyframes aglow { 50% { box-shadow: 0 0 0 3px #fff3a0, 0 0 26px 8px rgba(255, 216, 74, 0.95); } }
.atile .xmark { inset: 14%; width: 72%; height: 72%; }
.atile .xmark path { stroke: #1d1a22; stroke-width: 3.6; opacity: 0.92; }
.atile .cnum { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1.5em; font-weight: 900; color: #2d1b4e; }
.atile.k-cloud.sel { outline: 3px solid #fff; background: rgba(201, 168, 240, 0.55); z-index: 4; }
.ahdr { position: absolute; pointer-events: none; border-radius: 3px; }
.ahdr text { font-family: "Arial Narrow", "Roboto Condensed", "Helvetica Neue", Impact, sans-serif; font-weight: 800; fill: #2b2b2b; }
.ahdr .lock { fill: #fafcf9; stroke: #2b2b2b; stroke-width: 0.8; font-weight: 600; }
.ahdr .sl { fill: #2b2b2b; stroke: none; }
.abx { position: absolute; display: block; pointer-events: none; }
.abx .xmark { inset: 6%; width: 88%; height: 88%; }
.abx .xmark path { stroke: #c0152f; stroke-width: 4.4; opacity: 0.95; }
.amon.done::after { content: ""; position: absolute; inset: 0; background: rgba(15, 15, 15, 0.5); border-radius: 8px; }
.amon .adone { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; font-size: 3em; }
/* ?outline=1 debug view for the scan squares */
.dmap.dbg .atile, .dmap.dbg .amon { outline: 2px solid rgba(255, 40, 40, 0.85); outline-offset: -1px; }
.dmap.dbg .amon { outline-color: rgba(30, 90, 255, 0.9); }
.dmap.dbg .atile::before, .dmap.dbg .amon::before { content: attr(data-t); position: absolute; left: 2px; top: 1px; z-index: 5; padding: 0 3px; font: 700 11px/14px system-ui, sans-serif; color: #fff; background: rgba(0, 0, 0, 0.7); border-radius: 3px; pointer-events: none; }
/* in-app square editor (owner tool, see public/games/delve-edit.js) */
.dmap.edit { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.dmap.edit .atile, .dmap.edit .amon { cursor: pointer; background: rgba(255, 60, 60, 0.07); }
.dmap.edit .amon { background: rgba(40, 100, 255, 0.07); }
.dmap.edit .ehdr { position: absolute; z-index: 4; box-sizing: border-box; outline: 2px solid #1fc46a; background: rgba(31, 196, 106, 0.18); }
.dmap.edit .abx { position: absolute; z-index: 4; box-sizing: border-box; outline: 2px solid #e832c8; }
.dmap.edit .sel { z-index: 8 !important; touch-action: none; cursor: move; outline: 3px solid #ffd84a !important; background: rgba(255, 216, 74, 0.35) !important; }
.etool-gap { height: 335px; order: 99; }

/* Editor panel: same look as the rest of the app (display font, thick outline, hard shadow, .seg-style chips) */
.etool { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-width: 680px; margin: 0 auto; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; gap: 8px; background: var(--room, #1b1340); color: var(--text); border: 2.5px solid var(--edge); border-bottom: none; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 0 var(--pop); font-size: 0.9rem; }
.etool .erow { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.etool .erow > span:not(.muted) { font-family: var(--display); font-weight: 600; color: var(--muted); margin-right: 2px; }
.etool .erow:first-child { padding-bottom: 8px; border-bottom: 2px dashed var(--card-2); }
.etool b { font-family: var(--display); font-weight: 600; font-size: 1.05rem; }
.etool .muted { color: var(--muted); }
.etool button { min-width: 38px; min-height: 36px; padding: 0 9px; white-space: nowrap; border-radius: 12px; border: 2px solid var(--edge); background: var(--card-2); color: var(--text); font: inherit; font-family: var(--display); font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: transform 0.08s ease, box-shadow 0.08s ease; }
.etool button:active { transform: translate(2px, 2px); }
.etool button.on { background: var(--accent-2); color: #1b1340; border-color: var(--edge); box-shadow: 2px 2px 0 var(--pop); }
.etool .esave button { flex: 1; min-height: 42px; background: var(--accent-2); color: #1b1340; box-shadow: 3px 3px 0 var(--pop); font-size: 1rem; }
.etool .gapl { margin-left: 2px; }
.etool .erow.emove { gap: 4px; }
.etool .erow.emove button { min-width: 32px; padding: 0 5px; }
.etool .erow.eact button { flex: 1; box-shadow: 2px 2px 0 var(--pop); }
.etool .erow.eact button[data-edit-act="clear"] { color: var(--bad); }
.topbar .iconbtn.editon { background: var(--accent-2); color: #1b1340; box-shadow: 2px 2px 0 var(--pop); }
@media (min-width: 1200px) {
  /* desktop: the panel is a card at the top of the side column, so the map is never covered */
  .etool-gap { display: none; }
  .dextra .etool { position: static; max-width: none; margin: 0; padding: 14px 14px 12px; border: 2.5px solid var(--edge); border-radius: var(--radius); box-shadow: 4px 4px 0 var(--pop); gap: 10px; order: -1; flex: none; }
  .etool .erow { gap: 6px; }
  .etool .erow > span:not(.muted):not(.gapl) { width: 66px; flex: none; }
  .etool button { min-height: 38px; }
  .etool .erow.emove { gap: 5px; }
  .etool .erow.eact { display: grid; grid-template-columns: 1fr 1fr; }
  .etool b { font-size: 1.15rem; }
  .etool .gapl { flex: 0 0 100%; height: 0; margin: 0; }
  .etool .gapl + button { margin-left: 72px; }
  .etool .erow.emove button { min-width: 38px; padding: 0 8px; }
}

/* Square editor, phone: a full-screen editor. Top bar, the map filling what is left, and a compact tool dock under it (it no longer floats over the map). */
.edbar { display: none; }
@media (max-width: 699px) {
  .edscreen { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--room, #1b1340); padding-top: env(safe-area-inset-top); }
  .edscreen .dhead { display: none; }
  .edbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; flex: none; }
  .edbar strong { flex: 1; min-width: 0; font-family: var(--display); font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .edzoom { display: flex; gap: 6px; }
  .edscreen .dlayout, .edscreen .dgrid, .edscreen .gmap, .edscreen .dboard { display: flex; flex-direction: column; flex: 1; min-height: 0; gap: 0; }
  .edscreen .dboard { order: 0; }
  .edscreen .zoombar, .edscreen .dboard .legend { display: none; }
  .edscreen .dscroll { flex: 1; min-height: 0; max-height: none; border: 0; border-radius: 0; box-shadow: none; padding: 4px; }
  .edscreen .dextra { display: block; flex: none; }
  .edscreen .etool-gap { display: none; }
  .edscreen .etool { position: static; max-width: none; margin: 0; width: 100%; box-sizing: border-box; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-radius: 16px 16px 0 0; box-shadow: 0 -3px 0 var(--pop); }
  .edscreen .etool .erow { grid-column: 1 / -1; }
  .edscreen .etool .erow:first-child { padding-bottom: 4px; border-bottom-width: 0; flex-wrap: nowrap; }
  .edscreen .etool .erow:first-child b { font-size: 0.95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .edscreen .etool #e-val { font-size: 0.72rem; white-space: nowrap; }
  .edscreen .etool .erow.esave, .edscreen .etool .erow.eact { display: contents; }
  .edscreen .etool .esave button { grid-column: span 2; min-height: 40px; }
  .edscreen .etool .erow.eact button { box-shadow: none; }
  .edscreen .etool .eact button[data-edit-act="copy"], .edscreen .etool .eact button[data-edit-act="file"] { display: none; }
  .edscreen .etool .erow:last-child { font-size: 0.78rem; }
}
@media (min-width: 700px) { .edscreen { display: contents; } }


/* ---- Twelve Letters (2026-11-14) ---- */
/* Phone: one column in DOM order (question, answers list, who's playing). Desktop: question left, answers + status right. */
.tlgrid { display: flex; flex-direction: column; gap: 14px; }
.tlmain, .tlside { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.tl-timer { display: flex; justify-content: center; margin: 2px 0; }
.tl-q .big.q { margin: 2px 0 6px; overflow-wrap: anywhere; }
.tl-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; }
.tl-nav > :first-child { justify-self: start; }
.tl-nav > :last-child { justify-self: end; }
.tl-search { display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--accent-2); color: #1b1340; border: 2.5px solid var(--edge); border-radius: 18px; padding: 10px 14px; box-shadow: 4px 4px 0 var(--pop); position: sticky; top: 8px; z-index: 4; }
.tl-search .muted { color: #1b1340; opacity: 0.8; }
.tl-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
.tl-row { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 12px; padding: 5px 10px; font: inherit; font-weight: 600; color: var(--text); min-height: 40px; cursor: pointer; }
.tl-row.now { background: var(--accent-2); color: #1b1340; box-shadow: 3px 3px 0 var(--pop); }
.tl-list.static .tl-row { cursor: default; }
.tl-row .n, .tl-rev .n { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--g, var(--accent-2)); color: #1b1340; border: 2px solid var(--edge); font-size: 0.8rem; font-weight: 800; }
.tl-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tl-tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tl-tile { width: 38px; height: 46px; display: grid; place-items: center; font-family: var(--display); font-size: 1.5rem; font-weight: 700; background: var(--card-2); color: var(--text); border: 2.5px solid var(--edge); border-radius: 10px; box-shadow: 2px 2px 0 var(--pop); }
.tl-tile.empty { opacity: 0.45; box-shadow: none; }
.tl-tile.on { background: var(--g, var(--accent-2)); color: #1b1340; }
.tl-slots { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; width: 100%; max-width: 560px; margin: 0 auto; }
.tl-slot { aspect-ratio: 3 / 4; display: grid; place-items: center; border: 2px dashed var(--edge); border-radius: 8px; background: transparent; color: var(--muted); font: 700 0.8rem var(--font); padding: 0; cursor: pointer; }
.tl-slot.sel { background: var(--accent-2); color: #1b1340; border-style: solid; }
.tl-slot.on { cursor: default; background: var(--g, var(--accent-2)); color: #1b1340; border-style: solid; font-family: var(--display); font-size: 1.1rem; }
.tl-wrong { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: center; }
.tl-chip { font-weight: 800; background: var(--bg-2); border: 2px solid var(--edge); border-radius: 999px; padding: 3px 10px; overflow-wrap: anywhere; }
.tl-chip.right { background: var(--good-fill); color: #1b1340; }
.tl-chip.wrong { background: color-mix(in srgb, var(--accent) 35%, var(--card)); }
.tl-confirm { display: flex; flex-direction: column; gap: 8px; border: 2px dashed var(--edge); border-radius: 14px; padding: 10px; text-align: center; }
.tl-confirm p { margin: 0; }
.tl-res-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; flex-wrap: wrap; }
.tl-sum { width: 100%; border-collapse: collapse; }
.tl-sum td { padding: 4px 6px; border-bottom: 1px dashed color-mix(in srgb, var(--edge) 50%, transparent); }
.tl-sum td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.tl-sum tr.total td { border-bottom: 0; font-weight: 800; font-size: 1.05rem; }
.tl-revlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.tl-rev { display: flex; gap: 10px; align-items: flex-start; }
.tl-rev > div { min-width: 0; }
.tl-rev .q { color: var(--muted); font-size: 0.9rem; }
.tl-rev .a { font-weight: 800; }
.tl-rev .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
@media (min-width: 700px) { .tl-list { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .tl-tile { width: 32px; height: 40px; font-size: 1.3rem; } .tl-slot { font-size: 0.7rem; } .tl-slot.on { font-size: 0.95rem; } }
@media (min-width: 1000px) {
  .tlgrid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
  .tlgrid.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tlside { position: sticky; top: 8px; max-height: calc(100dvh - 120px); overflow-y: auto; }
  .tl-tile { width: 44px; height: 54px; font-size: 1.7rem; }
}

/* Twelve Letters on short desktop windows (e.g. 1280x620): tighter rows so the question and confirm screens fit without page scroll */
@media (min-width: 1000px) and (max-height: 760px) {
  .tlgrid { gap: 10px; }
  .tlmain, .tlside { gap: 8px; }
  .tl-list { gap: 4px; }
  .tl-row { padding: 2px 8px; }
  .tl-row .n { width: 22px; height: 22px; font-size: 0.72rem; }
  .tl-confirm { gap: 6px; padding: 6px 8px; font-size: 0.85rem; }
  .tlside { max-height: calc(100dvh - 200px); }
  .g-twelveletters .timer { font-size: 1.6rem; }
  .g-twelveletters .tl-timer { margin: 0; }
  .g-twelveletters .tl-confirm .btn { padding-top: 6px; padding-bottom: 6px; }
}

/* ---- Poker (public/games/poker.js) ----
   The table is a size container: everything inside is sized in em from one font-size that follows the table width,
   and positions are percentages, so the same markup works on a phone, a tablet and a desktop window.
   Animations only run on elements the renderer marks (new card, new bet...); see makePlan() in poker.js. */
.pkgrid { display: flex; flex-direction: column; gap: 12px; }
.pkmain, .pkside { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pk-info { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pill.soft { background: var(--card-2); color: var(--text); }
.pk-wrap { container-type: inline-size; width: 100%; }
.pk-table { position: relative; width: 100%; aspect-ratio: 1 / 1.12; container-type: size; font-size: clamp(9px, 2.5cqw, 16px); user-select: none; }
.pk-table.few { font-size: clamp(9px, 3cqw, 17px); }
.pk-table.mid { font-size: clamp(9px, 2.75cqw, 16px); }
.pk-rail { position: absolute; inset: 8% 2% 8%; border-radius: 999px; padding: 3.4cqw; background: linear-gradient(145deg, #6a4328, #2e1b10 55%, #4d311d); box-shadow: 0 .45em 0 rgba(0, 0, 0, .35), 0 0 0 .18em #1a0f08, inset 0 .15em .3em rgba(255, 255, 255, .2); }
.pk-felt { position: relative; width: 100%; height: 100%; border-radius: 999px; background: radial-gradient(ellipse at 50% 38%, #35a872 0%, #1f7d52 55%, #135d3c 100%); box-shadow: inset 0 0 0 .16em rgba(0, 0, 0, .35), inset 0 .5em 2.4em rgba(0, 0, 0, .45); overflow: hidden; }
.pk-felt::after { content: ""; position: absolute; inset: 8%; border-radius: 999px; border: .12em dashed rgba(255, 255, 255, .15); }
.pk-mark { position: absolute; left: 50%; top: 24%; translate: -50% -50%; font-family: var(--display); font-weight: 700; letter-spacing: .5em; font-size: 1.1em; color: rgba(255, 255, 255, .13); white-space: nowrap; }

/* cards */
.pc { position: relative; flex: none; width: 3.3em; height: 4.6em; border-radius: .35em; background: #fff; color: #17142b; font-family: var(--display); font-weight: 700; box-shadow: 0 .1em 0 rgba(0, 0, 0, .3), 0 0 0 .07em rgba(0, 0, 0, .4); }
.pc.red { color: #d3202c; }
.pc b { position: absolute; left: .26em; top: .1em; font-size: 1.2em; line-height: 1; letter-spacing: -.04em; }
.pc i { position: absolute; left: .3em; top: 1.4em; font-style: normal; font-size: .95em; line-height: 1; }
.pc u { position: absolute; left: 50%; top: 58%; translate: -50% -50%; text-decoration: none; font-size: 2.2em; line-height: 1; }
.pc.back { background: repeating-linear-gradient(45deg, #b3202c 0 .35em, #8c1520 .35em .7em); box-shadow: inset 0 0 0 .2em #fff, 0 .1em 0 rgba(0, 0, 0, .3), 0 0 0 .07em rgba(0, 0, 0, .4); }
.pc.slot { background: rgba(0, 0, 0, .14); box-shadow: inset 0 0 0 .1em rgba(255, 255, 255, .2); }
.pc.sm { font-size: .62em; }
.pc.sm.rev { font-size: .85em; }
.pk-board { position: absolute; left: 50%; top: 44%; translate: -50% -50%; display: flex; gap: .45em; z-index: 3; }

/* chips */
.stk { display: inline-flex; align-items: flex-end; gap: .08em; height: calc(var(--h) * .2em + 1.6em); }
.stk .col { position: relative; width: 1.6em; height: 100%; }
.pkc { --c: #e9e4d6; --r: #fff; display: block; padding: 0; min-width: 0; border: 0; position: absolute; left: 0; bottom: calc(var(--j) * .2em); width: 1.6em; height: 1.6em; border-radius: 50%; background: repeating-conic-gradient(var(--r) 0 14deg, var(--c) 14deg 45deg); box-shadow: 0 .1em 0 rgba(0, 0, 0, .5), inset 0 0 0 .07em rgba(0, 0, 0, .25); }
.pkc::before { content: ""; position: absolute; inset: .26em; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 .08em rgba(255, 255, 255, .55); }
.pkc::after { content: ""; position: absolute; inset: .54em; border-radius: 50%; border: .07em solid rgba(255, 255, 255, .55); }
.pkc.c1 { --c: #e9e4d6; --r: #b3a78e; }
.pkc.c5 { --c: #dc2f3a; } .pkc.c25 { --c: #26995a; } .pkc.c100 { --c: #26262e; } .pkc.c500 { --c: #7a3fd0; } .pkc.c1k { --c: #eeb02a; } .pkc.c5k { --c: #ff7a1a; }
.coin { display: inline-block; width: .9em; height: .9em; border-radius: 50%; background: radial-gradient(circle, #ffd75e 42%, #b9780a 44% 58%, #ffd75e 60%); box-shadow: 0 .06em 0 rgba(0, 0, 0, .4); flex: none; }

/* seats */
.pk-seat { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); translate: -50% -50%; width: 9.4em; z-index: 5; display: flex; flex-direction: column; align-items: center; }
.pk-cards { position: absolute; top: -1.85em; left: 50%; translate: -50% 0; display: flex; z-index: 0; }
.pk-cards .pc { margin: 0 -.12em; rotate: -6deg; }
.pk-cards .pc:nth-child(2), .pk-cards .pk-rv:nth-child(2) .pc { rotate: 6deg; }
.pk-cards .pc.rev { margin: 0 .05em; }
.pk-rv { position: relative; display: inline-block; }
.pk-rv .pc.flip { position: absolute; inset: 0; }
.pk-pl { position: relative; z-index: 1; display: flex; align-items: center; gap: .5em; width: 100%; padding: .32em .75em .32em .32em; background: linear-gradient(#2c2352, #1b1340); color: #fff; border: .16em solid rgba(255, 255, 255, .38); border-radius: 999px; box-shadow: 0 .2em 0 rgba(0, 0, 0, .4); }
.pk-pl .av { width: 2.7em; height: 2.7em; font-size: 1.05em; border-width: .14em; border-color: rgba(255, 255, 255, .6); }
.pk-nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; flex: 1; }
.pk-nm b { font-family: var(--display); font-weight: 600; font-size: .98em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pk-style { font-size: .85em; }
.pk-st { display: flex; align-items: center; gap: .3em; font-size: .92em; font-weight: 700; color: #ffd75e; font-variant-numeric: tabular-nums; }
.pk-st .num { position: relative; display: inline-block; }
.pk-new { position: absolute; left: 0; opacity: 0; animation: pkshow .3s var(--wd) forwards; }
.pk-old { animation: pkhide .01s var(--wd) forwards; }
.pk-seat.me .pk-pl { border-color: #ffd75e; }
.pk-seat.folded .pk-pl, .pk-seat.out .pk-pl, .pk-seat.gone .pk-pl { opacity: .5; filter: grayscale(.6); }
.pk-seat.turn .pk-pl { border-color: #ffd75e; animation: pkpulse 1.3s ease-in-out infinite; }
.pk-seat.win .pk-pl { animation: pkwin 1.8s ease-in-out var(--wd) both; }
.pk-seat.allin .pk-pl { border-color: #ff5a5f; }
.pk-clock { position: absolute; left: 1.2em; right: 1.2em; bottom: -.05em; height: .24em; border-radius: 999px; background: #ffd75e; transform-origin: left; animation: pkclock var(--tot) linear calc(var(--el) * -1) forwards; }
.pk-tag { position: absolute; bottom: -.85em; left: 50%; translate: -50% 0; z-index: 2; white-space: nowrap; font-size: .78em; font-weight: 800; line-height: 1.2; padding: .12em .75em; border-radius: 999px; background: #fff; color: #1b1340; border: .14em solid #1b1340; }
.pk-tag.dim { background: #6b6780; color: #fff; border-color: #2b2740; }
.pk-tag.bet, .pk-tag.raise { background: #ffc93c; } .pk-tag.call, .pk-tag.check { background: #7ef0c6; }
.pk-tag.allin { background: #ff5a5f; animation: pkflame .7s ease-in-out infinite alternate; }
.pk-tag.think { background: #ffd75e; letter-spacing: .15em; }
.pk-d, .pk-bl { position: absolute; z-index: 3; display: grid; place-items: center; border-radius: 50%; font-style: normal; font-weight: 800; border: .13em solid #1b1340; box-shadow: 0 .12em 0 rgba(0, 0, 0, .4); }
.pk-d { left: -.55em; top: -.45em; width: 1.9em; height: 1.9em; font-size: .9em; background: #fff; color: #1b1340; }
.pk-d.move { animation: pkpuck .8s cubic-bezier(.3, .7, .3, 1) both; }
.pk-bl { right: -.4em; top: -.45em; width: 2em; height: 2em; font-size: .62em; background: #ffd75e; color: #1b1340; }
.pk-bl.BB { background: #7ef0c6; }
.pk-plus { position: absolute; top: -2.7em; left: 50%; translate: -50% 0; z-index: 9; font-family: var(--display); font-size: 1.35em; font-weight: 700; color: #ffd75e; text-shadow: 0 .08em .25em rgba(0, 0, 0, .8); animation: pkrise 1.6s ease-out var(--wd) both; white-space: nowrap; }

/* bets, pot, winners */
.pk-bet, .pk-pot, .pk-ghost { position: absolute; left: calc(var(--x) * 1%); top: calc(var(--y) * 1%); translate: -50% -50%; display: flex; flex-direction: column; align-items: center; pointer-events: none; }
.pk-bet { z-index: 4; } .pk-ghost { z-index: 6; } .pk-pot { --x: 50; --y: 63; z-index: 3; }
.pk-bet b, .pk-pot b { margin-top: .25em; font-size: .85em; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .42); padding: 0 .6em; border-radius: 999px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pk-bet.in { animation: pkbetin .55s cubic-bezier(.2, .8, .3, 1) both; }
.pk-pot.bump { animation: pkbump .5s ease-out .6s both; }
.pk-pot.paid { animation: pkpaid .3s ease-in var(--wd) forwards; }
.pk-ghost.sweep { animation: pkflow .55s ease-in .45s forwards; }
.pk-ghost.sweep.late { animation: pklate .4s ease-out both, pkflow .55s ease-in .45s forwards; }
.pk-ghost.award { opacity: 0; animation: pkaward 1.1s ease-in-out var(--wd) both; }
.pk-banner { position: absolute; left: 50%; top: 27%; translate: -50% -50%; z-index: 8; text-align: center; background: rgba(15, 10, 40, .9); color: #fff; border: .16em solid #ffd75e; border-radius: 1em; padding: .45em 1.2em; max-width: 90%; box-shadow: 0 .3em 0 rgba(0, 0, 0, .35); animation: pkpop .55s cubic-bezier(.2, 1.4, .4, 1) var(--wd) both; }
.pk-banner .ln b { display: block; font-family: var(--display); font-size: 1.25em; color: #ffd75e; }
.pk-banner .ln small { display: block; color: #fff; font-size: .95em; }
.pk-banner.mine { background: #14532d; }

/* card animations */
.pc.deal { animation: pkdeal .5s cubic-bezier(.2, .8, .3, 1) var(--bd) both; }
.pc.lit { animation: pklit .7s ease-out var(--wd) both; }
.pc.dim { animation: pkdim .5s ease-out var(--wd) both; }
.pc.deal.lit { animation: pkdeal .5s cubic-bezier(.2, .8, .3, 1) var(--bd) both, pklit .7s ease-out var(--wd) both; }
.pc.deal.dim { animation: pkdeal .5s cubic-bezier(.2, .8, .3, 1) var(--bd) both, pkdim .5s ease-out var(--wd) both; }
.pc.dealfly { animation: pkfly .45s cubic-bezier(.2, .8, .3, 1) var(--dd) both; }
.pc.flip { animation: pkflip .6s ease-out var(--rd) both; }
.pc.unflip { animation: pkhide .01s var(--rd) forwards; }
.pc.myflip { animation: pkmy .6s cubic-bezier(.2, .8, .3, 1) var(--dd) both; }
.pk-toss { position: absolute; top: -1.85em; left: 50%; translate: -50% 0; display: flex; z-index: 0; pointer-events: none; }
.pk-toss .pc { animation: pktoss .55s ease-in both; }

@keyframes pkpulse { 50% { box-shadow: 0 0 0 .3em rgba(255, 215, 94, .5), 0 .2em 0 rgba(0, 0, 0, .4); } }
@keyframes pkwin { 0% { border-color: rgba(255, 255, 255, .38); } 25% { border-color: #ffd75e; box-shadow: 0 0 0 .5em rgba(255, 215, 94, .55), 0 0 2em #ffd75e; } 60% { box-shadow: 0 0 0 .2em rgba(255, 215, 94, .4), 0 .2em 0 rgba(0, 0, 0, .4); } 100% { border-color: #ffd75e; box-shadow: 0 0 0 .22em rgba(255, 215, 94, .45), 0 .2em 0 rgba(0, 0, 0, .4); } }
@keyframes pkclock { from { transform: scaleX(1); } to { transform: scaleX(0); background: #ff5a5f; } }
@keyframes pkflame { to { box-shadow: 0 0 .9em #ff5a5f; } }
@keyframes pkpuck { from { translate: calc(var(--dx) * 1cqw) calc(var(--dy) * 1cqh); rotate: -300deg; } }
@keyframes pkshow { to { opacity: 1; } }
@keyframes pkhide { to { opacity: 0; } }
@keyframes pkrise { 0% { opacity: 0; translate: -50% 1em; } 20% { opacity: 1; } 100% { opacity: 1; translate: -50% 0; } }
@keyframes pkbetin { from { translate: calc(-50% + var(--dx) * 1cqw) calc(-50% + var(--dy) * 1cqh); opacity: 0; } 50% { opacity: 1; } }
@keyframes pklate { from { translate: calc(-50% + var(--fx) * 1cqw) calc(-50% + var(--fy) * 1cqh); opacity: 0; } 50% { opacity: 1; } }
@keyframes pkflow { 70% { opacity: 1; } to { translate: calc(-50% + var(--dx) * 1cqw) calc(-50% + var(--dy) * 1cqh); opacity: 0; } }
@keyframes pkbump { 40% { scale: 1.18; } }
@keyframes pkpaid { to { opacity: 0; } }
@keyframes pkaward { from { translate: calc(-50% + var(--dx) * 1cqw) calc(-50% + var(--dy) * 1cqh); opacity: 0; scale: 1.2; } 15% { opacity: 1; } 85% { opacity: 1; } to { opacity: 0; } }
@keyframes pkpop { from { scale: .3; opacity: 0; } }
@keyframes pkdeal { from { translate: calc((2 - var(--i)) * 3.75em) -9em; rotate: 120deg; opacity: 0; scale: .6; } 40% { opacity: 1; } }
@keyframes pklit { 45% { translate: 0 -.6em; } to { box-shadow: 0 0 0 .2em #ffd75e, 0 0 1.2em #ffd75e, 0 .1em 0 rgba(0, 0, 0, .3); } }
@keyframes pkdim { to { opacity: .42; filter: grayscale(.5); } }
@keyframes pkfly { from { translate: calc(var(--dx) * 1cqw) calc(var(--dy) * 1cqh); rotate: 200deg; opacity: 0; scale: .7; } 30% { opacity: 1; } }
@keyframes pkflip { from { rotate: y 90deg; opacity: 0; } 30% { opacity: 1; } }
@keyframes pkmy { from { translate: 0 -26vh; rotate: -25deg; opacity: 0; scale: .6; } 30% { opacity: 1; } }
@keyframes pktoss { to { translate: calc(var(--dx) * 1cqw) calc(var(--dy) * 1cqh); rotate: 300deg; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pk-table *, .pk-hole * { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; } }

/* your cards, the action bar and the info panels */
.pk-me { display: flex; align-items: center; gap: 14px; padding: 10px 14px; background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius); }
.pk-hole { display: flex; gap: .5rem; font-size: 1.3rem; flex: none; }
.pk-hole.folded { opacity: .45; filter: grayscale(.7); }
.pk-mi { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-hn { font-family: var(--display); font-size: 1.2rem; line-height: 1.15; }
.pk-mi span { color: var(--muted); font-size: .9rem; }
.pk-mi span b { color: var(--text); }
.pk-dock .pk-btns { display: grid; grid-template-columns: 1fr 1.5fr 1fr; gap: 8px; }
.pk-dock .btn { width: 100%; padding-inline: 6px; font-size: 1.05rem; }
.pk-dock .stack-row { display: flex; gap: 8px; } .pk-dock .stack-row .btn { width: auto; } .pk-dock .stack-row .grow { flex: 1; }
.pk-wait { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 600; min-height: 2rem; }
.pk-wait.mine { font-family: var(--display); font-size: 1.15rem; color: var(--accent); }
.pk-wait .timer { font-size: 1.05rem; padding: 0 10px; line-height: 1.5; }
.pk-raise { display: flex; flex-direction: column; gap: 8px; }
.pk-presets { display: flex; gap: 6px; } .pk-presets .seg { flex: 1; padding-inline: 4px; }
.pk-step { display: grid; grid-template-columns: 54px 1fr 54px; gap: 8px; align-items: center; }
.pk-step .btn { font-size: 1.5rem; }
.pk-to { display: flex; align-items: center; justify-content: center; gap: .6rem; font-family: var(--display); font-size: 1.7rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pk-to .stk { font-size: .55rem; }
.pk-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.pk-rank li { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: .95rem; }
.pk-rank li.out { opacity: .5; }
.pk-rank .who { display: flex; align-items: center; gap: 8px; min-width: 0; } .pk-rank .who span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pk-rank .pk-bar { height: .6rem; border-radius: 999px; background: var(--card-2); overflow: hidden; } .pk-rank .pk-bar i { display: block; height: 100%; background: #2fb36d; border-radius: 999px; }
.pk-rank b { font-variant-numeric: tabular-nums; }
.pk-rank.final li { grid-template-columns: 1fr auto; font-size: 1.1rem; padding: 4px 0; } .pk-rank .md { width: 1.8em; text-align: center; font-size: 1.3em; }
.pk-log ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; font-size: .88rem; max-height: 30dvh; overflow-y: auto; }
.pk-log li.hd, .pk-log li.st { font-family: var(--display); font-weight: 600; color: var(--muted); }
.pk-log li.hot { color: var(--accent); font-weight: 700; } .pk-log li.win { color: var(--good); font-weight: 700; }
.pk-stand, .pk-log { display: none; }
@media (min-width: 700px) {
  .pk-table { aspect-ratio: 4 / 3; }
  .pk-stand, .pk-log { display: flex; }
  .pk-hole { font-size: 1.5rem; }
}
@media (min-width: 1000px) {
  body:has(.pkgrid) #app { max-width: 1500px; }
  .pkgrid { display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 20px; align-items: start; }
  .pk-wrap { width: min(100%, calc((100dvh - 200px) * 1.5)); margin: 0 auto; }
  .pk-table { aspect-ratio: 3 / 2; }
  .pkside { position: sticky; top: 8px; max-height: calc(100dvh - 120px); overflow-y: auto; padding: 2px 4px 6px 2px; }
  .pk-dock.dock { position: static; margin: 0; padding: 12px; background: var(--card); border: 2px solid var(--edge); border-radius: var(--radius); }
  .pk-hole { font-size: 1.25rem; }
  .pk-log ul { max-height: 22dvh; }
}


/* ---- Card games: Liar's Deck (public/games/liarsdeck.js). The card faces (.pc) are defined in the Poker block above. ---- */
.ld { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.ld .gamehead { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ld-table { position: relative; border: 2.5px solid var(--edge); border-radius: 22px; padding: 12px 10px 14px; color: #fff; box-shadow: 5px 5px 0 var(--pop);
  background: radial-gradient(120% 100% at 50% 40%, #7a2442 0%, #4a1230 62%, #2e0b20 100%); }
.ld-players { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.ld-p { display: flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; border-radius: 999px; background: rgba(0, 0, 0, .38); border: 2px solid transparent; font-weight: 700; min-width: 0; }
.ld-p .nm { max-width: 7.5em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); }
.ld-p .cnt { display: inline-flex; align-items: center; gap: 4px; color: #ffd75e; font-variant-numeric: tabular-nums; }
.ld-p .mini { width: .8em; height: 1.15em; border-radius: .16em; background: repeating-linear-gradient(45deg, #b3202c 0 3px, #8c1520 3px 6px); box-shadow: inset 0 0 0 2px #fff; }
.ld-p.turn { border-color: #ffd75e; animation: ldpulse 1.3s ease-in-out infinite; }
.ld-p.claimer .nm::after { content: " 🗣"; }
.ld-p.empty { opacity: .65; }
@keyframes ldpulse { 50% { box-shadow: 0 0 0 5px rgba(255, 215, 94, .3); } }
.ld-mid { display: flex; align-items: center; justify-content: center; gap: 18px; padding: 16px 4px 2px; flex-wrap: wrap; min-height: 7.6em; }
.ld-pile { position: relative; width: 4.8em; height: 6em; flex: none; }
.ld-pile .pc { position: absolute; left: 50%; top: 50%; translate: -50% -50%; rotate: calc((var(--i) - 2) * 6deg); margin-left: calc(var(--i) * .16em); margin-top: calc(var(--i) * -.1em); }
.ld-pile.empty::before { content: ""; position: absolute; inset: .3em .7em; border: .16em dashed rgba(255, 255, 255, .45); border-radius: .5em; }
.ld-n { position: absolute; right: -.5em; bottom: -.3em; z-index: 3; min-width: 1.9em; text-align: center; background: #ffd75e; color: #1b1340; border: .14em solid #1b1340; border-radius: 999px; padding: 0 .4em; font-family: var(--display); font-weight: 700; }
.ld-claim { max-width: 15em; font-size: 1.05em; line-height: 1.35; text-align: left; }
.ld-claim.muted { color: rgba(255, 255, 255, .75); }
.say::before { content: "“"; } .say::after { content: "”"; }
.ld-claim .say { color: #ffd75e; font-family: var(--display); font-size: 1.1em; }
.ld-reveal .say { color: #ffd75e; }
.ld-log em { font-style: normal; font-weight: 700; color: var(--text); }
.ld-pc.drop { animation: lddrop .5s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes lddrop { from { translate: -50% 170%; opacity: 0; } 50% { opacity: 1; } }
.ld-reveal { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 100%; padding: 10px 12px; border: 2.5px solid var(--edge); border-radius: 18px; box-shadow: 4px 4px 0 var(--pop); color: #fff; background: #2e0b20; }
.ld-reveal.stale { padding: 6px 10px; gap: 4px; opacity: .92; }
.ld-reveal.stale .cards { font-size: .62em; }
.ld-reveal .lbl { font-size: .75em; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); font-weight: 700; }
.ld-reveal.stale .verdict b { font-size: 1.1em; display: inline; margin-right: .4em; }
.ld-reveal.stale .verdict div { display: inline; margin-right: .4em; }
.ld-reveal .cards { display: flex; gap: .35em; flex-wrap: wrap; justify-content: center; }
.ld-reveal .pc.ok { box-shadow: 0 0 0 .2em #7ef0c6, 0 .1em 0 rgba(0, 0, 0, .3); }
.ld-reveal .pc.bad { box-shadow: 0 0 0 .2em #ff5a5f, 0 .1em 0 rgba(0, 0, 0, .3); }
.ld-reveal .verdict { text-align: center; line-height: 1.35; font-size: 1em; }
.ld-reveal .verdict b { display: block; font-family: var(--display); font-size: 1.45em; }
.ld-reveal.honest .verdict b { color: #7ef0c6; }
.ld-reveal.liar .verdict b { color: #ff8a8a; }
.ld-flip { animation: ldflip .55s ease-out calc(var(--i) * .14s) both; }
@keyframes ldflip { from { scale: 0 1; } 60% { scale: 1.15 1; } }
.ld-me { display: flex; flex-direction: column; gap: 10px; padding: 12px 10px; }
.ld-me.myturn { box-shadow: 0 0 0 4px #ffd75e, 5px 5px 0 var(--pop); }
.ld-turn { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; line-height: 1.3; }
.ld-hand { display: flex; flex-wrap: wrap; justify-content: center; gap: .35em; padding-top: .7em; }
.ld-hand.lg { font-size: 15px; } .ld-hand.md { font-size: 13px; } .ld-hand.sm { font-size: 11px; } .ld-hand.xs { font-size: 9.5px; }
.ld-c { background: none; border: 0; padding: 0; margin: 0; cursor: pointer; border-radius: .4em; font: inherit; transition: translate .15s; -webkit-tap-highlight-color: transparent; }
.ld-c.sel { translate: 0 -.7em; }
.ld-c.sel .pc { box-shadow: 0 0 0 .2em #ffd75e, 0 .35em .5em rgba(0, 0, 0, .4); }
.ld-ranks { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.ld-ranks .rk { min-width: 2.4em; height: 2.4em; padding: 0 .4em; border-radius: 10px; border: 2px solid var(--edge); background: var(--card); color: var(--text); font: inherit; font-family: var(--display); font-weight: 700; cursor: pointer; }
.ld-ranks .rk.on { background: #ffd75e; color: #1b1340; }
.ld-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ld-btns .btn { flex: 1 1 10em; }
.ld-btns .btn.small { flex: 0 0 auto; }
.ld-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: .92em; color: var(--muted); }
.ld-log li:first-child { color: var(--text); }
.ld-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ld-rank li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px; border-bottom: 2px dashed color-mix(in srgb, var(--edge) 30%, transparent); }
.ld-rank .who { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.ld-rank .md { width: 1.6em; text-align: center; }
@media (min-width: 700px) {
  .ld { font-size: 15px; }
  .ld-mid { min-height: 8.4em; }
}
@media (min-width: 1000px) {
  body:has(.ld) #app { max-width: 1180px; }
  .ld { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 12px 20px; align-items: start; }
  .ld > .gamehead { grid-column: 1 / -1; }
  .ld > .ld-table { grid-column: 1; grid-row: 2 / span 2; }
  .ld > .card, .ld > .result-banner, .ld > .ld-reveal, .ld > .stack, .ld > .hint { grid-column: 2; }
  .ld > .ld-log { grid-column: 2; }
  .ld.ld-over > .ld-table { grid-row: 2 / span 3; }
  .ld-hand.lg { font-size: 16px; }
}

/* ---- Card games: Spy Cards (public/games/spycards.js) ---- */
.sc { display: flex; flex-direction: column; gap: 12px; }
.sc .gamehead { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.sc-card { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .2em; width: 8.5em; aspect-ratio: 5 / 7; border: .18em solid #1b1340; border-radius: .7em; background: #fff; color: #1b1340; box-shadow: .25em .25em 0 rgba(27, 19, 64, .9); font-family: var(--display); }
.sc-card .em { font-size: 3.6em; line-height: 1; }
.sc-card b { font-size: 1.2em; text-align: center; padding: 0 .3em; line-height: 1.1; }
.sc-card.big { font-size: 1.6rem; margin: 6px auto 4px; animation: scflip .6s ease-out both; }
.sc-card.mini { font-size: .5rem; width: auto; aspect-ratio: auto; flex-direction: row; gap: .5em; padding: .35em .8em; border-radius: 999px; box-shadow: none; }
.sc-card.mini .em { font-size: 2.2em; }
.sc-card.mini b { font-size: 1.9em; padding: 0; }
@keyframes scflip { from { scale: 0 1; } 60% { scale: 1.08 1; } }
.sc-me { display: flex; flex-direction: column; gap: 10px; }
.sc-mine { display: flex; align-items: center; gap: 10px; }
.sc-mine .lbl { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.sc-turn { font-weight: 700; line-height: 1.3; }
.sc-hand { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.sc-h { background: none; border: 0; padding: 0; cursor: pointer; font: inherit; -webkit-tap-highlight-color: transparent; }
.sc-h:disabled { cursor: default; opacity: .75; }
.sc-clue { display: inline-flex; align-items: center; justify-content: center; min-width: 4.2em; padding: .5em .6em; border: 2.5px solid var(--edge); border-radius: 12px; background: var(--card-2); color: var(--text); font-family: var(--display); font-weight: 700; font-size: .95rem; box-shadow: 2px 2px 0 var(--pop); }
.sc-h .sc-clue { display: flex; width: 100%; min-height: 3.3em; background: #fff; color: #1b1340; border-color: #1b1340; font-size: 1.05rem; }
.sc-h:not(:disabled):active .sc-clue { transform: translate(2px, 2px); box-shadow: none; }
.sc-h:not(:disabled) .sc-clue { background: #fff6c9; }
.sc-clue.on { background: #fff; color: #1b1340; border-color: #1b1340; font-size: .85rem; padding: .35em .5em; min-width: 0; }
.sc-clue.slot { min-width: 3em; min-height: 1.9em; background: transparent; border-style: dashed; box-shadow: none; opacity: .45; }
.sc-clue.drop { animation: scdrop .45s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes scdrop { from { translate: 0 -1.6em; opacity: 0; rotate: -8deg; } }
.sc-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who act" "plays act"; align-items: center; gap: 6px 10px; padding: 6px 8px; border: 2.5px solid transparent; border-radius: 14px; }
.sc-row .who { grid-area: who; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.sc-row .plays { grid-area: plays; display: inline-flex; gap: 6px; flex-wrap: wrap; }
.sc-row .btn.small, .sc-row .votes { grid-area: act; margin: 0; }
.sc-rows.result .sc-row { grid-template-areas: "who act" "pick act" "plays act"; }
.sc-pick { grid-area: pick; }
@media (min-width: 700px) {
  .sc-row { grid-template-columns: 11em minmax(0, 1fr) auto; grid-template-areas: "who plays act"; }
  .sc-rows.result .sc-row { grid-template-columns: 11em 9em minmax(0, 1fr) auto; grid-template-areas: "who pick plays act"; }
}
.sc-row.turn { border-color: var(--g, #4fb3a5); background: color-mix(in srgb, var(--g, #4fb3a5) 15%, transparent); }
.sc-row.me .who { color: var(--text); }
.sc-rows.result .sc-row { border-color: color-mix(in srgb, var(--edge) 25%, transparent); }
.sc-row.spy { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.sc-row .tag { font-style: normal; font-size: .72rem; letter-spacing: .1em; background: var(--bad); color: #fff; padding: 1px 7px; border-radius: 999px; }
.sc-pick { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.sc-pick .em { font-size: 1.5rem; }
.sc-row .votes { font-weight: 700; color: var(--muted); }
@media (min-width: 700px) {
  .sc { max-width: 760px; margin: 0 auto; width: 100%; }
}
@media (min-width: 1000px) {
  body:has(.sc) #app { max-width: 1100px; }
  .sc:has(.sc-me) { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px 20px; align-items: start; max-width: none; }
  .sc:has(.sc-me) > .gamehead { grid-column: 1 / -1; }
  .sc.res { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 12px 20px; align-items: start; max-width: none; }
  .sc.res > .gamehead, .sc.res > .result-banner { grid-column: 1 / -1; }
  .sc.res > .stack, .sc.res > .hint, .sc.res > .btn { grid-column: 2; }
}

/* ---- Card games: Blackjack (public/games/blackjack.js). Cards (.pc) and chips (.stk .pkc) come from the Poker block. ---- */
.bj { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.bj .gamehead { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.bj-table { position: relative; border: 2.5px solid var(--edge); border-radius: 24px; padding: 12px 10px 14px; color: #fff; box-shadow: 5px 5px 0 var(--pop); display: flex; flex-direction: column; gap: 14px;
  background: radial-gradient(130% 90% at 50% 25%, #35a872 0%, #1f7d52 55%, #135d3c 100%); }
.bj-mark { text-align: center; font-family: var(--display); font-weight: 700; letter-spacing: .22em; font-size: .62em; color: rgba(255, 255, 255, .4); }
.bj-dealer { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bj-dh { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; }
.bj-who { font-size: 1.1em; letter-spacing: .08em; text-transform: uppercase; }
.bj-total { min-width: 2em; text-align: center; padding: 0 .55em; border-radius: 999px; background: rgba(0, 0, 0, .4); font-weight: 800; font-variant-numeric: tabular-nums; font-size: .95em; }
.bj-total.top { background: #ffd75e; color: #1b1340; } .bj-total.bust { background: #ff5a5f; color: #1b1340; }
.bj-cards { display: flex; justify-content: center; min-height: 4.6em; font-size: .95em; padding-left: .8em; }
.bj-cards .pc { margin-left: -.8em; flex: none; }
.bj-cards.empty { opacity: 0; }
.bj-cards .pc.drop { animation: bjdrop .45s cubic-bezier(.2, .8, .3, 1) var(--d, 0s) both; }
.bj-cards .pc.flip { animation: bjflip .55s ease-out both; }
@keyframes bjdrop { from { translate: 40% -160%; rotate: 25deg; opacity: 0; } 40% { opacity: 1; } }
@keyframes bjflip { from { scale: 0 1; } 60% { scale: 1.12 1; } }
.bj-seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.bj-seats.n1 { grid-template-columns: minmax(0, 1fr); max-width: 15em; margin: 0 auto; width: 100%; }
.bj-seat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 6px 8px; border-radius: 16px; background: rgba(0, 0, 0, .22); border: 2.5px solid transparent; min-width: 0; }
.bj-seat .bj-cards { font-size: .62em; min-height: 4.6em; }
.bj-seat.big .bj-cards { font-size: .95em; }
.bj-seat.turn { border-color: #ffd75e; animation: ldpulse 1.3s ease-in-out infinite; }
.bj-seat.me { background: rgba(0, 0, 0, .3); }
.bj-seat.out { opacity: .55; }
.bj-head { display: flex; align-items: center; gap: 6px; max-width: 100%; font-weight: 700; }
.bj-head .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); min-width: 0; }
.bj-chips { color: #ffd75e; font-variant-numeric: tabular-nums; margin-left: auto; padding-left: 4px; }
.bj-foot { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; min-height: 2.2em; }
.bj-bet { display: inline-flex; align-items: flex-end; gap: 4px; font-weight: 700; font-size: .85em; }
.bj-bet .stk { font-size: .6em; }
.bj-tag { font-style: normal; font-weight: 800; font-size: .72em; letter-spacing: .06em; padding: .15em .7em; border-radius: 999px; background: #fff; color: #1b1340; border: .16em solid #1b1340; white-space: nowrap; }
.bj-tag.good { background: #7ef0c6; } .bj-tag.bad { background: #ff7a7a; } .bj-tag.gold { background: #ffd75e; animation: bjgold .8s ease-in-out infinite alternate; } .bj-tag.dim { background: #c9c5d6; }
.bj-tag.think { letter-spacing: .2em; }
@keyframes bjgold { to { box-shadow: 0 0 0 .3em rgba(255, 215, 94, .45); } }
.bj-delta { position: absolute; top: -.6em; right: .4em; font-family: var(--display); font-size: 1.15em; text-shadow: 0 .08em .25em rgba(0, 0, 0, .8); animation: bjrise 1.6s ease-out both; }
.bj-delta.up { color: #7ef0c6; } .bj-delta.down { color: #ff9a9a; }
@keyframes bjrise { from { translate: 0 .8em; opacity: 0; } 25% { opacity: 1; } }
.bj-mine { display: flex; justify-content: center; }
.bj-mine .bj-seat { width: 100%; max-width: 20em; }
.bj-dock { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.bj-dock.center { align-items: center; text-align: center; }
.bj-stage { display: flex; align-items: flex-end; justify-content: center; gap: 12px; min-height: 3.6em; }
.bj-stage .lbl { align-self: center; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.bj-stage .amt { align-self: center; font-family: var(--display); font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.bj-stage .stk.big { font-size: 1.2em; }
.bj-chbar { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.bj-ch { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 0; padding: 0; cursor: pointer; font: inherit; color: var(--text); font-weight: 700; -webkit-tap-highlight-color: transparent; }
.bj-ch .pkc { position: relative; bottom: auto; width: 3.2em; height: 3.2em; font-size: 1rem; }
.bj-ch:disabled { opacity: .35; cursor: default; }
.bj-ch:not(:disabled):active .pkc { transform: scale(.92); }
.bj-row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.bj-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bj-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bj-rank li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 4px; border-bottom: 2px dashed color-mix(in srgb, var(--edge) 30%, transparent); }
.bj-rank .who { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bj-rank .md { width: 1.6em; text-align: center; }
.bj-rank small.up { color: var(--good); } .bj-rank small.down { color: var(--bad); }
@media (min-width: 700px) {
  .bj { font-size: 15px; }
  .bj-seats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bj-seats.n1, .bj-seats.n2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 32em; margin: 0 auto; }
  .bj-seats.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  body:has(.bj) #app { max-width: 1180px; }
  .bj { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 12px 20px; align-items: start; }
  .bj > .gamehead { grid-column: 1 / -1; }
  .bj > .bj-table { grid-column: 1; grid-row: 2 / span 3; }
  .bj > .card, .bj > .result-banner, .bj > .stack, .bj > .hint { grid-column: 2; }
}


/* ---- Magnet Ring: a ring of string, magnets dropped by tapping ---- */
.mrgrid { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.mrgrid > * { min-width: 0; }
.mr-boardcard { padding: 8px; display: grid; place-items: center; }
.mr-svg { display: block; width: min(100%, 560px); aspect-ratio: 1; height: auto; margin: 0 auto; user-select: none; -webkit-user-select: none; }
.mr-svg[data-live] { touch-action: none; cursor: crosshair; }
.mr-floor { fill: color-mix(in srgb, var(--text) 5%, var(--card, transparent)); }
.mr-string { fill: none; stroke: #b98a4c; stroke-width: 2.6; stroke-linecap: round; }
.mr-map { pointer-events: none; image-rendering: auto; }
.mr-mag .n { fill: #e8453c; } .mr-mag .s { fill: #3b7dd8; }
.mr-mag .rim { fill: none; stroke: var(--pc); stroke-width: 1.7; }
.mr-mag .mid { stroke: rgba(255, 255, 255, .85); stroke-width: .9; }
.mr-mag.fresh .rim { stroke-width: 2.4; }
.mr-ghost { pointer-events: none; opacity: .9; }
.mr-ghost .halo { fill: none; stroke-width: 2.4; stroke: color-mix(in srgb, var(--text) 40%, transparent); stroke-dasharray: 3 2; }
.mr-ghost.ok .halo { stroke: #2fbf71; } .mr-ghost.warn .halo { stroke: #ffb020; } .mr-ghost.bad .halo { stroke: #e03e45; fill: rgba(224, 62, 69, .18); }
.mr-tip { text-anchor: middle; font-size: 7px; font-weight: 700; fill: color-mix(in srgb, var(--text) 55%, transparent); pointer-events: none; }
.mr-str { text-anchor: middle; font-size: 5px; font-weight: 700; fill: var(--text); paint-order: stroke; stroke: var(--card, #fff); stroke-width: 1.4px; }
.mr-burst { fill: none; stroke: #e03e45; stroke-width: 1.8; stroke-dasharray: 3 2; }
.mr-link { stroke: #e03e45; stroke-width: 1.4; stroke-dasharray: 2 2; }
.mr-gone { fill: none; stroke: color-mix(in srgb, var(--text) 45%, transparent); stroke-width: 1.2; stroke-dasharray: 2 2; }
.mr-event { margin: 6px 0 0; font-weight: 700; }
.mr-players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.mr-players li { display: flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 2px solid transparent; background: color-mix(in srgb, var(--text) 6%, transparent); }
.mr-players li.now { border-color: var(--pc); }
.mr-players li.won { background: color-mix(in srgb, #2fbf71 30%, transparent); } .mr-players li.lost { background: color-mix(in srgb, #e03e45 25%, transparent); }
.mr-players .dot { width: .9em; height: .9em; border-radius: 50%; background: var(--pc); flex: none; }
.mr-players .n { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mr-players .hand { font-family: var(--display); min-width: 1.6em; text-align: center; border-radius: 999px; background: var(--g); color: #1b1340; padding: 0 6px; }
.mr-controls { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.mr-controls.idle { align-items: center; }
.mr-meter { display: flex; align-items: center; gap: 10px; }
.mr-meter .bar { position: relative; flex: 1; height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; }
.mr-meter .fill { position: absolute; inset: 0 auto 0 0; background: #2fbf71; transition: width .08s linear; }
.mr-meter[data-state="warn"] .fill { background: #ffb020; } .mr-meter[data-state="bad"] .fill { background: #e03e45; }
.mr-meter .band { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(255, 176, 32, .55) 0 4px, rgba(255, 176, 32, .25) 4px 8px); }
.mr-meter .line { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: var(--text); }
.mr-meter .lab { min-width: 7.5ch; text-align: right; font-weight: 800; }
.mr-rot { display: flex; align-items: center; gap: 8px; justify-content: center; }
.mr-rot .mr-angle { flex: 1; min-width: 0; accent-color: var(--g); }
.mr-drop[disabled] { opacity: .45; }
@media (min-width: 700px) { .mr-svg { width: min(100%, 520px); } }
@media (min-width: 1000px) {
  body:has(.mrgrid) #app { max-width: 1100px; }
  .mrgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); grid-template-rows: auto auto 1fr; grid-template-areas: "board top" "board controls" "board players"; align-items: start; gap: 12px 18px; }
  .mr-top { grid-area: top; } .mr-board { grid-area: board; justify-self: center; width: 100%; } .mr-players-wrap { grid-area: players; } .mr-controls-wrap { grid-area: controls; }
  .mr-board .mr-svg { width: min(100%, calc(100dvh - 150px), 640px); }
  .mrgrid.over { grid-template-areas: "board top" "board players" "board controls"; }
}

/* ---- Shut the Box ---- */
.stbgrid { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.stbgrid > * { min-width: 0; }
.stb-main { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.stb-side { padding: 10px 12px; }
.stb-round { margin: 4px 0 0; opacity: .7; font-weight: 700; }
.stb-event { margin: 6px 0 0; font-weight: 700; }
.stb-dice { display: flex; align-items: center; justify-content: center; gap: 14px; min-height: 72px; }
.stb-dice.old .stb-die { opacity: .35; }
.stb-pair { display: flex; gap: 10px; }
.stb-die { width: 62px; height: 62px; overflow: visible; }
.stb-die rect { fill: #fffdf6; stroke: var(--edge, #1b1340); stroke-width: 2.4; }
.stb-die circle { fill: #1b1340; }
.stb-die .q { fill: #9a94b8; font-size: 22px; font-weight: 800; }
.stb-total { font-family: var(--display); font-size: 2.4rem; font-weight: 700; min-width: 1.6em; text-align: center; }
.stb-die.tumble { animation: stb-tumble .5s ease-out; } .stb-die.t1 { animation-delay: .06s; }
@keyframes stb-tumble { 0% { transform: translateY(-14px) rotate(-200deg); opacity: 0; } 70% { transform: translateY(2px) rotate(12deg); opacity: 1; } 100% { transform: none; } }
.stb-tiles { --cols: 9; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: 6px; }
.stb-tiles.n12 { --cols: 6; }
.stb-tile { appearance: none; font: inherit; display: grid; place-items: center; aspect-ratio: 3 / 4; padding: 0; border-radius: 8px; border: 2.5px solid #6b4423; background: linear-gradient(#e6b27a, #c78a4c); color: #3a2410; box-shadow: 0 3px 0 #6b4423; transition: transform .12s, opacity .12s; }
.stb-tile b { font-family: var(--display); font-size: clamp(1rem, 4.4vw, 1.9rem); line-height: 1; }
button.stb-tile { cursor: pointer; }
button.stb-tile:hover { transform: translateY(-2px); }
.stb-tile.sel { transform: translateY(-5px); background: linear-gradient(#ffd98a, #f0b13c); border-color: var(--text); box-shadow: 0 3px 0 var(--text); }
.stb-tile.dim { opacity: .45; }
.stb-tile.shut { background: color-mix(in srgb, var(--text) 12%, transparent); border-color: color-mix(in srgb, var(--text) 25%, transparent); box-shadow: none; color: color-mix(in srgb, var(--text) 40%, transparent); transform: translateY(5px) scaleY(.82); }
.stb-tile.shut b { text-decoration: line-through; }
.stb-tiles.fresh .stb-tile.shut { animation: stb-shut .3s ease-out; }
@keyframes stb-shut { from { transform: none; } }
.stb-controls { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.stb-hint { margin: 0; }
.stb-players { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.stb-players li { display: grid; grid-template-columns: minmax(0, 1fr) auto 3.4em; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; border: 2px solid transparent; background: color-mix(in srgb, var(--text) 6%, transparent); }
.stb-players.multi li { grid-template-columns: minmax(0, 1fr) auto 3.4em 3.4em; }
.stb-players li.head { background: none; padding-top: 0; padding-bottom: 0; font-size: .8rem; opacity: .65; font-weight: 700; }
.stb-players li.now { border-color: var(--pc); }
.stb-players .who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.stb-players .dot { width: .9em; height: .9em; border-radius: 50%; background: var(--pc); flex: none; }
.stb-players .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stb-players .c { text-align: center; } .stb-players .tot { font-family: var(--display); font-size: 1.15rem; }
.stb-mini { display: inline-flex; gap: 2px; }
.stb-mini i { width: 7px; height: 11px; border-radius: 2px; background: #c78a4c; border: 1px solid #6b4423; }
.stb-mini i.s { background: transparent; border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.stb-table { width: 100%; border-collapse: collapse; text-align: center; }
.stb-table th, .stb-table td { padding: 8px 6px; border-bottom: 1px solid color-mix(in srgb, var(--text) 15%, transparent); }
.stb-table th[scope="row"] { text-align: left; font-weight: 700; } .stb-table thead th { font-size: .85rem; opacity: .7; }
.stb-table tr.won { background: color-mix(in srgb, #2fbf71 25%, transparent); } .stb-table .tot { font-family: var(--display); font-size: 1.2rem; }
@media (min-width: 700px) {
  .stb-tiles.n12 { --cols: 12; } .stb-die { width: 74px; height: 74px; }
}
@media (min-width: 1000px) {
  body:has(.stbgrid) #app { max-width: 1100px; }
  .stbgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); grid-template-rows: auto 1fr; grid-template-areas: "main top" "main side"; align-items: start; gap: 12px 18px; }
  .stb-top { grid-area: top; } .stb-main { grid-area: main; } .stb-side { grid-area: side; }
  .stb-main { padding: 22px; gap: 22px; } .stb-tile b { font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) { .stb-die.tumble { animation: none; } }
.stb-players .you { flex: none; opacity: .7; }

/* ---- Werewolf (public/games/werewolf.js). The night panel has its own dark colours so it reads the same in every theme. ---- */
.ww { display: flex; flex-direction: column; gap: 12px; }
.ww .gamehead { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; }
.ww-role { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: .15em; padding: .5em 1.1em; border: .16em solid #1b1340; border-radius: .7em; background: #fff; color: #1b1340; box-shadow: .22em .22em 0 rgba(27, 19, 64, .9); font-family: var(--display); }
.ww-role .em { font-size: 3em; line-height: 1; }
.ww-role b { font-size: 1.15em; }
.ww-role.big { font-size: 1.5rem; margin: 6px auto 4px; animation: wwflip .6s ease-out both; }
.ww-role.mini { font-size: .5rem; flex-direction: row; gap: .5em; padding: .35em .8em; border-radius: 999px; box-shadow: none; }
.ww-role.mini .em { font-size: 2.4em; }
.ww-role.mini b { font-size: 1.9em; }
@keyframes wwflip { from { scale: 0 1; } 60% { scale: 1.08 1; } }
.ww-mates { font-weight: 700; margin: 0; }
.ww-deck { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.ww-deck .lbl, .ww-mine .lbl { font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.ww-chip { display: inline-flex; gap: .3em; padding: 2px 10px; border: 2px solid var(--edge); border-radius: 999px; background: var(--bg-2); font-weight: 700; font-size: .9rem; }
.ww-mine { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ww-out { font-weight: 700; color: var(--bad); }
.ww-say { font-weight: 700; line-height: 1.3; }
.ww-night, .ww-day { display: flex; flex-direction: column; gap: 10px; }
.ww-night { position: relative; overflow: hidden; background: linear-gradient(180deg, #1c2145, #0f1230); color: #e8ecff; border-color: #0b0d24; }
.ww-night .lbl, .ww-night .hint { color: #aab4e8; }
.ww-night .btn.ghost { color: #e8ecff; border-color: #aab4e8; }
.ww-night .moon { position: absolute; top: 12px; right: 14px; width: 38px; height: 38px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fffbe0, #f4e08a 60%, #cdb85c); box-shadow: 0 0 22px 6px rgba(255, 244, 170, .35); animation: wwglow 4s ease-in-out infinite alternate; }
@keyframes wwglow { to { box-shadow: 0 0 30px 10px rgba(255, 244, 170, .5); } }
.ww-seen { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.ww-news { padding: 9px 12px; border: 2.5px solid var(--edge); border-radius: 14px; background: var(--bg-2); font-weight: 600; line-height: 1.35; }
.ww-news.bad { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.ww-news.good { border-color: var(--good-fill); background: color-mix(in srgb, var(--good-fill) 14%, transparent); }
.ww-rows { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.ww-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who btn" "meta btn"; align-items: center; gap: 2px 10px; padding: 6px 8px; border: 2.5px solid transparent; border-radius: 14px; }
.ww-row .who { grid-area: who; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; min-width: 0; }
.ww-row .nm { overflow-wrap: anywhere; }
.ww-row .you { font-weight: 600; color: var(--muted); }
.ww-row .meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: .85rem; }
.ww-row .meta:empty { display: none; }
.ww-row .btn { grid-area: btn; margin: 0; }
.ww-row.me { border-color: color-mix(in srgb, var(--edge) 30%, transparent); }
.ww-row.mate { border-color: var(--bad); }
.ww-row.dead .who { opacity: .55; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.ww-why { color: var(--muted); }
.ww-tag { display: inline-flex; gap: .3em; align-items: center; padding: 1px 8px; border: 2px solid var(--edge); border-radius: 999px; background: var(--bg-2); font-weight: 700; font-size: .78rem; }
.ww-tag.bad { border-color: var(--bad); color: var(--bad); }
.ww-tag.good { border-color: var(--good-fill); color: var(--good); }
.ww-night .ww-tag { background: #262c5c; color: #e8ecff; border-color: #aab4e8; }
.ww-night .ww-tag.bad { border-color: #ff8d98; color: #ff8d98; }
.ww-night .ww-tag.good { border-color: #5ff0d0; color: #5ff0d0; }
.ww-log ol { margin: 8px 0 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 4px; }
@media (prefers-reduced-motion: reduce) { .ww-role.big, .ww-night .moon { animation: none; } }
@media (min-width: 700px) {
  .ww { max-width: 760px; margin: 0 auto; width: 100%; }
}
@media (min-width: 1000px) {
  body:has(.ww) #app { max-width: 1100px; }
  .ww { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px 20px; align-items: start; max-width: none; }
  .ww > .gamehead, .ww > .result-banner { grid-column: 1 / -1; }
  .ww:not(.over) > .ww-players { grid-column: 2; grid-row: 2 / span 3; }
  .ww.over > .stack, .ww.over > .hint { grid-column: 1 / -1; }
  .ww-rows { max-height: calc(100vh - 215px); overflow-y: auto; gap: 2px; }
  .ww-row { padding: 3px 8px; gap: 0 10px; }
  .ww-row .btn.small { padding-block: 4px; }
  .ww.fresh .ww-rows { scrollbar-width: thin; }
}
@media (min-width: 1000px) and (max-height: 760px) {
  .gcard-blurb { margin: 6px 0 8px; }
  .gcard-tags { display: none; }
  .gcard { position: relative; }
  .gcard-actions { position: absolute; top: 14px; right: 62px; }
  .gcard-actions .btn.small { min-height: 34px; padding: 3px 12px; }
  .gcard-start { min-height: 46px; margin-top: 8px; font-size: 1.1rem; }
  .lactions .gcard-browse { min-height: 46px; }
}
/* Lobby: favourites card above the selected-game card */
.favcard { padding-top: 8px; padding-bottom: 8px; }
.favlabel { flex: none; align-self: center; font-size: 1.2rem; color: var(--text); }
.favrow { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.favchip { flex: none; display: flex; align-items: center; gap: 6px; min-height: 40px; padding: 4px 12px 4px 8px; border: 2px solid var(--edge); border-radius: 12px; background: color-mix(in srgb, var(--g, var(--accent)) 30%, var(--card)); color: var(--text); font-family: var(--display); font-weight: 700; font-size: 0.9rem; cursor: pointer; white-space: nowrap; }
.favchip .ico { width: 20px; height: 20px; stroke: var(--edge); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.favchip.selected { background: var(--g, var(--accent)); color: #1b1340; box-shadow: 3px 3px 0 var(--pop); }
.favchip:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* Settings cog popover (language, theme, streamer mode) and the tappable room code (2026-11-15) */
.setpanel { width: min(300px, calc(100vw - 24px)); padding: 12px; gap: 12px; }
.setsec { display: flex; flex-direction: column; gap: 6px; }
.setlabel { font-family: var(--display); font-weight: 700; font-size: 0.9rem; }
.setrow { display: flex; gap: 6px; }
.setrow .seg { flex: 1; }
.themegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.themegrid .themeopt { min-height: 40px; padding: 6px 8px; font-size: 0.88rem; }
.setstream { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; }
.setstream small { display: block; font-size: 0.72rem; line-height: 1.3; }
.codebtn { background: none; border: 0; padding: 2px 4px; margin: -2px -4px; color: inherit; font: inherit; text-align: left; cursor: pointer; border-radius: 12px; display: block; }
.codebtn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.codebtn:active { transform: translate(1px, 1px); }
.codehead .codebtn .eyebrow { display: block; }
/* On a phone the cog is not at the right edge, so the panel spans the top bar instead of hanging off the button */
@media (max-width: 699px) {
  .topbar { position: relative; }
  .topbar .themewrap, .homebar .themewrap { position: static; }
  .homebar { position: relative; }
  .setpanel { left: 0; right: 0; width: auto; }
}
