* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #061a1e; color: var(--text); font-family: var(--txt); }
#stage { position: absolute; top: 50%; left: 50%; width: 1920px; height: 1080px; transform-origin: center; overflow: hidden; background: var(--bg); }
[hidden] { display: none !important; }
html.prefit #stage { visibility: hidden; }   /* حتى أول fit في tv.js */
.scr { position: absolute; inset: 0; padding: 40px 60px; }
.center { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 30px; text-align: center; }
.logo { font-size: 150px; font-weight: 800; }
.logo span { color: var(--brand-text); font-family: var(--num); }
.sub { font-size: 44px; color: var(--muted); margin: 0; }
h1 { margin: 0; font-size: 80px; font-weight: 800; }

.pair { display: grid; grid-template-columns: 1fr 1fr; align-items: center; text-align: center; gap: 60px; }
.pair p { font-size: 48px; color: var(--muted); margin: 20px 0 0; }
.code { font-family: var(--num); font-size: 150px; letter-spacing: 24px; color: var(--brand-text); direction: ltr; display: block; }
.qrbox { display: flex; justify-content: center; }
#qr { width: 600px; height: 600px; border-radius: 32px; background: #fff; }

.vs { display: flex; align-items: center; gap: 60px; font-size: 90px; font-weight: 800; }
.vs b { color: var(--tct); } .vs span { color: var(--muted); font-size: 50px; }
.turnpill { font-size: 54px; font-weight: 800; padding: 16px 50px; border-radius: 99px; background: var(--tc); color: var(--on-color); margin: 0; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; max-width: 1600px; }
.chipcat { font-size: 52px; padding: 22px 40px; border-radius: 24px; background: var(--panel); border: 5px solid var(--tc, var(--brand)); }
.noms { display: flex; gap: 60px; }
.nom { font-size: 64px; font-weight: 800; padding: 50px 70px; border-radius: 32px; background: var(--panel); border: 6px solid var(--tc); min-width: 600px; transition: opacity .3s, transform .3s; }
.nom.flash { background: var(--tc); color: var(--on-color); }
.nom.win { background: var(--tc); color: var(--on-color); transform: scale(1.08); }
.nom.lose { opacity: .3; }

