.g-wrap.wide { width: min(1180px, 100%); }
.online-tag { background: rgb(34 197 94 / .12); border-color: rgb(34 197 94 / .35); color: var(--ok); }
.small { font-size: .82rem; }
.mute { color: var(--text-mute); }
.num { font-family: var(--font-en); font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; padding: .1rem .55rem; border-radius: 99px; font-size: .78rem; font-weight: 800; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--text-dim); }
.net-banner { position: fixed; top: 0; inset-inline: 0; z-index: 90; display: flex; align-items: center; justify-content: center; gap: .5rem; padding: .55rem; background: var(--danger); color: #fff; font-weight: 800; }
.net-banner svg { width: 18px; height: 18px; }
.room-bar { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .3rem .25rem .8rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--line-soft); }
html[dir='rtl'] .room-bar { padding: .25rem .8rem .25rem .3rem; }
.room-bar b { color: var(--primary-ink); letter-spacing: .1em; }
.room-bar .g-icon-btn { width: 34px; height: 34px; }

/* Entry */
.entry { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.4rem; align-items: center; flex: 1; }
@media (max-width: 860px) { .entry { grid-template-columns: 1fr; } }
.entry-art { border-radius: calc(var(--radius) + 8px); overflow: hidden; border: 1px solid var(--line); box-shadow: var(--shadow); aspect-ratio: 16 / 11; }
.entry-art svg { width: 100%; height: 100%; display: block; }
.entry-panel h2 { font-size: 1.3rem; line-height: 1.5; }
.rules { color: var(--text-dim); font-size: .92rem; line-height: 1.8; margin-bottom: .6rem; }
.rules ul { margin: .4rem 0; padding-inline-start: 1.2rem; }
.join-box { margin-top: 1rem; border-top: 1px solid var(--line-soft); padding-top: 1rem; }
.join-box summary { cursor: pointer; font-weight: 800; color: var(--primary-ink); list-style: none; text-align: center; }
.join-box summary::-webkit-details-marker { display: none; }
.join-box .add-row { margin-top: .8rem; }
#eCode { text-align: center; letter-spacing: .3em; font-size: 1.2rem; font-weight: 800; }

