:root {
    --bg-color: #050510;
    --neon-green: #39ff14;
    --neon-blue: #00ffff;
    --neon-pink: #ff00ff;
    --neon-red: #ff3131;
    --text-color: #ffffff;
    --scanline-color: rgba(0, 0, 0, 0.5);
    --hud-font: 'Orbitron', sans-serif;
    --body-font: 'Share Tech Mono', monospace;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--body-font);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.scanlines {
    display: none;
    /* OPTIMIZATION: Disabled for performance */
}

@keyframes scanlineScroll {
    0% {
        transform: translateY(0);
    }

    100% {
        transform: translateY(4px);
    }
}

.game-container {
    position: relative;
    width: 600px;
    height: 800px;
    max-width: 100%;
    max-height: 100vh;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue), inset 0 0 20px rgba(0, 255, 255, 0.2);
    border-radius: 4px;
    background: radial-gradient(circle at center, #1a1a2e 0%, #050510 100%);
}

canvas {
    width: 100%;
    height: 100%;
}

.hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--hud-font);
    z-index: 10;
    text-shadow: 0 0 5px var(--neon-blue);
}

.label {
    font-size: 0.8rem;
    color: var(--neon-blue);
    display: block;
    margin-bottom: 5px;
}

.title-display {
    display: none;
    /* Hide title to make room for scores/timer */
}

.score-board span:last-child,
.lives-board span:last-child,
.time-board span:last-child {
    font-size: 1.5rem;
    font-weight: 700;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(5, 5, 16, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 20;
    backdrop-filter: blur(5px);
}

.overlay h1 {
    font-family: var(--hud-font);
    font-size: 3rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, var(--neon-blue), var(--neon-pink));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.overlay.hidden {
    display: none;
}

.mobile-start-buttons {
    display: none;
}

.blink {
    animation: blinker 1s linear infinite;
    color: var(--neon-green);
}

@keyframes blinker {
    50% {
        opacity: 0;
    }
}

.controls-hint {
    margin-top: 40px;
    display: flex;
    gap: 20px;
    font-size: 1.4rem;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.9);
}

.danger {
    color: var(--neon-red) !important;
    background: none !important;
    -webkit-text-fill-color: var(--neon-red) !important;
    text-shadow: 0 0 20px var(--neon-red) !important;
}

/* Mobile Controls */
.mobile-controls {
    display: none;
    /* Hidden by default */
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    padding: 0 20px;
    justify-content: space-between;
    align-items: flex-end;
    pointer-events: none;
    /* Let clicks pass through container */
    z-index: 1000;
}

@media (max-width: 1024px) {
    .mobile-controls {
        display: flex;
    }
}

.d-pad {
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.d-pad .horizontal {
    display: flex;
    gap: 10px;
}

.mobile-controls button {
    background: rgba(0, 255, 255, 0.2);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: manipulation;
    user-select: none;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-blue);
}

.mobile-controls button:active {
    background: var(--neon-blue);
    color: #000;
}

.shoot-btn {
    pointer-events: auto;
    width: 80px !important;
    height: 80px !important;
    border-color: var(--neon-red) !important;
    color: var(--neon-red) !important;
    box-shadow: 0 0 10px var(--neon-red) !important;
    font-size: 2rem !important;
}

.shoot-btn:active {
    background: var(--neon-red) !important;
    color: #fff !important;
}

.high-scores {
    margin-top: 30px;
    width: 80%;
    max-width: 400px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-blue);
    padding: 15px;
    border-radius: 4px;
}

.high-scores h3 {
    color: var(--neon-pink);
    font-size: 1.2rem;
    margin-bottom: 15px;
    text-shadow: 0 0 5px var(--neon-pink);
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
    padding-bottom: 5px;
}

#scoreList {
    list-style: none;
    padding: 0;
    text-align: left;
}

#scoreList li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1rem;
    color: #fff;
}

#scoreList li span.name {
    color: var(--neon-green);
}

#scoreList li span.score {
    color: var(--neon-blue);
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 450px;
}

.login-form input {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--neon-blue);
    color: var(--neon-blue);
    padding: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.4rem;
    text-align: center;
    border-radius: 6px;
    outline: none;
    transition: all 0.3s;
}

.login-form input:focus {
    box-shadow: 0 0 20px var(--neon-blue);
    background: rgba(0, 255, 255, 0.15);
}

.login-form button {
    background: var(--neon-blue);
    color: #000;
    border: none;
    padding: 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    cursor: pointer;
    margin-top: 15px;
    clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    transition: all 0.2s;
}

.login-form button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 20px var(--neon-blue);
    background: #fff;
}

/* Social Hub Styles */
.social-btn {
    background: linear-gradient(45deg, #00ffff, #0066ff);
    color: #000;
    border: none;
    padding: 10px 20px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    cursor: pointer;
    margin-bottom: 15px;
    clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
    transition: all 0.2s;
}

.social-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.social-container {
    width: 350px;
    max-width: 90vw;
}

.add-friend-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.add-friend-section input {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ffff;
    color: #fff;
    padding: 10px;
    font-family: 'Share Tech Mono', monospace;
    flex-grow: 1;
}

.friend-list-container {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #333;
    padding: 15px;
    min-height: 200px;
    text-align: left;
}

.friend-list-container h3 {
    color: #39ff14;
    font-size: 1rem;
    border-bottom: 1px solid #333;
    padding-bottom: 5px;
    margin-top: 0;
}

#friendList {
    list-style: none;
    padding: 0;
    margin: 0;
}

#friendList li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friend-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 10px;
}

.status-online {
    background: #39ff14;
    box-shadow: 0 0 5px #39ff14;
}

.status-offline {
    background: #666;
}

html,
body {
    touch-action: none;
    /* Prevent scrolling/zooming */
    overflow: hidden;
}

@media (max-width: 1024px) {
    .mobile-start-buttons {
        display: flex;
        flex-direction: column;
        gap: 15px;
        margin-top: 20px;
        width: 100%;
        align-items: center;
        margin-bottom: 20px;
    }

    .mobile-start-buttons button {
        background: var(--neon-blue);
        color: #000;
        border: none;
        padding: 15px 30px;
        font-family: 'Orbitron', sans-serif;
        font-weight: 900;
        font-size: 1.2rem;
        width: 80%;
        clip-path: polygon(10% 0, 100% 0, 100% 70%, 90% 100%, 0 100%, 0 30%);
    }

    /* Make text instructions smaller on mobile to fit */
    .controls-hint {
        font-size: 1rem;
        flex-direction: column;
    }
}