@import url('https://fonts.googleapis.com/css2?family=Chakra+Petch:ital,wght@0,400;0,600;0,700;1,700&family=Orbitron:wght@400;600;700;900&family=Share+Tech+Mono&display=swap');

:root {
    --grid-size: 5;
    --color-blue: #00e5ff;
    --color-red: #ff3333;
    --active-color: #00e5ff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Share Tech Mono', monospace;
    user-select: none;
}

body {
    background-color: #000205;
    color: #00ff41;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* CANVAS DE AMBIENTE E PARTÍCULAS */
#ocean-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#vfx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 50;
}

/* TEMAS DE CENÁRIOS */
body.scenario-1, body.scenario-2, body.scenario-3, body.scenario-4, body.scenario-5 { 
    background-color: transparent; 
}

/* HEADER E BADGES */
.radar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 2px solid #00ff41;
    background: rgba(0, 255, 65, 0.05);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    z-index: 10;
}

.header-left, .header-right {
    display: flex;
    gap: 10px;
}

.header-title { 
    font-size: 1.25rem; 
    text-shadow: 0 0 8px #00ff41; 
    letter-spacing: 2px; 
    text-align: center; 
    display: flex; 
    align-items: center; 
    gap: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.nav-btn {
    background: rgba(0, 20, 10, 0.8);
    border: 1px solid #00ff41;
    color: #00ff41;
    padding: 8px 15px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.nav-btn:hover { background: #00ff41; color: #000; box-shadow: 0 0 10px #00ff41; }

/* PAINÉIS DAS FROTAS (GLASSMORPHISM SOBRE O OCEANO) */
.battlefield-container {
    display: flex;
    flex: 1;
    gap: 2px;
    min-height: 0;
    position: relative;
    z-index: 5;
}

.fleet-sector {
    flex: 1;
    position: relative;
    overflow: hidden;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.team-blue { background: transparent; }
.team-red { background: transparent; }

.team-blue.active-turn {
    border-color: var(--color-blue, #00e5ff) !important;
    box-shadow: inset 0 0 28px rgba(0, 229, 255, 0.2), 0 0 12px rgba(0, 229, 255, 0.4) !important;
}

.team-red.active-turn {
    border-color: var(--color-red, #ff3333) !important;
    box-shadow: inset 0 0 28px rgba(255, 51, 51, 0.2), 0 0 12px rgba(255, 51, 51, 0.4) !important;
}

/* 2. Mantem o elemento do sonar instanciado na GPU, alternando apenas opacidade em vez de destruir/recriar camada com display */
.sonar-sweep {
    position: absolute;
    top: -50%; 
    left: -50%; 
    width: 200%; 
    height: 200%;
    pointer-events: none;
    display: block !important;
    opacity: 0 !important;
    z-index: 1;
    transform: translateZ(0);
    animation: spin 4s linear infinite;
    animation-play-state: paused;
    transition: opacity 0.25s ease;
    will-change: opacity;
}

.team-blue .sonar-sweep {
    background: conic-gradient(from 0deg, transparent 75%, var(--color-blue, #00e5ff) 100%);
}

.team-red .sonar-sweep {
    background: conic-gradient(from 0deg, transparent 75%, var(--color-red, #ff3333) 100%);
}

.active-turn .sonar-sweep { 
    opacity: 0.25 !important; 
    animation-play-state: running !important;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
        rotate: 0deg;
    }
    to {
        transform: rotate(360deg);
        rotate: 360deg;
    }
}

.sector-content {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 2;
    padding: 8px 14px;
}

.panel-info { text-align: center; flex-shrink: 0; }
.team-blue h2 { color: var(--color-blue, #00e5ff); font-size: 1.45rem; transition: color 0.3s ease; }
.team-red h2 { color: var(--color-red, #ff3333); font-size: 1.45rem; transition: color 0.3s ease; }

.score-display { font-size: 1rem; margin: 3px 0; color: #ccc; }
.highlight-blue { color: var(--color-blue, #00e5ff); font-size: 1.3rem; font-weight: bold; }
.highlight-red { color: var(--color-red, #ff3333); font-size: 1.3rem; font-weight: bold; }
.highlight-neutral { color: #fff; font-size: 1.3rem; font-weight: bold;}

/* BARRA DE PERKS TÁTICOS (5 VANTAGENS TÁTICAS POR EQUIPE) */
.perks-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
    max-width: 96%;
    margin-left: auto;
    margin-right: auto;
}

.perk-btn {
    background: rgba(0, 0, 0, 0.7);
    padding: 5px 10px;
    font-size: 0.76rem;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.2s ease;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.team-blue .perk-btn {
    border: 1px solid var(--color-blue, #00e5ff);
    color: var(--color-blue, #00e5ff);
}
.team-blue .perk-btn:hover:not(:disabled) {
    background: var(--color-blue, #00e5ff);
    color: #000000;
    box-shadow: 0 0 12px var(--color-blue, #00e5ff);
    transform: translateY(-1px);
}

.team-red .perk-btn {
    border: 1px solid var(--color-red, #ff3333);
    color: var(--color-red, #ff3333);
}
.team-red .perk-btn:hover:not(:disabled) {
    background: var(--color-red, #ff3333);
    color: #000000;
    box-shadow: 0 0 12px var(--color-red, #ff3333);
    transform: translateY(-1px);
}

.perk-btn:disabled {
    opacity: 0.22;
    border-color: #444 !important;
    color: #666 !important;
    cursor: not-allowed;
    background: rgba(10, 10, 15, 0.6) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* INDICADOR DE TURNO ("COMANDE O ATAQUE" & BORDA DINÂMICA) */
.turn-indicator {
    font-size: 0.88rem; 
    padding: 4px 16px; 
    display: inline-block;
    border-radius: 4px; 
    color: #ffffff; 
    font-weight: bold; 
    letter-spacing: 1px; 
    margin-top: 3px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.active-turn { 
    border-bottom-color: inherit; 
}

/* GRADE DE COMBATE DINÂMICA (AMPLIADA PARA ALTA VISIBILIDADE EM 7X7 E 10X10) */
.grid-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
    padding: 24px 15px 15px 28px; /* Espaço para letras e números */
    width: 100%;
}

.battle-grid {
    position: relative;
    width: 100%;
    max-width: min(94%, 58vh);
    height: min(94%, 58vh);
    aspect-ratio: 1 / 1;
    z-index: 5;
    margin: auto;
}

.cells-container { 
    width: 100%; 
    height: 100%; 
    display: grid; 
    grid-template-columns: repeat(var(--grid-size, 5), 1fr); 
    grid-template-rows: repeat(var(--grid-size, 5), 1fr); 
    gap: calc(18px / var(--grid-size, 5)); 
}
.col-headers { 
    position: absolute; 
    top: -24px; 
    left: 0; 
    width: 100%; 
    height: 20px; 
    display: grid; 
    grid-template-columns: repeat(var(--grid-size, 5), 1fr); 
    gap: calc(18px / var(--grid-size, 5)); 
}
.row-headers { 
    position: absolute; 
    top: 0; 
    left: -24px; 
    width: 20px; 
    height: 100%; 
    display: grid; 
    grid-template-rows: repeat(var(--grid-size, 5), 1fr); 
    gap: calc(18px / var(--grid-size, 5)); 
}

.cell { 
    width: 100%; 
    height: 100%; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    font-size: calc(1.45rem - (var(--grid-size, 5) - 5) * 0.07rem); 
    font-weight: bold; 
}
.header-cell { 
    color: #ffffff; 
    opacity: 1; 
    font-size: calc(1.05rem - (var(--grid-size, 5) - 5) * 0.035rem); 
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.8); 
}

.grid-btn {
    background-color: rgba(4, 20, 42, 0.78); /* Mantem o visual escuro tatico identico sem acionar blur na GPU */
    border-radius: 4px;
    cursor: crosshair; 
    color: transparent; 
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
    opacity: 0.95;
    position: relative;
    overflow: hidden;
}

.team-blue .grid-btn { 
    border: 1px solid var(--color-blue, #00e5ff); 
}
.team-blue .grid-btn:hover:not(.water):not(.miss):not(.destroyed) { 
    background-color: rgba(0, 229, 255, 0.25); 
    color: #ffffff; 
    box-shadow: 0 0 16px var(--color-blue, #00e5ff), inset 0 0 10px rgba(0, 229, 255, 0.3); 
    opacity: 1; 
    transform: scale(1.04); 
}

.team-red .grid-btn { 
    border: 1px solid var(--color-red, #ff3333); 
}
.team-red .grid-btn:hover:not(.water):not(.miss):not(.destroyed) { 
    background-color: rgba(255, 51, 51, 0.25); 
    color: #ffffff; 
    box-shadow: 0 0 16px var(--color-red, #ff3333), inset 0 0 10px rgba(255, 51, 51, 0.3); 
    opacity: 1; 
    transform: scale(1.04); 
}

/* ==========================================================================
   ESTADOS DE DISPARO, NAVIOS E EFEITOS VISUAIS (CENÁRIO 1)
   ========================================================================== */

/* 1. TIRO NA ÁGUA / MISS (cena1/erro.html) */
.water, .grid-btn.miss { 
    background: rgba(6, 182, 212, 0.12) !important; 
    border-color: #06b6d4 !important; 
    box-shadow: 0 0 14px rgba(6, 182, 212, 0.35), inset 0 0 10px rgba(6, 182, 212, 0.2) !important; 
    cursor: not-allowed; 
    opacity: 1; 
}

.ripple-ring,
.ground-shockwave {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0px;
    height: 0px;
    border: 2px solid #38bdf8;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    animation: expandRipple 1.4s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 1;
}

.ground-shockwave {
    border-color: #8d6e63;
}

.ripple-ring:nth-child(2),
.ground-shockwave:nth-child(2) { animation-delay: 0.2s; }
.ripple-ring:nth-child(3),
.ground-shockwave:nth-child(3) { animation-delay: 0.4s; }

@keyframes expandRipple {
    0% { width: 0px; height: 0px; opacity: 1; border-color: #a5f3fc; }
    100% { width: 140%; height: 140%; opacity: 0; border-color: #06b6d4; }
}

.radar-marker-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    animation: fadeInMarker 0.35s ease-out forwards;
}

@keyframes fadeInMarker {
    to { opacity: 1; }
}

.radar-svg {
    width: 80%;
    height: 80%;
}

.dashed-ring {
    transform-origin: center;
    animation: pulseGlow 2s ease-in-out infinite alternate, rotateRing 12s linear infinite;
}

@keyframes pulseGlow {
    0% { stroke-opacity: 0.5; stroke-width: 1.5; filter: drop-shadow(0 0 2px #06b6d4); }
    100% { stroke-opacity: 1; stroke-width: 2.5; filter: drop-shadow(0 0 8px #38bdf8); }
}

@keyframes rotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.tactical-x {
    transform-origin: center;
    animation: xPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    filter: drop-shadow(0 0 6px #06b6d4);
}

@keyframes xPopIn {
    0% { transform: scale(0) rotate(-45deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* 2. ALVO DETECTADO / SPOTTED */
.spotted { 
    background-color: rgba(255, 165, 0, 0.18) !important; 
    border: 2px dashed #ff9900 !important; 
    box-shadow: 0 0 12px rgba(255, 153, 0, 0.35), inset 0 0 8px rgba(255, 153, 0, 0.2) !important; 
    animation: blink 1s infinite alternate; 
    opacity: 1; 
}

/* Navio detectado/avistado com opacidade reduzida na célula spotted */
.cell.spotted .ship-cell-graphic,
.grid-btn.spotted .ship-cell-graphic {
    opacity: 0.45 !important;
    filter: drop-shadow(0 0 6px rgba(255, 153, 0, 0.8)) !important;
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.cell.destroyed .ship-cell-graphic,
.grid-btn.destroyed .ship-cell-graphic {
    opacity: 1 !important;
}

/* 3. ALVO ATINGIDO / DESTRUÍDO & RENDERIZAÇÃO DE NAVIO (cena1/navio.html) */
.destroyed { 
    background: rgba(20, 5, 5, 0.85) !important; 
    border-color: #ff3333 !important; 
    box-shadow: 0 0 16px rgba(255, 51, 51, 0.5), inset 0 0 10px rgba(255, 0, 0, 0.3) !important; 
    cursor: not-allowed; 
    opacity: 1; 
}

.cell.shake {
    animation: impact-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes impact-shake {
    0%, 100% { transform: translate3d(0, 0, 0); }
    20% { transform: translate3d(-3px, 2px, 0) rotate(-1deg); }
    40% { transform: translate3d(4px, -3px, 0) rotate(1deg); }
    60% { transform: translate3d(-2px, 1px, 0); }
    80% { transform: translate3d(2px, -1px, 0); }
}

/* Fragmento SVG da Embarcação */
.ship-cell-graphic {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transform-origin: center center;
}

.ship-cell-graphic.dir-v {
    transform: rotate(90deg);
}

.ship-cell-graphic svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.9));
    transition: filter 1s ease;
}

/* Estado de Naufrágio Total (Escurecimento do Casco) */
.cell.ship-sunk .ship-cell-graphic svg,
.cell.destroyed.ship-sunk .ship-cell-graphic svg {
    filter: brightness(0.25) contrast(1.3) sepia(0.6) hue-rotate(-20deg) saturate(1.5) drop-shadow(0 0 10px rgba(0, 0, 0, 0.8));
}

/* Carbonização de Veículo Terrestre Destruído (Cenários 4 e 5) */
body.scenario-4 .cell.ship-sunk .ship-cell-graphic svg,
body.scenario-4 .cell.destroyed.ship-sunk .ship-cell-graphic svg,
body.scenario-5 .cell.ship-sunk .ship-cell-graphic svg,
body.scenario-5 .cell.destroyed.ship-sunk .ship-cell-graphic svg {
    filter: brightness(0.35) sepia(0.6) drop-shadow(0 0 8px rgba(255, 80, 0, 0.5)) !important;
    transition: filter 0.8s ease !important;
}

/* ==========================================================================
   EFEITOS VFX ORIGINAIS: CRATERA, FOGO E FUMAÇA (FIDELIDADE RESTAURADA)
   ========================================================================== */
.vfx-node {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 3;
}

.crater {
    position: absolute;
    width: 44%;
    height: 44%;
    background: radial-gradient(circle, #050505 20%, #1a1005 50%, transparent 80%);
    border-radius: 50%;
    box-shadow: inset 0 0 6px black, 0 0 5px rgba(255, 100, 0, 0.8);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    animation: crater-form 0.25s ease-out forwards;
}

@keyframes crater-form {
    to { transform: translate(-50%, -50%) scale(1); }
}

.particle.fire {
    position: absolute;
    bottom: 25%;
    width: 11px;
    height: 11px;
    background: #ffaa00;
    border-radius: 50% 50% 20% 20%;
    box-shadow: 0 0 10px #ff5500;
    opacity: 0;
    animation: fire-flicker linear infinite;
}

@keyframes fire-flicker {
    0% { transform: translateY(0) scale(1); opacity: 1; background: #ffea00; }
    50% { transform: translateY(-14px) scale(1.25); opacity: 0.85; background: #ff3c00; }
    100% { transform: translateY(-30px) scale(0.3); opacity: 0; background: #330000; }
}

.particle.smoke {
    position: absolute;
    bottom: 35%;
    width: 18px;
    height: 18px;
    background: #111111;
    border-radius: 50%;
    filter: blur(2.5px);
    opacity: 0;
    animation: smoke-rise ease-in infinite;
}

@keyframes smoke-rise {
    0% { transform: translateY(0) scale(1) translateX(0); opacity: 0.85; }
    50% { opacity: 0.6; }
    100% { transform: translateY(-50px) scale(2.8) translateX(12px); opacity: 0; }
}

/* Fumaça do Cenário 2 (Tempestade) */
body.scenario-2 .particle.smoke,
.cenario-2 .particle.smoke,
.particle.smoke.storm-smoke {
    background: radial-gradient(circle, #010203 15%, #0b0e13 50%, #151a22 80%, transparent 100%) !important;
    width: 26px !important;
    height: 26px !important;
    filter: blur(2.2px) !important;
    opacity: 0;
    animation: storm-smoke-rise 1.5s cubic-bezier(0.2, 0.8, 0.3, 1) infinite !important;
}

@keyframes storm-smoke-rise {
    0% { transform: translateY(0) scale(0.9) translateX(0); opacity: 0.96; }
    35% { opacity: 0.88; transform: translateY(-22px) scale(1.8) translateX(6px); }
    70% { opacity: 0.55; transform: translateY(-44px) scale(2.7) translateX(14px); }
    100% { transform: translateY(-64px) scale(3.5) translateX(22px); opacity: 0; }
}

/* Vapor do Cenário 3 (Gelo) */
body.scenario-3 .particle.smoke,
.particle.smoke.frost-steam {
    background: radial-gradient(circle, #ffffff 20%, #e2e8f0 50%, #bae6fd 75%, transparent 100%) !important;
    width: 28px !important;
    height: 28px !important;
    filter: blur(3px) !important;
    opacity: 0;
    animation: frost-steam-rise 1.5s cubic-bezier(0.2, 0.8, 0.3, 1) infinite !important;
}

@keyframes frost-steam-rise {
    0% { transform: translateY(0) scale(0.9) translateX(0); opacity: 0.95; }
    35% { opacity: 0.85; transform: translateY(-22px) scale(1.9) translateX(4px); }
    70% { opacity: 0.5; transform: translateY(-45px) scale(2.8) translateX(10px); }
    100% { transform: translateY(-68px) scale(3.6) translateX(18px); opacity: 0; }
}

/* Fogo mais cálido nos cenários 4 e 5 */
body.scenario-4 .particle.fire,
body.scenario-5 .particle.fire {
    background: #ff6600 !important;
    box-shadow: 0 0 10px #ff3300 !important;
    width: 10px !important;
    height: 10px !important;
}

.global-ember {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #ff5500;
    border-radius: 50%;
    box-shadow: 0 0 6px #ffaa00;
    pointer-events: none;
    z-index: 4;
    animation: float-ember 2.2s linear forwards;
}

@keyframes float-ember {
    0% { transform: translateY(0) translateX(0); opacity: 1; }
    100% { transform: translateY(-60px) translateX(20px); opacity: 0; }
}

/* MICRO-FAÍSCAS ELÉTRICAS DE CURTO-CIRCUITO (CENÁRIO 2) */
.electric-sparks {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.spark-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #00e5ff;
    border-radius: 50%;
    box-shadow: 0 0 8px #00e5ff, 0 0 14px #ffea00;
    animation: electric-flash 0.5s ease-out 3 alternate forwards;
}

@keyframes electric-flash {
    0%, 100% { opacity: 0; transform: scale(0.4) translate(0, 0); }
    15% { opacity: 1; transform: scale(1.6) translate(3px, -4px); background: #ffea00; }
    40% { opacity: 0.1; transform: scale(0.6) translate(-2px, 2px); background: #00e5ff; }
    65% { opacity: 1; transform: scale(1.8) translate(4px, 3px); background: #ffffff; }
    85% { opacity: 0.3; transform: scale(0.9) translate(-3px, -2px); background: #38bdf8; }
}

/* ==========================================================================
   EFEITOS VISUAIS ESPECÍFICOS - CENÁRIO 2: TEMPESTADE NOTURNA
   ========================================================================== */

/* 1. CANVAS DE GOTAS DINÂMICAS ESCORRENDO NA LENTE (CENÁRIO 2) */
#lens-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 8;
    display: none;
}

body.scenario-2 #lens-canvas,
.lens-canvas-active {
    display: block !important;
}

/* 2. ONDA / OSCILAÇÃO ADJACENTE EM MAR REVOLTO */
.adjacent-wave-surge {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border-radius: 4px;
    box-shadow: inset 0 0 14px rgba(56, 189, 248, 0.75), 0 0 16px rgba(148, 163, 184, 0.55);
    border: 1.5px solid rgba(56, 189, 248, 0.7);
    animation: wave-surge-pulse 0.55s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
    z-index: 3;
}

@keyframes wave-surge-pulse {
    0% { opacity: 0.95; transform: scale(0.92); }
    40% { opacity: 0.8; transform: scale(1.06); }
    100% { opacity: 0; transform: scale(1); }
}

/* 3. MARCADOR DE ERRO EXCLUSIVO DE TEMPESTADE ("X" TÁTICO DE ALTA TENSÃO) */
.storm-radar-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    animation: fadeInMarker 0.35s ease-out forwards;
}

.storm-radar-svg {
    width: 86%;
    height: 86%;
    animation: storm-marker-pulse 2.2s infinite ease-in-out;
}

@keyframes storm-marker-pulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px var(--storm-color, #00e5ff)); }
    50% { transform: scale(1.06); filter: drop-shadow(0 0 12px var(--storm-color, #00e5ff)) drop-shadow(0 0 5px #ffffff); }
}

.storm-pulsing-ring {
    transform-origin: center;
    animation: pulseRingStorm 1.8s ease-in-out infinite alternate;
}

@keyframes pulseRingStorm {
    0% { stroke-opacity: 0.4; stroke-width: 1.5; }
    100% { stroke-opacity: 1; stroke-width: 2.8; filter: drop-shadow(0 0 6px var(--storm-color, #00e5ff)); }
}

.storm-electric-x {
    transform-origin: center;
    animation: xPopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* 4. DESTAQUES DE SONAR E RADAR */
.sonar-highlight { background-color: rgba(255, 255, 255, 0.25) !important; border: 2px solid var(--active-color, #00e5ff) !important; box-shadow: 0 0 12px var(--active-color, #00e5ff); }
.quadrant-highlight { background-color: rgba(255, 193, 7, 0.3) !important; border: 2px solid var(--active-color, #ffc107) !important; box-shadow: 0 0 18px var(--active-color, #ffc107); animation: blink 0.8s infinite alternate; }

/* ==========================================================================
   POWER-UP: RADAR DE QUADRANTE 2x2 (HOVER & ILUMINAÇÃO ATIVA DE SCAN)
   ========================================================================== */

/* 1. Pré-visualização do Bloco 2x2 no Hover de Seleção */
.grid-btn.radar-quadrante-hover,
.fleet-sector .grid-btn.radar-quadrante-hover,
.cells-container .grid-btn.radar-quadrante-hover,
body.scenario-1 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-2 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-3 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-4 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-5 .fleet-sector .grid-btn.radar-quadrante-hover,
.team-blue .grid-btn.radar-quadrante-hover,
.team-red .grid-btn.radar-quadrante-hover {
    background: rgba(0, 243, 255, 0.25) !important;
    border: 2px dashed #00f3ff !important;
    box-shadow: inset 0 0 16px rgba(0, 243, 255, 0.45), 0 0 18px rgba(0, 243, 255, 0.6) !important;
    transform: scale(1.04) !important;
    z-index: 20 !important;
    opacity: 1 !important;
    transition: all 0.1s ease-out !important;
}

body.scenario-5 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-5 .cells-container .grid-btn.radar-quadrante-hover {
    background: rgba(0, 255, 136, 0.28) !important;
    border: 2px dashed #00ff88 !important;
    box-shadow: inset 0 0 16px rgba(0, 255, 136, 0.5), 0 0 20px rgba(0, 255, 136, 0.7) !important;
}

body.scenario-4 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-4 .cells-container .grid-btn.radar-quadrante-hover {
    background: rgba(255, 170, 0, 0.28) !important;
    border: 2px dashed #ffaa00 !important;
    box-shadow: inset 0 0 16px rgba(255, 170, 0, 0.5), 0 0 20px rgba(255, 170, 0, 0.7) !important;
}

body.scenario-3 .fleet-sector .grid-btn.radar-quadrante-hover,
body.scenario-3 .cells-container .grid-btn.radar-quadrante-hover {
    background: rgba(165, 243, 252, 0.28) !important;
    border: 2px dashed #a5f3fc !important;
    box-shadow: inset 0 0 16px rgba(56, 189, 248, 0.5), 0 0 20px rgba(165, 243, 252, 0.7) !important;
}

/* 2. Iluminação Ativa de Varredura / Execução do Radar 2x2 */
.grid-btn.radar-quadrante-ativo,
.fleet-sector .grid-btn.radar-quadrante-ativo,
.cells-container .grid-btn.radar-quadrante-ativo,
body.scenario-1 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-2 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-3 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-4 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-5 .fleet-sector .grid-btn.radar-quadrante-ativo,
.team-blue .grid-btn.radar-quadrante-ativo,
.team-red .grid-btn.radar-quadrante-ativo {
    background: radial-gradient(circle at 50% 50%, rgba(0, 243, 255, 0.45) 0%, rgba(0, 60, 100, 0.6) 100%) !important;
    border: 2px solid #00f3ff !important;
    box-shadow: inset 0 0 18px #00f3ff, 0 0 24px #00f3ff, 0 0 40px rgba(0, 243, 255, 0.85) !important;
    animation: radarQuadrantPulse 1.1s ease-in-out infinite alternate !important;
    z-index: 25 !important;
    position: relative !important;
    opacity: 1 !important;
}

body.scenario-5 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-5 .cells-container .grid-btn.radar-quadrante-ativo {
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.45) 0%, rgba(10, 40, 20, 0.6) 100%) !important;
    border: 2px solid #00ff88 !important;
    box-shadow: inset 0 0 18px #00ff88, 0 0 24px #00ff88, 0 0 40px rgba(0, 255, 136, 0.85) !important;
}

body.scenario-4 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-4 .cells-container .grid-btn.radar-quadrante-ativo {
    background: radial-gradient(circle at 50% 50%, rgba(255, 170, 0, 0.45) 0%, rgba(60, 30, 0, 0.6) 100%) !important;
    border: 2px solid #ffaa00 !important;
    box-shadow: inset 0 0 18px #ffaa00, 0 0 24px #ffaa00, 0 0 40px rgba(255, 170, 0, 0.85) !important;
}

body.scenario-3 .fleet-sector .grid-btn.radar-quadrante-ativo,
body.scenario-3 .cells-container .grid-btn.radar-quadrante-ativo {
    background: radial-gradient(circle at 50% 50%, rgba(165, 243, 252, 0.45) 0%, rgba(12, 74, 110, 0.6) 100%) !important;
    border: 2px solid #a5f3fc !important;
    box-shadow: inset 0 0 18px #38bdf8, 0 0 24px #38bdf8, 0 0 40px rgba(165, 243, 252, 0.85) !important;
}

@keyframes radarQuadrantPulse {
    0% {
        box-shadow: inset 0 0 12px #00f3ff, 0 0 15px #00f3ff, 0 0 25px rgba(0, 243, 255, 0.4);
        border-color: rgba(0, 243, 255, 0.85);
    }
    100% {
        box-shadow: inset 0 0 22px #00f3ff, 0 0 30px #00f3ff, 0 0 50px rgba(0, 243, 255, 0.9);
        border-color: #ffffff;
    }
}

/* 3. Marcador Suave Pós-Varredura ("Zona Escaneada") */
.grid-btn.radar-quadrante-scanned:not(.water):not(.miss):not(.destroyed),
.fleet-sector .grid-btn.radar-quadrante-scanned:not(.water):not(.miss):not(.destroyed) {
    box-shadow: inset 0 0 8px rgba(0, 243, 255, 0.25), 0 0 8px rgba(0, 243, 255, 0.2) !important;
    border-color: rgba(0, 243, 255, 0.45) !important;
    transition: all 0.6s ease-out !important;
}

/* ==========================================================================
   POWER-UP: RADAR SONAR (ILUMINAÇÃO DE LINHA ATIVA)
   ========================================================================== */
.grid-btn.sonar-linha-ativa,
.fleet-sector .grid-btn.sonar-linha-ativa,
.cells-container .grid-btn.sonar-linha-ativa,
body.scenario-1 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-2 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-3 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-4 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-5 .fleet-sector .grid-btn.sonar-linha-ativa,
.team-blue .grid-btn.sonar-linha-ativa,
.team-red .grid-btn.sonar-linha-ativa {
    background: radial-gradient(circle at 50% 50%, rgba(0, 243, 255, 0.45) 0%, rgba(0, 60, 100, 0.6) 100%) !important;
    border: 2px solid #00f3ff !important;
    box-shadow: inset 0 0 18px #00f3ff, 0 0 24px #00f3ff, 0 0 40px rgba(0, 243, 255, 0.85) !important;
    animation: sonarRowPulse 1.1s ease-in-out infinite alternate !important;
    z-index: 25 !important;
    position: relative !important;
    opacity: 1 !important;
}

body.scenario-5 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-5 .cells-container .grid-btn.sonar-linha-ativa {
    background: radial-gradient(circle at 50% 50%, rgba(0, 255, 136, 0.45) 0%, rgba(10, 40, 20, 0.6) 100%) !important;
    border: 2px solid #00ff88 !important;
    box-shadow: inset 0 0 18px #00ff88, 0 0 24px #00ff88, 0 0 40px rgba(0, 255, 136, 0.85) !important;
}

body.scenario-4 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-4 .cells-container .grid-btn.sonar-linha-ativa {
    background: radial-gradient(circle at 50% 50%, rgba(255, 170, 0, 0.45) 0%, rgba(60, 30, 0, 0.6) 100%) !important;
    border: 2px solid #ffaa00 !important;
    box-shadow: inset 0 0 18px #ffaa00, 0 0 24px #ffaa00, 0 0 40px rgba(255, 170, 0, 0.85) !important;
}

body.scenario-3 .fleet-sector .grid-btn.sonar-linha-ativa,
body.scenario-3 .cells-container .grid-btn.sonar-linha-ativa {
    background: radial-gradient(circle at 50% 50%, rgba(165, 243, 252, 0.45) 0%, rgba(12, 74, 110, 0.6) 100%) !important;
    border: 2px solid #a5f3fc !important;
    box-shadow: inset 0 0 18px #38bdf8, 0 0 24px #38bdf8, 0 0 40px rgba(165, 243, 252, 0.85) !important;
}

@keyframes sonarRowPulse {
    0% {
        box-shadow: inset 0 0 12px #00f3ff, 0 0 15px #00f3ff, 0 0 25px rgba(0, 243, 255, 0.4);
        border-color: rgba(0, 243, 255, 0.85);
    }
    100% {
        box-shadow: inset 0 0 22px #00f3ff, 0 0 30px #00f3ff, 0 0 50px rgba(0, 243, 255, 0.9);
        border-color: #ffffff;
    }
}

/* ==========================================================================
   BADGES DE CONTAGEM DE ALVOS (NEGRITO + BRILHO NEON)
   ========================================================================== */
.target-count-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 1.05em;
    font-weight: 900;
    letter-spacing: 0.8px;
    margin: 2px 4px;
    vertical-align: middle;
}

.target-count-badge.target-count-found {
    color: #ffffff !important;
    background: rgba(255, 51, 51, 0.25) !important;
    border: 1.5px solid #ff3333 !important;
    text-shadow: 0 0 8px #ff3333, 0 0 16px #ff3333 !important;
    box-shadow: 0 0 14px rgba(255, 51, 51, 0.5), inset 0 0 10px rgba(255, 51, 51, 0.3) !important;
    animation: targetFoundPulse 1.1s ease-in-out infinite alternate;
}

.target-count-badge.target-count-none {
    color: #ffffff !important;
    background: rgba(0, 255, 136, 0.25) !important;
    border: 1.5px solid #00ff88 !important;
    text-shadow: 0 0 8px #00ff88, 0 0 16px #00ff88 !important;
    box-shadow: 0 0 14px rgba(0, 255, 136, 0.5), inset 0 0 10px rgba(0, 255, 136, 0.3) !important;
}

@keyframes targetFoundPulse {
    0% { transform: scale(1); filter: brightness(1); }
    100% { transform: scale(1.05); filter: brightness(1.25); box-shadow: 0 0 20px rgba(255, 51, 51, 0.8); }
}

.disabled-lock { 
    pointer-events: none !important; 
    opacity: 0.38 !important; 
    filter: none !important;
}

/* MODAIS */
.notification-overlay, .modal-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 3, 8, 0.88); display: flex; justify-content: center; align-items: center; z-index: 100; }
.notification-box { background: #000d1a; border: 2px solid #00ff41; box-shadow: 0 0 30px rgba(0, 255, 65, 0.3); width: 550px; padding: 30px; text-align: center; }
.alert-banner { background: #00ff41; color: #000; font-weight: bold; padding: 10px; font-size: 1.2rem; margin-bottom: 20px; }
.alert-banner.critical-red { background: #ff3333 !important; color: #fff !important; animation: blink 0.8s infinite alternate; }
.alert-banner.dreadnought-alert { background: #ff9900 !important; color: #000 !important; font-size: 1.3rem; animation: blink 0.5s infinite alternate; }
.alert-message { font-size: 1.1rem; color: #fff; margin-bottom: 30px; line-height: 1.5; }

.tactical-btn { background: transparent; border: 2px solid #00ff41; color: #00ff41; padding: 10px 24px; font-size: 1.1rem; cursor: pointer; transition: 0.2s; font-weight: bold;}
.tactical-btn:hover { background: #00ff41; color: #000; box-shadow: 0 0 15px #00ff41; }
.danger-btn { border-color: #ff3333; color: #ff3333; }
.danger-btn:hover { background: #ff3333; color: #fff; box-shadow: 0 0 15px #ff3333; }
.secondary-btn { border-color: #888; color: #ccc; }
.secondary-btn:hover { background: #888; color: #000; box-shadow: 0 0 10px #888; }

.sonar-border { border: 2px solid var(--active-color, #00ff41); box-shadow: 0 0 35px rgba(0, 255, 65, 0.2); background-color: #000205; padding: 30px; width: 750px; max-width: 90vw; }
.alert-bar { background-color: #ff3333; color: #fff; padding: 10px; font-size: 1.1rem; font-weight: bold; text-align: center; margin-bottom: 15px; }
.alert-bar-info { background-color: var(--active-color, #00e5ff); color: #000; padding: 10px; font-size: 1.1rem; font-weight: bold; text-align: center; margin-bottom: 15px; }
.timer-box { font-size: 1.2rem; margin-bottom: 15px; color: #ff9900; text-align: center; }
#timer-display { font-size: 1.8rem; font-weight: bold; color: #fff;}
#question-text { font-size: 1.25rem; color: #fff; margin-bottom: 20px; line-height: 1.5; text-align: left; }
.options-layout { display: flex; flex-direction: column; gap: 10px; }
.option-btn { background: rgba(0, 20, 10, 0.5); border: 1px solid #00ff41; color: #fff; padding: 12px 18px; font-size: 1rem; cursor: pointer; text-align: left; transition: 0.2s; }
.option-btn:hover:not(:disabled) { background: #00ff41; color: #000; font-weight: bold; }
.option-btn:disabled { opacity: 0.2; cursor: not-allowed; border-color: #444; }

.question-perk-box {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed rgba(255, 255, 255, 0.15);
    text-align: center;
}

.perk-modal-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #ffb700;
    color: #ffb700;
    font-size: 0.92rem;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#btn-use-5050-in-modal { border-color: #ffb700; color: #ffb700; }
#btn-use-5050-in-modal:hover { background: #ffb700; color: #000; box-shadow: 0 0 16px rgba(255, 183, 0, 0.6); }

#btn-use-extratime-in-modal { border-color: #00ff41; color: #00ff41; }
#btn-use-extratime-in-modal:hover { background: #00ff41; color: #000; box-shadow: 0 0 16px rgba(0, 255, 65, 0.6); }

#btn-use-secondchance-in-modal { border-color: #ff9900; color: #ff9900; }
#btn-use-secondchance-in-modal:hover { background: #ff9900; color: #000; box-shadow: 0 0 16px rgba(255, 153, 0, 0.6); }

#btn-change-question-in-modal { border-color: #00e5ff; color: #00e5ff; }
#btn-change-question-in-modal:hover { background: #00e5ff; color: #000; box-shadow: 0 0 16px rgba(0, 229, 255, 0.6); }

.sonar-buttons-grid { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 15px 0; }
.sonar-row-btn { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--active-color, #00e5ff); color: var(--active-color, #00e5ff); padding: 12px 20px; font-size: 1.2rem; cursor: pointer; font-weight: bold; transition: 0.2s; }
.sonar-row-btn:hover { background: var(--active-color, #00e5ff); color: #000; box-shadow: 0 0 12px var(--active-color, #00e5ff); }

.hidden { display: none !important; }
.text-center { text-align: center; }
.glow-winner { color: #fff; text-shadow: 0 0 20px #00ff41; font-size: 2.2rem; margin-bottom: 8px; font-weight: 900; letter-spacing: 1px; }
@keyframes blink { 0% { opacity: 1; } 100% { opacity: 0.3; } }

/* TELA DE FIM DE JOGO & RELATÓRIO ESTATÍSTICO */
.game-over-container {
    background: #090b14 !important;
    border: 2px solid var(--accent-gold, #ffb700) !important;
    box-shadow: 0 0 50px rgba(255, 183, 0, 0.3), inset 0 0 35px rgba(0, 0, 0, 0.9) !important;
    border-radius: 16px;
    width: 100%;
    max-width: 820px;
    padding: 35px 30px !important;
    text-align: center;
    animation: zoomInVictory 0.35s ease;
}

@keyframes zoomInVictory {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.victory-header {
    margin-bottom: 22px;
}

.trophy-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.7));
    animation: floatTrophy 2s ease-in-out infinite alternate;
}

@keyframes floatTrophy {
    from { transform: translateY(0); }
    to { transform: translateY(-6px); }
}

.winner-badge {
    display: inline-block;
    background: rgba(255, 183, 0, 0.15);
    border: 1px solid #ffb700;
    color: #ffb700;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    padding: 4px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
}

.winner-reason {
    font-size: 0.95rem;
    color: #a0aec0;
    margin: 0 auto;
}

.stats-comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 25px;
    text-align: left;
}

@media (max-width: 680px) {
    .stats-comparison-grid {
        grid-template-columns: 1fr;
    }
}

.team-stat-card {
    background: #111422;
    border: 1px solid #2d334d;
    border-radius: 12px;
    padding: 16px 18px;
    transition: all 0.3s ease;
}

.team-stat-card.winner-card {
    border-width: 2px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.05) 0%, #111422 100%);
}

.team-stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-team-name {
    font-size: 1.15rem;
    font-weight: 800;
}

.team-result-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 3px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #aaa;
}

.team-result-badge.badge-winner {
    font-weight: 900;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.stat-items-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
}

.stat-label {
    color: #94a3b8;
}

.stat-val {
    font-weight: 700;
    color: #f1f5f9;
}

.highlight-stat {
    color: #00ff41;
    font-size: 1.05rem;
}

.game-over-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.victory-btn {
    padding: 12px 24px;
    font-size: 0.98rem;
    border-radius: 8px;
}

/* ==========================================================================
   ESTILIZAÇÃO INTEGRAL DE MODAIS E NOTIFICAÇÕES - CENÁRIO 2 (TEMPESTADE NOTURNA)
   ========================================================================== */

/* Overlays com desfoque de fundo no Cenário 2 */
body.scenario-2 .notification-overlay,
body.scenario-2 .modal-overlay {
    background: rgba(1, 4, 10, 0.72) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
}

/* 1. NOTIFICAÇÃO TÁTICA (Alvo Detectado / Tiro na Água / Interceptação Falhou) */
body.scenario-2 .notification-box {
    background: rgba(2, 10, 22, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 2px solid var(--active-color, #00e5ff) !important;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.08), 0 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 14px;
}

/* 2. MODAL DE INTERCEPTAÇÃO/PERGUNTAS & SONAR */
body.scenario-2 .sonar-border {
    background: rgba(2, 10, 22, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 2px solid var(--active-color, #00e5ff) !important;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.08), 0 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 14px;
}

body.scenario-2 .option-btn {
    background: rgba(3, 15, 30, 0.68) !important;
    border: 1px solid rgba(0, 229, 255, 0.3) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.scenario-2 .option-btn:hover:not(:disabled) {
    background: var(--active-color, #00e5ff) !important;
    color: #000000 !important;
    font-weight: bold;
    box-shadow: 0 0 16px var(--active-color, #00e5ff) !important;
    border-color: var(--active-color, #00e5ff) !important;
}

body.scenario-2 .sonar-row-btn {
    background: rgba(3, 15, 30, 0.68) !important;
    border: 1px solid var(--active-color, #00e5ff) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-radius: 6px;
}

body.scenario-2 .perk-modal-btn {
    background: rgba(3, 15, 30, 0.7) !important;
    backdrop-filter: blur(6px) !important;
}

/* 3. MODAL DE FIM DE JOGO & RELATÓRIO FINAL */
body.scenario-2 .game-over-container {
    background: rgba(2, 10, 22, 0.88) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 2px solid var(--accent-gold, #ffb700) !important;
    box-shadow: inset 0 0 20px rgba(0, 229, 255, 0.08), 0 0 45px rgba(0, 0, 0, 0.9) !important;
    border-radius: 16px;
}

body.scenario-2 .team-stat-card {
    background: rgba(4, 14, 28, 0.75) !important;
    border: 1px solid rgba(0, 229, 255, 0.25) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: 12px;
}

body.scenario-2 .team-stat-card.winner-card {
    background: linear-gradient(180deg, rgba(0, 229, 255, 0.12) 0%, rgba(2, 10, 22, 0.85) 100%) !important;
    border: 2px solid var(--accent-gold, #ffb700) !important;
}

/* 4. INTERFERÊNCIA DE ESTÁTICA MILITAR (REAÇÃO AOS RELÂMPAGOS) */
.lightning-glitch {
    filter: brightness(1.55) contrast(1.25) drop-shadow(0 0 20px rgba(0, 229, 255, 0.75)) !important;
    transform: translate(1px, -1px) scale(1.006) !important;
    transition: filter 0.04s ease, transform 0.04s ease !important;
}

/* ==========================================================================
   ESTILIZAÇÃO INTEGRAL - CENÁRIO 3: OPERAÇÃO MAR DE GELO
   ========================================================================== */

/* 1. TIPOGRAFIA TÁTICA EXCLUSIVA DO CENÁRIO 3 (CHAKRA PETCH) */
body.scenario-3,
.cenario-3,
body.scenario-3 h1,
body.scenario-3 h2,
body.scenario-3 h3,
body.scenario-3 .fleet-title,
body.scenario-3 .brand-title,
body.scenario-3 .status-label,
body.scenario-3 .hud-text,
body.scenario-3 .display-team-name,
body.scenario-3 .turn-indicator,
body.scenario-3 .tactical-btn,
body.scenario-3 .modal-content,
body.scenario-3 .notification-box,
body.scenario-3 .winner-text,
body.scenario-3 .stat-team-name,
body.scenario-3 .score-badge,
body.scenario-3 .alert-banner,
body.scenario-3 .alert-bar,
body.scenario-3 .peao-name {
    font-family: 'Chakra Petch', sans-serif !important;
    letter-spacing: 1.2px;
}

/* 2. OVERLAY DE TELA CONGELADA / LENTE GLACIAL */
/* Posiciona a moldura de gelo atras dos tabuleiros (z-index 2), evitando o aspecto lavado */
.frozen-screen-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 2 !important; /* Estava 8 e cobria o battlefield-container que tem z-index 5 */
    opacity: 0;
    transition: opacity 0.6s ease;
    background-image:
        /* Canto Superior Esquerdo - Cristais e Geada */
        radial-gradient(ellipse at 0% 0%, rgba(200, 245, 255, 0.45) 0%, rgba(140, 220, 255, 0.25) 25%, rgba(0, 243, 255, 0.08) 45%, transparent 65%),
        /* Canto Superior Direito */
        radial-gradient(ellipse at 100% 0%, rgba(200, 245, 255, 0.45) 0%, rgba(140, 220, 255, 0.25) 25%, rgba(0, 243, 255, 0.08) 45%, transparent 65%),
        /* Canto Inferior Esquerdo */
        radial-gradient(ellipse at 0% 100%, rgba(200, 245, 255, 0.45) 0%, rgba(140, 220, 255, 0.25) 25%, rgba(0, 243, 255, 0.08) 45%, transparent 65%),
        /* Canto Inferior Direito */
        radial-gradient(ellipse at 100% 100%, rgba(200, 245, 255, 0.45) 0%, rgba(140, 220, 255, 0.25) 25%, rgba(0, 243, 255, 0.08) 45%, transparent 65%),
        /* Vinhetas sutis de geada nas bordas */
        linear-gradient(to right, rgba(180, 235, 255, 0.12) 0%, transparent 12%, transparent 88%, rgba(180, 235, 255, 0.12) 100%),
        linear-gradient(to bottom, rgba(180, 235, 255, 0.14) 0%, transparent 10%, transparent 90%, rgba(180, 235, 255, 0.14) 100%);
}

body.scenario-3 .frozen-screen-overlay,
.frozen-screen-active {
    opacity: 0.65 !important; /* Reduz para dar nitidez total ao tabuleiro */
}

/* 3. TABULEIRO E CONTRASTE FROST */
body.scenario-3 .fleet-sector .grid-btn {
    background: rgba(3, 16, 28, 0.92) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1px solid rgba(0, 243, 255, 0.45) !important;
    box-shadow: inset 0 0 10px rgba(0, 243, 255, 0.1) !important;
    position: relative;
}

/* Acúmulo de geada nos cantos das células */
body.scenario-3 .fleet-sector .grid-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 0% 0%, rgba(255, 255, 255, 0.14) 0%, transparent 40%),
                radial-gradient(circle at 100% 100%, rgba(255, 255, 255, 0.12) 0%, transparent 35%);
    pointer-events: none;
    border-radius: inherit;
}

body.scenario-3 .fleet-sector .grid-btn:hover:not(.water):not(.miss):not(.destroyed):not(.disabled-lock) {
    border-color: #ffffff !important;
    box-shadow: 0 0 22px rgba(0, 243, 255, 0.7), inset 0 0 15px rgba(255, 255, 255, 0.35) !important;
}

/* 4. CÉLULA CONGELADA REAL (TIRO NA ÁGUA NO CENÁRIO 3) */
body.scenario-3 .grid-btn.water.miss,
.grid-btn.frozen-miss-cell {
    background: linear-gradient(135deg, #e0f7fa 0%, #b2ebf2 20%, #4dd0e1 45%, #00838f 75%, #00364a 100%) !important;
    border: 2px solid #ffffff !important;
    box-shadow: inset 0 0 16px #00f3ff, inset 0 0 8px #ffffff, 0 0 25px rgba(0, 243, 255, 0.85) !important;
    position: relative !important;
    overflow: hidden !important;
    animation: freezeSpreading 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}

@keyframes freezeSpreading {
    0% { transform: scale(0.85); filter: brightness(2.8) drop-shadow(0 0 20px #ffffff); }
    50% { transform: scale(1.05); filter: brightness(1.6) drop-shadow(0 0 25px #00f3ff); }
    100% { transform: scale(1); filter: brightness(1.1); }
}

.frozen-ice-block {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.45) 0%, rgba(0, 243, 255, 0.25) 50%, transparent 80%),
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0px, rgba(255, 255, 255, 0.12) 2px, transparent 2px, transparent 6px);
    animation: fadeInMarker 0.3s ease-out forwards;
}

.ice-frost-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.65) 0%, rgba(255, 255, 255, 0.2) 30%, transparent 60%);
    pointer-events: none;
    animation: frostShimmer 2.5s ease-in-out infinite alternate;
}

@keyframes frostShimmer {
    0% { opacity: 0.7; transform: rotate(0deg); }
    100% { opacity: 1; transform: rotate(5deg); }
}

.ice-crystals-svg {
    width: 92%;
    height: 92%;
    filter: drop-shadow(0 0 8px #00f3ff) drop-shadow(0 0 3px #ffffff);
    animation: crystalPulse 2s ease-in-out infinite alternate;
}

@keyframes crystalPulse {
    0% { transform: scale(0.97); filter: drop-shadow(0 0 6px #00f3ff) drop-shadow(0 0 2px #ffffff); }
    100% { transform: scale(1.03); filter: drop-shadow(0 0 14px #00f3ff) drop-shadow(0 0 6px #ffffff); }
}

/* 5. MODAIS GLACIAIS COM TEXTURA REPETITIVA DE GELO (CENÁRIO 3) */
body.scenario-3 .notification-overlay,
body.scenario-3 .modal-overlay {
    background: rgba(1, 6, 15, 0.8) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
}

body.scenario-3 .notification-box,
body.scenario-3 .sonar-border,
body.scenario-3 .game-over-container,
body.scenario-3 .modal-content {
    background-color: rgba(2, 14, 26, 0.94) !important;
    background-image: 
        /* Textura de Cristais de Gelo / Malha de Geada Geométrica com Opacidade Repetida */
        url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2300f3ff' stroke-width='1' stroke-opacity='0.13'%3E%3Cpath d='M30 0 L60 30 L30 60 L0 30 Z'/%3E%3Cpath d='M30 10 L50 30 L30 50 L10 30 Z' stroke='%23ffffff' stroke-opacity='0.1'/%3E%3Cline x1='0' y1='0' x2='60' y2='60' stroke-opacity='0.08'/%3E%3Cline x1='60' y1='0' x2='0' y2='60' stroke-opacity='0.08'/%3E%3Ccircle cx='30' cy='30' r='6' stroke='%23e0f7fa' stroke-opacity='0.15'/%3E%3C/g%3E%3C/svg%3E"),
        /* Gradiente Glacial Profundo */
        linear-gradient(135deg, rgba(8, 38, 62, 0.85) 0%, rgba(2, 14, 26, 0.96) 60%, rgba(0, 20, 36, 0.98) 100%) !important;
    background-repeat: repeat, no-repeat !important;
    background-size: 60px 60px, cover !important;
    border: 1.5px solid rgba(180, 240, 255, 0.45) !important;
    box-shadow: inset 0 0 25px rgba(0, 243, 255, 0.15), 0 0 40px rgba(0, 0, 0, 0.95) !important;
    border-radius: 14px;
}

body.scenario-3 .option-btn {
    background-color: rgba(4, 20, 36, 0.85) !important;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0 L40 20 L20 40 L0 20 Z' fill='none' stroke='%2300f3ff' stroke-width='0.8' stroke-opacity='0.1'/%3E%3C/svg%3E") !important;
    background-repeat: repeat !important;
    border: 1px solid rgba(180, 240, 255, 0.35) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-radius: 6px;
    transition: all 0.2s ease;
}

body.scenario-3 .option-btn:hover:not(:disabled) {
    background: var(--active-color, #00f3ff) !important;
    color: #000000 !important;
    font-weight: bold;
    box-shadow: 0 0 18px var(--active-color, #00f3ff) !important;
    border-color: var(--active-color, #00f3ff) !important;
}

body.scenario-3 .sonar-row-btn {
    background-color: rgba(4, 20, 36, 0.85) !important;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0 L40 20 L20 40 L0 20 Z' fill='none' stroke='%2300f3ff' stroke-width='0.8' stroke-opacity='0.1'/%3E%3C/svg%3E") !important;
    background-repeat: repeat !important;
    border: 1px solid var(--active-color, #00f3ff) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    border-radius: 6px;
}

body.scenario-3 .team-stat-card {
    background-color: rgba(4, 20, 36, 0.85) !important;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M20 0 L40 20 L20 40 L0 20 Z' fill='none' stroke='%2300f3ff' stroke-width='0.8' stroke-opacity='0.1'/%3E%3C/svg%3E") !important;
    background-repeat: repeat !important;
    border: 1px solid rgba(180, 240, 255, 0.35) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: 12px;
}

body.scenario-3 .team-stat-card.winner-card {
    background: linear-gradient(180deg, rgba(0, 243, 255, 0.2) 0%, rgba(2, 14, 26, 0.95) 100%) !important;
    border: 2px solid var(--accent-gold, #ffb700) !important;
}

/* 6. CHOQUE TÉRMICO: PLUMA DE VAPOR BRANCO/CINZA-CLARO DENSO & GEADA NOS NAVIOS */
body.scenario-3 .ship-cell-graphic svg {
    filter: drop-shadow(0 0 4px rgba(0, 243, 255, 0.55)) drop-shadow(2px 6px 4px rgba(0, 0, 0, 0.85)) !important;
}

body.scenario-3 .particle.smoke,
.particle.smoke.frost-steam {
    background: radial-gradient(circle, #ffffff 20%, #e2e8f0 50%, #bae6fd 75%, transparent 100%) !important;
    width: 28px !important;
    height: 28px !important;
    filter: blur(3px) !important;
    opacity: 0;
    animation: frost-steam-rise 1.5s cubic-bezier(0.2, 0.8, 0.3, 1) infinite !important;
}

@keyframes frost-steam-rise {
    0% { transform: translateY(0) scale(0.9) translateX(0); opacity: 0.95; }
    35% { opacity: 0.85; transform: translateY(-22px) scale(1.9) translateX(4px); }
    70% { opacity: 0.5; transform: translateY(-45px) scale(2.8) translateX(10px); }
    100% { transform: translateY(-68px) scale(3.6) translateX(18px); opacity: 0; }
}

/* ==========================================================================
   ESTILIZAÇÃO INTEGRAL - CENÁRIOS 4 E 5: OPERAÇÕES TERRESTRES & BASE MILITAR
   ========================================================================== */

/* 1. TABULEIROS E CONTRASTE NO CENARIO 4 (DESERTO) */
body.scenario-4 .fleet-sector .grid-btn {
    background: rgba(22, 16, 10, 0.9) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1.5px solid rgba(255, 170, 0, 0.45) !important;
    box-shadow: inset 0 0 14px rgba(255, 153, 0, 0.08), 0 0 16px rgba(0, 0, 0, 0.8) !important;
    position: relative;
}

body.scenario-4 .fleet-sector .grid-btn:hover:not(.water):not(.miss):not(.destroyed):not(.disabled-lock) {
    border-color: #ffaa00 !important;
    box-shadow: 0 0 20px rgba(255, 170, 0, 0.7), inset 0 0 14px rgba(255, 200, 0, 0.3) !important;
}

/* 4. RADAR DO SONAR NO CENARIO 4 (DESERTO) */
/* Reativa o radar cobrindo todo o setor como nos outros cenarios */
body.scenario-4 .fleet-sector > .sonar-sweep {
    display: block !important;
}

/* Desativa o feixe atras dos botoes */
body.scenario-4 .cells-container::before {
    display: none !important;
}

body.scenario-4 .team-blue .sonar-sweep {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 280deg,
        rgba(0, 229, 255, 0.15) 330deg,
        var(--color-blue, #00e5ff) 360deg
    ) !important;
}

body.scenario-4 .team-red .sonar-sweep {
    background: conic-gradient(
        from 0deg,
        transparent 0deg,
        transparent 280deg,
        color-mix(in srgb, var(--color-red, #ff3333) 15%, transparent) 330deg,
        var(--color-red, #ff3333) 360deg
    ) !important;
}

body.scenario-4 .battle-grid {
    position: relative !important;
    overflow: visible !important;
}

body.scenario-4 .cells-container {
    position: relative !important;
    overflow: hidden !important;
    border-radius: 8px !important;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.85), inset 0 0 15px rgba(255, 170, 0, 0.08) !important;
}

body.scenario-4 .cells-container .grid-btn {
    position: relative !important;
    z-index: 1 !important;
}

/* ==========================================================================
   CENÁRIO 4: IDENTIDADE VISUAL COMPLETA — DESERTO TÁTICO / EGÍPCIO
   ========================================================================== */

/* 1. TIPOGRAFIA TÁTICA EXCLUSIVA DO CENÁRIO 4 (ORBITRON) */
body.scenario-4,
body.scenario-4 h1,
body.scenario-4 h2,
body.scenario-4 h3,
body.scenario-4 .header-title,
body.scenario-4 .fleet-title,
body.scenario-4 .brand-title,
body.scenario-4 .status-label,
body.scenario-4 .hud-text,
body.scenario-4 .display-team-name,
body.scenario-4 .turn-indicator,
body.scenario-4 .tactical-btn,
body.scenario-4 .notification-box,
body.scenario-4 .score-display,
body.scenario-4 .alert-banner,
body.scenario-4 .alert-bar,
body.scenario-4 .peao-name,
body.scenario-4 .nav-btn,
body.scenario-4 .perk-btn,
body.scenario-4 #display-name-blue,
body.scenario-4 #display-name-red,
body.scenario-4 .stat-team-name {
    font-family: 'Orbitron', 'Chakra Petch', sans-serif !important;
    letter-spacing: 1.5px !important;
}

/* 2. HEADER SUPERIOR — BORDA E FUNDO ÂMBAR VULCÂNICO */
body.scenario-4 .radar-header {
    border-bottom: 2px solid rgba(255, 170, 0, 0.55) !important;
    background: rgba(16, 8, 3, 0.88) !important;
    box-shadow: 0 2px 20px rgba(255, 120, 0, 0.18) !important;
}

/* 3. TÍTULO "BATALHA NAVAL" — COR ÂMBAR INCANDESCENTE */
body.scenario-4 .header-title {
    color: #ffaa00 !important;
    text-shadow: 0 0 10px rgba(255, 170, 0, 0.4), 0 0 24px rgba(255, 100, 0, 0.2) !important;
}

/* 4. BOTÕES SUPERIORES (VOLTAR / TELA CHEIA) — ESTILO ÂMBAR MILITAR */
body.scenario-4 .nav-btn {
    background: rgba(20, 10, 5, 0.85) !important;
    border: 1px solid rgba(255, 170, 0, 0.4) !important;
    color: #ffaa00 !important;
    text-shadow: 0 0 6px rgba(255, 170, 0, 0.3) !important;
    box-shadow: none !important;
}

body.scenario-4 .nav-btn:hover {
    background: rgba(255, 170, 0, 0.18) !important;
    border-color: #ffaa00 !important;
    color: #ffcc44 !important;
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.4) !important;
}

/* 5. CONTADORES DO HUD COM ALTO CONTRASTE (PÍLULA ESCURA TRANSLÚCIDA + DOURADO EGÍPCIO) */
body.scenario-4 #display-name-blue,
body.scenario-4 #display-name-red {
    font-size: 1.25rem !important;
}

body.scenario-4 .score-display {
    background: rgba(20, 12, 5, 0.85) !important;
    padding: 4px 12px !important;
    border-radius: 6px !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    color: #ffffff !important;
    display: inline-block !important;
    margin: 4px auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6) !important;
    letter-spacing: 0.8px !important;
}

body.scenario-4 .score-display span,
body.scenario-4 #destroyed-blue,
body.scenario-4 #left-red,
body.scenario-4 #destroyed-red,
body.scenario-4 #left-blue,
body.scenario-4 .highlight-blue,
body.scenario-4 .highlight-red,
body.scenario-4 .highlight-neutral {
    color: #e5b842 !important;
    text-shadow: 1px 1px 3px #000000, 0 0 6px rgba(229, 184, 66, 0.4) !important;
    font-weight: bold !important;
}

/* 6. MODAIS COM TEMA DESERTO / HIERÓGLIFOS EGÍPCIOS ANTIGOS */
body.scenario-4 .notification-overlay,
body.scenario-4 .modal-overlay {
    background: rgba(12, 6, 2, 0.82) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

body.scenario-4 .notification-box,
body.scenario-4 .sonar-border,
body.scenario-4 .game-over-container {
    background-color: rgba(25, 15, 8, 0.96) !important;
    background-image: 
        radial-gradient(ellipse at 50% 25%, rgba(212, 175, 55, 0.09) 0%, transparent 75%),
        url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%23d4af37' stroke-width='1.2' stroke-opacity='0.08'%3E%3Cpath d='M45 8 L58 26 L32 26 Z'/%3E%3Ccircle cx='45' cy='18' r='5'/%3E%3Cpath d='M45 32 L45 52 M35 40 L55 40'/%3E%3Cpath d='M12 12 L24 24 M78 12 L66 24 M12 78 L24 66 M78 78 L66 66'/%3E%3Cpath d='M10 45 Q22 35 35 45 T60 45 T80 45'/%3E%3Ccircle cx='45' cy='45' r='2.5' fill='%23d4af37' fill-opacity='0.08'/%3E%3Cpath d='M25 76 L45 64 L65 76'/%3E%3Cpath d='M18 55 L28 55 L23 45 Z'/%3E%3Cpath d='M62 55 L72 55 L67 45 Z'/%3E%3C/g%3E%3C/svg%3E") !important;
    background-repeat: repeat !important;
    border: 2px solid #d4af37 !important;
    outline: 1px solid #8a6d27 !important;
    outline-offset: -5px !important;
    box-shadow: 0 0 25px rgba(212, 175, 55, 0.25), inset 0 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 8px !important;
    position: relative !important;
}

/* Detalhes de Canto Ornamentais (Hieróglifos / Relíquias) */
body.scenario-4 .notification-box::before,
body.scenario-4 .sonar-border::before,
body.scenario-4 .game-over-container::before {
    content: '◈' !important;
    position: absolute !important;
    top: 4px !important;
    left: 8px !important;
    color: #e5b842 !important;
    font-size: 15px !important;
    text-shadow: 0 0 8px rgba(229, 184, 66, 0.8) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

body.scenario-4 .notification-box::after,
body.scenario-4 .sonar-border::after,
body.scenario-4 .game-over-container::after {
    content: '◈' !important;
    position: absolute !important;
    top: 4px !important;
    right: 8px !important;
    color: #e5b842 !important;
    font-size: 15px !important;
    text-shadow: 0 0 8px rgba(229, 184, 66, 0.8) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

/* Banners de Alerta e Faixas Superiores dos Modais */
body.scenario-4 .alert-banner,
body.scenario-4 .alert-bar,
body.scenario-4 .alert-bar-info {
    background: linear-gradient(90deg, #38200b 0%, #684115 50%, #38200b 100%) !important;
    color: #f5d77f !important;
    border-top: 1px solid #d4af37 !important;
    border-bottom: 1px solid #d4af37 !important;
    text-shadow: 0 0 8px rgba(245, 215, 127, 0.5), 1px 1px 2px #000000 !important;
    font-weight: 700 !important;
    letter-spacing: 1.5px !important;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.65) !important;
}

body.scenario-4 .alert-banner.critical-red {
    background: linear-gradient(90deg, #4d1508 0%, #7a220c 50%, #4d1508 100%) !important;
    color: #ffc4b2 !important;
    border-color: #ff5522 !important;
}

/* Textos e Títulos dos Modais */
body.scenario-4 #notification-body,
body.scenario-4 .alert-message,
body.scenario-4 #question-text,
body.scenario-4 .winner-reason {
    color: #ffffff !important;
    text-shadow: 1px 1px 3px #000000 !important;
    font-weight: 600 !important;
}

body.scenario-4 .timer-box {
    color: #e5b842 !important;
    text-shadow: 0 0 8px rgba(229, 184, 66, 0.4) !important;
}

body.scenario-4 #timer-display {
    color: #ffffff !important;
    text-shadow: 0 0 10px #e5b842, 1px 1px 2px #000000 !important;
}

/* Botões dos Modais */
body.scenario-4 .option-btn,
body.scenario-4 .tactical-btn,
body.scenario-4 .sonar-row-btn,
body.scenario-4 .perk-modal-btn,
body.scenario-4 .victory-btn {
    background: rgba(35, 20, 10, 0.9) !important;
    border: 1.5px solid #d4af37 !important;
    color: #f5d77f !important;
    text-shadow: 0 0 4px rgba(245, 215, 127, 0.3) !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}

body.scenario-4 .option-btn:hover:not(:disabled),
body.scenario-4 .tactical-btn:hover:not(:disabled),
body.scenario-4 .sonar-row-btn:hover:not(:disabled),
body.scenario-4 .perk-modal-btn:hover:not(:disabled),
body.scenario-4 .victory-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #d4af37 0%, #a67c1e 100%) !important;
    color: #120a04 !important;
    border-color: #f5d77f !important;
    font-weight: 800 !important;
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.7), inset 0 0 8px rgba(255, 255, 255, 0.4) !important;
    text-shadow: none !important;
}

body.scenario-4 .secondary-btn {
    border-color: #8a6d27 !important;
    color: #c4a868 !important;
    background: rgba(25, 15, 8, 0.85) !important;
}

body.scenario-4 .secondary-btn:hover {
    background: #5c3e14 !important;
    color: #ffffff !important;
    border-color: #d4af37 !important;
}

/* Modal de Fim de Jogo */
body.scenario-4 .team-stat-card {
    background: rgba(30, 18, 9, 0.9) !important;
    border: 1px solid #8a6d27 !important;
    border-radius: 8px !important;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.6) !important;
}

body.scenario-4 .team-stat-card.winner-card {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.15) 0%, rgba(30, 18, 9, 0.92) 100%) !important;
    border: 2px solid #d4af37 !important;
    box-shadow: 0 0 18px rgba(212, 175, 55, 0.3), inset 0 0 20px rgba(0, 0, 0, 0.7) !important;
}

body.scenario-4 .stat-team-name {
    color: #e5b842 !important;
    text-shadow: 0 0 8px rgba(229, 184, 66, 0.5) !important;
}

body.scenario-4 .stat-label {
    color: #d0b896 !important;
}

body.scenario-4 .stat-val {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px #000000 !important;
}

body.scenario-4 .highlight-stat {
    color: #e5b842 !important;
    text-shadow: 0 0 8px rgba(229, 184, 66, 0.6) !important;
}

body.scenario-4 .winner-badge {
    background: rgba(212, 175, 55, 0.2) !important;
    border: 1px solid #d4af37 !important;
    color: #f5d77f !important;
    text-shadow: 0 0 6px rgba(245, 215, 127, 0.4) !important;
}

body.scenario-4 #winner-text {
    color: #f5d77f !important;
    text-shadow: 0 0 18px rgba(212, 175, 55, 0.8), 0 0 30px rgba(229, 184, 66, 0.4), 2px 2px 4px #000000 !important;
}

/* 7. BRASAS / POEIRA FLUTUANTE ÂMBAR DO CENÁRIO 4 */
.ember-dust {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(1.5px);
    animation: ember-float-up 1.4s ease-in forwards;
    z-index: 3;
}

@keyframes ember-float-up {
    0%   { transform: translateY(0) translateX(0) scale(1);   opacity: 0.85; }
    40%  { transform: translateY(-18px) translateX(6px) scale(0.9); opacity: 0.6; }
    100% { transform: translateY(-50px) translateX(-8px) scale(0.4); opacity: 0; }
}

/* Fumaça de Combustão de Veículo Terrestre (Castanho Escuro) */
body.scenario-4 .particle.smoke,
body.scenario-5 .particle.smoke {
    background: radial-gradient(circle, #1a1005 10%, #2a1a08 45%, #3c2510 75%, transparent 100%) !important;
    width: 22px !important;
    height: 22px !important;
    filter: blur(2.8px) !important;
    opacity: 0;
    animation: smoke-rise 1.6s cubic-bezier(0.2, 0.8, 0.3, 1) infinite !important;
}

/* Fogo mais cálido nos veículos terrestres */
body.scenario-4 .particle.fire,
body.scenario-5 .particle.fire {
    background: #ff6600 !important;
    box-shadow: 0 0 10px #ff3300 !important;
    width: 10px !important;
    height: 10px !important;
}

/* ==========================================================================
   ESTILIZAÇÃO INTEGRAL - CENÁRIO 5: OPERAÇÃO SELVA FECHADA
   ========================================================================== */

/* 1. TIPOGRAFIA MILITAR TÁTICA DO CENÁRIO 5 */
body.scenario-5,
.cenario-5,
body.scenario-5 h1,
body.scenario-5 h2,
body.scenario-5 h3,
body.scenario-5 .header-title,
body.scenario-5 .fleet-title,
body.scenario-5 .brand-title,
body.scenario-5 .status-label,
body.scenario-5 .hud-text,
body.scenario-5 .display-team-name,
body.scenario-5 .turn-indicator,
body.scenario-5 .tactical-btn,
body.scenario-5 .modal-content,
body.scenario-5 .notification-box,
body.scenario-5 .score-display,
body.scenario-5 .alert-banner,
body.scenario-5 .alert-bar,
body.scenario-5 .peao-name,
body.scenario-5 .nav-btn,
body.scenario-5 .perk-btn,
body.scenario-5 #display-name-blue,
body.scenario-5 #display-name-red,
body.scenario-5 .stat-team-name {
    font-family: 'Share Tech Mono', 'Courier New', monospace !important;
    letter-spacing: 1px !important;
}

/* 2. HEADER SUPERIOR — VERDE MILITAR CAMUFLADO */
body.scenario-5 .radar-header {
    border-bottom: 2px solid rgba(0, 255, 136, 0.45) !important;
    background: rgba(10, 20, 12, 0.9) !important;
    box-shadow: 0 2px 20px rgba(0, 255, 136, 0.15) !important;
}

body.scenario-5 .header-title {
    color: #00ff88 !important;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5), 0 0 22px rgba(0, 255, 136, 0.25) !important;
}

body.scenario-5 .nav-btn {
    background: rgba(12, 24, 15, 0.85) !important;
    border: 1px solid rgba(0, 255, 136, 0.4) !important;
    color: #a3e635 !important;
    text-shadow: 0 0 6px rgba(163, 230, 53, 0.35) !important;
}

body.scenario-5 .nav-btn:hover {
    background: rgba(0, 255, 136, 0.18) !important;
    border-color: #00ff88 !important;
    color: #00ff88 !important;
    box-shadow: 0 0 12px rgba(0, 255, 136, 0.4) !important;
}

/* 3. CONTADORES DO HUD (PÍLULA ESCURA DE SELVA + VERDE ESMERALDA / VERDE LIMA TÁTICO) */
body.scenario-5 #display-name-blue,
body.scenario-5 #display-name-red {
    font-size: 1.25rem !important;
}

body.scenario-5 .score-display {
    background: rgba(10, 20, 12, 0.85) !important;
    border: 1px solid rgba(0, 255, 136, 0.3) !important;
    border-radius: 6px !important;
    padding: 4px 10px !important;
    color: #ffffff !important;
    display: inline-block !important;
    margin: 4px auto !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6) !important;
    letter-spacing: 0.8px !important;
}

body.scenario-5 .score-display span,
body.scenario-5 #destroyed-blue,
body.scenario-5 #left-red,
body.scenario-5 #destroyed-red,
body.scenario-5 #left-blue,
body.scenario-5 .highlight-blue,
body.scenario-5 .highlight-red,
body.scenario-5 .highlight-neutral {
    color: #00ff88 !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5), 1px 1px 2px #000000 !important;
    font-weight: bold !important;
}

/* 4. TABULEIROS E CONTRASTE NO CENARIO 5 */
body.scenario-5 .fleet-sector .grid-btn {
    background: rgba(10, 20, 12, 0.9) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: 1.5px solid rgba(0, 255, 136, 0.4) !important;
    box-shadow: inset 0 0 14px rgba(0, 255, 136, 0.05), 0 0 16px rgba(0, 0, 0, 0.8) !important;
    position: relative;
}

body.scenario-5 .fleet-sector .grid-btn:hover:not(.water):not(.miss):not(.destroyed):not(.disabled-lock) {
    border-color: #00ff88 !important;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.6), inset 0 0 14px rgba(0, 255, 136, 0.25) !important;
}

/* IMPACTO DE TIRO NO SOLO / BURACO DE BOMBA NO TERRENO (CENÁRIOS 4 E 5) */
body.scenario-4 .grid-btn.water.miss,
body.scenario-5 .grid-btn.water.miss,
.grid-btn.ground-miss-cell {
    background: radial-gradient(circle at 50% 50%, #030202 0%, #0c0805 45%, #18100a 75%, rgba(20, 14, 9, 0.95) 100%) !important;
    border: 1.5px solid #2a180e !important;
    box-shadow: inset 0 0 18px #000000, 0 0 10px rgba(0, 0, 0, 0.9) !important;
    position: relative !important;
    overflow: hidden !important;
    cursor: not-allowed !important;
}

.bomb-crater-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    animation: craterBlastPop 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes craterBlastPop {
    0% { transform: scale(0.3); opacity: 0; }
    70% { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.bomb-crater-svg {
    width: 92%;
    height: 92%;
    filter: drop-shadow(0 0 6px #000000);
}

/* 5. MODAIS NO CENÁRIO 5 (TERMINAL MILITAR DE CAMPANHA) */
body.scenario-5 .notification-overlay,
body.scenario-5 .modal-overlay {
    background: rgba(6, 12, 8, 0.82) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
}

body.scenario-5 .notification-box,
body.scenario-5 .sonar-border,
body.scenario-5 .game-over-container {
    background-color: rgba(12, 22, 14, 0.96) !important;
    background-image: 
        radial-gradient(ellipse at 50% 25%, rgba(0, 255, 136, 0.08) 0%, transparent 75%),
        url("data:image/svg+xml,%3Csvg width='90' height='90' viewBox='0 0 90 90' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%2300ff88' stroke-width='1.2' stroke-opacity='0.085'%3E%3Cpath d='M45 10 Q65 25 45 45 Q25 25 45 10 Z'/%3E%3Cpath d='M45 10 L45 45 M38 22 Q45 28 52 22 M34 32 Q45 38 56 32'/%3E%3Cpath d='M15 65 Q25 50 35 65 Q25 80 15 65 Z'/%3E%3Cline x1='15' y1='65' x2='35' y2='65'/%3E%3Cpath d='M75 65 Q65 50 55 65 Q65 80 75 65 Z'/%3E%3Cline x1='75' y1='65' x2='55' y2='65'/%3E%3Ccircle cx='45' cy='68' r='3' fill='%2300ff88' fill-opacity='0.06'/%3E%3Cpath d='M20 20 Q10 35 25 40'/%3E%3Cpath d='M70 20 Q80 35 65 40'/%3E%3Cpath d='M35 80 Q45 72 55 80'/%3E%3C/g%3E%3C/svg%3E") !important;
    background-repeat: repeat !important;
    border: 2px solid #00ff88 !important;
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.25), inset 0 0 35px rgba(0, 0, 0, 0.85) !important;
    border-radius: 10px !important;
    position: relative !important;
}

/* Detalhes de Canto Ornamentais Táticos de Selva */
body.scenario-5 .notification-box::before,
body.scenario-5 .sonar-border::before {
    content: '' !important;
    position: absolute !important;
    top: 6px !important;
    left: 8px !important;
    width: 14px !important;
    height: 14px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300ff88'%3E%3Cpath d='M17 8C8 10 5.9 16.17 3.82 21.34L5.71 22l1-2.3A4.49 4.49 0 0 0 8 20C19 20 22 3 22 3c-1 2-8 2.25-13 3.25S2 11.5 2 13.5s1.75 3.75 1.75 3.75C7 8 17 8 17 8z'/%3E%3C/svg%3E") no-repeat center / contain !important;
    filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.7)) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

body.scenario-5 .notification-box::after,
body.scenario-5 .sonar-border::after {
    content: '' !important;
    position: absolute !important;
    top: 6px !important;
    right: 8px !important;
    width: 14px !important;
    height: 14px !important;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2300ff88'%3E%3Cpath d='M17 8C8 10 5.9 16.17 3.82 21.34L5.71 22l1-2.3A4.49 4.49 0 0 0 8 20C19 20 22 3 22 3c-1 2-8 2.25-13 3.25S2 11.5 2 13.5s1.75 3.75 1.75 3.75C7 8 17 8 17 8z'/%3E%3C/svg%3E") no-repeat center / contain !important;
    transform: scaleX(-1) !important;
    filter: drop-shadow(0 0 6px rgba(0, 255, 136, 0.7)) !important;
    pointer-events: none !important;
    z-index: 10 !important;
}

/* Banners e Faixas Superiores dos Modais */
body.scenario-5 .alert-banner,
body.scenario-5 .alert-bar,
body.scenario-5 .alert-bar-info {
    background: linear-gradient(90deg, #102916 0%, #1e4a28 50%, #102916 100%) !important;
    color: #a3e635 !important;
    border-top: 1px solid #00ff88 !important;
    border-bottom: 1px solid #00ff88 !important;
    text-shadow: 0 0 8px rgba(163, 230, 53, 0.6), 1px 1px 2px #000000 !important;
    font-weight: 700 !important;
    letter-spacing: 1.2px !important;
}

body.scenario-5 .alert-banner.critical-red {
    background: linear-gradient(90deg, #4d1508 0%, #7a220c 50%, #4d1508 100%) !important;
    color: #ffc4b2 !important;
    border-color: #ff5522 !important;
}

/* Textos e Títulos dos Modais */
body.scenario-5 #notification-body,
body.scenario-5 .alert-message,
body.scenario-5 #question-text,
body.scenario-5 .winner-reason {
    color: #ffffff !important;
    text-shadow: 1px 1px 2px #000000 !important;
}

body.scenario-5 .timer-box {
    color: #a3e635 !important;
    text-shadow: 0 0 8px rgba(163, 230, 53, 0.5) !important;
}

body.scenario-5 #timer-display {
    color: #00ff88 !important;
    text-shadow: 0 0 10px #00ff88, 1px 1px 2px #000000 !important;
}

/* Botões dos Modais */
body.scenario-5 .option-btn,
body.scenario-5 .tactical-btn,
body.scenario-5 .sonar-row-btn,
body.scenario-5 .perk-modal-btn,
body.scenario-5 .victory-btn {
    background: rgba(16, 30, 18, 0.9) !important;
    border: 1.5px solid rgba(0, 255, 136, 0.55) !important;
    color: #a3e635 !important;
    text-shadow: 0 0 4px rgba(163, 230, 53, 0.35) !important;
    border-radius: 6px !important;
    transition: all 0.2s ease !important;
}

body.scenario-5 .option-btn:hover:not(:disabled),
body.scenario-5 .tactical-btn:hover:not(:disabled),
body.scenario-5 .sonar-row-btn:hover:not(:disabled),
body.scenario-5 .perk-modal-btn:hover:not(:disabled),
body.scenario-5 .victory-btn:hover:not(:disabled) {
    background: #00ff88 !important;
    color: #05140a !important;
    border-color: #a3e635 !important;
    font-weight: 800 !important;
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.7) !important;
    text-shadow: none !important;
}

body.scenario-5 .secondary-btn {
    border-color: #2e5a36 !important;
    color: #8bb394 !important;
    background: rgba(14, 26, 16, 0.85) !important;
}

body.scenario-5 .secondary-btn:hover {
    background: #23472a !important;
    color: #ffffff !important;
    border-color: #00ff88 !important;
}

/* Modal de Fim de Jogo */
body.scenario-5 .team-stat-card {
    background: rgba(14, 26, 16, 0.9) !important;
    border: 1px solid rgba(0, 255, 136, 0.3) !important;
    border-radius: 8px !important;
}

body.scenario-5 .team-stat-card.winner-card {
    background: linear-gradient(180deg, rgba(0, 255, 136, 0.12) 0%, rgba(14, 26, 16, 0.92) 100%) !important;
    border: 2px solid #00ff88 !important;
    box-shadow: 0 0 18px rgba(0, 255, 136, 0.3) !important;
}

body.scenario-5 .stat-team-name {
    color: #00ff88 !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.5) !important;
}

body.scenario-5 .stat-label {
    color: #9ebba3 !important;
}

body.scenario-5 .stat-val {
    color: #ffffff !important;
}

body.scenario-5 .highlight-stat {
    color: #00ff88 !important;
    text-shadow: 0 0 8px rgba(0, 255, 136, 0.6) !important;
}

body.scenario-5 .winner-badge {
    background: rgba(0, 255, 136, 0.15) !important;
    border: 1px solid #00ff88 !important;
    color: #00ff88 !important;
}

body.scenario-5 #winner-text {
    color: #00ff88 !important;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.8), 0 0 35px rgba(163, 230, 53, 0.4) !important;
}

/* ==========================================================================
   1. OVERLAY DE ORIENTAÇÃO (EXIBIDO APENAS SE O CELULAR ESTIVER EM PÉ)
   ========================================================================== */
.rotate-device-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: radial-gradient(circle at center, #001524 0%, #00040a 100%);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.rotate-device-box {
    text-align: center;
    max-width: 320px;
    border: 1.5px solid #00ff41;
    background: rgba(0, 20, 10, 0.92);
    border-radius: 12px;
    padding: 28px 20px;
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.25), inset 0 0 15px rgba(0, 255, 65, 0.1);
}

.rotate-device-icon {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 16px;
    animation: rotatePhoneAnim 2.2s ease-in-out infinite;
    display: inline-block;
}

@keyframes rotatePhoneAnim {
    0%, 20% { transform: rotate(0deg); }
    50%, 70% { transform: rotate(90deg); }
    90%, 100% { transform: rotate(0deg); }
}

.rotate-device-title {
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    font-size: 1.2rem;
    font-weight: 800;
    color: #00ff41;
    letter-spacing: 2px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #00ff41;
}

.rotate-device-desc {
    font-size: 0.88rem;
    color: #cbd5e1;
    line-height: 1.45;
}

/* Ativa o overlay exclusivamente quando a tela estiver em modo retrato */
@media screen and (orientation: portrait) {
    .rotate-device-overlay {
        display: flex !important;
    }
}

/* ==========================================================================
   2. AJUSTE DE MODAIS NO CELULAR EM PAISAGEM (ALTURA LIMITADA <= 520px)
   ========================================================================== */
@media screen and (orientation: landscape) and (max-height: 520px) {

    /* 1. BARRA SUPERIOR DO JOGO (Batalha Tatica / Voltar / Tela Cheia) */
    /* Reduz de ~48px para ~26px de altura total sem alterar elementos */
    .radar-header {
        padding: 3px 12px !important;
        border-bottom-width: 1.5px !important;
    }

    .header-title {
        font-size: 0.85rem !important;
        letter-spacing: 1px !important;
    }

    .nav-btn {
        padding: 3px 8px !important;
        font-size: 0.72rem !important;
    }

    /* 2. ESPACAMENTO DO SETOR DE COMBATE */
    .sector-content {
        padding: 2px 8px 4px 8px !important;
    }

    .panel-info {
        margin-bottom: 2px !important;
    }

    /* 3. LINHA 1: NOME DA FROTA (Mantido em linha propria) */
    .team-blue h2, 
    .team-red h2 {
        font-size: 0.88rem !important;
        margin: 0 !important;
        line-height: 1.15 !important;
    }

    /* 4. LINHA 2: CONTADOR DE NAVIOS / PLACAR (Mantido em linha propria) */
    .score-display {
        font-size: 0.72rem !important;
        margin: 1px 0 !important;
        line-height: 1.1 !important;
    }

    .highlight-blue,
    .highlight-red,
    .highlight-neutral {
        font-size: 0.85rem !important;
    }

    /* 5. LINHA 3: BARRA DE POWER-UPS (Mantida em linha propria, confortavel para ate 3 botoes) */
    .perks-bar {
        margin: 2px auto !important;
        gap: 5px !important;
    }

    .perk-btn {
        padding: 2px 7px !important;
        font-size: 0.68rem !important;
        min-height: 22px !important;
        border-radius: 4px !important;
        letter-spacing: 0.2px !important;
    }

    /* 6. LINHA 4: INDICADOR DE TURNO (Mantido em linha propria) */
    .turn-indicator {
        font-size: 0.68rem !important;
        padding: 2px 10px !important;
        margin-top: 2px !important;
        letter-spacing: 0.5px !important;
        line-height: 1.2 !important;
        border-radius: 3px !important;
    }

    /* 7. EXPANSÃO DA GRADE DE COMBATE (DE 58vh PARA ATE 72vh) */
    .grid-wrapper {
        flex: 1 !important;
        /* Encurta o espaco morto em volta das coordenadas A-J e 1-10 */
        padding: 18px 6px 4px 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        min-height: 0 !important;
    }

    .battle-grid {
        /* Permite a grade crescer ate 70vh no 5x5 e 7x7 */
        width: 100% !important;
        max-width: min(96%, 70vh) !important;
        height: min(96%, 70vh) !important;
        margin: auto !important;
    }

    /* 8. AMPLIACAO ESPECIFICA PARA QUANDO A GRADE FOR 10x10 */
    /* Garante maxima area de toque quando houver 10 colunas e 10 linhas */
    .cells-container[style*="repeat(10,"] {
        gap: 2px !important; /* Espaco menor entre botoes para dar mais corpo a cada celula */
    }

    .battlefield-container:has(.cells-container[style*="repeat(10,"]) .battle-grid,
    body:has(.cells-container[style*="repeat(10,"]) .battle-grid {
        max-width: min(98%, 73vh) !important;
        height: min(98%, 73vh) !important;
    }

    /* Ajuste de escala para as letras (A-J) e numeros (1-10) ocuparem menos borda */
    .col-headers {
        top: -16px !important;
        height: 14px !important;
    }

    .row-headers {
        left: -18px !important;
        width: 14px !important;
    }

    .header-cell,
    .cell.header-cell {
        font-size: 0.68rem !important;
    }

    .cell {
        /* Calibra o texto/icone interno da celula para telas menores */
        font-size: calc(1.1rem - (var(--grid-size, 5) - 5) * 0.05rem) !important;
    }

    /* 1.1 Elimina o custo de processamento de desfoque continuo em mobile */
    .radar-header,
    .fleet-sector,
    .grid-btn,
    .modal-content,
    .sonar-border,
    .notification-box,
    .team-stat-card {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .sonar-sweep {
        will-change: opacity;
    }

    .active-turn .sonar-sweep {
        opacity: 0.25 !important;
    }

    /* Garante que o overlay acomode o modal com margem de segurança */
    .modal-overlay,
    .notification-overlay {
        padding: 8px 12px !important;
        align-items: center !important;
        justify-content: center !important;
        overflow-y: auto !important;
    }

    /* Modal de Perguntas compacto e rolável se necessário */
    .sonar-border {
        width: 95vw !important;
        max-width: 820px !important;
        max-height: 94dvh !important;
        max-height: 94vh !important;
        padding: 12px 18px !important;
        overflow-y: auto !important;
        display: flex !important;
        flex-direction: column !important;
        box-sizing: border-box !important;
    }

    /* Barra de rolagem discreta e temática para o modal */
    .sonar-border::-webkit-scrollbar {
        width: 4px;
    }
    .sonar-border::-webkit-scrollbar-thumb {
        background: #00ff41;
        border-radius: 4px;
    }

    /* Barra superior de alerta */
    .alert-bar,
    #question-alert-bar {
        padding: 4px 10px !important;
        font-size: 0.78rem !important;
        margin-bottom: 6px !important;
        letter-spacing: 1px !important;
    }

    /* Caixa de Cronômetro */
    .timer-box {
        font-size: 0.82rem !important;
        margin-bottom: 6px !important;
    }

    #timer-display {
        font-size: 1.25rem !important;
    }

    /* Enunciado da questão */
    #question-text {
        font-size: 0.92rem !important;
        line-height: 1.35 !important;
        margin-bottom: 8px !important;
    }

    /* Alternativas em layout compacto e direto */
    .options-layout {
        gap: 6px !important;
    }

    .option-btn {
        padding: 7px 12px !important;
        font-size: 0.82rem !important;
        line-height: 1.3 !important;
        min-height: 36px !important;
    }

    /* Caixa de Vantagens Táticas/Power-ups da Pergunta (100% visível na tela) */
    .question-perk-box,
    #question-perk-container {
        margin-top: 8px !important;
        padding-top: 8px !important;
        gap: 8px !important;
        display: flex !important;
        justify-content: center !important;
        flex-wrap: wrap !important;
    }

    .perk-modal-btn {
        padding: 6px 14px !important;
        font-size: 0.78rem !important;
        border-radius: 5px !important;
        letter-spacing: 0.3px !important;
    }

    /* Notificações táticas de disparo */
    .notification-box {
        max-height: 92dvh !important;
        overflow-y: auto !important;
        padding: 16px 20px !important;
        width: 90vw !important;
        max-width: 480px !important;
    }

    .alert-banner {
        padding: 6px !important;
        font-size: 0.95rem !important;
        margin-bottom: 12px !important;
    }

    .alert-message {
        font-size: 0.92rem !important;
        margin-bottom: 16px !important;
        line-height: 1.35 !important;
    }

    /* Container do Ecrã de Fim de Jogo: ocupa a área útil sem transbordar */
    .game-over-container {
        width: 95vw !important;
        max-width: 760px !important;
        max-height: 96dvh !important;
        max-height: 96vh !important;
        padding: 8px 16px !important;
        overflow-y: hidden !important; /* Elimina a necessidade de rolar */
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
    }

    /* Cabeçalho de Vitória Compacto */
    .victory-header {
        margin-bottom: 4px !important;
    }

    .trophy-icon {
        font-size: 1.6rem !important;
        margin-bottom: 2px !important;
    }

    .winner-badge {
        font-size: 0.68rem !important;
        padding: 2px 10px !important;
        margin-bottom: 4px !important;
    }

    .glow-winner, #winner-text {
        font-size: 1.15rem !important;
        margin-bottom: 2px !important;
    }

    .winner-reason, #winner-subtitle {
        font-size: 0.75rem !important;
        margin: 0 auto !important;
    }

    /* Grelha de Estatísticas Compacta */
    .stats-comparison-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
        margin-bottom: 6px !important;
    }

    .team-stat-card {
        padding: 6px 10px !important;
        border-radius: 8px !important;
    }

    .team-stat-header {
        padding-bottom: 4px !important;
        margin-bottom: 6px !important;
    }

    .stat-team-name {
        font-size: 0.88rem !important;
    }

    .team-result-badge {
        font-size: 0.65rem !important;
        padding: 1px 6px !important;
    }

    .stat-items-list {
        gap: 3px !important;
    }

    .stat-item {
        font-size: 0.72rem !important;
    }

    /* Botões de Ação Imediatamente Visíveis */
    .game-over-actions {
        display: flex !important;
        justify-content: center !important;
        gap: 10px !important;
        margin-top: 4px !important;
    }

    .victory-btn {
        padding: 6px 18px !important;
        font-size: 0.82rem !important;
    }
}

/* ==========================================================================
   PORTAO DE ENTRADA: TELA CHEIA E INICIO DE OPERACOES
   ========================================================================== */
.start-battle-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 4, 10, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.start-battle-card {
    background: #000d1a;
    border: 2px solid #00ff41;
    box-shadow: 0 0 35px rgba(0, 255, 65, 0.35);
    border-radius: 12px;
    padding: 22px 28px;
    text-align: center;
    max-width: 480px;
    width: 90vw;
}

.start-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.start-title {
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    font-size: 1.25rem;
    font-weight: 800;
    color: #00ff41;
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.start-desc {
    font-size: 0.85rem;
    color: #cbd5e1;
    margin-bottom: 18px;
    line-height: 1.4;
}

.start-fullscreen-btn {
    background: #00ff41;
    color: #000000;
    font-family: 'Orbitron', 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    font-weight: 800;
    border: none;
    border-radius: 6px;
    padding: 12px 24px;
    cursor: pointer;
    box-shadow: 0 0 16px rgba(0, 255, 65, 0.6);
    transition: all 0.2s ease;
    width: 100%;
}

.start-fullscreen-btn:active {
    transform: scale(0.98);
}

/* ==========================================================================
   LIMITACAO DO PULSO DO MARCADOR DE TIRO (ALIVIO DE GPU)
   ========================================================================== */
/* Limita o pulso do marcador de tiro a 2 repeticoes em vez de infinito, mantendo o ecra frio */
.storm-radar-svg {
    animation: storm-marker-pulse 1.8s ease-in-out 2 !important;
}

.storm-pulsing-ring {
    animation: pulseRingStorm 1.4s ease-in-out 2 !important;
}

.dashed-ring {
    animation: pulseGlow 1.8s ease-in-out 2 !important;
}

/* ==========================================================================
   MODAIS TÁTICOS RR EDUCAÇÃO (PADRÃO PREVIEW-MODAIS.HTML)
   ========================================================================== */
.tactical-modal-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(0, 4, 10, 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    display: none; /* Inicia oculto e só abre via script */
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

.tactical-modal-card {
    background: #0b0f19;
    border: 1.5px solid #1e293b;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), 0 0 40px rgba(0, 229, 255, 0.08);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
    animation: fadeInModal 0.25s ease-out;
}

/* Modais de Identificação Dedicados (Elimina CSS inline) */
.modal-dupla-card {
    max-width: 650px;
    width: 92%;
    display: none;
}

.modal-single-card {
    max-width: 480px;
    width: 92%;
    display: none;
}

.modal-waiting-card {
    max-width: 480px;
    width: 92%;
    text-align: center;
    display: none;
}

.swatch-field-label {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-bottom: 8px;
}

.swatch-field-label-single {
    font-size: 0.78rem;
    font-weight: 700;
    color: #cbd5e1;
    margin-bottom: 8px;
}

.form-group-single {
    margin-bottom: 16px;
}

.input-tight {
    margin-bottom: 0 !important;
}

.commander-card-single {
    margin-bottom: 24px;
}

.pin-display-compact {
    font-size: 2rem !important;
    padding: 6px 20px !important;
    letter-spacing: 4px !important;
}

.waiting-subtitle {
    margin-bottom: 20px;
}

.pin-container-tight {
    margin-bottom: 0;
}

.icon-pulse-anim {
    animation: pulse 1.5s infinite;
}

.tactical-modal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00e5ff, transparent);
}

@keyframes fadeInModal {
    from { opacity: 0; transform: scale(0.97); }
    to { opacity: 1; transform: scale(1); }
}

.icon-header-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 229, 255, 0.08);
    border: 1px solid rgba(0, 229, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 1.8rem;
    color: #00e5ff;
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.2);
    transition: all 0.3s ease;
}

.modal-main-title {
    text-align: center;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: #f8fafc;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.modal-subtitle {
    text-align: center;
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 24px;
    line-height: 1.4;
}

.commanders-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

@media (max-width: 580px) {
    .commanders-grid {
        grid-template-columns: 1fr;
    }
}

.commander-card-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1.5px solid #1e293b;
    padding: 18px;
    border-radius: 12px;
    transition: all 0.25s ease;
    box-sizing: border-box;
}

.commander-label {
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color 0.25s ease;
}

.tactical-text-input {
    width: 100%;
    padding: 12px 14px;
    background: #080b11;
    border: 1.5px solid #1e293b;
    color: #fff;
    border-radius: 8px;
    font-size: 0.92rem;
    outline: none;
    transition: all 0.2s;
    margin-bottom: 12px;
    box-sizing: border-box;
}

.tactical-text-input:focus {
    border-color: #00e5ff;
    background: #0b101c;
}

.swatches-flex {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.color-dot {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    position: relative;
    box-sizing: border-box;
}

/* Cor ocupada pelo adversário no modo 1v1 */
.color-dot.blocked {
    opacity: 0.22 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    transform: scale(0.9) !important;
    box-shadow: none !important;
    position: relative;
}

.color-dot.blocked::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 900;
    color: #ff3333;
}

.color-dot:hover {
    transform: scale(1.15);
}

.color-dot.selected {
    border-color: #ffffff !important;
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(255,255,255,0.6);
}

.color-dot.selected::after {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-action-primary {
    width: 100%;
    padding: 14px;
    font-size: 0.95rem;
    font-weight: 800;
    background: #00e5ff;
    color: #05070b;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-action-primary:hover {
    background: #38bdf8;
    box-shadow: 0 0 25px rgba(0, 229, 255, 0.5);
    transform: translateY(-1px);
}

.btn-action-secondary {
    background: transparent;
    border: 1px solid #334155;
    color: #94a3b8;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-action-secondary:hover {
    border-color: #64748b;
    color: #fff;
    background: rgba(255,255,255,0.03);
}

.pin-container-box {
    text-align: center;
    margin-bottom: 22px;
}

.pin-label-text {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.pin-number-badge {
    display: inline-block;
    background: rgba(0, 229, 255, 0.06);
    border: 2px solid #00e5ff;
    padding: 10px 28px;
    border-radius: 12px;
    font-size: 2.4rem;
    font-weight: 900;
    color: #00e5ff;
    letter-spacing: 8px;
    text-shadow: 0 0 20px rgba(0, 229, 255, 0.4);
    box-shadow: inset 0 0 15px rgba(0, 229, 255, 0.1);
}

.copy-url-wrapper {
    display: flex;
    gap: 8px;
    background: #080b11;
    border: 1.5px solid #1e293b;
    padding: 4px 6px 4px 14px;
    border-radius: 10px;
    align-items: center;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}

.copy-url-wrapper:focus-within {
    border-color: #00e5ff;
}

.copy-url-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #38bdf8;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
    outline: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-action {
    background: rgba(0, 229, 255, 0.12);
    border: 1px solid #00e5ff;
    color: #00e5ff;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-copy-action:hover {
    background: #00e5ff;
    color: #000;
    box-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

.btn-copy-action.copied {
    background: rgba(0, 255, 65, 0.15) !important;
    border-color: #00ff41 !important;
    color: #00ff41 !important;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3) !important;
}

/* AJUSTES RESPONSIVOS MOBILE LANDSCAPE PARA OS MODAIS TÁTICOS */
@media screen and (orientation: landscape) and (max-height: 520px) {
    .tactical-modal-card {
        padding: 14px 20px !important;
        max-height: 96vh !important;
        max-height: 96dvh !important;
        overflow-y: auto !important;
    }
    .icon-header-badge {
        width: 38px !important;
        height: 38px !important;
        font-size: 1.2rem !important;
        margin-bottom: 8px !important;
    }
    .modal-main-title {
        font-size: 1.05rem !important;
        margin-bottom: 4px !important;
    }
    .modal-subtitle {
        font-size: 0.74rem !important;
        margin-bottom: 12px !important;
    }
    .commanders-grid {
        gap: 10px !important;
        margin-bottom: 12px !important;
    }
    .commander-card-box {
        padding: 10px 12px !important;
    }
    .commander-label {
        font-size: 0.72rem !important;
        margin-bottom: 4px !important;
    }
    .tactical-text-input {
        padding: 6px 10px !important;
        font-size: 0.82rem !important;
        margin-bottom: 6px !important;
    }
    .color-dot {
        width: 22px !important;
        height: 22px !important;
    }
    .btn-action-primary {
        padding: 10px !important;
        font-size: 0.85rem !important;
    }
}