:root {
  --orange: #f26f38;
  --orange-d: #dc5f2b;
  --tint: #fff0e4;
  --black: #111111;
  --white: #ffffff;
  --bg: #ffffff;
  --soft: #f5f5f4;
  --line: #e7e5e4;
  --muted: #78716c;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--black); }
body { font-family: 'Cairo', system-ui, -apple-system, 'Segoe UI', sans-serif; font-size: 16px; }
.ar { direction: rtl; unicode-bidi: plaintext; }
.hidden { display: none !important; }
button { font-family: inherit; }
h1, h2, h3, p { margin: 0; }

.brand { font-weight: 900; letter-spacing: .5px; display: inline-flex; align-items: center; gap: 8px; }
.brand .logo { width: 28px; height: 28px; border-radius: 9px; background: var(--orange); display: inline-block; position: relative; }
.brand .logo::after { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: var(--white); }
.brand b { color: var(--orange); font-weight: 900; }

/* buttons */
.btn {
  border: 0; border-radius: 14px; padding: 14px 22px; font-size: 17px; font-weight: 800;
  background: var(--black); color: var(--white); cursor: pointer; transition: transform .1s, opacity .2s, background .2s;
}
.btn:hover { background: #2b2b2b; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn.orange { background: var(--orange); }
.btn.orange:hover { background: var(--orange-d); }
.btn.ghost { background: var(--white); color: var(--black); border: 2px solid var(--line); }
.btn.ghost:hover { border-color: var(--black); background: var(--white); }
.btn.small { padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btn.big { width: 100%; font-size: 22px; padding: 18px; border-radius: 18px; }
.btn.danger { background: var(--white); color: #b42318; border: 2px solid #f3c6c2; }

input[type=text], input[type=number], input:not([type]), textarea {
  width: 100%; background: var(--white); color: var(--black); border: 2px solid var(--line);
  border-radius: 14px; padding: 14px 16px; font: inherit; outline: none; transition: border-color .15s;
}
input:focus, textarea:focus { border-color: var(--orange); }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 22px; box-shadow: 0 6px 24px rgba(17,17,17,.05); }
.muted { color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #d6d3d1; margin-inline-end: 8px; }
.dot.on { background: var(--orange); }
.label { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); }

/* ---------- player ---------- */
#app { max-width: 520px; margin: 0 auto; min-height: 100vh; display: flex; flex-direction: column; padding: 14px 16px 30px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 4px 0 14px; font-size: 18px; }
.topbar .roundtag { font-size: 13px; font-weight: 800; color: var(--muted); }
.center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; }
.hero { font-size: 42px; font-weight: 900; line-height: 1.05; letter-spacing: -.5px; }
.hero b { color: var(--orange); }
.sub { color: var(--muted); font-size: 17px; }

.scorebar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; margin: 0 -2px; scrollbar-width: none; }
.scorebar::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-width: 96px; background: var(--soft); border: 2px solid transparent; border-radius: 16px; padding: 8px 14px; transition: all .3s; }
.chip .nm { font-weight: 800; font-size: 13px; color: var(--muted); max-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip .sc { font-size: 26px; font-weight: 900; line-height: 1.1; font-variant-numeric: tabular-nums; }
.chip.active { background: var(--orange); }
.chip.active .nm { color: rgba(255,255,255,.85); }
.chip.active .sc { color: var(--white); }
.chip.me { border-color: var(--black); }

.turn { text-align: center; margin: 4px 0 6px; font-size: 22px; font-weight: 900; }
.turn small { display: block; font-size: 13px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--orange); }

