/* =====================================================================================
 * mobile-hud.css — Padrão visual ÚNICO da partida no jogo mobile (game-mobile.html).
 * A mesma linguagem do hud.css do desktop e da Sala de Guerra: superfícies escuras,
 * linhas finas, Space Grotesk nos títulos, Inter no texto, JetBrains Mono nos números,
 * raio 10px, âmbar = ação principal, uma cor por fase.
 *
 * Carregado POR ÚLTIMO no game-mobile.html: sobrepõe mobile.css e mobile-ux.css sem
 * apagá-los (rollback = tirar o <link>). Escopo: a partida (#game-screen) e os avisos;
 * menu, lobby e login continuam com o visual deles.
 * ===================================================================================== */

:root {
    /* superfícies e texto (mesmos valores do hud.css) */
    --hud-bg: #0B0F17;
    --hud-bg-2: #111827;
    --hud-panel: rgba(17, 24, 39, 0.82);
    --hud-panel-solid: #121a29;
    --hud-raise: rgba(30, 41, 59, 0.6);
    --hud-sunk: rgba(2, 6, 14, 0.5);
    --hud-line: rgba(148, 163, 184, 0.16);
    --hud-line-strong: rgba(148, 163, 184, 0.32);
    --hud-text: #E5E7EB;
    --hud-muted: #8A97AD;

    --hud-amber: #F59E0B;
    --hud-blue: #3B82F6;
    --hud-red: #EF4444;
    --hud-green: #22C55E;
    --hud-sky: #38BDF8;

    /* uma cor por fase — barra, seletor de tropas e dicas falam a mesma língua */
    --ph-draft: var(--hud-blue);
    --ph-attack: var(--hud-red);
    --ph-occupy: var(--hud-amber);
    --ph-fortify: var(--hud-green);

    --hud-head: "Space Grotesk", "Inter", system-ui, sans-serif;
    --hud-body: "Inter", system-ui, sans-serif;
    --hud-mono: "JetBrains Mono", ui-monospace, monospace;

    --hud-r-sm: 6px;
    --hud-r: 10px;
    --hud-r-lg: 14px;
    --hud-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    --z-notice: 9500;
}

#game-screen {
    --phase-c: var(--hud-line-strong);
    background: var(--hud-bg);
    color: var(--hud-text);
    font-family: var(--hud-body);
}
#game-screen[data-phase="draft"] { --phase-c: var(--ph-draft); }
#game-screen[data-phase="attack"] { --phase-c: var(--ph-attack); }
#game-screen[data-phase="fortify"] { --phase-c: var(--ph-fortify); }
#game-screen button, #game-screen input, #game-screen select, #hud-notices { font-family: var(--hud-body); }

/* ------------------------------------------------------------------ botões ----------- */
#game-screen .btn-primary, #game-screen .btn-secondary {
    border-radius: var(--hud-r-sm);
    font-size: 13px;
    letter-spacing: 0.01em;
    box-shadow: none;
    text-shadow: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s;
}
/* ação principal: âmbar, texto escuro — a mesma do "Lançar operação" e do desktop */
#game-screen .btn-primary {
    background: var(--hud-amber);
    border: 1px solid var(--hud-amber);
    color: #1a1204;
    font-weight: 700;
}
#game-screen .btn-primary:active:not(:disabled) { background: #fbbf24; transform: translateY(1px); opacity: 1; }
#game-screen .btn-primary:disabled {
    background: var(--hud-raise); border-color: var(--hud-line-strong); color: var(--hud-muted);
    opacity: 1; cursor: not-allowed;
}
#game-screen .btn-secondary {
    background: transparent;
    border: 1px solid var(--hud-line-strong);
    color: var(--hud-text);
    font-weight: 600;
}
#game-screen .btn-secondary:active { background: var(--hud-raise); }
#game-screen .btn-icon {
    width: 32px; height: 32px; border-radius: var(--hud-r-sm);
    background: transparent; border: 1px solid var(--hud-line); color: var(--hud-muted);
    font-size: 18px;
}
#game-screen .btn-icon:active { color: var(--hud-text); border-color: var(--hud-line-strong); }
#game-screen button:focus-visible { outline: 2px solid var(--hud-sky); outline-offset: 2px; }

/* pulso único de "há algo a fazer aqui" (troca de cartas disponível) */
#game-screen .combo-alert { animation: hudNudge 2.2s ease-in-out infinite; }
@keyframes hudNudge {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
    50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.25); }
}

/* ------------------------------------------------------------------ topo -------------- */
#game-screen .hud-btn, #game-screen .hud-btn-cards {
    border-radius: var(--hud-r);
    background: var(--hud-panel);
    border: 1px solid var(--hud-line);
    color: var(--hud-text);
    box-shadow: none;
}
#game-screen .hud-btn:active, #game-screen .hud-btn-cards:active { background: var(--hud-raise); border-color: var(--hud-line-strong); }
#game-screen .hud-btn.is-on { color: #fcd34d; border-color: rgba(245, 158, 11, 0.5); box-shadow: none; }
#game-screen .badge {
    font-family: var(--hud-mono); font-size: 9px; font-weight: 700;
    min-width: 16px; width: auto; padding: 0 4px; border-radius: 999px;
    background: var(--hud-amber); color: #1a1204;
}
#game-screen .card-count { font-family: var(--hud-mono); font-size: 13px; font-weight: 700; color: var(--hud-text); }
#btn-cards.combo-alert { border-color: var(--hud-amber); }
#btn-cards.combo-alert .card-count { color: #fcd34d; }

