/* جَلسة — card table + sadu weave. Dark is the hero; light follows the same tokens. RTL-first (logical properties only). */
:root {
  --bg: #0D1613; --surface: #16241D; --raised: #1D2F26; --text: #F0E9DA; --dim: #93A396;
  --green: #3E8A63; --green-hi: #6CC496; --red: #D05A3F; --gold: #E0AC4E;
  --teal: #4FA3A0; --violet: #9A86D6; --sky: #6FA8DC; --rose: #D9829B; --sand: #C7B38A;
  --line: rgba(240, 233, 218, .09); --line-2: rgba(240, 233, 218, .17);
  --felt: #1E5039; --felt-2: #123324; --cream: #F0E9DA;
  --glow: rgba(62, 138, 99, .20); --shadow: 0 12px 32px rgba(0, 0, 0, .38);
  --font-d: "Alexandria", "SF Arabic", "Geeza Pro", system-ui, sans-serif;
  --font-b: "IBM Plex Sans Arabic", "SF Arabic", "Geeza Pro", system-ui, sans-serif;
  --r-card: 20px; --r-btn: 14px;
  --tabs: 0px;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F3EDDF; --surface: #FCF9F0; --raised: #FFFFFF; --text: #18261F; --dim: #61705F;
  --green: #2E7A52; --green-hi: #2E7A52; --red: #B84A31; --gold: #A8791F;
  --teal: #2F7F7C; --violet: #6B58B0; --sky: #3F79B0; --rose: #B25A74; --sand: #8C7648;
  --line: rgba(24, 38, 31, .10); --line-2: rgba(24, 38, 31, .18);
  --felt: #2A6A4A; --felt-2: #1F5539; --glow: rgba(46, 122, 82, .13); --shadow: 0 10px 26px rgba(50, 55, 35, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F3EDDF; --surface: #FCF9F0; --raised: #FFFFFF; --text: #18261F; --dim: #61705F;
    --green: #2E7A52; --green-hi: #2E7A52; --red: #B84A31; --gold: #A8791F;
    --teal: #2F7F7C; --violet: #6B58B0; --sky: #3F79B0; --rose: #B25A74; --sand: #8C7648;
    --line: rgba(24, 38, 31, .10); --line-2: rgba(24, 38, 31, .18);
    --felt: #2A6A4A; --felt-2: #1F5539; --glow: rgba(46, 122, 82, .13); --shadow: 0 10px 26px rgba(50, 55, 35, .12);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0; min-height: 100%; color: var(--text); font: 400 16px/1.55 var(--font-b);
  background: radial-gradient(120% 55% at 50% -12%, var(--glow), transparent 62%), var(--bg);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none;
  padding-top: env(safe-area-inset-top, 0px);
}
body.has-tabs { --tabs: 68px; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; touch-action: manipulation; }
:focus-visible { outline: 2.5px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.rg { display: contents; }
h1, h2, h3 { font-family: var(--font-d); margin: 0; line-height: 1.2; }
p { margin: 0; }

/* ---------- layout ---------- */
#app { max-width: 560px; margin: 0 auto; }
.scr { padding: 12px 16px calc(28px + var(--tabs) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 14px; }
.center-scr { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; min-height: 55vh; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.center { text-align: center; align-items: center; }
.muted { color: var(--dim); }
.sm { font-size: 14px; }
.lbl { font-size: 13px; font-weight: 600; color: var(--dim); display: block; }
.sec-t { font-size: 17px; font-weight: 800; margin-top: 6px; }
.empty { color: var(--dim); text-align: center; padding: 18px 8px; }
.hint-line { padding: 0 4px; }
.err-detail { font-size: 12px; color: var(--dim); white-space: pre-wrap; max-width: 100%; overflow-x: auto; }

/* ---------- signature: sadu diamond strip ---------- */
.sadu {
  height: 16px; width: 100%; position: relative; flex: none;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='12'><path d='M7 0 14 6 7 12 0 6Z' fill='%23D05A3F'/><path d='M21 0 28 6 21 12 14 6Z' fill='%23E0AC4E'/><path d='M7 3.4 9.6 6 7 8.6 4.4 6Z' fill='%23F0E9DA'/><path d='M21 3.4 23.6 6 21 8.6 18.4 6Z' fill='%233E8A63'/></svg>") repeat-x center / auto 12px;
}
.sadu::before, .sadu::after { content: ""; position: absolute; inset-inline: 0; height: 1.5px; background: var(--gold); opacity: .55; }
.sadu::before { top: 0; } .sadu::after { bottom: 0; }

.dia { display: inline-block; width: 11px; height: 11px; background: var(--c, var(--gold)); transform: rotate(45deg); border-radius: 2px; flex: none; }
.dia.xl { width: 34px; height: 34px; border-radius: 5px; box-shadow: 0 0 0 6px color-mix(in srgb, var(--c, var(--gold)) 22%, transparent); }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: rotate(45deg) scale(.8); opacity: .6; } }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.top-t { flex: 1; min-width: 0; }
.top-t h1 { font-size: 21px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-t p { font-size: 13px; color: var(--dim); }
.top-a { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text); flex: none; transition: transform .12s; }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.icon-btn:active { transform: scale(.94); }
.icon-btn:disabled { opacity: .35; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn.sm .ic { width: 18px; height: 18px; }
.ic-play, .ic-more { fill: currentColor; }
[dir="rtl"] .ic-back { transform: scaleX(-1); }

/* ---------- buttons, chips, pills ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px;
  border-radius: var(--r-btn); background: var(--green); color: #F7F2E6; font-weight: 700; font-size: 16px;
  transition: transform .12s, filter .12s; box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .18);
}
.btn:active { transform: scale(.97); filter: brightness(1.08); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn.sm { min-height: 38px; padding: 0 13px; font-size: 14px; border-radius: 12px; }
.btn.lg { min-height: 58px; font-size: 18px; border-radius: 15px; font-family: var(--font-d); font-weight: 800; }
.btn.ghost { background: var(--surface); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.btn.gold { background: var(--gold); color: #1B150A; }
.btn.danger { background: var(--red); color: #FFF4EE; }
.btn.ghost.danger { background: transparent; color: var(--red); border-color: color-mix(in srgb, var(--red) 45%, transparent); }
.btn.round { width: 64px; height: 64px; min-height: 64px; padding: 0; border-radius: 50%; }
.btn.round .ic { width: 28px; height: 28px; }
.btn.choice { min-height: 54px; font-size: 17px; }
.btn.choice.on { outline: 2.5px solid var(--gold); outline-offset: 2px; }
.btn .ic { width: 19px; height: 19px; }
.link-btn { color: var(--gold); font-weight: 700; font-size: 14px; padding: 6px 2px; align-self: flex-start; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line-2); font-size: 14px; font-weight: 600; color: var(--text); transition: transform .12s;
}
.chip:active { transform: scale(.96); }
.chip.lg { min-height: 42px; padding: 0 16px; font-size: 15px; }
.chip.on { background: color-mix(in srgb, var(--cc, var(--green)) 20%, var(--surface)); border-color: var(--cc, var(--green)); }
.chip.saved { padding: 0; gap: 0; }
.chip.saved > button:first-child { padding: 0 6px 0 0; padding-inline: 14px 6px; min-height: 36px; font-weight: 600; }
.chip .x, .nchip .x { width: 30px; height: 30px; border-radius: 50%; color: var(--dim); font-size: 18px; line-height: 1; }
.pill { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--raised); color: var(--dim); white-space: nowrap; }
.pill.t-mafia { background: color-mix(in srgb, var(--red) 20%, transparent); color: var(--red); }
.pill.t-citizens { background: color-mix(in srgb, var(--green) 22%, transparent); color: var(--green-hi); }
.pill.t-neutral { background: color-mix(in srgb, var(--gold) 20%, transparent); color: var(--gold); }
.badge { font-size: 11px; color: var(--gold); border: 1px solid color-mix(in srgb, var(--gold) 40%, transparent); padding: 0 7px; border-radius: 999px; margin-inline-start: 6px; }

/* side / team colour helper */
.c-green { --cc: var(--green); } .c-red { --cc: var(--red); } .c-gold { --cc: var(--gold); } .c-teal { --cc: var(--teal); }
.c-violet { --cc: var(--violet); } .c-sky { --cc: var(--sky); } .c-rose { --cc: var(--rose); } .c-sand { --cc: var(--sand); } .c-raised { --cc: var(--raised); }
p.c-green, b.c-green, .proj.c-green, .big.c-green { color: var(--green-hi); } p.c-red, b.c-red, .proj.c-red { color: var(--red); } .proj.c-gold, b.c-gold { color: var(--gold); }
b.c-teal { color: var(--teal); } b.c-violet { color: var(--violet); } b.c-sky { color: var(--sky); } b.c-rose { color: var(--rose); } b.c-sand { color: var(--sand); }

/* ---------- inputs ---------- */
.field { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font-size: 16px; }
.field::placeholder { color: var(--dim); opacity: .8; }
.field.num { width: 96px; flex: none; text-align: center; font-variant-numeric: tabular-nums; }
.field.big-in { min-height: 58px; font-size: 20px; text-align: center; font-weight: 600; }
.fld { display: flex; flex-direction: column; gap: 6px; }

.seg { display: flex; padding: 4px; gap: 4px; border-radius: 15px; background: var(--surface); border: 1px solid var(--line); }
.seg-b { flex: 1; min-height: 42px; border-radius: 11px; font-weight: 700; font-size: 15px; color: var(--dim); display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 8px; transition: background .15s, color .15s; }
.seg-b.on { background: var(--raised); color: var(--text); box-shadow: 0 1px 0 var(--line-2), 0 3px 10px rgba(0, 0, 0, .18); }
.seg.sm .seg-b { min-height: 34px; font-size: 13.5px; }
.seg.wrap .seg-b { font-size: 13px; line-height: 1.25; padding: 6px 8px; }
.seg .ic { width: 18px; height: 18px; }

.stepper { display: inline-flex; align-items: center; background: var(--raised); border-radius: 12px; border: 1px solid var(--line); flex: none; }
.st-b { width: 38px; height: 38px; font-size: 21px; font-weight: 600; border-radius: 11px; color: var(--text); }
.st-b:active { background: var(--line-2); }
.st-v { min-width: 30px; text-align: center; font: 800 17px var(--font-d); font-variant-numeric: tabular-nums; }

.tgl { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); text-align: start; }
.tgl-l { flex: 1; font-weight: 600; font-size: 15px; }
.tgl-k { width: 46px; height: 28px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.tgl-k::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--text); transition: inset-inline-start .15s; }
.tgl.on .tgl-k { background: var(--green); }
.tgl.on .tgl-k::after { inset-inline-start: 21px; background: #F7F2E6; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 16px; }
.card.inset { background: transparent; border-style: dashed; }
.card-t { font-size: 19px; font-weight: 800; }

/* ---------- home ---------- */
.home-top { display: flex; align-items: flex-start; justify-content: space-between; padding-top: 8px; }
.brand { font-size: 46px; font-weight: 900; letter-spacing: -.01em; line-height: 1.05; }
.tagline { color: var(--dim); font-size: 15px; margin-top: 2px; }
.hero { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: start; padding: 22px 20px; border-radius: 24px; min-height: 124px; justify-content: flex-end; transition: transform .14s; }
.hero:active { transform: scale(.985); }
.hero-t { font: 900 27px/1.15 var(--font-d); }
.hero-s { font-size: 14px; opacity: .82; max-width: 38ch; text-wrap: balance; }
.hero.felt {
  min-height: 168px; color: var(--cream);
  background: radial-gradient(130% 110% at 85% 0%, color-mix(in srgb, var(--felt) 70%, #fff 6%), var(--felt) 45%, var(--felt-2));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07), inset 0 0 0 7px rgba(0, 0, 0, .14), inset 0 0 0 8px rgba(224, 172, 78, .35), var(--shadow);
}
.hero-suit { position: absolute; top: -18px; inset-inline-end: 12px; font-size: 150px; line-height: 1; color: var(--cream); opacity: .10; font-family: Georgia, serif; pointer-events: none; }
.hero.raised { background: var(--raised); border: 1px solid var(--line-2); }
.hero-dias { position: absolute; top: 20px; inset-inline-end: 20px; display: flex; gap: 9px; }
.joinbox .row { margin-top: 8px; }
.code-in { flex: 1; min-width: 0; min-height: 52px; border-radius: 13px; border: 1px solid var(--line-2); background: var(--bg); text-align: center; font: 800 24px var(--font-d); letter-spacing: .35em; font-variant-numeric: tabular-nums; }
.code-in::placeholder { color: var(--dim); opacity: .6; letter-spacing: .2em; }
.recent .chips { margin-top: 8px; }
.hint { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; border-color: color-mix(in srgb, var(--gold) 35%, transparent); }
.hint p { font-size: 14px; color: var(--dim); }

/* ---------- picker ---------- */
.games { display: flex; flex-direction: column; gap: 10px; }
.game { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 8px; padding-inline-end: 12px; }
.game-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; text-align: start; padding: 6px; border-radius: 14px; }
.game-main:active { background: var(--raised); }
.game.new { border-style: dashed; padding: 14px; text-align: start; }
.game-ic { width: 52px; height: 52px; flex: none; border-radius: 15px; display: grid; place-items: center; font-size: 26px; background: var(--raised); color: var(--gold); font-family: Georgia, serif; }
.game-ic.s-score { background: color-mix(in srgb, var(--felt) 85%, transparent); color: var(--cream); }
.game-ic.s-hiddenRoles { color: var(--red); } .game-ic.s-buzzer { color: var(--green-hi); } .game-ic.s-turns { color: var(--gold); }
.game-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.game-txt b { font: 800 19px var(--font-d); }
.game-meta { font-size: 13px; color: var(--dim); display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }

/* ---------- scoreboard (the hero moment) ---------- */
.board { display: grid; gap: 10px; }
.board.two { grid-template-columns: 1fr 1fr; }
.board.many { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.side { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 14px 16px; position: relative; overflow: hidden; }
.side::before { content: ""; position: absolute; inset-block-start: 0; inset-inline: 0; height: 4px; background: var(--cc); }
.side.win { border-color: var(--cc); box-shadow: 0 0 0 1px var(--cc), 0 10px 30px color-mix(in srgb, var(--cc) 30%, transparent); }
.side-name { font: 800 18px var(--font-d); color: var(--cc); }
.board.two .side-name { font-size: 20px; }
.big { font: 900 clamp(60px, 21vw, 100px)/.95 var(--font-d); font-variant-numeric: tabular-nums; letter-spacing: -.02em; margin: 6px 0 12px; }
.board.many .big { font-size: clamp(40px, 12vw, 56px); }
/* size the number to its own card, so 3-digit scores fit even on an iPhone SE */
@supports (container-type: inline-size) {
  .side { container-type: inline-size; }
  .big { font-size: clamp(38px, 46cqi, 100px); }
  .board.many .big { font-size: clamp(30px, 34cqi, 56px); }
}
.bar { height: 8px; border-radius: 999px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--cc); border-radius: inherit; transition: width .45s cubic-bezier(.2, .8, .2, 1); }
.proj { text-align: center; font-weight: 700; font-size: 15px; color: var(--dim); }
.live-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--red); background: color-mix(in srgb, var(--red) 14%, transparent); }
.live-badge i, .status i, .armed-line i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.2s infinite; }
@keyframes blink { 50% { opacity: .25; } }