/* wheel */
.wheel-wrap { position: relative; width: min(80vw, 360px); aspect-ratio: 1; margin: 10px auto 6px; }
.wheel-wrap svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 10px 20px rgba(17,17,17,.18)); }
#wheel { transform-origin: 50% 50%; will-change: transform; }
.pointer {
  position: absolute; left: 50%; top: -10px; transform: translateX(-50%); width: 0; height: 0;
  border-left: 15px solid transparent; border-right: 15px solid transparent; border-top: 32px solid var(--black); z-index: 2;
}
.status { font-size: 18px; font-weight: 800; text-align: center; min-height: 28px; color: var(--muted); }
.notice { background: var(--tint); color: var(--orange-d); border-radius: 14px; padding: 12px 16px; text-align: center; margin-top: 12px; font-weight: 800; }

/* question card */
.qcard { text-align: center; border-top: 6px solid var(--orange); }
.catname { display: inline-block; background: var(--black); color: var(--white); font-weight: 900; border-radius: 999px; padding: 6px 18px; font-size: 15px; text-transform: uppercase; letter-spacing: 1.2px; }
.catdesc { color: var(--muted); margin: 10px 0 4px; font-size: 14px; font-weight: 600; }
.qtext { font-size: 34px; font-weight: 900; line-height: 1.5; padding: 16px 4px; }
.qhint { color: var(--muted); font-size: 17px; font-weight: 600; }
.hidden-q { font-size: 19px; color: var(--muted); padding: 28px 0; font-weight: 700; }
.timer { font-size: 60px; font-weight: 900; font-variant-numeric: tabular-nums; margin: 6px 0 10px; letter-spacing: -1px; }
.bar { height: 10px; background: var(--soft); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; background: var(--orange); transition: width .25s linear; border-radius: 99px; }
.timer.low { color: var(--orange); animation: blink .7s infinite; }
@keyframes blink { 50% { opacity: .4; } }

