:root {
    --primary-color: #4285F4;
    --accent-color: #00d4ff;
    --bg-dark: #121212;
    --card-bg: rgba(45, 45, 45, 0.65);
    --text-main: #ffffff;
    --text-dim: #b0b0b0;
    --glass-border: rgba(255, 255, 255, 0.1);
}

body { 
    font-family: 'Outfit', sans-serif; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    min-height: 100vh; 
    background: #0f0f0f;
    color: var(--text-main);
    margin: 0;
    overflow: hidden;
}

/* Dedicated Background Image Layer for smooth zoom */
.bg-zoom-layer {
    position: fixed;
    top: -5%;
    left: -5%;
    width: 110%;
    height: 110%;
    background: 
        linear-gradient(135deg, rgba(15, 15, 15, 0.9) 0%, rgba(26, 26, 46, 0.6) 100%),
        url('../assets/imgs/plan3big.jpg') center/cover no-repeat;
    background-blend-mode: soft-light;
    z-index: -1;
    animation: drift 120s infinite ease-in-out alternate;    
    will-change: transform;
}

/* Continuous Scanning Line Effect - Softened */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, 
        transparent 45%, 
        rgba(0, 212, 255, 0.15) 50%, 
        transparent 55%);
    background-size: 100% 400px;
    pointer-events: none;
    z-index: 1;
    animation: scan 60s infinite linear;
}

@keyframes scan {
    from { background-position: 0 -500px; }
    to { background-position: 0 100vh; }
}

/* Drifting Ambient Flare */
body::after {
    content: "";
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.08) 0%, transparent 60%);
    pointer-events: none;
    z-index: 2;
    animation: flareMove 45s infinite ease-in-out;
}

@keyframes drift {
    0% { 
        transform: scale(3) translate(0, 0);
    }
    100% { 
        transform: scale(1) translate(-1%, -1%);
    }
}

@keyframes flareMove {
    0% { transform: translate(-5%, -5%); opacity: 0.1; }
    50% { transform: translate(5%, 10%); opacity: 0.5; }
    100% { transform: translate(-5%, -5%); opacity: 0.1; }
}

/* Grid Overlay (Tactical look) */
.grid-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 70px 70px;
    pointer-events: none;
    z-index: 0;
}

.container { 
    position: relative;
    z-index: 10;
    text-align: center; 
    padding: 3rem 2rem; 
    border: 1px solid var(--glass-border); 
    border-radius: 20px; 
    background: var(--card-bg); 
    backdrop-filter: blur(12px);
    width: 100%;
    max-width: 400px; 
    box-shadow: 0 20px 50px rgba(0,0,0,0.6), 0 0 20px rgba(0, 212, 255, 0.05);
    animation: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 { 
    font-size: 2rem; 
    margin-bottom: 0.5rem; 
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 700;
}

.logo-corner {
    position: fixed;
    top: 25px;
    left: 25px;
    width: 120px;
    height: auto;
    z-index: 100;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.3));
    opacity: 0.8;
    transition: opacity 0.3s;
    user-select: none;
    pointer-events: none;
}

.logo-corner:hover {
    opacity: 1;
}

.logo-container {
    width: 200px;
    height: auto;
    margin-bottom: 1px;
    filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.3));
    animation: logoFloat 12s infinite ease-in-out;
    user-select: none;
    pointer-events: none;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0) scale(1); filter: drop-shadow(0 0 15px rgba(0, 212, 255, 0.3)); }
    50% { transform: translateY(-8px) scale(1.03); filter: drop-shadow(0 0 25px rgba(0, 212, 255, 0.5)); }
}

.welcome-text {
    color: var(--text-dim);
    margin-bottom: 1.2rem;
    font-weight: 300;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

#userInfo { 
    margin: 0.5rem 0 1rem 0; 
    min-height: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

/* Profile card for horizontal layout */
.user-card {
    flex-direction: row !important;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 12px;
    gap: 15px;
    text-align: left;
    justify-content: flex-start !important;
    width: 100%;
    box-sizing: border-box;
}

.user-card .avatar {
    width: 42px;
    height: 42px;
    margin-bottom: 0;
    flex-shrink: 0;
    border-width: 1.5px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.2);
}