#game-screen #hud-top-center {
    background: rgba(11, 15, 23, 0.9);
    border: 1px solid var(--hud-line) !important;
    border-radius: 999px;
    box-shadow: none;
    padding: 4px 6px 4px 12px;
    gap: 6px;
}
#game-screen .hud-label {
    font-family: var(--hud-head); font-size: 10px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--hud-muted);
}
#game-screen .hud-value { font-family: var(--hud-mono); font-size: 13px; font-weight: 700; color: var(--hud-text); }
#game-screen .hud-accent { color: var(--hud-text); }
#game-screen .hud-divider { background: var(--hud-line); height: 14px; }
/* rede e ranking: mesma pílula de status da Sala de Guerra */
#game-screen .hud-match-badge {
    font-family: var(--hud-mono); font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
    padding: 3px 8px; border-radius: 999px; box-shadow: none;
    border: 1px solid var(--hud-line-strong); background: transparent; color: var(--hud-muted);
}
#game-screen .hud-match-badge.net-online { color: #86efac; border-color: rgba(34, 197, 94, 0.45); background: transparent; }
#game-screen .hud-match-badge.rank-on { color: #fcd34d; border-color: rgba(245, 158, 11, 0.5); background: transparent; }

/* jogadores: marca de cor à esquerda, contagem em mono, quem joga em destaque */
#game-screen .hud-player-chip {
    --pc: var(--hud-muted);
    background: var(--hud-panel);
    border: 1px solid var(--hud-line);
    border-left: 3px solid var(--pc);
    border-radius: var(--hud-r-sm);
    box-shadow: none;
    padding: 5px 8px;
    gap: 6px;
}
#game-screen .hud-player-chip.active {
    background: var(--hud-raise);
    border-color: color-mix(in srgb, var(--pc) 60%, transparent);
    border-left-color: var(--pc);
    box-shadow: none;
}
#game-screen .chip-dot { width: 8px; height: 8px; background: var(--pc); box-shadow: none; }
#game-screen .chip-name { font-family: var(--hud-body); font-weight: 600; color: var(--hud-text); }
#game-screen .chip-count { font-family: var(--hud-mono); font-size: 11px; font-weight: 700; color: var(--hud-text); }

/* objetivo, legenda de continentes e dica de território */
#game-screen .objective-tip {
    background: var(--hud-panel); border: 1px solid var(--hud-line);
    border-left: 3px solid var(--hud-amber); border-radius: var(--hud-r-sm);
    color: var(--hud-text); text-align: left; font-size: 11px;
}
#game-screen .continent-legend-toggle {
    background: var(--hud-panel) !important;
    border: 1px solid var(--hud-line) !important;
    border-radius: var(--hud-r) !important;
    color: var(--hud-text) !important;
    box-shadow: none;
}
#game-screen .continent-legend-toggle.active { border-color: var(--hud-line-strong) !important; color: var(--hud-text) !important; box-shadow: none; background: var(--hud-raise) !important; }
#game-screen .legend-toggle-label { font-family: var(--hud-head); font-weight: 600; letter-spacing: 0.02em; }
#game-screen .continent-legend {
    background: var(--hud-panel-solid); border: 1px solid var(--hud-line-strong);
    border-radius: var(--hud-r); box-shadow: var(--hud-shadow); color: var(--hud-text);
}
#game-screen .continent-legend-item b { font-family: var(--hud-mono); }
/* quantos países faltam por continente; "quase" (≤ 2) pulsa em âmbar, dominado em verde */
#game-screen .continent-legend-item .leg-missing { font-family: var(--hud-mono); font-style: normal; font-size: 10px; color: var(--hud-muted); margin-left: 6px; padding: 0 5px; border-radius: 999px; }
#game-screen .continent-legend-item .leg-missing:empty { display: none; }
#game-screen .continent-legend-item.leg-mine .leg-missing { color: var(--hud-green); border: 1px solid color-mix(in srgb, var(--hud-green) 45%, transparent); }
#game-screen .continent-legend-item.leg-near .leg-missing { color: #0b0f1a; background: var(--hud-amber); font-weight: 700; animation: legNearM 1.4s ease-in-out infinite; }
#game-screen .continent-legend-toggle.near { border-color: var(--hud-amber) !important; color: var(--hud-amber) !important; animation: legNearM 1.4s ease-in-out infinite; }
@keyframes legNearM { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--hud-amber) 60%, transparent); } 50% { box-shadow: 0 0 0 5px transparent; } }
#game-screen #territory-tooltip {
    background: var(--hud-panel-solid); border: 1px solid var(--hud-line-strong);
    border-radius: var(--hud-r-sm); box-shadow: var(--hud-shadow);
}
#game-screen #tt-name { font-family: var(--hud-head); font-weight: 700; color: var(--hud-text); }
#game-screen #tt-details { color: var(--hud-muted); }

/* ------------------------------------------------------------------ barra inferior --- */
#game-screen #hud-bottom-bar {
    background: rgba(11, 15, 23, 0.94) !important;
    border-top: 1px solid var(--hud-line) !important;
    box-shadow: inset 0 2px 0 var(--turn-color, transparent);
    gap: 10px;
}
#game-screen #hud-player-avatar { width: 26px; height: 26px; border: 0; box-shadow: 0 0 0 3px color-mix(in srgb, var(--turn-color, #fff) 25%, transparent); }
#game-screen #hud-player-name { font-family: var(--hud-head); font-size: 12px; font-weight: 700; color: var(--hud-text); }
#game-screen #hud-player-ideology { font-size: 10px; color: var(--hud-muted); }

