@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Space+Grotesk:wght@400;700&display=swap');

:root {
    --bg-dark: #070714;
    --bg-card: rgba(15, 15, 35, 0.65);
    --border-glow: rgba(0, 240, 255, 0.15);
    --border-glow-active: rgba(255, 0, 127, 0.4);
    --neon-pink: #ff007f;
    --neon-cyan: #00f0ff;
    --neon-purple: #9d4edd;
    --neon-green: #39ff14;
    --text-main: #f3f3f9;
    --text-muted: #8e8eb2;
    --font-outfit: 'Outfit', sans-serif;
    --font-space: 'Space Grotesk', sans-serif;
    --shadow-neon-pink: 0 0 15px rgba(255, 0, 127, 0.5);
    --shadow-neon-cyan: 0 0 15px rgba(0, 240, 255, 0.5);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-outfit);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Retro Neon Grid Background Effect */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(18, 18, 48, 0.4) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 18, 48, 0.4) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}

body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(20, 10, 45, 0.8) 0%, rgba(7, 7, 20, 1) 100%);
    z-index: -3;
    pointer-events: none;
}

header {
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo {
    font-family: var(--font-space);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 4px;
    background: linear-gradient(135deg, var(--neon-cyan) 0%, var(--neon-pink) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    position: relative;
    text-shadow: 0 0 30px rgba(0, 240, 255, 0.2);
}

.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
    width: 100%;
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 900px) {
    .container {
        grid-template-columns: 7fr 5fr;
    }
}

/* Glassmorphism Card Style */
.card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glow);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: 0 12px 40px 0 rgba(0, 240, 255, 0.05);
}

.card-title {
    font-family: var(--font-space);
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--neon-cyan);
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.75rem;
}

/* Leaderboard Specific Styles */
.leaderboard-list {
    list-style: none;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
    border-color: rgba(0, 240, 255, 0.15);
}

.rank-badge {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-main);
}

.rank-1 .rank-badge {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    color: #000;
}

.rank-2 .rank-badge {
    background: linear-gradient(135deg, #c0c0c0, #808080);
    box-shadow: 0 0 10px rgba(192, 192, 192, 0.5);
    color: #000;
}

.rank-3 .rank-badge {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    box-shadow: 0 0 10px rgba(205, 127, 50, 0.5);
    color: #000;
}

.player-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    margin-left: 0.75rem;
}

.player-email {
    font-weight: 500;
    color: var(--text-main);
    font-size: 0.95rem;
}

.player-score {
    font-family: var(--font-space);
    font-weight: 700;
    color: var(--neon-cyan);
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}

.no-scores {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem 0;
    font-style: italic;
}

/* User Auth Panel / Verification UI */
.auth-box {
    text-align: center;
    padding: 1.5rem 0;
}

.auth-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-family: var(--font-outfit);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

/* Buttons */
.btn {
    width: 100%;
    padding: 0.85rem 1.5rem;
    border-radius: 8px;
    font-weight: 700;
    font-family: var(--font-space);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--neon-pink);
    color: #fff;
    box-shadow: var(--shadow-neon-pink);
}

.btn-primary:hover {
    background: #ff2a9d;
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.8);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    width: auto;
    text-transform: none;
    letter-spacing: 0;
}

.btn-logout:hover {
    color: var(--neon-pink);
    border-color: var(--neon-pink);
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    min-height: 520px;
    flex-grow: 1;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    display: block;
}

/* Alerts and Notifications */
.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    border: 1px solid transparent;
}

.alert-success {
    background: rgba(57, 255, 20, 0.05);
    border-color: rgba(57, 255, 20, 0.2);
    color: #a8ff9e;
}

.alert-error {
    background: rgba(255, 0, 127, 0.05);
    border-color: rgba(255, 0, 127, 0.2);
    color: #ff9ec4;
}

.alert-info {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.2);
    color: #9effff;
}

/* User Welcome Banner */
.user-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.user-email-tag {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.user-email-tag span {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* Footer styling */
footer {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: auto;
}

.footer-link {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-link:hover {
    color: var(--neon-pink);
    text-decoration: underline;
}

/* Dev Mailbox styling */
.dev-mail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--neon-pink);
    padding-bottom: 1rem;
}

.email-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.email-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 1.5rem;
}

.email-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 0.5rem;
}

.email-body-preview {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    border-left: 3px solid var(--neon-cyan);
}

.btn-verify-dev {
    display: inline-block;
    background: var(--neon-cyan);
    color: #000;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    box-shadow: var(--shadow-neon-cyan);
    transition: all 0.2s;
}

.btn-verify-dev:hover {
    background: #5effff;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.8);
}

/* Ship selector grid styles */
.ship-card {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 0.65rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
    user-select: none;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.ship-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.3);
}

.ship-card.active {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2);
}

.ship-card.premium-locked {
    border-color: rgba(255, 215, 0, 0.25);
    background: rgba(15, 10, 0, 0.4);
}

.ship-card.premium-locked:hover {
    border-color: rgba(255, 215, 0, 0.5);
    background: rgba(15, 10, 0, 0.6);
}

.ship-card.premium-locked.active {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.ship-name {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    margin-bottom: 0.2rem;
}

.ship-meta {
    font-size: 0.58rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}