.user-meta-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name-label {
    font-size: 0.9rem;
    color: var(--text-main);
}

.logout-link {
    font-size: 0.7rem;
    color: #ff6b6b;
    text-decoration: none;
    opacity: 0.7;
    transition: 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.logout-link:hover {
    opacity: 1;
}

.login-hint {
    font-size: 0.8rem;
    color: var(--text-dim);
    opacity: 0.8;
    font-weight: 300;
    line-height: 1;
    text-align: center;
}

.avatar { 
    width: 50px; 
    height: 50px; 
    border-radius: 50%; 
    margin-bottom: 10px; 
    object-fit: cover; 
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.3);
}

/* Highlighted Login Button */
#btnLogin { 
    background: linear-gradient(45deg, #4285F4, #34a853);
    color: white; 
    padding: 15px 25px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 1.1rem;
    width: 100%;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(66, 133, 244, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

#btnLogin:hover {
    transform: scale(1.05);
    box-shadow: 0 15px 30px rgba(66, 133, 244, 0.5);
    filter: brightness(1.1);
}

#btnLogout { 
    background-color: transparent; 
    color: #ff6b6b; 
    padding: 8px;
    border: 1px solid rgba(255, 107, 107, 0.3);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    width: auto;
    margin: 10px auto;
    display: none;
    transition: all 0.2s;
}

#btnLogout:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

/* Game Menu Buttons */
.game-menu {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.menu-btn {
    padding: 14px 20px;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 0.95rem;
}

.menu-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    transform: translateX(5px);
}

.menu-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.separator-hr {
    border: none;
    border-top: 1px solid var(--glass-border);
    margin: 10px 0;
    width: 100%;
    opacity: 0.5;
}

.footer-links {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px 20px;
    font-size: 0.85rem;
}

.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.footer-links a:hover {
    color: var(--accent-color);
}

.legal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 25px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    z-index: 5;
    pointer-events: auto;
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, transparent 100%);
    padding: 15px 0 10px 0;
    backdrop-filter: blur(2px);
}

.legal-footer a {
    color: inherit;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0,0,0,0.5);
    font-weight: 400;
}

.legal-footer a:hover {
    color: var(--accent-color);
    transform: translateY(-1px);
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

i { font-size: 1.1rem; }

/* Cookie Consent Popup */
.cookie-consent {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.8);
    backdrop-filter: blur(15px);
    border: 1px solid var(--glass-border);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 2000;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    animation: slideUp 0.5s ease-out;
    visibility: hidden; /* Controlado via JS */
}

.cookie-consent.show {
    visibility: visible;
}

@keyframes slideUp {
    from { transform: translate(-50%, 100px); opacity: 0; }
    to { transform: translate(-50%, 0); opacity: 1; }
}

.cookie-text {
    color: var(--text-dim);
    font-size: 0.85rem;
    line-height: 1.4;
    flex: 1;
}

.cookie-btn {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    white-space: nowrap;
}

.cookie-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* Custom Discrete Tooltip */
.info-tooltip-wrapper {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}

.info-tooltip-wrapper .tooltip-content {
    visibility: hidden;
    width: 220px;
    background: rgba(20, 20, 20, 0.95);
    color: #ccc;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    z-index: 2100;
    bottom: 150%;
    left: 0;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid rgba(66, 133, 244, 0.4);
    box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    font-size: 0.75rem;
    line-height: 1.4;
    pointer-events: none;
}

.info-tooltip-wrapper .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 10px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(66, 133, 244, 0.4) transparent transparent transparent;
}

.info-tooltip-wrapper:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
    bottom: 130%;
}


@media (max-width: 600px) {
    .cookie-consent {
        flex-direction: column;
        text-align: center;
        bottom: 10px;
    }
}

/* Estilos do Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: #1a1a2e;
    border: 1px solid var(--accent-color);
    border-radius: 20px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.2);
    animation: none;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 1rem;
}

.modal-header h3 { margin: 0; color: var(--accent-color); font-size: 1.4rem; }

.close-modal {
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-dim);
    transition: color 0.2s;
}

.close-modal:hover { color: white; }

.guide-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.guide-item h4 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.guide-item p {
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-dim);
    margin: 5px 0;
}

.guide-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent-color);
}

@media (max-width: 500px) {
    .guide-grid { grid-template-columns: 1fr; }
}
/* Side Panel Styles */
.side-panel {
    position: fixed;
    top: 0;
    right: -250px; /* Hidden by default */
    width: 210px;
    height: 100vh;
    background: rgba(8, 12, 25, 0.7);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.5);
}