.add { display: flex; flex-direction: column; gap: 12px; }
.pt-row { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.pt-row.two { grid-template-columns: 1fr 1fr; }
.pt-field { display: flex; flex-direction: column; gap: 6px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 10px 12px; position: relative; }
.pt-field:focus-within { border-color: var(--cc); }
.pt-name { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-weight: 800; color: var(--cc); font-size: 15px; }
.pts { width: 100%; border: 0; background: transparent; font: 900 38px/1.1 var(--font-d); text-align: center; font-variant-numeric: tabular-nums; padding: 0; outline: none; }
.pts::placeholder { color: var(--dim); opacity: .35; }
.auto-tag { display: none; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, transparent); }
.auto-tag.show { display: inline-flex; }
.neg { position: absolute; bottom: 8px; inset-inline-end: 8px; width: 30px; height: 30px; border-radius: 9px; background: var(--raised); font-weight: 800; }
.decl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.decl-col { display: flex; flex-direction: column; gap: 6px; }
.decl-h { font-size: 13px; font-weight: 700; color: var(--dim); }
.decl .chip { min-height: 32px; padding: 0 10px; font-size: 13px; }
.decl .chip.on { --cc: var(--gold); }
.rounds { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.round { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.rn-i { width: 26px; color: var(--dim); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.rn-s { flex: 1; display: flex; justify-content: flex-end; gap: 14px; font: 800 18px var(--font-d); font-variant-numeric: tabular-nums; }
.foot-actions { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.banner { border-radius: 22px; padding: 0 16px 16px; background: color-mix(in srgb, var(--cc, var(--gold)) 16%, var(--surface)); border: 1px solid var(--cc, var(--gold)); display: flex; flex-direction: column; gap: 10px; text-align: center; overflow: hidden; animation: pop .45s cubic-bezier(.2, 1.3, .4, 1); }
.banner .sadu { margin-inline: -16px; width: calc(100% + 32px); }
.banner h2 { font-size: 28px; font-weight: 900; }
.banner-k { font: 800 15px var(--font-d); color: var(--gold); }
@keyframes pop { from { transform: scale(.92); opacity: 0; } }
.out-banner { padding: 14px; }

/* ---------- sheets & toasts ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(5, 10, 8, .55); z-index: 40; animation: fade .18s; }
.sheet {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 41; max-width: 560px; margin: 0 auto; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; border: 1px solid var(--line-2); border-bottom: 0;
  padding: 8px 18px calc(20px + env(safe-area-inset-bottom, 0px)); animation: up .22s cubic-bezier(.2, .9, .3, 1);
}
.sheet.out, .backdrop.out { opacity: 0; transition: opacity .18s; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 4px auto 12px; }
.sheet-t { font-size: 20px; font-weight: 800; }
.sheet-msg { font-size: 17px; font-weight: 600; text-align: center; padding: 6px 0; }
@keyframes up { from { transform: translateY(100%); } }
@keyframes fade { from { opacity: 0; } }
#toasts { position: fixed; z-index: 60; inset-inline: 0; bottom: calc(var(--tabs) + 18px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 13px; font-weight: 700; font-size: 14px; max-width: 90vw; box-shadow: var(--shadow); animation: up .2s; transition: opacity .3s; }
.toast.out { opacity: 0; }

/* ---------- sessions ---------- */
.codebox { display: flex; flex-direction: column; gap: 12px; background: var(--bg); border: 1px solid var(--line-2); border-radius: var(--r-card); padding: 16px; }
.code-digits { display: flex; justify-content: center; gap: 10px; }
.code-digits span { width: 58px; height: 70px; border-radius: 15px; display: grid; place-items: center; background: var(--raised); border: 1px solid var(--line-2); font: 900 40px var(--font-d); color: var(--gold); box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .2); }
.code-mini { font: 800 15px var(--font-d); letter-spacing: .2em; color: var(--gold); background: var(--raised); padding: 3px 10px; border-radius: 9px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--dim); }
.status.s-open { color: var(--green-hi); } .status.s-reconnecting { color: var(--gold); }
.lobby { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lobby li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 600; }
.lobby li.muted { font-weight: 400; justify-content: center; text-align: center; font-size: 14px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--line-2); }
.dot.on { background: var(--green-hi); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green-hi) 25%, transparent); }
.session-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.join-head { display: flex; align-items: center; gap: 10px; }
.join-name { align-items: stretch; text-align: center; padding-top: 10px; }
.join-name h2 { font-size: 26px; }
.av { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font: 800 16px var(--font-d); background: color-mix(in srgb, var(--cc, var(--green)) 26%, var(--raised)); color: var(--text); flex: none; }
.av.c-raised { background: var(--raised); }

