@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;700&display=swap'); 

/* 🔥 O CANIVETE SUÍÇO DO PIXEL ART 🔥 */
/* Adicione isso no topo do seu style.css */
img, canvas {
    image-rendering: pixelated; /* Chrome/Safari */
    image-rendering: crisp-edges; /* Firefox */
    -ms-interpolation-mode: nearest-neighbor; /* Old IE (por garantia) */
}

body { 
    background: #000; 
    color: #fff; 
    font-family: 'Orbitron', sans-serif; 
    margin: 0; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    height: 100vh; 
    overflow: hidden; 
}
#game-window { 
    position: relative; 
    width: 900px; 
    height: 600px; 
    background: #001; 
    overflow: hidden; 
}

.screen { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: none !important; z-index: 1; }
.screen.active { display: block !important; z-index: 5; }

button { background: rgba(0, 40, 80, 0.7); color: #fff; border: 1px solid #00d9ff; padding: 12px 20px; cursor: pointer; font-family: 'Orbitron'; text-transform: uppercase; transition: 0.2s; }
button:hover:not(:disabled) { background: #00d9ff; color: #000; box-shadow: 0 0 15px #0ff; }
button:disabled { opacity: 0.4; cursor: not-allowed; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 20, 40, 0.8); }
::-webkit-scrollbar-thumb { background: #00d9ff; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #fff; }

#login-screen { background: radial-gradient(circle, #001a33, #000); }
#login-screen.active { display: flex !important; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.login-box { border: 1px solid #0ff; padding: 40px; background: rgba(0,20,40,0.8); box-shadow: 0 0 20px #0ff; }
input { background: #000; border: 1px solid #0ff; color: #0ff; padding: 10px; font-family: 'Orbitron'; margin: 20px 0; outline: none; text-align: center; width: 80%; }

/* 🔥 HUDs antigos ocultados para não gerar quadrados fantasmas na tela nova 🔥 */
#city-hud { display: none !important; }
#btn-open-inv { display: none !important; }

#city-interaction { position: absolute; bottom: 50px; width: 100%; text-align: center; color: #ff0; font-size: 20px; text-shadow: 0 0 10px #000; display: none; z-index: 10; }

.menu-screen { background: rgba(0, 10, 25, 0.95); padding: 30px; box-sizing: border-box; overflow-y: auto; }
.menu-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #00d9ff; padding-bottom: 10px; margin-bottom: 20px; position: sticky; top: -30px; background: rgba(0, 10, 25, 0.95); z-index: 20; padding-top: 30px; }
.grid-container { display: flex; gap: 15px; flex-wrap: wrap; justify-content: center;}

.card-item { border: 1px solid #0ff; background: linear-gradient(135deg, rgba(0,30,50,0.9), rgba(0,10,20,0.9)); width: 220px; padding: 15px; text-align: center; border-radius: 10px; position: relative; box-shadow: 0 0 10px rgba(0, 217, 255, 0.2); transition: 0.3s; }
.card-item:hover { transform: scale(1.05); box-shadow: 0 0 20px #00d9ff; z-index: 10; }
.active-baku { border: 2px solid #0f0; background: linear-gradient(135deg, rgba(0,50,20,0.9), rgba(0,20,10,0.9)); box-shadow: 0 0 15px #0f0; }

.baku-image-container { width: 100px; height: 100px; margin: 10px auto; border-radius: 10px; overflow: hidden; border: 2px solid rgba(0,217,255,0.5); background: rgba(0,0,0,0.5); display: none; justify-content: center; align-items: center; }
.baku-image-container img { max-width: 100%; max-height: 100%; object-fit: contain; }

@keyframes piscarVerde { 0% { box-shadow: 0 0 10px #0f0; border-color: #0f0; background: #004400; color: #fff;} 50% { box-shadow: 0 0 20px #0f0; border-color: #fff; background: #0f0; color: #000;} 100% { box-shadow: 0 0 10px #0f0; border-color: #0f0; background: #004400; color: #fff;} }
.btn-swap-target { animation: piscarVerde 1.5s infinite; cursor: pointer; font-weight: bold; }

.baku-lvl-big { font-family: 'Teko', sans-serif; font-size: 32px; color: #ffcc00; line-height: 1; text-shadow: 0 0 5px #000; margin-bottom: 5px;}
.baku-attr { font-size: 12px; letter-spacing: 2px; font-weight: bold; }
.baku-name { font-size: 18px; font-weight: bold; margin: 5px 0; color: #fff; }
.baku-g { font-size: 24px; color: #fff; font-weight: bold; text-shadow: 0 0 10px #0ff; }
.baku-stats-row { font-family: 'Teko', sans-serif; font-size: 18px; color: #ff6666; margin: 10px 0; background: rgba(0,0,0,0.5); padding: 5px; border-radius: 5px;}
.baku-xp-bar { width: 100%; height: 6px; background: #111; margin-top: 10px; border: 1px solid #0ff; border-radius: 3px; overflow: hidden;}
.baku-xp-fill { height: 100%; background: #0f0; transition: width 0.5s; }

#battle-screen { background: #87CEEB; }
#battle-ui-layer { display: none; width: 100%; height: 100%; position: absolute; top: 0; left: 0; pointer-events: none; }
#battle-ui-layer > * { pointer-events: auto; }

.battle-top-bar { position: absolute; top: 0; width: 100%; height: 110px; background: linear-gradient(180deg, #555, #222); border-bottom: 4px solid #888; display: flex; justify-content: space-between; z-index: 10; box-shadow: 0 5px 15px rgba(0,0,0,0.5); padding: 0 10px; box-sizing: border-box; }

.avatar-wrapper { position: relative; width: 130px; height: 130px; margin-top: 5px; display: flex; flex-direction: column; align-items: center; }

.brawler-avatar { width: 100px; height: 100px; font-size: 32px; background: #ffccaa; border: 4px solid #00d9ff; border-radius: 50%; box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 10px #0ff; display: flex; justify-content: center; align-items: center; color: #000; font-weight: bold; overflow: hidden; }
.avatar-wrapper.right .brawler-avatar { border-color: #ff3333; box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 10px #f00; background: #333; color: #fff; }

.bakugan-sphere-icon { 
    position: absolute; 
    top: 0px; 
    right: -20px; 
    width: 55px; 
    height: 55px; 
    border-radius: 50%; 
    border: 3px solid #ccc; 
    box-shadow: 0 0 10px #000; 
    overflow: visible; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background: rgba(0,0,0,0.8) !important; 
    z-index: 5; 
}

.bakugan-sphere-icon img { 
    width: 145%; 
    height: 145%; 
    object-fit: contain; 
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.8)); 
}

.avatar-wrapper.right .bakugan-sphere-icon { 
    left: -20px; 
    right: auto; 
}

.brawler-name-label { font-size: 12px; font-weight: bold; color: #fff; text-shadow: 0 0 5px #000; margin-top: -5px; z-index: 2; }
.team-indicators { display: flex; gap: 5px; margin-top: 5px; }
.team-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: #0f0; box-shadow: 0 0 5px #0f0; transition: 0.3s; }
.team-dot.dead { background: #555; border-color: #222; box-shadow: inset 0 0 5px #000; }

.top-stats { flex-grow: 1; display: flex; flex-direction: column; padding: 10px 20px; }
.top-stats-right { text-align: right; }
.hp-bar-top-container { width: 100%; height: 15px; background: #000; border: 2px solid #333; position: relative; }
.hp-fill-top { height: 100%; transition: 0.5s; }
.p1-hp-top { background: linear-gradient(90deg, #aa0000, #ff0000); width: 100%; float: right; }
.p2-hp-top { background: linear-gradient(90deg, #ff0000, #aa0000); width: 100%; float: left; }
.hp-text-overlay { position: absolute; top: -1px; width: 100%; text-align: center; font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: bold; color: #fff; text-shadow: 1px 1px 2px #000; z-index: 2; pointer-events: none; }

.baku-top-info { display: flex; justify-content: space-between; align-items: baseline; margin-top: 5px; }
.baku-top-name { font-family: 'Orbitron'; font-size: 14px; color: #ccc; }
.g-power-big { font-family: 'Teko', sans-serif; font-size: 42px; color: #fff; text-shadow: 0 0 10px #fff; line-height: 1; }
.sub-stats { font-family: 'Teko', sans-serif; font-size: 18px; color: #ff6666; margin-top: -5px; letter-spacing: 2px; }

.center-gate { width: 120px; display: flex; justify-content: center; align-items: center; }
.gate-circle { width: 80px; height: 80px; border-radius: 50%; background: radial-gradient(circle, #444, #111); border: 4px solid #888; display: flex; justify-content: center; align-items: center; font-size: 30px; font-family: 'Teko'; color: #0ff; box-shadow: inset 0 0 20px #000; }

.battle-bottom-console { position: absolute; bottom: 0; width: 100%; height: 130px; background: linear-gradient(to top, rgba(0,0,0,0.9), transparent); display: flex; flex-direction: column; align-items: center; justify-content: flex-end; z-index: 10; padding-bottom: 10px; }
.range-indicator { background: #111; border: 2px solid #0ff; color: #0ff; padding: 2px 20px; font-size: 12px; font-weight: bold; border-radius: 10px 10px 0 0; margin-bottom: -2px; z-index: 2; box-shadow: 0 0 10px #0ff; }
.action-wheel { display: flex; gap: 20px; background: rgba(30,30,40,0.8); padding: 15px 40px; border-top: 3px solid #ccc; border-radius: 50px 50px 0 0; box-shadow: 0 -5px 20px rgba(0,0,0,0.5); }
.ability-card-btn { width: 70px; height: 70px; border-radius: 50%; background: radial-gradient(circle, #333, #000); border: 3px solid #777; color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; position: relative; overflow: hidden; }
.ability-card-btn:hover:not(:disabled) { transform: translateY(-10px) scale(1.1); box-shadow: 0 0 20px currentColor; }
.ability-card-btn:disabled { opacity: 0.5; cursor: not-allowed; filter: grayscale(100%); }
.card-cost { position: absolute; top: 5px; font-size: 10px; font-weight: bold; color: #0ff; background: rgba(0,0,0,0.7); padding: 1px 4px; border-radius: 5px;}
.card-name { font-size: 9px; font-family: 'Orbitron'; text-align: center; margin-top: 10px; padding: 0 2px; text-shadow: 0 0 2px #000;}
.card-icon { font-size: 20px; margin-top: 5px; }

#ability-tooltip { position: absolute; bottom: 135px; left: 50%; transform: translateX(-50%); background: rgba(0, 15, 30, 0.95); border: 1px solid #0ff; color: #fff; padding: 8px 20px; font-size: 12px; border-radius: 5px; box-shadow: 0 0 10px rgba(0,217,255,0.5); display: none; z-index: 30; text-align: center; font-family: 'Orbitron', sans-serif; letter-spacing: 1px; pointer-events: none;}
#battle-log { position: absolute; top: 150px; width: 100%; text-align: center; font-size: 36px; font-family: 'Teko', sans-serif; color: #fff; text-shadow: 0 0 10px #00d9ff, 2px 2px 5px #000; pointer-events: none; z-index: 20; letter-spacing: 2px; }
.cooldown-overlay-circle { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 30px; font-weight: bold; pointer-events: none; font-family: 'Teko'; }

.energy-text { position: absolute; bottom: 95px; left: 15px; font-size: 16px; color: #0ff; font-weight: bold; text-shadow: 0 0 5px #000; z-index: 25; }

#battle-history-panel {
    position: absolute; left: 15px; bottom: 10px; width: 200px; height: 75px;
    background: rgba(0, 10, 20, 0.85); border: 1px solid #00d9ff; border-radius: 5px;
    display: flex; flex-direction: column; z-index: 40; box-shadow: inset 0 0 10px #000;
    transition: all 0.3s ease;
}
#battle-history-panel.expanded { width: 260px; height: 180px; }
#battle-history-header {
    display: flex; justify-content: space-between; align-items: center; background: rgba(0, 217, 255, 0.2);
    padding: 2px 10px; font-family: 'Orbitron', sans-serif; font-size: 10px; font-weight: bold; color: #0ff;
    border-bottom: 1px solid #00d9ff;
}
#btn-toggle-log { background: none; border: none; color: #0ff; cursor: pointer; font-size: 12px; padding: 0; box-shadow: none; font-family: 'Orbitron'; }
#btn-toggle-log:hover { color: #fff; transform: scale(1.2); }
#battle-history-content {
    overflow-y: auto; padding: 5px 10px; box-sizing: border-box; font-family: 'Teko', sans-serif;
    font-size: 14px; display: flex; flex-direction: column; gap: 2px; flex-grow: 1;
}
.log-entry { border-bottom: 1px solid rgba(0, 217, 255, 0.2); padding-bottom: 2px; text-shadow: 1px 1px 2px #000; line-height: 1.1; letter-spacing: 1px; }

#bakugan-selection-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.75); z-index: 50; display: none; justify-content: center; align-items: center; backdrop-filter: blur(5px); }
.selection-panel { background: rgba(0, 30, 45, 0.9); border: 4px solid #888; border-radius: 15px; padding: 30px; box-shadow: 0 0 30px rgba(0,217,255,0.5); text-align: center; width: 600px; }
.selection-panel h2 { font-family: 'Teko', sans-serif; font-size: 36px; color: #fff; text-shadow: 0 0 10px #0ff; margin: 0 0 20px 0; letter-spacing: 2px; }
.selection-list { display: flex; justify-content: center; gap: 30px; }
.selection-item { display: flex; flex-direction: column; align-items: center; cursor: pointer; transition: 0.3s; padding: 10px; border-radius: 10px; }
.selection-item:hover { background: rgba(0, 217, 255, 0.2); transform: scale(1.05); }
.selection-item.dead { opacity: 0.3; filter: grayscale(100%); cursor: not-allowed; }
.selection-sphere { width: 90px; height: 90px; border-radius: 50%; border: 3px solid #ccc; box-shadow: inset 0 0 20px rgba(0,0,0,0.8), 0 0 15px rgba(0,0,0,0.5); position: relative; display: flex; justify-content: center; align-items: center; overflow: hidden; }
.selection-sphere img { width: 80%; height: 80%; object-fit: contain; }
.selection-text { font-size: 14px; font-weight: bold; color: #0ff; text-transform: uppercase; margin-top: 15px; text-shadow: 0 0 5px #000; }
.selection-g { font-family: 'Teko', sans-serif; font-size: 28px; color: #fff; line-height: 1; margin-top: 5px; }

#victory-screen { background: radial-gradient(circle at center, #00334d, #00111a); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; z-index: 100; overflow-y: auto; }
.victory-title { font-family: 'Teko', sans-serif; font-size: 50px; color: #00d9ff; text-shadow: 0 0 20px #00d9ff; margin-bottom: 20px; letter-spacing: 5px; transition: 0.3s; }
.victory-container { display: flex; width: 100%; max-width: 850px; gap: 20px; }
.vic-player-panel { background: rgba(0, 20, 30, 0.8); border: 2px solid #0ff; border-radius: 10px; padding: 20px; display: flex; flex-direction: column; align-items: center; width: 200px; box-shadow: 0 0 15px rgba(0,217,255,0.3); }
.vic-player-avatar { width: 100px; height: 100px; background: #ffccaa; border: 4px solid #00d9ff; border-radius: 50%; margin-bottom: 15px; display: flex; justify-content: center; align-items: center; color: #000; font-weight: bold; font-size: 20px; }
.vic-brawler-name { font-size: 18px; font-weight: bold; color: #fff; text-transform: uppercase; margin-bottom: 5px; }
.vic-xp-text { color: #0f0; font-size: 12px; margin-bottom: 5px; }
.vic-bakugan-grid { display: flex; gap: 15px; flex-grow: 1; }
.vic-baku-card { background: rgba(0, 20, 30, 0.8); border: 2px solid #555; border-radius: 10px; padding: 15px; flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.vic-baku-lvl-badge { position: absolute; top: 10px; right: 10px; width: 25px; height: 25px; background: #00d9ff; color: #000; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 12px; }
.vic-baku-sphere { width: 60px; height: 60px; border-radius: 50%; border: 2px solid #ccc; margin: 15px 0; overflow: hidden; display: flex; justify-content: center; align-items: center; }
.vic-baku-sphere img { max-width: 100%; max-height: 100%; }
.vic-baku-name { font-size: 12px; font-weight: bold; color: #fff; text-align: center; height: 30px; }
.anim-xp-bar-bg { width: 100%; height: 8px; background: #111; border: 1px solid #0ff; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.anim-xp-fill { height: 100%; background: #0f0; width: 0%; transition: width 1.5s ease-out, background-color 0.5s; }
.anim-xp-fill.levelup { background: #ffcc00; }
.vic-gained-text { color: #0ff; font-size: 10px; margin-top: 5px; font-weight: bold; text-align: center; height: 15px; }
.bakucoins-panel { background: rgba(0,0,0,0.8); border: 1px solid #ffcc00; padding: 10px 30px; border-radius: 20px; margin-top: 30px; font-size: 20px; font-family: 'Teko'; letter-spacing: 2px; color: #ffcc00; box-shadow: 0 0 10px #ffcc00; }
.btn-continue { margin-top: 20px; font-size: 18px; padding: 10px 40px; }

/* ==========================================
   EFEITOS DE TURNO: BAKUGAN DIMENSIONS (Avançado)
   ========================================== */

/* 1. Inverte a imagem do Jogador para olhar para a direita */
#p1-sphere-icon img { transform: scaleX(-1); }

/* 2. Animação de Abertura e Balanço da IMAGEM (Jogador 1 - Invertido) */
@keyframes bakuganAbrirP1 {
    0% { transform: scaleX(-1) rotate(-180deg) scale(0); opacity: 0; filter: drop-shadow(0 0 20px #0df); }
    60% { transform: scaleX(-1) rotate(20deg) scale(1.1); opacity: 1; filter: drop-shadow(0 0 10px #0df); }
    100% { transform: scaleX(-1) rotate(0deg) scale(1); opacity: 1; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.8)); }
}
@keyframes imgBobP1 {
    0% { transform: scaleX(-1) translateY(0px); }
    50% { transform: scaleX(-1) translateY(-8px); } /* A imagem flutua 8px para cima */
    100% { transform: scaleX(-1) translateY(0px); }
}

/* 3. Animação de Abertura e Balanço da IMAGEM (Inimigo - Normal) */
@keyframes bakuganAbrirP2 {
    0% { transform: rotate(180deg) scale(0); opacity: 0; filter: drop-shadow(0 0 20px #f55); }
    60% { transform: rotate(-20deg) scale(1.1); opacity: 1; filter: drop-shadow(0 0 10px #f55); }
    100% { transform: rotate(0deg) scale(1); opacity: 1; filter: drop-shadow(0 5px 5px rgba(0,0,0,0.8)); }
}
@keyframes imgBobP2 {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); } /* A imagem flutua 8px para cima */
    100% { transform: translateY(0px); }
}

/* 4. Animação do Brilho do CÍRCULO (O círculo fica parado, só pulsa a cor) */
@keyframes activeTurnContainerP1 {
    0% { border-color: #0df; box-shadow: 0 0 15px #0df; }
    50% { border-color: #fff; box-shadow: 0 0 25px #0df; }
    100% { border-color: #0df; box-shadow: 0 0 15px #0df; }
}
@keyframes activeTurnContainerP2 {
    0% { border-color: #f55; box-shadow: 0 0 15px #f55; }
    50% { border-color: #fff; box-shadow: 0 0 25px #f55; }
    100% { border-color: #f55; box-shadow: 0 0 15px #f55; }
}

/* 5. APLICANDO AS ANIMAÇÕES JUNTAS */
.active-turn-p1 { animation: activeTurnContainerP1 1.5s infinite ease-in-out; z-index: 10 !important; }
.active-turn-p2 { animation: activeTurnContainerP2 1.5s infinite ease-in-out; z-index: 10 !important; }

.active-turn-p1.anim-esfera-abrir-p1 img { 
    animation: bakuganAbrirP1 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               imgBobP1 1.5s ease-in-out 0.5s infinite; 
}
.active-turn-p2.anim-esfera-abrir-p2 img { 
    animation: bakuganAbrirP2 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards,
               imgBobP2 1.5s ease-in-out 0.5s infinite; 
}

/* ==========================================
   EFEITOS DE INTERFACE (HOVER NA SELEÇÃO E PERFIL)
   ========================================== */

@keyframes uiHoverSpinOpen {
    0% { transform: rotate(180deg) scale(0.2); opacity: 0; }
    70% { transform: rotate(-15deg) scale(1.1); opacity: 1; }
    100% { transform: rotate(0deg) scale(1); opacity: 1; }
}

@keyframes uiHoverBob {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
    100% { transform: translateY(0px); }
}

.selection-item:not(.dead):hover .selection-sphere img {
    animation: uiHoverSpinOpen 0.4s ease-out forwards, uiHoverBob 1.5s ease-in-out 0.4s infinite;
}

.profile-baku-card:hover .profile-sphere img {
    animation: uiHoverSpinOpen 0.4s ease-out forwards, uiHoverBob 1.5s ease-in-out 0.4s infinite;
}

