:root {
    --neon-pink: #ff00ff;
    --neon-cyan: #00ffff;
    --dark-bg: #050510;
}

body, html {
    margin: 0; padding: 0; height: 100%;
    background-color: var(--dark-bg);
    font-family: 'Press Start 2P', monospace;
    color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column; 
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    background-position: center bottom;
    perspective: 1000px;
}

body::after {
    content: " "; display: block; position: absolute;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100; background-size: 100% 4px, 6px 100%; pointer-events: none;
}

/* BARRA SUPERIOR */
.top-navbar { 
    width: 100%; min-height: 70px; display: flex; justify-content: center; align-items: center; 
    padding: 0 30px; box-sizing: border-box; z-index: 200; position: relative;
    background: rgba(0, 0, 5, 0.8); border-bottom: 2px solid #222;
}

/* CONTADOR ONLINE */
.online-counter {
    position: absolute;
    left: 30px;
    font-size: 8px;
    color: #0f0;
    background: rgba(0, 20, 0, 0.8);
    border: 1px solid #0f0;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.4);
    cursor: pointer;
    transition: 0.3s;
}

.online-counter:hover {
    background: rgba(0, 40, 0, 0.9);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.8);
    transform: scale(1.05);
}

.blink-dot {
    width: 6px; height: 6px; background-color: #0f0; border-radius: 50%;
    animation: pulse-green 1.5s infinite;
}

