/* Space WOW - Auth & Leaderboard Styles */

#space-wow-auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: swFadeIn 0.3s ease;
}

@keyframes swFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sw-auth-box {
    background: linear-gradient(135deg, #0a0b1a, #1a1b3f);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 40px rgba(0, 212, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sw-auth-logo {
    font-size: 4rem;
    margin-bottom: 10px;
    animation: swRocketBounce 2s ease-in-out infinite;
}

@keyframes swRocketBounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.sw-auth-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.8rem;
    color: #00d4ff;
    margin: 0 0 10px;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.sw-auth-subtitle {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.4;
}

.sw-auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #4b5563;
    font-size: 0.7rem;
    letter-spacing: 1px;
}

.sw-auth-divider::before,
.sw-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
}

.sw-auth-note {
    color: #666;
    font-size: 0.7rem;
    margin-top: 14px;
}

.sw-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    max-width: 320px;
    padding: 14px 24px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: transparent;
    box-sizing: border-box;
    white-space: nowrap;
}

.sw-btn:hover {
    transform: scale(1.03);
}

.sw-btn-primary {
    color: #00d4ff;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3), inset 0 0 10px rgba(0, 212, 255, 0.1);
}

.sw-btn-primary:hover {
    background: rgba(0, 212, 255, 0.15);
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
}

.sw-btn-secondary {
    color: #aaa;
    border-color: #555;
}

.sw-btn-secondary:hover {
    border-color: #888;
    color: #fff;
}

.sw-input {
    background: rgba(10, 10, 26, 0.8);
    border: 2px solid #555;
    border-radius: 8px;
    padding: 12px 16px;
    color: white;
    font-size: 1rem;
    width: 100%;
    max-width: 250px;
    text-align: center;
    margin: 10px auto;
    display: block;
    box-sizing: border-box;
}

.sw-input:focus {
    outline: none;
    border-color: #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.sw-avatar-grid {
    display: grid;
    grid-template-columns: repeat(6, 50px);
    gap: 10px;
    justify-content: center;
    margin: 16px 0;
}

.sw-avatar-option {
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    border-radius: 50%;
    border: 3px solid #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 26, 0.8);
    transition: all 0.2s;
}

.sw-avatar-option:hover {
    border-color: #00d4ff;
    transform: scale(1.1);
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.sw-avatar-option.selected {
    border-color: #39ff14;
    background: rgba(57, 255, 20, 0.1);
    box-shadow: 0 0 10px rgba(57, 255, 20, 0.4);
}

/* Player Bar */
#sw-player-bar {
    position: fixed;
    top: 10px;
    left: 10px;
    display: none;
    align-items: center;
    gap: 8px;
    background: rgba(10, 10, 26, 0.85);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 10px;
    padding: 8px 14px;
    z-index: 5000;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #eee;
    font-size: 0.85rem;
}

.sw-bar-avatar {
    font-size: 1.3rem;
}

.sw-bar-name {
    font-weight: 600;
}

.sw-bar-signout {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    padding: 4px 8px;
    margin-left: 6px;
    min-width: auto;
    max-width: none;
    transition: border-color 0.2s;
}

.sw-bar-signout:hover {
    border-color: rgba(255, 0, 64, 0.5);
    background: rgba(255, 0, 64, 0.1);
}

/* Main Screen Leaderboard */
#sw-main-leaderboard {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    max-width: 90vw;
    background: rgba(10, 10, 26, 0.9);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 16px;
    z-index: 5000;
    text-align: center;
    display: none;
}

.sw-main-lb-title {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 0.85rem;
    color: #00d4ff;
    margin: 0 0 10px;
    letter-spacing: 1px;
}

/* Leaderboard Overlay */
#sw-leaderboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 20px;
    animation: swFadeIn 0.3s ease;
}

.sw-lb-box {
    background: linear-gradient(135deg, #0a0b1a, #1a1b3f);
    border: 1px solid rgba(57, 255, 20, 0.3);
    border-radius: 16px;
    padding: 30px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 0 30px rgba(57, 255, 20, 0.1);
}

.sw-lb-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(57, 255, 20, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: #eee;
    font-size: 0.85rem;
}

.sw-lb-row:last-child {
    border: none;
}

.sw-lb-rank {
    min-width: 24px;
    font-weight: bold;
    color: #00d4ff;
    text-align: center;
}

.sw-lb-avatar {
    font-size: 1.3rem;
    width: 28px;
    text-align: center;
}

.sw-lb-name {
    flex: 1;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sw-lb-score {
    color: #39ff14;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.5);
}

@media (max-width: 480px) {
    .sw-auth-box {
        padding: 28px 20px;
    }

    .sw-auth-title {
        font-size: 1.3rem;
    }

    .sw-avatar-grid {
        grid-template-columns: repeat(4, 48px);
    }

    .sw-avatar-option {
        width: 48px;
        height: 48px;
        font-size: 1.6rem;
    }
}

@media (max-width: 800px) {
    #sw-player-bar {
        top: auto;
        bottom: 220px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    #sw-main-leaderboard {
        bottom: 5% !important;
        top: auto !important;
        transform: translateX(-50%);
    }
}
