/* ══════════════ Раскладка игры ══════════════ */
.game-layout {
    display: grid;
    grid-template-columns: 240px 1fr 280px;
    grid-template-rows: auto auto auto 1fr;
    gap: 12px;
    height: calc(100vh - 54px - 40px);
    min-height: 620px;
}
.status-bar   { grid-column: 1 / -1; }
.phase-banner { grid-column: 1 / -1; }
.duel-banner  { grid-column: 1 / -1; }

@media (max-width: 950px) {
    .game-layout { grid-template-columns: 1fr; height: auto; }
    .panel-left, .panel-right { max-height: 260px; }
}

/* ══════════════ Статус-бар ══════════════ */
.status-bar {
    background: linear-gradient(180deg, #23324a, #1a2436);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    padding: 10px 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    box-shadow: inset 0 1px 0 #ffffff10;
}
.turn-indicator { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .98rem; }
.turn-dot { width: 14px; height: 14px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 8px currentColor; }
.round-badge { font-size: .82rem; color: var(--c-muted); }
.conn-badge  { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--c-muted); }
.conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #64748b; transition: background .3s; }
.conn-dot.live { background: var(--c-green); box-shadow: 0 0 6px var(--c-green); }
.conn-dot.poll { background: var(--c-gold); box-shadow: 0 0 6px var(--c-gold); }
.spectator-badge {
    background: #7c3aed33; color: #c4b5fd;
    border: 1px solid #7c3aed66; border-radius: 999px;
    padding: 3px 12px; font-size: .78rem; font-weight: 700;
}
.my-turn-hint { display: none; color: var(--c-green); font-size: .88rem; font-weight: 600; }
.skip-btn { display: none; }