/* result */
.result { text-align: center; border: 0; color: var(--white); }
.result.ok { background: var(--orange); }
.result.bad { background: var(--black); animation: shake .5s; }
.result .big { font-size: 30px; font-weight: 900; }
.result .pts { font-size: 84px; font-weight: 900; line-height: 1.05; animation: pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { from { transform: scale(.2); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes shake { 20%,60% { transform: translateX(-10px);} 40%,80% { transform: translateX(10px);} }
.answer { background: var(--white); color: var(--black); border-radius: 16px; padding: 14px; margin: 14px 0; font-size: 26px; font-weight: 900; }
.answer small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.board { display: grid; gap: 8px; }
.board .row { display: flex; justify-content: space-between; align-items: center; background: var(--soft); border-radius: 14px; padding: 11px 16px; font-size: 18px; font-weight: 800; color: var(--black); text-align: start; }
.board .row .sc { font-size: 26px; font-variant-numeric: tabular-nums; color: var(--black); }
.board .row.lead { background: var(--tint); box-shadow: inset 0 0 0 2px var(--orange); }
.result .board .row { background: rgba(255,255,255,.95); }
.result .nextup { margin-top: 14px; font-weight: 700; opacity: .95; }

.crown { font-size: 76px; }
canvas#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 50; }
.conn { position: fixed; top: 0; left: 0; right: 0; background: var(--orange); color: var(--white); text-align: center; font-weight: 800; padding: 6px; z-index: 60; }

/* ---------- admin ---------- */
.admin { max-width: 1080px; margin: 0 auto; padding: 18px 20px 40px; }
.ahead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-bottom: 16px; margin-bottom: 22px; border-bottom: 1px solid var(--line); }
.ahead .brand { font-size: 20px; }
.tabs { display: flex; gap: 6px; margin-inline-start: auto; background: var(--soft); padding: 4px; border-radius: 14px; }
.tab { background: transparent; border: 0; color: var(--muted); border-radius: 10px; padding: 8px 18px; font-weight: 800; cursor: pointer; font-size: 15px; }
.tab.on { background: var(--white); color: var(--black); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.grid { display: grid; gap: 18px; grid-template-columns: 1fr 1fr; align-items: start; }
@media (max-width: 800px) { .grid { grid-template-columns: 1fr; } }
.card h2 { font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }

.home { text-align: center; padding: 56px 20px 40px; }
.home .hero { font-size: 60px; }
.home .btn { font-size: 26px; padding: 20px 56px; margin-top: 26px; border-radius: 20px; }
.settings { display: flex; gap: 14px; flex-wrap: wrap; align-items: end; justify-content: center; margin: 34px auto 0; max-width: 560px; }
.settings label { display: block; font-size: 12px; color: var(--muted); font-weight: 800; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 1px; text-align: start; }
.settings input { width: 150px; }

.lobby { display: grid; grid-template-columns: 380px 1fr; gap: 26px; align-items: start; }
@media (max-width: 860px) { .lobby { grid-template-columns: 1fr; } }
.qr { width: 100%; display: block; border-radius: 12px; }
.qrbox { text-align: center; }
.url { margin-top: 12px; font-weight: 800; color: var(--orange); word-break: break-all; }
.teamgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin: 6px 0 18px; }
.teamtile { background: var(--soft); border-radius: 16px; padding: 16px; font-weight: 900; font-size: 20px; position: relative; animation: tilein .4s cubic-bezier(.2,1.5,.4,1); word-break: break-word; }
.teamtile small { display: block; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 4px; }
.teamtile .x { position: absolute; top: 8px; right: 10px; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
@keyframes tilein { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.empty { color: var(--muted); font-weight: 700; padding: 30px 0; text-align: center; border: 2px dashed var(--line); border-radius: 16px; grid-column: 1 / -1; }
.count-big { font-size: 56px; font-weight: 900; color: var(--orange); line-height: 1; }

.teamrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--soft); border-radius: 14px; padding: 12px 14px; margin-bottom: 8px; font-weight: 800; }
.teamrow.active { background: var(--tint); box-shadow: inset 0 0 0 2px var(--orange); }
.score-big { font-size: 34px; font-weight: 900; font-variant-numeric: tabular-nums; min-width: 48px; text-align: center; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.row-actions .btn { flex: 1; }
.judge { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.judge .btn { padding: 22px; font-size: 24px; border-radius: 18px; }
.q-admin { font-size: 30px; font-weight: 900; line-height: 1.5; margin: 10px 0 2px; }
.a-admin { font-size: 22px; color: var(--orange-d); font-weight: 800; }
.counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count { background: var(--soft); border-radius: 10px; padding: 6px 12px; font-size: 14px; font-weight: 700; }
.count b { color: var(--orange); }
.qrow { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; margin-bottom: 8px; }
.qrow input { padding: 10px 12px; }
.qrow .used { font-size: 11px; color: var(--orange); font-weight: 800; }
.hist { font-size: 14px; color: var(--muted); max-height: 180px; overflow: auto; }
.hist div { padding: 5px 0; border-bottom: 1px solid var(--line); }

/* ================= animation layer ================= */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg i { position: absolute; border-radius: 50%; background: var(--orange); opacity: .09; animation: floaty 14s ease-in-out infinite; }
.bg i:nth-child(1) { width: 340px; height: 340px; left: -90px; top: 8%; }
.bg i:nth-child(2) { width: 220px; height: 220px; right: -60px; top: 42%; animation-duration: 18s; animation-delay: -5s; opacity: .13; }
.bg i:nth-child(3) { width: 420px; height: 420px; left: 30%; bottom: -200px; animation-duration: 22s; animation-delay: -9s; opacity: .07; }
@keyframes floaty { 0%,100% { transform: translate(0,0) scale(1); } 33% { transform: translate(30px,-40px) scale(1.08); } 66% { transform: translate(-25px,25px) scale(.94); } }

.enter { animation: enter .55s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes enter { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }

.brand .logo { animation: logoSpin 1.2s cubic-bezier(.3,1.5,.5,1) both; }
@keyframes logoSpin { from { transform: rotate(-180deg) scale(.2); } to { transform: none; } }

.hero b { display: inline-block; animation: wob 3s ease-in-out infinite; }
@keyframes wob { 0%,100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(2deg) scale(1.07); } }

.btn { position: relative; overflow: hidden; }
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(17,17,17,.18); }
.btn.orange:hover:not(:disabled) { box-shadow: 0 10px 22px rgba(242,111,56,.45); }
.btn.orange:not(:disabled)::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.45), transparent); transform: skewX(-20deg);
  animation: shine 3s ease-in-out infinite;
}
@keyframes shine { 0%,55% { left: -60%; } 100% { left: 130%; } }
.btn.bounce { animation: bounce 1s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0) scale(1); } 40% { transform: translateY(-8px) scale(1.03); } 60% { transform: translateY(0) scale(.98); } }
.home .btn.orange, .lobby .btn.orange:not(:disabled) { animation: breathe 1.8s ease-in-out infinite; }
@keyframes breathe { 0%,100% { box-shadow: 0 0 0 0 rgba(242,111,56,.55); } 50% { box-shadow: 0 0 0 16px rgba(242,111,56,0); } }

