/**
 * Global Styles for Final Block Space
 */
:root {
    --bg-dark: #0a0a0a;
    --accent: #f1c40f;
    --card-bg: #1a1a1a;
    --bitcoin-orange: #F7931A;
}

/* PWA Install Button Styling */
#pwa-install-btn {
    display: none;
    /* Managed by pwa_install.js */
    background: var(--bitcoin-orange);
    color: #000;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    transition: all 0.2s;
    cursor: pointer;
    white-space: nowrap;
}

#pwa-install-btn:hover {
    filter: brightness(1.2);
    transform: scale(1.02);
}

/* --- Lobby & General Styles --- */

body {
    background-color: var(--bg-dark);
    color: #fff;
    font-family: 'Outfit', sans-serif;
    min-height: 100vh;
}

.lobby-hero {
    padding: 42px 0 21px;
    text-align: center;
    background: radial-gradient(circle at center, rgba(241, 196, 15, 0.1) 0%, transparent 70%);
}

.hero-title {
    font-size: 80px;
    font-weight: 900;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: -2px;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.4);
}

.hero-subtitle {
    font-size: 20px;
    color: #888;
    letter-spacing: 5px;
    text-transform: uppercase;
}

.game-card {
    background: var(--card-bg);
    border: 2px solid #333;
    border-radius: 20px;
    padding: 10px;
    transition: all 0.3s;
    text-align: center;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.game-card:hover {
    border-color: var(--accent);
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.game-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 15px;
    margin-bottom: 15px;
    object-fit: cover;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.game-meta {
    color: #888;
    font-size: 14px;
    margin-bottom: 25px;
}

.game-meta span {
    color: var(--accent);
    font-weight: 700;
}

.lobby-action-btn {
    background: var(--accent);
    color: #000;
    font-weight: 900;
    padding: 12px 30px;
    border-radius: 12px;
    text-decoration: none;
    text-transform: uppercase;
    display: block;
    text-align: center;
}

.lobby-action-btn:hover {
    background: #d4ac0d;
    color: #000;
}

/* Mode Visibility Toggles */
.mode-pvp-btn,
.mode-pvp-text {
    display: none;
}

.mode-solo-btn,
.mode-solo-text {
    display: block;
}

body.mode-pvp .mode-pvp-btn,
body.mode-pvp .mode-pvp-text {
    display: block;
}

body.mode-pvp .mode-solo-btn,
body.mode-pvp .mode-solo-text {
    display: none;
}

/* Override PvP text highlights */
body.mode-pvp .game-meta span {
    color: #e74c3c;
}


/* Mobile Adjustments for Lobby */
@media (max-width: 768px) {
    .hero-title {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 14px;
        letter-spacing: 3px;
    }

    .lobby-hero {
        padding: 42px 0 21px;
    }
}

/* --- Smart Mobile Layout & Immersive Mode --- */

/* Immersive Mode: Hide Global HUD (Mobile Only) */
@media (max-width: 768px) {
    body.immersive-mode #global-hud {
        display: none !important;
    }

    body.immersive-mode {
        padding-top: 0 !important;
        /* Remove padding reserved for HUD */
    }
}

/* Floating Exit Button (Home) */
#exit-game-btn {
    position: fixed;
    top: 15px;
    left: 15px;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    cursor: pointer;
    font-size: 20px;
}

#exit-game-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

/* --- Utility Animations --- */
.thunder-icon {
    font-size: 5rem;
    color: var(--accent);
    display: none;
    margin: 1rem 0;
    animation: thunder-pulse 2s infinite;
}

@keyframes thunder-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--accent));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 15px var(--accent));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0px var(--accent));
    }
}

/* --- Lobby Footer --- */
.lobby-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: auto;
    z-index: 1000;
    pointer-events: none;
}

.footer-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    z-index: 1;
}

.footer-content {
    position: relative;
    float: right;
    background: #0d0d0d;
    padding: 10px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 3px solid var(--accent);
    border-left: 3px solid var(--accent);
    border-top-left-radius: 20px;
    z-index: 2;
    margin-right: -1px;
    /* Overlap right edge slightly */
    pointer-events: auto;
}

.footer-content span.small {
    color: rgba(255, 255, 255, 0.4);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.footer-logo {
    height: 22px;
    width: auto;
    filter: grayscale(1) brightness(2);
    opacity: 0.6;
    transition: all 0.2s ease;
}

.footer-logo:hover {
    filter: grayscale(0) brightness(1);
    opacity: 1;
}

.footer-socials {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 15px;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.social-link {
    color: rgba(255, 255, 255, 0.4);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-2px);
}

.social-icon {
    width: 22px;
    height: 22px;
}

/* Ensure Canvas Container is Centered */
#game-container,
canvas {
    display: block;
    margin: 0 auto;
}