.side-panel.visible {
    right: 0;
}

.side-panel.collapsed {
    width: 70px;
}

.panel-header {
    padding: 25px 20px 15px 20px;
    display: flex;
    justify-content: flex-start;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.toggle-btn {
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.2);
    border-radius: 8px;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 1rem;
    padding: 8px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
}

.toggle-btn:hover {
    transform: scale(1.1);
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.4);
}

.panel-nav {
    flex: 1;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 25px;
    gap: 15px;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    overflow: hidden;
}

.nav-item i {
    font-size: 1.2rem;
    width: 24px; /* Fixed small width for icon alignment */
    min-width: 24px;
    display: flex;
    justify-content: center;
    transition: color 0.2s;
}

.side-panel.collapsed .nav-item {
    padding: 15px 0;
    justify-content: center;
}

.side-panel.collapsed .nav-item i {
    width: auto;
}

.side-panel.collapsed .nav-item span {
    display: none;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border-left: 3px solid var(--accent-color);
    padding-left: 22px;
}

.side-panel.collapsed .nav-item:hover {
    padding-left: 0;
    border-left: none;
    background: rgba(0, 212, 255, 0.1);
}

.nav-item.active {
    color: #fff;
    background: rgba(0, 212, 255, 0.2);
    border-left: 4px solid var(--accent-color);
    padding-left: 21px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.panel-footer {
    padding: 20px 0 30px 0;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.logout-item {
    color: #ff8c8c !important;
    margin: 0 10px;
    border-radius: 8px;
}

.logout-item:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    border-left-color: #ff6b6b !important;
}

/* Tooltip behavior or simpler: just title attribute as used in HTML */

/* =========================================
   LOBBY & MULTIPLAYER STYLES
   ========================================= */
.lobby-content {
    max-width: 500px;
    text-align: center;
}
.room-code-container {
    background: rgba(255, 255, 255, 0.04);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    position: relative;
}
.room-code-container h2 {
    font-family: 'Outfit', monospace;
    font-size: 2.8rem;
    color: #f1c40f;
    margin: 10px 0;
    letter-spacing: 5px;
}
#btnCopyCode {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}
#btnCopyCode:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
}
.copy-feedback {
    display: none;
    color: #2ecc71;
    font-size: 0.8rem;
    margin-left: 10px;
}
.lobby-player-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
}
.lobby-player-item {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e0e0e0;
}
.lobby-player-item:last-child {
    border-bottom: none;
}
.lobby-player-item .fa-crown {
    color: #f1c40f;
}
.lobby-footer {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}
.primary-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    border: none;
}
.primary-btn:disabled {
    background: #7f8c8d;
    cursor: not-allowed;
    opacity: 0.7;
}
.danger-btn {
    background: rgba(231, 76, 60, 0.2);
    border: 1px solid #c0392b;
}
.danger-btn:hover {
    background: rgba(231, 76, 60, 0.4);
}

/* =========================================
   SETTINGS MODAL STYLES
   ========================================= */
.settings-content-box {
    max-width: 450px;
}
.settings-body {
    text-align: left;
    padding: 10px 0;
}
.setting-item {
    margin-bottom: 25px;
}
.setting-item label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #ccc;
}
.input-group {
    display: flex;
    gap: 10px;
}
.input-group input {
    flex: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 10px;
    border-radius: 6px;
    outline: none;
}
.input-group input:focus {
    border-color: #f1c40f80;
}
.mini-btn {
    background: #f1c40f;
    color: #000;
    border: none;
    padding: 0 20px;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}
.mini-btn:hover {
    background: #d4af37;
}
.setting-hint {
    font-size: 0.75rem;
    color: #777;
    margin-top: 5px;
}
.setting-item.disabled {
    opacity: 0.4;
}
.small-placeholder {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    padding: 5px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
}
.small-placeholder.active {
    border-color: #f1c40f;
    color: #f1c40f;
}
