/* تحدّي الديوانية — نفس هوية «المافيا»: ليل الديوانية، أسود وذهبي وأحمر */
:root {
  --ink: #07080d;
  --s1: rgba(28, 28, 34, .86);
  --s2: rgba(38, 38, 46, .9);
  --s3: #34343d;
  --label: #f6f2ea;
  --label2: rgba(246, 242, 234, .72);
  --label3: rgba(246, 242, 234, .46);
  --sep: rgba(243, 238, 228, .1);
  --gold: #d9b675;
  --gold-hi: #f0d69d;
  --tint: #e0263f;
  --tint-press: #b81c33;
  --ice: #8cc4e6;
  --ok: #3dc266;
  --amber: #f08a3c;
  --t0: #e0263f;
  --t1: #8cc4e6;
  --r1: 10px; --r2: 14px; --r3: 20px; --r4: 28px;
  --display: 'Lalezar', 'Tajawal', system-ui, sans-serif;
  --body: 'Tajawal', system-ui, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--ink); color: var(--label); font-family: var(--body); font-size: 16px;
  -webkit-tap-highlight-color: transparent; overflow-x: hidden;
}
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2;
  background: url(bg.webp) center 30% / cover no-repeat;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: radial-gradient(120% 90% at 50% 0%, rgba(7,8,13,.55), rgba(7,8,13,.92) 70%), linear-gradient(180deg, rgba(7,8,13,.35), rgba(7,8,13,.95));
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
button:disabled { opacity: .38; cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
a { color: var(--gold); }

.app { max-width: 1440px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) clamp(14px, 3vw, 44px) 28px; min-height: 100dvh; display: flex; flex-direction: column; }

/* ===== الشعار والهيدر ===== */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--label); }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #17210f; transform: rotate(-6deg); box-shadow: 0 8px 22px -10px rgba(217,182,117,.7); }
.brand-name { font-family: var(--display); font-size: 26px; line-height: 1; letter-spacing: .2px; }
.brand-name b { color: var(--gold); font-weight: normal; }
.meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--sep); background: rgba(255,255,255,.05); border-radius: 999px; padding: 5px 12px; font-size: 13px; color: var(--label2); white-space: nowrap; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px rgba(61,194,102,.18); }
.chip.off .dot { background: var(--amber); box-shadow: 0 0 0 3px rgba(240,138,60,.18); animation: blink 1s infinite; }
.chip.code { font-family: ui-monospace, monospace; letter-spacing: 3px; color: var(--gold); font-weight: 700; direction: ltr; }
@keyframes blink { 50% { opacity: .35; } }

