[x-cloak] {
    display: none !important;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a1a;
    background-image: radial-gradient(ellipse at 50% 0%, rgba(0, 240, 255, 0.03) 0%, transparent 60%);
    color: #e0e0ff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 10px;
    font-size: 24px;
    letter-spacing: 3px;
    color: #00f0ff;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5), 0 0 30px rgba(0, 240, 255, 0.2);
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#main-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

#canvas-wrapper {
    position: relative;
    border-radius: 6px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.1), inset 0 0 15px rgba(0, 240, 255, 0.05);
}

#game-canvas {
    width: 800px;
    height: 790px;
    aspect-ratio: 800 / 790;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 6px;
    cursor: pointer;
    display: block;
}

#start-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

#start-overlay.hidden {
    display: none;
}

#start-btn {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #00ff88, #00cc66);
    color: #0a0a1a;
    font-size: 32px;
    padding: 20px 60px;
    letter-spacing: 4px;
    font-weight: 900;
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4), 0 0 60px rgba(0, 255, 136, 0.15);
    transition: box-shadow 0.3s, transform 0.2s;
}

#start-btn:hover {
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.6), 0 0 80px rgba(0, 255, 136, 0.25);
    transform: scale(1.02);
}

button {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: box-shadow 0.3s, background 0.2s, transform 0.2s;
}

#status {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #7a7a9a;
    min-height: 20px;
}

.hidden {
    display: none !important;
}

#game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 800px;
    margin-bottom: 20px;
}

#header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

#game-header h1 {
    margin-bottom: 0;
}

#howtoplay-btn,
#about-btn {
    background: transparent;
    color: #00f0ff;
    padding: 6px 14px;
    font-size: 12px;
    border: 1px solid rgba(0, 240, 255, 0.4);
    border-radius: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

#howtoplay-btn:hover,
#about-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    color: #e0e0ff;
}

#auth-section {
    display: flex;
    align-items: center;
    gap: 10px;
}

#sign-in-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    background: linear-gradient(135deg, #cc44ff, #9900cc);
    color: white;
    border: 1px solid rgba(204, 68, 255, 0.6);
    box-shadow: 0 0 12px rgba(204, 68, 255, 0.4), 0 0 30px rgba(204, 68, 255, 0.15);
}

#sign-in-btn:hover {
    box-shadow: 0 0 20px rgba(204, 68, 255, 0.6), 0 0 50px rgba(204, 68, 255, 0.25);
}

#avatar-menu {
    position: relative;
}

#user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #cc44ff;
    box-shadow: 0 0 10px rgba(204, 68, 255, 0.5), 0 0 20px rgba(204, 68, 255, 0.2);
    cursor: pointer;
    transition: box-shadow 0.3s, transform 0.2s;
}

#user-avatar:hover {
    box-shadow: 0 0 16px rgba(204, 68, 255, 0.7), 0 0 30px rgba(204, 68, 255, 0.3);
    transform: scale(1.05);
}

#avatar-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 180px;
    background: #111128;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 6px;
    padding: 8px 0;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.15), 0 0 60px rgba(0, 240, 255, 0.05);
    z-index: 100;
}

.dropdown-name {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #e0e0ff;
    padding: 8px 16px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    margin-bottom: 4px;
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: #7a7a9a;
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    padding: 8px 16px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.dropdown-item:hover {
    background: rgba(0, 240, 255, 0.08);
    color: #00f0ff;
}

.dropdown-signout {
    color: #ff00aa;
}

.dropdown-signout:hover {
    background: rgba(255, 0, 170, 0.08);
    color: #ff00aa;
}

#persistence-controls {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

#save-game-btn,
#load-game-btn,
#share-btn {
    background: transparent;
    color: #7a7a9a;
    padding: 8px 14px;
    font-size: 12px;
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 4px;
}

#save-game-btn:hover,
#load-game-btn:hover,
#share-btn:hover {
    color: #00f0ff;
    border-color: rgba(0, 240, 255, 0.5);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

#site-footer {
    width: 100%;
    max-width: 800px;
    margin-top: 30px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 240, 255, 0.15);
    font-size: 13px;
    color: #7a7a9a;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

#site-footer a {
    color: #00f0ff;
    text-decoration: none;
    transition: text-shadow 0.3s;
}

#site-footer a:hover {
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.5);
}

/* Mobile Responsive Styles */
@media (max-width: 900px) {
    body {
        padding: 10px;
    }

    #game-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    #game-header h1 {
        font-size: 20px;
    }

    #game-canvas {
        max-width: 100%;
        height: auto !important;
        touch-action: manipulation;
    }

    #persistence-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    #game-header h1 {
        font-size: 16px;
        letter-spacing: 1px;
    }

    button {
        padding: 12px 16px;
        font-size: 13px;
        min-height: 44px;
    }

    #status {
        font-size: 12px;
        text-align: center;
    }
}
