:root {
  --bg: #0f1220; --panel: #171b2e; --panel2: #1f2440; --line: #2c3358; --text: #eef0ff; --muted: #9aa1c7;
  --accent: #7c5cff; --accent2: #22d3ee; --ok: #22c55e; --warn: #f59e0b; --bad: #ef4444; --gold: #fbbf24;
  --r: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text); font-family: "Rubik", "Segoe UI", "Assistant", Arial, sans-serif; direction: rtl; font-size: 15px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel2); border-radius: 10px; padding: 8px 14px; transition: .15s; }
button:hover { border-color: var(--accent); }
button.primary { background: linear-gradient(135deg, var(--accent), #5b8cff); border: 0; font-weight: 700; }
button.big { padding: 12px 22px; font-size: 17px; }
button.ghost { background: transparent; }
button.sm { padding: 4px 9px; font-size: 13px; border-radius: 8px; }
button:disabled { opacity: .5; cursor: wait; }
input, select, textarea { background: #0c0f1c; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { width: 100%; resize: vertical; min-height: 110px; }
label { color: var(--muted); font-size: 13px; }
.top { position: sticky; top: 0; z-index: 10; display: flex; gap: 12px; align-items: center; padding: 12px 20px; background: rgba(15,18,32,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.top .logo { font-weight: 800; font-size: 20px; background: linear-gradient(90deg, var(--gold), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.top .title { font-size: 18px; font-weight: 700; min-width: 220px; flex: 1; max-width: 420px; }
.spacer { flex: 1; }
.layout { display: grid; grid-template-columns: 380px 1fr; gap: 20px; padding: 20px; align-items: start; }
@media (max-width: 1000px) { .layout { grid-template-columns: 1fr; } }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-bottom: 16px; }
.panel h3 { margin: 0 0 12px; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.side { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs button { flex: 1; padding: 7px 6px; font-size: 13px; }
.tabs button.on { background: var(--accent); border-color: var(--accent); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.row > * { flex: 1; min-width: 0; }
.row > button, .row > .fit { flex: 0 0 auto; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; color: var(--muted); cursor: pointer; }
.drop:hover, .drop.over { border-color: var(--accent2); color: var(--text); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.thumbs img, .thumbs video { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: var(--panel2); border: 1px solid var(--line); }
.badge.ai-on { background: rgba(34,197,94,.15); border-color: var(--ok); color: #86efac; }
.badge.ai-off { background: rgba(245,158,11,.12); border-color: var(--warn); color: #fcd34d; }

.cards { display: grid; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; position: relative; animation: pop .25s ease; }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
.card.double { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.card.mine { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad) inset; }
.card .num { width: 34px; height: 34px; border-radius: 50%; background: var(--panel2); display: grid; place-items: center; font-weight: 800; }
.card .qtext { font-size: 17px; font-weight: 700; padding: 4px 6px; border-radius: 8px; outline: none; min-height: 28px; }
.card [contenteditable]:hover { background: rgba(255,255,255,.04); }
.card [contenteditable]:focus { background: #0c0f1c; box-shadow: 0 0 0 1px var(--accent); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ans { display: flex; align-items: center; gap: 8px; background: #0f1326; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; }
.ans.correct { border-color: var(--ok); background: rgba(34,197,94,.1); }
.ans .dot { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: 0 0 auto; cursor: pointer; color: #fff; }
.ans .txt { flex: 1; outline: none; padding: 2px 4px; border-radius: 6px; }
.meta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.meta select, .meta input { padding: 4px 8px; font-size: 13px; }
.meta .toggle { padding: 4px 10px; font-size: 13px; border-radius: 99px; }
.meta .toggle.on.d { background: rgba(251,191,36,.18); border-color: var(--gold); color: var(--gold); }
.meta .toggle.on.m { background: rgba(239,68,68,.18); border-color: var(--bad); color: #fca5a5; }
.media { width: 130px; }
.media img, .media video { width: 130px; height: 100px; object-fit: cover; border-radius: 10px; display: block; }
.media .add { width: 130px; height: 100px; border: 2px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); cursor: pointer; font-size: 13px; text-align: center; }
.tools { display: flex; flex-direction: column; gap: 6px; }
.ai-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ai-tools button { font-size: 12.5px; padding: 4px 10px; border-radius: 99px; background: rgba(124,92,255,.12); border-color: rgba(124,92,255,.4); }
.card.busy::after { content: "✨ ה-AI עובד..."; position: absolute; inset: 0; background: rgba(15,18,32,.75); display: grid; place-items: center; border-radius: var(--r); font-weight: 700; }
.expl { color: var(--muted); font-size: 13px; margin-top: 6px; outline: none; }
.section-title { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; font-size: 20px; }
.empty { text-align: center; color: var(--muted); padding: 40px; border: 2px dashed var(--line); border-radius: var(--r); }
.players { display: flex; flex-wrap: wrap; gap: 10px; }
.pl { width: 82px; text-align: center; font-size: 12.5px; position: relative; }
.pl img, .pl .ph { width: 70px; height: 70px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--panel2); display: grid; place-items: center; margin: 0 auto 4px; font-size: 26px; }
.pl input { width: 100%; padding: 2px 4px; font-size: 12px; text-align: center; }
.pl .x { position: absolute; top: -4px; left: 2px; width: 20px; height: 20px; padding: 0; border-radius: 50%; font-size: 11px; }
.host { display: flex; gap: 12px; align-items: center; }
.host img, .host .ph { width: 90px; height: 110px; object-fit: contain; background: repeating-conic-gradient(#222 0 25%, #2b2b2b 0 50%) 50%/16px 16px; border-radius: 12px; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: grid; place-items: center; z-index: 50; }
.modal .box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; max-width: 92vw; max-height: 92vh; overflow: auto; }
.cropper { position: relative; display: inline-block; cursor: crosshair; }
.cropper img { max-width: 80vw; max-height: 65vh; display: block; }
.cropper .sq { position: absolute; border: 2px solid var(--accent2); border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2000px rgba(0,0,0,.35); }
.cropper .face { position: absolute; border: 2px solid var(--gold); border-radius: 8px; cursor: pointer; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--panel2); border: 1px solid var(--line); padding: 10px 18px; border-radius: 12px; z-index: 60; animation: pop .2s; }
.toast.err { border-color: var(--bad); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid2 label { display: flex; flex-direction: column; gap: 4px; }
.grid2 input { width: 100%; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.check input { width: 18px; height: 18px; }
.offline::before { content: "אין חיבור לשרת – מנסה להתחבר מחדש..."; position: fixed; top: 0; inset-inline: 0; background: var(--bad); color: #fff; text-align: center; padding: 4px; z-index: 100; font-size: 13px; }

/* ---------- media library ---------- */
.modal.lib .box { width: min(1200px, 94vw); height: 86vh; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.libhead { display: flex; align-items: center; gap: 8px; }
.libhead h3 { margin: 0; } .libhead small { font-weight: 400; opacity: .7; font-size: 14px; }
.libbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.libbar input { flex: 1; min-width: 160px; }
.libbody { flex: 1; display: grid; grid-template-columns: 1fr 260px; gap: 12px; min-height: 0; }
.libgrid { overflow: auto; display: grid; grid-auto-rows: max-content; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; align-content: start; padding: 2px; }
.libgrid .empty { grid-column: 1 / -1; }
.libgrid .it { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #000; cursor: pointer; border: 3px solid transparent; transition: transform .15s, border-color .15s; }
.libgrid .it:hover { transform: translateY(-3px) scale(1.02); border-color: #7c5cff; }
.libgrid .it.sel { border-color: #22c55e; }
.libgrid .it img, .libgrid .it video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.libgrid .it .nm { position: absolute; inset: auto 0 0 0; padding: 4px 6px; font-size: 11px; background: linear-gradient(transparent, rgba(0,0,0,.85)); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.libgrid .it .kind { position: absolute; top: 6px; right: 6px; font-size: 18px; }
.libgrid .it .del { position: absolute; top: 4px; left: 4px; padding: 3px 7px; font-size: 15px; opacity: .8; background: rgba(0,0,0,.6); border-radius: 8px; z-index: 2; }
.libgrid .it:hover .del { opacity: 1; }
.libgrid .it .del:hover { background: #d63a4a; }
.libgrid .it .chk { position: absolute; top: 6px; left: 6px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: rgba(0,0,0,.5); border: 2px solid #fff; color: transparent; font-weight: 900; }
.libgrid .it.sel .chk { background: #22c55e; color: #fff; }
.libside { display: flex; flex-direction: column; gap: 10px; overflow: auto; }
.libside .drop { padding: 22px 10px; }
.qrup { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 10px; border-radius: 12px; background: rgba(127,127,127,.08); }
.qrup img { width: 170px; height: 170px; background: #fff; border-radius: 8px; padding: 4px; }
.uprow { position: relative; font-size: 12px; padding: 6px 8px; border-radius: 8px; background: rgba(127,127,127,.12); overflow: hidden; }
.uprow i { position: absolute; inset: auto auto 0 0; height: 3px; width: 0; background: #22c55e; transition: width .2s; }
.uprow.err { color: #ef4444; }
.libfoot { display: flex; align-items: center; gap: 10px; }
.ai-tools .nk { font-size: 11px; padding: 1px 6px; border-radius: 99px; background: #22c55e; color: #fff; }
@media (max-width: 800px) { .libbody { grid-template-columns: 1fr; } .libside { order: -1; } .qrup { display: none; } }

.vsound { width: 100%; font-weight: 700; }
.vsound.on { background: #16a34a; border-color: #16a34a; color: #fff; }
.vsound.off { background: #475569; border-color: #475569; color: #fff; }

/* judge picker */
.hostpick { width: min(1100px, 94vw); display: flex; flex-direction: column; gap: 10px; }
.cropper.rect { cursor: crosshair; touch-action: none; user-select: none; }
.cropper.rect .sel { position: absolute; border: 3px solid #22c55e; border-radius: 6px; box-shadow: 0 0 0 4000px rgba(0,0,0,.5); pointer-events: none; }
.cropper.rect .face { z-index: 2; }

/* picture answers in the editor */
.card .ans { position: relative; }
.card .ans .aimgb { padding: 2px 6px; font-size: 13px; opacity: .55; }
.card .ans:hover .aimgb { opacity: 1; }
.card .ans .aimg { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; cursor: pointer; border: 2px solid var(--accent2); }
.card .ans .aimgx { padding: 0 5px; font-size: 11px; }

/* ---------- media editor ---------- */
.libgrid .it .edit { position: absolute; bottom: 24px; left: 4px; padding: 2px 6px; font-size: 13px; opacity: 0; }
.libgrid .it:hover .edit { opacity: 1; }
.modal.ed { z-index: 60; }
.edbox { width: 96vw; height: 92vh; max-width: none; display: flex; flex-direction: column; gap: 10px; padding: 14px; overflow: hidden; }
.edtop { display: flex; align-items: center; gap: 8px; } .edtop h3 { margin: 0; }
.edmain { flex: 1; display: grid; grid-template-columns: 1fr 330px; gap: 12px; min-height: 0; }
.edstage { position: relative; display: grid; place-items: center; min-height: 0; border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(#1c1f30 0 25%, #23273b 0 50%) 50%/24px 24px; }
.edstage canvas { max-width: 100%; max-height: 100%; cursor: grab; touch-action: none; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.cropbox { position: absolute; border: 2px dashed #22c55e; box-shadow: 0 0 0 4000px rgba(0,0,0,.45); pointer-events: none; }
.edtools { overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-inline-end: 4px; }
.edtools section { background: rgba(127,127,127,.08); border-radius: 10px; padding: 8px 10px; }
.edtools h4 { margin: 0 0 6px; font-size: 14px; }
.edtools .row { flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.edtools .chips button.on, .edtools button.on { background: var(--accent); border-color: var(--accent); }
.edtools .sl { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); margin: 4px 0; }
.edtools .emo { padding: 2px 6px; font-size: 18px; }
.vstage { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; }
.vwrap { position: relative; touch-action: none; user-select: none; }
.vwrap video { width: 100%; height: 100%; display: block; background: #000; }
.vtexts .vt { position: absolute; transform: translate(-50%, -50%); font-weight: 900; white-space: nowrap; cursor: grab; text-shadow: 0 0 4px #000, 0 2px 6px #000; }
.vtexts .vt.sel { outline: 2px dashed #22c55e; outline-offset: 4px; }
.vbar { display: flex; align-items: center; gap: 8px; width: 90%; }
@media (max-width: 900px) { .edmain { grid-template-columns: 1fr; grid-template-rows: 1fr auto; } .edtools { max-height: 40vh; } }

/* groups */
.teamsed { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.teamsed .tm { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 10px; border: 2px solid var(--tc); }
.teamsed .tm input { flex: 1; }
.teamsed .dot { width: 22px; height: 22px; border-radius: 50%; padding: 0; border: 2px solid #fff; }
.pl select { width: 100%; font-size: 12px; margin-top: 2px; }
.card.survey { border-color: #7c5cff; box-shadow: 0 0 0 1px #7c5cff inset; }
.toggle.s.on { background: #7c5cff; border-color: #7c5cff; color: #fff; }

.audioed { display: flex; flex-direction: column; gap: 6px; }
.aslot { display: flex; align-items: center; gap: 6px; }
.aslot .al { flex: 1; font-size: 13px; }
.aslot select { max-width: 170px; }
.bged { display: flex; flex-direction: column; gap: 6px; }
.bged img, .bged video { width: 100%; max-height: 120px; object-fit: cover; border-radius: 10px; }
.libgrid .it .aud { width: 100%; height: 100%; display: grid; place-items: center; font-size: 48px; background: linear-gradient(135deg, #7c5cff, #00bbf9); }
.sl { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); }

.facesbox { width: min(1000px, 94vw); }
.afgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; max-height: 60vh; overflow: auto; margin: 10px 0; }
.af { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; position: relative; }
.af:has(input:checked) { border-color: #22c55e; }
.af img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; }
.af input[type=checkbox] { position: absolute; top: 6px; right: 6px; }
.af .afn { width: 100%; font-size: 12px; text-align: center; }
.af:not(:has(input:checked)) img { filter: grayscale(1) opacity(.4); }

/* slide preview */
.prevbtn { width: 100%; margin-bottom: 6px; background: linear-gradient(135deg, #1e3a8a, #6d28d9); border: 0; font-weight: 700; }
.modal.pv .box { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; max-width: 96vw; }
.pvbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pvbar .spacer { flex: 1; }
.pvlabel { color: var(--muted); font-size: 13px; max-width: 40vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pvstage { border-radius: 12px; overflow: hidden; background: #000; box-shadow: 0 10px 40px rgba(0,0,0,.6); align-self: center; }
.pvstage iframe { width: 100%; height: 100%; border: 0; display: block; }
.pvdots { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.pvdots button { padding: 3px 8px; font-size: 12px; border-radius: 8px; min-width: 30px; }
.pvdots button.on { background: var(--accent); border-color: var(--accent); }
/* opening slide editor */
.wed { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.wed.off { opacity: .45; }
.wed label, label.stack { display: flex; flex-direction: column; gap: 4px; }
.wed textarea { resize: vertical; }
.wthumb { height: 54px; border-radius: 8px; }

/* narration */
.sayed { margin-top: 10px; padding: 10px; border-radius: 10px; background: rgba(124,92,255,.08); border: 1px dashed rgba(124,92,255,.5); display: flex; flex-direction: column; gap: 6px; }
.sayrow { display: grid; grid-template-columns: 46px 1fr auto; gap: 6px; align-items: center; }
.sayrow .sl2 { color: var(--muted); font-size: 12px; }
.ai-tools button.on { background: var(--accent); }
.lexed { display: flex; flex-direction: column; gap: 6px; }
.lexrow { display: grid; grid-template-columns: 1fr auto 1fr auto auto; gap: 4px; align-items: center; }
.lexrow input { min-width: 0; padding: 6px 8px; }
.vbtns { flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; align-items: center; }
.vbtns button.on { background: var(--accent); border-color: var(--accent); }
.btcfg { padding-inline-start: 1.5em; font-size: .9em; } .btcfg input { width: 4.5em; }
/* a question that was just added (at the top of the list) flashes briefly */
.justAdded { animation: justAdded 1.6s ease-out; }
@keyframes justAdded { 0%, 30% { box-shadow: 0 0 0 3px var(--accent), 0 0 24px var(--accent); } 100% { box-shadow: none; } }
/* answers: ✕ removes one (2–4 per question), ＋ adds one back */
.card .ans .ansx { padding: 0 6px; font-size: 12px; opacity: .45; background: transparent; border: 1px solid var(--line); }
.card .ans:hover .ansx { opacity: 1; }
.card .ans .ansx:hover { background: #b4232f; border-color: #b4232f; color: #fff; }
.card .ansadd { border: 1px dashed var(--line); background: transparent; border-radius: 10px; padding: 6px 8px; opacity: .7; }
.card .ansadd:hover { opacity: 1; border-color: var(--accent); }

/* ⚔️ duel question toggle on a question card */
.duelchk { display: inline-flex; align-items: center; gap: 4px; padding: 2px 10px; border-radius: 99px; border: 1px solid rgba(255, 120, 80, .45); cursor: pointer; white-space: nowrap; }
.duelchk.on { background: linear-gradient(90deg, #ff4d4d, #ff9a3c); color: #fff; border-color: transparent; font-weight: 700; }
.duelchk input { margin: 0; }

/* question list order buttons */
#listView, #playOrder, #reverseQ { white-space: nowrap; }
#playOrder.on { background: linear-gradient(90deg, #7c5cff, #2fb8e8); color: #fff; border-color: transparent; }

/* slides in the question list */
.kindsel { font-weight: 700; }
.card.slidecard { border-style: dashed; }
.card.slidecard.textslide { background: linear-gradient(180deg, rgba(124, 92, 255, .14), transparent 70%), var(--panel, #161a33); border-color: rgba(124, 92, 255, .6); }
.card.slidecard.transition { background: linear-gradient(180deg, rgba(242, 195, 91, .14), transparent 70%), var(--panel, #161a33); border-color: rgba(242, 195, 91, .6); }
.card.slidecard .num { font-size: 22px; }
.card.slidecard .hint { margin-inline-start: 10px; }
.card.slidecard .qtext { min-height: 1.6em; font-size: 20px; margin: 10px 0; }
.card.slidecard .qtext:empty::before { content: attr(data-ph); opacity: .45; }
.slidetext { width: 100%; font: inherit; font-size: 16px; padding: 10px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(0, 0, 0, .25); color: inherit; resize: vertical; }

/* the card's kind: question / opening or text slide / transition slide */
.kindbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.kindbar .kb { padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .04); color: inherit; opacity: .7; cursor: pointer; }
.kindbar .kb:hover { opacity: 1; }
.kindbar .kb.on { opacity: 1; color: #fff; border-color: transparent; }
.kindbar .kb[data-kind="question"].on { background: linear-gradient(90deg, #3d7bff, #2fb8e8); }
.kindbar .kb[data-kind="text"].on { background: linear-gradient(90deg, #7c5cff, #b05cff); }
.kindbar .kb[data-kind="transition"].on { background: linear-gradient(90deg, #f2a33c, #f2c35b); color: #2a1c00; }

/* the screens run a different game than the one being edited */
#liveBanner { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 14px; padding: 12px 16px; border-radius: 12px;
  background: linear-gradient(90deg, #7a2a00, #b34700); color: #fff; font-weight: 600; box-shadow: 0 6px 18px rgba(0, 0, 0, .4); }
#liveBanner b { color: #ffe39a; }
#liveBanner button { margin-inline-start: auto; }

/* the sounds sit closed behind one line – open it to change them */
details.fold { margin: 10px 0; border: 1px solid var(--line, #ffffff22); border-radius: 12px; padding: 0 12px; background: #ffffff08; }
details.fold > summary { cursor: pointer; padding: 12px 0; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "▾"; margin-inline-start: auto; transition: transform .2s; }
details.fold[open] > summary::after { transform: rotate(180deg); }
details.fold > summary small { font-weight: 400; opacity: .65; }
details.fold[open] { padding-bottom: 12px; }
/* what the narrator reads: two neat columns, each label on its own line */
.sayopts { display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px 14px; align-items: start; }
.sayopts .check { align-items: flex-start; line-height: 1.3; }
.sayopts .check input { flex: none; margin-top: 1px; }
.libgrid .it .gm { position: absolute; bottom: 24px; right: 6px; max-width: 75%; padding: 2px 7px; border-radius: 99px; font-size: 11px; background: rgba(0,0,0,.7); color: #fcd34d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#libScope { margin-inline-end: 8px; }
.toggle.t.on { background: linear-gradient(135deg, #ffcc4d, #ff7a00); border-color: #ff9a1f; color: #1a1030; }
.toggle.t2.on { background: linear-gradient(135deg, #ff5e7a, #b3125b); border-color: #ff5e7a; color: #fff; }

/* trivia library */
.triv { border-color: #f2b41655; background: linear-gradient(180deg, rgba(242,180,22,.08), transparent 60%), var(--panel); }
.tcats { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.tcat { flex: 1 1 45%; padding: 8px 6px; border-radius: 10px; font-weight: 700; }
.tcat b { background: #0b0e1a; border-radius: 99px; padding: 0 7px; margin-inline-start: 4px; font-size: 12px; }
.tcat.on { background: linear-gradient(135deg, #f2b416, #d48806); color: #1a1200; border-color: #f2b416; }
.tcat.on b { background: rgba(0,0,0,.25); color: #fff; }
.modal.tlib .box { width: min(1100px, 94vw); height: 88vh; display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.tlist { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 6px; }
.trow { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: 12px; background: #0f1326; border: 1px solid var(--line); }
.trow.sel { border-color: #f2b416; }
.trow input[type=checkbox] { margin-top: 4px; width: 18px; height: 18px; }
.trow .tc { white-space: nowrap; font-size: 13px; padding: 2px 8px; border-radius: 99px; background: var(--panel2); }
.trow .tt { flex: 1; } .trow .tt b { display: block; margin-bottom: 4px; }
.trow .ta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--muted); }
.trow .ta .ok { color: #22c55e; font-weight: 700; }
.tform { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px; border-radius: 12px; background: #0f1326; border: 1px solid #f2b41677; }
.tform .full { grid-column: 1 / -1; } .tform textarea { width: 100%; min-height: 56px; } .tform input[type=text] { width: 100%; }
.tform .okin { border-color: #22c55e; }
.pl .pphone { width: 100%; font-size: 13px; margin-top: 4px; }
#licBtn.trial { border-color: #f2b416; color: #f2b416; }
.licbox { width: min(560px, 92vw); text-align: center; display: flex; flex-direction: column; gap: 12px; }
.licbox .mcode { font-size: 30px; font-weight: 900; letter-spacing: 3px; direction: ltr; color: var(--gold, #f2b416); }
.licbox textarea { width: 100%; min-height: 80px; direction: ltr; font-size: 12px; }
/* the account strip in the header */
.acct { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 12px; border-radius: 99px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; }
.acct .who { font-weight: 700; }
.acct .plan { color: var(--muted); }
.acct .plan .bad { color: var(--bad); }
.acct button.sm { padding: 4px 10px; font-size: 12px; }
#start.locked, #newGame.locked { background: var(--panel2); border: 1px dashed var(--gold); color: var(--gold); }
/* the plan is about to end / ended */
#planWarn { margin: 0 0 12px; padding: 12px 16px; border-radius: 12px; background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.5); color: #ffd58a; line-height: 1.6; }
#planWarn.bad { background: rgba(239,68,68,.14); border-color: rgba(239,68,68,.5); color: #ffb0b0; }

/* "✅ משחק מוכן" – the finished game is locked */
#readyBtn { font-weight: 700; }
#readyBtn.on { background: rgba(34,197,94,.16); border-color: rgba(34,197,94,.55); color: #8ff0b4; }
#readyBtn.bad { background: rgba(239,68,68,.16); border-color: rgba(239,68,68,.6); color: #ffb0b0; }

/* the logo badge next to the name (studio, control panel, admin) */
.logo .mark { width: 1.45em; height: 1.45em; vertical-align: -0.38em; margin-inline-end: 7px; filter: drop-shadow(0 0 6px rgba(255,190,40,.35)); }

/* logout: clearly visible next to the account name */
#logoutBtn { background: rgba(255, 77, 94, .16); border: 1.5px solid #ff5d6c; color: #ffd0d5; font-weight: 800; padding: 4px 12px; border-radius: 8px; box-shadow: 0 0 10px rgba(255, 77, 94, .25); }
#logoutBtn:hover { background: #ff4d5e; color: #fff; }
#upgradeBtn { background: linear-gradient(180deg, #ffd54a, #f0a500); color: #2a1a00; border: 0; font-weight: 800; padding: 4px 12px; border-radius: 8px; }
#upgradeBtn:hover { filter: brightness(1.1); }
