/* durusi a3 v2 — landing, teacher board (projector) and student phone. a2 look: #0b6fb0, Baloo Bhaijaan 2 + IBM Plex Sans Arabic, RTL. */
:root {
  --brand: #0b6fb0; --brand-d: #085689; --brand-l: #e7f2fa; --accent: #ffb020;
  --ok: #1f9d55; --no: #d64545; --ink: #17324a; --muted: #5d7385; --bg: #f4f8fb; --card: #fff;
  --ta: #1e7fd6; --tb: #ff8a1f;
  --r: 22px; --shadow: 0 8px 26px rgba(11, 111, 176, .14); --tap: 56px;
  --c0: #e04848; --c1: #1e7fd6; --c2: #e0a400; --c3: #1f9d55;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
button, a, .s-ch, .tile-l, .react, .hand-btn, .ear-btn, .tf button { touch-action: manipulation; -webkit-user-select: none; user-select: none; cursor: pointer; }
body {
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif; color: var(--ink); background: var(--bg);
  min-height: 100vh; -webkit-tap-highlight-color: transparent;
}
body[data-skin="kids"] { background: linear-gradient(180deg, #dff3ff 0%, #c4e8fb 55%, #a9dcf5 100%) fixed; }
body[data-skin="adults"] { background: #f2f5f8; }
h1, h2, h3, .brand, .btn, .code-xl, .num, .round-title, .bravo, .s-ch, .ch, .tile-l, .slots, .letters, .pts, .em-xl {
  font-family: 'Baloo Bhaijaan 2', 'IBM Plex Sans Arabic', system-ui, sans-serif;
}
h1 { font-size: clamp(1.7rem, 4.5vw, 3rem); margin: .3em 0; line-height: 1.2; }
h2 { font-size: clamp(1.25rem, 2.6vw, 1.9rem); margin: 0 0 .3em; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[dir="ltr"] { unicode-bidi: isolate; }

/* top bar */
.top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--brand); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.brand { color: #fff; text-decoration: none; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.brand small { font-size: .8rem; opacity: .8; }
.tag, .mode-pill { opacity: .9; font-weight: 700; }
.conn { margin-inline-start: auto; font-size: .85rem; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.15); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conn[data-connected="1"] { background: #e8f7ee; color: var(--ok); font-weight: 700; }
.conn[data-connected="0"]:not([data-reason="idle"]):not([data-reason="connecting"]) { background: #fde8e8; color: var(--no); }

/* buttons */
.btn { min-height: var(--tap); padding: 8px 20px; border-radius: 18px; border: 2px solid var(--brand-l); background: #fff; color: var(--brand-d);
  font-size: 1.1rem; font-weight: 800; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
  transition: transform .08s, box-shadow .15s, background .15s; }
.btn:hover { box-shadow: var(--shadow); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.accent { background: var(--accent); color: #3b2600; border-color: var(--accent); }
.btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); min-height: 42px; }
.btn.sm { min-height: 40px; padding: 4px 12px; font-size: .95rem; border-radius: 12px; }
.btn.mega { min-height: 84px; font-size: clamp(1.4rem, 3vw, 2.1rem); padding: 12px 40px; border-radius: 28px; box-shadow: 0 8px 0 rgba(0,0,0,.14); }
.btn.mega:active { transform: translateY(4px); box-shadow: 0 4px 0 rgba(0,0,0,.14); }
.btn[aria-pressed="true"] { background: var(--brand-l); border-color: var(--brand); }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 14px rgba(255,176,32,.25), 0 8px 0 rgba(0,0,0,.14); } }
.field { min-height: var(--tap); padding: 8px 14px; border-radius: 16px; border: 2px solid #cfe0ec; font: inherit; font-size: 1.1rem; background: #fff; color: var(--ink); min-width: 0; width: 100%; }
.field:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.field.big { min-height: 64px; font-size: 1.35rem; }
.code-in { letter-spacing: .4em; text-transform: uppercase; text-align: center; font-weight: 800; font-family: 'Baloo Bhaijaan 2', monospace; }
.lbl { display: flex; flex-direction: column; gap: 8px; font-weight: 700; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }

/* avatars */
.av { display: inline-grid; place-items: center; border-radius: 50%; overflow: hidden; flex: none; color: #fff; font-weight: 800; background: #dbe9f4; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.12); font-family: 'Baloo Bhaijaan 2', sans-serif; }
.av-img { position: relative; background: #f6d9a8; color: var(--brand-d); }
.av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top; background: #e7f2fa; }
.av-sm { width: 34px; height: 34px; font-size: 1rem; border-width: 2px; }
.av-md { width: 52px; height: 52px; font-size: 1.5rem; }
.av-lg { width: 76px; height: 76px; font-size: 2.2rem; }
.av-xl { width: 128px; height: 128px; font-size: 3.6rem; border-width: 5px; }

/* toast, floaters, confetti */
#toast { position: fixed; inset-inline: 0; bottom: 110px; margin: auto; width: max-content; max-width: 90vw; background: #17324a; color: #fff; padding: 12px 20px; border-radius: 16px; opacity: 0; transform: translateY(10px); transition: .25s; z-index: 80; pointer-events: none; font-weight: 700; }
#toast.show { opacity: 1; transform: none; }
#float-layer { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.floater { position: absolute; bottom: -80px; display: flex; flex-direction: column; align-items: center; gap: 2px; animation: floatUp 3.1s ease-out forwards; }
.floater .fl-e { font-size: 3rem; line-height: 1; }
.floater .fl-n { font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.9); padding: 0 8px; border-radius: 99px; }
@keyframes floatUp { 0% { transform: translateY(0) scale(.6); opacity: 0; } 15% { opacity: 1; transform: translateY(-15vh) scale(1.1); } 100% { transform: translateY(-85vh) scale(1); opacity: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 75; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 16px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg) translateX(40px); } }

/* actor (a2 videos) */
.actor { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: #cfe6f5; box-shadow: var(--shadow); }
.actor-v { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .2s; }
.actor-v.show { opacity: 1; }
.actor-still { width: 100%; height: 100%; object-fit: cover; }
.actor-mood { position: absolute; bottom: 8px; inset-inline-start: 8px; background: rgba(255,255,255,.92); padding: 4px 12px; border-radius: 99px; font-weight: 800; font-size: 1rem; }
.actor[data-mood="happy"] { animation: bounce .5s 3; box-shadow: 0 0 0 6px #ffd84d, var(--shadow); }
.actor[data-mood="oops"] { animation: shake .4s 2; box-shadow: 0 0 0 6px #ffb0b0, var(--shadow); }
.actor[data-mood="wave"] { box-shadow: 0 0 0 6px #b8f0cf, var(--shadow); }
.actor[data-mood="wave"]::after { content: '👋'; position: absolute; top: 8px; inset-inline-end: 10px; font-size: 3rem; animation: wave .5s 4; transform-origin: 70% 70%; }
@keyframes bounce { 50% { transform: translateY(-10px); } }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@keyframes wave { 50% { transform: rotate(25deg); } }

/* ------------------------------------------------------------ landing */
.landing { max-width: 1180px; margin: 0 auto; padding: 18px 18px 40px; text-align: center; }
.lead { font-size: 1.3rem; color: var(--muted); margin: 0 0 18px; }
.steps { list-style: none; padding: 0; margin: 0 0 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { position: relative; background: #fff; border-radius: 28px; padding: 18px 18px 22px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; }
.step h2 { margin-top: 12px; }
.step p { margin: 0; font-size: 1.1rem; color: var(--muted); line-height: 1.6; }
.num { position: absolute; top: -14px; inset-inline-start: -10px; width: 56px; height: 56px; border-radius: 50%; background: var(--accent); color: #3b2600; display: grid; place-items: center; font-size: 2rem; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.12); z-index: 2; }
.pic { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; background: linear-gradient(160deg, #e7f2fa, #cfe6f5); display: flex; align-items: flex-end; justify-content: center; }
.pic img { height: 100%; object-fit: contain; }
.pic.wide img { width: 100%; object-fit: cover; }
.pic.duo img { height: 88%; width: 48%; object-fit: contain; }
.pic-e { font-size: 6rem; align-self: center; }
.badge-qr { position: absolute; top: 10px; inset-inline-end: 10px; background: #fff; border-radius: 14px; padding: 6px 12px; font-weight: 800; box-shadow: var(--shadow); color: var(--brand-d); }
.ph-ic { position: absolute; bottom: 10px; inset-inline-end: 12px; font-size: 3rem; }
.trophy { position: absolute; top: 8px; inset-inline-end: 10px; font-size: 3.2rem; filter: drop-shadow(0 3px 4px rgba(0,0,0,.25)); }
.cta { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.cta .btn { min-width: min(100%, 380px); }
.quiet { color: var(--muted); margin-top: 22px; font-size: 1.05rem; }
.quiet a { color: var(--brand-d); font-weight: 700; }
.foot { text-align: center; color: var(--muted); padding: 16px; font-size: .9rem; }
.foot .discreet { color: var(--muted); }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; gap: 26px; } .pic { aspect-ratio: 16 / 9; } }

/* ------------------------------------------------------------ teacher board */
body[data-page="teacher"] { padding-bottom: 130px; }
.board { max-width: 1600px; margin: 0 auto; padding: 16px; }
.board > section { display: none; }
.board[data-phase="lobby"] > .lobby,
.board[data-phase="wait"] > .wait,
.board[data-phase="scene"] > .stage, .board[data-phase="path"] > .stage, .board[data-phase="game"] > .stage,
.board[data-phase="podium"] > .podium-wrap { display: grid; }

.lobby { justify-items: center; gap: 18px; text-align: center; padding-top: 10px; }
.lobby-art { width: min(560px, 90vw); aspect-ratio: 16 / 10; object-fit: cover; border-radius: 28px; box-shadow: var(--shadow); }
.skin-toggle { display: inline-flex; background: #fff; border-radius: 999px; padding: 6px; box-shadow: var(--shadow); gap: 6px; }
.skin-b { border: 0; background: transparent; border-radius: 999px; padding: 6px 22px 6px 10px; font: 800 1.25rem 'Baloo Bhaijaan 2', sans-serif; color: var(--muted); display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 60px; }
.skin-b img { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--brand-l); }
.skin-b[aria-pressed="true"] { background: var(--brand); color: #fff; }

.wait { grid-template-columns: minmax(340px, 1fr) 1.3fr; gap: 22px; align-items: start; }
.join-card { background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 22px; text-align: center; display: grid; gap: 10px; justify-items: center; }
.join-l { margin: 0; font-size: 1.25rem; font-weight: 700; }
.code-xl { direction: ltr; font-size: clamp(4rem, 10vw, 9rem); font-weight: 800; letter-spacing: .12em; line-height: 1; color: var(--brand-d); background: var(--brand-l); border-radius: 26px; padding: 14px 26px 6px; }
.qr-box img { width: min(340px, 34vw); height: auto; aspect-ratio: 1; image-rendering: pixelated; border-radius: 16px; background: #fff; }
.roster { background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 22px; min-height: 360px; }
.count { background: var(--accent); border-radius: 999px; padding: 0 14px; color: #3b2600; }
.student-list { display: flex; flex-wrap: wrap; gap: 16px; }
.student-list .empty { color: var(--muted); font-size: 1.3rem; }
.s-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 120px; padding: 10px 6px; border-radius: 20px; background: var(--brand-l); animation: pop .35s; cursor: default; }
.s-tile.off { opacity: .45; }
.s-tile.hand { background: #fff4d6; box-shadow: 0 0 0 4px var(--accent); cursor: pointer; }
.s-tile.spot { box-shadow: 0 0 0 4px var(--ok); }
.s-name { font-weight: 800; font-size: 1.1rem; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-name small { font-size: .72em; color: var(--muted); font-weight: 700; }
.s-hand { position: absolute; top: -8px; inset-inline-end: -4px; font-size: 1.8rem; animation: wave .5s infinite; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }

.stage { grid-template-columns: 1fr minmax(300px, 380px); gap: 18px; align-items: start; }
.stage-main { background: #fff; border-radius: 30px; box-shadow: var(--shadow); padding: 18px 22px; min-height: 60vh; display: flex; flex-direction: column; gap: 14px; }
.round-head { display: flex; align-items: center; gap: 14px; }
.round-title { font-size: clamp(1.4rem, 2.6vw, 2.2rem); font-weight: 800; color: var(--brand-d); }
.round-pos { background: var(--brand-l); border-radius: 999px; padding: 2px 14px; font-weight: 800; font-size: 1.2rem; }
.timer { margin-inline-start: auto; position: relative; width: 86px; height: 86px; --frac: 1; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke: var(--brand-l); stroke-width: 5; }
.timer circle.arc { stroke: var(--brand); stroke-linecap: round; stroke-dasharray: 119.4; stroke-dashoffset: calc(119.4 * (1 - var(--frac))); transition: stroke-dashoffset .2s linear; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font: 800 2.2rem 'Baloo Bhaijaan 2', sans-serif; }
.timer.low circle.arc { stroke: var(--no); }
.timer.low b { color: var(--no); animation: shake .4s infinite; }
.prompt { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.q-top { display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 180px; }
.em-xl { font-size: clamp(7rem, 14vw, 12rem); line-height: 1; filter: drop-shadow(0 6px 8px rgba(0,0,0,.15)); animation: pop .4s; }
.qmark { font: 800 8rem 'Baloo Bhaijaan 2', sans-serif; color: var(--brand-l); -webkit-text-stroke: 3px var(--brand); }
.answer-word { direction: ltr; font: 800 clamp(3rem, 7vw, 6rem) 'Baloo Bhaijaan 2', sans-serif; color: var(--ok); animation: pop .4s; }
.ear-btn { width: 150px; height: 150px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 4.4rem; cursor: pointer; box-shadow: 0 8px 0 var(--brand-d); animation: pulse 1.8s infinite; }
.ear-btn.sm { width: 84px; height: 84px; font-size: 2.4rem; box-shadow: 0 5px 0 var(--brand-d); }
.choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.ch { position: relative; border-radius: 24px; padding: 16px 10px; min-height: 150px; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; transition: opacity .2s, transform .2s; }
.ch:nth-child(1) { background: var(--c0); } .ch:nth-child(2) { background: var(--c1); } .ch:nth-child(3) { background: var(--c2); } .ch:nth-child(4) { background: var(--c3); }
.ch .n { position: absolute; top: 8px; inset-inline-start: 12px; font-weight: 800; opacity: .8; }
.ch .em { font-size: 5rem; line-height: 1; }
.ch b { direction: ltr; font-size: clamp(1.8rem, 3.4vw, 3rem); }
.ch.right { transform: scale(1.06); box-shadow: 0 0 0 6px #fff, 0 0 0 11px var(--ok); }
.ch.dim { opacity: .3; }
.under { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 34px; }
.under .av { animation: pop .3s; }
.bubble { direction: ltr; background: #fff; border: 3px solid var(--brand); border-radius: 22px; padding: 10px 20px; font-size: 1.6rem; font-weight: 700; position: relative; }
.bubble.big { font-size: clamp(2rem, 4vw, 3.4rem); }
.bubble .strike { text-decoration: line-through; color: var(--no); }
.bubble .fix { color: var(--ok); }
.catch-q { text-align: center; font-size: 2rem; font-weight: 800; margin: 0; }
.catch-q b { color: var(--ok); }
.slots { direction: ltr; display: flex; justify-content: center; gap: 10px; }
.slots span { width: 74px; height: 86px; border-bottom: 6px solid var(--brand); display: grid; place-items: center; font-size: 3.4rem; font-weight: 800; color: var(--ok); text-transform: lowercase; }
.letters { direction: ltr; display: flex; justify-content: center; gap: 10px; }
.letters span { width: 70px; height: 70px; border-radius: 16px; background: var(--accent); display: grid; place-items: center; font-size: 2.6rem; font-weight: 800; box-shadow: 0 5px 0 #c98700; }
.intro { text-align: center; display: grid; gap: 16px; justify-items: center; padding: 10px; }
.intro h2 { font-size: clamp(2.2rem, 5vw, 4rem); }
.big-ic { font-size: 8rem; margin: 0; }
.teams { display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; width: 100%; align-items: center; }
.team { border-radius: 26px; padding: 16px; min-height: 180px; }
.team.ta { background: #e3f0fd; border: 4px solid var(--ta); }
.team.tb { background: #fff0e0; border: 4px solid var(--tb); }
.team > div { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.mini { display: flex; flex-direction: column; align-items: center; font-weight: 700; }
.vs { font: 800 3rem 'Baloo Bhaijaan 2', sans-serif; color: var(--muted); }
.scene-card { position: relative; border-radius: 24px; overflow: hidden; min-height: 52vh; background: var(--brand-l); }
.scene-img { width: 100%; height: 100%; min-height: 52vh; object-fit: cover; display: block; }
.hotspots { position: absolute; inset-inline: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.spot-card { background: rgba(255,255,255,.93); border-radius: 20px; padding: 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.spot-card .em { font-size: 3.4rem; line-height: 1; }
.spot-card b { direction: ltr; font-size: 1.8rem; }
.spot-card.target { box-shadow: 0 0 0 5px var(--accent); animation: bounce 1s infinite; }
.spot-card.right { box-shadow: 0 0 0 6px var(--ok); animation: none; }
.scene-card .bubble { position: absolute; top: 14px; inset-inline-start: 14px; }
.who-answered { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg); border-radius: 18px; min-height: 68px; }
.wa-l { font-weight: 800; margin-inline-end: 6px; }
.wa { position: relative; display: inline-flex; flex-direction: column; align-items: center; transition: .2s; }
.wa.wait { opacity: .35; filter: grayscale(1); }
.wa.ok .av { box-shadow: 0 0 0 4px var(--ok); animation: pop .3s; }
.wa.no .av { box-shadow: 0 0 0 4px var(--no); animation: shake .3s; }
.wa small { font-weight: 800; color: var(--ok); font-size: .8rem; }
.stage-side { display: grid; gap: 14px; }
.team-bar { background: #fff; border-radius: 22px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 8px; }
.tb-row { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font-weight: 800; }
.tb-track { position: relative; height: 26px; background: var(--bg); border-radius: 99px; overflow: hidden; }
.tb-track i { position: absolute; inset-block: 0; inset-inline-start: 0; width: 0; border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
[data-testid="team-a"] { background: linear-gradient(90deg, #6fb7f5, var(--ta)); }
[data-testid="team-b"] { background: linear-gradient(90deg, #ffc27a, var(--tb)); }
.isle { position: absolute; inset-inline-end: 4px; top: 0; line-height: 26px; }
.leaderboard { list-style: none; margin: 0; padding: 12px; background: #fff; border-radius: 22px; box-shadow: var(--shadow); display: grid; gap: 6px; }
.leaderboard li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 14px; background: var(--bg); font-weight: 700; font-size: 1.15rem; transition: background .3s; }
.leaderboard li.lb-h { background: none; font: 800 1.3rem 'Baloo Bhaijaan 2', sans-serif; }
.leaderboard li.spot { box-shadow: 0 0 0 3px var(--ok); }
.leaderboard li.me { background: #fff4d6; }
.leaderboard .rk { width: 30px; text-align: center; }
.leaderboard .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard .pts { font-size: 1.3rem; color: var(--brand-d); }
.fire { font-size: .95rem; color: #d35400; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.dot.ta { background: var(--ta); } .dot.tb { background: var(--tb); }

.podium-wrap { justify-items: center; gap: 14px; text-align: center; }
.bravo { font-size: clamp(2.6rem, 7vw, 5.4rem); color: var(--brand-d); margin: 0; animation: bounce .8s infinite; }
.team-winner { font: 800 clamp(1.4rem, 3vw, 2.4rem) 'Baloo Bhaijaan 2', sans-serif; background: #fff; border-radius: 999px; padding: 8px 28px; box-shadow: var(--shadow); }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 16px; width: min(900px, 100%); }
.pd { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; font-weight: 800; font-size: 1.4rem; animation: pop .6s; }
.pd .block { width: 100%; border-radius: 20px 20px 0 0; color: #fff; font: 800 3.4rem 'Baloo Bhaijaan 2', sans-serif; display: grid; place-items: center; }
.pd.p1 .block { height: 220px; background: linear-gradient(#ffcf4d, #e0a400); }
.pd.p2 .block { height: 160px; background: linear-gradient(#cfd8e0, #97a7b5); }
.pd.p3 .block { height: 120px; background: linear-gradient(#f0b07a, #c87533); }
.pd.p1 .av { box-shadow: 0 0 0 6px #ffcf4d; }
.ranking { list-style: none; padding: 0; margin: 0; width: min(700px, 100%); display: grid; gap: 6px; }
.ranking li { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 16px; padding: 8px 14px; font-weight: 700; font-size: 1.2rem; box-shadow: var(--shadow); }
.ranking .rk { width: 30px; font-weight: 800; }
.ranking .nm { flex: 1; text-align: start; }

.hands { position: fixed; top: 80px; inset-inline-start: 16px; z-index: 60; display: grid; gap: 8px; }
.hand-pop { display: flex; align-items: center; gap: 10px; background: #fff4d6; border: 3px solid var(--accent); border-radius: 999px; padding: 6px 18px 6px 8px; font-size: 1.3rem; box-shadow: var(--shadow); animation: pop .3s; }

.guide-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 40; display: flex; gap: 16px; align-items: center; padding: 14px 20px; background: rgba(255,255,255,.96); box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
.guide-text { flex: 1; margin: 0; font-size: clamp(1.1rem, 2vw, 1.6rem); font-weight: 700; line-height: 1.5; }
.guide-text::before { content: '💡 '; }
.btn.next { background: var(--ok); color: #fff; border-color: var(--ok); min-width: 260px; }

.tools { position: fixed; top: 64px; inset-inline-end: 12px; z-index: 50; width: min(420px, 94vw); max-height: calc(100vh - 200px); overflow: auto; background: #fff; border-radius: 22px; box-shadow: 0 12px 40px rgba(0,0,0,.2); padding: 16px; display: grid; gap: 12px; }
.tools h3, .tools h4 { margin: 0; }
.ts-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--bg); }
.ts-row .nm { flex: 1; font-weight: 700; }

@media (max-width: 1000px) {
  .wait, .stage { grid-template-columns: 1fr; }
  .choices, .hotspots { grid-template-columns: repeat(2, 1fr); }
  .qr-box img { width: min(300px, 70vw); }
}

/* ------------------------------------------------------------ student phone */
.me-chip { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.18); border-radius: 999px; padding: 3px 10px 3px 4px; font-weight: 700; }
.me-chip .pts { background: var(--accent); color: #3b2600; border-radius: 999px; padding: 0 10px; font-weight: 800; }
.phone { max-width: 560px; margin: 0 auto; padding: 14px; display: grid; gap: 14px; }
.join { display: grid; gap: 16px; }
.avatar-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.av-b { border: 0; background: var(--bg); border-radius: 20px; padding: 8px 0; cursor: pointer; display: grid; place-items: center; min-height: 92px; }
.av-b[aria-checked="true"] { background: #fff4d6; box-shadow: 0 0 0 4px var(--accent); transform: scale(1.05); }
.err { color: var(--no); font-weight: 700; margin: 0; }
.waiting { text-align: center; display: grid; justify-items: center; gap: 6px; padding: 30px 20px; }
.w-av .av { animation: bounce 1.6s infinite; }
.w-msg { font-size: 1.6rem; font-weight: 800; margin: 6px 0; }
.play { display: grid; gap: 12px; }
.hint-row { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 20px; padding: 8px 12px; box-shadow: var(--shadow); }
.mini-actor { width: 54px; height: 54px; border-radius: 50%; object-fit: cover; object-position: top; background: var(--brand-l); flex: none; }
.mini-actor[data-mood="happy"] { animation: bounce .5s 3; box-shadow: 0 0 0 4px #ffd84d; }
.mini-actor[data-mood="oops"] { animation: shake .4s 2; box-shadow: 0 0 0 4px #ffb0b0; }
.student-hint { margin: 0; font-weight: 800; font-size: 1.2rem; }
.s-timer { height: 14px; background: #fff; border-radius: 99px; overflow: hidden; }
.s-timer i { display: block; height: 100%; width: 100%; background: var(--brand); border-radius: 99px; transition: width .2s linear; }
.s-timer.low i { background: var(--no); }
.q { display: grid; gap: 12px; justify-items: center; min-height: 40vh; align-content: start; }
.q .ear-btn { width: 120px; height: 120px; font-size: 3.4rem; }
.em-l { font-size: 6rem; line-height: 1; }
.s-choices { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.s-ch { border: 0; border-radius: 22px; min-height: 120px; color: #fff; font-size: 2rem; font-weight: 800; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; box-shadow: 0 6px 0 rgba(0,0,0,.18); }
.s-ch:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.s-ch.c0 { background: var(--c0); } .s-ch.c1 { background: var(--c1); } .s-ch.c2 { background: var(--c2); } .s-ch.c3 { background: var(--c3); }
.s-ch .em { font-size: 4rem; line-height: 1; }
.s-ch b { direction: ltr; }
.s-choices.both .s-ch { font-size: 1.5rem; }
.s-ch.target { box-shadow: 0 0 0 5px var(--accent), 0 6px 0 rgba(0,0,0,.18); }
.s-say { direction: ltr; font-size: 1.6rem; margin: 0; }
.s-sub { margin: 0; font-weight: 800; font-size: 1.2rem; }
.tf { width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tf-no { background: var(--no); min-height: 140px; font-size: 2.2rem; }
.tf-ok { background: var(--ok); min-height: 140px; font-size: 2rem; }
.spell-top { display: flex; align-items: center; gap: 16px; }
.q .slots span { width: 48px; height: 60px; font-size: 2.2rem; border-bottom-width: 5px; }
.tiles { direction: ltr; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.tile-l { width: 66px; height: 66px; border: 0; border-radius: 16px; background: var(--accent); font-size: 2.2rem; font-weight: 800; color: #3b2600; box-shadow: 0 5px 0 #c98700; cursor: pointer; }
.tile-l:disabled { opacity: .25; box-shadow: none; }
.fb { width: 100%; text-align: center; border-radius: 24px; padding: 24px 14px; font-size: 2rem; font-weight: 800; display: grid; gap: 4px; animation: pop .35s; }
.fb.ok { background: #e3f7ea; color: var(--ok); }
.fb.no { background: #fde8e8; color: var(--no); font-size: 1.5rem; }
.fb.sent, .fb.late { background: #fff; color: var(--muted); font-size: 1.5rem; }
.fb small { font-size: 1.05rem; color: #d35400; }
.reveal { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 20px; padding: 10px 20px; box-shadow: var(--shadow); }
.reveal .em { font-size: 3.6rem; }
.reveal b { direction: ltr; font: 800 2.6rem 'Baloo Bhaijaan 2', sans-serif; color: var(--ok); }
.s-intro { text-align: center; }
.team-tag { font-size: 1.6rem; font-weight: 800; border-radius: 999px; padding: 8px 20px; }
.team-tag.ta { background: #e3f0fd; color: var(--ta); }
.team-tag.tb { background: #fff0e0; color: #c25e00; }
.who-answered.mini { min-height: 0; padding: 6px 10px; background: rgba(255,255,255,.7); }
.leaderboard.compact li { font-size: 1rem; }
.s-podium { text-align: center; display: grid; gap: 12px; justify-items: center; }
.s-podium .bravo { font-size: 2.6rem; }
.my-place p { font-size: 1.4rem; font-weight: 700; margin: 8px 0 0; }
.podium.small .pd { font-size: 1rem; }
.podium.small .block { font-size: 2rem; }
.podium.small .p1 .block { height: 110px; } .podium.small .p2 .block { height: 80px; } .podium.small .p3 .block { height: 60px; }
.spot-banner { position: fixed; top: 64px; inset-inline: 10px; z-index: 55; background: #e3f7ea; border: 3px solid var(--ok); border-radius: 20px; padding: 12px; text-align: center; font-weight: 800; font-size: 1.3rem; }
.spot-banner[data-me="1"] { background: #fff4d6; border-color: var(--accent); animation: bounce .6s 3; }
.dock { position: fixed; inset-inline: 0; bottom: 0; z-index: 45; background: rgba(255,255,255,.97); box-shadow: 0 -4px 18px rgba(0,0,0,.08); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.hand-btn { width: 100%; min-height: 54px; font-size: 1.3rem; }
.hand-btn.up { background: var(--accent); border-color: var(--accent); color: #3b2600; }
.reactions { display: flex; justify-content: space-between; gap: 6px; }
.react { flex: 1; min-height: 52px; border: 0; border-radius: 16px; background: var(--bg); font-size: 1.8rem; cursor: pointer; }
.react:active { transform: scale(1.2); }
.react:disabled { opacity: .4; }
body[data-page="student"][data-skin="adults"] .s-ch { box-shadow: 0 4px 0 rgba(0,0,0,.12); }


/* ---- a3 v3: unlock bar, try-as-student, solo, actor reactions ---- */
.audio-unlock {
  position: fixed; inset-inline: 12px; top: calc(8px + env(safe-area-inset-top)); z-index: 80;
  border: 0; border-radius: 16px; padding: 12px 16px; font: inherit; font-weight: 800; font-size: 1.05rem;
  background: #0b6fb0; color: #fff; box-shadow: 0 8px 24px rgba(11,111,176,.35); cursor: pointer;
}
.audio-unlock:hover { filter: brightness(1.05); }
body[data-page="student"] {
  min-height: 100dvh;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}
body[data-page="student"] .top { flex: 0 0 auto; position: sticky; }
body[data-page="student"] .phone {
  flex: 1 1 auto;
  width: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}
body[data-page="student"] .dock {
  position: relative;
  inset: auto;
  flex: 0 0 auto;
  width: 100%;
  z-index: 40;
}
body[data-page="student"] .s-ch,
body[data-page="student"] .tile-l,
body[data-page="student"] .ear-btn,
body[data-page="student"] .tf .s-ch { pointer-events: auto; position: relative; z-index: 2; }
.audio-unlock {
  max-width: min(520px, calc(100vw - 24px));
  pointer-events: auto;
}
.audio-unlock[hidden] { display: none !important; }
.wa.bot::after { content: ''; }
.leaderboard li[data-bot="1"] .nm::after { content: ' · افتراضي'; font-size: .75em; color: var(--muted); font-weight: 700; }
.bots-toggle { display: flex; align-items: center; gap: 10px; }

.solo-hint { text-align: center; margin: 8px 0 0; }
.btn.mega.ghost, .btn.ghost.mega { background: #fff; color: #0b4f7c; border: 2px solid #0b6fb0; }
.stu-actor { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 4px 0 rgba(0,0,0,.08); }
.stu-actor .actor, .stu-actor video, .stu-actor img { width: 100%; height: 100%; object-fit: cover; }
.stu-actor[data-mood="happy"] { box-shadow: 0 0 0 3px #3cbf6e, 0 6px 0 rgba(60,191,110,.25); transform: scale(1.06); transition: transform .2s; }
.stu-actor[data-mood="oops"] { box-shadow: 0 0 0 3px #e36b4a, 0 6px 0 rgba(227,107,74,.2); }
.stu-actor[data-mood="wave"] { box-shadow: 0 0 0 3px #0b6fb0; }
.hint-row { display: flex; gap: 10px; align-items: center; }
.try-panel {
  position: fixed; inset-block: 0; inset-inline-end: 0; width: min(420px, 96vw); z-index: 70;
  background: #fff; box-shadow: -8px 0 28px rgba(0,0,0,.18); display: flex; flex-direction: column;
}
.try-panel[hidden] { display: none !important; }
.try-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid #e6eef4; font-weight: 800; }
.try-head b { flex: 1; }
.try-panel iframe { flex: 1; border: 0; width: 100%; background: #eaf6ff; }
body[data-try="1"] .board { margin-inline-end: min(420px, 96vw); }
@media (max-width: 800px) {
  body[data-try="1"] .board { margin-inline-end: 0; }
  .try-panel { width: 100%; inset-block-start: 20%; border-radius: 16px 16px 0 0; }
}
.actor-box[data-mood="happy"] { outline: 4px solid #3cbf6e; border-radius: 20px; }
.actor-box[data-mood="oops"] { outline: 4px solid #e36b4a; border-radius: 20px; }