/* ===== عناصر عامة ===== */
.card { background: var(--s1); border: 1px solid var(--sep); border-radius: var(--r4); padding: clamp(16px, 2.2vw, 28px); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 30px 60px -40px rgba(0,0,0,.9); }
.h1 { font-family: var(--display); font-weight: normal; font-size: clamp(36px, 6vw, 72px); line-height: 1.25; margin: 0; text-shadow: 0 6px 30px rgba(0,0,0,.6); }
.h1 em { font-style: normal; color: var(--gold); }
.h2 { font-family: var(--display); font-weight: normal; font-size: clamp(24px, 3vw, 36px); margin: 0 0 8px; }
.h3 { font-weight: 800; font-size: 18px; margin: 0 0 8px; }
.muted { color: var(--label2); }
.dim { color: var(--label3); font-size: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.stack { display: grid; gap: 12px; }
.center { text-align: center; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 22px; border-radius: var(--r2); font-weight: 800; font-size: 17px; transition: transform .15s var(--ease), filter .15s; user-select: none; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn-gold { color: #17210f; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 10px 26px -10px rgba(217,182,117,.6), inset 0 1px 0 rgba(255,255,255,.45); }
.btn-red { color: #fff; background: var(--tint); box-shadow: 0 10px 26px -12px rgba(224,38,63,.8); }
.btn-ok { color: #06210f; background: linear-gradient(180deg, #6fe08f, var(--ok)); box-shadow: 0 10px 26px -12px rgba(61,194,102,.8); }
.btn-ghost { color: var(--label); background: rgba(255,255,255,.07); border: 1px solid var(--sep); }
.btn-sm { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: var(--r1); }
.btn-xl { min-height: 76px; font-size: 24px; border-radius: var(--r3); }
.btn-block { width: 100%; }
.input { width: 100%; min-height: 50px; border-radius: var(--r2); border: 1px solid var(--sep); background: rgba(0,0,0,.35); padding: 10px 14px; color: var(--label); font-size: 17px; }
.input::placeholder { color: var(--label3); }
.input.code { text-align: center; letter-spacing: 8px; font-family: ui-monospace, monospace; font-size: 26px; text-transform: uppercase; direction: ltr; }

/* ===== الصفحة الأولى ===== */
.landing { flex: 1; display: grid; place-items: center; text-align: center; padding: 4vh 0; }
.landing .hero { max-width: 760px; display: grid; gap: 18px; justify-items: center; }
.eyebrow { color: var(--gold); font-weight: 800; font-size: 14px; letter-spacing: .3px; display: inline-flex; gap: 8px; align-items: center; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--gold); }
.landing .actions { display: grid; gap: 12px; width: min(440px, 100%); margin-top: 8px; }
.landing .join { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.facts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 6px; }

/* ===== لوبي الهوست ===== */
.lobby { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.step { position: relative; }
.step .num { position: absolute; top: -12px; inset-inline-start: 18px; background: var(--gold); color: #17210f; border-radius: 999px; padding: 2px 12px; font-weight: 900; font-size: 13px; }
.step.done { border-color: rgba(61,194,102,.4); }
.step.locked { opacity: .45; }
.qr { background: #fff; border-radius: 18px; padding: 10px; width: min(230px, 70vw); aspect-ratio: 1; margin: 10px auto; }
.qr svg { width: 100%; height: 100%; display: block; }
.status-list { display: grid; gap: 8px; margin-top: 10px; }
.status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r2); background: rgba(255,255,255,.04); border: 1px solid var(--sep); }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--s3); flex: none; }
.status.on .dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(61,194,102,.18); }
.status.joined .dot { background: var(--amber); }
.cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0 14px; }
.cat { text-align: start; padding: 11px 12px; border-radius: var(--r2); border: 1px solid var(--sep); background: rgba(255,255,255,.04); font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; transition: background .15s, border-color .15s; }
.cat .tick { width: 22px; height: 22px; border-radius: 7px; border: 2px solid var(--label3); flex: none; display: grid; place-items: center; font-size: 13px; color: #17210f; }
.cat.on { border-color: var(--gold); background: rgba(217,182,117,.14); }
.cat.on .tick { background: var(--gold); border-color: var(--gold); }
.counter { font-family: var(--display); font-size: 22px; color: var(--gold); }

/* ===== لوحة المباراة (التلفزيون) ===== */
.stage { display: grid; grid-template-columns: minmax(170px, 260px) minmax(0, 1fr) minmax(170px, 260px); gap: clamp(10px, 1.6vw, 22px); align-items: stretch; flex: 1; }
.team { border-radius: var(--r4); padding: 18px 14px; display: grid; align-content: center; justify-items: center; gap: 6px; background: var(--s1); border: 2px solid var(--sep); text-align: center; position: relative; transition: border-color .3s, box-shadow .3s, transform .3s var(--ease); backdrop-filter: blur(14px); }
.team .tname { font-family: var(--display); font-size: clamp(20px, 2.2vw, 32px); line-height: 1.2; word-break: break-word; }
.team .score { font-family: var(--display); font-size: clamp(44px, 6vw, 92px); line-height: 1; direction: ltr; }
.team.t0 .tname { color: var(--t0); }
.team.t1 .tname { color: var(--t1); }
.team.turn.t0 { border-color: var(--t0); box-shadow: 0 0 0 6px rgba(224,38,63,.15), 0 20px 60px -20px rgba(224,38,63,.6); transform: translateY(-4px); }
.team.turn.t1 { border-color: var(--t1); box-shadow: 0 0 0 6px rgba(140,196,230,.15), 0 20px 60px -20px rgba(140,196,230,.6); transform: translateY(-4px); }
.team .turn-tag { position: absolute; top: -13px; border-radius: 999px; padding: 3px 12px; font-weight: 900; font-size: 13px; color: #fff; }
.team.t0 .turn-tag { background: var(--t0); }
.team.t1 .turn-tag { background: var(--t1); color: #06131c; }
.team .off { font-size: 12px; color: var(--amber); }
.strikes { display: flex; gap: 6px; margin-top: 6px; direction: ltr; }
.strikes span { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; border: 2px solid var(--s3); color: var(--s3); font-size: 18px; }
.strikes span.hit { border-color: var(--tint); background: var(--tint); color: #fff; animation: pop .35s var(--ease); }
@keyframes pop { from { transform: scale(1.6); } }
.delta { position: absolute; top: 30%; font-family: var(--display); font-size: 40px; animation: floatup 1.6s var(--ease) forwards; pointer-events: none; }
.delta.plus { color: var(--ok); } .delta.minus { color: var(--tint); }
@keyframes floatup { from { opacity: 0; transform: translateY(20px) scale(.8); } 20% { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-60px); } }

.board { display: grid; grid-template-rows: auto 1fr auto; gap: 12px; min-width: 0; }
.phase-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.phase-name { font-family: var(--display); font-size: clamp(22px, 2.6vw, 34px); color: var(--gold); }
.progress { height: 6px; border-radius: 6px; background: rgba(255,255,255,.08); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-hi)); border-radius: 6px; transition: width .6s var(--ease); }
.qcard { position: relative; display: grid; align-content: center; justify-items: center; gap: 16px; text-align: center; min-height: 340px; }
.qtext { font-weight: 800; font-size: clamp(24px, 3.4vw, 50px); line-height: 1.45; margin: 0; max-width: 30ch; text-wrap: balance; }
.qtext.small { font-size: clamp(20px, 2.6vw, 36px); }
.art { width: min(620px, 100%); }
.art svg { width: 100%; height: auto; display: block; border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
.bigline { font-family: var(--display); font-size: clamp(30px, 4.6vw, 64px); line-height: 1.3; }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; font-weight: 900; font-size: 15px; }
.badge.gold { background: rgba(217,182,117,.16); color: var(--gold); border: 1px solid rgba(217,182,117,.4); }
.badge.red { background: rgba(224,38,63,.16); color: #ff8a96; border: 1px solid rgba(224,38,63,.4); }
.badge.t0 { background: rgba(224,38,63,.18); color: #ff9aa6; }
.badge.t1 { background: rgba(140,196,230,.18); color: var(--t1); }
.turnline { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: clamp(16px, 1.8vw, 22px); color: var(--label2); }
.live { width: 10px; height: 10px; border-radius: 50%; background: var(--tint); animation: blink 1s infinite; }
.answer-reveal { display: grid; gap: 4px; justify-items: center; animation: rise .5s var(--ease); }
.answer-reveal small { color: var(--label3); font-weight: 700; }
.answer-reveal b { font-family: var(--display); font-weight: normal; font-size: clamp(30px, 4vw, 56px); color: var(--gold); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }
.result-banner { font-family: var(--display); font-size: clamp(26px, 3.6vw, 48px); padding: 8px 24px; border-radius: var(--r3); animation: rise .45s var(--ease); }
.result-banner.ok { background: rgba(61,194,102,.14); color: #8ff0ad; border: 1px solid rgba(61,194,102,.4); }
.result-banner.none { background: rgba(255,255,255,.06); color: var(--label2); border: 1px solid var(--sep); }

/* المؤقت */
.timer { --p: 1; width: clamp(96px, 11vw, 150px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255,255,255,.08) 0); position: relative; }
.timer::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: #121218; }
.timer b { position: relative; font-family: var(--display); font-size: clamp(38px, 4.5vw, 62px); font-weight: normal; direction: ltr; }
.timer.warn { background: conic-gradient(var(--tint) calc(var(--p) * 360deg), rgba(255,255,255,.08) 0); }
.timer.warn b { color: #ff8a96; animation: blink .5s infinite; }
.timer.paused b { color: var(--label3); animation: none; }
.timer.sm { width: 74px; }
.timer.sm::before { inset: 6px; }
.timer.sm b { font-size: 30px; }

/* اللستة */
.list-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; width: 100%; max-width: 980px; }
.slot { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--r2); background: rgba(255,255,255,.05); border: 1px solid var(--sep); min-height: 54px; text-align: start; }
.slot b { font-family: var(--display); font-size: 24px; font-weight: normal; color: var(--label3); text-align: center; }
.slot span { font-weight: 800; font-size: clamp(16px, 1.7vw, 22px); color: var(--label3); letter-spacing: 2px; }
.slot strong { font-weight: 900; color: var(--label3); direction: ltr; }
.slot.on span { letter-spacing: 0; color: var(--label); animation: flip .5s var(--ease); }
.slot.on strong { color: var(--gold); }
.slot.on.t0 { border-color: rgba(224,38,63,.6); background: rgba(224,38,63,.12); }
.slot.on.t1 { border-color: rgba(140,196,230,.6); background: rgba(140,196,230,.12); }
.slot.on.tn { border-color: var(--sep); background: rgba(255,255,255,.08); }
.slot.on.tn span { color: var(--label2); }
@keyframes flip { from { transform: rotateX(90deg); opacity: 0; } }
.penalties { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.flash { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.flash span { font-family: var(--display); font-size: clamp(60px, 10vw, 140px); animation: stamp 1.3s var(--ease) forwards; text-shadow: 0 10px 50px rgba(0,0,0,.8); }
.flash .wrong { color: var(--tint); }
.flash .good { color: var(--ok); }
@keyframes stamp { 0% { opacity: 0; transform: scale(2.2); } 15% { opacity: 1; transform: scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: scale(.9); } }
.chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; max-width: 900px; }
.chips span { padding: 7px 14px; border-radius: 999px; font-weight: 800; animation: rise .4s var(--ease); }
.chips .t0 { background: rgba(224,38,63,.2); color: #ffb3bb; }
.chips .t1 { background: rgba(140,196,230,.2); color: #cbe7f8; }

/* الفاصل بين الفقرات */
.intro { display: grid; gap: 10px; justify-items: center; }
.intro .pnum { font-family: var(--display); color: var(--label3); font-size: 22px; }
.intro .pname { font-family: var(--display); font-size: clamp(48px, 8vw, 110px); line-height: 1.1; color: var(--gold); text-shadow: 0 10px 50px rgba(217,182,117,.25); animation: rise .6s var(--ease); }
.phase-dots { display: flex; gap: 6px; justify-content: center; }
.phase-dots i { width: 28px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.12); }
.phase-dots i.done { background: var(--gold); }
.phase-dots i.now { background: var(--gold-hi); box-shadow: 0 0 12px var(--gold); }

/* النهاية */
.final { flex: 1; display: grid; place-items: center; text-align: center; gap: 18px; }
.final .scores { display: flex; gap: clamp(14px, 4vw, 60px); justify-content: center; align-items: stretch; flex-wrap: wrap; }
.final .team { min-width: 220px; }
.final .team.win { border-color: var(--gold); box-shadow: 0 0 0 8px rgba(217,182,117,.15), 0 30px 80px -20px rgba(217,182,117,.6); }
.crown { font-size: 46px; position: absolute; top: -34px; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ===== لوحة الهوست ===== */
.host-fab { position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 30; opacity: .85; }
.host-fab:hover { opacity: 1; }
.sticky-verdict { position: sticky; bottom: 10px; z-index: 5; filter: drop-shadow(0 10px 20px rgba(0,0,0,.7)); }
.drawer { position: fixed; inset-block: 0; inset-inline-start: 0; width: min(420px, 94vw); z-index: 40; background: rgba(16,16,20,.97); border-inline-end: 1px solid var(--sep); padding: 18px; overflow-y: auto; transform: translateX(110%); transition: transform .35s var(--ease); box-shadow: 0 0 80px rgba(0,0,0,.8); }
[dir=rtl] .drawer { transform: translateX(110%); }
.drawer.open { transform: none; }
.drawer section { border-top: 1px solid var(--sep); padding: 14px 0; display: grid; gap: 10px; }
.drawer h4 { margin: 0; font-size: 15px; color: var(--gold); }
.adj { display: grid; grid-template-columns: 1fr repeat(3, auto); gap: 6px; align-items: center; }
.adj .name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 35; }

/* ===== تلفون الحكم ===== */
.phone { max-width: 620px; width: 100%; margin: 0 auto; display: grid; gap: 12px; }
.ref-head { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.ref-head .ph { font-family: var(--display); font-size: 24px; color: var(--gold); line-height: 1.2; }
.ref-head .sub { color: var(--label2); font-size: 14px; }
.secret { border: 1px dashed rgba(217,182,117,.5); background: rgba(217,182,117,.07); }
.secret .lbl { font-size: 12px; font-weight: 900; color: var(--gold); letter-spacing: .5px; }
.secret .ans { font-family: var(--display); font-size: 32px; color: var(--gold-hi); line-height: 1.3; }
.secret .alts { color: var(--label2); font-size: 14px; }
.verdict { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.verdict .btn { min-height: 92px; font-size: 26px; border-radius: var(--r3); }
.items { display: grid; gap: 7px; }
.item { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 8px; text-align: start; padding: 12px; border-radius: var(--r2); background: rgba(255,255,255,.06); border: 1px solid var(--sep); font-weight: 800; font-size: 17px; min-height: 54px; }
.item b { font-family: var(--display); font-weight: normal; color: var(--label3); text-align: center; font-size: 20px; }
.item small { display: block; font-weight: 500; color: var(--label3); font-size: 12px; }
.item em { font-style: normal; font-weight: 900; direction: ltr; color: var(--ok); }
.item.neg em { color: var(--tint); }
.item.neg { border-color: rgba(224,38,63,.3); }
.item.used { opacity: .35; text-decoration: line-through; }
.item:not(:disabled):active { background: rgba(217,182,117,.2); }
.split { border: 0; border-top: 1px solid var(--sep); margin: 4px 0; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar .btn { flex: 1; }

/* ===== تلفون الفريق ===== */
.team-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.team-head .me { font-family: var(--display); font-size: 28px; }
.team-head .me.t0 { color: var(--t0); } .team-head .me.t1 { color: var(--t1); }
.mini-scores { display: flex; gap: 8px; }
.mini-scores span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.06); font-weight: 800; }
.buzz { width: min(78vw, 340px); aspect-ratio: 1; border-radius: 50%; margin: 10px auto; display: grid; place-items: center; font-family: var(--display); font-size: clamp(38px, 11vw, 56px); color: #fff; background: radial-gradient(circle at 50% 35%, #ff5d73, var(--tint) 55%, var(--tint-press)); box-shadow: 0 18px 0 #7d1022, 0 30px 60px -10px rgba(224,38,63,.7), inset 0 6px 18px rgba(255,255,255,.35); transition: transform .08s, box-shadow .08s; touch-action: manipulation; }
.buzz:active:not(:disabled) { transform: translateY(14px); box-shadow: 0 4px 0 #7d1022, 0 10px 30px -10px rgba(224,38,63,.7), inset 0 6px 18px rgba(255,255,255,.35); }
.buzz:disabled { filter: grayscale(.9) brightness(.55); opacity: 1; }
.big-msg { text-align: center; display: grid; gap: 10px; justify-items: center; padding: 18px 6px; }
.big-msg .t { font-family: var(--display); font-size: 34px; line-height: 1.3; }
.secret-word { font-family: var(--display); font-size: 46px; color: var(--gold-hi); text-align: center; padding: 16px; border-radius: var(--r3); background: rgba(217,182,117,.1); border: 1px dashed rgba(217,182,117,.5); }

/* ===== نافذة التأكيد والتنبيه ===== */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0,0,0,.65); padding: 20px; }
.modal .card { max-width: 420px; width: 100%; text-align: center; display: grid; gap: 14px; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 70; background: rgba(20,20,26,.96); border: 1px solid var(--sep); border-radius: 999px; padding: 12px 20px; font-weight: 700; box-shadow: 0 10px 40px rgba(0,0,0,.6); max-width: 92vw; text-align: center; animation: rise .3s var(--ease); }
.toast.err { border-color: rgba(224,38,63,.6); }

/* ===== Powered by Rakaz ===== */
.rkz-wrap { text-align: center; margin: 22px 0 4px; }
.rkz { display: inline-flex; align-items: center; gap: 9px; direction: ltr; text-decoration: none; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 7px 15px 7px 13px; transition: transform .25s cubic-bezier(.2,.8,.2,1); position: relative; overflow: hidden; }
.rkz span { font-family: system-ui, sans-serif; font-size: 11.5px; letter-spacing: .4px; color: #b9bcc6; font-weight: 500; }
.rkz img { height: 16px; width: auto; display: block; }
.rkz::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(45,124,255,.18) 50%, transparent 70%); transform: translateX(-120%); transition: transform .8s ease; }
.rkz:hover { transform: translateY(-2px); }
.rkz:hover::after { transform: translateX(120%); }

/* ===== شاشات صغيرة ===== */
@media (max-width: 980px) {
  .lobby { grid-template-columns: 1fr; }
  .stage { grid-template-columns: 1fr 1fr; }
  .stage .board { grid-column: 1 / -1; grid-row: 2; }
  .team .score { font-size: 44px; }
  .qcard { min-height: 260px; }
  .list-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 21px; }
  .brand-mark { width: 34px; height: 34px; }
  .cats { grid-template-columns: 1fr; }
}
/* التلفزيون: كل شي أكبر */
@media (min-width: 1700px) {
  .app { max-width: 1840px; }
  .stage { grid-template-columns: 320px 1fr 320px; }
}

/* =====================================================================
   النسخة ٢ — تصميم الاستوديو: لوحة نتيجة فوق، وكرت السؤال ياخذ الشاشة كلها
   ===================================================================== */
/* أجواء: وهج ذهبي يتحرك بهدوء + فانوسين */
.app::before { content: ""; position: fixed; inset: -20%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 30% at 18% 12%, rgba(217,182,117,.16), transparent 70%),
    radial-gradient(34% 28% at 84% 18%, rgba(224,38,63,.12), transparent 70%),
    radial-gradient(50% 40% at 50% 105%, rgba(140,196,230,.10), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { to { transform: translate3d(2%, -2%, 0) scale(1.06); } }
.app.on-air::after { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; box-shadow: inset 0 0 220px 40px rgba(0,0,0,.75); }

/* الشعار الكبير */
.wordmark { font-family: var(--display); line-height: .95; display: grid; justify-items: center; filter: drop-shadow(0 14px 40px rgba(0,0,0,.7)); }
.wordmark span { font-size: clamp(34px, 6vw, 64px); color: var(--label); letter-spacing: 1px; }
.wordmark b { font-weight: normal; font-size: clamp(64px, 13vw, 150px);
  background: linear-gradient(100deg, #b98f4d 0%, #f6e3b4 28%, #d9b675 50%, #fff3d2 68%, #b98f4d 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 5s linear infinite; }
@keyframes shine { to { background-position: -220% 0; } }
.h1.sub { font-size: clamp(20px, 2.6vw, 32px); font-family: var(--body); font-weight: 800; letter-spacing: 0; color: var(--label2); }

/* المسرح */
.stage { display: grid; grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; gap: clamp(10px, 1.4vw, 18px); flex: 1; align-items: stretch; }
.scorebar { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: clamp(8px, 1.4vw, 20px); align-items: stretch; }
.plate { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: clamp(10px, 1.2vw, 18px) clamp(14px, 2vw, 30px); border-radius: var(--r4);
  background: linear-gradient(180deg, rgba(34,34,42,.92), rgba(18,18,24,.92)); border: 2px solid var(--sep); backdrop-filter: blur(14px); overflow: hidden;
  transition: border-color .3s, box-shadow .3s, transform .3s var(--ease); min-width: 0; }
.plate::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 8px; }
.plate.t0::before { background: linear-gradient(180deg, #ff6b7f, var(--t0)); }
.plate.t1::before { background: linear-gradient(180deg, #c9e8fa, var(--t1)); }
.plate.t1 { flex-direction: row-reverse; }
.plate.t1::before { inset-inline-start: auto; inset-inline-end: 0; }
.plate.t1 .plate-info { text-align: end; justify-items: end; }
.plate.t1 .plate-sub { flex-direction: row-reverse; }
.plate-info { display: grid; gap: 4px; min-width: 0; }
.plate .tname { font-family: var(--display); font-size: clamp(20px, 2.6vw, 40px); line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate.t0 .tname { color: #ff8a98; } .plate.t1 .tname { color: var(--t1); }
.plate .lead { font-style: normal; font-size: .7em; margin-inline-end: 6px; }
.plate-sub { display: flex; align-items: center; gap: 8px; min-height: 26px; flex-wrap: wrap; }
.plate .score { font-family: var(--display); font-size: clamp(40px, 5.4vw, 84px); line-height: 1; direction: ltr; text-shadow: 0 6px 24px rgba(0,0,0,.6); font-variant-numeric: tabular-nums; }
.plate .turn-tag { border-radius: 999px; padding: 2px 12px; font-weight: 900; font-size: 13px; color: #fff; animation: pulse 1.2s ease-in-out infinite; }
.plate.t0 .turn-tag { background: var(--t0); } .plate.t1 .turn-tag { background: var(--t1); color: #06131c; }
.plate .off { font-size: 12px; color: var(--amber); }
.plate .strikes { margin: 0; } .plate .strikes span { width: 26px; height: 26px; font-size: 14px; border-radius: 7px; }
.plate.turn.t0 { border-color: var(--t0); box-shadow: 0 0 0 5px rgba(224,38,63,.16), 0 18px 60px -18px rgba(224,38,63,.8); transform: translateY(-3px); }
.plate.turn.t1 { border-color: var(--t1); box-shadow: 0 0 0 5px rgba(140,196,230,.16), 0 18px 60px -18px rgba(140,196,230,.8); transform: translateY(-3px); }
.plate .delta { top: 8%; inset-inline-end: 34%; font-size: 34px; }
@keyframes pulse { 50% { transform: scale(1.08); } }
.mid { display: grid; justify-items: center; align-content: center; gap: 6px; padding: 0 clamp(4px, 1vw, 16px); text-align: center; }
.mid .phase-name { font-size: clamp(22px, 2.8vw, 40px); line-height: 1.1;
  background: linear-gradient(100deg, #b98f4d, #f6e3b4 40%, #d9b675 60%, #b98f4d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.mid-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.mid .phase-dots i { width: 22px; height: 5px; }

/* كرت السؤال: إطار ذهبي */
.qcard { min-height: 0; border: 1.5px solid transparent; padding: clamp(18px, 3vw, 44px);
  background: linear-gradient(180deg, rgba(26,26,32,.94), rgba(14,14,19,.94)) padding-box,
              linear-gradient(140deg, rgba(240,214,157,.9), rgba(217,182,117,.12) 30%, rgba(217,182,117,.08) 70%, rgba(240,214,157,.7)) border-box;
  box-shadow: 0 40px 90px -40px rgba(0,0,0,.95), inset 0 1px 0 rgba(255,255,255,.05); transition: box-shadow .4s; }
.qcard.glow-t0 { box-shadow: 0 40px 90px -40px rgba(0,0,0,.95), 0 0 80px -30px rgba(224,38,63,.75); }
.qcard.glow-t1 { box-shadow: 0 40px 90px -40px rgba(0,0,0,.95), 0 0 80px -30px rgba(140,196,230,.75); }
.qtext { font-size: clamp(26px, 4.2vw, 64px); max-width: 26ch; animation: rise .5s var(--ease); }
.qtext.small { font-size: clamp(20px, 2.8vw, 40px); max-width: 34ch; }
.art { width: min(680px, 100%, 62vh); animation: zoomin .6s var(--ease); }
@keyframes zoomin { from { opacity: 0; transform: scale(.9); } }
.intro .pname { font-size: clamp(56px, 10vw, 150px);
  background: linear-gradient(100deg, #b98f4d 0%, #f6e3b4 28%, #d9b675 50%, #fff3d2 68%, #b98f4d 100%); background-size: 220% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent; animation: shine 4s linear infinite, rise .6s var(--ease); text-shadow: none; filter: drop-shadow(0 12px 40px rgba(217,182,117,.25)); }
.timer { box-shadow: 0 0 40px -8px rgba(217,182,117,.55); }
.timer.warn { box-shadow: 0 0 50px -6px rgba(224,38,63,.8); animation: pulse .5s ease-in-out infinite; }
.progress { height: 5px; }
.list-grid { max-width: 1180px; }
.slot { min-height: clamp(48px, 5.4vh, 64px); }
.slot.on { box-shadow: 0 10px 30px -18px rgba(0,0,0,.9); }
.flash .bz { font-size: clamp(54px, 9vw, 130px); }
.flash .bt0 { color: #ff8a98; text-shadow: 0 0 60px rgba(224,38,63,.9); }
.flash .bt1 { color: var(--t1); text-shadow: 0 0 60px rgba(140,196,230,.9); }
.result-banner { box-shadow: 0 20px 50px -24px rgba(0,0,0,.9); }
.trophy { font-size: clamp(60px, 9vw, 110px); animation: rise .8s var(--ease), pulse 2.4s ease-in-out infinite; filter: drop-shadow(0 10px 40px rgba(217,182,117,.6)); }
.final .team.win { transform: scale(1.08); }

/* التلفونات: كل فريق بلونه */
.app.team-t0 { --team: var(--t0); } .app.team-t1 { --team: var(--t1); }
.app.role-team::after { content: ""; position: fixed; inset-inline: 0; top: 0; height: 5px; background: var(--team); z-index: 20; box-shadow: 0 0 30px 6px var(--team); }
.app.role-team .card { border-color: color-mix(in srgb, var(--team) 35%, transparent); }
.app.role-referee::after { content: ""; position: fixed; inset-inline: 0; top: 0; height: 5px; background: var(--gold); z-index: 20; box-shadow: 0 0 30px 6px rgba(217,182,117,.7); }
.buzz:not(:disabled) { animation: buzzpulse 1.4s ease-in-out infinite; }
@keyframes buzzpulse { 0%,100% { box-shadow: 0 18px 0 #7d1022, 0 30px 60px -10px rgba(224,38,63,.7), inset 0 6px 18px rgba(255,255,255,.35), 0 0 0 0 rgba(224,38,63,.5); } 50% { box-shadow: 0 18px 0 #7d1022, 0 30px 60px -10px rgba(224,38,63,.7), inset 0 6px 18px rgba(255,255,255,.35), 0 0 0 26px rgba(224,38,63,0); } }
.verdict .btn:active:not(:disabled) { transform: scale(.94); }

@media (max-width: 980px) {
  .stage { grid-template-columns: 1fr; }
  .scorebar { grid-template-columns: 1fr 1fr; }
  .scorebar .mid { grid-column: 1 / -1; grid-row: 1; }
  .plate .score { font-size: 40px; }
}
@media (min-width: 1700px) { .stage { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; } }
.input.code::placeholder { letter-spacing: 0; font-family: var(--body); font-size: 17px; text-transform: none; }

/* =====================================================================
   النسخة ٣ — ألوان فاتحة (طلب ١٥ نوفمبر): رملي فاتح، كحلي، ذهبي غامق
   ===================================================================== */
:root {
  --ink: #f5efe3;
  --s1: rgba(255, 255, 255, .9);
  --s2: #ffffff;
  --s3: #ded5c4;
  --label: #1c1f2a;
  --label2: rgba(28, 31, 42, .74);
  --label3: rgba(28, 31, 42, .5);
  --sep: rgba(28, 31, 42, .12);
  --gold: #b07f2c;
  --gold-hi: #e5bb62;
  --tint: #d22b42;
  --tint-press: #ab1f33;
  --ice: #2a78b5;
  --ok: #1e9c4b;
  --amber: #d4731a;
  --t0: #d22b42;
  --t1: #2a78b5;
}
body { background: var(--ink); color: var(--label); }
body::before { background: radial-gradient(70% 60% at 15% 0%, #fff8ea, transparent 70%), radial-gradient(60% 50% at 90% 10%, #fde9ec, transparent 70%), radial-gradient(70% 60% at 50% 110%, #e6f1fa, transparent 70%), #f5efe3; }
body::after { background: none; }
.app::before { opacity: .55; }
.app.on-air::after { box-shadow: none; }
.card { box-shadow: 0 24px 50px -36px rgba(40,30,10,.45); }
.h1 { text-shadow: none; }
.btn-gold { color: #fff; background: linear-gradient(180deg, #d4a24a, var(--gold)); box-shadow: 0 10px 24px -12px rgba(176,127,44,.7), inset 0 1px 0 rgba(255,255,255,.35); }
.btn-ok { color: #fff; background: linear-gradient(180deg, #2fb862, var(--ok)); }
.btn-ghost { color: var(--label); background: #fff; border: 1px solid var(--sep); }
.input { background: #fff; color: var(--label); }
.step .num { color: #fff; }
.qr { box-shadow: 0 0 0 1px var(--sep); }
.status, .cat, .slot, .item, .result-banner.none, .mini-scores span { background: rgba(28,31,42,.04); }
.cat .tick { color: #fff; }
.cat.on { background: rgba(176,127,44,.12); }
.progress, .phase-dots i { background: rgba(28,31,42,.1); }
.badge.red { color: #b0182d; background: rgba(210,43,66,.1); }
.badge.t0 { color: #b0182d; background: rgba(210,43,66,.12); }
.badge.t1 { color: #1d5f93; background: rgba(42,120,181,.12); }
.badge.gold { color: #8a6120; background: rgba(176,127,44,.12); }
.result-banner.ok { color: #157a39; background: rgba(30,156,75,.1); }
.timer { background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(28,31,42,.1) 0); box-shadow: 0 10px 30px -14px rgba(176,127,44,.6); }
.timer::before { background: #fff; }
.timer.warn { background: conic-gradient(var(--tint) calc(var(--p) * 360deg), rgba(28,31,42,.1) 0); }
.timer.warn b { color: var(--tint); }
.slot.on.tn { background: rgba(28,31,42,.06); }
.flash span { text-shadow: 0 10px 40px rgba(40,30,10,.25); }
.chips .t0 { background: rgba(210,43,66,.12); color: #a31529; }
.chips .t1 { background: rgba(42,120,181,.12); color: #1d5f93; }
.sticky-verdict { filter: drop-shadow(0 10px 18px rgba(40,30,10,.25)); }
.drawer { background: rgba(251,248,241,.98); box-shadow: 0 0 60px rgba(40,30,10,.25); }
.backdrop { background: rgba(28,31,42,.3); }
.modal { background: rgba(28,31,42,.45); }
.toast { background: #1c1f2a; color: #fff; }
.rkz { background: #fff; border-color: #dfe6f7; }
.rkz span { color: #5b6785; }
.wordmark { filter: none; }
.wordmark b, .intro .pname, .mid .phase-name { background-image: linear-gradient(100deg, #8a5d17 0%, #d9a648 30%, #a8762a 55%, #e2b768 75%, #8a5d17 100%); }
.intro .pname { filter: none; }
.plate { background: #fff; box-shadow: 0 18px 40px -30px rgba(40,30,10,.5); }
.plate.t0 .tname { color: var(--t0); }
.plate .score { text-shadow: none; color: var(--label); }
.plate.t1 .turn-tag { color: #fff; }
.plate.turn.t0 { box-shadow: 0 0 0 5px rgba(210,43,66,.12), 0 18px 40px -18px rgba(210,43,66,.55); }
.plate.turn.t1 { box-shadow: 0 0 0 5px rgba(42,120,181,.12), 0 18px 40px -18px rgba(42,120,181,.55); }
.qcard { background: linear-gradient(180deg, #ffffff, #fdfaf3) padding-box, linear-gradient(140deg, rgba(229,187,98,.95), rgba(176,127,44,.18) 30%, rgba(176,127,44,.12) 70%, rgba(229,187,98,.8)) border-box;
  box-shadow: 0 30px 70px -40px rgba(40,30,10,.45); }
.qcard.glow-t0 { box-shadow: 0 30px 70px -40px rgba(40,30,10,.45), 0 0 60px -26px rgba(210,43,66,.55); }
.qcard.glow-t1 { box-shadow: 0 30px 70px -40px rgba(40,30,10,.45), 0 0 60px -26px rgba(42,120,181,.55); }
.art svg { box-shadow: 0 24px 50px -30px rgba(40,30,10,.5); }
.slot.on { box-shadow: 0 10px 24px -18px rgba(40,30,10,.5); }
.flash .bt0 { color: var(--t0); text-shadow: 0 0 40px rgba(210,43,66,.4); }
.flash .bt1 { color: var(--t1); text-shadow: 0 0 40px rgba(42,120,181,.4); }
.result-banner { box-shadow: 0 16px 36px -26px rgba(40,30,10,.45); }
.app.role-referee::after { box-shadow: 0 0 20px 3px rgba(176,127,44,.45); }

/* جديد: أسماء الفرق باللوبي، التلميحات، باركود الممثل، أزرار الحكم */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.vs b { font-family: var(--display); font-weight: normal; color: var(--label3); }
.vs-team { text-align: center; padding: 14px 10px; border-radius: var(--r3); border: 2px dashed var(--sep); font-family: var(--display); font-size: clamp(20px, 2.4vw, 30px); color: var(--label3); }
.vs-team.on { border-style: solid; color: #fff; }
.vs-team.on.t0 { background: var(--t0); border-color: var(--t0); }
.vs-team.on.t1 { background: var(--t1); border-color: var(--t1); }
.plate .hints { font-size: 18px; letter-spacing: 2px; }
.plate .hints i { font-style: normal; opacity: .22; filter: grayscale(1); }
.slot .hint { font-style: normal; font-weight: 700; font-size: .82em; color: #8a6120; }
.actor-qr { display: grid; justify-items: center; gap: 4px; }
.actor-qr .qr { width: min(240px, 34vh); margin: 4px auto; }
.actor-qr p { margin: 0; text-align: center; line-height: 1.8; }
.buzz-t { min-height: 92px; font-family: var(--display); font-size: 26px; color: #fff; border-radius: var(--r3); }
.buzz-t.t0 { background: var(--t0); } .buzz-t.t1 { background: var(--t1); }
.input.t0in { border-inline-start: 6px solid var(--t0); } .input.t1in { border-inline-start: 6px solid var(--t1); }
.lbl.center { display: block; text-align: center; }
.secret-word { color: #8a6120; background: rgba(176,127,44,.1); border-color: rgba(176,127,44,.45); }
.lbl { font-size: 13px; font-weight: 900; color: var(--gold); }
.secret .ans { color: #8a6120; }

/* ===== السؤال كلمة كلمة + رمز الديوانية ===== */
.qtext.reveal .w{opacity:0;transform:translateY(8px);display:inline-block;transition:opacity .25s ease,transform .25s ease}
.qtext.reveal .w.on{opacity:1;transform:none}
.qtext.reveal.stopped .w.on:last-of-type,.qtext.reveal.stopped .w.on:has(+ .w:not(.on)){border-bottom:3px solid var(--gold,#c9a227)}
.modal .h3{white-space:pre-line;line-height:1.8}
.diwan-box{display:grid;gap:8px;text-align:center;width:min(420px,100%);margin:0 auto}
.diwan-input{font:inherit;font-size:24px;letter-spacing:6px;text-align:center;text-transform:uppercase;padding:10px;border-radius:12px;border:1px solid #d5dcec;background:#fff}
.diwan-note{display:grid;gap:6px;text-align:center}
.diwan-note b{font-size:28px;letter-spacing:6px}

/* =====================================================================
   v4 — ألوان جديدة (بنفسجي ملكي + كهرماني) + شعارات الفئات والفقرات
   ===================================================================== */
:root {
  --ink: #f4f2ff;
  --label: #1a1640;
  --label2: rgba(26, 22, 64, .72);
  --label3: rgba(26, 22, 64, .48);
  --sep: rgba(26, 22, 64, .1);
  --gold: #5b3df5;
  --gold-hi: #9d8cff;
  --amber: #ffad1f;
  --tint: #f0435a;
  --tint-press: #d02c43;
  --t0: #f0435a;
  --t1: #1e8bff;
  --ice: #1e8bff;
  --ok: #12a150;
  --vio-grad: linear-gradient(135deg, #6a4bff 0%, #8b3dff 45%, #d94dd0 100%);
}
body::before { background:
  radial-gradient(55% 45% at 8% 0%, rgba(124, 92, 255, .22), transparent 70%),
  radial-gradient(45% 40% at 100% 8%, rgba(255, 173, 31, .2), transparent 70%),
  radial-gradient(60% 50% at 50% 110%, rgba(30, 139, 255, .14), transparent 70%), #f4f2ff; }
.card { box-shadow: 0 24px 50px -36px rgba(40, 20, 120, .45); border-color: rgba(91, 61, 245, .1); }
.btn-gold { color: #fff; background: var(--vio-grad); box-shadow: 0 14px 30px -14px rgba(91, 61, 245, .8), inset 0 1px 0 rgba(255,255,255,.3); }
.btn-gold:hover { filter: brightness(1.06); }
.brand-mark { background: var(--vio-grad) !important; color: #fff; }
.brand-name b { color: var(--gold); }
.wordmark b, .intro .pname, .mid .phase-name { background-image: linear-gradient(100deg, #5b3df5 0%, #9b3dff 35%, #e04fbf 65%, #ffad1f 100%); }
.lbl { color: var(--gold); }
.cat.on { background: rgba(91, 61, 245, .1); border-color: rgba(91, 61, 245, .45); }
.cat .tick { background: var(--gold); }
.badge.gold { color: #4a2fd6; background: rgba(91, 61, 245, .1); }
.timer { background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(26,22,64,.08) 0); box-shadow: 0 10px 30px -14px rgba(91,61,245,.6); }
.qcard { background: linear-gradient(180deg, #ffffff, #faf8ff) padding-box, linear-gradient(140deg, rgba(124,92,255,.9), rgba(124,92,255,.12) 30%, rgba(255,173,31,.15) 70%, rgba(255,173,31,.85)) border-box;
  box-shadow: 0 30px 70px -40px rgba(40,20,120,.45); }
.slot .hint, .secret .ans, .secret-word { color: #4a2fd6; }
.secret-word { background: rgba(91,61,245,.08); border-color: rgba(91,61,245,.35); }
.eyebrow { color: #4a2fd6; }
.eyebrow::before { background: var(--amber); }
.app.role-referee::after { box-shadow: 0 0 20px 3px rgba(91,61,245,.4); }
.drawer { background: rgba(250, 249, 255, .98); }
.qtext.reveal.stopped .w.on:last-of-type, .qtext.reveal.stopped .w.on:has(+ .w:not(.on)) { border-bottom-color: var(--amber); }

/* ===== الشعارات ===== */
.ico { --hue: #5b3df5; display: inline-grid; place-items: center; flex: none; width: 1.6em; height: 1.6em; border-radius: 30%;
  color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--hue) 78%, #fff), var(--hue));
  box-shadow: 0 6px 14px -8px var(--hue), inset 0 1px 0 rgba(255,255,255,.35); vertical-align: middle; }
.ico svg { width: 62%; height: 62%; }
.ico.xs { width: 22px; height: 22px; border-radius: 7px; }
.ico.sm { width: 30px; height: 30px; border-radius: 9px; }
.ico.md { width: 52px; height: 52px; border-radius: 16px; }
.ico.lg { width: clamp(70px, 8vw, 104px); height: clamp(70px, 8vw, 104px); border-radius: 26px; }
.ico.xl { width: clamp(88px, 10vw, 132px); height: clamp(88px, 10vw, 132px); border-radius: 32px; box-shadow: 0 24px 50px -20px var(--hue), inset 0 1px 0 rgba(255,255,255,.35); }
.ico.pop { animation: icoPop .7s var(--ease) both; }
@keyframes icoPop { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
.cat { display: inline-flex; align-items: center; gap: 8px; }
.chip .ico, .sub .ico { margin-inline-end: 4px; }
.chip .ico.sm, .mid-chips .ico.sm { width: 22px; height: 22px; border-radius: 7px; }
.mid .phase-name { display: inline-flex; align-items: center; gap: 10px; }
.mid .phase-name .ico { -webkit-text-fill-color: initial; }
.ref-head .ph { display: flex; align-items: center; gap: 8px; }
.intro .ico { margin-bottom: 4px; }

/* ===== الصفحة الأولى v4 ===== */
.landing.v4 { display: grid; gap: 34px; justify-items: center; padding: 3vh 0 2vh; }
.landing.v4 .hero { position: relative; display: grid; gap: 16px; justify-items: center; max-width: 760px; padding-top: 70px; }
.landing.v4 .wordmark { font-size: clamp(64px, 11vw, 132px); line-height: .95; }
.landing.v4 .lead { margin: 0; font-size: clamp(17px, 1.8vw, 21px); line-height: 1.9; color: var(--label2); }
.orbit { position: absolute; top: 0; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; }
.orbit span { animation: bob 3.2s ease-in-out infinite; animation-delay: calc(var(--i) * -.6s); }
.orbit span:nth-child(odd) .ico { transform: rotate(-8deg); }
.orbit span:nth-child(even) .ico { transform: rotate(8deg) translateY(10px); }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -8px; } }
.cta { display: grid; gap: 12px; width: min(420px, 100%); margin-top: 6px; }
.cta .btn-xl { font-size: 22px; min-height: 66px; }
.diwan-box { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; text-align: start; padding: 10px 14px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid var(--sep); }
.diwan-box label { font-weight: 800; font-size: 14px; color: var(--label2); }
.diwan-box small { font-weight: 500; color: var(--label3); }
.diwan-box .hint { grid-column: 1 / -1; font-size: 12.5px; color: var(--label3); }
.diwan-input { font: inherit; font-weight: 800; font-size: 18px; letter-spacing: 5px; text-align: center; text-transform: uppercase; padding: 8px; border-radius: 10px; border: 1px solid var(--sep); background: #fff; color: var(--label); width: 100%; }
.diwan-input:focus { outline: 2px solid rgba(91,61,245,.45); }
.ph-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; width: min(900px, 100%); }
.ph-card { position: relative; display: grid; justify-items: center; gap: 10px; padding: 20px 10px 16px; border-radius: 22px; background: #fff;
  border: 1px solid color-mix(in srgb, var(--hue) 22%, transparent); box-shadow: 0 18px 36px -28px var(--hue);
  animation: icoPop .6s var(--ease) both; animation-delay: var(--d); }
.ph-card b { font-family: var(--display); font-weight: normal; font-size: 21px; color: var(--hue); }
.ph-n { position: absolute; top: 10px; inset-inline-start: 12px; font-weight: 900; font-size: 13px; color: var(--label3); }
.cat-cloud { display: grid; gap: 12px; justify-items: center; width: min(900px, 100%); }
.cat-cloud > div { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.cat-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border-radius: 999px; background: #fff; border: 1px solid var(--sep); font-weight: 700; font-size: 14.5px; }
@media (max-width: 720px) { .ph-row { grid-template-columns: repeat(3, 1fr); } .orbit .ico.md { width: 40px; height: 40px; border-radius: 12px; } .landing.v4 .hero { padding-top: 56px; } }

/* ===== باركود الفريقين ===== */
.team-qrs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.team-qr { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 18px; border: 2px dashed var(--sep); text-align: center; }
.team-qr .qr { width: min(150px, 100%); }
.team-qr b { font-family: var(--display); font-weight: normal; font-size: 22px; }
.team-qr.t0 b { color: var(--t0); } .team-qr.t1 b { color: var(--t1); }
.team-qr.on { border-style: solid; }
.team-qr.on.t0 { border-color: var(--t0); background: rgba(240,67,90,.06); } .team-qr.on.t1 { border-color: var(--t1); background: rgba(30,139,255,.06); }
.team-qr .joined { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 30px; color: #fff; }
.team-qr.t0 .joined { background: var(--t0); } .team-qr.t1 .joined { background: var(--t1); }
.vs-b { font-style: normal; font-family: var(--display); color: var(--label3); }
.join-card { gap: 14px; display: grid; justify-items: center; }
.join-tag { padding: 4px 14px; border-radius: 999px; color: #fff; font-weight: 800; font-size: 14px; }
.join-card.t0 .join-tag { background: var(--t0); } .join-card.t1 .join-tag { background: var(--t1); }
.field { font: inherit; font-size: 20px; width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--sep); background: #fff; text-align: center; }

.cat .tick { background: transparent; border: 2px solid var(--sep); }
.cat.on .tick { background: var(--gold); border-color: var(--gold); }
.diwan-note { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--sep); font-size: 13px; color: var(--label3); }
.diwan-note b { font-size: 17px; letter-spacing: 4px; color: var(--label); }

/* =====================================================================
   v5 — هوية راقية: بورسلين فاتح + حبر كحلي + كهرماني، عناصر ثلاثية الأبعاد وحركة هادية
   ===================================================================== */
:root {
  --ink: #f4f2ed;
  --label: #151826;
  --label2: rgba(21, 24, 38, .7);
  --label3: rgba(21, 24, 38, .45);
  --sep: rgba(21, 24, 38, .09);
  --gold: #1b2238;
  --gold-hi: #f2a33a;
  --amber: #f2a33a;
  --tint: #e8564c;
  --tint-press: #c9433a;
  --t0: #e8564c;
  --t1: #3f74c9;
  --ice: #3f74c9;
  --ok: #2f9e6a;
  --navy-grad: linear-gradient(180deg, #2a3455 0%, #1b2238 55%, #121829 100%);
  --amber-grad: linear-gradient(180deg, #ffd27a 0%, #f2a33a 55%, #d9841c 100%);
}
body::before { background:
  radial-gradient(60% 50% at 50% -10%, #ffffff 0%, transparent 70%),
  radial-gradient(40% 35% at 0% 100%, rgba(242,163,58,.10), transparent 70%),
  radial-gradient(40% 35% at 100% 100%, rgba(63,116,201,.08), transparent 70%), #f4f2ed; }
.card { background: #fff; border: 1px solid rgba(21,24,38,.06); box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 20px 40px -30px rgba(21,24,38,.35); }
.btn { transition: transform .18s var(--ease), box-shadow .18s var(--ease), filter .18s; }
.btn-gold { color: #fff; background: var(--navy-grad); border: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 5px 0 #0b0f1c, 0 18px 30px -16px rgba(21,24,38,.7); }
.btn-gold:hover { filter: brightness(1.08); }
.btn-gold:active { transform: translateY(4px); box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 1px 0 #0b0f1c, 0 8px 16px -12px rgba(21,24,38,.7); }
.btn-gold:disabled { filter: grayscale(.4) opacity(.45); }
.btn-ghost { background: #fff; border: 1px solid var(--sep); box-shadow: 0 3px 0 rgba(21,24,38,.08); }
.brand-mark { background: var(--amber-grad) !important; color: #1b2238 !important; box-shadow: inset 0 1px 0 rgba(255,255,255,.6), 0 3px 0 #b86d14 !important; }
.brand-name b { color: #d9841c; }
.wordmark span { color: var(--label); }
.wordmark b, .intro .pname, .mid .phase-name { background-image: linear-gradient(180deg, #ffc65c 0%, #f2a33a 50%, #d9781c 100%); }
.wordmark b { filter: drop-shadow(0 1px 0 #c76e12) drop-shadow(0 2px 0 #b5620e) drop-shadow(0 3px 0 #a3570c) drop-shadow(0 14px 18px rgba(176,98,14,.35)); }
.intro .pname { filter: drop-shadow(0 2px 0 #b5620e) drop-shadow(0 10px 14px rgba(176,98,14,.3)); }
.lbl, .eyebrow { color: #b8701a; }
.eyebrow::before { background: var(--amber); }
.badge.gold { color: #1b2238; background: rgba(242,163,58,.18); }
.cat.on { background: rgba(242,163,58,.12); border-color: rgba(242,163,58,.55); }
.cat.on .tick { background: var(--amber); border-color: var(--amber); color: #1b2238; }
.step .num { background: var(--navy-grad); }
.timer { background: conic-gradient(var(--amber) calc(var(--p) * 360deg), rgba(21,24,38,.08) 0); box-shadow: 0 10px 30px -14px rgba(242,163,58,.7); }
.qcard { background: #fff; border: 1px solid rgba(21,24,38,.06); box-shadow: 0 2px 0 rgba(255,255,255,.9) inset, 0 34px 70px -44px rgba(21,24,38,.45); }
.slot .hint, .secret .ans, .secret-word { color: #b8701a; }
.secret-word { background: rgba(242,163,58,.1); border-color: rgba(242,163,58,.45); }
.app.role-referee::after { box-shadow: 0 0 20px 3px rgba(242,163,58,.45); }
.qtext.reveal.stopped .w.on:last-of-type, .qtext.reveal.stopped .w.on:has(+ .w:not(.on)) { border-bottom-color: var(--amber); }
.diwan-input:focus, .field:focus { outline: 2px solid rgba(242,163,58,.6); }

/* ===== الشعارات بشكل ثلاثي الأبعاد ===== */
.ico { color: #fff; background: linear-gradient(165deg, color-mix(in srgb, var(--hue) 55%, #fff) 0%, var(--hue) 48%, color-mix(in srgb, var(--hue) 82%, #000) 100%);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), inset 0 -3px 0 rgba(0,0,0,.16), 0 3px 0 color-mix(in srgb, var(--hue) 62%, #000), 0 12px 20px -10px color-mix(in srgb, var(--hue) 70%, transparent); }
.ico svg { filter: drop-shadow(0 1.5px 0 rgba(0,0,0,.22)); stroke-width: 2; }
.ico.d3 { width: 74px; height: 74px; border-radius: 22px;
  box-shadow: inset 0 3px 0 rgba(255,255,255,.5), inset 0 -4px 0 rgba(0,0,0,.16), 0 6px 0 color-mix(in srgb, var(--hue) 62%, #000), 0 22px 30px -14px color-mix(in srgb, var(--hue) 75%, transparent); }
.ico.xl, .ico.lg { box-shadow: inset 0 4px 0 rgba(255,255,255,.5), inset 0 -5px 0 rgba(0,0,0,.16), 0 8px 0 color-mix(in srgb, var(--hue) 62%, #000), 0 30px 40px -18px color-mix(in srgb, var(--hue) 75%, transparent); }
.ico.pop { animation: icoDrop .8s var(--ease) both; }
@keyframes icoDrop { 0% { transform: translateY(-28px) scale(.7); opacity: 0; } 60% { transform: translateY(4px) scale(1.04); opacity: 1; } 100% { transform: none; } }

/* ===== الصفحة الأولى v5 ===== */
.landing.v5 { display: grid; gap: 40px; justify-items: center; padding: 2vh 0 1vh; }
.landing.v5 .hero { display: grid; gap: 14px; justify-items: center; max-width: 720px; }
.landing.v5 .wordmark { font-size: clamp(60px, 10vw, 124px); line-height: .98; animation: rise .8s var(--ease) .1s both; }
.landing.v5 .lead { margin: 2px 0 0; font-size: clamp(16px, 1.6vw, 19px); letter-spacing: .2px; color: var(--label2); font-weight: 600; animation: rise .8s var(--ease) .2s both; }
.landing.v5 .cta { display: grid; gap: 12px; width: min(380px, 100%); margin-top: 12px; animation: rise .8s var(--ease) .3s both; }
.landing.v5 .cta .btn-xl { min-height: 64px; font-size: 21px; border-radius: 18px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.landing.v5 .diwan-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 16px; background: rgba(255,255,255,.7); border: 1px solid var(--sep); cursor: text; }
.landing.v5 .diwan-box span { font-weight: 700; font-size: 14px; color: var(--label2); white-space: nowrap; }
.landing.v5 .diwan-box small { font-weight: 500; color: var(--label3); margin-inline-start: 4px; }
.landing.v5 .diwan-input { width: 150px; font-size: 16px; padding: 7px; }
/* زر «أبي أجاوب» ثلاثي الأبعاد */
.emblem { position: relative; width: 150px; height: 120px; margin-bottom: 4px; animation: rise .8s var(--ease) both; }
.buzzer { position: absolute; inset: 0; animation: press 3.6s var(--ease) 1.2s infinite; }
.buzzer i { position: absolute; left: 50%; transform: translateX(-50%); border-radius: 50%; }
.buzzer .base { bottom: 6px; width: 140px; height: 46px; background: linear-gradient(180deg, #2a3455, #121829); box-shadow: 0 16px 24px -10px rgba(21,24,38,.55), inset 0 2px 0 rgba(255,255,255,.12); }
.buzzer .ring { bottom: 22px; width: 116px; height: 38px; background: var(--amber-grad); box-shadow: inset 0 2px 0 rgba(255,255,255,.55), 0 3px 0 #b86d14; z-index: 1; }
.buzzer .cap { bottom: 30px; width: 92px; height: 62px; border-radius: 50% 50% 46% 46% / 62% 62% 38% 38%; z-index: 2; transition: transform .2s;
  background: radial-gradient(60% 50% at 38% 28%, #ff9b8d 0%, #e8564c 45%, #b3362e 100%); box-shadow: inset 0 -6px 10px rgba(110,20,15,.35), 0 4px 0 #9c2f28; }
.buzzer .shine { bottom: 66px; width: 34px; height: 12px; margin-left: -14px; background: rgba(255,255,255,.65); filter: blur(1.5px); z-index: 3; transform: translateX(-50%) rotate(-16deg); }
@keyframes press { 0%, 84%, 100% { transform: none; } 88% { transform: translateY(6px) scaleY(.94); } 92% { transform: translateY(-2px); } }
.spark { position: absolute; width: 10px; height: 10px; border-radius: 3px; background: var(--amber); opacity: 0; animation: spark 3.6s ease-out 1.2s infinite; }
.spark.s1 { top: 18px; left: 6px; --dx: -22px; --dy: -14px; }
.spark.s2 { top: 4px; left: 68px; --dx: 0; --dy: -24px; background: #e8564c; width: 8px; height: 8px; }
.spark.s3 { top: 18px; right: 6px; --dx: 22px; --dy: -14px; background: #3f74c9; }
@keyframes spark { 0%, 86% { opacity: 0; transform: none; } 90% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(45deg); } }
/* كروت الفقرات */
.landing.v5 .ph-row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; width: min(1040px, 100%); perspective: 900px; }
.landing.v5 .ph-card { position: relative; display: grid; justify-items: center; gap: 14px; padding: 26px 10px 20px; border-radius: 24px; background: #fff;
  border: 1px solid rgba(21,24,38,.06); box-shadow: 0 1px 0 #fff inset, 0 4px 0 rgba(21,24,38,.05), 0 24px 40px -30px rgba(21,24,38,.4);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease); animation: rise .7s var(--ease) both; animation-delay: var(--d); transform-style: preserve-3d; }
.landing.v5 .ph-card .ico { transform: translateZ(30px); }
.landing.v5 .ph-card b { font-family: var(--display); font-weight: normal; font-size: 21px; color: var(--label); }
.landing.v5 .ph-card .ph-n { position: static; font-weight: 800; font-size: 12px; color: var(--label3); }
.landing.v5 .ph-card.tilting { box-shadow: 0 1px 0 #fff inset, 0 4px 0 rgba(21,24,38,.05), 0 34px 50px -30px color-mix(in srgb, var(--hue) 60%, transparent); }
@media (max-width: 720px) { .landing.v5 .ph-row { grid-template-columns: repeat(3, 1fr); gap: 10px; } .ico.d3 { width: 58px; height: 58px; border-radius: 18px; } }
@media (prefers-reduced-motion: reduce) { .buzzer, .spark, .landing.v5 * { animation: none !important; } }

/* ===== واجهة الحكم v6 ===== */
.ref-head2 { display: grid; gap: 10px; padding: 14px; position: sticky; top: 6px; z-index: 5; }
.ref-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ref-top .ph { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 20px; }
.ref-top .ph small { font-family: var(--body); font-size: 13px; font-weight: 700; color: var(--label3); }
.ref-scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ref-score { display: grid; justify-items: center; gap: 2px; padding: 8px; border-radius: 14px; background: rgba(21,24,38,.04); border: 2px solid transparent; }
.ref-score b { font-size: 14px; } .ref-score span { font-family: var(--display); font-size: 26px; line-height: 1; }
.ref-score.t0 b { color: var(--t0); } .ref-score.t1 b { color: var(--t1); }
.ref-score.on.t0 { border-color: var(--t0); background: rgba(232,86,76,.08); } .ref-score.on.t1 { border-color: var(--t1); background: rgba(63,116,201,.08); }
.ref-x { font-style: normal; display: flex; gap: 4px; } .ref-x em { font-style: normal; font-weight: 900; color: rgba(21,24,38,.18); } .ref-x em.hit { color: var(--tint); }
.ref-turn { text-align: center; padding: 10px; border-radius: 14px; color: #fff; font-size: 17px; }
.ref-turn.t0 { background: var(--t0); } .ref-turn.t1 { background: var(--t1); }
.ref-turn small { opacity: .85; font-size: 12.5px; }
.ref-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ref-tools .btn { min-height: 48px; }
.ref-edit .adj { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ref-edit .name { flex: 1 1 100%; font-weight: 800; }
.verdict .btn { min-height: 76px; font-size: 24px; }
@media (max-width: 900px) { .landing.v5 .ph-row { grid-template-columns: repeat(3, 1fr); gap: 10px; } }

.brand-logo { width: 46px; height: auto; display: block; filter: drop-shadow(0 4px 6px rgba(21,24,38,.25)); transition: transform .2s var(--ease); }
.brand:hover .brand-logo { transform: translateY(1px) scale(.97); }
@media (max-width: 720px) { .brand-logo { width: 38px; } }

/* ===== صفحة الفئات: أقسام وبطاقات بصور ===== */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; margin-top: 10px; }
.cgrid.sections { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.ccard { position: relative; display: grid; justify-items: center; align-content: start; gap: 8px; padding: 10px 10px 14px; border-radius: 20px; background: #fff;
  border: 2px solid rgba(21,24,38,.06); box-shadow: 0 3px 0 rgba(21,24,38,.05), 0 16px 30px -24px rgba(21,24,38,.45); font: inherit; color: var(--label); cursor: pointer;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s; text-align: center; }
.ccard:hover { transform: translateY(-3px); }
.ccard:active { transform: translateY(1px); }
.ccard b { font-size: 15px; line-height: 1.35; }
.ccard small { font-size: 11.5px; color: var(--label3); font-weight: 600; }
.ccard.on { border-color: var(--amber); box-shadow: 0 0 0 4px rgba(242,163,58,.18), 0 16px 30px -22px rgba(242,163,58,.7); }
.ccard.soon { cursor: default; opacity: .55; filter: grayscale(.6); }
.ccard.soon:hover { transform: none; }
.cimg { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; border-radius: 14px; overflow: hidden;
  background: radial-gradient(80% 70% at 50% 35%, color-mix(in srgb, var(--hue) 22%, #fff), color-mix(in srgb, var(--hue) 10%, #f4f2ed)); }
.cimg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ctick { position: absolute; top: 8px; inset-inline-end: 8px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center;
  background: var(--amber); color: #1b2238; font-weight: 900; box-shadow: 0 3px 0 #b86d14; z-index: 2; }
.csoon { position: absolute; top: 8px; inset-inline-start: 8px; padding: 3px 10px; border-radius: 999px; background: #1b2238; color: #fff; font-size: 11px; font-weight: 800; z-index: 2; }
.csec-head { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.csec-head b { font-family: var(--display); font-weight: normal; font-size: 22px; }
.cpicked { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.cpicked .chip { cursor: pointer; background: rgba(242,163,58,.14); border: 1px solid rgba(242,163,58,.45); font: inherit; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.cthumb { position: relative; display: inline-grid; vertical-align: middle; }
.cthumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 8px; }
@media (max-width: 520px) { .cgrid, .cgrid.sections { grid-template-columns: repeat(2, 1fr); gap: 10px; } }

/* ===== الصفحة الثانية: الفئات واسم اللعبة ===== */
.setup { width: min(1100px, 100%); margin: 0 auto; padding: 8px 0 170px; display: grid; gap: 22px; }
.setup-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.field.search { max-width: 340px; font-size: 16px; padding: 12px 16px; text-align: start; }
.setup-sec h3 { margin: 0 0 10px; font-family: var(--display); font-weight: normal; font-size: 24px; display: flex; align-items: center; gap: 10px; }
.setup-sec h3::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, rgba(242,163,58,.5)); }
.cgrid.small { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 0; }
.cgrid.small .ccard b { font-size: 14px; }
.setup-bar { position: fixed; z-index: 30; bottom: 12px; left: 50%; transform: translateX(-50%); width: min(560px, calc(100% - 24px)); display: grid; gap: 10px;
  padding: 14px; border-radius: 22px; background: rgba(255,255,255,.94); backdrop-filter: blur(10px); box-shadow: 0 20px 50px -20px rgba(21,24,38,.45); border: 1px solid var(--sep); }
.setup-count { text-align: center; font-weight: 800; font-size: 16px; color: var(--label2); }
.setup-count b { font-size: 22px; color: var(--tint); }
.setup-count.full b { color: var(--ok); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets .chip { cursor: pointer; font: inherit; font-weight: 700; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--sep); }
@media (max-width: 520px) { .cgrid.small { grid-template-columns: repeat(3, 1fr); gap: 8px; } .cgrid.small .ccard { padding: 6px 6px 10px; } .cgrid.small .ccard b { font-size: 12px; } }

/* ===== الصفحة الثالثة: أكواد الدخول (شوش: كبيرة وواضحة) ===== */
.lobby3 { width: min(1200px, 100%); margin: 0 auto; display: grid; gap: 18px; }
.lobby-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.room-code { text-align: center; } .room-code b { display: block; font-size: 32px; letter-spacing: 6px; }
.join-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.join-box { display: grid; justify-items: center; gap: 12px; padding: 18px 16px 20px; border-radius: 26px; background: #fff; border: 4px solid var(--c); box-shadow: 0 20px 44px -26px var(--c); }
.join-box.ref { --c: #f07a1a; } .join-box.t0 { --c: var(--t0); } .join-box.t1 { --c: var(--t1); }
.join-title { width: 100%; text-align: center; padding: 10px; border-radius: 16px; background: var(--c); color: #fff; font-family: var(--display); font-size: clamp(22px, 2.4vw, 32px); }
.join-box .qr { width: min(260px, 100%); }
.join-box .joined { width: 160px; height: 160px; border-radius: 50%; display: grid; place-items: center; font-size: 80px; color: #fff; background: var(--c); }
.join-box .joined.wait { background: rgba(21,24,38,.06); color: var(--label3); }
.join-box.ok { background: color-mix(in srgb, var(--c) 7%, #fff); }
.join-sub { font-size: 16px; color: var(--label2); text-align: center; }
.lobby-foot { display: grid; gap: 10px; }
.lobby-cats { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.lobby-cats .chip { display: inline-flex; align-items: center; gap: 6px; }
.cthumb.xs { width: 22px; height: 22px; }
.ref-ready { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 17px; }
.ref-ready i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: rgba(21,24,38,.08); }
.ref-ready.ok i { background: var(--ok); color: #fff; }
@media (max-width: 860px) { .join-row { grid-template-columns: 1fr; } }

/* صور فقرة «الصورة» المصورة */
.art img.artimg { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; display: block; border-radius: 22px; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9); }