/* ---------- mafia ---------- */
.names { display: flex; flex-direction: column; gap: 10px; }
.nchip { display: inline-flex; align-items: center; gap: 8px; padding: 3px; padding-inline-end: 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line-2); font-weight: 600; font-size: 14px; }
.nchip .av { width: 28px; height: 28px; border-radius: 50%; font-size: 13px; }
.roles { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.role { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.role.open { border-color: var(--line-2); }
.role-main { display: flex; align-items: center; gap: 8px; padding: 6px; padding-inline-end: 8px; }
.role-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 11px; text-align: start; }
.role-name .dia { margin-inline: 3px; }
.rn { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-more { padding: 4px 14px 14px; }
.balance { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; }
.balance .chip.on { font-weight: 700; }
.sticky-cta { position: sticky; bottom: calc(var(--tabs) + 10px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 12px; margin-inline: -4px; border-radius: 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); }

.pass { text-align: center; padding-top: 6px; }
.pass-to { color: var(--dim); font-weight: 600; }
.pass-name { font-size: 40px; font-weight: 900; }
.rcard { perspective: 1200px; width: min(100%, 330px); aspect-ratio: 5 / 7; margin: 4px auto; }
.rc-in { position: relative; width: 100%; height: 100%; transition: transform .6s cubic-bezier(.3, 1.3, .5, 1); transform-style: preserve-3d; }
.rcard.flipped .rc-in { transform: rotateY(180deg); }
.rc-face { position: absolute; inset: 0; border-radius: 24px; backface-visibility: hidden; -webkit-backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 22px; text-align: center; border: 1px solid var(--line-2); box-shadow: var(--shadow); }
.rc-back { background: radial-gradient(120% 90% at 50% 0%, var(--felt), var(--felt-2)); box-shadow: inset 0 0 0 10px rgba(0, 0, 0, .15), inset 0 0 0 11px rgba(224, 172, 78, .45), var(--shadow); }
.rc-back::before, .rc-back::after { content: ""; position: absolute; inset-inline: 22px; height: 12px; background: inherit; }
.rc-mark .dia.xl { --c: var(--gold); width: 54px; height: 54px; }
.rc-hint { position: absolute; bottom: 28px; inset-inline: 20px; color: var(--cream); opacity: .8; font-size: 14px; font-weight: 600; }
.rc-front { transform: rotateY(180deg); background: linear-gradient(170deg, color-mix(in srgb, var(--c) 22%, var(--raised)), var(--surface) 70%); border-color: var(--c); }
.rc-label { color: var(--dim); font-size: 14px; font-weight: 600; }
.rc-name { font: 900 40px/1.15 var(--font-d); color: var(--c); }
.rc-note { font-size: 15px; background: var(--bg); padding: 10px 12px; border-radius: 12px; }
.rc-mates { font-size: 14px; color: var(--red); font-weight: 700; }
.rcard.tappable { cursor: pointer; }

.narrator.is-night { --glow: rgba(90, 80, 160, .22); }
.phase .seg-b.on { background: var(--raised); }
.timer { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.clock { font: 900 64px/1 var(--font-d); font-variant-numeric: tabular-nums; }
.timer.running .clock { color: var(--gold); }
.timer-b { justify-content: center; }
.wizard { display: flex; flex-direction: column; gap: 10px; border-color: color-mix(in srgb, var(--c, var(--gold)) 50%, transparent); }
.wizard h3 { display: flex; align-items: center; gap: 12px; font-size: 22px; font-weight: 900; }
.wizard h3 .dia { --c: var(--c); }
.wz-dots { display: flex; gap: 6px; }
.wz-dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--line-2); }
.wz-dots i.done { background: var(--dim); } .wz-dots i.cur { background: var(--c, var(--gold)); }
.wz-names { font-size: 18px; font-weight: 700; }
.day-card h3 { font-size: 22px; font-weight: 900; margin-bottom: 4px; }
.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.prow { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; transition: opacity .2s; }
.prow.cur { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold); }
.prow-main { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; text-align: start; border-radius: 16px; }
.prow.dead .pname { text-decoration: line-through; color: var(--dim); }
.prow.dead .av { filter: grayscale(1); opacity: .5; }
.pname { font-weight: 700; }
.prow-more { padding: 2px 12px 14px; }
.prow-more .chip.on { outline: 2px solid var(--cc); }
.hearts { color: var(--red); letter-spacing: 2px; font-size: 15px; }