/* Lobby */
.lobby { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; align-items: start; }
@media (max-width: 900px) { .lobby { grid-template-columns: 1fr; } }
.lobby-main { display: flex; flex-direction: column; gap: 1rem; }
.lobby-main .panel + .panel { margin-top: 0; }
.code-panel { text-align: center; }
.code { font-size: clamp(2.4rem, 8vw, 3.6rem); font-weight: 900; letter-spacing: .25em; color: var(--primary-ink); margin: .2rem 0 .6rem; direction: ltr; }
.row-btns { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; }
.row-btns .btn svg, .host-tools .btn svg { width: 16px; height: 16px; }
.row-h { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: .8rem; }
.row-h h2 { margin: 0; display: flex; align-items: center; gap: .5rem; }
.need { font-size: .85rem; font-weight: 700; color: var(--warn); }
.need.ok { color: var(--ok); }
.plist { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; }
.pl { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line-soft); min-width: 0; animation: pop .3s var(--ease); }
.pl.is-me { border-color: var(--primary); }
.pl.is-off { opacity: .55; }
.pl .av { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-weight: 900; background: var(--primary); color: var(--on-primary); flex: none; }
.pl .av svg { width: 18px; height: 18px; }
.pl .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.pl .nm small { color: var(--text-mute); font-weight: 600; }
.pt { display: inline-grid; place-items: center; color: var(--text-mute); font-size: .7rem; font-weight: 800; }
.pt svg { width: 15px; height: 15px; }
.pt.host { color: var(--primary-ink); }
.pt.role { padding: .1rem .45rem; border-radius: 99px; background: var(--tint); color: var(--primary-ink); border: 1px solid var(--line); }
.pt.off { color: var(--danger); }
.kick { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; color: var(--text-mute); flex: none; }
.kick:hover { color: var(--danger); background: rgb(239 68 68 / .1); }
.kick svg { width: 14px; height: 14px; }
.host-tools { display: flex; gap: .5rem; margin-top: 1rem; flex-wrap: wrap; }
.teams { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 600px) { .teams { grid-template-columns: 1fr; } }
.team { border-radius: var(--radius-sm); border: 2px solid var(--line-soft); padding: .7rem; background: var(--bg-2); display: flex; flex-direction: column; gap: .5rem; }
.team-h { display: flex; justify-content: space-between; align-items: center; font-weight: 900; }
.team-h span { font-family: var(--font-en); color: var(--text-mute); }
.team-list { display: flex; flex-direction: column; gap: .4rem; min-height: 44px; }
.team-acts { display: flex; gap: .4rem; flex-wrap: wrap; }
.team.t-red { border-color: rgb(239 68 68 / .45); }
.team.t-red .team-h b { color: #ef4444; }
.team.t-yellow { border-color: rgb(234 179 8 / .5); }
.team.t-yellow .team-h b { color: #ca8a04; }
.team.t-blue { border-color: rgb(59 130 246 / .5); }
.team.t-blue .team-h b { color: #3b82f6; }
.av.t-red { background: #ef4444 !important; color: #fff !important; }
.av.t-yellow { background: #eab308 !important; color: #1d1600 !important; }
.av.t-blue { background: #3b82f6 !important; color: #fff !important; }
#lSettings h3 { margin: 0 0 .8rem; font-size: 1rem; }
#lSettings h3 small { color: var(--text-mute); font-weight: 600; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .5rem 0; border-bottom: 1px solid var(--line-soft); font-weight: 700; font-size: .92rem; }
.set-row:last-child { border: 0; }
.set-row .input { max-width: 190px; height: 40px; }
.sw { appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.sw::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: inset-inline-start .25s var(--ease); }
.sw:checked { background: var(--primary); }
.sw:checked::after { inset-inline-start: 21px; }
.sw:disabled { opacity: .6; cursor: default; }

/* Chat */
.lobby-chat { position: sticky; top: 1rem; }
.lobby-chat h2 { margin: 0 0 .7rem; font-size: 1rem; }
.chat { display: flex; flex-direction: column; gap: .5rem; }
.chat-list { height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: .35rem; padding: .3rem; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line-soft); }
.msg { padding: .4rem .65rem; border-radius: 12px; background: var(--surface-2); font-size: .9rem; line-height: 1.6; max-width: 92%; align-self: flex-start; overflow-wrap: anywhere; }
.msg b { display: block; font-size: .74rem; color: var(--primary-ink); }
.msg.mine { align-self: flex-end; background: var(--tint); border: 1px solid var(--line); }
.msg.sys { align-self: center; background: none; color: var(--text-mute); font-size: .8rem; text-align: center; padding: .2rem; }
.chat form { display: flex; gap: .4rem; }
.chat form .input { height: 42px; }
.chat form .btn { height: 42px; padding: 0 .8rem; }
.chat form .btn svg { width: 18px; height: 18px; }
.chat-note { margin: 0; font-size: .82rem; text-align: center; }

/* In-game shared */
.rt-timer { display: inline-flex; align-items: center; justify-content: center; min-width: 58px; height: 38px; padding: 0 .7rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-en); font-weight: 900; font-size: 1.1rem; color: var(--primary-ink); }
.rt-timer.is-low { color: var(--danger); border-color: rgb(239 68 68 / .5); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1rem; align-items: start; }
@media (max-width: 960px) { .game-layout { grid-template-columns: minmax(0, 1fr); } }
.phase-bar { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; flex-wrap: wrap; }
.phase-bar h2 { margin: 0; font-size: 1.3rem; }
.phase-bar .grow { flex: 1; }
.stage-card { border-radius: calc(var(--radius) + 6px); border: 1px solid var(--line); background: radial-gradient(ellipse at 50% 0%, rgb(var(--primary-rgb) / .12), transparent 70%), var(--surface); box-shadow: var(--shadow); padding: clamp(1.1rem, 3vw, 1.8rem); }
.side-col { display: flex; flex-direction: column; gap: 1rem; }
.side-col .panel + .panel { margin-top: 0; }
.side-col h3 { margin: 0 0 .7rem; font-size: 1rem; }
.targets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-top: 1rem; }
.target { display: flex; align-items: center; gap: .5rem; padding: .65rem .7rem; border-radius: 14px; background: var(--surface-2); border: 2px solid var(--line-soft); font-weight: 800; text-align: start; transition: border-color .2s, transform .2s, background .2s; }
.target:hover:not(:disabled) { border-color: var(--primary); transform: translateY(-2px); }
.target.is-on { border-color: var(--primary); background: var(--tint); }
.target:disabled { opacity: .45; cursor: default; }
.target .av { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); font-weight: 900; flex: none; }
.target .meta { margin-inline-start: auto; font-family: var(--font-en); color: var(--primary-ink); }
.notice-box { padding: .9rem 1rem; border-radius: 14px; background: var(--tint); border: 1px solid var(--line); font-weight: 700; line-height: 1.7; }
.notice-box.bad { background: rgb(239 68 68 / .1); border-color: rgb(239 68 68 / .35); }
.notice-box.good { background: rgb(34 197 94 / .1); border-color: rgb(34 197 94 / .35); }
.end-acts { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1.2rem; }

/* Score board (shared by the newer games) */
.sboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
.sboard li { display: flex; align-items: center; gap: .5rem; padding: .4rem .55rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-soft); transition: border-color .2s, opacity .2s; }
.sboard li.is-me { border-color: var(--primary); }
.sboard li.is-cur { background: var(--tint); border-color: var(--primary); box-shadow: 0 0 0 3px rgb(var(--primary-rgb) / .15); }
.sboard li.is-dim { opacity: .45; }
.sboard .rk { width: 1.3rem; text-align: center; color: var(--text-mute); font-weight: 800; font-size: .85rem; }
.sboard .av { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-3); font-weight: 900; font-size: .85rem; flex: none; }
.sboard .av svg { width: 16px; height: 16px; }
.sboard .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; font-size: .92rem; }
.sboard .nm small { color: var(--text-mute); font-weight: 600; }
.sboard .nm em { font-style: normal; font-size: .75rem; color: var(--primary-ink); }
.sboard b { color: var(--primary-ink); font-size: 1.05rem; }
.sboard .gain { font-size: .8rem; font-weight: 900; color: var(--ok); animation: pop .4s var(--ease); }
.end-banner { text-align: center; padding: .6rem 0; }
.end-banner h3 { font-size: clamp(1.4rem, 4vw, 2rem); margin: 0 0 .3rem; }
.big-q { font-size: clamp(1.25rem, 3.4vw, 1.8rem); font-weight: 900; line-height: 1.6; text-align: center; margin: .4rem 0 1.2rem; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: .8rem; text-align: center; }
.answered-row { display: flex; flex-wrap: wrap; gap: .35rem; justify-content: center; margin-top: 1rem; }
.answered-row span { padding: .2rem .6rem; border-radius: 99px; font-size: .8rem; font-weight: 700; background: var(--surface-2); border: 1px solid var(--line-soft); color: var(--text-mute); }
.answered-row span.on { background: rgb(34 197 94 / .12); border-color: rgb(34 197 94 / .4); color: var(--ok); }
.inline-form { display: flex; gap: .5rem; justify-content: center; flex-wrap: wrap; width: 100%; }
.inline-form .input { max-width: 320px; height: 52px; font-size: 1.15rem; font-weight: 800; text-align: center; }
.inline-form .btn { height: 52px; }
#gStep:empty { display: none; }
@media (max-width: 520px) {
  .g-head { gap: .45rem; }
  .g-head h1 { font-size: 1.15rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .online-tag, .room-bar .mute { display: none; }
  .room-bar { gap: .25rem; }
  .g-head .g-icon-btn { width: 38px; height: 38px; flex: none; }
}

/* ===== Presenter + host controls ===== */
.present-panel .present-row { align-items: center; gap: 1rem; }
.present-row span { display: flex; flex-direction: column; gap: .25rem; }
.present-row b { display: inline-flex; align-items: center; gap: .4rem; }
.present-row b svg, .present-note svg { width: 18px; height: 18px; color: var(--primary); }
.present-row small { color: var(--text-mute); font-weight: 600; line-height: 1.6; }
.present-note { margin: 0; display: flex; align-items: center; gap: .45rem; font-weight: 700; }
.host-bar { position: fixed; z-index: 70; bottom: 14px; left: 14px; display: flex; align-items: center; gap: .35rem; padding: .35rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 16px 40px -12px rgb(0 0 0 / .55); max-width: calc(100vw - 20px); }
.host-bar .hb-tag { font-size: .72rem; font-weight: 900; color: var(--on-primary); background: var(--primary); padding: .25rem .6rem; border-radius: 10px; margin-inline: .2rem; white-space: nowrap; }
.host-bar .hb-btn { display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 .85rem; border-radius: 12px; font-weight: 800; font-size: .86rem; color: var(--text); background: var(--surface-2); border: 1px solid var(--line-soft); white-space: nowrap; transition: background .2s, border-color .2s; }
.host-bar .hb-btn svg { width: 16px; height: 16px; flex: none; }
.host-bar .hb-btn:hover:not(:disabled) { border-color: var(--primary); }
.host-bar .hb-btn:disabled { opacity: .4; cursor: not-allowed; }
.host-bar .hb-btn.is-on { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
body.has-hostbar .g-wrap { padding-bottom: 80px; }
@media (max-width: 560px) { .host-bar .hb-btn span { display: none; } .host-bar .hb-btn { width: 44px; justify-content: center; padding: 0; } }
.paused-banner { display: flex; align-items: center; justify-content: center; gap: .5rem; margin-bottom: 1rem; padding: .75rem 1rem; border-radius: 14px; background: rgb(var(--primary-rgb) / .14); border: 1px solid rgb(var(--primary-rgb) / .45); color: var(--primary-ink); font-weight: 800; animation: pop .35s var(--ease); }
.paused-banner svg { width: 18px; height: 18px; }
body.is-presenter .stage-card { font-size: 1.04rem; }

/* the host bar sits in the corner so it never covers the hand or the move buttons */
.host-bar .hb-btn span { display: none; }
.host-bar .hb-btn { min-width: 44px; justify-content: center; }
.host-bar:hover .hb-btn span, .host-bar:focus-within .hb-btn span { display: inline; }
@media (max-width: 640px) { .host-bar:hover .hb-btn span { display: none; } }