/* fases: três nomes fixos, cada passo acende na cor da sua fase */
#game-screen #hud-phase-dots {
    gap: 2px; padding: 3px;
    background: var(--hud-sunk);
    border: 1px solid var(--hud-line);
    border-radius: 999px;
}
#game-screen .phase-dot {
    --c: var(--hud-muted);
    width: auto; height: auto;
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px;
    border-radius: 999px;
    background: transparent;
    transform: none;
    font-family: var(--hud-head); font-size: 10.5px; font-weight: 600; letter-spacing: 0.02em;
    color: var(--hud-muted);
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s;
}
#game-screen .phase-dot[data-phase="draft"] { --c: var(--ph-draft); }
#game-screen .phase-dot[data-phase="attack"] { --c: var(--ph-attack); }
#game-screen .phase-dot[data-phase="fortify"] { --c: var(--ph-fortify); }
#game-screen .phase-dot i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.6; flex: none; }
#game-screen .phase-dot.active { background: var(--c); color: #fff; transform: none; }
#game-screen .phase-dot.active i { display: none; }
#game-screen .phase-dot[data-phase="fortify"].active { color: #052e14; }
#game-screen .phase-dot b { font-family: var(--hud-mono); font-weight: 700; }
/* tela estreita: só a fase atual mostra o nome; as outras viram pontos */
@media (max-width: 760px) {
    #game-screen .phase-dot:not(.active) { padding: 4px 5px; }
    #game-screen .phase-dot:not(.active) span { display: none; }
}

/* ação principal da fase: âmbar (como "Encerrar turno" no desktop); Passar é secundária */
#game-screen .btn-action {
    background: var(--hud-amber);
    color: #1a1204;
    border: 1px solid var(--hud-amber);
    border-radius: var(--hud-r-sm);
    font-family: var(--hud-body); font-size: 12.5px; font-weight: 700;
    letter-spacing: 0.01em; text-transform: none;
    padding: 7px 14px; min-height: 36px;
    box-shadow: none;
    max-width: 44vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#game-screen .btn-action:active:not(:disabled) { background: #fbbf24; transform: translateY(1px); }
#game-screen .btn-action:disabled {
    background: var(--hud-raise); border-color: var(--hud-line); color: var(--hud-muted);
    cursor: default;
}
#game-screen .btn-pass {
    border-radius: var(--hud-r-sm);
    background: transparent; border: 1px solid var(--hud-line-strong); color: var(--hud-text);
    font-size: 12px; font-weight: 600; min-height: 36px;
}
#game-screen .btn-pass:disabled { opacity: 0.4; }
#game-screen #hud-round-info { font-family: var(--hud-head); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; color: var(--hud-muted); }

/* ------------------------------------------------------------------ seletor de tropas  */
#game-screen .troop-picker {
    --tp-accent: var(--ph-draft);
    background: var(--hud-panel-solid);
    border: 1px solid var(--hud-line-strong);
    border-top: 3px solid var(--tp-accent);
    border-radius: var(--hud-r-lg);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}
#game-screen .troop-picker[data-kind="draft"] { --tp-accent: var(--ph-draft); }
#game-screen .troop-picker[data-kind="attack"] { --tp-accent: var(--ph-attack); }
#game-screen .troop-picker[data-kind="occupation"] { --tp-accent: var(--ph-occupy); }
#game-screen .troop-picker[data-kind="fortify"] { --tp-accent: var(--ph-fortify); }
#game-screen .tp-title { font-family: var(--hud-head); font-size: 13px; font-weight: 700; color: var(--hud-text); letter-spacing: 0; }
#game-screen .tp-sub { color: var(--hud-muted); }
#game-screen .tp-sub b { color: var(--hud-text); font-family: var(--hud-mono); }
#game-screen .tp-btn {
    border-radius: var(--hud-r); border: 1px solid var(--hud-line-strong);
    background: var(--hud-raise); color: var(--hud-text); box-shadow: none;
    font-family: var(--hud-mono);
}
#game-screen .tp-btn:active:not(:disabled) { border-color: var(--tp-accent); background: var(--hud-raise); }
#game-screen .tp-minmax { font-family: var(--hud-head); font-size: 10px; letter-spacing: 0.04em; }
#game-screen .tp-value, #game-screen .tp-input { font-family: var(--hud-mono); font-weight: 700; color: var(--hud-text); text-shadow: none; }
#game-screen .tp-value { border-bottom-color: var(--hud-line-strong); }
#game-screen .tp-unit, #game-screen .tp-range { font-family: var(--hud-body); text-transform: none; letter-spacing: 0; color: var(--hud-muted); }
#game-screen .tp-actions button { border-radius: var(--hud-r-sm); }
#game-screen .tp-confirm {
    background: var(--tp-accent); border: 1px solid var(--tp-accent);
    color: #fff; font-weight: 700; box-shadow: none;
}
#game-screen .troop-picker[data-kind="occupation"] .tp-confirm,
#game-screen .troop-picker[data-kind="fortify"] .tp-confirm { color: #0b1220; }
#game-screen .tp-confirm:active:not(:disabled) { filter: brightness(1.08); background: var(--tp-accent); }
#game-screen .tp-extra {
    background: transparent; border: 1px solid rgba(239, 68, 68, 0.6); color: #fca5a5;
    font-family: var(--hud-body);
}
#game-screen .tp-extra:active { background: rgba(239, 68, 68, 0.14); }
#game-screen .ux-toggle { color: var(--hud-muted); }
#game-screen .ux-toggle input { accent-color: var(--hud-amber); }