/* ---------- buzzer: host control room ---------- */
.bz-cols, .bz-main, .bz-side { display: flex; flex-direction: column; gap: 14px; }
.bz-grid { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.bz-grid.n1, .bz-grid.n2 { grid-template-columns: 1fr; }
.bz-grid.n3 > :first-child { grid-column: span 2; }
.bz { min-height: 96px; border-radius: 22px; background: var(--surface); border: 2px solid color-mix(in srgb, var(--cc) 40%, transparent); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; user-select: none; -webkit-user-select: none; touch-action: none; transition: transform .08s, background .15s, opacity .15s; }
.bz-n { font: 800 19px var(--font-d); color: var(--cc); }
.bz-r { font-size: 13px; font-weight: 700; min-height: 18px; }
.armed .bz { background: color-mix(in srgb, var(--cc) 18%, var(--surface)); border-color: var(--cc); }
.bz:active { transform: scale(.96); }
.bz.hit { background: color-mix(in srgb, var(--cc) 34%, var(--surface)); }
.bz.first { background: var(--cc); } .bz.first .bz-n, .bz.first .bz-r { color: #fff; }
.bz.locked { opacity: .4; border-style: dashed; }
.stage { position: relative; text-align: center; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s; }
.stage.armed { border-color: var(--red); animation: stagePulse 1s ease-in-out infinite; }
.stage.answer { border-color: var(--gold); box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 16%, transparent); }
.stage.won { border-color: var(--green-hi); box-shadow: 0 0 0 4px color-mix(in srgb, var(--green-hi) 16%, transparent); }
@keyframes stagePulse { 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--red) 14%, transparent); } }
.stage-q { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 700; color: var(--dim); }
.stage-q b { color: var(--text); font-size: 15px; }
.stage-lbl { font-size: 14px; font-weight: 700; color: var(--gold); }
.stage-name { font: 900 clamp(34px, 9vw, 60px) var(--font-d); line-height: 1.15; overflow-wrap: anywhere; color: var(--text); }
.stage.won .stage-name { color: var(--green-hi); }
.stage-ms { font-variant-numeric: tabular-nums; color: var(--dim); font-weight: 700; font-size: 15px; }
.stage-arm { min-height: 68px; font-size: 22px; border-radius: 18px; }
.stage-hint { color: var(--dim); font-size: 14px; }
.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.judge .btn { min-height: 64px; font-size: 20px; border-radius: 18px; }
.judge .ok { background: var(--green); color: #fff; }
.judge .no { background: var(--red); color: #fff; }
.cd { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.cd i { display: block; height: 100%; width: 100%; background: var(--gold); transition: width .2s linear; }
.cd.low i { background: var(--red); }
.cd-t { font-size: 13px; color: var(--dim); font-variant-numeric: tabular-nums; }
.bz-res { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.bz-res li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 600; }
.bz-res li.top { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); }
.bz-res li.me { box-shadow: 0 0 0 2px var(--green-hi); }
.bz-res li.no { opacity: .55; } .bz-res li.no .grow { text-decoration: line-through; }
.bz-res li.ok { border-color: var(--green-hi); }
.bz-res .v { font-weight: 900; } .bz-res li.ok .v { color: var(--green-hi); } .bz-res li.no .v { color: var(--red); }
.rk { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--raised); font-weight: 800; font-size: 13px; flex: none; }
.ms { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--dim); font-size: 14px; }
.bz-early { font-size: 13px; color: var(--gold); text-align: center; }
.lb { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.lb li { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 600; }
.lb li.lead { border-color: var(--gold); }
.lb li.off { opacity: .6; }
.lb .sc { font: 900 22px var(--font-d); min-width: 40px; text-align: center; font-variant-numeric: tabular-nums; }
.lb .pm { display: flex; gap: 4px; }
.lb .pm .icon-btn { width: 32px; height: 32px; font-weight: 800; }
.lb .tdot { width: 10px; height: 10px; border-radius: 3px; background: var(--cc); flex: none; }
.team-h { display: flex; align-items: center; gap: 8px; padding: 8px 6px 2px; font-weight: 800; color: var(--cc); }
.team-h .sc { margin-inline-start: auto; font: 900 20px var(--font-d); }
.tchips { display: flex; gap: 4px; }
.tchips .chip { padding: 3px 9px; font-size: 12px; min-height: 26px; }
.sess-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sess-head .code-mini { font-size: 20px; }
.hist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.hist li { display: flex; gap: 8px; align-items: center; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.hist .q { color: var(--dim); font-weight: 700; min-width: 34px; }
.hist .none { color: var(--dim); font-style: italic; }
.final { text-align: center; padding: 20px 16px; }
.final .stage-name { font-size: clamp(30px, 8vw, 48px); }
@media (min-width: 900px) {
  body.wide #app { max-width: 1120px; }
  .scr.buzzer { padding-inline: 28px; }
  .bz-cols { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 22px; align-items: start; }
  .stage { padding: 28px 24px; min-height: 300px; justify-content: center; }
  .stage-name { font-size: clamp(48px, 6vw, 88px); }
  .stage-arm { min-height: 84px; font-size: 26px; }
  .judge .btn { min-height: 76px; font-size: 24px; }
  .bz { min-height: 120px; }
}

/* ---------- question packs & quiz ---------- */
.qcard { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--line-2); }
.q-i { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--dim); }
.q-text { font: 800 20px/1.4 var(--font-d); }
.q-ans { color: var(--gold); font-weight: 800; }
.q-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.q-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-size: 14px; font-weight: 600; }
.q-opt.right { border-color: var(--green-hi); color: var(--green-hi); }
.q-opt .n { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--raised); font-size: 12px; font-weight: 800; flex: none; }
.q-opt .cnt { margin-inline-start: auto; font-size: 12px; color: var(--dim); }
.qz-opts { display: flex; flex-direction: column; gap: 8px; width: 100%; }
.qz-opt { min-height: 60px; border-radius: 16px; background: var(--surface); border: 2px solid var(--line-2); font: 700 18px var(--font-b); padding: 10px 14px; display: flex; align-items: center; gap: 12px; text-align: start; transition: transform .08s, background .15s; }
.qz-opt .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--raised); font: 800 14px var(--font-d); flex: none; }
.qz-opt:active { transform: scale(.98); }
.qz-opt.mine { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, var(--surface)); }
.qz-opt.right { border-color: var(--green-hi); background: color-mix(in srgb, var(--green-hi) 18%, var(--surface)); }
.qz-opt.wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 14%, var(--surface)); }
.qz-opt[disabled] { opacity: .85; }
.qz-q { font: 800 22px/1.4 var(--font-d); text-align: center; }
.qz-status { text-align: center; font-weight: 700; color: var(--dim); }
.qz-status.ok { color: var(--green-hi); } .qz-status.no { color: var(--red); }
.q-edit { display: flex; flex-direction: column; gap: 8px; }
.q-edit .q-n { font-size: 13px; font-weight: 800; color: var(--dim); display: flex; justify-content: space-between; align-items: center; }
.q-optrow { display: flex; align-items: center; gap: 6px; }
.q-optrow .field { flex: 1; }
.pk-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.pk-row .ic { font-size: 22px; width: 32px; text-align: center; }
.pk-row b { display: block; } .pk-row .muted { display: block; font-size: 13px; }
.pk-row.on { border-color: var(--gold); }
.code-big { font: 900 34px var(--font-d); letter-spacing: .18em; text-align: center; color: var(--gold); }
@media (min-width: 900px) { .q-text { font-size: 26px; } .qz-q { font-size: 28px; } }