/* wheel */
.wheel-wrap { animation: wheelIn .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes wheelIn { from { transform: scale(.4) rotate(-120deg); opacity: 0; } to { transform: none; opacity: 1; } }
.wheel-wrap.idle svg { animation: idleWobble 3.2s ease-in-out infinite; }
@keyframes idleWobble { 0%,100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2.5deg); } }
.wheel-wrap.landed svg { animation: landed .6s ease-out; }
@keyframes landed { 0% { transform: scale(1); } 40% { transform: scale(1.09); filter: drop-shadow(0 0 28px rgba(242,111,56,.8)); } 100% { transform: scale(1); } }
.pointer { transform-origin: 50% 0; }
.pointer.flick { animation: flick .11s ease-out; }
@keyframes flick { 0% { transform: translateX(-50%) rotate(0); } 35% { transform: translateX(-50%) rotate(-24deg); } 100% { transform: translateX(-50%) rotate(0); } }

/* turn + chips */
.turn.turnin { animation: slideDown .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes slideDown { from { transform: translateY(-14px); opacity: 0; } to { transform: none; opacity: 1; } }
.chip { animation: chipIn .5s cubic-bezier(.2,1.5,.4,1) both; }
.chip:nth-child(2) { animation-delay: .06s; } .chip:nth-child(3) { animation-delay: .12s; } .chip:nth-child(4) { animation-delay: .18s; }
.chip:nth-child(5) { animation-delay: .24s; } .chip:nth-child(n+6) { animation-delay: .3s; }
@keyframes chipIn { from { transform: translateY(20px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.chip.active { animation: chipIn .5s both, glow 1.8s ease-in-out .5s infinite; }
@keyframes glow { 0%,100% { box-shadow: 0 0 0 0 rgba(242,111,56,.55); } 50% { box-shadow: 0 0 0 9px rgba(242,111,56,0); } }
.bump { display: inline-block; animation: bump .6s cubic-bezier(.2,1.8,.4,1); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* question */
.qcard.pop { animation: cardPop .6s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes cardPop { from { transform: translateY(40px) scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.catname.stamp { animation: stamp .5s cubic-bezier(.2,2,.4,1) .15s both; }
@keyframes stamp { from { transform: scale(2.4) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }
.qtext { animation: textUp .55s ease-out .25s both; }
@keyframes textUp { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.hidden-q { animation: textUp .55s ease-out .25s both, think 2.4s ease-in-out 1s infinite; }
@keyframes think { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
.timer.low { animation: lowPulse .6s ease-in-out infinite; }
@keyframes lowPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
.bar > i { background: linear-gradient(90deg, var(--orange), #ffa47a, var(--orange)); background-size: 200% 100%; animation: flow 1.5s linear infinite; }
@keyframes flow { to { background-position: -200% 0; } }

/* result */
.result { animation: resultIn .7s cubic-bezier(.2,1.3,.4,1) both; }
.result.bad { animation: resultIn .7s cubic-bezier(.2,1.3,.4,1) both, shake .5s .7s; }
@keyframes resultIn { from { transform: translateY(60px) scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
.result .emoji { font-size: 64px; animation: emojiDrop .9s cubic-bezier(.2,2,.4,1) .1s both; }
@keyframes emojiDrop { from { transform: translateY(-80px) rotate(-40deg) scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
.result.ok .emoji { animation: emojiDrop .9s cubic-bezier(.2,2,.4,1) .1s both, partyWiggle 1.2s ease-in-out 1s infinite; }
@keyframes partyWiggle { 0%,100% { transform: rotate(-10deg); } 50% { transform: rotate(10deg) scale(1.1); } }
.result .pts { animation: pop .7s cubic-bezier(.2,1.8,.4,1) .35s both; }
.result .answer { animation: textUp .5s ease-out .6s both; }
.board .row { animation: rowIn .45s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes rowIn { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.result .nextup { animation: textUp .5s ease-out 1.2s both; }

.crown { display: inline-block; animation: crownDrop 1s cubic-bezier(.2,1.6,.4,1) both, crownFloat 2.4s ease-in-out 1s infinite; }
@keyframes crownDrop { from { transform: translateY(-160px) rotate(-30deg) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes crownFloat { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }

/* admin */
.teamtile { animation: none; }
.teamtile.new { animation: tilein .55s cubic-bezier(.2,1.7,.4,1); }
.count-big.bump { animation: bump .6s cubic-bezier(.2,1.8,.4,1); }
.qr { animation: qrIn .7s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes qrIn { from { transform: scale(.7) rotate(-6deg); opacity: 0; } to { transform: none; opacity: 1; } }
.teamrow.active { animation: glow 1.8s ease-in-out infinite; }
.judge .btn:hover { transform: translateY(-3px) scale(1.02); }

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

.teamtile .x { top: 10px; right: 12px; font-size: 12px; font-weight: 800; font-family: inherit; }
.teamtile .x:hover { color: var(--black); }

.draw { text-align: center; background: var(--black); color: var(--white); border-radius: 18px; padding: 14px 16px; font-size: 22px; font-weight: 900; margin: 6px 0 10px; }
.draw small { display: block; color: var(--orange); font-size: 12px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; }
.draw.drawIn { animation: drawIn .8s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes drawIn { from { transform: scale(.3) rotate(-8deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* wheel: rotate an HTML box (reliable on mobile browsers), never an SVG group */
.wheel-fx { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 12px 28px rgba(17,17,17,.18); }
.wheel-spin { width: 100%; height: 100%; transform-origin: 50% 50%; will-change: transform; border-radius: 50%; overflow: hidden; }
.wheel-wrap svg, .wheel-wrap.idle svg, .wheel-wrap.landed svg { filter: none; animation: none; width: 100%; height: 100%; display: block; }
.wheel-wrap.idle .wheel-fx { animation: idleWobble 3.2s ease-in-out infinite; }
.wheel-wrap.landed .wheel-fx { animation: landedFx .6s ease-out; }
@keyframes landedFx { 0% { transform: scale(1); } 40% { transform: scale(1.07); box-shadow: 0 0 0 10px rgba(242,111,56,.35), 0 12px 28px rgba(17,17,17,.18); } 100% { transform: scale(1); } }
.wheel-wrap { max-width: 100%; }

/* admin live view */
.play-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.play-grid { display: grid; grid-template-columns: minmax(300px, 460px) 1fr; gap: 48px; align-items: center; }
@media (max-width: 860px) { .play-grid { grid-template-columns: 1fr; gap: 20px; } }
.play-wheel .wheel-wrap { width: 100%; max-width: 460px; }
.play-info .turn { text-align: start; font-size: 30px; margin: 0 0 8px; }
.play-info .timer { font-size: 120px; line-height: 1; margin: 14px 0 12px; }
.play-info .q-admin { font-size: 36px; min-height: 54px; }
.play-info .a-admin { min-height: 34px; }
.play-info .judge .btn { padding: 26px; font-size: 30px; }
.play-info .catname { min-height: 34px; }


/* ================= smart-board layout (admin) ================= */
.admin { max-width: 1760px; padding: 28px 56px 56px; }
.ahead { padding-bottom: 22px; margin-bottom: 36px; gap: 20px; }
.ahead .brand { font-size: 24px; }
.tab { padding: 10px 24px; font-size: 16px; }

/* home + lobby */
.home { padding: 110px 20px 90px; }
.home .hero { font-size: clamp(56px, 6vw, 104px); }
.home .sub { font-size: 22px; margin-top: 18px !important; }
.home .btn { font-size: 30px; padding: 26px 80px; margin-top: 48px; }
.lobby { grid-template-columns: minmax(360px, 560px) 1fr; gap: 56px; }
.lobby .card { padding: 36px; }
.lobby .count-big { font-size: 96px; }
.teamgrid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; margin: 18px 0 36px; }
.teamtile { padding: 26px 24px; font-size: 28px; border-radius: 20px; }
.lobby .row-actions { gap: 16px; }
.lobby .row-actions .btn { padding: 24px; }
.settings { margin-top: 56px; gap: 24px; }

/* live game */
.play-bar {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; margin-bottom: 40px;
}
.play-bar .btn { justify-self: end; }
.play-round { font-size: 15px; font-weight: 800; letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.play-team { font-size: clamp(28px, 3vw, 52px); font-weight: 900; text-align: center; line-height: 1.1; }
.play-grid { grid-template-columns: minmax(340px, 44%) 1fr; gap: clamp(36px, 5vw, 96px); align-items: center; }
.play-wheel .wheel-wrap { width: min(100%, 72vh); max-width: none; margin: 0 auto; }
.play-main { display: grid; gap: 28px; }

.stage { background: var(--soft); border-radius: 28px; padding: 36px 40px; min-height: 250px; display: flex; flex-direction: column; justify-content: center; gap: 20px; }
.stage-cat { min-height: 44px; }
.stage .catname { font-size: 20px; padding: 8px 24px; }
.stage .q-admin { font-size: clamp(34px, 3.4vw, 68px); line-height: 1.45; margin: 0; min-height: 0; }
.stage .a-admin { font-size: clamp(24px, 2.2vw, 40px); margin: 0; min-height: 0; }

.clock { padding: 4px 4px; }
.clock .timer { font-size: clamp(90px, 11vw, 210px); line-height: 1; margin: 0 0 22px; text-align: center; }
.clock .bar { height: 16px; }

.controls { display: grid; gap: 20px; }
.controls .judge { margin: 0; gap: 20px; }
.controls .judge .btn { padding: 30px; font-size: clamp(26px, 2.2vw, 38px); border-radius: 22px; }
#bNext { padding: 34px; font-size: clamp(30px, 2.6vw, 44px); border-radius: 22px; width: 100%; }
.controls-sub { display: flex; gap: 16px; flex-wrap: wrap; }
.controls-sub .btn { flex: 1; padding: 18px; font-size: 18px; min-width: 150px; }

@media (max-width: 900px) {
  .admin { padding: 18px 18px 40px; }
  .play-bar { grid-template-columns: 1fr auto; }
  .play-round { display: none; }
  .play-grid { grid-template-columns: 1fr; }
  .lobby { grid-template-columns: 1fr; }
}

/* fit the live view to one screen, no scrolling (sizes follow the screen height) */
.admin { padding-top: 18px; padding-bottom: 26px; }
.ahead { padding-bottom: 14px; margin-bottom: 18px; }
.play-bar { margin-bottom: 18px; }
.play-wheel .wheel-wrap { width: min(100%, 64vh); }
.play-main { gap: 20px; }
.stage { padding: 26px 36px; min-height: 0; gap: 14px; }
.stage .q-admin { font-size: clamp(30px, min(3vw, 5.4vh), 64px); }
.stage .a-admin { font-size: clamp(22px, min(2vw, 3.6vh), 38px); }
.clock .timer { font-size: min(15vh, 9vw); margin-bottom: 14px; }
.clock .bar { height: 14px; }
.controls { gap: 14px; }
.controls .judge { gap: 16px; }
.controls .judge .btn { padding: 22px; font-size: min(3.6vh, 2.2vw); }
#bNext { padding: 26px; font-size: min(4vh, 2.6vw); }
.controls-sub .btn { padding: 14px; font-size: 17px; }

/* board: centre the question block so Arabic and English lines line up */
.stage { align-items: center; text-align: center; }
.stage .q-admin, .stage .a-admin { text-align: center; width: 100%; }
.stage-cat { text-align: center; }


/* Team-Up logo */
.tu-logo { display: block; height: 46px; width: auto; border-radius: 12px; }
.tu-logo.big { height: auto; width: min(260px, 62vw); border-radius: 20px; margin: 0 auto; box-shadow: 0 10px 28px rgba(242,111,56,.28); animation: logoIn .8s cubic-bezier(.2,1.5,.4,1) both; }
.home .tu-logo.big { width: min(340px, 60vw); margin-bottom: 36px; }
@keyframes logoIn { from { transform: scale(.6) translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }

.topbrand { display: inline-flex; align-items: center; gap: 12px; min-width: 0; }
.topbar .tu-logo { height: 38px; }
.topbar .brand { font-size: 15px; white-space: nowrap; }

/* logo blends straight into the page: transparent, no tile, no shadow */
.tu-logo, .tu-logo.big, .home .tu-logo.big { border-radius: 0; box-shadow: none; background: none; }
.tu-logo { height: 40px; }
.topbar .tu-logo { height: 32px; }
.tu-logo.big { width: min(300px, 64vw); }
.home .tu-logo.big { width: min(420px, 64vw); margin-bottom: 40px; }

/* live view: scale to the window height so nothing needs scrolling */
.admin { padding: 10px 40px 14px; }
.ahead { padding-bottom: 8px; margin-bottom: 10px; gap: 14px; }
.ahead .tu-logo { height: 34px; }
.ahead .brand { font-size: 20px; }
.tab { padding: 7px 18px; font-size: 15px; }
.play-bar { margin-bottom: 8px; }
.play-team { font-size: clamp(24px, 4.4vh, 46px); }
.play-bar .btn { padding: 8px 18px; font-size: 15px; }
.play-grid { align-items: start; gap: clamp(28px, 4vw, 80px); grid-template-columns: minmax(300px, 46%) 1fr; }
.play-wheel .wheel-wrap { width: min(100%, calc(100vh - 150px)); margin: 6px auto 0; }
.play-main { gap: 1.6vh; }
.stage { padding: 2vh 30px; gap: 1.2vh; border-radius: 22px; }
.stage-cat { min-height: 0; }
.stage .catname { font-size: 17px; padding: 6px 20px; }
.stage .q-admin { font-size: clamp(26px, min(2.9vw, 5vh), 60px); line-height: 1.35; }
.stage .a-admin { font-size: clamp(20px, min(1.9vw, 3.4vh), 36px); }
.clock { padding: 0; }
.clock .timer { font-size: min(14vh, 9vw); margin: 0 0 1.2vh; }
.clock .bar { height: 12px; }
.controls { gap: 1.4vh; position: sticky; bottom: 0; background: var(--bg); padding-top: 4px; }
.controls .judge { gap: 14px; }
.controls .judge .btn { padding: 2.6vh 20px; font-size: min(3.4vh, 2.2vw); border-radius: 18px; }
#bNext { padding: 3vh 20px; font-size: min(3.8vh, 2.6vw); border-radius: 18px; }
.controls-sub { gap: 12px; }
.controls-sub .btn { padding: 1.5vh 12px; font-size: 16px; }

.play-wheel .wheel-wrap { width: min(100%, calc(100vh - 175px)); }
html, body { overflow-x: hidden; }