/* ------------------------------------------------------------------ combate ----------- */
#game-screen .last-combat {
    background: var(--hud-panel-solid);
    border: 1px solid var(--hud-line);
    border-radius: var(--hud-r);
    box-shadow: var(--hud-shadow);
}
#game-screen .lc-title { font-family: var(--hud-head); font-weight: 600; letter-spacing: 0.08em; color: var(--hud-muted); }
#game-screen .lc-summary, #game-screen .lc-result { font-family: var(--hud-head); }
#game-screen .lc-who { font-family: var(--hud-head); }
#game-screen .lc-toggle { border-radius: var(--hud-r-sm); border-color: var(--hud-line); color: var(--hud-muted); }
#game-screen .lc-die, #game-screen .uxd-die, #game-screen .lc-loss, #game-screen .uxd-loss { font-family: var(--hud-mono); }
#game-screen .lc-die, #game-screen .uxd-die { border-radius: var(--hud-r-sm); }
#game-screen .ux-dice {
    background: var(--hud-panel-solid);
    border: 1px solid var(--hud-line-strong);
    border-radius: var(--hud-r-lg);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.6);
}

/* ------------------------------------------------------------------ painéis e diálogos  */
#game-screen .modal { background: rgba(2, 6, 14, 0.62); }
#game-screen .modal-content {
    --dlg-accent: var(--hud-sky);
    background: var(--hud-panel-solid);
    border: 1px solid var(--hud-line-strong);
    border-top: 3px solid var(--dlg-accent);
    border-radius: var(--hud-r-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    color: var(--hud-text);
}
#game-screen .modal-content h2, #game-screen .modal-content h3, #game-screen .panel-header {
    font-family: var(--hud-head); font-weight: 700; letter-spacing: -0.01em; color: var(--hud-text); text-shadow: none;
}
#game-screen .panel-header { font-size: 15px; }
#draft-income-modal .modal-content { --dlg-accent: var(--ph-draft); }
#revolt-overlay .modal-content { --dlg-accent: var(--hud-red); }
#gameover-modal .modal-content, #cards-modal .modal-content { --dlg-accent: var(--hud-amber); }
#revolt-title { color: #fca5a5; }

#game-screen .ux-dialog { background: rgba(2, 6, 14, 0.62); backdrop-filter: blur(4px); }
#game-screen .ux-dialog-card {
    --dlg-accent: var(--hud-sky);
    background: var(--hud-panel-solid);
    border: 1px solid var(--hud-line-strong);
    border-top: 3px solid var(--dlg-accent);
    border-radius: var(--hud-r-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
}
#game-screen .ux-dialog-card h3 { font-family: var(--hud-head); font-weight: 700; letter-spacing: -0.01em; color: var(--hud-text); }
#game-screen .ux-dialog-body, #game-screen .ux-dialog-body b { color: var(--hud-text); }
#game-screen .ux-tip-kicker { font-family: var(--hud-head); font-weight: 600; letter-spacing: 0.14em; color: var(--hud-sky); }
#game-screen #ux-confirm .ux-dialog-card { --dlg-accent: var(--hud-amber); border-color: var(--hud-line-strong); border-top-color: var(--dlg-accent); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65); }
#game-screen #ux-confirm[data-tone="danger"] .ux-dialog-card { --dlg-accent: var(--hud-red); }
#game-screen #ux-confirm-yes { border: 1px solid var(--hud-line-strong); color: var(--hud-text); background: transparent; }
#game-screen #ux-confirm[data-tone="danger"] #ux-confirm-yes { border-color: rgba(239, 68, 68, 0.6); color: #fca5a5; }
#game-screen #ux-confirm[data-tone="danger"] #ux-confirm-yes:active { background: rgba(239, 68, 68, 0.12); }

/* reforços do turno */
#game-screen .draft-income-row { background: var(--hud-sunk); border: 1px solid var(--hud-line); border-radius: var(--hud-r-sm); }
#game-screen .draft-income-label strong { color: var(--hud-text); font-weight: 600; }
#game-screen .draft-income-label span { color: var(--hud-muted); }
#game-screen .draft-income-amt { font-family: var(--hud-mono); color: #86efac; }
#game-screen .draft-income-row.negative .draft-income-amt { color: #fca5a5; }
#game-screen .draft-income-total { font-family: var(--hud-mono); color: var(--ph-draft); text-shadow: none; }
#game-screen .draft-income-sentence b, #game-screen .draft-income-howto b { color: var(--hud-text); }
#game-screen .draft-income-howto { background: var(--hud-sunk); border: 1px solid var(--hud-line); border-left: 3px solid var(--ph-draft); border-radius: var(--hud-r-sm); }
#game-screen .draft-income-hint { color: var(--hud-muted); }