.q { display: flex; flex-direction: column; gap: 18px; padding: 30px 50px 36px; }
.qhead { display: flex; align-items: center; gap: 20px; height: 70px; }
.chip { font-size: 32px; padding: 8px 26px; border-radius: 99px; background: var(--panel); color: var(--muted); }
.timer { margin-inline-start: auto; font-family: var(--num); font-size: 44px; font-weight: 800; padding: 6px 30px; border-radius: 99px; background: var(--warn); color: var(--on-color); }
.timer:empty { display: none; }
.timer.low { background: var(--bad); color: #fff; animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.08); } }
.qtitle { text-align: center; font-size: 66px; line-height: 1.25; }
.mid { flex: 1; display: grid; grid-template-columns: 300px 1fr 300px; gap: 36px; align-items: center; min-height: 0; }
.team { height: 440px; border-radius: 32px; background: var(--panel); border: 6px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 20px; transition: transform .3s; }
.team.on { border-color: var(--tc); transform: scale(1.05); box-shadow: 0 0 60px rgba(0, 0, 0, .4); }
.team .tn { font-size: 42px; font-weight: 800; color: var(--tct); }
.team .ts { font-family: var(--num); font-size: 96px; font-weight: 800; }
.team .tturn { font-size: 30px; color: var(--brand-text); min-height: 40px; }
.team .tlife { font-size: 26px; color: var(--muted); }
.board { display: grid; grid-template-rows: repeat(5, 1fr); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 16px 24px; height: 100%; max-height: 600px; perspective: 1400px; }
.slot { border-radius: 20px; display: flex; align-items: center; gap: 18px; padding: 0 22px; font-size: 40px; }
.slot .rank { font-family: var(--num); width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--used); color: var(--brand-text); font-size: 38px; flex: none; }
.slot .nm { flex: 1; font-weight: 800; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.05; }
.slot .nm small { display: block; font-size: 26px; font-weight: 500; opacity: .8; margin-top: 4px; }
.slot .pts { font-family: var(--num); font-size: 44px; flex: none; }
.slot.hid { background: var(--panel); border: 4px solid var(--line); color: var(--muted); }
.slot.open { background: var(--tc); color: var(--on-color); }
.slot.open .rank { background: rgba(0, 0, 0, .25); color: var(--on-color); }
.slot.none { background: #dfeaeb; color: var(--on-color); opacity: .75; }
.slot.flip { animation: flip 280ms cubic-bezier(.2, .8, .2, 1); }
@keyframes flip { 0% { transform: rotateX(90deg);  } 60% { transform: rotateX(-12deg); } 100% { transform: none; } }
.traps { display: flex; justify-content: center; align-items: center; gap: 18px; font-size: 32px; }
.traps .tl { color: var(--muted); }
.trap { padding: 8px 26px; border-radius: 16px; border: 3px dashed var(--bad); color: var(--muted); font-family: var(--num); }
.trap.open { border-style: solid; color: var(--text); font-family: var(--txt); }
.trap.hit { background: var(--bad); color: #fff; }
.status { height: 90px; display: flex; align-items: center; justify-content: center; font-size: 44px; font-weight: 800; border-radius: 24px; background: var(--panel); color: var(--tct, var(--text)); padding: 0 30px; }
.status.hint { background: var(--hint); color: var(--on-color); }
.status.pass { background: var(--action); color: var(--on-color); }

.winner { font-size: 120px; }
.finals { display: flex; gap: 60px; }
.fin { min-width: 480px; padding: 30px; border-radius: 32px; background: var(--panel); border: 4px solid var(--tc); display: flex; flex-direction: column; gap: 10px; }
.fin span { font-size: 50px; font-weight: 800; color: var(--tct); }
.fin b { font-family: var(--num); font-size: 120px; }
.fin.win { border-width: 10px; }
.moments { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; max-width: 1700px; }
.moments span { font-size: 34px; background: var(--panel); border-radius: 18px; padding: 12px 26px; color: var(--muted); }

.overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: rgba(0, 0, 0, .55); pointer-events: none; }
.overlay b { font-size: 170px; font-weight: 800; }
.overlay span { font-size: 64px; font-weight: 800; }
.ov-trap b { color: #ff5a7e; } .ov-pass b { color: var(--action); } .ov-wrong b { color: var(--bad); font-size: 360px; line-height: 1; }
/* الطبقة كلها تتلاشى فقط، والتكبير على الرمز والنص (صغيرين): تكبير طبقة بحجم المسرح كاملاً مرتين ورا بعض («غلط» مرتين)
   كان يستنفد ذاكرة سفاري الآيفون فتنعاد الصفحة (بلاغ المالك 2026-10-18) */
.overlay.go { animation: ovfade 1.9s ease forwards; }
.overlay.go b, .overlay.go span { animation: ovpop 1.9s ease forwards; }
@keyframes ovfade { 0% { opacity: 0; } 12% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ovpop { 0% { transform: scale(1.3); } 12%, 100% { transform: none; } }
@keyframes ov { 0% { opacity: 0; transform: scale(1.3); } 12% { opacity: 1; transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.sound { position: absolute; bottom: 16px; left: 24px; margin: 0; font-size: 24px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .slot.flip, .overlay.go, .overlay.go b, .overlay.go span, .timer.low { animation: none; } }
.ts, .fin b, .slot .pts { direction: ltr; unicode-bidi: isolate; }

.catgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; width: 100%; max-width: 1760px; }
/* المسرح العريض (جوال أعرض من 16:9): الفئات تاخذ العرض الإضافي بعمود خامس */
#stage.wide .catgrid { max-width: calc(var(--sw) - 200px); }
.catcard { background: var(--panel); border: 5px solid var(--line); border-radius: 26px; padding: 26px 20px; display: flex; flex-direction: column; gap: 8px; text-align: center; }
.catcard b { font-size: 48px; font-weight: 800; }
.catcard small { font-size: 30px; color: var(--muted); }
.catcard.taken { background: var(--tc, var(--brand-deep)); border-color: var(--tc, var(--brand)); color: var(--on-color); }
.catcard.taken small { color: var(--on-color); }
.prechip { margin-inline-start: auto; font-size: 34px; padding: 6px 26px; border-radius: 99px; background: var(--panel); color: var(--muted); }
.team { justify-content: flex-start; padding-top: 0; height: 560px; }
.ttimer { font-family: var(--num); font-size: 120px; font-weight: 800; line-height: 1; min-height: 150px; display: flex; align-items: center; justify-content: center; width: 100%; border-radius: 26px 26px 0 0; margin-bottom: 6px; }
.ttimer.on { background: var(--warn); color: var(--on-color); }
.ttimer.off { color: var(--line); }
.ttimer.low { background: var(--bad); color: #fff; animation: pulse .5s ease-in-out infinite alternate; }
.team { overflow: hidden; }
.slot.hinted { border-color: var(--hint); background: #2a3a1c; }
.slot .nm.hint { color: var(--hint); font-size: 30px; font-weight: 700; white-space: normal; line-height: 1.2; }
.paused { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: rgba(6, 26, 30, .82); }
.paused b { font-size: 220px; color: var(--warn); line-height: 1; }
.paused span { font-size: 80px; font-weight: 800; }
.trap.hit.t-a, .trap.hit.t-b { background: var(--tc); border-color: var(--tc); color: var(--on-color); }
/* بطاقة الفريق الذي عليه الدور: كلها بلون الفريق */
.team.on { background: var(--tc); border-color: var(--tc); color: var(--on-color); }
.team.on .tn, .team.on .tturn, .team.on .tlife { color: var(--on-color); }
.team.on .ttimer.on { background: rgba(0, 21, 26, .85); color: var(--warn); }
.team.on .ttimer.low { background: var(--bad); color: #fff; }

.lobt { color: var(--tct); }
.lobcfg { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.lobcfg span { font-size: 36px; background: var(--panel); border-radius: 99px; padding: 10px 30px; color: var(--muted); }
.splash { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; background: var(--bg); }
.splash small { font-size: 60px; color: var(--muted); }
.splash b { font-size: 150px; font-weight: 800; }
.splash span { font-size: 64px; font-weight: 800; background: var(--tc); color: var(--on-color); border-radius: 99px; padding: 14px 50px; }
.splash.go { animation: splash 2.6s ease forwards; }
@keyframes splash { 0% { opacity: 0; transform: scale(1.15); } 12% { opacity: 1; transform: none; } 82% { opacity: 1; } 100% { opacity: 0; } }
.ov-dk b { font-size: 260px; }
.pop { position: absolute; transform: translate(-50%, 0); font-family: var(--num); font-size: 80px; font-weight: 800; color: var(--tc); text-shadow: 0 6px 0 rgba(0, 0, 0, .5); pointer-events: none; animation: pop 1.5s ease-out forwards; direction: ltr; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 20px) scale(.6); } 20% { opacity: 1; transform: translate(-50%, -30px) scale(1.15); } 100% { opacity: 0; transform: translate(-50%, -150px) scale(1); } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -40px; width: 22px; height: 34px; border-radius: 4px; animation: fall linear forwards; }
@keyframes fall { to { top: 1120px; transform: rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { .splash.go, .pop, .confetti i { animation-duration: .01s; } }
/* التلفزيون: خلفية اللعبة تملأ الشاشة كلها بلا أشرطة سوداء مهما كان مقاسها */
html, body { background: var(--bg); }
.timeup { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(6, 26, 30, .78); }
.timeup b { font-size: 260px; line-height: 1; animation: ring 1s ease-in-out infinite; }
.timeup span { font-size: 100px; font-weight: 800; color: var(--bad); }
.timeup small { font-size: 54px; font-weight: 800; background: var(--tc); color: var(--on-color); border-radius: 99px; padding: 8px 40px; }
@keyframes ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(-14deg); } 40% { transform: rotate(14deg); } 60% { transform: rotate(-8deg); } 80% { transform: rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .timeup b { animation: none; } }

/* ===== بطاقة الفريق (إعادة تصميم 2026-10-17): الاسم، النقاط، حلقة الوقت، الدور، الوسائل ===== */
.team { height: 640px; padding: 26px 18px 22px; justify-content: space-between; gap: 0; overflow: visible; border-radius: 36px; }
.team .tn { font-size: 40px; line-height: 1.15; }
.team .ts { font-size: 92px; line-height: 1; direction: ltr; unicode-bidi: isolate; }
.ring { position: relative; width: 210px; height: 210px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring .rbg { stroke: rgba(255, 255, 255, .08); }
.ring .rfg { stroke: var(--tc); stroke-linecap: round; transition: stroke-dashoffset .25s linear; }
.ring .rt { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--num); font-size: 86px; font-weight: 800; }
.ring.off { opacity: .35; }
.ring.idle { opacity: .15; }
.ring.low .rfg { stroke: var(--bad); }
.ring.low .rt { color: var(--bad); animation: pulse .5s ease-in-out infinite alternate; }
.team .tturn { font-size: 30px; min-height: 44px; padding: 4px 22px; border-radius: 99px; }
.tlife { display: flex; gap: 10px; }
.tlife span { font-size: 26px; padding: 6px 16px; border-radius: 99px; background: rgba(0, 0, 0, .22); }
.tlife span.used { opacity: .35; text-decoration: line-through; }
.team.on .ring .rbg { stroke: rgba(0, 21, 26, .18); }
.team.on .ring .rfg { stroke: var(--on-color); }
.team.on .ring .rt { color: var(--on-color); }
.team.on .ring.low .rfg { stroke: var(--bad); }
.team.on .ring.low .rt { color: #7a0019; }
.team.on .tturn { background: var(--on-color); color: var(--tc); }
.team.on .tlife span { background: rgba(0, 21, 26, .16); color: var(--on-color); }
.mid { grid-template-columns: 320px 1fr 320px; }
/* وضوح: الوقت في بطاقة صاحب الدور أبيض، والخانات المكشوفة بدرجة الفريق الغامقة وكتابة بيضاء */
.team.on .ring .rt { color: #fff; text-shadow: 0 3px 0 rgba(0, 21, 26, .45); }
.team.on .ring .rfg { stroke: #fff; }
.team.on .ring .rbg { stroke: rgba(0, 21, 26, .25); }
.team.on .ring.low .rt { color: #fff; }
.team.on .ring.low .rfg { stroke: var(--bad); }
.slot.open.t-a, .slot.open.t-b { background: var(--tcd); color: #fff; border: 4px solid var(--tc); }
.slot.open.t-a .rank, .slot.open.t-b .rank { background: #fff; color: var(--tcd); }
.slot.open.t-a .nm small, .slot.open.t-b .nm small { opacity: .9; }
.pop { color: #fff; -webkit-text-stroke: 3px var(--tcd); }
/* ===== لا كتابة داكنة على التلفزيون: كل الكتابة فوق الألوان بيضاء، والخلفيات بدرجة الفريق الغامقة ===== */
#stage { --on-color: #fff; }
.turnpill, .nom.flash, .nom.win, .catcard.taken, .trap.hit.t-a, .trap.hit.t-b, .splash span, .timeup small { background: var(--tcd, var(--brand-deep)); color: #fff; }
.catcard.taken { border-color: var(--tc, var(--brand)); }
.team.on { background: var(--tcd); border-color: var(--tc); color: #fff; box-shadow: 0 0 0 6px var(--tc), 0 0 70px rgba(0, 0, 0, .45); }
.team.on .tn, .team.on .ts { color: #fff; }
.team.on .tturn { background: #fff; color: var(--tcd); }
.team.on .tlife span { background: rgba(255, 255, 255, .16); color: #fff; }
.slot.none { background: var(--panel-2); color: #fff; border: 4px dashed var(--line); opacity: .8; }
.slot.none .rank { background: var(--used); color: var(--muted); }
.status.pass { background: var(--action-deep); color: #fff; }
.status.hint { background: #6b6d10; color: #fff; }
.slot .nm, .slot .nm small, .slot .pts { text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
/* ظل خفيف خلف كل كتابة بيضاء فوق لون: ظل قصير تحت الحرف + توهج داكن ناعم حوله (لا إطار: يقطع وصل الحروف العربية) */
#stage { --txt-shadow: 0 3px 0 rgba(0, 12, 16, .45); }
.team.on .tn, .team.on .ts, .team.on .ring .rt, .team.on .tlife span,
.slot.open .nm, .slot.open .nm small, .slot.open .pts,
.catcard.taken b, .catcard.taken small, .turnpill, .trap.hit, .splash span, .splash b, .timeup small,
.nom.win, .nom.flash, .status.pass, .overlay span, .overlay b, .timeup span, .winner, .fin b { text-shadow: var(--txt-shadow); }
.slot.open .rank, .team.on .tturn { box-shadow: 0 2px 6px rgba(0, 12, 16, .35); }
/* ظل أقوى على كل الكتابة في شاشة التلفزيون */
#stage { --txt-shadow: 0 4px 0 rgba(0, 8, 12, .65); }
#stage, #stage * { text-shadow: var(--txt-shadow); }
.slot, .team, .trap, .catcard, .chip, .prechip, .status, .lobcfg span, .moments span, .fin, .nom { box-shadow: 0 6px 18px rgba(0, 8, 12, .35); }
/* تجربة: ظل أقوى (المستوى 3) — للمقارنة */
#stage { --txt-shadow: 0 6px 0 rgba(0, 6, 10, .8), 0 2px 2px rgba(0, 6, 10, .9); }
.slot, .team, .trap, .catcard, .chip, .prechip, .status, .lobcfg span, .moments span, .fin, .nom { box-shadow: 0 10px 28px rgba(0, 6, 10, .6), 0 3px 6px rgba(0, 6, 10, .5); }
.team.on { box-shadow: 0 0 0 6px var(--tc), 0 16px 80px rgba(0, 6, 10, .8); }
/* ظل الحلقة بـbox-shadow على دائرتين خلفها (ظل الفلتر يرسمه سفاري الآيفون مستطيلاً مقصوصاً):
   الخارجية بقطر حافة الخط الخارجية، والداخلية تلقي الظل داخل الفتحة */
.ring svg { position: relative; }
.ring::before, .ring::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.ring::before { inset: 4.4px; box-shadow: 0 5px 10px rgba(0, 6, 10, .8); }
.ring::after { inset: 24.3px; box-shadow: inset 0 5px 10px rgba(0, 6, 10, .8); }
/* الكتابة الملوّنة فوق خلفية بيضاء بلا ظل (الظل الداكن يلطّخها) */
#stage .slot.open .rank, #stage .team.on .tturn, #stage .slot.open .rank * { text-shadow: none; }
/* الظل قريب من الحرف حتى لا تذوب نقاط الحروف (ث، ش، ت): إزاحة صغيرة + توهج ناعم */
#stage { --txt-shadow: 0 2px 2px rgba(0, 6, 10, .75); }
/* نقاط الحروف تحت السطر (ي، ج، ب) كانت تُقص: سطر أوسع ومساحة تحت الاسم */
.slot .nm { line-height: 1.45; padding: 4px 0 6px; overflow: hidden; }
.slot .nm small { line-height: 1.3; margin-top: 0; }
.slot { padding-top: 0; padding-bottom: 0; }
.team .tn, .catcard b, .splash b, .qtitle, .trap, .chip, .status { line-height: 1.45; }

/* ===== الحياة على التلفزيون ===== */
#stage::before { content: ""; position: absolute; inset: -20%; pointer-events: none; z-index: 0;
  background: radial-gradient(600px 400px at 20% 30%, rgba(0, 190, 174, .10), transparent 70%), radial-gradient(700px 500px at 80% 70%, rgba(91, 129, 255, .09), transparent 70%), radial-gradient(500px 400px at 60% 20%, rgba(224, 114, 39, .07), transparent 70%);
  animation: drift 18s ease-in-out infinite alternate; }
@keyframes drift { 0% { transform: translate(0, 0) rotate(0); } 100% { transform: translate(4%, -3%) rotate(6deg); } }
.scr, .overlay, .timeup, .splash, .paused, .confetti, .pop, .passarrow { z-index: 1; }
.team.on { animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 6px var(--tc), 0 16px 80px rgba(0, 6, 10, .8); } 50% { box-shadow: 0 0 0 10px var(--tc); } }
.slot.hid { position: relative; overflow: hidden; }
.slot.hid::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .07) 50%, transparent 70%); transform: translateX(-120%); animation: sweep 6s ease-in-out 1; }
.slot.hid::after { animation-delay: var(--b, 0s); }
.slot.hinted { animation-delay: var(--a, 0s); }
@keyframes sweep { 0%, 60% { transform: translateX(120%); } 100% { transform: translateX(-120%); } }
.slot.hintpop { animation: hintpop 1.2s ease-out; }
@keyframes hintpop { 0% { box-shadow: 0 0 0 0 var(--hint); transform: scale(1); } 30% { box-shadow: 0 0 0 14px rgba(251, 172, 40, .45); transform: scale(1.04); } 100% { box-shadow: 0 0 0 0 transparent; transform: none; } }
.slot.hinted { animation: hintglow 2.2s ease-in-out infinite; }
@keyframes hintglow { 50% { border-color: #FBAC28; } }
.passarrow { position: absolute; font-size: 160px; color: var(--tc); pointer-events: none; }
.ring.low { animation: ringlow .5s ease-in-out infinite alternate; }
@keyframes ringlow { to { transform: scale(1.06); } }
#qr { animation: qrpulse 2.8s ease-in-out infinite; }
@keyframes qrpulse { 50% { box-shadow: 0 0 0 16px rgba(0, 246, 225, .18); } }
.lobt { display: inline-block; animation: lobin .8s cubic-bezier(0.22, 1, 0.36, 1) backwards; }
#lob-b { animation-delay: .15s; }
@keyframes lobin { from { opacity: 0; transform: translateY(40px) scale(.8); } }
.fin.win { animation: winpulse 1.6s ease-in-out infinite; }
@keyframes winpulse { 50% { transform: scale(1.05); box-shadow: 0 18px 40px rgba(0, 6, 10, .5); } }
.moments span { animation: lobin .7s ease backwards; } .moments span:nth-child(2) { animation-delay: .25s; } .moments span:nth-child(3) { animation-delay: .5s; }
@media (prefers-reduced-motion: reduce) { #stage::before, .team.on, .slot.hid::after, .slot.hinted, .slot.hintpop, .ring.low, #qr, .lobt, .fin.win, .moments span { animation: none; } }
/* منع تداخل اللوحة مع شريط الفخاخ: الوسط يأخذ المساحة الباقية فقط، والبطاقات واللوحة لا تتجاوزه */
.q { overflow: hidden; }
.mid { min-height: 0; align-items: stretch; }
.team { height: auto; max-height: 100%; min-height: 0; padding: 18px 16px 16px; }
.ring { width: 170px; height: 170px; }
.ring .rt { font-size: 72px; }
.team .ts { font-size: 80px; }
.team .tn { font-size: 36px; }
.board { height: 100%; max-height: none; min-height: 0; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: 12px 22px; }
.slot { min-height: 0; overflow: hidden; }
.slot .nm { font-size: 38px; line-height: 1.4; padding: 2px 0 4px; }
.slot .nm small { font-size: 24px; }
.traps, .status { flex: none; position: relative; z-index: 2; }
.board { max-height: 100%; align-self: stretch; overflow: hidden; padding: 2px; }
.team.on { transform: none; }
.mid { margin-bottom: 4px; }
/* شارتا رأس السؤال: أكبر، بلونين مميزين، والكلام في الوسط تماماً */
.qhead { height: 92px; gap: 18px; }
.qhead .chip { display: inline-flex; align-items: center; justify-content: center; gap: 12px; height: 80px; padding: 0 38px; font-size: 40px; font-weight: 800; line-height: 1; color: #fff; border: 3px solid transparent; }
#q-count { background: var(--brand-deep); border-color: var(--brand); }
#q-cat { background: #6A3FA8; border-color: #9B74D9; }
/* ===== كل الشارات المستديرة في التلفزيون: لون مميز لكل نوع، والكلام في الوسط تماماً ===== */
.lobcfg span, .prechip, .moments span, .tlife span, .team .tturn, .trap, .chipcat, .turnpill, .splash span, .timeup small {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; line-height: 1; text-align: center; color: #fff; border: 3px solid transparent; }
/* شاشة الانتظار: كل إعداد بلون */
.lobcfg span { font-size: 40px; font-weight: 800; height: 76px; padding: 0 36px; }
.lobcfg span:nth-child(1) { background: var(--brand-deep); border-color: var(--brand); }
.lobcfg span:nth-child(2) { background: #8C6016; border-color: #FBAC28; }
.lobcfg span:nth-child(3) { background: #6A3FA8; border-color: #9B74D9; }
.lobcfg span:nth-child(4) { background: var(--action-deep); border-color: var(--action); }
/* «لم يبدأ الوقت» */
.prechip { height: 80px; padding: 0 34px; font-size: 38px; font-weight: 800; background: #8C6016; border-color: #FBAC28; }
/* لحظات النتيجة النهائية */
.moments span { height: 72px; padding: 0 32px; font-size: 34px; font-weight: 800; }
.moments span:nth-child(1) { background: var(--brand-deep); border-color: var(--brand); }
.moments span:nth-child(2) { background: #9b1036; border-color: var(--bad); }
.moments span:nth-child(3) { background: #6A3FA8; border-color: #9B74D9; }
/* وسائل الفريق في بطاقته */
.tlife span { height: 50px; padding: 0 18px; font-size: 26px; font-weight: 800; }
.tlife .lp { background: var(--action-deep); border-color: var(--action); }
.tlife .lh { background: #8C6016; border-color: #FBAC28; }
.tlife span.used { background: var(--used); border-color: var(--line); color: var(--muted); }
.team.on .tlife .lp { background: var(--action-deep); } .team.on .tlife .lh { background: #8C6016; }
.team .tturn { height: 52px; padding: 0 24px; }
/* الفخاخ المخفية: إطار متقطع أحمر والكلام في الوسط */
.trap { height: 62px; padding: 0 26px; }
.trap:not(.open) { background: #3a1420; border: 3px dashed var(--bad); color: #ffd0da; }
/* عنوان السؤال داخل إطار ملوّن واضح من بعيد */
.qtitle { align-self: center; max-width: 1700px; background: #0F4A54; border: 5px solid var(--brand-text); border-radius: 30px; padding: 10px 46px 14px; font-size: 62px; line-height: 1.35; color: #fff; box-shadow: 0 0 0 6px rgba(0, 246, 225, .12), 0 12px 34px rgba(0, 6, 10, .6); }
/* عنوان السؤال: لون جديد، والكلام في وسط الإطار عمودياً */
.qtitle { background: #4A1238; border-color: #E58BC0; box-shadow: 0 0 0 6px rgba(229, 139, 192, .14), 0 12px 34px rgba(0, 6, 10, .6);
  display: flex; align-items: center; justify-content: center; line-height: 1.25; padding: 22px 50px 16px; }
.qtitle { font-size: 50px; padding: 18px 44px 13px; }

.fsbtn { position: absolute; top: 20px; left: 24px; z-index: 5; font: inherit; font-size: 30px; font-weight: 800; color: #fff; background: var(--brand-deep); border: 3px solid var(--brand); border-radius: 99px; padding: 10px 28px; cursor: pointer; opacity: .85; }
@media (hover: hover) and (pointer: fine) { .fsbtn:hover { opacity: 1; } }
.mutedtag { position: absolute; bottom: 16px; right: 24px; z-index: 5; font-size: 28px; font-weight: 800; color: #fff; background: #9b1036; border-radius: 99px; padding: 6px 22px; }
.fsbtn.in { font-size: 22px; padding: 6px 18px; opacity: .35; background: var(--used); border-color: var(--line); }
@media (hover: hover) and (pointer: fine) { .fsbtn.in:hover { opacity: .9; } }

/* ===== السؤال وبقية الشاشة حيّة ===== */
.qtitle { position: relative; overflow: hidden; animation: qglow 3.2s ease-in-out infinite; }
@keyframes qglow { 50% { border-color: #FFC2E4; box-shadow: 0 0 0 10px rgba(229, 139, 192, .22), 0 12px 34px rgba(0, 6, 10, .6); } }
.qtitle::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .13) 50%, transparent 65%); transform: translateX(-130%); animation: qshine 7s ease-in-out 1.5s 1; }
@keyframes qshine { 0%, 70% { transform: translateX(130%); } 100% { transform: translateX(-130%); } }
.trap:not(.open) { animation: trapwarn 2.6s ease-in-out infinite; }
.trap:not(.open), .trap.open.hit { animation-delay: var(--a, 0s); }
@keyframes trapwarn { 50% { box-shadow: 0 0 0 4px rgba(255, 80, 110, .35); } }
.trap.open.hit { animation: traphit 1.8s ease-in-out infinite; }
@keyframes traphit { 50% { box-shadow: 0 0 0 5px var(--tc); } }
.prechip:not([hidden]) { animation: preblink 1.4s ease-in-out infinite; }
@keyframes preblink { 50% { opacity: .55; } }
.team.on .tturn { animation: tturn 1.6s ease-in-out infinite; }
@keyframes tturn { 50% { transform: scale(1.06); } }
.slot.open .pts { display: inline-block; }
@media (prefers-reduced-motion: reduce) { .qtitle, .qtitle::after, .trap, .trap.open.hit, .prechip, .team.on .tturn { animation: none !important; } }
/* الأجوبة المكشوفة حيّة: توهج بلون الفريق ولمعة تمر عليها بين حين وآخر */
.slot.open.t-a, .slot.open.t-b { position: relative; overflow: hidden; animation: opglow 4s ease-in-out var(--a, 0s) infinite; }
.slot.open.t-a.flip, .slot.open.t-b.flip { animation: flip 280ms cubic-bezier(.2, .8, .2, 1), opglow 4s ease-in-out var(--a, 0s) infinite; }
@keyframes opglow { 50% { box-shadow: 0 10px 28px rgba(0, 6, 10, .6); } }
.slot.open.t-a::after, .slot.open.t-b::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .08) 50%, transparent 70%); transform: translateX(130%); animation: opshine 9s ease-in-out var(--b, 0s) 1; }
@keyframes opshine { 0%, 75% { transform: translateX(130%); } 100% { transform: translateX(-130%); } }
@keyframes oprank { 50% { transform: scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .slot.open.t-a, .slot.open.t-b, .slot.open::after, .slot.open .rank { animation: none !important; } }

/* ===== الأداء: التوهج ما يرسم الشاشة من جديد كل إطار =====
   تحريك box-shadow وborder-color وfilter يجبر المتصفح يعيد رسم المسرح كله (وهو مكبّر بـtransform)، فينزل الإطار لـ20 تقريباً.
   البديل: التوهج ظل ثابت في طبقة ::before، والحركة على شفافيتها فقط، والطبقات المتحركة مستقلة (will-change) */
.team.on, .qtitle, .slot.hinted, .trap:not(.open), .trap.open.hit, .slot.open.t-a, .slot.open.t-b { animation: none; }
.slot.open.t-a.flip, .slot.open.t-b.flip { animation: flip 280ms cubic-bezier(.2, .8, .2, 1); }
.team, .qtitle, .trap, .slot { position: relative; }
.team.on::before, .qtitle::before, .slot.hinted::before, .trap:not(.open)::before, .trap.open.hit::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; will-change: opacity;
  animation: glowop 2.4s ease-in-out var(--a, 0s) infinite; }
.team.on::before { box-shadow: inset 0 0 0 4px var(--tc); }
.qtitle::before { box-shadow: inset 0 0 0 3px #FFC2E4; animation-duration: 3.2s; }
.slot.hinted::before { box-shadow: inset 0 0 0 3px #FBAC28; animation-duration: 2.2s; }
.trap:not(.open)::before { box-shadow: 0 0 0 4px rgba(255, 80, 110, .35); animation-duration: 2.6s; }
.trap.open.hit::before { box-shadow: 0 0 0 5px var(--tc); animation-duration: 1.8s; }
@keyframes glowop { 50% { opacity: 1; } }
#stage::before, .slot.hid::after, .slot.open.t-a::after, .slot.open.t-b::after, .qtitle::after, .team.on .tturn, .ring.low, .timeup b { will-change: transform; }
/* الكشف: قلبة بلا filter (الـfilter على خانة فيها ظلال نص ثقيل يعلّق لحظة الكشف) */
@keyframes flip { 0% { transform: rotateX(90deg); opacity: .4; } 60% { transform: rotateX(-12deg); opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .team.on::before, .qtitle::before, .slot.hinted::before, .trap::before { animation: none; opacity: 0; } }
/* إعلان الفئة ثابت لين الحكم يشيله: دخول فقط بلا اختفاء تلقائي */
.splash { z-index: 5; }
.splash.go { animation: splashin .6s var(--ease-out) both; }
@keyframes splashin { from { opacity: 0; transform: scale(1.12); } }
.splash b { animation: splashb 2.4s ease-in-out .6s infinite; will-change: transform; }
@keyframes splashb { 50% { transform: scale(1.04); } }
@media (prefers-reduced-motion: reduce) { .splash.go, .splash b { animation: none; } }
/* شريط الدور تحت: إطار على قد الكلام، بلون الفريق */
#q-status { align-self: center; justify-self: center; width: auto; max-width: 1700px; height: auto; min-height: 0; margin: 0 auto; padding: 8px 46px 12px; font-size: 40px; border-radius: 99px; background: #0F4A54; border: 4px solid var(--brand-text); color: #fff; text-shadow: var(--txt-shadow); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#q-status.t-a, #q-status.t-b { background: var(--tcd); border-color: var(--tc); }
#q-status.pass { background: var(--action-deep); border-color: #FF92A4; }
#q-status:empty { visibility: hidden; }
/* إطار السؤال بنفس طريقة شريط الدور: لون الفريق اللي عليه الدور */
/* تبدّل الدور: الألوان تتغير فوراً بلا تدرّج. تدرّج اللون يعيد حساب التنسيق ورسم السؤال والإطارات والخلفية كل إطار،
   فلحظة «غلط» كانت تطلع 16 إلى 20 إطاراً متأخراً على شاشة 120 هرتز (وعلامة ✗ تغطي لحظة التبدّل أصلاً) */
.qtitle.t-a, .qtitle.t-b { background: var(--tcd); border-color: var(--tc); box-shadow: 0 10px 28px rgba(0, 6, 10, .6); }
.qtitle.t-a::before, .qtitle.t-b::before { box-shadow: inset 0 0 0 3px #fff; }
.qtitle.pass { background: var(--action-deep); border-color: #FF92A4; }
.qtitle.pass::before { box-shadow: inset 0 0 0 3px #FFC2CC; }
/* شريط الدور حي مثل السؤال: توهج على الشفافية ولمعة تمر */
#q-status { position: relative; }
#q-status::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; will-change: opacity; box-shadow: inset 0 0 0 3px #fff, inset 0 0 36px var(--tc, var(--brand)); animation: glowop 3.2s ease-in-out infinite; }
#q-status.pass::before { box-shadow: inset 0 0 0 3px #FFC2CC; }
#q-status::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(100deg, transparent 35%, rgba(255, 255, 255, .13) 50%, transparent 65%); transform: translateX(-130%); will-change: transform; animation: qshine 7s ease-in-out 3s 1; }
@media (prefers-reduced-motion: reduce) { #q-status::before, #q-status::after { animation: none; } }
/* الإطاران فوق: في الوسط فوق السؤال وبلون الفريق اللي عليه الدور */
.qhead { justify-content: center; }
.qhead.t-a .chip, .qhead.t-b .chip { background: var(--tcd); border-color: var(--tc); }
.qhead.pass .chip { background: var(--action-deep); border-color: #FF92A4; }
.qhead.t-a #q-count, .qhead.t-a #q-cat, .qhead.t-b #q-count, .qhead.t-b #q-cat { background: var(--tcd); border-color: var(--tc); }
.qhead.pass #q-count, .qhead.pass #q-cat { background: var(--action-deep); border-color: #FF92A4; }
/* زر ملء الشاشة: صغير في الزاوية اليمين فوق */
.fsbtn { left: auto; right: 22px; top: 18px; font-size: 20px; padding: 5px 16px; border-width: 2px; opacity: .6; }
.fsbtn.in { font-size: 18px; padding: 4px 14px; opacity: .3; }
/* كلمة «الفخاخ» فوق الفخاخ في الوسط */
#traps { flex-wrap: wrap; row-gap: 6px; }
#traps .tl { flex: 0 0 100%; text-align: center; line-height: 1.2; font-size: 28px; }
/* خلفية «غطاوي»: رسم خطوط قديم خفيف ثابت (ما يتحرك، فما يثقل الشاشة)، ولونه لون الفريق اللي عليه الدور */
.bgart { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; color: var(--brand-text); opacity: .13; }
.bgart .qm text { stroke-width: 2.5; }
/* الخلفية صورة ثابتة طول اللعبة (طلب المالك 2026-10-18: «ثبّت الخلفية، لا تخليها حية»): أربع طبقات بحجم المسرح تتحرك
   كانت تثقل ذاكرة سفاري الآيفون فتعلّق شاشة العرض وترجع لصفحة البداية. الطبقات باقية بنفس مكانها، ولونها ثابت ما يتبع الدور (طلب المالك) */
.bgart { overflow: hidden; }
.bgl { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.bgl-far { opacity: .75; }
.bgl-tw { opacity: .55; }
/* داخل إطار السدو: الزر والتنبيه ما يركبون على الإطار */
.fsbtn { top: 48px; right: 50px; }
.sound { bottom: 46px !important; left: 50px !important; }
/* تنبيه الصوت فوق يسار (مقابل زر ملء الشاشة) حتى ما يدخل تحت شريط الدور */
.sound { top: 50px !important; bottom: auto !important; left: 50px !important; font-size: 20px; }
/* كل المحتوى داخل إطار السدو (الإطار 36px + فسحة) في كل الشاشات */
.scr { padding: 58px 66px; }
.q { padding: 56px 62px 56px; gap: 14px; }
.qhead { height: 84px; }
.qhead .chip { height: 72px; }
/* الوضع الخفيف (يتفعّل تلقائياً على الأجهزة الضعيفة): الخلفية ثابتة وبلا توهج ولمعات */
.lite .bgl, .lite #stage::before, .lite .slot.hid::after, .lite .slot.open::after, .lite .qtitle::after, .lite #q-status::after,
.lite .team.on::before, .lite .qtitle::before, .lite .trap::before, .lite #q-status::before, .lite .slot.hinted::before { animation: none !important; will-change: auto; }
/* الجوال دائماً خفيف (قياس 2026-10-18: 53 طبقة رسم و25 مليون بكسل وقت السؤال فتعلق شاشة الآيفون عند «غلط»):
   بلا توهج خلفي متحرك، وعلامات غلط وفخ وباس تظهر وتختفي بلا حركة فما تنشئ طبقة بحجم المسرح، ولا will-change */
.lite #stage::before { display: none; }
.lite .overlay.go, .lite .overlay.go b, .lite .overlay.go span { animation: none !important; }
.lite #stage *, .lite #stage *::before, .lite #stage *::after { will-change: auto !important; }
/* أهم سبب (قياس الطبقات): شارة «الدور عليهم» تنبض بلا توقف، فكل شي فوقها ينرسم طبقة مستقلة بحجم المسرح (18 مليون بكسل).
   على الجوال: كل الحركات المستمرة واقفة، ويبقى قلب الخانة عند الكشف ونقاط «+» ونبض السؤال في بدايته */
.lite #stage *:not(.slot):not(.pop):not(.sqt):not(.confetti i), .lite #stage *::before, .lite #stage *::after { animation: none !important; }
/* ===== الإعداد على الشاشة الكبيرة (مثل اضمنها): الفرق تجهّز هنا، والحكم يمسح الباركود بعدها ===== */
.setup { gap: 22px; }
/* الأزرار الثانوية في صف واحد: الإعداد كان أطول من المسرح (1239 من 1080) فينقص العنوان فوق والرابط تحت */
.setup .altrow { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 18px 24px; }
.setup .logo { font-size: 120px; }
.teamsin { display: flex; gap: 40px; }
.tin { display: flex; flex-direction: column; gap: 10px; text-align: start; }
.tin span { font-size: 34px; font-weight: 800; color: var(--tct); }
.tin input { width: 620px; font: 800 52px/1.2 var(--txt); color: var(--text); background: var(--panel); border: 5px solid var(--tc); border-radius: 26px; padding: 18px 30px; outline: none; }
.opts { display: flex; flex-direction: column; gap: 18px; }
.optrow { display: flex; align-items: center; gap: 18px; justify-content: center; }
.optrow > span { font-size: 36px; color: var(--muted); min-width: 340px; text-align: start; }
.opt { min-width: 130px; font: 800 48px/1 var(--num); color: var(--text); background: var(--panel); border: 5px solid var(--line); border-radius: 22px; padding: 16px 26px; cursor: pointer; }
.opt.on { border-color: var(--brand); color: var(--brand-text); }
.gobtn { font: 800 52px/1 var(--txt); color: #fff; background: var(--action-deep); border: 0; border-radius: 99px; padding: 26px 70px; cursor: pointer; box-shadow: 0 7px 24px rgba(0, 0, 0, .35); }
.gobtn:disabled { opacity: .45; }
.linkbtn { font: 700 32px/1.3 var(--txt); color: var(--muted); background: none; border: 0; text-decoration: underline; cursor: pointer; }
/* التركيز ظاهر بوضوح للريموت والكيبورد */
#stage button:focus-visible:where(html.keyboard-nav *), #stage input:focus-visible:where(html.keyboard-nav *), .catcard.tap:focus-visible:where(html.keyboard-nav *) { outline: 6px solid var(--hint, #FBAC28); outline-offset: 6px; }
.catcard.tap { cursor: pointer; transition: transform .12s ease; }
@media (hover: hover) and (pointer: fine) { .catcard.tap:hover { transform: translateY(-4px); border-color: var(--brand); } }
/* شريط أزرار المضيف تحت (القرعة، التالي، تراجع) */
.hostbar { position: absolute; left: 50%; bottom: 54px; transform: translateX(-50%); display: flex; gap: 24px; z-index: 3; }
.hb { font: 800 38px/1 var(--txt); color: var(--text); background: var(--panel); border: 4px solid var(--line); border-radius: 99px; padding: 18px 44px; cursor: pointer; }
.hb.main { color: #fff; background: var(--action-deep); border-color: #a3334e; font-size: 46px; padding: 22px 60px; }
#s-pick { padding-bottom: 150px; }
/* الباركود للحكم بعد الاختيار */
.pairtitle { font-size: 90px; margin-top: 10px; }
.pairpicks { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-top: 18px; }
.pchip { font-size: 32px; font-weight: 800; padding: 10px 24px; border-radius: 99px; background: var(--tcd, var(--panel)); border: 3px solid var(--tc, var(--line)); }
/* الفئات كثرت (27 بعد الدفعة الأولى): ستة أعمدة ببطاقات أصغر، والزائد يتمرّر داخل الشبكة بدل ما يطلع برّا الشاشة */
#s-pick { justify-content: flex-start; gap: 22px; padding-top: 70px; }
#s-pick h1 { font-size: 64px; }
#s-pick .catgrid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; max-height: 720px; overflow-y: auto; padding: 10px; scrollbar-width: none; }
#s-pick .catgrid::-webkit-scrollbar { display: none; }
#s-pick .catcard { padding: 16px 12px; border-radius: 20px; border-width: 4px; gap: 4px; justify-content: center; }
#s-pick .catcard b { font-size: 32px; line-height: 1.25; }
#s-pick .catcard small { font-size: 22px; }
#s-pick .catgrid { grid-auto-rows: 122px; max-height: 700px; }
#s-pick .catcard { padding: 10px 12px; }
#s-pick .catcard b { font-size: 28px; line-height: 1.22; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#s-pick .catgrid { grid-auto-rows: 112px; gap: 14px; }
#s-pick { padding-top: 46px; gap: 14px; }
#s-pick h1 { font-size: 52px; }
#s-pick .turnpill { font-size: 40px; padding: 10px 40px; }
#s-pick .catgrid { grid-auto-rows: 132px; gap: 12px; max-height: 760px; }
#s-pick .catcard { gap: 6px; }
#s-pick .catcard b { font-size: 27px; line-height: 1.4; padding-bottom: 2px; }
#s-pick .catcard small { font-size: 20px; line-height: 1.2; }
/* الأسماء الطويلة في الخانات (كانت تنقص بنقاط: «خفيتشا كفارات…»): 17–22 حرفاً سطر واحد أصغر مع السنوات،
   23–34 سطران بلا السنوات، وأطول من ذلك («حرب النجوم الجزء الخامس: …») ثلاثة أسطر صغيرة */
/* ما ينقص كلام: fitText في tv.js يصغّر الخط لين يدخل سطراً؛ وإن ما دخل ينكسر (.wrap) والقيمة تظل ظاهرة */
.slot .nm { text-overflow: clip; }
.slot .nm.wrap { display: block; line-height: 1.2; padding: 0; overflow: visible; }
.slot .nm.wrap small { font-size: 20px; }
.slot.open .pts { font-size: 36px; }   /* المكشوف: النقاط أصغر عشان الاسم ياخذ مساحة */
.qtitle { white-space: nowrap; overflow: hidden; }
.qtitle.wrap { line-height: 1.3; }
.traps { min-width: 0; max-width: 100%; }
.trap { min-width: 0; max-width: 31%; overflow: hidden; text-overflow: clip; }
.trap.wrap { height: auto; min-height: 62px; line-height: 1.2; padding-top: 6px; padding-bottom: 6px; text-align: center; }
/* نهاية السؤال: المصدر سطر مستقل أصغر يتكسر بدل ما ينقص */
#q-status.withsrc { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 40px 10px; max-width: 1640px; }
#q-status .src { display: block; font-size: 24px; font-weight: 700; line-height: 1.35; opacity: .85; white-space: normal; text-align: center; unicode-bidi: plaintext; max-width: 1560px; }

/* أقسام الفئات فوق الشبكة (خطة الـ500 فئة) */
.sectabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; max-width: 100%; padding: 4px 10px; flex-shrink: 0; }
.sectabs::-webkit-scrollbar { display: none; }
.sectab { flex: none; font: inherit; font-size: 21px; font-weight: 700; padding: 6px 18px; border-radius: 999px; border: 3px solid rgba(255,255,255,.25); background: rgba(0,0,0,.25); color: #fff; cursor: pointer; white-space: nowrap; }
.sectab.on { background: #fff; color: #111; border-color: #fff; }
.sectab:focus-visible:where(html.keyboard-nav *) { outline: 4px solid #FBAC28; outline-offset: 2px; }
#s-pick .catgrid { max-height: 640px; }

/* إعلان بداية السؤال (طلب المالك 2026-10-18): يُقرأ من بعيد، وفوق الخلفية الحية نفسها (بلون الفريق) بدل لون سادة.
   السؤال تحته يختفي وقت الإعلان عشان ما يبين من ورا */
.splash { background: transparent; gap: 26px; }
#stage:has(#splash:not([hidden])) #s-q { visibility: hidden; }
.splash small { font-size: 54px; font-weight: 700; color: #fff; opacity: .85; }
.splash b { font-size: 140px; line-height: 1.3; }
/* السؤال كتابة بيضاء بظل قوي فوق الخلفية الحية، ينبض بهدوء.
   الحشوة تكفي نقاط الحروف وهمزاتها فوق السطر (الشين كانت تنقص) */
.splash .sqt { box-sizing: border-box; width: 100%; font-size: 80px; font-weight: 800; line-height: 1.5; text-align: center; white-space: nowrap; text-overflow: ellipsis; padding: 22px 140px 26px; color: #fff;
  animation: sqtpulse 2.4s ease-in-out .6s infinite; will-change: transform;   /* بلا إطار ولا شريط: السؤال ينبض بهدوء (اختيار المالك 2026-10-18)، والفئة ثابتة */
  overflow: hidden; }   /* سطر واحد دائماً: الخط يصغر للسؤال الطويل (fitLine في tv.js) */
.splash span { font-size: 44px; padding: 10px 44px; text-shadow: 0 2px 10px rgba(0,0,0,.45); box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.splash .schg { font-size: 40px; font-weight: 700; color: #fff; opacity: .85; }
/* ظلال لكل كلام الإعلان، والسؤال ظله أقوى */
.splash small, .splash b, .splash .schg { text-shadow: 0 3px 4px rgba(0,0,0,.55), 0 6px 24px rgba(0,0,0,.6); }
.splash .sqt { text-shadow: 0 4px 6px rgba(0,0,0,.75), 0 10px 40px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.6); }
@keyframes sqtpulse { 50% { transform: scale(1.04); } }
.splash b { animation: none; will-change: auto; }
@media (prefers-reduced-motion: reduce) { .splash .sqt { animation: none; } }
/* فئات الخطة اللي ما اكتملت أسئلتها (أقل من 35): تبين باهتة «قريباً» وما تنختار */
.catcard.soon { opacity: .42; border-style: dashed; }
.catcard.soon small { font-weight: 700; }

/* جوال يعرض اللعبة (html.phone): الثانويات مخفية والخط أكبر؛ والطول له ترتيب خاص (html.portrait) */
html.phone #fs, html.phone .mutedtag { display: none !important; }
html.phone .mid { grid-template-columns: 250px 1fr 250px; gap: 24px; }
html.phone .slot .nm small { font-size: 28px; }
html.phone .slot .pts { font-size: 40px; }
html.phone .slot.open .pts { font-size: 36px; }
html.phone .slot .rank { transform: scale(1.1); }
html.phone .qhead .chip { font-size: 46px; }
/* اختيار الفئات على جوال العرض: الأقسام صف واحد يتمرر بخط أكبر، والبطاقات أربع في الصف بخط أكبر */
html.phone #s-pick { padding-top: 26px; gap: 12px; }
html.phone #s-pick h1 { font-size: 44px; }
html.phone .sectabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; padding: 6px 12px; }
html.phone .sectabs::-webkit-scrollbar { display: none; }
html.phone .sectab { font-size: max(34px, var(--min-fs, 0px)); padding: 10px 30px; }
html.phone #s-pick .catgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: 168px; max-height: 620px; }
html.phone #stage.wide #s-pick .catgrid { grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: calc(var(--sw) - 200px); }
html.phone #s-pick .catcard b { font-size: 40px; }
html.phone #s-pick .catcard small { font-size: 28px; }

/* زر باركود الحكم في الإعداد: زر واضح ثانوي */
.gobtn.alt { background: var(--panel); box-shadow: 0 7px 24px rgba(0, 0, 0, .35); border: 4px solid var(--brand-text); font-size: 40px; padding: 20px 56px; }
#s-setup .linkbtn { text-decoration: underline; }

/* ===== الشاشة بالطول (جوال واقف): مسرح 1080×1920 وترتيب عمودي ===== */
html.portrait #stage { width: 1080px; height: var(--sh, 1920px); }   /* الطول يتبع نسبة الشاشة (fit في tv.js) فما تبقى أشرطة فاضية */

html.portrait .scr { padding: 70px 56px; }
html.portrait #fs { display: none; }
/* الإعداد */
html.portrait .setup .teamsin { flex-direction: column; gap: 24px; }
html.portrait .tin input { width: 860px; }
html.portrait .setup .logo { font-size: 120px; }
/* الباركود */
html.portrait .pair { grid-template-columns: 1fr; gap: 30px; align-content: center; }
/* اختيار الفئات */
html.portrait #s-pick { padding-top: 90px; }
html.portrait #s-pick .catgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: 170px; max-height: 1380px; }
html.portrait .sectabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; }
html.portrait .sectabs::-webkit-scrollbar { display: none; }
html.portrait .sectab { font-size: 32px; padding: 10px 28px; }
html.portrait .noms, html.portrait .finals { flex-direction: column; gap: 30px; }
/* السؤال: الفريقان صف فوق، والأجوبة العشرة عمود واحد تحتهم */
html.portrait .q { padding: 60px 40px 50px; gap: 16px; }
html.portrait .qhead { flex-wrap: wrap; justify-content: center; height: auto; }
html.portrait .qtitle { max-width: 1000px; }
html.portrait .mid { grid-template-columns: 1fr 1fr; grid-template-rows: auto minmax(0, 1fr); gap: 18px 22px; align-items: stretch; }
html.portrait .mid > #board { grid-column: 1 / -1; grid-row: 2; }
html.portrait .mid > #team-0 { grid-column: 1; grid-row: 1; }
html.portrait .mid > #team-1 { grid-column: 2; grid-row: 1; }
html.portrait .team { height: 300px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto auto; align-items: center; justify-items: center; padding: 14px 18px; gap: 4px 14px; }
html.portrait .team .ring { width: 150px; height: 150px; grid-row: 1 / span 3; grid-column: 1; }
html.portrait .team .tn { font-size: 36px; }
html.portrait .team .ts { font-size: 76px; }
html.portrait .team .tturn { font-size: 26px; min-height: 36px; }
html.portrait .board { grid-template-rows: repeat(10, minmax(0, 1fr)); grid-template-columns: 1fr; grid-auto-flow: row; gap: 12px; max-height: none; height: 100%; }
html.portrait .traps { flex-wrap: wrap; gap: 12px; }
html.portrait .trap { max-width: 48%; }
html.portrait .slot .nm small { font-size: 24px; }
html.portrait .slot .pts { font-size: 38px; }

/* اللعب بالعرض إجباري على الجوال الواقف (طلب المالك): الإعداد والفئات والباركود بالطول، والسؤال والقرعة والنتيجة بالعرض */
.rotate { display: none; }
/* وضع البث والجوال واقف: كل الشاشات تطلب اللف (الصورة المنسوخة للتلفزيون تملأه بالعرض فقط) */
.castoff { display: none; }
html.castpor .castoff { display: block; margin-top: 12px; font: inherit; font-size: 20px; font-weight: 800; color: #fff; background: rgba(255, 255, 255, .12); border: 2px solid rgba(255, 255, 255, .35); border-radius: 999px; padding: 12px 22px; }
html.castpor .rotate small { display: block; max-width: 100%; }
html.castpor .rotate small::after { content: " · وطفّ قفل الدوران عشان تملأ التلفزيون"; }

.rotate b { font-size: 72px; animation: rot 2.4s ease-in-out infinite; }
.rotate span { font-size: 28px; font-weight: 800; }
.rotate small { font-size: 16px; opacity: .8; }
@keyframes rot { 0%, 30% { transform: rotate(0); } 60%, 100% { transform: rotate(-90deg); } }
@media (prefers-reduced-motion: reduce) { .rotate b { animation: none; } }

/* ===== بطاقات الفئات المبسّطة (طلب المالك 2026-10-18: «أبسط وخفيفة على الجهاز لأن عددها واجد») =====
   الاسم فقط في مربع مسطّح: بلا رمز ولا ظل ولا عدد أسئلة، وسطر صغير فقط إذا انختارت أو قريباً */
#s-pick .catcard { box-shadow: none; border: 2px solid rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); border-radius: 16px; gap: 0; padding: 6px 10px; transition: none; }
#s-pick .catcard .ce { display: none; }
#s-pick .catcard b { display: block; -webkit-line-clamp: unset; overflow: visible; font-weight: 800; }
#s-pick .catcard small:empty { display: none; }
#s-pick .catcard.taken { border-color: var(--tc, var(--brand)); background: var(--tcd, var(--brand-deep)); }
#s-pick .catcard.soon { opacity: .45; border-style: dashed; }
#s-pick .catcard.tap:hover { transform: none; }
html.phone #s-pick .catcard b { font-size: 36px; }
html.phone #s-pick .catcard small { font-size: 24px; }
html.phone #s-pick .catgrid { grid-auto-rows: 120px; gap: 12px; }

/* ربط الحكم (طلب المالك 2026-10-19): الباركود والرمز يختفون أول ما يربط، ورسالة «تم ربط الحكم» */
#s-pair.paired .qrbox, #s-pair.paired #pair-code, #s-pair.paired #pair-code-label { display: none; }
#s-pair.paired #pair-msg { font-size: 56px; font-weight: 800; color: #fff; }
.toast { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--brand-deep, #0F4A54); color: #fff; border: 4px solid var(--brand-text); border-radius: 999px; padding: 14px 44px; font-size: 44px; font-weight: 800; white-space: nowrap; box-shadow: 0 10px 30px rgba(0, 6, 10, .6); pointer-events: none; }

/* تغيير الحكم وسط اللعب */
.swapbtn { position: absolute; bottom: 46px; left: 50px; z-index: 5; font: inherit; font-size: 26px; font-weight: 800; color: #fff; background: var(--brand-deep); border: 3px solid var(--brand); border-radius: 99px; padding: 8px 24px; cursor: pointer; opacity: .8; }
.swappanel { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center; justify-content: center; background: rgba(0, 10, 14, .82); }
.swappanel[hidden] { display: none; }
.swapbox { display: flex; flex-direction: column; align-items: center; gap: 14px; background: var(--panel); border: 4px solid var(--brand); border-radius: 30px; padding: 30px 50px; text-align: center; }
.swapbox b { font-size: 48px; font-weight: 800; }
.swapbox p { margin: 0; font-size: 28px; }
.swapbox canvas { width: 420px; height: 420px; border-radius: 18px; background: #fff; }

/* زر الأقسام ولوحتها */
#pick-secs.sectabs { position: relative; display: flex; justify-content: center !important; flex-wrap: nowrap; overflow: visible !important; z-index: 4; }
#pick-secs.sectabs[hidden] { display: none; }
.secbtn { font: inherit; font-size: 32px; font-weight: 800; color: #fff; background: var(--brand-deep); border: 3px solid var(--brand); border-radius: 99px; padding: 8px 30px; cursor: pointer; }
.secpanel { position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 4; width: min(1500px, calc(var(--sw, 1920px) - 160px)); display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding: 22px; background: var(--panel); border: 3px solid var(--brand); border-radius: 26px; box-shadow: 0 16px 40px rgba(0, 6, 10, .7); }
.secpanel .sectab { font-size: 28px; }
html.phone .secbtn { font-size: 38px; }
html.phone .secpanel .sectab { font-size: max(32px, var(--min-fs, 0px)); padding: 8px 20px; }   /* كانت 11.5 ظاهرة على 844×390 (مراجعة آبل 2026-11-07) */

.howbox { max-width: 1500px; text-align: start; align-items: stretch; }
.howbox b { text-align: center; }
.howbox ul { margin: 0; padding-inline-start: 40px; display: flex; flex-direction: column; gap: 12px; font-size: 32px; line-height: 1.45; }
.howbox #howclose { align-self: center; font-size: 30px; padding: 10px 50px; }
.howbox .howhelp { margin: 0; text-align: center; font-size: 32px; color: var(--muted, inherit); }
.howbox .howhelp a { display: inline-flex; align-items: center; gap: .35em; min-height: 56px; padding-inline: 8px; color: inherit; text-decoration: none; }
.sup-ic{width:1.25em;height:1.25em;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
html.phone .howbox .howhelp { font-size: 36px; }
html.phone .howbox .howhelp a { min-height: 110px; }
html.phone .howbox ul { font-size: 36px; }

/* «الكل»: عنوان لكل قسم فوق فئاته */
#s-pick .catgrid .sechead { grid-column: 1 / -1; font-size: 34px; font-weight: 800; color: var(--brand-text); padding: 14px 6px 2px; border-bottom: 2px solid rgba(255, 255, 255, .12); }
html.phone #s-pick .catgrid .sechead { font-size: 40px; }
/* الصفوف بارتفاع محتواها (عناوين الأقسام أقصر من البطاقات)، والبطاقة بحد أدنى بدل الصف الثابت */
#s-pick .catgrid { grid-auto-rows: max-content !important; }   /* «auto» في شبكة بارتفاع محدد ينكمش للحد الأدنى فيخرج الكلام (درس 2026-11-03) */
#s-pick .catcard { min-height: 112px; }
html.phone #s-pick .catcard { min-height: 120px; }
html.portrait #s-pick .catcard { min-height: 150px; }

/* ===== فحص «ما في كلام برا إطاره» 2026-10-19 ===== */
.team .tn, .team .tturn { max-width: 100%; min-width: 0; box-sizing: border-box; }
.team .tturn { white-space: nowrap; }
.team .tturn.wrap { white-space: normal; line-height: 1.2; }
.team .tlife { flex-wrap: wrap; justify-content: center; max-width: 100%; }
#q-status { text-overflow: clip; }
#q-status.wrap { white-space: normal; border-radius: 30px; line-height: 1.3; }
.splash .sqt { text-overflow: clip; }
.splash .sqt.wrap { white-space: normal; line-height: 1.3; }
html.phone .splash .sqt { padding-left: 60px; padding-right: 60px; }
.slot .nm { padding-bottom: 8px; }
.slot .nm { line-height: 1.2; padding-top: 0; }
.slot .nm small { line-height: 1.25; }
#s-pick .catcard { padding-bottom: 10px; }
#s-pick .catgrid .morecards { grid-column: 1 / -1; text-align: center; font-size: 40px; opacity: .5; padding: 10px; }

/* =====================================================================================================
   طبقة «ليلة الديوانية» (تجربة Impeccable 2026-10-19). آخر الملف تغلب ما قبلها.
   المبادئ: سؤال بحجم عنوان، إجابة مكشوفة ورقية هي أفتح عنصر، لون الفريق للفريق فقط، بلا ظل نص ولا إيموجي،
   حركة واحدة مقصودة (كشف الإجابة وتبدّل الدور)، والأرقام Rubik بعرض ثابت.
   ===================================================================================================== */
html, body { background: var(--bg); }
#stage { background: var(--bg); }
#stage, #stage * { text-shadow: none; }
.slot, .team, .trap, .catcard, .chip, .prechip, .status, .lobcfg span, .moments span, .fin, .nom { box-shadow: none; }

/* الجو: إضاءة ثابتة خفيفة من فوق (بلا حركة)، والرسم الحرفي ذهبي خافت */
#stage::before { animation: none; will-change: auto; background: radial-gradient(1100px 620px at 50% -8%, rgba(251, 172, 40, .10), transparent 70%), radial-gradient(900px 600px at 50% 112%, rgba(76, 141, 255, .07), transparent 70%); }
.bgart { color: var(--gold-text); opacity: .11; }
.logo { letter-spacing: 0; }
.logo span { color: var(--gold-text); }
.sub { font-size: 38px; font-weight: 500; color: var(--muted); }
h1 { letter-spacing: 0; }

/* ---------- أيقونات الأزرار ---------- */
#join-live::before, #cast::before, #how::before, #fs::before, #swap::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-inline-end: .4em; vertical-align: -.14em; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
#join-live::before { --ic: var(--i-phone); } #cast::before { --ic: var(--i-tv); } #how::before { --ic: var(--i-help); }
#fs::before { --ic: var(--i-expand); } #swap::before { --ic: var(--i-phone); }
.tlife .lp::before, .tlife .lh::before, .tl::before, .splashbtn::before { content: ""; display: inline-block; width: 1em; height: 1em; margin-inline-end: .3em; vertical-align: -.14em; background: currentColor; -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.tlife .lp::before { --ic: var(--i-skip); } .tlife .lh::before { --ic: var(--i-bulb); } .tl::before { --ic: var(--i-warn); }
#stage .timeup b.ic { width: 190px; height: 190px; font-size: inherit; color: var(--warn); animation: ring 1s ease-in-out infinite; }
#stage .paused b.ic { width: 170px; height: 170px; color: var(--warn); }
.rotate b.ic { width: 84px; height: 84px; font-size: inherit; }

/* ---------- الإعداد ---------- */
.setup { gap: 26px; }
.setup .logo { font-size: 132px; line-height: 1.15; }
.tin span { font-size: 30px; font-weight: 700; color: var(--tct); }
.tin input { background: var(--panel); border: 3px solid var(--line-soft); border-color: var(--tc); border-radius: 22px; font: 700 50px/1.3 var(--txt); padding: 14px 30px 18px; }
.tin input:focus-visible:where(html.keyboard-nav *) { border-color: var(--tc); }
.optrow > span { font-size: 32px; font-weight: 500; color: var(--muted); }
.opt { background: transparent; border: 3px solid var(--line); color: var(--text); border-radius: 18px; font: 600 46px/1 var(--num); min-width: 128px; padding: 14px 26px; }
.opt.on { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.gobtn { background: var(--gold); color: var(--ink); border: 0; font-weight: 800; box-shadow: 0 10px 24px rgba(0, 0, 0, .35); text-shadow: none; }
.gobtn:disabled { background: var(--panel-2); color: var(--muted); opacity: 1; box-shadow: none; }
.gobtn.alt { background: transparent; color: var(--text); border: 3px solid var(--line); box-shadow: none; font-weight: 700; font-size: 36px; padding: 18px 46px; }
.linkbtn { color: var(--muted); font-weight: 500; }

/* ---------- الباركود ---------- */
.pair p { font-weight: 500; }
.code { color: var(--gold-text); }
#qr { animation: none; background: #fff; }
#s-pair.paired #pair-msg { color: var(--ok); }
.pairtitle { font-weight: 800; }
.pchip { background: var(--panel); border: 2px solid var(--line-soft); font-weight: 700; }
.toast { background: var(--panel-2); border: 2px solid var(--gold); color: var(--text); box-shadow: 0 14px 34px rgba(0, 0, 0, .5); }

/* ---------- اختيار الفئات ---------- */
#s-pick h1 { font-size: 56px; }
.turnpill, #stage .turnpill { background: var(--tcd); border-color: transparent; font-weight: 800; }
.secbtn { background: transparent; border: 3px solid var(--line); color: var(--text); font-weight: 700; }
.secpanel { background: var(--panel); border: 2px solid var(--line-soft); }
.sectab { border-color: var(--line-soft); background: transparent; color: var(--text); }
.sectab.on { background: var(--gold); border-color: var(--gold); color: var(--ink); }
#s-pick .catcard { background: var(--panel); border: 2px solid var(--line-soft); }
#s-pick .catcard b { font-weight: 700; color: var(--text); }
#s-pick .catcard.tap:hover { border-color: var(--gold); }
#s-pick .catcard.taken { background: var(--tcd); border-color: var(--tc); }
#s-pick .catcard.taken b, #s-pick .catcard.taken small { color: #fff; }
#s-pick .catgrid .sechead { color: var(--gold-text); font-weight: 700; border-bottom-color: var(--line-soft); }
.catcard.soon small { color: var(--muted); }
#stage button:focus-visible:where(html.keyboard-nav *), #stage input:focus-visible:where(html.keyboard-nav *), .catcard.tap:focus-visible:where(html.keyboard-nav *) { outline: 6px solid var(--gold-text); outline-offset: 6px; }
.hb { background: transparent; border: 3px solid var(--line); color: var(--text); font-weight: 700; }
.hb.main { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.nom { background: var(--panel); border: 4px solid var(--tc); font-weight: 800; }
.nom.flash, .nom.win { background: var(--tcd); color: #fff; }

/* ---------- شاشة السؤال ---------- */
.q { gap: 10px; }
.qhead { height: 62px; gap: 14px; justify-content: center; }
#stage .qhead .chip, #stage .qhead.t-a .chip, #stage .qhead.t-b .chip, #stage .qhead.pass .chip, #stage .qhead #q-count, #stage .qhead #q-cat { height: auto; padding: 0; background: transparent; border: 0; color: var(--muted); font-size: 32px; font-weight: 500; }
#stage .qhead #q-count { color: var(--gold-text); font-family: var(--num); font-weight: 600; font-size: 30px; }
#stage .qhead #q-count + #q-cat::before { content: "·"; margin-inline-end: 14px; color: var(--line); }
#stage .qhead #q-cat { color: var(--text); font-weight: 700; }
#stage .prechip { height: auto; padding: 6px 24px 8px; font-size: 28px; font-weight: 700; background: transparent; border: 2px solid var(--gold); color: var(--gold-text); animation: none; margin-inline-start: 0; }

/* السؤال عنوان مباشر على الخلفية، وخط سفلي بلون صاحب الدور */
#stage .qtitle, #stage .qtitle.t-a, #stage .qtitle.t-b, #stage .qtitle.pass { background: transparent; border: 0; border-bottom: 1px solid var(--tc, var(--gold)); border-radius: 0; box-shadow: none; color: var(--text); font-size: 68px; font-weight: 800; line-height: 1.3; padding: 4px 28px 16px; width: fit-content; max-width: 1780px; margin: 0 auto; overflow: hidden; }
#stage .qtitle.pass { border-bottom-color: var(--action); }
.qtitle::before, .qtitle::after { display: none !important; }

/* بطاقة الفريق */
.mid { grid-template-columns: 310px 1fr 310px; gap: 32px; }
.team { background: var(--panel); border: 2px solid var(--line-soft); border-color: var(--tc); border-radius: 28px; padding: 18px 16px 18px; }
.team .tn { font-size: 36px; font-weight: 700; color: var(--tct); }
.team .ts { font-family: var(--num); font-size: 84px; font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.ring .rbg { stroke: rgba(255, 255, 255, .10); }
.ring .rfg { stroke: var(--tc); }
.ring .rt { font-weight: 600; }
.ring::before, .ring::after { display: none; }
.team .tturn { font-weight: 700; color: var(--muted); }
.tlife span { background: rgba(255, 255, 255, .07); border: 2px solid var(--line-soft); color: var(--text); font-weight: 700; height: 48px; }
.tlife .lp, .tlife .lh, .team.on .tlife .lp, .team.on .tlife .lh { background: rgba(255, 255, 255, .07); border-color: var(--line-soft); }
.tlife span.used { background: transparent; opacity: .4; text-decoration: line-through; }
.tlife .lh b { font-family: var(--num); font-weight: 600; }
/* الدور: البطاقة تمتلئ بدرجة الفريق الغامقة، بلا توهج ولا تنفس */
#stage .team.on { background: var(--tcd); border-color: var(--tc); border-top-color: #fff; color: #fff; box-shadow: none; animation: none; }
#stage .team.on::before { display: none; }
#stage .team.on .tn, #stage .team.on .ts, #stage .team.on .ring .rt { color: #fff; text-shadow: none; }
#stage .team.on .tturn { background: #fff; color: var(--tcd); animation: none; }
#stage .team.on .tlife span, #stage .team.on .tlife .lp, #stage .team.on .tlife .lh { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .3); color: #fff; }

/* الخانات */
.board { gap: 12px 22px; }
#stage .slot { border-radius: 18px; gap: 18px; padding: 0 20px 0 22px; font-size: 40px; }
#stage .slot .rank { width: 62px; height: 62px; border-radius: 14px; font-size: 36px; font-weight: 600; }
.slot .nm { font-weight: 800; font-size: 40px; }
.slot .pts { font-weight: 600; }
/* المخفية: ظلام هادئ ورقم ذهبي مخطّط */
#stage .slot.hid { background: var(--panel); border: 2px solid var(--line-soft); color: var(--muted); }
#stage .slot.hid .rank { background: transparent; border: 2.5px solid var(--gold); color: var(--gold-text); }
#stage .slot.hid .pts { color: var(--muted); font-size: 38px; }
.slot.hid::after { display: none; }
/* المكشوفة: ورق كريمي بحبر داكن، أفتح عنصر في الشاشة؛ ولون الفريق على مربع الترتيب فقط */
#stage .slot.open, #stage .slot.open.t-a, #stage .slot.open.t-b { background: var(--paper); color: var(--ink); border: 0; animation: none; }
#stage .slot.open.flip, #stage .slot.open.t-a.flip, #stage .slot.open.t-b.flip { animation: flip .6s var(--ease-out); }
#stage .slot.open .rank, #stage .slot.open.t-a .rank, #stage .slot.open.t-b .rank { background: var(--tcd); color: #fff; box-shadow: none; }
#stage .slot.open .nm small, #stage .slot.open.t-a .nm small, #stage .slot.open.t-b .nm small { color: var(--ink-soft); opacity: 1; font-weight: 500; }
#stage .slot.open .pts { color: var(--ink); font-size: 36px; font-weight: 700; }
.slot.open::after { display: none !important; }
#stage .slot.none { background: transparent; border: 2px dashed var(--line); color: var(--muted); opacity: 1; }
#stage .slot.none .rank { background: transparent; border: 2px solid var(--line-soft); color: var(--muted); }
#stage .slot.hinted { background: var(--panel); border: 2px dashed var(--gold); animation: none; }
#stage .slot.hinted .rank { border-color: var(--gold); }
.slot .nm.hint { color: var(--hint); font-weight: 600; font-size: 30px; }
.slot.hinted::before { display: none; }
.slot.hintpop { animation: none; }

/* الفخاخ: حمراء منقّطة قبل الوقوع، ومصمتة بعده */
#traps .tl { color: var(--bad-text); font-weight: 700; font-size: 26px; }
#stage .trap { font-size: 30px; font-weight: 600; background: transparent; border: 2px solid var(--line-soft); color: var(--text); height: 58px; }
#stage .trap:not(.open) { background: transparent; border: 2px dashed var(--bad); color: var(--bad-text); animation: none; }
#stage .trap.open { background: var(--panel); border-color: var(--bad); }
#stage .trap.hit, #stage .trap.hit.t-a, #stage .trap.hit.t-b { background: var(--bad); border-color: var(--bad); color: #fff; animation: none; }
.trap::before { display: none !important; }

/* شريط الحالة: سطر بسيط بلا إطار */
#stage #q-status, #stage #q-status.t-a, #stage #q-status.t-b, #stage #q-status.pass { background: transparent; border: 0; border-radius: 0; color: var(--tct, var(--text)); font-size: 38px; font-weight: 700; padding: 4px 30px 8px; }
#stage #q-status.pass { color: var(--action); }
#stage #q-status.hint { color: var(--hint); background: transparent; }
#stage #q-status::before, #stage #q-status::after { display: none; }
#q-status .src { color: var(--muted); font-weight: 500; opacity: 1; }
#q-status.wrap { border-radius: 0; }

/* ---------- النتيجة النهائية ---------- */
.winner { font-size: 120px; color: var(--gold-text); font-weight: 800; }
.fin { background: var(--panel); border: 2px solid var(--line-soft); border-color: var(--tc); border-radius: 28px; animation: none; }
.fin span { font-weight: 700; }
.fin b { font-family: var(--num); font-weight: 700; font-size: 116px; }
#stage .fin.win { background: var(--tcd); border-color: var(--tc); border-top-color: #fff; animation: none; transform: none; }
#stage .fin.win span, #stage .fin.win b { color: #fff; }
#stage .moments span, #stage .moments span:nth-child(n) { background: var(--panel); border: 2px solid var(--line-soft); color: var(--text); font-weight: 600; font-size: 32px; }
.moments span { animation: none; }
.lobcfg span, .lobcfg span:nth-child(n) { background: var(--panel); border-color: var(--line-soft); color: var(--text); font-weight: 600; }

/* ---------- الطبقات فوق اللعب ---------- */
.overlay, #stage .timeup, #stage .paused { background: rgba(8, 12, 27, .84); }
.overlay b { font-weight: 800; }
.ov-trap b { color: var(--bad-text); } .ov-pass b { color: var(--action); } .ov-wrong b { color: #ff5d7d; } .ov-dk b { color: var(--text); }
.timeup span { color: var(--bad-text); }
.timeup small, .splash span { background: var(--tcd); color: #fff; }
.splash small { color: var(--muted); font-weight: 500; opacity: 1; }
.splash b { color: var(--gold-text); }
.splash .sqt { color: var(--text); }
.pop { color: #fff; -webkit-text-stroke: 3px var(--tcd); }
.paused span { color: var(--text); }
.swapbox { background: var(--panel); border: 2px solid var(--line); }
.fsbtn { background: transparent; border: 2px solid var(--line-soft); color: var(--muted); font-weight: 600; }
.swapbtn { background: transparent; border: 2px solid var(--line-soft); color: var(--muted); }
.mutedtag { background: var(--bad); }
.sound { color: var(--muted); }
.rotate { background: var(--bg); }
.castoff { color: var(--text); }

/* تصحيحات بعد اللقطة الأولى */
#stage .qhead .chip, #stage .qhead #q-count, #stage .qhead #q-cat { line-height: 1.65; padding: 2px 0 8px; height: auto; }
/* حافة الفريق العليا: ظل داخلي يتبع التدوير بدل حد علوي يلتف عند الزوايا */
.team { border-top: 2px solid var(--line-soft); box-shadow: none; padding-top: 30px; }
#stage .team.on { border-top-color: var(--tc); box-shadow: none; padding-top: 18px; }
.fin { border-top: 2px solid var(--line-soft); box-shadow: none; padding-top: 40px; }
#stage .fin.win { border-top-color: var(--tc); box-shadow: none; padding-top: 30px; }
.tin input { box-shadow: none; padding-top: 24px; }
#stage .qtitle, #stage .qtitle.t-a, #stage .qtitle.t-b, #stage .qtitle.pass { border-bottom-width: 6px; }
#stage .slot.none .pts { color: var(--muted); }
#stage .slot.none .nm { color: var(--text); }
#stage .slot.none .nm small { color: var(--muted); }
   طبقة مهارة إميل كوفالسكي (تجربة 2026-10-19): الحركة تخدم غرضاً (تغذية راجعة، حالة، تواصل المكان) أو تنحذف.
   القاعدة: ما يراه اللاعب عشرات المرات (خانات خاملة، عنوان السؤال، شريط الدور) ثابت؛ والحركة للحظات: كشف جواب، تبدّل دور،
   فخ، لعبة جديدة، فوز. كل الدخول بمنحنى خروج حاد (--ease-out)، وأقل من 300ms للواجهة، وtransform وopacity فقط.
   ===================================================================================================== */

/* ---- 1) نشيل الحركات المحيطة الدائمة (زخرفة بلا غرض على شاشة معلومات): اللمعات والنبض والتوهج الخاملة ---- */
#stage::before { animation: none; will-change: auto; }
.slot.hid::after, .slot.open.t-a::after, .slot.open.t-b::after, .qtitle::after, #q-status::after { animation: none; display: none; }
.qtitle::before, .slot.hinted::before, .trap:not(.open)::before, #q-status::before, .trap.open.hit::before { animation: none; opacity: 0; }
.slot.hinted { border-color: #FBAC28; }                         /* المساعدة ثابتة بدل نبضها: حالة لا حركة */
.trap:not(.open) { box-shadow: 0 0 0 3px rgba(255, 80, 110, .22), 0 10px 28px rgba(0, 6, 10, .6); }
.prechip:not([hidden]) { animation: none; }
#qr { animation: none; box-shadow: 0 0 0 14px rgba(0, 246, 225, .14); }
.team.on .tturn { animation: none; will-change: auto; }
.ring.low .rt { animation: none; }                                /* نبض واحد على الحلقة يكفي (كان على الحلقة والرقم معاً) */
.timeup b { animation: ring 1s var(--ease-in-out) 2; will-change: auto; }   /* الجرس يدق مرتين ويقف، لا يدق للأبد */
.fin.win { animation: winin 560ms var(--ease-settle) both; }
@keyframes winin { from { opacity: 0; transform: scale(.9) translateY(24px); } }
.lobt { animation: lobin 520ms var(--ease-settle) backwards; }
@keyframes lobin { from { opacity: 0; transform: translateY(20px) scale(.94); } }
.moments span { animation: lobin 420ms var(--ease-out) backwards; }
.moments span:nth-child(2) { animation-delay: 80ms; } .moments span:nth-child(3) { animation-delay: 160ms; }
.rotate b { animation: rot 2.4s var(--ease-in-out) 2; }          /* تلميح اللف: مرتين ويقف */
.team.on::before { animation-duration: 3.2s; }                    /* الباقي الوحيد: توهج بطاقة صاحب الدور (حالة)، على الشفافية فقط، أبطأ وأهدأ */

/* ---- 2) كشف الجواب: لحظة اللعبة الأهم. قلبة قوية الخروج 440ms بدل 700ms، ورقم الترتيب ينط بعدها بلحظة ---- */
.slot { transform-origin: 50% 50%; }
@keyframes flip { 0% { transform: perspective(900px) rotateX(78deg) scale(.96); opacity: 0; } 45% { opacity: 1; } 100% { transform: none; opacity: 1; } }
.slot.flip, .slot.open.t-a.flip, .slot.open.t-b.flip { animation: flip 280ms var(--ease-out) backwards; }
@keyframes rankpop { 0% { transform: scale(.7); } 60% { transform: scale(1.12); } 100% { transform: none; } }
.slot.flip .rank { animation: rankpop 180ms var(--ease-settle) 100ms backwards; }
.slot.hintpop { animation: hintpop 700ms var(--ease-out); }
@keyframes hintpop { 0% { box-shadow: 0 0 0 0 var(--hint); transform: scale(1); } 35% { box-shadow: 0 0 0 12px rgba(251, 172, 40, .4); transform: scale(1.03); } 100% { box-shadow: 0 0 0 0 transparent; transform: none; } }

/* ---- 3) النقاط الطايرة: تظهر من تحت بدل ما تنكبر من الصفر، وتطلع بخروج حاد ---- */
.pop { animation: pop 1.1s var(--ease-out) forwards; }
@keyframes pop { 0% { opacity: 0; transform: translate(-50%, 14px) scale(.86); } 16% { opacity: 1; transform: translate(-50%, -26px) scale(1.08); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -120px) scale(1); } }

/* ---- 4) التلميحات الكبيرة (غلط، فخ، باس): تدخل بسرعة 180ms وتخرج بتلاشٍ 260ms (دخول سريع، خروج أهدأ).
   المدة الكلية تجي من --ov (يحطها tv.js)، فما ينقطع التلاشي لو قصر الوقت. الغلط يهتز أفقياً قبل ما يهدأ (اهتزاز = رفض) ---- */
.overlay.go { animation: ovin 180ms var(--ease-out) both, ovout 260ms ease-out calc(var(--ov, 1900ms) - 260ms) forwards; }
.overlay.go b, .overlay.go span { animation: ovpop 300ms var(--ease-out) both; }
.overlay.go span { animation-delay: 70ms; }
.ov-wrong.go b { animation: wrongin 440ms var(--ease-out) both; }
@keyframes ovin { from { opacity: 0; } }
@keyframes ovout { to { opacity: 0; } }
@keyframes ovpop { from { opacity: 0; transform: translateY(14px) scale(.9); } }
@keyframes wrongin { 0% { opacity: 0; transform: scale(.85); } 28% { opacity: 1; transform: scale(1.05); } 42% { transform: translateX(-18px); } 56% { transform: translateX(14px); } 70% { transform: translateX(-8px); } 84% { transform: translateX(4px); } 100% { transform: none; } }

/* ---- 5) إعلان بداية السؤال: ينكبر من 96% (لا من 112%) ويدخل كلامه بالتتابع 70ms؛ بلا نبض مستمر ---- */
.splash.go { animation: splashin 300ms var(--ease-out) both; }
@keyframes splashin { from { opacity: 0; transform: scale(.97); } }
.splash.go > * { animation: splashkid 420ms var(--ease-out) backwards; }
.splash.go > :nth-child(2) { animation-delay: 70ms; } .splash.go > :nth-child(3) { animation-delay: 140ms; }
.splash.go > :nth-child(4) { animation-delay: 210ms; } .splash.go > :nth-child(5) { animation-delay: 280ms; }
@keyframes splashkid { from { opacity: 0; transform: translateY(18px) scale(.96); } }
.splash b, .splash .sqt { animation: none; will-change: auto; }
.splash.go b, .splash.go .sqt { animation: splashkid 420ms var(--ease-out) backwards; }
.splash.go b { animation-delay: 70ms; } .splash.go .sqt { animation-delay: 140ms; }

/* ---- 6) انتقال الدور: بطاقة الفريق اللي صار دوره تنزل مكانها بنطة خفيفة (الألوان تتبدل فوراً بقرار الأداء القديم) ---- */
.team.on { animation: teamarrive 380ms var(--ease-settle) backwards; }
@keyframes teamarrive { from { transform: scale(.965); } }
.team { transition: none; }

/* ---- 7) الترشيح والقرعة: الفائز يكبر بنطة، والخاسر يخفت ويصغر قليلاً؛ بلا انتقال ألوان ---- */
.nom { transition: opacity 240ms var(--ease-out), transform 380ms var(--ease-settle); }
.nom.win { transform: scale(1.06); }
.nom.lose { opacity: .3; transform: scale(.96); }

/* ---- 8) الأزرار: ضغطة تصغّر الزر 3% بسرعة (أنا سمعتك)، والرجوع أبطأ؛ التحويم للماوس فقط؛ الريموت: تركيز يكبّر ---- */
.gobtn, .hb, .opt, .sectab, .secbtn, .fsbtn, .swapbtn, .linkbtn, .catcard.tap, #stage .tin input {
  transition: transform var(--t-press) var(--ease-out), opacity var(--t-press) var(--ease-out); -webkit-tap-highlight-color: transparent; }
.gobtn:not(:disabled):active, .hb:active, .opt:active, .sectab:active, .secbtn:active, .fsbtn:active, .swapbtn:active, .catcard.tap:active { transform: scale(.97); transition-duration: 70ms; }
@media (hover: hover) and (pointer: fine) {
  .gobtn:not(:disabled):hover, .hb:hover, .opt:hover, .swapbtn:hover { transform: translateY(-2px); }
  .gobtn:not(:disabled):hover:active, .hb:hover:active, .opt:hover:active { transform: scale(.97); }
  .fsbtn:hover { opacity: 1; }
  .catcard.tap:hover { transform: none; }
}
#stage .gobtn:focus-visible:where(html.keyboard-nav *), #stage .hb:focus-visible:where(html.keyboard-nav *), #stage .opt:focus-visible:where(html.keyboard-nav *) { transform: scale(1.04); }
#stage .catcard.tap:focus-visible:where(html.keyboard-nav *) { transform: scale(1.03); }
.opt { transition-property: transform, opacity; }

#s-pick .catcard.tap { transition: transform var(--t-press) var(--ease-out); }
#s-pick .catcard.tap:active { transform: scale(.96); transition-duration: 70ms; }

/* ---- 9) النوافذ والقوائم تنبثق من مكانها: لوحة الأقسام من زرها (أصل علوي)، والنوافذ المنبثقة من الوسط (أصل مركزي) ---- */
.secpanel { transform-origin: 50% 0; animation: panelin var(--t-ui) var(--ease-out) backwards; }
@keyframes panelin { from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(.97); } }
.swappanel, .howpanel, .paused, .timeup { animation: fadein 200ms var(--ease-out) backwards; }
.swapbox { animation: boxin 260ms var(--ease-out) backwards; }
@keyframes fadein { from { opacity: 0; } }
@keyframes boxin { from { opacity: 0; transform: scale(.96) translateY(8px); } }
.toast:not([hidden]) { animation: toastin 240ms var(--ease-out) backwards; }
@keyframes toastin { from { opacity: 0; transform: translateX(-50%) translateY(-14px); } }
.passarrow { will-change: auto; }

/* ---- 10) الكونفيتي: يسقط بـtransform لا بـtop (كان يحرّك التخطيط 120 قطعة)، ومنحنى يسرّع شوي مثل السقوط ---- */
.confetti i { top: -40px; animation: fall 3s cubic-bezier(0.3, 0.1, 0.7, 0.9) forwards; }
@keyframes fall { from { transform: translateY(0) rotate(0); } to { transform: translateY(1180px) rotate(720deg); } }

/* ---- 11) تقليل الحركة: الشفافية فقط، بلا تحريك مكان أو حجم (تقليل الحركة ما يعني صفر حركة) ---- */
@keyframes fadeonly { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .overlay.go, .overlay.go b, .overlay.go span, .ov-wrong.go b, .splash.go, .splash.go > *, .splash.go b, .splash.go .sqt, .toast:not([hidden]), .secpanel, .swapbox, .fin.win, .lobt, .moments span, .slot.flip, .slot.open.t-a.flip, .slot.open.t-b.flip, .team.on { animation: fadeonly 150ms linear both !important; }
  .slot.flip .rank, .timeup b, .rotate b { animation: none !important; }
  .confetti i, .pop { animation-duration: .01s !important; }
  .gobtn:active, .hb:active, .opt:active, .sectab:active, .secbtn:active, .catcard.tap:active, #stage .gobtn:focus-visible:where(html.keyboard-nav *), #stage .hb:focus-visible:where(html.keyboard-nav *) { transform: none; }
}
/* ترتيب ثابت بالطول والعرض: خمس يمين وخمس يسار، والحادي عشر تحتهما. */
#board.board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(5, minmax(0, 1fr)); grid-auto-flow: column; }
#board.board.l11 { grid-template-rows: repeat(6, minmax(0, 1fr)); }
#board .slot:nth-child(-n+5) { grid-column: 1; }
#board .slot:nth-child(n+6):nth-child(-n+10) { grid-column: 2; }
#board .slot:nth-child(5n+1) { grid-row: 1; }
#board .slot:nth-child(5n+2) { grid-row: 2; }
#board .slot:nth-child(5n+3) { grid-row: 3; }
#board .slot:nth-child(5n+4) { grid-row: 4; }
#board .slot:nth-child(5n+5) { grid-row: 5; }
#board.board.l11 .slot:nth-child(11) { grid-column: 1 / -1; grid-row: 6; }

/* عزل الرئيسية في شاشة العرض؛ تنسيق الحكم المشترك يبقى كما هو. */
html:root { --home-nav-height: 0px; }



/* =====================================================================================================
   كل زعفراني بلون الشعار المعتمد وشوائبه (قرار المالك 2026-10-20: «أي شي لونه أصفر أو زعفراني سوّه نفس لون الشعار
   مع الشوائب بالضبط»). الخامة media/brand/saffron.webp (نفس خامة ستة في ستة). التعبئة: الخامة فوق اللون الأصلي احتياطاً؛
   الكتابة: الخامة مقصوصة على الحروف. محددات أعلى لأن قواعد «ليلة الديوانية» فوق أخص.
   ===================================================================================================== */
html body:not(#x) .opt.on, html body:not(#x) .gobtn:not(.alt):not(:disabled), html body:not(#x) .sectab.on, html body:not(#x) .hb.main {
  background: url("media/brand/saffron.webp") center / 360px, #FBAC28; color: #1B1633; }
html body:not(#x) .gobtn:not(.alt):not(:disabled) { box-shadow: 0 9px 30px rgba(0, 0, 0, .35), 0 14px 24px rgba(0, 0, 0, .35); }
html body:not(#x) .logo span, html body:not(#x) .code, html body:not(#x) #s-pick .catgrid .sechead, html body:not(#x) #stage .qhead #q-count,
html body:not(#x) #stage .slot.hid .rank, html body:not(#x) .winner, html body:not(#x) .splash b {
  background: none; color: var(--gold-text, #FBAC28); -webkit-text-fill-color: currentColor; }
html body:not(#x) .winner *, html body:not(#x) .splash b * { -webkit-text-fill-color: currentColor; }
/* التلميح المكشوف في الخانة: كتابته بالخامة، والحد المتقطع بلون الشعار المصمت (الخامة ما تُرسم على حد متقطع) */
html body:not(#x) #stage .slot .nm.hint { background: none; color: var(--gold-text, #FBAC28); -webkit-text-fill-color: currentColor; }
html body:not(#x) #stage .slot.hinted, html body:not(#x) #stage .slot.hinted .rank { border-color: #FBAC28; }

/* قياس شاشة الجوال الفعلية (طلب المالك 2026-10-20 بعد بلاغ أندرويد: «غيّر السؤال» و«ابدأ الوقت» مختفية): كروم أندرويد يكبّر الكلام
   حسب حجم خط الجوال فيدفع الأزرار تحت؛ نثبّت حجم الصفحة، والجوال يكبّر بالتكبير العادي. والارتفاع من الشاشة الظاهرة فعلاً (--app-h) */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 2026-10-22: قيد العنوان يعلو على قاعدة المسرح ذات المعرّف؛ العرض يُقاس داخل الشاشة الطولية. */
html.portrait #stage .qtitle { max-width: 100%; min-width: 0; box-sizing: border-box; }

/* الدفعة أ: نهاية شبكة الفئات محجوزة للأزرار، والزر لا ينكسر عند ضيق العرض. */
#s-pick { padding-bottom: 190px; }
#s-pick .catgrid { min-height: 0; flex: 1 1 auto; padding-bottom: 24px; }
.hostbar { max-width: calc(100% - 96px); justify-content: center; }
.hostbar .hb { white-space: nowrap; flex: 0 1 auto; }
html.portrait #s-pick { padding-bottom: 220px; }

.setup-preserve { font-size: 18px; line-height: 1.5; max-width: 50ch; margin: 4px auto; }
.game-choice { color: var(--gold-text); min-height: 44px; padding: 10px; }
.pick-filters { display: grid; grid-template-columns: auto minmax(180px, 1fr) auto auto; align-items: center; justify-content: center; gap: 16px; width: min(100%, 1400px); margin-block: 8px; font-size: 30px; }
.pick-filters input[type="search"] { min-width: 0; width: 100%; box-sizing: border-box; min-height: 70px; padding: 12px 16px; color: var(--text, #F5EEDC); background: var(--panel, #1C3B41); border: 3px solid var(--line-strong, #7A989E); border-radius: 12px; font: inherit; }
.ready-filter { display: flex; align-items: center; gap: 12px; min-height: 70px; }
.ready-filter input { width: 36px; height: 36px; accent-color: var(--gold, #FBAC28); }
.pick-empty { grid-column: 1 / -1; font-size: 24px; line-height: 1.8; }
html.portrait .pick-filters { grid-template-columns: auto minmax(0, 1fr); gap: 12px 20px; font-size: 46px; }
html.portrait .pick-filters input[type="search"] { min-height: 124px; }
html.portrait .ready-filter { min-height: 124px; }
html.portrait .ready-filter input { width: 62px; height: 62px; }
html.portrait #pick-clear { min-height: 124px; font-size: 42px; }

/* مكان الزر ضمن رأس السؤال الموجود، محسوب بمقياس المسرح. */
#stage .qhead {  flex-shrink: 0; }

/* الأهداف مقاسة بعد تصغير المسرح، لا بحجمه المنطقي وحده. */
#stage :is(button, input, summary, a[href]) { min-height: var(--touch-min, 44px); min-width: var(--touch-min, 44px); box-sizing: border-box; }
#stage .tin input { width: 100%; }
/* العدّاد بحجم عنوان الحقل ولون النص: كان رمادياً أصغر من العنوان فلا يُرى من الكنبة (تدقيق 2026-11-19، البند 72) */
#stage .name-count { display: block; direction: ltr; text-align: end; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; color: var(--text); }
#stage .tin .name-count { margin-top: 0; }
#s-setup, #s-pick { overflow-y: auto; }
/* الحد الأدنى الصريح للمس (44) يلغي الحد التلقائي بالمحتوى، فينضغط الزر داخل العمود المرن ويطلع كلامه (درس 2026-10-23: زر «التالي» في تلفزيون 1920)؛ الشاشة تتمرر فلا ينضغط أحد */
#s-setup > *, #s-pick > * { flex-shrink: 0; }
.names, .mid, .vs, .finals, .noms { direction: rtl; }
#stage .team .tn, #stage .fin span { overflow-wrap: anywhere; }

#stage [role="button"] { min-height: var(--touch-min, 44px); min-width: var(--touch-min, 44px); }
/* لا يتوسط المحتوى الأطول من المسرح إلى إحداثيات سالبة؛ يبقى كله قابلاً للتمرير. */
#stage #s-setup { justify-content: safe center; }

#stage #s-pick .catcard[role="button"] { min-height: var(--touch-min, 44px); }
#stage #pick-secs { flex-direction: column; align-items: center; }
#stage .secpanel { position: static; transform: none; width: 100%; max-height: 500px; overflow-y: auto; flex: none; }

/* الفريق الأول يميناً في كل الشاشات، مثل ستة في ستة والقراءة من اليمين (قرار المالك 2026-11-01)؛ لوحة الأجوبة لها اتجاهها فلا تتأثر */
#judge .judge-middle, #stage .teamsin, #stage .mid { direction: rtl; }

/* إطار السدو شيل من كل الشاشات (قرار المالك 2026-11-02) */
.bgl-base .sadu { display: none; }

/* ===== الشاشة بالعرض: كل الإعداد ظاهر بلا تمرير (درس 2026-11-03: «التالي» كان تحت حافة الآيفون، وثلاثة أزرار تحت حافة التلفزيون) ===== */
html:not(.portrait) #stage #s-setup { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-content: center; align-content: safe center; justify-items: center; align-items: center; gap: 16px 56px; padding: 20px 56px; }
html:not(.portrait) #s-setup > :is(.logo, .sub, #go-pick, .altrow) { grid-column: 1 / -1; }
html:not(.portrait) #s-setup .logo { font-size: 104px; line-height: 1.1; }
html:not(.portrait) #s-setup > .sub { font-size: 38px; line-height: 1.3; }
html:not(.portrait) #s-setup .teamsin { flex-direction: column; gap: 14px; width: min(100%, 860px); }
html:not(.portrait) #s-setup .tin { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 8px 16px; }
html:not(.portrait) #s-setup .tin input { grid-column: 1 / -1; padding-block: 10px; }
html:not(.portrait) #s-setup .opts { gap: 14px; width: min(100%, 860px); }
html:not(.portrait) #s-setup .optrow { justify-content: flex-start; gap: 12px; }
html:not(.portrait) #s-setup .opt { padding-block: 10px; }
html:not(.portrait) #s-setup .optrow > span { min-width: 300px; }
html:not(.portrait) #s-setup .setup-preserve { font-size: 28px; line-height: 1.3; max-width: none; margin: 0; }
html:not(.portrait) #s-setup #go-pick { padding-block: 18px; }
html:not(.portrait) #s-setup .altrow { flex-wrap: nowrap; gap: 16px; }
html:not(.portrait) #s-setup .altrow > * { white-space: nowrap; }
html:not(.portrait) #s-setup .gobtn.alt { font-size: max(32px, var(--min-fs, 0px)); padding: 10px 30px; }
html:not(.portrait) #s-setup .linkbtn { font-size: max(32px, var(--min-fs, 0px)); display: flex; align-items: center; }

/* مربع «الجاهزة فقط»: الهدف بحجم اللمس، والمرسوم مربع عادي بدل مربع أبيض ضخم */
#stage .ready-filter[hidden] { display: none; }
#stage .ready-filter input { appearance: none; -webkit-appearance: none; position: relative; flex: none; margin: 0; background: none; border: 0; cursor: pointer; }
#stage .ready-filter input::before { content: ""; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); box-sizing: border-box; width: max(36px, calc(var(--touch-min, 44px) * .55)); height: max(36px, calc(var(--touch-min, 44px) * .55)); background: var(--panel); border: 3px solid var(--line); border-radius: 22%; }
#stage .ready-filter input:checked::before { background: var(--gold); border-color: var(--gold); }
#stage .ready-filter input:checked::after { content: "✓"; position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%); font: 800 calc(var(--touch-min, 44px) * .42)/1 var(--txt); color: var(--ink); }
.pick-filters .long { white-space: pre; }
#pick-filters:not(:has(#pick-search:not(:placeholder-shown))):not(:has(#pick-ready:checked)) #pick-clear { display: none; }

/* ===== اختيار الفئات بالعرض في كل المقاسات: الدور والأقسام والبحث صف واحد، والباقي للبطاقات ===== */
html:not(.portrait) #stage #s-pick { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); align-items: center; gap: 10px 18px; padding: 14px 56px 146px; overflow: hidden; }
html:not(.portrait) #s-pick > h1 { display: none; }
html:not(.portrait) #s-pick .turnpill { margin: 0; font-size: 38px; padding: 8px 32px; white-space: nowrap; }
html:not(.portrait) #stage #pick-secs { position: static; padding: 0; }
html:not(.portrait) #stage #s-pick .secpanel { position: absolute; inset: 150px 56px auto; transform: none; width: auto; max-height: 760px; z-index: 6; }
html:not(.portrait) #s-pick .secbtn { font-size: max(34px, var(--min-fs, 0px)); padding: 6px 26px; white-space: nowrap; }
html:not(.portrait) #s-pick .pick-filters { display: flex; width: auto; margin: 0; gap: 14px; font-size: max(30px, var(--min-fs, 0px)); min-width: 0; }
html:not(.portrait) #s-pick .pick-filters > label[for="pick-search"] { display: none; }
html:not(.portrait) #s-pick .pick-filters input[type="search"] { flex: 1 1 0; min-height: var(--touch-min, 44px); padding: 4px 22px; }
html:not(.portrait) #s-pick .ready-filter { min-height: var(--touch-min, 44px); gap: 6px; white-space: nowrap; flex: none; }
html:not(.portrait) #s-pick .pick-filters .long { display: none; }
html:not(.portrait) #stage #s-pick .catgrid { grid-column: 1 / -1; align-self: stretch; height: 100%; max-height: none; grid-auto-rows: 176px; padding: 6px 4px 12px; }
html:not(.portrait) #s-pick .catgrid .sechead { font-size: 36px; padding: 4px 6px 0; }
html:not(.portrait) #s-pick .catgrid > .sechead.availability:first-child { display: none; }
html.phone:not(.portrait) #s-pick .catcard { padding: 6px 10px; gap: 2px; }
html.phone:not(.portrait) #s-pick .catcard b { line-height: 1.25; font-size: 38px; }
html.phone:not(.portrait) #s-pick .catcard small { font-size: var(--min-fs); }
html.phone:not(.portrait) #hostbar { bottom: 12px; }
/* مكان زر ملء الشاشة: --fs-space يقيسه tv.js من الزر نفسه (نصه وحجم خطه ووضع ملء الشاشة)، ناقص حشوة الشبكة 56. الحجز الثابت 190 كان أصغر من الزر فركب عليه شريط الدور (عيب top10-picker-badge-overlap 2026-11-07) */
html:not(.portrait) #s-pick .turnpill { margin-inline-start: max(0px, calc(var(--fs-space, 250px) - 56px)); }
/* صف الدور والأقسام يبدأ عند أعلى زر ملء الشاشة (48): ارتفاع الصف يكبر مع الخط مثل الزر فلا ينزل الزر على أول صف بطاقات.
   كان 24 فنزل الزر بخط 150% و200% على اسم أول فئة (حاجز test_apple_review، عيب top10-picker-badge-overlap) */
html:not(.phone):not(.portrait) #stage #s-pick { padding-top: 48px; }

/* ===== الجوال بالعرض: لا نص أصغر من 12 بكسل ظاهرة (--min-fs يحسبها tv.js بمقياس المسرح) ===== */
html.phone:not(.portrait) #stage :is(.tin span, .name-count, .optrow > span, .setup-preserve, .sound, .qhead .chip, .team .tn, .team .tturn, .tlife span, .tlife b, #traps .tl, .slot .nm small, .value-en, #q-status .src, .moments span) { font-size: max(var(--min-fs), 1px); }

/* ===== السؤال على جوال بالعرض: الخط صار أكبر، فاللوحة تأخذ مساحة الهوامش لئلا ينقص الاسم أو سطر قيمته ===== */
html.phone:not(.portrait) #s-q { gap: 8px; padding: 12px 40px 14px; }
html.phone:not(.portrait) #s-q .qhead { height: auto; }
html.phone:not(.portrait) #s-q .qhead .chip { height: auto; min-height: 0; padding-block: 2px; }
html.phone:not(.portrait) #s-q .qtitle { padding-block: 6px 10px; }
html.phone:not(.portrait) #s-q .board { row-gap: 8px; }
html.phone:not(.portrait) #s-q .slot .nm { line-height: 1.15; padding: 0; overflow: visible; min-width: 0; }
html.phone:not(.portrait) #s-q .slot.none .nm small br { display: none; }
/* الفاصل خارج عزل الإنجليزي (span.vsep من tv.js): الهامش داخل العزل كان يقع على الجهة الخطأ فالتصق «Part 1» بـ «2010» وصار «20101» */
#stage .slot .nm .vsep { display: none; }
html.phone:not(.portrait) #s-q .slot.none .nm .vsep { display: inline; padding-inline: .35em; }
html.phone:not(.portrait) #s-q .slot.none .nm .vsep::before { content: "·"; }
html.phone:not(.portrait) #s-q .team .tturn { height: auto; min-height: 44px; padding-inline: 12px; }
html.phone:not(.portrait) #s-q .slot .nm small { line-height: 1.15; }
html.phone:not(.portrait) #s-q #q-status.withsrc { padding: 2px 34px 4px; gap: 0; }

/* ===== لحظات القمة ===== */
.pop.big { font-size: 118px; }
.team .tturn:empty { visibility: hidden; }
#stage .fin.win { transform: scale(1.08); position: relative; z-index: 1; }
html.portrait #stage .fin.win { transform: none; }
/* الرقم الطائر قطعة بلون الفريق: كان أبيض بحدّ رفيع فيضيع فوق الخانة الكريمية */
#stage .pop { color: #fff; -webkit-text-stroke: 0; text-shadow: none; background: var(--tcd); padding: 4px 30px 8px; border-radius: 99px; box-shadow: 0 8px 22px rgba(0, 0, 0, .45); z-index: 3; }

/* ===== الصور: رسوم الفئات بشكل فئات ستة في ستة (مجسم بلا إطار والاسم تحته) ===== */
#stage #s-pick .catgrid { row-gap: 14px; }
#stage #s-pick .catcard.has-art:not(.taken) { background: none; border-color: transparent; box-shadow: none; }
#stage #s-pick .catcard.has-art { padding: 2px 4px 14px; gap: 0; justify-content: flex-start; min-height: 0; }
#s-pick .catcard .cart { display: block; width: min(100%, 180px); aspect-ratio: 1; object-fit: contain; margin: 0 auto -4px; pointer-events: none; }
html.phone:not(.portrait) #s-pick .catcard .cart { width: min(100%, 240px); }
html.portrait #s-pick .catcard .cart { width: min(100%, 250px); }
#s-pick .catgrid .sechead { align-self: end; }
#s-pick .catcard.taken .cart { opacity: .85; }
/* الإعلان: الرسم فوق اسم الفئة، والكلام يبقى مقروءاً لأنه ليس فوق الرسم */
.splash .sart { display: block; width: 340px; height: 340px; object-fit: contain; flex: none; margin-bottom: -26px; }
html.portrait .splash .sart { width: 420px; height: 420px; }
/* النهاية: رسم الفوز بين البطاقتين */
.finals { align-items: center; }
.fin-art { width: 300px; height: 300px; object-fit: contain; flex: none; margin-inline: -30px; position: relative; z-index: 2; }
html.portrait .fin-art { width: 240px; height: 240px; margin: -40px auto; }
/* درع الفريق بلونه: زر في طرف حقل الاسم، وعلى البطاقة وفي النهاية؛ والصورة الاختيارية مقصوصة داخله */
.tinwrap { position: relative; }
.tphoto { position: absolute; inset-inline-end: 12px; bottom: 6px; display: grid; place-items: center; width: var(--touch-min, 44px); height: var(--touch-min, 44px); min-width: 70px; min-height: 70px; cursor: pointer; }
.tphoto input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tphoto .shield-svg, .tpic svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: var(--tcd); stroke: var(--tc); stroke-width: 3; pointer-events: none; }
.tphoto .shield-svg .inner, .tpic svg .inner { fill: none; stroke-width: 1.5; }
.tphoto .cam { position: relative; color: #fff; pointer-events: none; }
.tphoto img, .tpic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 130'%3E%3Cpath fill='white' d='M55 12C41 23 26 25 13 29v35c0 25 16 42 42 54 26-12 42-29 42-54V29C83 25 69 22 55 12Z'/%3E%3C/svg%3E") center/100% 100%; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 110 130'%3E%3Cpath fill='white' d='M55 12C41 23 26 25 13 29v35c0 25 16 42 42 54 26-12 42-29 42-54V29C83 25 69 22 55 12Z'/%3E%3C/svg%3E") center/100% 100%; }
.tphoto-x { position: absolute; inset-inline-end: calc(var(--touch-min, 70px) + 16px); bottom: 8px; display: grid; place-items: center; font: 800 44px/1 var(--txt); color: var(--muted); background: none; border: 0; cursor: pointer; }
.tphoto-x[hidden] { display: none; }
.tinwrap .tin input { padding-inline-end: calc(var(--touch-min, 70px) * 2 + 24px); }
/* على بطاقة لونها نفس لون الفريق: الدرع بحافة بيضاء حتى يبين */
.team.on .tpic svg, .fin.win .tpic svg { fill: var(--tc); stroke: #fff; stroke-width: 5; }
.team.on .tpic svg .inner, .fin.win .tpic svg .inner { stroke-width: 2; }
.tpic { position: relative; display: block; width: 92px; height: 109px; flex: none; }
#stage .team .tturn:empty { display: none; }
.fin { position: relative; }
.fin .tpic { align-self: center; width: 96px; height: 113px; margin: -78px auto -4px; z-index: 2; }

/* ===== إعداد الجوال بالطول (2026-11-04): المسرح يصغر إلى نحو الثلث، فلا نص تحت 12 بكسل ظاهرة ولا فراغ لمس تحت 12 نقطة.
   --touch-min = 44 نقطة بمقياس المسرح. طريق جوال الحكم زر واضح لا رابط صغير. والشاشات الأقصر تتمرر و«التالي» يبقى في المتناول. ===== */
html.phone.portrait #stage :is(.sound, #s-setup .sub, #s-setup .tin span, #s-setup .name-count, #s-setup .optrow > span, #s-setup .setup-preserve) { font-size: max(var(--min-fs), 38px); }
html.phone.portrait #s-setup { justify-content: flex-start; gap: calc(var(--touch-min) / 3.6); padding: calc(var(--touch-min) * .9) 56px 40px; overflow-y: auto; }
html.phone.portrait #s-setup .logo { font-size: 104px; line-height: 1.05; flex: none; }
html.phone.portrait #s-setup .sub { line-height: 1.25; flex: none; }
html.phone.portrait #s-setup .teamsin { width: 100%; gap: 14px; flex: none; }
html.phone.portrait #s-setup .tin { gap: 4px; }
html.phone.portrait #s-setup .tin input { padding-block: 8px; font-size: 46px; min-height: var(--touch-min); }
html.phone.portrait #s-setup .opts { width: 100%; gap: calc(var(--touch-min) / 3.6); flex: none; }
html.phone.portrait #s-setup .optrow { justify-content: flex-start; gap: calc(var(--touch-min) / 3.6); }
html.phone.portrait #s-setup .optrow > span { flex: 1 1 0; min-width: 0; line-height: 1.15; }
html.phone.portrait #s-setup .opt { flex: none; min-width: var(--touch-min); width: var(--touch-min); min-height: var(--touch-min); padding: 0; font-size: 44px; }
html.phone.portrait #s-setup .setup-preserve { max-width: 100%; line-height: 1.25; margin: 0; }
html.phone.portrait #s-setup #go-pick { width: 100%; flex: none; min-height: calc(var(--touch-min) * 1.2); padding-block: 0; font-size: 50px; }
html.phone.portrait #s-setup .altrow { width: 100%; flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: calc(var(--touch-min) / 3.6); }
html.phone.portrait #s-setup .altrow > * { min-height: var(--touch-min); font-size: max(var(--min-fs), 36px); padding: 4px 14px; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.15; }
html.phone.portrait #s-setup #join-live, html.phone.portrait #s-setup #fs-size { grid-column: 1 / -1; }

/* ===== كل شاشات الجوال بالطول (2026-11-04): حد 12 بكسل الظاهرة نفسه الذي للعرض، فالتصغير في الطول أشد ===== */
html.phone.portrait #stage :is(.qhead .chip, #q-cat, #q-count, .team .tn, .team .tturn, .tlife span, .tlife b, .lp, .lp *, #traps .tl, .slot .nm small, .value-en, #q-status .src, .moments span, #s-pick .catcard small) { font-size: max(var(--min-fs), 1px); }
/* البطاقة تتسع لمحتواها بعد تكبير الخط: «باس» والتلميحات كانت تنزل من البطاقة فوق لوحة الأجوبة */
html.phone.portrait .team { height: auto; min-height: 300px; align-self: stretch; }
html.phone.portrait .team .tlife { grid-column: 1 / -1; justify-self: center; flex-wrap: nowrap; position: static; transform: none; margin: 0; }
html.phone.portrait .team .tlife span { height: auto; min-height: 50px; display: inline-flex; align-items: center; gap: 6px; opacity: 1; }
html.phone.portrait .team .tlife span.used { opacity: .55; }
html.phone.portrait .team .tturn { grid-column: 1 / -1; justify-self: center; position: static; transform: none; }
html.portrait #s-pick .pick-filters { grid-template-columns: minmax(0, 1fr) auto; }
html.portrait #s-pick .pick-filters > label[for="pick-search"] { display: none; }

/* ===== الجوال بالعرض (2026-11-04): فراغ لمس 12 نقطة، وطريق الحكم زر واضح مثل الطول ===== */
html.phone:not(.portrait) #stage #s-setup { row-gap: calc(var(--touch-min) / 5.4); }
html.phone:not(.portrait) #s-setup .logo { font-size: 88px; line-height: 1; }
/* أربعة صفوف خيارات بعد وقت السؤال (المواصفة 016) أطول من شاشة الجوال بالعرض: «التالي» ينتقل تحت خانتي الفريقين في العمود الفارغ بجانب الخيارات،
   بدل صف وحده، فلا تمرير ولا تصغير لفراغ اللمس (فحص الملاءمة 2026-11-08) */
html.phone:not(.portrait) #stage #s-setup:has(#opts > .optrow:nth-child(4)) { grid-template-areas: "logo logo" "sub sub" "teams opts" "go opts" "alt alt"; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > .logo { grid-area: logo; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > .sub:not(.name-warn, .setup-preserve, .data-err) { grid-area: sub; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > .teamsin { grid-area: teams; align-self: end; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > #opts { grid-area: opts; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > #go-pick { grid-area: go; align-self: start; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > .altrow { grid-area: alt; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > :is(.name-warn, .setup-preserve, .data-err, #data-retry) { grid-column: 1 / -1; }
/* فشل التحميل: الرسالة وزرها في الوسط تحت «التالي» مباشرة، لا في عمود جانبي ولا بعد صف الأزرار الثانوية (تدقيق 2026-11-19، البند 67) */
html:not(.portrait) #s-setup > #data-retry { grid-column: 1 / -1; }
#s-setup > #data-retry { justify-self: center; align-self: center; }
html.phone:not(.portrait) #stage #s-setup:has(#opts > .optrow:nth-child(4)):has(#data-retry:not([hidden])) { grid-template-areas: "logo logo" "sub sub" "teams opts" "go opts" "err err" "retry retry" "alt alt"; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)):has(#data-retry:not([hidden])) > .data-err { grid-area: err; }
html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)):has(#data-retry:not([hidden])) > #data-retry { grid-area: retry; }
html.phone:not(.portrait) #s-setup .opts { gap: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #s-setup .optrow { gap: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #s-setup .optrow > span { min-width: 0; flex: 1 1 0; line-height: 1.15; }
html.phone:not(.portrait) #s-pick .pick-filters { gap: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #s-pick .secbtn { margin-inline: calc(var(--touch-min) / 7); }
html.phone:not(.portrait) #s-setup .altrow { gap: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #s-setup .altrow > * { min-height: var(--touch-min); padding: 4px 22px; }
/* آيفون بالعرض وشريط المتصفح ظاهر (ارتفاع 360 فأقل، تدقيق 2026-11-19 البند 4): كان الشعار والعنوان يُقصّان من فوق بلا وصول، وصف الأزرار يخرج من تحت.
   الشعار والعنوان في صف واحد والحشو أقل؛ و«safe center» فوق يبقي الأعلى في المتناول لو زاد المحتوى يوماً */
@media (orientation: landscape) and (max-height: 360px) {
  html.phone:not(.portrait) #stage #s-setup { padding-block: 10px; row-gap: calc(var(--touch-min) / 9); }
  html.phone:not(.portrait) #stage #s-setup:has(#opts > .optrow:nth-child(4)) { grid-template-areas: "logo sub" "teams opts" "go opts" "alt alt"; }
  html.phone:not(.portrait) #s-setup .logo { font-size: 64px; }
  html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > .logo { justify-self: end; }
  html.phone:not(.portrait) #s-setup:has(#opts > .optrow:nth-child(4)) > .sub:not(.name-warn, .setup-preserve, .data-err) { justify-self: start; max-width: 62%; text-align: start; line-height: 1.2; }
  html.phone:not(.portrait) #s-setup .optrow { gap: calc(var(--touch-min) / 5.4); }
}

/* ===== شاشة التلفزيون (2026-11-04): تُقرأ من بعيد، فلا نص ثابت تحت 24 بكسل (تقديرنا، لا رقم من دليل آبل).
   أسماء الأجوبة تبدأ من 28 وتنكسر سطرين، ولا تصغر عنها إلا إذا كان البديل القص (fitV). ===== */
html:not(.phone) #stage :is(.sound, #fs, #s-pick .catcard small, .slot .nm small, .value-en, #q-status .src) { font-size: calc(24px * var(--fs-scale, 1)); }

/* ===== إعداد الجوال بعد خطوة «وين بتلعبون؟» (2026-11-04): مكان اللعب والحكم يُختاران منها ===== */
html:is(.phone, .cast) #s-setup :is(#cast, .linkbtn) { display: none !important; }
html.phone #s-setup #data-retry { width: 100%; min-height: var(--touch-min); padding-block: 0; }
.name-warn, .data-err { color: var(--text); font-weight: 700; }
html.phone #stage :is(.name-warn, .data-err) { font-size: max(var(--min-fs), 38px); line-height: 1.25; }
#where { z-index: 5; gap: calc(var(--touch-min, 44px) / 2.4); padding-inline: 90px; background: var(--bg, #0D1326); }
#where[hidden] { display: none; }
#where h1 { margin: 0 0 16px; font-size: 76px; font-weight: 800; color: var(--text); }
#where .logo { font-size: 132px; line-height: 1.1; }
html.phone:not(.portrait) #where { padding-block: 16px; gap: 14px; }
html.phone:not(.portrait) #where .logo { font-size: 92px; }
html.phone:not(.portrait) #where h1 { font-size: 64px; margin: 0; }
#where :is(button, a) { width: min(100%, 900px); min-height: calc(var(--touch-min, 44px) * 1.2); padding-block: 0; display: flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
html.phone:not(.portrait) #where :is(button, a) { width: min(100%, 1100px); min-height: var(--touch-min); }

/* حجم الخط الأكبر: الإعداد يتمرر، و«التالي» يبقى في المتناول */
html.fs-big #stage #s-setup { overflow-y: auto; align-content: start; }
/* بالعرض مع الخط المكبّر: صف الأزرار السفلي ينكسر لسطرين ولا يخرج من الجانب؛ على 667×375 بالأقصى كان زر «حجم الخط» نفسه ينقص 87 بكسل فيصعب الرجوع (التدقيق الشامل، البند 61) */
html.fs-big:not(.portrait) #stage #s-setup .altrow { flex-wrap: wrap; max-width: 100%; }
/* ما حجمه ثابت في المسرح يبقى على حده العادي: بطاقة الفريق والفخاخ وسطر القيمة، فلا يخرج منها نص */
html.fs-big #stage :is(#q-status, #q-status *, .qhead .chip, #q-cat, #q-count, .team .tn, .team .tturn, .tlife span, .tlife b, .lp, .lp *, #traps .tl, .trap, .trap *, .slot .nm small, .value-en, .moments span) { font-size: max(var(--min-fs-base, 0px), 24px * var(--tv-only, 0)) !important; }
html.fs-big:not(.phone) #stage { --tv-only: 1; }
html.fs-big .moments span { line-height: 1.25; height: auto; }

/* ===== إعدادات النظام (مراجعة آبل 2026-11-04) ===== */
@media (prefers-contrast: more) {
  :root { --muted: #E4E2F0; --line: #F6F0E0; --line-soft: #F6F0E0; }
  .bgl { display: none !important; }
  .sound, .setup-preserve { color: var(--text); }
}
@media (prefers-reduced-transparency: reduce) { .swappanel { background: #060A16; } }
@media (forced-colors: active) {
  html body:not(#x) .opt.on { forced-color-adjust: none; background: Highlight; color: HighlightText; border-color: Highlight; }
  .gobtn, .opt { border: 2px solid ButtonText; }
}

/* ===== بقية شاشات توب 10 (مراجعة آبل 2026-11-04) ===== */
html.phone #stage :is(.trap, .trap *, #q-pre, #howclose) { font-size: max(var(--min-fs-base, 0px), 1px); }
#howclose { min-height: var(--touch-min, 44px); }
.ring.off { opacity: .5; }
html.phone.portrait #s-pick .catgrid { gap: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #s-pick #pick-list { margin-bottom: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #where { gap: calc(var(--touch-min) / 3.6); }
html.portrait .overlay { padding-inline: 60px; box-sizing: border-box; text-align: center; }
html.portrait .overlay b { font-size: 124px; line-height: 1.15; max-width: 100%; }
html.portrait .overlay span { font-size: max(var(--min-fs-base, 0px), 52px); line-height: 1.25; }
/* طبقة #stage::before أوسع من المسرح فكان يتمرر فينزاح كل شيء إذا استُدعي عنصر للعرض (كشفها تلفزيون 1920) */
#stage { overflow: clip; }
/* أزرار الشريط السفلي تنكسر صفين بالطول: كانت تتراكب و«اسحب القرعة» مقصوص */
html.phone.portrait .hostbar { width: calc(100% - 60px); max-width: none; flex-wrap: wrap; justify-content: center; gap: calc(var(--touch-min) / 3.6); bottom: 40px; }
html.phone.portrait .hostbar .hb { min-height: var(--touch-min); padding-block: 0; }
html.phone #stage .pchip { font-size: max(var(--min-fs-base, 0px), 1px); }
html.phone #s-pick .catgrid { gap: calc(var(--touch-min) / 3.6) !important; }
.nom.lose { opacity: .55; }
/* تنبيه الصوت أثناء السؤال بالطول ينزل لأسفل الشاشة: كان يتراكب مع رأس السؤال */
html.phone.portrait[data-scr="s-q"] .sound { top: auto !important; bottom: 10px !important; left: 0 !important; right: 0; text-align: center; font-size: max(var(--min-fs-base, 0px), 1px); }
/* ===== شاشة الفئات على الجوال (مراجعة 2026-11-04): فراغ لمس 12 نقطة، والشبكة تنتهي فوق الشريط أياً كان ارتفاعه (--hostbar-space من barSpace) ===== */
html.phone.portrait #stage #s-pick { gap: calc(var(--touch-min) / 3.6); padding-bottom: max(220px, calc(var(--hostbar-space, 0px) + var(--touch-min) / 3.6)); }
html.phone.portrait #stage #s-pick .pick-filters { gap: calc(var(--touch-min) / 3.6); }
html.phone:not(.portrait) #stage #s-pick { padding-bottom: max(146px, calc(var(--hostbar-space, 0px) + var(--touch-min) / 3.6)); }
html.phone:not(.portrait) .hostbar { gap: calc(var(--touch-min) / 3.6); }
html.phone #hostbar .hb { font-size: max(var(--min-fs, 0px), 38px); }
html.phone #hostbar .hb.main { font-size: max(var(--min-fs, 0px), 46px); }

/* ===== مراجعة آبل الكاملة لتوب 10 (المواصفة 015، 2026-11-07) ===== */
/* زر ملء الشاشة بلا شفافية تُسقط تباينه: «خروج من ملء الشاشة» كان بشفافية .3 فتباينه 1.9:1. الهدوء من الحجم واللون الخافت لا من الشفافية (5.9:1) */
#stage .fsbtn, #stage .fsbtn.in { opacity: .75; }
@media (hover: hover) and (pointer: fine) { #stage .fsbtn:hover, #stage .fsbtn.in:hover { opacity: 1; } }
/* تنبيه الصوت في السؤال على الجوال بالعرض يبقى بحجمه العادي (12 ظاهرة): بالخط الأكبر كان يكبر فوق عنوان السؤال (عيب top10-picker-badge-overlap) */
/* بالمعرّف #sound لا الصنف: قاعدة الحد الأدنى للجوال فيها :is(... #q-status .src) فوزنها معرّفان، وغلبت القاعدة الأولى بالصنف فلم تعمل (كشفته لوحة قبل وبعد، 2026-11-07) */
html.phone:not(.portrait)[data-scr="s-q"] #stage #sound { font-size: max(var(--min-fs-base, 0px), 1px); }
/* درع البطاقة الفائزة يطلع فوقها، فكان يلمس حرف «ج» من عنوان الفائز على 1920×1080 (جولة الاقتران الكاملة 2026-11-07) */
html:not(.portrait) #s-final .finals { margin-top: 40px; }
/* التلفزيون والحاسوب: ارتفاع السطر في الخانة كان 1.45، فثلاثة أسطر (الاسم والإنجليزي والقيمة) بخط 24 لا تدخل الخانة فيصغر الكل تحت حد القراءة البعيدة.
   1.25 للاسم العربي (لا يقص علامات الحروف) و1.15 لسطر القيمة اللاتيني والأرقام (حاجز test_tv_reading.cjs) */
html:not(.phone) #stage .slot .nm { line-height: 1.25; padding: 2px 0 4px; }
html:not(.phone) #stage .slot .nm small { line-height: 1.15; }

/* ===== المواصفة 016 (2026-11-08): وقت السؤال، ومشهد الفائز ===== */
/* خيارات «وقت السؤال» كلمات لا أرقام: عرضها بحسب الكلمة، ولو كانت بقية الخيارات مربعات */
#s-setup .opt.opt-word, html.phone.portrait #s-setup .opt.opt-word { width: auto; min-width: var(--touch-min, 44px); padding-inline: 22px; font-family: var(--txt); white-space: nowrap; }
/* لا تنضغط تحت كلامها: ثلاث كلمات بخط 46 مع عنوان 300 أعرض من عمود الإعداد (860)، فطلع «10 دقايق» من إطاره على 1920×1080 */
#s-setup .opt.opt-word { flex: none; font-size: 36px; padding-inline: 18px; }
#s-setup .optrow:has(.opt-word) { flex-wrap: wrap; }
html:not(.portrait) #s-setup .optrow:has(.opt-word) > span { min-width: 220px; }
.qclock { font-variant-numeric: tabular-nums; }
.qclock.low { color: var(--gold-text); }
/* طلب المالك 2026-11-08 «وقت السؤال صغير»: شارة بإطار ذهبي وخط أكبر من سطر الفئة، يقرأها البعيد عن الشاشة */
#stage .qhead #q-clock { display: inline-flex; align-items: center; height: 60px; padding: 0.29em 26px 0;   /* حبر الخط العربي أعلى من وسط سطره بـ0.145em تقريباً (قيس 6.4 من 44)، فالحشوة العلوية توسّطه بعين المالك */ border: 3px solid var(--gold); border-radius: 99px; background: var(--panel); color: var(--text); font-family: var(--txt); font-size: 44px; font-weight: 800; line-height: 1; white-space: nowrap; }
#stage .qhead #q-clock[hidden] { display: none; }
/* انقلاب الشارة للذهبي في آخر 30 ثانية بلون يتغير بنعومة لا قفزة (مراجعة إميل 2026-11-09)؛ لون لا حركة، فيبقى مع تقليل الحركة */
#stage .qhead #q-clock { transition: background-color 200ms cubic-bezier(0.23, 1, 0.32, 1), color 200ms cubic-bezier(0.23, 1, 0.32, 1); }
#stage .qhead #q-clock.low { color: var(--ink, #0D1326); background: var(--gold); }
/* الفائز: درعه بصورته أو بلونه واسمه كاملاً بخط كبير؛ الاسم ينكسر ولا يُقص (لا نص ناقص) */
.fin-hero { display: flex; justify-content: center; align-items: flex-end; gap: 80px; margin: 4px 0 18px; }
.hero-team { display: flex; flex-direction: column; align-items: center; gap: 10px; max-width: 900px; }
.hero-team .tpic { width: 190px; height: 225px; }
.hero-name { font: 800 112px/1.12 var(--txt); color: var(--tct, var(--text)); text-align: center; overflow-wrap: anywhere; }
.fin-hero.tie .hero-team .tpic { width: 150px; height: 177px; }
.fin-hero.tie .hero-name { font-size: 88px; max-width: 760px; }
#s-final .winner { font-size: 72px; }
/* الشاشة العريضة: الدرع بجانب الاسم لا فوقه؛ فوقه أطال المشهد فخرج زر «لعبة جديدة» من أسفل 1920×1080 وقُص العنوان على الجوال بالعرض */
html:not(.portrait) .hero-team { flex-direction: row; gap: 32px; }
html:not(.portrait) .fin-hero { margin: 0 0 10px; }
html:not(.portrait) .hero-team .tpic { width: 160px; height: 189px; }
/* الاسم سطر واحد بالعرض: اثنا عشر حرفاً بخط 100 (ضعف اسم البطاقة) تسعها 1300، وكان ينكسر سطرين داخل 900 فيُخرج «لعبة جديدة» من 1080 (فحص الملاءمة 2026-11-08) */
html:not(.portrait) .hero-team { max-width: 1500px; }
html:not(.portrait) .hero-name { font-size: 100px; max-width: 1300px; }
html:not(.portrait) .fin-hero.tie .hero-name { font-size: 80px; max-width: 620px; }
/* بالعرض مع البطل: الدرع أصغر وبطاقتا النقاط أقصر، فيبقى «لعبة جديدة» داخل 1080 بأطول المحتوى (فحص الملاءمة 2026-11-08) */
html:not(.portrait) .hero-team .tpic, html:not(.portrait) .fin-hero.tie .hero-team .tpic { width: 120px; height: 142px; }
html:not(.portrait) #s-final:has(#fin-hero:not(:empty)) .fin { padding: 30px 26px 18px; gap: 4px; }
html:not(.portrait) #s-final:has(#fin-hero:not(:empty)) .fin b { font-size: 96px; line-height: 1.05; }
html:not(.portrait) #s-final:has(#fin-hero:not(:empty)) .moments { gap: 14px; }
html:not(.portrait) #s-final:has(#fin-hero:not(:empty)) .winner { font-size: 60px; line-height: 1.1; }
html:not(.portrait) #s-final:has(#fin-hero:not(:empty)) .finals { margin-top: 28px; }
html:not(.portrait) #s-final:has(#fin-hero:not(:empty)) .moments span { height: 62px; }
#s-final #fin-new { flex: none; }   /* لا ينضغط الزر فيصغر كلامه إلى 27 (فحص الملاءمة 2026-11-08)؛ إن ضاقت الشاشة يكشفه الفحص خارجها */
html:not(.portrait) .fin-hero.tie .hero-team .tpic { width: 140px; height: 165px; }
html.portrait .fin-hero { gap: 30px; }
html.portrait .hero-name { font-size: 84px; }
html.portrait .fin-hero.tie .hero-name { font-size: 64px; }
@media (forced-colors: active) { .hero-name { color: CanvasText; } }

/* فحص الليل 2026-11-09: على الجوال عند حد الخط، الفخ المكسور سطرين بأسطر أضيق فلا يُقص من فوق ولا تحت، وصنف «sr» يخفي من العرض ويبقي لقارئ الشاشة */
html.phone .trap.wrap { line-height: 1.1; padding-top: 4px; padding-bottom: 4px; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* اللوحة الطويلة على الجوال: الصف بارتفاعه المعتاد على الأقل، ويطول إن احتاج نصه، واللوحة تتمرر عمودياً؛ لا يحدث إلا إن بقي نص أطول من خانته عند حد الخط */
html.phone #board.board.tall { grid-template-rows: none; grid-auto-rows: auto; overflow-y: auto; overscroll-behavior: contain; align-content: start; }
/* حد صريح على الخانة أو على الصف يُعدّ حده الأدنى فلا يكبر الصف مع نصها (قيس في كروم 2026-11-09)؛ فالارتفاع المعتاد حدٌّ على الاسم داخلها، والصف يُحسب من المحتوى */
html.phone #board.board.tall .slot { overflow: visible; min-height: auto; }
html.phone #board.board.tall .slot > .nm { min-height: var(--row, 0px); display: flex; flex-direction: column; justify-content: center; }
/* الفخ المكسور سطرين يطول معه: «#stage .trap» يفرض 58 وهو أقوى من «.trap.wrap» (height:auto)، فكان الفخ الطويل يُقص بكسلين على كل الشاشات (فحص الليل 2026-11-09) */
#stage .trap.wrap { height: auto; min-height: 58px; }
/* الجوال بالعرض حين يقصر المتصفح عن 375 (شريط سفاري يأكل من ارتفاع الآيفون): أحجام ثابتة كانت تنزل إلى 10.7 بكسل ظاهرة لأنها خارج قائمة الحد.
   كل واحد يبقى على حجمه المعتاد ولا ينزل عن الحد الظاهر 12 (التدقيق الشامل، البند 62) */
html.phone:not(.portrait) #stage .slot .rank { font-size: max(var(--min-fs-base, 0px), 36px); }
html.phone:not(.portrait) #stage .slot.hid .pts { font-size: max(var(--min-fs-base, 0px), 38px); }
html.phone:not(.portrait) #stage .slot.open .pts { font-size: max(var(--min-fs-base, 0px), 36px); }
html.phone:not(.portrait) #stage #s-pick .catcard b { font-size: max(var(--min-fs-base, 0px), 38px); }
html.phone:not(.portrait) #stage #s-pick .catgrid .sechead { font-size: max(var(--min-fs-base, 0px), 36px); }
html.phone:not(.portrait) #stage .sub { font-size: max(var(--min-fs-base, 0px), 38px); }
html.phone:not(.portrait) #stage #s-setup .opt.opt-word { font-size: max(var(--min-fs-base, 0px), 36px); }
html.phone:not(.portrait) #stage #s-pick .turnpill { font-size: max(var(--min-fs-base, 0px), 38px); }
/* وخيارات وقت السؤال الثلاثة تبقى في صف واحد بعد تكبيرها: حشوها الجانبي يقل على الشاشة القصيرة بدل أن ينزل «10 دقايق» لسطر ثانٍ فيحتاج الإعداد تمريراً */
@media (orientation: landscape) and (max-height: 360px) { html.phone:not(.portrait) #stage #s-setup .opt.opt-word { padding-inline: 6px; } }
