:root {
  --bg: #f2f6fc; --surface: #ffffff; --text: #0b1a33; --muted: #5a6b86; --line: #d9e3f2;
  --gold: #e8b931; --gold-dark: #b8861b; --gold-ink: #4a3200; --coin-bg: #000814; /* edge colour of icons/icon.svg */
  --logo: url(icons/icon.svg); --glow: 61 155 255; --cap: #1a2e50; /* brand art; beedoo overrides below */
  --accent: #1462d6; --pos: #13824a; --neg: #b3261e; --warn: #c77700; --warn-bg: #fff4d6;
  --radius: 16px; --shadow: 0 2px 10px rgba(11, 26, 51, .08);
  /* Buttons: one blue family. Primary = solid blue with white text; secondary = a light tint of the same blue. */
  --btn: #1462d6; --btn-ink: #ffffff;
  --btn2-bg: color-mix(in srgb, var(--accent) 8%, var(--surface)); --btn2-ink: var(--accent);
  --btn2-line: color-mix(in srgb, var(--accent) 25%, transparent); --btn2-sub: var(--muted); /* small text: 4.8:1 */
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--coin-bg); --surface: #0b1a33; --text: #eaf2ff; --muted: #8fa3c4; --line: #1a2e50;
    --accent: #3d9bff; --pos: #4cd28b; --neg: #ff8a80; --warn: #ffb74d; --warn-bg: #3a2f12;
    --shadow: none;
    /* white on #1a6be0 = 5:1; the lighter link blue (#3d9bff) would need dark text, which read as muddy */
    --btn: #1a6be0; --btn-ink: #ffffff;
    --btn2-bg: color-mix(in srgb, var(--accent) 14%, var(--surface)); --btn2-ink: #cfe4ff;
    --btn2-line: color-mix(in srgb, var(--accent) 35%, transparent);
    --btn2-sub: color-mix(in srgb, var(--btn2-ink) 72%, var(--btn2-bg)); /* small text: 6.3:1 */
  }
}
/* ---- Beedoo brand (beedoo.vteam.com; brand.js sets data-brand). Honey on charcoal. Same variables, other values. */
:root[data-brand="beedoo"] {
  --bg: #fffaf0; --surface: #ffffff; --text: #2a1f0a; --muted: #75643f; --line: #efe3c8;
  --coin-bg: #17120a; --logo: url(icons/beedoo/icon.svg); --glow: 255 179 0; --cap: #3a2e1a;
  --accent: #a34a00; --btn: #a34a00; --btn-ink: #ffffff; /* white on #a34a00 = 6.4:1 */
  --warn-bg: #fff0c2; --shadow: 0 2px 10px rgba(42, 31, 10, .08);
}
@media (prefers-color-scheme: dark) {
  :root[data-brand="beedoo"] {
    --bg: var(--coin-bg); --surface: #241c10; --text: #fff6e5; --muted: #c2b08a; --line: #3a2e1a;
    --accent: #f5b301; --btn: #f5b301; --btn-ink: #1a1200; /* dark ink on honey = 10:1 */
    --btn2-ink: #ffe2a3; --warn-bg: #3a2f12; --shadow: none;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* .btn etc. set display, which would otherwise beat the hidden attribute */
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { min-height: 100dvh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
main { max-width: 560px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.6rem; margin: .4em 0 .5em; }
h2 { font-size: 1.1rem; margin: 1.4em 0 .5em; }
a { color: var(--accent); }
/* Keyboard focus is always visible (mouse and touch don't show it). */
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.modal:focus { outline: none; }
.muted { color: var(--muted); } .small { font-size: .85rem; } .center { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; }
.err { color: var(--neg); min-height: 1.2em; margin: 0; }
.back { display: inline-block; margin-bottom: 4px; text-decoration: none; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(8px); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; color: var(--text); text-decoration: none; }
/* On wide screens the header lines up with the centred content column (main: 560px wide with 16px padding). */
.top > .brand { width: 100%; max-width: 528px; margin: 0 auto; }
.brand .coin.sm { font-size: 2.2rem; flex: none; box-shadow: 0 2px 8px rgba(232, 185, 49, .3); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.brand-text b { font-weight: 800; font-size: 1.1rem; }
.brand-text small { font-size: .75rem; color: var(--muted); text-wrap: balance; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px; font-size: .75rem; color: var(--muted); text-decoration: none; }
.tabs a.active { color: var(--accent); font-weight: 700; }
/* Icons (js/icons.js): line art in currentColor; the active tab gets a tinted pill and its coin turns gold. */
.tabs a span { display: grid; place-items: center; width: 56px; height: 30px; border-radius: 99px; transition: background-color .2s; }
.tabs a.active span { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.tabs .ic { display: block; transition: transform .2s; }
.tabs .ic-gold { transition: fill .2s, stroke .2s; }
.tabs a.active .ic-gold { fill: var(--gold); stroke: var(--gold-dark); }
.tabs a:active .ic { transform: scale(.9); }
@media (prefers-color-scheme: dark) { .tabs a.active .ic-gold { stroke: var(--gold); } }
/* Connection badge on the Settings gear: green = online, red with a ring = offline, a ripple when it reconnects. */
.tabs a span { position: relative; }
.net-dot { position: absolute; top: 1px; right: 12px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--pos); box-shadow: 0 0 0 2px var(--surface); transition: background-color .3s; }
.net-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--pos); opacity: 0; }
.tabs[data-net="off"] .net-dot { background: var(--neg); }
.tabs[data-net="off"] .net-dot::after { border-color: var(--neg); opacity: .5; inset: -4px; }
.tabs[data-net="down"] .net-dot { background: var(--warn); }
.tabs[data-net="down"] .net-dot::after { border-color: var(--warn); opacity: .5; inset: -4px; }
.tabs.ping .net-dot::after { animation: net-ping 1.2s ease-out 2; }
@keyframes net-ping { from { inset: 0; opacity: .9; } to { inset: -9px; opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tabs a span, .tabs .ic, .tabs .ic-gold { transition: none; } .tabs.ping .net-dot::after { animation: none; } }

.btn { appearance: none; border: 1px solid var(--btn2-line); background: var(--btn2-bg); color: var(--btn2-ink); border-radius: 12px;
  padding: 11px 16px; font: inherit; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer; display: inline-block; }
.btn:disabled { opacity: .5; cursor: default; }
.btn { transition: filter .15s, transform .1s; }
.btn:not(:disabled):hover { filter: brightness(1.08); }
.btn:not(:disabled):active { transform: scale(.98); }
.btn.primary { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--accent); }
.btn.danger { background: var(--surface); color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, transparent); }
.btn.big { padding: 15px 18px; font-size: 1.05rem; }
.btn.small { padding: 5px 10px; font-size: .85rem; border-radius: 8px; }
input, select, textarea { width: 100%; font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); margin-top: 4px; }
input.pin { font-size: 1.4rem; letter-spacing: .3em; text-align: center; }
label { font-weight: 600; font-size: .95rem; }
label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; margin: 14px 0; }
label.check input { width: 22px; height: 22px; margin: 0; flex: none; }

