body { min-height: 100vh; display: flex; flex-direction: column; }

.host-top { display: flex; align-items: center; gap: 16px; padding: 18px 20px 12px; flex-wrap: wrap; }
.host-top h1 { font-size: 20px; letter-spacing: -0.02em; }
.rounds { display: flex; gap: 6px; flex-wrap: wrap; }
.rounds .btn.current { border-color: var(--brand); color: var(--brand); }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.host-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; padding: 0 20px 16px; min-height: 0; }
@media (max-width: 1000px) { .host-main { grid-template-columns: 1fr; } }

/* ---- Grid ---- */
.host-grid { display: grid; gap: 6px; }
.host-grid .theme { display: flex; align-items: center; padding: 8px 10px; font-weight: 800; font-size: 13px; background: var(--surface); border: 1px solid var(--surface-border); border-left: 3px solid var(--brand); border-radius: 6px; line-height: 1.15; }
.host-grid .cell {
  position: relative; height: 52px; border-radius: 6px;
  border: 1px solid rgba(61, 232, 202, .35); background: rgba(61, 232, 202, .06);
  color: var(--brand); font: 800 17px var(--font); cursor: pointer;
  transition: background .12s, color .12s;
}
.host-grid .cell:hover:not(:disabled) { background: var(--brand); color: var(--bg); }
.host-grid .cell:disabled { cursor: default; }
.host-grid .cell.played { color: var(--fg-5); background: transparent; border-color: var(--surface-border); text-decoration: line-through; }
.host-grid .cell.current { outline: 2px solid var(--accent-cyan); outline-offset: 1px; }
.host-grid .cell .tag { position: absolute; top: 3px; right: 4px; width: 14px; height: 14px; }
.host-grid .cell .tag.cat { color: var(--accent-violet); }
.host-grid .cell .tag.auction { color: var(--accent-cyan); }
.host-grid.locked .cell:not(.played) { opacity: .55; }
.grid-hint { margin-top: 12px; color: var(--fg-3); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.grid-hint .icon { width: 14px; height: 14px; }

/* ---- Question panel ---- */
.qpanel { display: flex; flex-direction: column; gap: 14px; min-height: 360px; }
.qpanel .empty { margin: auto; text-align: center; color: var(--fg-3); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.qpanel .empty h2 { font-size: 22px; color: var(--fg); }
.q-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.q-meta .theme { font-weight: 800; font-size: 14px; }
.q-meta .val { margin-left: auto; font-size: 22px; font-weight: 800; color: var(--brand); }
.q-text { font-size: 17px; font-weight: 700; line-height: 1.35; }
.qpanel pre.code { font-size: 13px; line-height: 1.45; max-height: 260px; }
.q-answer { border: 1px dashed rgba(61, 232, 202, .5); border-radius: 8px; padding: 10px 12px; background: rgba(61, 232, 202, .05); }
.q-answer .label { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--brand); margin-bottom: 4px; }
.q-answer .text { font-size: 15px; font-weight: 700; }
.q-answer pre.code { margin-top: 8px; }
.q-answer.revealed .label::after { content: ' · показан на табло'; color: var(--fg-3); }

.phase-line { display: flex; align-items: center; gap: 12px; }
.phase-line .timer-num { font: 700 28px var(--mono); color: var(--accent-cyan); min-width: 56px; }
.phase-line .timer-num.warn { color: var(--accent-purple); }
.phase-line .phase-name { color: var(--fg-3); font-weight: 700; }

.controls { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.main-action { display: flex; gap: 10px; flex-wrap: wrap; }
.main-action .btn.lg { flex: 1; }
.secondary-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.judge { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.judge .who { display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 8px; border: 1px solid var(--surface-border); background: var(--surface); }
.judge .who .nm { font-weight: 800; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.judge .who .nm small { color: var(--fg-3); font-weight: 500; }
.judge .who .row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.judge .who .btn { height: 44px; min-width: 0; padding: 0 8px; }
.judge .who.off { opacity: .4; }

.assign { display: flex; flex-direction: column; gap: 10px; }
.assign .players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.assign .players .btn.sel { background: var(--accent-cyan); border-color: var(--accent-cyan); color: var(--bg); }
.assign .bid { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.assign .bid input { width: 140px; font-size: 16px; font-weight: 800; }

/* ---- Players ---- */
.host-players { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding: 0 20px 20px; }
.hp { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--surface-border); }
.hp input.name { flex: 1; min-width: 0; font-weight: 800; background: transparent; border-color: transparent; }
.hp input.name:hover, .hp input.name:focus { border-color: var(--border); }
.hp input.score { width: 110px; text-align: right; font-size: 20px; font-weight: 800; color: var(--brand); background: transparent; border-color: transparent; }
.hp input.score:hover, .hp input.score:focus { border-color: var(--border); }
.hp input.score.neg { color: var(--accent-purple); }

dialog { background: var(--bg); color: var(--fg); border: 1px solid var(--border); border-radius: 10px; padding: 0; box-shadow: 0 16px 40px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(0,0,0,.6); }
.dlg { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 340px; }
.dlg h2 { font-size: 18px; }
.dlg p { margin: 0; color: var(--fg-3); }
.dlg label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 12px; color: var(--fg-2); }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; }