/* fim de partida e registro */
#game-screen #go-score { font-family: var(--hud-mono); color: var(--hud-amber); }
#game-screen #go-stats { color: var(--hud-muted); }
#game-screen .go-rank-note { border-radius: var(--hud-r-sm); }
#game-screen .log-entries .log-entry {
    border: 0; border-left: 2px solid var(--hud-line-strong);
    padding: 4px 0 4px 9px; margin-bottom: 4px;
    font-size: 12px; line-height: 1.45; color: var(--hud-text);
}
#game-screen .tutorial-steps b { color: var(--hud-text); font-family: var(--hud-head); }

/* chat operacional */
#game-screen .chat-sheet-panel {
    background: var(--hud-panel-solid);
    border: 1px solid var(--hud-line-strong);
    border-bottom: none;
    border-radius: var(--hud-r-lg) var(--hud-r-lg) 0 0;
}
#game-screen .chat-sheet-title strong { font-family: var(--hud-head); color: var(--hud-text); }
#game-screen .chat-sheet-title small { color: var(--hud-muted); }
#game-screen .chat-filter.active { background: var(--hud-raise); border-color: var(--hud-line-strong); color: var(--hud-text); box-shadow: none; }
#game-screen .chat-input-row input { border-radius: var(--hud-r-sm); background: var(--hud-sunk); border-color: var(--hud-line-strong); }
#game-screen .chat-input-row input:focus { border-color: var(--hud-sky); box-shadow: none; }
#game-screen .chat-send { background: var(--hud-amber); color: #1a1204; border-radius: var(--hud-r-sm); }

/* ------------------------------------------------------------------ cartas ----------- */
#cards-modal .modal-cards {
    border-top: 1px solid var(--hud-line-strong);
    border-left: 3px solid var(--hud-amber);
    border-radius: var(--hud-r-lg) 0 0 var(--hud-r-lg);
}
#cards-modal .panel-header > span { padding-left: 0; }
/* grade de 3 colunas, sem carrossel nem rolagem lateral */
#game-screen #cards-hand {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    justify-content: stretch;
}
#game-screen .cards-empty { grid-column: 1 / -1; color: var(--hud-muted); font-size: 12px; line-height: 1.4; padding: 6px 0; }
#game-screen .card-item {
    position: relative;
    width: auto; height: auto; min-height: 84px;
    padding: 8px 4px 6px; gap: 2px;
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
    background: var(--hud-sunk);
    border: 1px solid var(--hud-line-strong);
    border-radius: var(--hud-r-sm);
    color: var(--hud-text);
    font-family: var(--hud-body);
    transform: none;
    box-shadow: none;
    cursor: pointer;
}
#game-screen .card-item:active { border-color: var(--hud-muted); }
#game-screen .card-item .card-symbol {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; margin: 2px 0 1px; background: var(--hud-raise);
}
#game-screen .card-item .card-territory {
    font-family: var(--hud-head); font-size: 10px; font-weight: 600; color: var(--hud-text);
    line-height: 1.2; text-align: center; overflow-wrap: anywhere;
}
#game-screen .card-item .card-type { font-family: var(--hud-mono); font-size: 8.5px; color: var(--hud-muted); margin-top: auto; }
#game-screen .card-item.is-own { border-color: rgba(34, 197, 94, 0.5); }
#game-screen .card-item.selected {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--hud-amber);
    box-shadow: 0 0 0 1px var(--hud-amber) inset;
    transform: none;
}
#game-screen .card-item.selected .card-symbol { background: rgba(245, 158, 11, 0.22); }
#game-screen .card-item.selected::after {
    content: "✓"; position: absolute; top: 4px; left: 4px;
    width: 15px; height: 15px; border-radius: 50%;
    background: var(--hud-amber); color: #1a1204;
    font-size: 9px; font-weight: 800;
    display: flex; align-items: center; justify-content: center;
}
#game-screen .card-own-badge {
    position: absolute; top: 4px; right: 4px;
    font-family: var(--hud-mono); font-size: 7.5px; font-weight: 700;
    padding: 1px 4px; border-radius: 999px;
    background: rgba(34, 197, 94, 0.16); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.45);
}
#cards-modal #cards-exchange-info { color: var(--hud-muted); text-align: left; line-height: 1.4; }
#cards-modal #cards-exchange-info b { color: var(--hud-text); font-family: var(--hud-mono); }
#cards-modal #btn-exchange { min-height: 44px; font-size: 13px; }

#game-screen .card-figures-rule { background: var(--hud-sunk); border: 1px solid var(--hud-line); border-radius: var(--hud-r-sm); }
#game-screen .cfr-title, #game-screen .tt-head { font-family: var(--hud-head); color: var(--hud-muted); letter-spacing: 0.08em; }
#game-screen .cfr-opt { color: var(--hud-text); }
#game-screen .cfr-note, #game-screen .tt-foot { color: var(--hud-muted); }
#game-screen .trade-table { background: var(--hud-sunk); border: 1px solid var(--hud-line); border-radius: var(--hud-r-sm); }
#game-screen .tt-next { color: #fcd34d; }
#game-screen .tt-next b, #game-screen .tt-v { font-family: var(--hud-mono); }
#game-screen .tt-cell { background: transparent; border-color: var(--hud-line); }
#game-screen .tt-cell.next { background: rgba(245, 158, 11, 0.14); border-color: var(--hud-amber); box-shadow: none; }
#game-screen .tt-arrow { color: var(--hud-amber); }