@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
    70% { box-shadow: 0 0 0 6px rgba(0, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

.season-nav { display: flex; gap: 15px; }

.season-btn {
    font-family: 'Press Start 2P', monospace; font-size: 8px; padding: 12px 15px; 
    cursor: pointer; background: rgba(0,0,0,0.5); border: 2px solid; transition: 0.2s; color: #fff;
    text-transform: uppercase;
}
.season-btn:active { transform: scale(0.9) translateY(2px); } 

.btn-s1 { border-color: var(--neon-cyan); color: var(--neon-cyan); }
.btn-s1:hover { background: var(--neon-cyan); color: #000; box-shadow: 0 0 15px var(--neon-cyan); }

.btn-s2 { border-color: #ff00ff; color: #ff00ff; }
.btn-s2:hover { background: #ff00ff; color: #000; box-shadow: 0 0 15px #ff00ff; }

.btn-s3 { border-color: #00ff00; color: #00ff00; }
.btn-s3:hover { background: #00ff00; color: #000; box-shadow: 0 0 15px #00ff00; }

.btn-s4 { border-color: #ffcc00; color: #ffcc00; }
.btn-s4:hover { background: #ffcc00; color: #000; box-shadow: 0 0 15px #ffcc00; }

.btn-s5 { border-color: #ff3300; color: #ff3300; }
.btn-s5:hover { background: #ff3300; color: #000; box-shadow: 0 0 15px #ff3300; }

.top-right-profile { position: absolute; right: 30px; display: none; align-items: center; gap: 10px; background: rgba(0, 0, 0, 0.9); border: 2px solid var(--neon-cyan); padding: 8px 12px; box-shadow: 0 0 10px var(--neon-cyan); }
.profile-info { display: flex; flex-direction: column; text-align: right; gap: 5px; }
.profile-name { font-size: 8px; color: #fff; }
.profile-status { font-size: 7px; color: #0f0; }
.profile-img { width: 32px; height: 32px; border: 2px solid var(--neon-pink); object-fit: cover; }

.btn-logout { background: transparent; color: #ff0044; border: 1px solid #ff0044; font-family: 'Press Start 2P', monospace; font-size: 7px; padding: 6px 8px; cursor: pointer; transition: 0.3s; }
.btn-logout:hover { background: #ff0044; color: #fff; box-shadow: 0 0 10px #ff0044; }

.main-container { flex: 1; display: flex; flex-direction: row; width: 100%; overflow: hidden; z-index: 10; }

.left-sidebar { display: flex; flex-direction: column; width: 380px; background: rgba(0, 0, 10, 0.95); border-right: 2px solid var(--neon-cyan); box-shadow: 5px 0 20px rgba(0, 255, 255, 0.2); padding: 20px; box-sizing: border-box; overflow: hidden; z-index: 50; animation: slideInLeft 0.5s ease-out forwards; }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.ranking-sidebar { display: flex; flex-direction: column; width: 380px; background: rgba(0, 0, 10, 0.95); border-left: 2px solid var(--neon-pink); box-shadow: -5px 0 20px rgba(255, 0, 255, 0.2); padding: 20px; box-sizing: border-box; overflow: hidden; z-index: 50; animation: slideInRight 0.5s ease-out forwards; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.game-wrapper { flex: 1; display: flex; justify-content: center; align-items: center; padding: 0 20px 20px 20px; box-sizing: border-box; position: relative; transition: all 0.3s ease; }

/* MOLDURA RETRO (MONITOR ANTIGO) */
.portal-container { 
    position: relative; 
    width: 100vw; 
    height: 75vw; 
    max-width: 800px; 
    max-height: 600px; 
    background: #000; 
    
    border-top: 14px solid #222;
    border-left: 14px solid #1a1a1a;
    border-right: 14px solid #111;
    border-bottom: 28px solid #0a0a0a; 
    border-radius: 12px;
    
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.9), 0 0 20px rgba(0, 255, 255, 0.1); 
    display: flex; flex-direction: column; overflow: hidden; 
}
@media (min-aspect-ratio: 4/3) { .portal-container { height: 75vh; width: 100vh; } }

.corujitsu-container { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 2px dashed #444; }
.speech-bubble { background: rgba(0, 255, 255, 0.1); border: 1px solid var(--neon-cyan); border-radius: 8px; padding: 12px; width: 100%; text-align: center; margin-bottom: 15px; position: relative; box-sizing: border-box; min-height: 50px; display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 10px rgba(0, 255, 255, 0.1); }
.speech-bubble::after { content: ''; position: absolute; bottom: -10px; left: 50%; margin-left: -10px; border-width: 10px 10px 0; border-style: solid; border-color: var(--neon-cyan) transparent transparent transparent; }
#corujitsu-text { font-size: 8px; color: #fff; line-height: 1.5; margin: 0; text-shadow: 1px 1px #000; letter-spacing: 1px; }

.corujitsu-img-wrapper { width: 150px; height: 150px; display: flex; align-items: center; justify-content: center; margin-top: 10px;}
#corujitsu-avatar { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; filter: drop-shadow(0 0 10px rgba(255,0,255,0.3)); }

/* AVATAR DA COELHA */
.coelha-img-wrapper {
    width: 250px;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
}
#coelha-avatar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 0 10px rgba(0, 255, 255, 0.3));
}

/* PAINEL DE MISSÃO */
.mission-panel {
    flex: 1; border: 1px solid var(--neon-cyan); background: rgba(0, 255, 255, 0.05);
    border-radius: 8px; padding: 15px; display: flex; flex-direction: column;
    box-shadow: inset 0 0 20px rgba(0, 255, 255, 0.1); position: relative; overflow: hidden;
}
.mission-panel::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(rgba(0, 255, 255, 0.05) 0px, rgba(0, 255, 255, 0.05) 2px, transparent 2px, transparent 4px);
    pointer-events: none; z-index: 5;
}

.mission-standby { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; z-index: 10; opacity: 1; transition: opacity 0.3s; }
.standby-text { color: var(--neon-cyan); font-size: 12px; animation: pulseGlow 1.5s infinite alternate; text-align: center; line-height: 1.6;}

.mission-active { display: none; flex-direction: column; height: 100%; z-index: 10; opacity: 0; transition: opacity 0.3s; }

.mission-header { color: var(--neon-cyan); text-align: center; font-size: 16px; margin-top: 0; margin-bottom: 10px; text-shadow: 0 0 5px var(--neon-cyan); border-bottom: 1px dashed var(--neon-cyan); padding-bottom: 8px; }

.boss-info { display: block; margin-bottom: 10px; background: rgba(0,0,0,0.6); padding: 10px; border-radius: 5px; border: 1px solid #444; overflow: hidden;}

.boss-avatar-wrapper { float: left; width: 120px; height: 120px; margin-right: 15px; margin-bottom: 5px; border: 2px solid var(--neon-pink); border-radius: 5px; background: #000; display: flex; justify-content: center; align-items: center; box-shadow: 0 0 15px rgba(255,0,255,0.4); }
.boss-avatar-wrapper img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }

.boss-details { display: block; }
.boss-label { display: block; font-size: 8px; color: #ffcc00; letter-spacing: 1px; margin-bottom: 6px; margin-top: 2px; }
.boss-name { display: block; color: var(--neon-pink); font-size: 14px; font-weight: bold; text-shadow: 1px 1px 0px #000; line-height: 1.2; margin-bottom: 8px; }

.boss-lore { display: block; font-size: 9px; color: #ccc; line-height: 1.6; text-align: justify; }

.troop-info { display: flex; flex-direction: column; align-items: center; gap: 10px; background: rgba(0,0,0,0.4); padding: 10px; border-radius: 5px; border: 1px solid #333; margin-top: auto; clear: both; }
.troop-title { font-size: 10px; color: var(--neon-cyan); letter-spacing: 1px; }
.troop-sprites { display: flex; gap: 20px; justify-content: center; background: rgba(0,255,255,0.05); padding: 10px 20px; border-radius: 5px; border: 1px solid rgba(0,255,255,0.2);}
.troop-sprites img { width: 40px; height: 40px; image-rendering: pixelated; }

@keyframes pulseGlow { 0% { opacity: 0.5; filter: drop-shadow(0 0 2px currentColor); } 100% { opacity: 1; filter: drop-shadow(0 0 8px currentColor); } }

.ranking-sidebar h2 { color: #ffcc00; text-align: center; margin-top: 0; font-size: 14px; margin-bottom: 20px; text-shadow: 2px 2px #000;}
.rank-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; flex: 1; padding-right: 10px; }
.rank-list::-webkit-scrollbar { width: 6px; }
.rank-list::-webkit-scrollbar-track { background: #111; border-radius: 4px;}
.rank-list::-webkit-scrollbar-thumb { background: var(--neon-pink); border-radius: 4px; }
.rank-item { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px dashed #444; padding: 12px 10px; box-sizing: border-box;}
.rank-item:first-child { border-bottom: 2px solid #ffcc00; background: rgba(255,204,0,0.1); padding: 15px 10px;}
.rank-left { display: flex; align-items: center; gap: 10px; }

.rank-pos { color: var(--neon-pink); font-size: 18px; width: 45px; text-align: left; display: inline-block; font-weight: bold; text-shadow: 1px 1px 0 #000;}

.rank-ship-img { width: 24px; height: 24px; image-rendering: pixelated; object-fit: contain;}
.rank-details { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rank-name { font-size: 10px; color: #fff; }
.rank-level { font-size: 8px; color: #aaa; letter-spacing: 1px;}
.rank-score { font-size: 12px; color: var(--neon-cyan); font-weight: bold;}
.rank-item:first-child .rank-pos, .rank-item:first-child .rank-name, .rank-item:first-child .rank-score { color: #ffcc00; }

header { text-align: center; padding: 20px; border-bottom: 2px solid var(--neon-pink); background: linear-gradient(90deg, transparent, rgba(255,0,255,0.2), transparent); }
h1 { font-size: 24px; margin: 0; color: #fff; text-shadow: 2px 2px 0px var(--neon-pink), -2px -2px 0px var(--neon-cyan); letter-spacing: 2px; }

.content { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; }
.btn { background: transparent; color: var(--neon-cyan); border: 2px solid var(--neon-cyan); font-family: 'Press Start 2P', monospace; padding: 15px 30px; margin: 15px; font-size: 14px; cursor: pointer; text-transform: uppercase; transition: 0.3s; box-shadow: 0 0 10px rgba(0,255,255,0.3); }
.btn:hover { background: var(--neon-cyan); color: #000; box-shadow: 0 0 20px var(--neon-cyan); }
.btn-google { border-color: #fff; color: #fff; box-shadow: 0 0 10px rgba(255,255,255,0.3); }
.btn-google:hover { background: #fff; color: #000; box-shadow: 0 0 20px #fff; }
.btn-play { border-color: var(--neon-pink); color: var(--neon-pink); font-size: 18px; padding: 20px 40px; box-shadow: 0 0 15px rgba(255,0,255,0.5); display: none;}
.btn-play:hover { background: var(--neon-pink); color: #000; box-shadow: 0 0 30px var(--neon-pink); }

.user-info { display: none; color: #0f0; margin-bottom: 30px; font-size: 12px; text-align: center; line-height: 1.5; }
#game-frame { display: none; width: 100%; height: 100%; border: none; background: #000; }

#toast-msg {
    position: fixed; top: 90px; left: 50%; transform: translateX(-50%);
    background: rgba(0,0,0,0.9); border: 2px solid var(--neon-pink); color: var(--neon-pink);
    padding: 15px 30px; font-family: 'Press Start 2P', monospace; font-size: 10px;
    z-index: 1000; display: none; box-shadow: 0 0 20px var(--neon-pink); text-align: center;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -20px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    85% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -20px); }
}

footer {
    background: rgba(0, 0, 5, 0.95);
    border-top: 2px solid var(--neon-cyan);
    text-align: center;
    padding: 15px;
    font-size: 8px;
    color: #aaa;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 200;
    position: relative;
}

.social-links { display: flex; gap: 20px; font-size: 16px; }
.social-links a { color: var(--neon-cyan); text-decoration: none; transition: 0.3s; }
.social-links a:hover { color: var(--neon-pink); transform: scale(1.3) translateY(-2px); text-shadow: 0 0 10px var(--neon-pink); }

@media (max-width: 1200px) {
    /* Destrava a tela para permitir o scroll do menu para cima */
    body, html { display: block; height: auto; min-height: 100vh; overflow-y: auto; overflow-x: hidden; }
    .main-container { display: block; overflow: visible; flex-direction: column; }
    
    .left-sidebar, .ranking-sidebar { width: 100%; height: auto; min-height: 400px; border: none; border-bottom: 2px solid var(--neon-cyan); }
    h1 { font-size: 16px; }
    .btn { font-size: 10px; padding: 10px 20px; }
    
    /* Menu superior mais limpo no mobile */
    .top-navbar { height: auto; padding: 15px 20px; flex-direction: row; justify-content: space-between; position: relative; }
    .online-counter { position: relative; left: auto; align-self: center; margin: 0; }
    .top-right-profile { position: relative; right: auto; margin: 0; }
    
    /* OCULTA AS SEASONS NO MOBILE */
    .season-nav { display: none !important; }

    /* Aumenta a altura da "TV" no celular */
    .portal-container {
        height: 150vw; 
        max-height: none;
        border-width: 8px; 
        border-bottom-width: 16px;
    }
}