/* ---------- buzzer: player phone ---------- */
.buzz-wrap { display: flex; flex-direction: column; gap: 16px; align-items: center; padding-top: 6px; }
.me-bar { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.me-bar .lbl { margin: 0; }
.me-bar b { font: 900 28px var(--font-d); font-variant-numeric: tabular-nums; }
.me-bar .tteam { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--cc); font-size: 13px; }
.giant { width: min(78vw, 320px); aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: var(--raised); border: 3px solid var(--line-2); font: 900 30px var(--font-d); color: var(--dim); user-select: none; -webkit-user-select: none; touch-action: none; box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .22), var(--shadow); transition: transform .08s, background .15s; padding: 12px; text-align: center; }
.giant small { font: 700 15px var(--font-b); }
.giant.armed { background: var(--red); border-color: color-mix(in srgb, var(--red) 70%, #fff); color: #fff; animation: throb .9s ease-in-out infinite; }
.giant.first { background: var(--gold); color: #1B150A; }
.giant.turn { background: var(--gold); color: #1B150A; border-color: #fff; animation: throbGold .9s ease-in-out infinite; }
.giant.ok { background: var(--green-hi); color: #fff; }
.giant.no { background: var(--red); color: #fff; opacity: .9; }
.giant.done { background: var(--surface); color: var(--text); }
.giant.early { background: var(--surface); color: var(--red); }
.giant.locked { opacity: .5; }
.giant:active { transform: scale(.95); }
@keyframes throb { 50% { box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .22), 0 0 0 14px color-mix(in srgb, var(--red) 25%, transparent); } }
@keyframes throbGold { 50% { box-shadow: inset 0 -10px 0 rgba(0, 0, 0, .22), 0 0 0 14px color-mix(in srgb, var(--gold) 30%, transparent); } }
.mini-lb { width: 100%; }
.mini-lb li { padding: 6px 10px; font-size: 14px; }
.mini-lb .sc { font-size: 18px; min-width: 32px; }

/* ---------- turns ---------- */
.turn-now { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; border: 1px solid var(--line-2); transition: border-color .2s, box-shadow .2s; }
.turn-now.low { border-color: var(--red); box-shadow: 0 0 0 4px color-mix(in srgb, var(--red) 16%, transparent); }
.turn-now.up { border-color: var(--red); }
.turn-head { width: 100%; display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; color: var(--dim); }
.turn-name { font: 900 clamp(34px, 9vw, 48px)/1.15 var(--font-d); overflow-wrap: anywhere; }
.turn-now .row { width: 100%; }
.turn-now .cd { width: 100%; }
.tn-clock { font: 900 34px var(--font-d); font-variant-numeric: tabular-nums; }
.tn-clock.low { color: var(--red); }
.tn-tools { display: flex; gap: 6px; width: 100%; }
.tn-tools .btn { flex: 1; padding-inline: 6px; font-size: 13px; white-space: nowrap; min-height: 40px; }
.hearts { letter-spacing: 1px; color: var(--red); }
.prow-main.static { cursor: default; }
.tn-rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.tn-rank li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; font-weight: 600; }
.tn-rank li:first-child { border-color: var(--gold); }

/* ---------- stats ---------- */
.lock { color: var(--gold); font-size: 11px; }
.stat-hero { display: grid; grid-template-columns: 1fr 1.2fr; gap: 14px; align-items: end; }
.last8 .l8 { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin-top: 8px; }
.l8 i { aspect-ratio: 1; border-radius: 5px; background: var(--raised); border: 1px solid var(--line); transform: rotate(45deg) scale(.8); }
.l8 i.w { background: var(--green); border-color: var(--green); } .l8 i.l { background: var(--red); border-color: var(--red); }
.h2h { display: flex; justify-content: space-between; font: 900 24px var(--font-d); margin: 6px 0 8px; }
.split { display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px; }
.split i.g { background: var(--green); } .split i.r { background: var(--red); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat-grid .card { display: flex; flex-direction: column; gap: 6px; }
.star { display: flex; align-items: center; gap: 10px; font: 900 22px var(--font-d); }
.mid { font: 900 34px var(--font-d); font-variant-numeric: tabular-nums; }

/* ---------- create ---------- */
.shapes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shape { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: start; padding: 16px; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--line); min-height: 150px; transition: transform .12s; }
.shape:active { transform: scale(.97); }
.shape b { font: 800 18px var(--font-d); }
.shape-ic { font-size: 30px; font-family: Georgia, serif; color: var(--gold); line-height: 1; margin-bottom: 4px; }
.shape.s-score .shape-ic { color: var(--green-hi); } .shape.s-hiddenRoles .shape-ic { color: var(--red); }
.shape-tag { display: flex; align-items: center; gap: 10px; }
.shape-tag .game-ic { width: 40px; height: 40px; font-size: 20px; border-radius: 12px; }
.mode-row .field.num { width: 110px; }
.issues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.issues li { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 12px; background: var(--surface); }
.issues li.error { color: var(--red); } .issues li.warn { color: var(--gold); }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30; display: flex; justify-content: center; gap: 4px;
  padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px));
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tab { flex: 1; max-width: 170px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 13px; color: var(--dim); text-decoration: none; font-size: 12px; font-weight: 700; }
.tab.on { color: var(--text); }
.tab.on .ic { color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
@media (min-width: 600px) { .scr { padding-top: 24px; } }

/* ---------- بنت السبيت (built-in; same tokens as the rest of Jalsah) ---------- */
.sb-intro { display: flex; align-items: center; gap: 14px; }
.sb-intro p { color: var(--dim); font-size: 15px; line-height: 1.6; }
.sb-mark { width: 56px; height: 56px; flex: none; border-radius: 16px; display: grid; place-items: center; font: 30px Georgia, serif; color: var(--gold);
  background: radial-gradient(circle at 30% 25%, var(--felt), var(--felt-2)); box-shadow: inset 0 0 0 1px rgba(240, 233, 218, .1); }
.sb-names { display: flex; flex-direction: column; gap: 8px; }
.sb-name { display: flex; align-items: center; gap: 8px; }
.sb-name .field { flex: 1; min-width: 0; }
.sb-num { width: 30px; height: 30px; flex: none; border-radius: 10px; display: grid; place-items: center; font: 800 14px var(--font-d); background: var(--raised); color: var(--dim); font-variant-numeric: tabular-nums; }
.sb-del { width: 40px; height: 40px; color: var(--dim); }
.sb-add { align-self: flex-start; margin-top: 4px; }
.sb-limit-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sb-limit-row .sec-t { margin: 0; }
.field.sb-limit { width: 116px; min-height: 56px; font: 800 24px var(--font-d); font-variant-numeric: tabular-nums; }
.sb-reset { align-self: center; }

.sb-list { display: flex; flex-direction: column; gap: 10px; }
.sb-row {
  --cc: var(--line-2);
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2px 12px;
  padding: 14px 16px 12px; border-radius: var(--r-card); background: var(--surface);
  border: 1px solid var(--line); border-inline-start: 4px solid var(--cc);
}
.sb-row.low { --cc: var(--green); background: color-mix(in srgb, var(--green) 10%, var(--surface)); }
.sb-row.high { --cc: var(--red); }
.sb-row.bench { opacity: .45; }
.sb-rank { width: 22px; text-align: center; font: 800 15px var(--font-d); color: var(--dim); font-variant-numeric: tabular-nums; }
.sb-mid { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-nm { font: 800 18px var(--font-d); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-tag { font-size: 12.5px; font-weight: 700; color: var(--cc); }
.sb-row.low .sb-tag { color: var(--green-hi); }
.sb-score { text-align: end; line-height: 1; }
.sb-score b { font: 900 34px var(--font-d); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.sb-row.low .sb-score b { color: var(--green-hi); }
.sb-row.high .sb-score b { color: var(--red); }
.sb-score small { display: block; margin-top: 5px; font-size: 12px; color: var(--dim); }
.bar.sb-bar { grid-column: 1 / -1; height: 6px; margin-top: 10px; }
.sb-bar i { background: color-mix(in srgb, var(--dim) 60%, transparent); }
.sb-bar.near i { background: var(--gold); }
.sb-tie { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, var(--surface)); display: flex; flex-direction: column; gap: 4px; }
.sb-tie p:first-child { color: var(--gold); font-weight: 700; }
.sb-done h2 { font-size: 30px; }

.sb-rounds-h .btn .ic { width: 16px; height: 16px; }
.sb-rounds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sb-round { padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 7px; }
.sb-round-h { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.sb-deltas { display: flex; flex-wrap: wrap; gap: 6px; }
.sb-delta { font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--raised); color: var(--dim); }
.sb-delta b { color: var(--text); font-variant-numeric: tabular-nums; }
.sb-delta.minus b { color: var(--green-hi); }

.sb-actions { flex-direction: row; }
.sb-actions .btn { flex: 1; }
.sb-values .seg-b { font: 800 17px var(--font-d); font-variant-numeric: tabular-nums; }
.sb-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.choice.sb-choice { justify-content: flex-start; gap: 10px; min-height: 54px; padding: 0 12px; font-size: 16px; background: var(--surface); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.btn.choice.sb-choice span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn.choice.sb-choice.on { background: var(--gold); color: #1B150A; border-color: var(--gold); outline: none; }
.btn.choice.sb-choice.on .av { background: rgba(27, 21, 10, .15); color: #1B150A; }
.sb-count { display: flex; flex-direction: column; gap: 8px; }
.sb-crow { display: flex; align-items: center; gap: 8px; }
.sb-crow .nm { flex: 1; min-width: 0; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-crow .field.num { width: 84px; font-weight: 700; font-size: 18px; }
.sb-sign { width: 44px; height: 48px; flex: none; border-radius: 12px; background: var(--raised); font: 800 20px var(--font-d); color: var(--dim); }
.sb-sign.minus { color: var(--green-hi); background: color-mix(in srgb, var(--green) 22%, var(--raised)); }
.sb-rem { text-align: center; font: 800 16px var(--font-d); padding: 8px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.sb-rem.ok { color: var(--green-hi); background: color-mix(in srgb, var(--green) 14%, transparent); }
.sb-rem.warn { color: var(--gold); background: color-mix(in srgb, var(--gold) 12%, transparent); }
.sb-note { text-align: center; }
.sb-sheet { max-height: min(78vh, 720px); overflow-y: auto; }

.sb-win h2 { font-size: 32px; }
.sb-lose { border-inline-start: 4px solid var(--red); display: flex; flex-direction: column; gap: 4px; }
.sb-lose-n { font: 800 22px var(--font-d); color: var(--red); }
.sb-rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sb-rank-list li { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.sb-rank-list li.low { border-color: var(--green); }
.sb-rank-list li.high { border-color: color-mix(in srgb, var(--red) 60%, transparent); }
.sb-rn { font-weight: 700; }
.sb-pts { font: 900 20px var(--font-d); font-variant-numeric: tabular-nums; }
.sb-rank-list li.low .sb-pts { color: var(--green-hi); }
.sb-rank-list li.high .sb-pts { color: var(--red); }
.game-ic.s-sbeet { color: var(--gold); background: radial-gradient(circle at 30% 25%, var(--felt), var(--felt-2)); }
button.pk-row { width: 100%; text-align: start; font: inherit; color: inherit; cursor: pointer; }
.qz-hint { font: 700 15px/1.4 var(--font-b); text-align: center; color: var(--text); padding: 0 8px; }
textarea.field { min-height: 80px; resize: vertical; font: inherit; line-height: 1.5; padding: 10px 12px; }
.spy .timer .clock { text-align: center; }
.qr-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.qr { background: #fff; padding: 8px; border-radius: 12px; box-sizing: content-box; }
.qr svg { display: block; width: 100%; height: 100%; }
.welcome { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; line-height: 1.5; }
/* ---------- TV screen ---------- */
.tv { display: flex; flex-direction: column; gap: 16px; }
.tv-head { display: flex; align-items: center; gap: 14px; }
.tv-head .brand.sm { font: 900 26px var(--font-d); color: var(--gold); }
.tv-stage { min-height: 42vh; justify-content: center; }
.tv .stage-name { font-size: clamp(48px, 11vw, 150px); }
.tv .stage-name.q { font-size: clamp(28px, 4.5vw, 64px); line-height: 1.35; }
.tv .stage-lbl { font-size: clamp(16px, 2vw, 28px); }
.tv .stage-ms { font-size: clamp(16px, 2vw, 26px); }
.tv .armed-line { font-size: clamp(24px, 4vw, 56px); }
.tv .q-opts { grid-template-columns: 1fr 1fr; gap: 10px; }
.tv .q-opt { font-size: clamp(16px, 2vw, 28px); padding: 12px 16px; }
.tv .q-ans { font-size: clamp(20px, 3vw, 40px); }
.tv-lb { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.tv .lb li { font-size: clamp(16px, 1.8vw, 24px); } .tv .lb .sc { font-size: clamp(22px, 2.6vw, 36px); }
.night-card { display: flex; align-items: center; gap: 12px; text-align: start; width: 100%; font: inherit; color: inherit; cursor: pointer; }
.night-ic { font-size: 28px; }
.hist li.done { opacity: .55; } .hist li.cur { font-weight: 800; }
/* ---------- تحدّي ---------- */
:root { --g-saudi: #2E7A52; --g-sport: #3F79B0; --g-fun: #B25A74; --g-deen: #A8791F; --g-world: #2F7F7C; --g-play: #6B58B0; }
.g-saudi { --gc: var(--g-saudi); } .g-sport { --gc: var(--g-sport); } .g-fun { --gc: var(--g-fun); } .g-deen { --gc: var(--g-deen); } .g-world { --gc: var(--g-world); } .g-play { --gc: var(--g-play); }
.th-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.th-team { display: flex; flex-direction: column; gap: 4px; padding: 10px; border-radius: 16px; background: var(--surface); border: 2px solid color-mix(in srgb, var(--cc) 50%, transparent); }
.th-team .field { border-color: transparent; background: var(--raised); }
.th-slots { display: flex; flex-direction: column; gap: 6px; }
.th-slotrow { display: flex; align-items: center; gap: 6px; } .th-slotrow b { color: var(--cc); min-width: 70px; font-size: 14px; }
.th-slot { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); border: 2px dashed var(--line-2); font-size: 20px; color: var(--dim); }
.th-slot.on { border-style: solid; border-color: var(--cc); background: color-mix(in srgb, var(--cc) 14%, var(--surface)); }
.th-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; } .th-tabs::-webkit-scrollbar { display: none; } .th-tabs .chip { flex: none; }
.th-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.th-cat { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 8px 10px; border-radius: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 26%, var(--surface)), var(--surface)); border: 2px solid color-mix(in srgb, var(--gc) 35%, transparent); text-align: center; font: inherit; color: inherit; cursor: pointer; transition: transform .1s, border-color .15s; }
.th-cat:active { transform: scale(.97); }
.th-cat.on { border-color: var(--cc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cc) 25%, transparent); }
.th-cat .muted { font-size: 11.5px; line-height: 1.3; }
.th-badge { position: absolute; top: 6px; inset-inline-start: 6px; width: 24px; height: 24px; border-radius: 8px; display: grid; place-items: center; background: var(--cc); color: #fff; font: 800 13px var(--font-d); }
.th-ic { font-size: 30px; line-height: 1; }
.th-head { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; top: 0; z-index: 3; background: var(--bg); padding: 4px 0; }
.th-score { padding: 10px 14px; border-radius: 18px; background: var(--surface); border: 2px solid var(--line); display: flex; flex-direction: column; gap: 2px; transition: box-shadow .2s, border-color .2s; }
.th-score.on { border-color: var(--cc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--cc) 18%, transparent); }
.th-score .name { color: var(--cc); font-size: 15px; } .th-score .pts { font: 900 38px/1.1 var(--font-d); font-variant-numeric: tabular-nums; }
.th-hlp { display: flex; gap: 4px; } .th-hlp .hl { font-size: 12px; font-weight: 800; padding: 2px 7px; border-radius: 8px; background: var(--raised); } .th-hlp .hl.used { opacity: .25; text-decoration: line-through; }
.th-turn { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill.big { font-size: 14px; padding: 6px 14px; }
.th-helpers { display: flex; gap: 6px; }
.th-board { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.th-col { display: flex; flex-direction: column; gap: 6px; }
.th-cover { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; min-height: 64px; padding: 8px 4px; border-radius: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--gc) 45%, var(--surface)), color-mix(in srgb, var(--gc) 15%, var(--surface))); text-align: center; font-size: 11px; line-height: 1.15; }
.th-cover .th-ic { font-size: 22px; } .th-cover.sm { min-height: 0; flex-direction: row; justify-content: flex-start; padding: 8px 10px; font-size: 13px; }
.th-cell { min-height: 46px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line-2); font: 900 16px var(--font-d); color: var(--gold); cursor: pointer; font-variant-numeric: tabular-nums; transition: transform .08s, background .15s; }
.th-cell:not(:disabled):hover { background: color-mix(in srgb, var(--gold) 16%, var(--raised)); } .th-cell:not(:disabled):active { transform: scale(.95); }
.th-cell:disabled { cursor: default; }
.th-cell.done { color: #fff; background: color-mix(in srgb, var(--cc) 60%, var(--surface)); border-color: transparent; opacity: .85; }
.th-cell.blocked { opacity: .35; } .th-cell.pickable { outline: 2px dashed var(--red); }
/* full-screen stage */
.th-stage { position: fixed; inset: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: 12px; animation: stageIn .18s ease-out; }
@keyframes stageIn { from { opacity: 0; transform: scale(.98); } }
.th-qcard { width: min(100%, 860px); background: var(--surface); border: 2px solid var(--cc); border-radius: 24px; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow); }
.th-qcard.steal { animation: stagePulse 1s ease-in-out infinite; }
.th-qhead { display: flex; align-items: center; gap: 10px; margin: 0 -16px; padding: 10px 16px; border-radius: 22px 22px 0 0; background: linear-gradient(90deg, color-mix(in srgb, var(--gc) 45%, var(--surface)), color-mix(in srgb, var(--gc) 12%, var(--surface))); }
.th-qhead .th-ic { font-size: 24px; } .th-qhead b { flex: 1; font-size: 15px; } .th-tier { font: 900 20px var(--font-d); color: var(--gold); }
.th-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.th-ring { position: relative; width: 88px; height: 88px; flex: none; } .th-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.th-ring circle { fill: none; stroke-width: 9; } .th-ring .bg { stroke: var(--line); } .th-ring .fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset .1s linear; }
.th-ring.low .fg { stroke: var(--red); } .th-ring.low b { color: var(--red); }
.th-ring b { position: absolute; inset: 0; display: grid; place-items: center; font: 900 20px var(--font-d); font-variant-numeric: tabular-nums; }
.th-body { display: flex; flex-direction: column; gap: 10px; }
.th-q { font: 800 clamp(22px, 3.4vw, 34px)/1.45 var(--font-d); text-align: center; margin: 6px 0; }
.th-q.big { font-size: clamp(34px, 8vw, 72px); letter-spacing: .04em; }
.th-items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.th-items li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--raised); border: 1px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 17px; }
.th-items li.ok { border-color: var(--green-hi); }
.th-ans { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--gold) 14%, var(--surface)); border: 1px solid var(--gold); font-size: 19px; animation: stageIn .2s; }
.th-tools { flex-wrap: wrap; } .th-keys { display: none; }
.th-fly { position: fixed; z-index: 60; font: 900 34px var(--font-d); color: var(--cc); pointer-events: none; transition: transform .8s cubic-bezier(.2,.8,.2,1), opacity .8s; text-shadow: 0 2px 8px rgba(0,0,0,.4); }
.th-end { text-align: center; display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 24px; background: var(--surface); border: 1px solid var(--line-2); }
.th-bars { display: flex; flex-direction: column; gap: 8px; text-align: start; }
.th-bar { display: grid; grid-template-columns: 90px 1fr 60px; align-items: center; gap: 10px; } .th-bar b { color: var(--cc); } .th-bar i { display: block; height: 16px; border-radius: 999px; background: var(--cc); min-width: 6px; transition: width .6s; } .th-bar span { font: 900 22px var(--font-d); }
.th-cats-won { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
body.th-open { overflow: hidden; }
@media (min-width: 900px) {
  .th-board { gap: 10px; } .th-cell { min-height: 66px; font-size: 24px; } .th-cover { min-height: 88px; font-size: 14px; } .th-cover .th-ic { font-size: 30px; }
  .th-score .pts { font-size: 52px; } .th-stage { align-items: center; } .th-qcard { padding: 0 28px 24px; gap: 16px; } .th-qhead { margin: 0 -28px; padding: 14px 28px; }
  .th-ring { width: 120px; height: 120px; } .th-ring b { font-size: 26px; } .th-items li { font-size: 20px; } .th-keys { display: block; }
}
/* ---------- كلمة السر ---------- */
.cn-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.cn-card { min-height: 64px; border-radius: 14px; background: var(--cream); color: #1B150A; border: 2px solid transparent; font: 800 clamp(13px, 2.4vw, 22px) var(--font-b); padding: 6px; display: grid; place-items: center; text-align: center; overflow-wrap: anywhere; cursor: pointer; transition: transform .08s, background .15s; }
.cn-card:active { transform: scale(.97); }
.cn-card.shown, .cn-card.keyed { color: #fff; } .cn-card.k-0 { background: var(--red); } .cn-card.k-1 { background: var(--sky); } .cn-card.k-n { background: var(--sand); color: #1B150A; } .cn-card.k-x { background: #111; color: #fff; }
.cn-card.keyed.done { outline: 3px solid #fff; opacity: .55; }
.cn-card:disabled { cursor: default; }
.cn-grid.sm .cn-card { min-height: 46px; font-size: 12px; padding: 4px; }
.cn-clue { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn.c-red { background: var(--red); } .btn.c-sky { background: var(--sky); }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 99; }
@media (min-width: 900px) { .cn-card { min-height: 96px; } }

/* Gold as text needs more ink in light mode (3.9:1 otherwise); fills keep --gold. */
:root { --gold-ink: var(--gold); }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --gold-ink: #8A6114; } }
:root[data-theme="light"] { --gold-ink: #8A6114; }
.th-cell, .q-ans, .badge, .code-mini, .link-btn, .th-tier, .code-digits span { color: var(--gold-ink); }
.th-hlp .hl, .th-tier { direction: ltr; unicode-bidi: isolate; }
.th-score.on { background: color-mix(in srgb, var(--cc) 14%, var(--surface)); }
.buzz-wrap .bz-res { width: 100%; }
.giant.ok { color: #0F1F17; border-color: #fff; }
.bz.first.c-gold .bz-n, .bz.first.c-gold .bz-r, .bz.first.c-sand .bz-n, .bz.first.c-sand .bz-r, .bz.first.c-sky .bz-n, .bz.first.c-sky .bz-r { color: #1B150A; }
.stage-arm { min-height: 84px; font-size: 26px; }
.game-ic.emoji { font-family: system-ui, sans-serif; }
.scr.tahadi { padding-bottom: 120px; }
.sticky-cta .btn:disabled { opacity: .4; }
@media (min-width: 900px) { .stage-arm { min-height: 110px; font-size: 32px; } }
/* TV (1600px+): the question stage and board must read from the couch. */
@media (min-width: 1600px) {
  body.wide #app { max-width: 1500px; }
  .th-turn .pill.big { font-size: 24px; padding: 10px 22px; }
  .th-cell { min-height: 84px; font-size: 32px; } .th-cover { font-size: 18px; } .th-score .pts { font-size: 72px; }
  .th-qcard { width: min(100%, 1400px); } .th-q { font-size: clamp(28px, 3.4vw, 60px); }
  .th-ring { width: 170px; height: 170px; } .th-ring b { font-size: 40px; } .th-items li { font-size: 28px; } .th-ans { font-size: 30px; }
  .th-stage .judge .btn { min-height: 100px; font-size: 34px; }
}
/* ---------- ارسم وخمّن ---------- */
.dr-grid { display: flex; flex-direction: column; gap: 14px; }
.dr-main { order: 0; } .dr-grid > .rg:first-child { order: 1; } .dr-grid > .rg:last-child { order: 2; }
.dr-paper { position: relative; width: 100%; max-width: min(100%, 70vh); margin-inline: auto; border-radius: 16px; overflow: hidden; background: #f7f2e8; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); }
.dr-paper.sm { max-width: 320px; }
.dr-canvas { display: block; width: 100%; aspect-ratio: 1 / 1; background: #f7f2e8; touch-action: none; -webkit-user-select: none; user-select: none; cursor: crosshair; }
.dr-canvas.pen { cursor: crosshair; } .dr-canvas.mirror, .dr-canvas.frozen { cursor: default; }
.dr-over { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; background: rgba(13, 22, 19, .55); color: #F0E9DA; font: 800 clamp(18px, 3vw, 28px) var(--font-d); backdrop-filter: blur(2px); animation: pop .3s ease-out; }
.dr-over.ok { background: color-mix(in srgb, var(--green) 55%, transparent); }
.dr-head { display: flex; align-items: center; gap: 14px; justify-content: center; flex-wrap: wrap; }
.dr-tiles { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dr-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }
.dr-word { display: inline-flex; gap: 4px; }
.dr-tile { width: 30px; height: 38px; border-radius: 8px; border: 2px solid var(--line-2); background: var(--surface); display: grid; place-items: center; font: 800 20px var(--font-d); color: var(--gold); line-height: 1; }
.dr-tile.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); animation: pop .35s cubic-bezier(.2, 1.3, .4, 1); }
.dr-tiles.big .dr-tile { width: 42px; height: 54px; font-size: 30px; border-radius: 10px; }
.dr-count { font-size: 13px; color: var(--dim); font-weight: 700; }
.dr-ring { width: 72px; height: 72px; } .dr-ring b { font-size: 20px; }
.dr-stage-card { gap: 12px; }
.dr-skip { align-self: flex-end; }
.dr-pick .dr-pick-av .av { width: 84px; height: 84px; border-radius: 26px; font-size: 38px; margin-inline: auto; }
.dr-pick { align-items: center; }
.dr-side .dr-order { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.dr-side .lb li.got { border-color: var(--green-hi); background: color-mix(in srgb, var(--green) 14%, var(--surface)); }
.dr-plus { font: 900 15px var(--font-d); color: var(--green-hi); }
.dr-feed { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.dr-feed li { padding: 6px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); overflow-wrap: anywhere; animation: pop .25s ease-out; }
.dr-feed li.ok { color: var(--green-hi); border-color: color-mix(in srgb, var(--green-hi) 55%, transparent); font-weight: 800; }
.dr-feed.sm { width: 100%; font-size: 14px; } .dr-feed.sm li { padding: 4px 10px; }
.dr-feedbox .dr-feed { max-height: 60vh; overflow-y: auto; }
.dr-reveal { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.dr-reveal-txt { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.dr-got { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.dr-bar { width: 100%; max-width: 420px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.dr-bar i { display: block; height: 100%; background: var(--gold); transform-origin: right; animation: drBar linear forwards; }
[dir="ltr"] .dr-bar i { transform-origin: left; }
@keyframes drBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* phones */
.dr-phone { gap: 12px; }
.dr-top { width: 100%; display: flex; align-items: center; gap: 12px; }
.dr-top .dr-ring { flex: none; width: 58px; height: 58px; } .dr-top .dr-ring b { font-size: 17px; }
.dr-top .dr-tiles { flex: 1; align-items: flex-start; } .dr-top .dr-words { justify-content: flex-start; }
.dr-word-box { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dr-word-box .lbl { margin: 0; } .dr-word-box b { font: 900 30px/1.2 var(--font-d); color: var(--gold); overflow-wrap: anywhere; }
.dr-tools { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.dr-colors { display: flex; justify-content: space-between; gap: 4px; }
.dr-dot { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 3px solid transparent; box-shadow: 0 0 0 1px var(--line-2); flex: none; transition: transform .1s; }
.dr-dot.on { border-color: var(--text); transform: scale(1.15); }
.dr-dot.eraser { background: #f7f2e8; color: #1d1d1b; font-size: 16px; font-weight: 800; display: grid; place-items: center; }
.dr-row2 { display: flex; align-items: center; gap: 8px; }
.dr-widths { display: flex; gap: 6px; margin-inline-end: auto; }
.dr-w { width: 38px; height: 38px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-2); display: grid; place-items: center; }
.dr-w.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.dr-w i { display: block; border-radius: 50%; background: var(--text); }
.dr-clear.hold { background: var(--red); color: #fff; }
.dr-mirror-wrap { width: 100%; display: flex; align-items: center; gap: 12px; }
.dr-mirror-wrap .dr-paper { width: 42%; margin: 0; border-radius: 12px; }
.dr-guess-row { width: 100%; display: flex; gap: 8px; }
.dr-guess-row .field { flex: 1; min-width: 0; text-align: start; }
.dr-guess-row .btn { flex: none; }
.dr-close { min-height: 20px; color: var(--gold); opacity: 0; transition: opacity .2s; }
.dr-close.on { opacity: 1; animation: pop .3s ease-out; }
.dr-mine { font-size: 18px; }
@media (min-width: 900px) {
  .dr-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr) 270px; gap: 18px; align-items: start; }
  .dr-grid > .rg:first-child, .dr-grid > .rg:last-child, .dr-main { order: 0; }
  .dr-side, .dr-feedbox { position: sticky; top: 10px; }
  .dr-stage-card { padding: 18px; min-height: 0; }
  .dr-paper { max-width: min(100%, calc(100vh - 260px)); }
  .dr-ring { width: 96px; height: 96px; } .dr-ring b { font-size: 26px; }
  .dr-tiles.big .dr-tile { width: 50px; height: 64px; font-size: 36px; }
}