/* The coin artwork (icons/icon.svg); the "J" inside each .coin is just a text fallback, hidden. */
.coin { display: inline-block; vertical-align: middle; width: 1.1em; height: 1.1em; border-radius: 50%;
  background: var(--gold) var(--logo) center / cover no-repeat; color: transparent; overflow: hidden; font-size: .8em; }
.coin.sm { font-size: 1.4rem; } .coin.xl { width: 120px; height: 120px; box-shadow: 0 8px 30px rgba(232, 185, 49, .35); }
.hero { text-align: center; padding-top: 24px; }
/* Welcome choices: one main path, invite as the second, restore as a quiet link for returning people. */
.hero .lead { margin: 22px auto 0; max-width: 30ch; color: var(--muted); text-wrap: balance; }
.hero .stack { margin-top: 20px; }
/* A button with a short explanation under its label. */
.btn.two-line { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.btn.two-line small { font-size: .8rem; font-weight: 400; color: var(--btn2-sub); text-wrap: balance; }
.alt { margin: 28px 0 0; text-align: center; color: var(--muted); }
.alt a { font-weight: 600; text-decoration: none; }

/* Welcome screen: the coin is the glass of a light bulb; "JPCoin" is engraved on its gold screw base.
   Geometry comes from icons/icon.svg: the coin is 80% of the artwork wide, centred at 47.6% height, bottom at 86.3%.
   In the 260px artwork the coin's bottom edge is at y = 224px; the collar starts 10px below it (margin-top -26px),
   leaving a small glowing gap between glass and socket. */
.bulb { --metal: linear-gradient(90deg, #6b4708, #c9951f 14%, #f7d257 32%, #fff4c4 44%, #f2c443 58%, #b8861b 80%, #5c3d08);
  position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center;
  background: var(--coin-bg); border-radius: var(--radius); padding-bottom: 26px; overflow: hidden; }
/* The bulb is "lit": a warm halo behind the coin, softly breathing. */
.bulb::before { content: ''; position: absolute; z-index: -1; top: 4px; left: 50%; width: 300px; height: 260px; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 214, 102, .28), rgb(var(--glow) / .12) 60%, transparent);
  animation: bulb-glow 3.2s ease-in-out infinite alternate; }