/* ------------------------------------------------------------------ avisos ----------- */
/* Um componente para tudo que "avisa": toasts, eventos (troca de cartas, assimilação) e
 * erros (hudNotice em game-mobile.js). Empilham no topo, abaixo do placar; toque dispensa. */
#hud-notices {
    position: fixed; top: 50px; left: 50%; transform: translateX(-50%);
    z-index: var(--z-notice);
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    width: min(400px, calc(100vw - 24px));
    pointer-events: none;
}
.hud-notice {
    --accent: var(--hud-sky);
    pointer-events: auto; cursor: pointer;
    display: flex; align-items: flex-start; gap: 9px;
    width: 100%;
    padding: 8px 12px;
    background: rgba(18, 26, 41, 0.97);
    border: 1px solid var(--hud-line-strong);
    border-left: 3px solid var(--accent);
    border-radius: var(--hud-r);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
    font-family: var(--hud-body); font-size: 12.5px; line-height: 1.4; color: var(--hud-text);
    opacity: 0; transform: translateY(-8px);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.hud-notice.show { opacity: 1; transform: translateY(0); }
.hud-notice.tone-success { --accent: var(--hud-green); }
.hud-notice.tone-error { --accent: var(--hud-red); }
.hud-notice.tone-warn { --accent: var(--hud-amber); }
.hud-notice-ic {
    flex: none; width: 18px; height: 18px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.hud-notice.tone-event .hud-notice-ic { background: var(--accent); width: 8px; height: 8px; margin-top: 5px; }
.hud-notice-body { min-width: 0; flex: 1; }
.hud-notice-body b { font-weight: 700; }
.hud-notice .hud-num-good { color: #86efac; font-family: var(--hud-mono); }
@media (prefers-reduced-motion: reduce) { .hud-notice { transition: none; } }
/* em retrato a partida fica atrás do "Gire o celular": os avisos também */
@media (orientation: portrait) { body.in-game #hud-notices { display: none; } }

/* ------------------------------------------------------------------ 29/out/2026 ---------- */
/* cronômetro de turno (settings.timer 30/60, espelho do #turn-timer do desktop): pílula mono no
 * placar; âmbar na nossa vez, vermelha e pulsando nos 10 s finais */
#game-screen .hud-timer {
    display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
    font-family: var(--hud-mono); font-size: 13px; font-weight: 700; color: var(--hud-text);
    padding: 1px 8px 1px 7px; border-radius: 999px;
    border: 1px solid var(--hud-line-strong); background: transparent;
}
#game-screen .hud-timer[hidden], #game-screen .hud-risk[hidden] { display: none; } /* display acima venceria o [hidden] */
#game-screen .hud-timer::before { content: "⏱"; font-size: 11px; line-height: 1; opacity: 0.85; }
#game-screen .hud-timer.mine { color: #fcd34d; border-color: rgba(245, 158, 11, 0.5); }
#game-screen .hud-timer.urgent { color: #fff; background: var(--hud-red); border-color: var(--hud-red); animation: hudTimerUrgent 1s infinite; }
@keyframes hudTimerUrgent { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { #game-screen .hud-timer.urgent { animation: none; } }
/* países em risco de revolta (espelho do painel "Riscos de revolta" do desktop): o toque abre a lista */
#game-screen .hud-risk {
    display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
    font-family: var(--hud-mono); font-size: 11px; font-weight: 700;
    padding: 2px 8px; border-radius: 999px; min-height: 0; width: auto; height: auto;
    color: #fcd34d; background: rgba(245, 158, 11, 0.14); border: 1px solid rgba(245, 158, 11, 0.5);
    box-shadow: none;
}
#game-screen .hud-risk b { font-weight: 700; }
#game-screen .hud-risk.unstable { color: #fff; background: var(--hud-red); border-color: var(--hud-red); }
#game-screen .hud-risk:active { transform: translateY(1px); }
/* lista do risco de revolta dentro da confirmação (ux-confirm, botão único) */
#game-screen .revolt-risk-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 38vh; overflow-y: auto; }
#game-screen .revolt-risk-list .rr-item {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    padding: 5px 8px; border-radius: var(--hud-r-sm);
    background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.3); font-size: 12px;
}
#game-screen .revolt-risk-list .rr-item.unstable { background: rgba(239, 68, 68, 0.12); border-color: rgba(239, 68, 68, 0.4); }
#game-screen .revolt-risk-list .rr-item b { font-family: var(--hud-mono); }
#game-screen .revolt-risk-list .rr-state { color: var(--hud-muted); font-size: 11px; white-space: nowrap; }
#game-screen .revolt-risk-list .rr-item.unstable .rr-state { color: #fca5a5; }
#game-screen #ux-confirm.single #ux-confirm-no { display: none; }

/* início de turno: cartão central breve, na cor do jogador */
#game-screen #turn-banner {
    --pc: var(--hud-sky);
    position: fixed; top: 38%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 40;
    padding: 12px 22px;
    background: rgba(18, 26, 41, 0.96);
    backdrop-filter: none;
    border: 1px solid var(--hud-line-strong);
    border-top: 3px solid var(--pc);
    border-radius: var(--hud-r-lg);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
    font-family: var(--hud-head); font-size: 17px; font-weight: 700; letter-spacing: -0.01em;
    color: var(--hud-text);
    pointer-events: none;
    opacity: 0;
    animation: none;
}
#game-screen #turn-banner.show { animation: hudTurn 1.9s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
#game-screen #turn-banner-text { display: flex; align-items: center; gap: 10px; }
#game-screen #turn-banner .tb-kicker { font-family: var(--hud-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hud-muted); display: block; }
#game-screen #turn-banner .tb-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--pc); flex: none; }
@keyframes hudTurn {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
    12%, 75% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@media (prefers-reduced-motion: reduce) { #game-screen #turn-banner.show { animation: none; opacity: 1; } }

/* ------------------------------------------------------------------ maior arsenal ------- */
/* aviso do maior arsenal (logArsenalHint): a linha pisca até o toque (ou até o próximo turno) e o
 * nome do território leva o mapa até lá (focusTerritoryOnMap); o botão do registro pulsa até abrir */
#game-screen .log-entries .log-entry.log-arsenal { border-left-color: var(--log-c, var(--hud-amber)); }
#game-screen .log-entries .log-entry.log-blink { animation: logBlink 1.1s ease-in-out infinite; border-radius: 4px; }
@keyframes logBlink { 0%, 100% { background: transparent; } 50% { background: rgba(245, 158, 11, 0.22); } }
#game-screen .log-entries .arsenal-link { color: var(--hud-amber); font-weight: 700; text-decoration: underline dotted; padding: 2px 0; }
#game-screen .hud-btn.has-alert { color: var(--hud-amber); border-color: rgba(245, 158, 11, 0.55); animation: hudBtnPulse 1.1s ease-in-out infinite; }
@keyframes hudBtnPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } 50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.28); } }
#map-canvas .territory-bloc.arsenal-pulse { animation: arsenalPulse 0.8s ease-in-out 4; }
@keyframes arsenalPulse { 0%, 100% { filter: none; } 50% { filter: brightness(1.9) drop-shadow(0 0 7px #ffd54f); } }

/* ------------------------------------------------------------------ celular em paisagem -- */
/* 19/out/2026: cada botão conferido em 844×390, 740×360 e 667×375. Palcos sobre o mapa, cabeçalho
 * sempre à vista, lista de facções recolhível e o chat como painel lateral de altura cheia. */

/* lista de facções: botão de recolher no topo; recolhida mostra só a cor e os territórios */
#game-screen .hud-players-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    min-height: 26px; padding: 2px 8px;
    border-radius: var(--hud-r-sm); border: 1px solid var(--hud-line);
    background: var(--hud-panel); color: var(--hud-muted);
    font-family: var(--hud-mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
    cursor: pointer;
}
#game-screen .hud-players-toggle:active { background: var(--hud-raise); color: var(--hud-text); }
#game-screen #hud-players.recolhido .hud-players-toggle { justify-content: center; padding: 2px 4px; }
#game-screen #hud-players.recolhido .hud-player-chip { min-width: 0; padding: 4px 6px; gap: 5px; }
#game-screen #hud-players.recolhido .chip-name { display: none; }

/* música desligada: ♪ riscado (o "×" de antes parecia fechar) */
#game-screen #btn-music.is-off { color: var(--hud-muted); position: relative; }
#game-screen #btn-music.is-off::after {
    content: ""; position: absolute; left: 9px; right: 9px; top: 50%; height: 2px;
    background: currentColor; transform: rotate(-45deg); border-radius: 1px;
}

/* painéis com rolagem: o título e o × ficam à vista */
#game-screen .modal-content > .panel-header {
    position: sticky; top: -20px; z-index: 3; /* cobre também a margem interna (20px) do painel */
    margin-top: -20px; padding-top: 20px;
    background: var(--hud-panel-solid);
}
#cards-modal .modal-cards > .panel-header { top: -10px; margin-top: -10px; padding: 10px 0 6px; } /* folha das cartas: margem de 10px */

/* bandeja do chat: a aba ativa manda (o display:flex da lista anulava o [hidden] e mostrava as duas) */
#game-screen .chat-emoji-list[hidden], #game-screen .chat-sticker-list[hidden] { display: none !important; }
/* no painel do chat só a lista de mensagens encolhe; cabeçalho, filtros e campo de texto ficam inteiros */
#game-screen .chat-sheet-panel > :not(.chat-body-row) { flex-shrink: 0; }

/* seletor de tropas aberto à esquerda: o "Último combate" vai para o lado dele (expandido, ficava atrás) */
#game-screen:has(#troop-picker[data-side="left"]:not([hidden])) #last-combat {
    left: calc(20px + min(282px, 46vw) + var(--safe-left, 0px));
}
/* fim de partida por cima de tudo: os avisos do topo não cobrem o título */
body:has(#gameover-modal:not([hidden])) #hud-notices,
body:has(#war-report.open) #hud-notices { display: none; } /* o relatório já traz os avisos (Diário) */
/* com o seletor aberto o título dele já diz o território: o balão só cobria o "Último combate" */
#game-screen:has(#troop-picker:not([hidden])) #territory-tooltip { display: none; }

@media (orientation: landscape) and (max-height: 500px) {
    #game-screen .chat-emoji-tray { max-height: 38vh; overflow-y: auto; }
    /* chat: painel lateral de altura cheia (como bottom sheet não sobrava altura para as mensagens) */
    #game-screen .chat-sheet { flex-direction: row; justify-content: flex-end; }
    #game-screen .chat-sheet-panel {
        width: min(460px, 60vw); height: 100%; max-height: none;
        border-bottom: 1px solid var(--hud-line-strong); border-right: none;
        border-radius: var(--hud-r-lg) 0 0 var(--hud-r-lg);
        padding: 0 calc(10px + var(--safe-right, 0px)) calc(8px + var(--safe-bottom, 0px)) 10px;
    }
    #game-screen .chat-sheet-panel.keyboard-open { max-height: none; }
    #game-screen .chat-sheet-handle, #game-screen .chat-hint { display: none; }
    #game-screen .chat-sheet-header { padding: 8px 2px 4px; }
    #game-screen .chat-filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
    #game-screen .chat-body-row { height: auto; flex: 1 1 auto; min-height: 60px; }
    #game-screen .chat-roster { width: 84px; }
    #game-screen .chat-quick-row { padding: 4px 0; scrollbar-width: none; }
    /* avisos do topo vão para o mapa à esquerda do painel (respostas do 📍 e jogadas continuam à vista) */
    body:has(#chat-panel:not([hidden])) #hud-notices {
        left: calc((100vw - min(460px, 60vw)) / 2);
        width: min(340px, calc(100vw - min(460px, 60vw) - 20px));
    }

    /* fim de partida em duas colunas: placar e objetivo à esquerda, pontos e botões à direita (sem rolar) */
    #gameover-modal .modal-gameover {
        width: min(760px, 94vw); max-width: none; max-height: calc(100vh - 20px);
        display: grid; grid-template-columns: 1fr 1fr; column-gap: 18px; align-content: start;
        padding: 12px 18px 14px;
    }
    #gameover-modal .modal-gameover > * { grid-column: 2; }
    #gameover-modal #go-title { grid-column: 1 / -1; margin-bottom: 4px; }
    #gameover-modal #go-stats { grid-column: 1; grid-row: 2 / span 6; margin: 0; line-height: 1.45; text-align: left; }
    #gameover-modal #go-score { margin: 4px 0 8px; font-size: 30px; }
    #gameover-modal .go-rank-note:empty { display: none; }
    #gameover-modal .go-rank-note { margin-bottom: 4px; padding: 6px 10px; font-size: 12px; }
    #gameover-modal .btn-wide { min-height: 40px; padding: 8px 12px; margin-top: 6px; }
    #gameover-modal #btn-go-hall { line-height: 24px !important; } /* o inline usava 48px */

    /* registro tático: usa a altura da tela */
    #game-screen #log-panel .modal-content { max-height: calc(100vh - 24px); padding: 0 16px 14px; }
    #game-screen #log-panel .panel-header { top: 0; margin-top: 0; padding-top: 14px; margin-bottom: 8px; }
    #game-screen #log-panel .log-entries { max-height: none; }
}