/* ══════════════ Баннер фазы (пункт 3) ══════════════ */
.phase-banner {
    border-radius: var(--radius);
    padding: 12px 20px;
    display: flex; align-items: center; gap: 16px;
    border: 1px solid var(--c-border);
    background: linear-gradient(135deg, #1e293b, #0f172a);
    position: relative; overflow: hidden;
}
.phase-banner::before {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(circle at 12% 50%, #ffffff10, transparent 60%);
    pointer-events: none;
}
.phase-banner.conquest { border-color: #3b82f688; background: linear-gradient(135deg, #172554, #1e293b); }
.phase-banner.war      { border-color: #dc262688; background: linear-gradient(135deg, #450a0a, #1e293b); }
.phase-icon  { font-size: 2rem; flex-shrink: 0; filter: drop-shadow(0 2px 4px #0008); }
.phase-title { font-size: 1.25rem; font-weight: 800; letter-spacing: .01em; margin-bottom: 2px;
               font-family: Georgia, 'Times New Roman', serif; }
.phase-hint  { font-size: .85rem; color: var(--c-muted); line-height: 1.35; }

/* ══════════════ Баннер дуэли/штурма — виден всем, включая зрителей ══════════════ */
.duel-banner {
    display: none;
    border-radius: var(--radius);
    padding: 10px 18px;
    border: 1px solid #7c3aed66;
    background: linear-gradient(135deg, #2a1a45, #1a1030);
    flex-direction: column; gap: 8px;
}
.duel-banner-row { display: flex; align-items: center; gap: 12px; font-weight: 700; flex-wrap: wrap; }
.duel-side { font-size: .92rem; color: var(--c-muted); }
.duel-side.answered { color: var(--c-green); }
.duel-vs { color: var(--c-gold); }
.duel-timer { margin-left: auto; font-weight: 800; color: var(--c-gold); }
.siege-progress { display: none; align-items: center; gap: 8px; font-size: .82rem; color: var(--c-muted); }
.siege-dots { display: flex; gap: 5px; }
.siege-dot { width: 13px; height: 13px; border-radius: 50%; background: #3a3a55; border: 1px solid #55557a; }
.siege-dot.filled { background: var(--c-gold); border-color: var(--c-gold); box-shadow: 0 0 6px #f59e0baa; }

/* ══════════════ Reveal — краткий результат раунда для всех ══════════════ */
.reveal-banner {
    position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-8px);
    background: linear-gradient(180deg, #202a3d, var(--c-surface2));
    border: 1px solid var(--c-border); border-radius: 12px;
    padding: 12px 22px; z-index: 550; box-shadow: 0 12px 40px #000a;
    font-size: .9rem; font-weight: 600; text-align: center; max-width: 90vw;
    opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.reveal-banner.show   { opacity: 1; transform: translateX(-50%) translateY(0); }
.reveal-banner.win    { border-color: var(--c-green); }
.reveal-banner.lose   { border-color: var(--c-red); }
.reveal-banner.replay { border-color: var(--c-gold); }

/* ══════════════ Боковые панели ══════════════ */
.panel-left, .panel-right {
    display: flex; flex-direction: column; gap: 10px;
    overflow-y: auto; min-height: 0;
}
.panel-heading { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em;
                 color: var(--c-muted); font-weight: 700; padding: 2px 2px 0; }

.player-card {
    background: linear-gradient(180deg, var(--c-surface), #171728);
    border: 2px solid var(--c-border);
    border-radius: var(--radius);
    padding: 10px 12px;
    transition: border-color .3s, transform .2s, opacity .3s;
    position: relative;
}
.player-card.active-turn { border-color: var(--c-gold); box-shadow: 0 0 14px #f59e0b44; transform: translateY(-1px); }
.player-card.is-me       { border-left-width: 5px; }
.player-card.eliminated  { opacity: .45; filter: grayscale(.6); }
.player-color-dot { width: 15px; height: 15px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 0 2px #ffffff22; }
.player-nickname  { font-weight: 700; font-size: .92rem; }
.player-score     { font-size: 1.35rem; font-weight: 800; color: var(--c-gold); line-height: 1.1; }
.player-sub       { font-size: .72rem; color: var(--c-muted); display: flex; gap: 10px; }
.crown-tag        { font-size: .9rem; }
.elim-tag { position: absolute; top: 8px; right: 10px; font-size: .68rem; color: var(--c-red);
            font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.player-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.player-card-body { display: flex; align-items: baseline; gap: 8px; }
.tag-sm { font-size: .68rem; }

/* ══════════════ Центр: карта ══════════════ */
.map-panel { display: flex; flex-direction: column; gap: 10px; overflow: hidden; min-height: 0; }
.map-container {
    flex: 1;
    border: 1px solid #2c3e5a;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
    /* «Вода» вокруг суши (пункт 9) */
    background:
        radial-gradient(circle at 30% 20%, #1e3a5f, transparent 55%),
        radial-gradient(circle at 75% 80%, #16324e, transparent 55%),
        linear-gradient(160deg, #0e2440, #0a1a30);
    box-shadow: inset 0 0 60px #00000066;
}
#game-map { width: 100%; height: 100%; display: block; }

.province {
    transition: opacity .2s, stroke-width .15s, filter .2s;
    stroke: #0b1220; stroke-width: 1.2;
    filter: drop-shadow(0 1px 1px #00000055);
}
.province.free  { fill: #6b7a63; }          /* незанятая суша — приглушённая зелень */
.province.owned { stroke: #0b1220aa; }
.province.mine  { stroke: #ffffffbb; stroke-width: 2; }

/* доступные для атаки — свечение + пульс (пункты 1 и 5) */
.province.attackable { cursor: crosshair; }
.province.attackable { animation: attackPulse 1.15s ease-in-out infinite alternate; }
@keyframes attackPulse {
    from { stroke: #ffffff; stroke-width: 2; filter: drop-shadow(0 0 2px #fff6); }
    to   { stroke: var(--c-gold); stroke-width: 4; filter: drop-shadow(0 0 9px #f59e0bcc); }
}
.province.not-clickable { cursor: default; }
.province.capital-mark  { stroke: #fde68a; stroke-width: 2.5; filter: drop-shadow(0 0 7px #fbbf24aa); }

.prov-label {
    font-size: 12px; font-weight: 700;
    fill: #ffffff; paint-order: stroke; stroke: #000000cc; stroke-width: 2.6px;
    pointer-events: none; text-anchor: middle; dominant-baseline: middle;
    font-family: var(--font);
}
.prov-value { font-size: 9px; fill: #ffffffcc; stroke: #000a; stroke-width: 2px; paint-order: stroke;
              pointer-events: none; text-anchor: middle; }
.capital-crown { pointer-events: none; font-size: 17px; text-anchor: middle;
                 filter: drop-shadow(0 1px 3px #000a); }

/* ══════════════ Лог событий ══════════════ */
.events-panel {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); padding: 9px 12px;
    max-height: 120px; overflow-y: auto; font-size: .8rem;
    color: var(--c-muted); display: flex; flex-direction: column; gap: 3px;
}
.events-panel .event-line { display: flex; gap: 8px; }
.events-panel .event-time { color: var(--c-border); flex-shrink: 0; }
.events-empty { color: var(--c-border); }

/* ══════════════ Чат (пункты 7 и 8) ══════════════ */
.chat-panel {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: var(--radius); display: flex; flex-direction: column;
    flex: 1; min-height: 0; overflow: hidden;
}
.chat-messages { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex;
                 flex-direction: column; gap: 7px; font-size: .84rem; min-height: 120px; }
.chat-msg { line-height: 1.35; word-break: break-word; }
.chat-msg .chat-nick { font-weight: 800; }
.chat-msg .chat-spec-tag { font-size: .66rem; background: #7c3aed44; color: #c4b5fd;
    border-radius: 4px; padding: 0 5px; margin-left: 4px; font-weight: 700; }
.chat-msg .chat-time { color: var(--c-border); font-size: .7rem; }
.chat-empty { color: var(--c-border); text-align: center; margin: auto 0; font-size: .82rem; }
.chat-input-row { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--c-border); }
.chat-input-row input {
    flex: 1; background: var(--c-bg); border: 1px solid var(--c-border);
    color: var(--c-text); border-radius: 8px; padding: 8px 10px; font-size: .85rem; font-family: var(--font);
}
.chat-input-row input:focus { outline: none; border-color: var(--c-primary); }
.chat-send-btn { background: var(--c-primary); color: #fff; border: none; border-radius: 8px;
    padding: 0 14px; cursor: pointer; font-weight: 700; }
.chat-send-btn:hover { background: var(--c-primary-h); }

/* ══════════════ Оверлей вопроса ══════════════ */
.question-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78);
    display: none; align-items: center; justify-content: center; z-index: 500; padding: 20px; }
.question-overlay.show { display: flex; }
.question-card {
    background: linear-gradient(180deg, #202a3d, var(--c-surface2));
    border: 1px solid var(--c-border); border-radius: 16px;
    padding: 28px 30px; width: 100%; max-width: 580px;
    box-shadow: 0 24px 70px #000a;
}
.question-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.question-category { font-size: .8rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .05em; }
.question-timer { font-size: 1.5rem; font-weight: 800; color: var(--c-gold); min-width: 2.5rem; text-align: right; }
.question-timer.urgent { color: var(--c-red); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: 1; } to { opacity: .45; } }
.question-text { font-size: 1.15rem; font-weight: 600; margin-bottom: 22px; line-height: 1.5; }
.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.option-btn {
    background: var(--c-bg); border: 2px solid var(--c-border); border-radius: 10px;
    padding: 13px 15px; cursor: pointer; text-align: left; color: var(--c-text);
    font-size: .92rem; transition: border-color .15s, background .15s;
    display: flex; gap: 10px; align-items: flex-start; font-family: var(--font);
}
.option-btn:hover:not(:disabled) { border-color: var(--c-primary); background: #6c63ff22; }
.option-btn:disabled { cursor: default; opacity: .6; }
.option-btn.chosen  { border-color: var(--c-primary); background: #6c63ff22; opacity: 1; }
.option-btn.correct { border-color: var(--c-green) !important; background: #22c55e22 !important; color: var(--c-green); }
.option-btn.wrong   { border-color: var(--c-red) !important; background: #ef444422 !important; color: var(--c-red); }
.option-letter { width: 26px; height: 26px; border-radius: 50%; background: var(--c-border);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: .82rem; flex-shrink: 0; }
.question-result  { text-align: center; margin-top: 18px; font-size: 1.05rem; font-weight: 700; display: none; }
.question-waiting { text-align: center; padding: 20px 0 4px; font-size: 1rem; font-weight: 700; color: var(--c-gold); display: none; }

/* ══════════════ Числовой ответ ══════════════ */
.numeric-answer-row { display: none; gap: 10px; }
.numeric-answer-row input {
    flex: 1; background: var(--c-bg); border: 2px solid var(--c-border);
    color: var(--c-text); border-radius: 10px; padding: 12px 14px;
    font-size: 1.1rem; font-weight: 700; font-family: var(--font); text-align: center;
}
.numeric-answer-row input:focus { outline: none; border-color: var(--c-primary); }
.numeric-answer-row button {
    background: var(--c-primary); color: #fff; border: none; border-radius: 10px;
    padding: 0 22px; cursor: pointer; font-weight: 700; font-size: .95rem;
}
.numeric-answer-row button:hover:not(:disabled) { background: var(--c-primary-h); }
.numeric-answer-row button:disabled { opacity: .6; cursor: default; }
.q-role-hint { margin-bottom: 10px; font-size: .82rem; color: var(--c-muted); }
.q-siege-info { margin-bottom: 10px; font-size: .82rem; color: var(--c-gold); font-weight: 700; display: none; }

/* ══════════════ Действия ══════════════ */
.action-bar { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 8px 0 0; }

/* ══════════════ Финал (пункт 11) ══════════════ */
.winner-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.88);
    display: none; align-items: center; justify-content: center; z-index: 600; padding: 20px; }
.winner-overlay.show { display: flex; }
.winner-card {
    background: linear-gradient(180deg, #202a3d, var(--c-surface2));
    border: 2px solid var(--c-gold); border-radius: 20px;
    padding: 36px 44px; text-align: center; max-width: 460px; width: 100%;
    box-shadow: 0 0 60px #f59e0b33;
}
.winner-card h2 { font-family: Georgia, serif; }
.winner-trophy { font-size: 3rem; margin-bottom: 8px; }
.winner-title { font-size: 1.9rem; font-weight: 800; color: var(--c-gold); margin-bottom: 6px; }
.winner-subtitle { font-size: 1.15rem; }
.final-scores { display: flex; flex-direction: column; gap: 6px; margin: 20px 0 26px; text-align: left; }
.final-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 9px; }
.final-row.is-winner { border-color: var(--c-gold); }
.final-rank { font-weight: 800; color: var(--c-muted); width: 22px; }
.final-name { flex: 1; font-weight: 700; }
.final-name .final-elim { color: var(--c-red); font-size: .72rem; }
.final-pts  { font-weight: 800; color: var(--c-gold); }