@keyframes bulb-glow { from { opacity: .55; } to { opacity: 1; } }
.bulb-glass { width: 260px; height: 260px; max-width: 100%; background: var(--logo) center / cover no-repeat;
  /* fade the artwork's square dark surround so no edge shows */
  -webkit-mask: radial-gradient(circle closest-side, #000 86%, transparent); mask: radial-gradient(circle closest-side, #000 86%, transparent); }
/* Hover or tap the coin: it flips once around its vertical (Y) axis. */
.bulb-glass { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bulb-glass.spin-y { animation: coin-spin-y 1.1s cubic-bezier(.45, .05, .25, 1); }
@keyframes coin-spin-y { from { transform: perspective(800px) rotateY(0); } to { transform: perspective(800px) rotateY(360deg); } }
.bulb .bulb-base { position: relative; margin: -26px 0 0; width: 124px; height: 46px; line-height: 46px; text-align: center; white-space: nowrap;
  font-size: 1.55rem; font-weight: 900; letter-spacing: .01em; color: #1b1000;
  background: var(--metal); border-radius: 7px 7px 12px 12px;
  text-shadow: 0 1px 0 rgba(255, 246, 210, .75), 0 -1px 0 rgba(0, 0, 0, .25); /* engraved look */
  box-shadow: 0 -2px 0 var(--coin-bg), 0 -6px 16px rgb(var(--glow) / .45),
    inset 0 2px 0 rgba(255, 255, 255, .55), inset 0 -4px 6px rgba(70, 40, 0, .35); }
/* a bright rim where metal meets glass */
.bulb .bulb-base::before { content: ''; position: absolute; left: 6px; right: 6px; top: 3px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .9), transparent); }
.bulb-threads { display: flex; flex-direction: column; align-items: center; gap: 3px; margin-top: 4px; }
.bulb-threads i { display: block; height: 8px; border-radius: 4px; background: var(--metal); transform: rotate(-3deg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), inset 0 -2px 2px rgba(70, 40, 0, .4); }
.bulb-threads i:nth-child(1) { width: 116px; } .bulb-threads i:nth-child(2) { width: 106px; } .bulb-threads i:nth-child(3) { width: 96px; }
/* the electrical contact at the very bottom, glowing blue like the circuit lines */
.bulb-threads b { position: relative; width: 46px; height: 13px; margin-top: 1px; border-radius: 0 0 23px 23px / 0 0 13px 13px;
  background: linear-gradient(var(--cap), var(--coin-bg)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 8px 22px rgb(var(--glow) / .6); }
.bulb-threads b::after { content: ''; position: absolute; left: 50%; bottom: -3px; width: 12px; height: 6px; transform: translateX(-50%);
  border-radius: 0 0 6px 6px; background: var(--metal); }

.balance-card, .card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 18px; margin-bottom: 14px; }
.balance-card { text-align: center; }
.balance-card p { margin: 0; }
.balance { font-size: 2.8rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; margin: 6px 0; font-variant-numeric: tabular-nums; }
.addr { margin: 0 0 16px !important; font-size: .8rem; color: var(--muted); }
.addr-full { word-break: break-all; font-size: .9rem; background: var(--surface); border: 1px dashed var(--line); padding: 10px; border-radius: 10px; }

.list, .board { list-style: none; padding: 0; margin: 0; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.list li, .board li > a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.list li:first-child, .board li:first-child > a { border-top: 0; }
.board li.muted { padding: 14px; }
/* Your own row: a gold bar and a light gold tint (mixing gold into the dark navy turned it grey). */
.board li.me > a { background: color-mix(in srgb, var(--gold) 12%, var(--surface)); box-shadow: inset 4px 0 0 var(--gold); }
.board li.me .amt { color: var(--gold-dark); }
@media (prefers-color-scheme: dark) { .board li.me > a { background: color-mix(in srgb, var(--gold) 7%, var(--surface)); } .board li.me .amt { color: var(--gold); } }
.rank { width: 2em; text-align: center; font-size: 1.2rem; font-weight: 700; color: var(--muted); }
.avatar { font-size: 1.2rem; }
.amt { font-weight: 700; font-variant-numeric: tabular-nums; } .pos { color: var(--pos); } .neg { color: var(--neg); }

.words { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 0; margin: 12px 0; list-style: none; counter-reset: w; }
.words li { counter-increment: w; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-weight: 700; }
.words li::before { content: counter(w) ". "; color: var(--muted); font-weight: 400; }

.notice { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin-bottom: 12px; color: inherit; text-decoration: none; }
.notice.warn { background: var(--warn-bg); border-color: transparent; }
.notice.calm { border-left: 4px solid var(--line); }
.balance.dim { opacity: .7; }
.balance.unknown { opacity: .45; }
.notice .btn { margin-left: 6px; }

.qr { border-radius: 12px; max-width: 100%; height: auto; }
.modal-wrap { position: fixed; inset: 0; background: rgba(0, 8, 20, .6); display: grid; place-items: end center; z-index: 20; padding: 12px; }
@media (min-width: 600px) { .modal-wrap { place-items: center; } }
.modal { width: 100%; max-width: 440px; background: var(--surface); border-radius: 20px; padding: 20px; max-height: 90dvh; overflow: auto; }
.modal h2 { margin-top: 0; } .modal video { width: 100%; border-radius: 12px; background: #000; margin-bottom: 10px; }
.big-text { font-size: 1.2rem; text-align: center; }
.spinner { width: 42px; height: 42px; margin: 10px auto; border: 4px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(86px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--text); color: var(--bg);
  padding: 10px 16px; border-radius: 12px; z-index: 30; max-width: calc(100% - 32px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.toast.bad { background: var(--neg); color: #fff; } .toast.ok { background: var(--pos); color: #fff; }
.celebrate { position: fixed; inset: 0; display: grid; place-content: center; text-align: center; z-index: 40; background: color-mix(in srgb, var(--bg) 85%, transparent); font-size: 1.3rem; font-weight: 700; }
.coin.spin { animation: flip 1.1s ease-in-out 2; margin: 0 auto 12px; }
@keyframes flip { 50% { transform: rotateY(180deg) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .coin.spin, .spinner, .bulb::before, .bulb-glass.spin-y, .scan-line, .pulse { animation: none; } .btn { transition: none; } .btn:not(:disabled):active { transform: none; } }

/* Install guide */
.steps { margin: 8px 0 0; padding-left: 1.4em; } .steps li { margin: 0 0 10px; padding-left: 4px; }
.install-tip { display: flex; align-items: center; gap: 6px; } .install-tip a { flex: 1; color: inherit; text-decoration: none; }
.install-tip .btn { margin: 0; flex: none; }
details.card summary { cursor: pointer; } details.card[open] summary { margin-bottom: 4px; }
.install-note { margin-top: 28px; }

/* Invites */
.invite-btn { display: block; margin-top: 10px; }
.extra-btns { margin-top: 10px; flex-wrap: wrap; } .extra-btns .btn { padding-inline: 6px; }
.invite-card .gift { font-size: 2.6rem; line-height: 1; }
.invite-card p { margin: 6px 0; }
.list li .btn.small { flex: none; }

/* Settings */
.settings .card > h2:first-child, .card summary h2 { margin-top: 0; }
.settings .card.stack > h2 { margin-bottom: 0; } .settings .card.stack p { margin: 0; }
details.card summary { list-style: none; display: flex; align-items: center; justify-content: space-between; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary h2 { margin-bottom: 0; }
details.card summary::after { content: '›'; font-size: 1.4rem; color: var(--muted); transition: transform .2s; }
details.card[open] summary::after { transform: rotate(90deg); }
.card.attention { background: var(--warn-bg); border-color: transparent; }
.danger-zone { border-color: color-mix(in srgb, var(--neg) 30%, var(--line)); }
/* Connection card: same colours as the badge on the Settings gear. */
.conn { --c: var(--pos); border-left: 5px solid var(--c); }
.conn[data-net="off"] { --c: var(--neg); } .conn[data-net="down"] { --c: var(--warn); }
.conn-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.conn-head h2 { margin: 0; flex: 1; color: var(--c); }
.conn-head .btn { margin: 0; flex: none; }
.conn-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); flex: none;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 22%, transparent); }
.conn p { margin: 0 0 6px; } .conn p:last-child { margin-bottom: 0; }

/* Activity */
.segmented { display: flex; padding: 3px; margin: 0 0 6px; border-radius: 10px; background: color-mix(in srgb, var(--muted) 16%, transparent); }
.segmented button { flex: 1; appearance: none; border: 0; background: transparent; color: var(--text); font: inherit; font-size: .9rem; font-weight: 600;
  padding: 7px 0; border-radius: 8px; cursor: pointer; }
.segmented button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
h2.day { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 20px 4px 8px; }
/* Avatars (avatar() in app.js): same lightness for every hue, so white initials read well on all 12 colours. */
.initial { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  font-size: .82rem; font-weight: 700; letter-spacing: .02em; color: #fff; --h: 250;
  background: linear-gradient(145deg, oklch(.66 .13 var(--h)), oklch(.5 .13 var(--h))); }
.initial.vault { color: var(--gold-ink); background: linear-gradient(145deg, #f7d257, var(--gold) 55%, var(--gold-dark)); }
.av-0 { --h: 0; }
.av-1 { --h: 30; }
.av-2 { --h: 60; }
.av-3 { --h: 90; }
.av-4 { --h: 120; }
.av-5 { --h: 150; }
.av-6 { --h: 180; }
.av-7 { --h: 210; }
.av-8 { --h: 240; }
.av-9 { --h: 270; }
.av-10 { --h: 300; }
.av-11 { --h: 330; }
.list li.me { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.empty { margin-top: 40px; }
.chip { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: 99px; font-size: .72rem; font-weight: 700; line-height: 1.5; vertical-align: 1px; }
.chip.wait { background: color-mix(in srgb, var(--warn) 22%, transparent); color: var(--warn); }
.chip.done { background: color-mix(in srgb, var(--pos) 18%, transparent); color: var(--pos); }
.chip.off { background: color-mix(in srgb, var(--muted) 18%, transparent); color: var(--muted); }
.invite-msg { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .9rem; background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; max-height: 40vh; overflow: auto; }

/* Settings: the welcome-screen bulb, a bit smaller, spins once on arrival (tap to spin again). */
.settings-hero { margin-top: 4px; }
.settings-hero .bulb-glass { width: 200px; height: 200px; }
.settings-hero .bulb .bulb-base { margin-top: -20px; } /* same glass-to-socket gap as at 260px */
.settings-hero p { margin: 10px auto 0; max-width: 34ch; text-wrap: balance; }

/* Receive */
.receive-card .who { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0 0 10px; font-size: 1.1rem; }
.receive-card #qr { display: inline-block; padding: 6px; border-radius: 16px; background: #fff; box-shadow: 0 0 0 4px var(--gold); line-height: 0; }
.receive-card #qr .qr { width: min(280px, 70vw); height: auto; }
.receive-card .small { margin: 12px auto 0; max-width: 32ch; text-wrap: balance; }
.ask-line { margin: 12px 0 0; font-size: 1.15rem; } .ask-line .btn { margin-left: 4px; }
.ask label { display: block; } .ask-row { display: flex; gap: 8px; align-items: stretch; }
.ask-row input { flex: 1; } .ask-row .btn { margin-top: 4px; flex: none; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 18px; }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: var(--pos); animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: .35; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.1); } }

/* Send: the big "scan" button, then "or choose" a person */
.scan-btn { width: 100%; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; text-align: left; align-items: center; }
.scan-btn .ic { grid-row: 1 / 3; width: 36px; height: 36px; }
.scan-btn .ic-gold { fill: var(--gold); stroke: var(--gold-dark); }
.scan-btn span { font-size: 1.1rem; } .scan-btn small { font-weight: 400; font-size: .82rem; color: var(--btn2-sub); }
.or { display: flex; align-items: center; gap: 10px; margin: 18px 0 6px; color: var(--muted); font-size: .85rem; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Full-screen QR scanner */
.modal-wrap.scanner { padding: 0; background: #000; place-items: stretch; }
.scanner .modal { max-width: none; max-height: none; height: 100dvh; border-radius: 0; padding: 0; background: #000; position: relative; overflow: hidden; color: #fff; }
.scanner video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 0; margin: 0; }
.scan-frame { position: absolute; left: 50%; top: 46%; width: min(70vw, 300px); aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(0, 8, 20, .55); }
.scan-frame i { position: absolute; width: 44px; height: 44px; border: 5px solid var(--gold); transition: border-color .2s; }
.scan-frame i:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 22px; }
.scan-frame i:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 22px; }
.scan-frame i:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 22px; }
.scan-frame i:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 22px; }
.scan-line { position: absolute; left: 10%; right: 10%; top: 10%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent); box-shadow: 0 0 12px var(--gold); animation: scan-sweep 2s ease-in-out infinite alternate; }
@keyframes scan-sweep { to { top: 90%; } }
.scan-frame.ok i { border-color: #4cd28b; } .scan-frame.ok .scan-line { display: none; }
.scan-frame.ok { box-shadow: 0 0 0 100vmax rgba(0, 8, 20, .55), inset 0 0 0 999px rgba(76, 210, 139, .18); }
.scan-top { position: absolute; top: 0; left: 0; right: 0; padding: calc(24px + env(safe-area-inset-top)) 24px 0; text-align: center; }
.scan-msg { display: inline-block; margin: 0; padding: 8px 14px; border-radius: 99px; background: rgba(0, 8, 20, .7); font-weight: 600; max-width: 32ch; text-wrap: balance; }
.scan-bottom { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 10px; justify-content: center;
  padding: 0 24px calc(28px + env(safe-area-inset-bottom)); }
.scan-bottom .btn { min-width: 120px; padding: 13px 20px; }
.scan-torch[aria-pressed="true"] { background: var(--gold); color: var(--gold-ink); border-color: var(--gold); }

/* Games ("winner takes the pot") */
.list li:has(> a.game-row) { padding: 0; }
.game-row { flex: 1; display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: inherit; text-decoration: none; min-width: 0; }
.initial.game { background: color-mix(in srgb, var(--accent) 14%, transparent); font-size: 1.1rem; }
.players { border: 0; padding: 0; margin: 0; }
.players legend { font-weight: 600; font-size: .95rem; padding: 0; margin-bottom: 2px; }
.players label.check { align-items: center; margin: 8px 0; }
.pot-line { margin: 0; text-align: center; font-size: 1.05rem; }
.pot-line:empty { display: none; }
.notice.win { background: color-mix(in srgb, var(--pos) 14%, var(--surface)); border-color: transparent; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-bottom: 8px; }
.pick .btn { display: flex; align-items: center; gap: 8px; text-align: left; padding: 8px 10px; min-width: 0; }
.pick .btn span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick .btn[aria-pressed="true"], .btn.ghost[data-vote][aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: -1px; }
.btn.ghost[data-vote] { width: 100%; white-space: normal; }
.vote { font-size: .85rem; color: var(--muted); text-align: right; } .vote b { color: var(--text); }
.game-actions { margin-top: 14px; }