/* ------------------------------------------------------------------ 20/out/2026 ---------- */
/* Repasse da Sala de Guerra (?sala=1 / ?handoff=1): o menu antigo não pisca antes da partida */
html.repasse #menu-screen { display: none !important; }
html.repasse-local body:not(.in-game)::after { /* só no treino local: o online tem a própria tela de espera */
    content: "Abrindo o tabuleiro…";
    position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
    font-family: var(--hud-mono, monospace); font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
    color: var(--hud-muted, #94a3b8); background: #040812; z-index: 1; pointer-events: none;
}

/* Tela cheia: ícone de abrir/fechar conforme o estado */
#game-screen #btn-fullscreen .fs-fechar { display: none; }
#game-screen #btn-fullscreen.is-on .fs-abrir { display: none; }
#game-screen #btn-fullscreen.is-on .fs-fechar { display: inline; }
#game-screen #btn-fullscreen[hidden] { display: none; }

/* Chat com o teclado aberto: o painel fica preso na área visível (game-mobile.js setupChatViewport)
 * e mostra só as mensagens e o campo; cabeçalho, filtros, respostas rápidas e facções voltam ao fechar o teclado */
#game-screen .chat-sheet-panel.keyboard-open { height: 100%; max-height: none; padding-top: 4px; }
#game-screen .chat-sheet-panel.keyboard-open .chat-sheet-handle,
#game-screen .chat-sheet-panel.keyboard-open .chat-sheet-header,
#game-screen .chat-sheet-panel.keyboard-open .chat-filters,
#game-screen .chat-sheet-panel.keyboard-open .chat-quick-row,
#game-screen .chat-sheet-panel.keyboard-open .chat-roster,
#game-screen .chat-sheet-panel.keyboard-open .chat-hint { display: none; }
#game-screen .chat-sheet-panel.keyboard-open .chat-body-row { height: auto; flex: 1 1 auto; min-height: 36px; }
#game-screen .chat-sheet-panel.keyboard-open .chat-messages { padding-bottom: 4px; }
#game-screen .chat-sheet-panel.keyboard-open .chat-input-row { padding-top: 2px; }

/* ---------- World Empire V (28/out/2026): bandeira da facção, voz do povo, setas ---------- */
#game-screen .faccao-bandeira { width: 14px; height: 14px; border-radius: 3px; object-fit: cover; vertical-align: middle; margin-right: 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.18); }
#hud-player-avatar .faccao-bandeira { width: 100%; height: 100%; border-radius: inherit; margin: 0; }
#game-screen .tp-povo { font-size: 0.7rem; color: var(--hud-muted, #8892b0); }
#game-screen .tp-povo-hostil { color: #ffb74d; }
#game-screen .tp-povo-amigo { color: #81c784; }
#game-screen .attack-arrow-fx { pointer-events: none; }
