/* Custom Properties - Color System */
:root {
    --bg-dark: #05050c;
    --bg-panel: rgba(10, 10, 25, 0.65);
    --border-color: rgba(0, 243, 255, 0.2);
    
    --color-p1: #00f3ff;
    --color-p1-glow: rgba(0, 243, 255, 0.5);
    --color-p2: #ff007f;
    --color-p2-glow: rgba(255, 0, 127, 0.5);
    --color-special: #ffaa00;
    --color-special-glow: rgba(255, 170, 0, 0.5);
    
    --color-vanguard: #ff3c3c;
    --color-aegis: #0084ff;
    --color-specter: #c400ff;
    
    --font-primary: 'Outfit', sans-serif;
    --font-title: 'Orbitron', sans-serif;
}

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

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-primary);
    color: #ffffff;
}

/* Background animated stars */
.stars-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: url('start_screen_bg.png') no-repeat center center;
    background-size: cover;
    z-index: 1;
    overflow: hidden;
    animation: bgPulse 60s ease-in-out infinite alternate;
    transition: background 0.8s ease; /* smooth fade in/out of background image */
}

.stars-bg.ingame {
    background: radial-gradient(circle at center, #11112b 0%, #05050c 100%);
    animation: none; /* disable zoom animation to save GPU/performance during game */
}

@keyframes bgPulse {
    0% { transform: scale(1.0); }
    100% { transform: scale(1.15); }
}

.stars-bg::after {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background-image: 
        radial-gradient(1px 1px at 10px 30px, #eee, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 70px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 150px 120px, #ddd, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 220px 180px, #fff, rgba(0,0,0,0)),
        radial-gradient(2px 2px at 300px 350px, #fff, rgba(0,0,0,0));
    background-size: 550px 550px;
    opacity: 0.35;
    animation: starsRotate 240s linear infinite;
}

@keyframes starsRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Game container */
#game-container {
    position: relative;
    z-index: 2;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: transparent;
}

#game-container.playing #game-canvas {
    cursor: none;
}

/* UI Screens Styling */
.ui-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, rgba(5, 5, 15, 0.55) 0%, rgba(3, 3, 7, 0.82) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.ui-screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* Header & Text Design */
.game-title {
    font-family: var(--font-title);
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: 0.5rem;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2), 0 0 40px var(--color-p1-glow);
    margin-bottom: 0.5rem;
    animation: pulseGlow 3s ease-in-out infinite alternate;
}

.game-title .highlight {
    color: var(--color-p1);
    text-shadow: 0 0 20px var(--color-p1-glow);
}

.game-subtitle {
    font-family: var(--font-primary);
    font-size: 1rem;
    letter-spacing: 0.4rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 3.5rem;
}

.screen-title {
    font-family: var(--font-title);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.2rem;
    margin-bottom: 1rem;
    text-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.screen-title.highlight {
    color: var(--color-p2);
    text-shadow: 0 0 20px var(--color-p2-glow);
}

.select-instructions {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2rem;
    letter-spacing: 0.1rem;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

/* Buttons */
.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 320px;
}

.btn {
    position: relative;
    padding: 1.1rem 2rem;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    font-family: var(--font-title);
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.15rem;
    cursor: pointer;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.btn-primary {
    border-color: rgba(0, 243, 255, 0.4);
}

.btn-primary:hover {
    border-color: var(--color-p1);
    box-shadow: 0 0 20px var(--color-p1-glow);
    transform: translateY(-2px);
}

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

.btn-secondary {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.03);
}

.btn-secondary:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.08);
}

.btn-text {
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: radial-gradient(circle, var(--color-p1-glow) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
    z-index: 1;
}

.btn:hover .btn-glow {
    width: 250px;
    height: 250px;
    opacity: 1;
}

/* Ship Class Cards */
.class-cards-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    width: 90%;
    max-width: 1000px;
    justify-content: center;
}

.class-card {
    flex: 1;
    max-width: 280px;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.class-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #ffffff;
    opacity: 0.5;
}

.class-card.vanguard::before { background: var(--color-vanguard); }
.class-card.aegis::before { background: var(--color-aegis); }
.class-card.specter::before { background: var(--color-specter); }

.class-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.25);
    background: rgba(15, 15, 35, 0.8);
}

.class-card.vanguard:hover { box-shadow: 0 10px 30px rgba(255, 60, 60, 0.15); }
.class-card.aegis:hover { box-shadow: 0 10px 30px rgba(0, 132, 255, 0.15); }
.class-card.specter:hover { box-shadow: 0 10px 30px rgba(196, 0, 255, 0.15); }

.class-icon {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.class-name {
    font-family: var(--font-title);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: 0.1rem;
}

.class-card.vanguard .class-name { color: var(--color-vanguard); }
.class-card.aegis .class-name { color: var(--color-aegis); }
.class-card.specter .class-name { color: var(--color-specter); }

.class-role {
    font-size: 0.75rem;
    letter-spacing: 0.15rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

/* Ship CSS Drawing in Card */
.ship-preview {
    width: 60px;
    height: 60px;
    margin-bottom: 1.5rem;
    position: relative;
}

#preview-vanguard {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 55px solid var(--color-vanguard);
    filter: drop-shadow(0 0 10px rgba(255, 60, 60, 0.7));
}

#preview-aegis {
    width: 50px;
    height: 50px;
    background: transparent;
    border: 3px solid var(--color-aegis);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    filter: drop-shadow(0 0 10px rgba(0, 132, 255, 0.7));
    margin: 5px auto 15px auto;
}

#preview-specter {
    width: 50px;
    height: 50px;
    background: var(--color-specter);
    clip-path: polygon(50% 0%, 100% 80%, 75% 100%, 50% 75%, 25% 100%, 0% 80%);
    filter: drop-shadow(0 0 10px rgba(196, 0, 255, 0.7));
    margin: 5px auto 15px auto;
}

/* Stat bar grid */
.class-stats {
    width: 100%;
    margin-bottom: 1.5rem;
}

.stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.8rem;
}

.stat-label {
    color: rgba(255, 255, 255, 0.6);
    width: 60px;
}

.stat-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-left: 0.5rem;
}

.stat-fill {
    height: 100%;
    background: #ffffff;
    border-radius: 3px;
}

.class-card.vanguard .stat-fill { background: var(--color-vanguard); }
.class-card.aegis .stat-fill { background: var(--color-aegis); }
.class-card.specter .stat-fill { background: var(--color-specter); }

.special-info {
    text-align: center;
    font-size: 0.8rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 1rem;
    width: 100%;
}

.special-info strong {
    display: block;
    color: var(--color-special);
    font-family: var(--font-title);
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
}

.special-info p {
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.2;
}

/* Controls Grid */
.controls-grid {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    width: 90%;
    max-width: 900px;
}

.player-controls-panel {
    flex: 1;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
}

.player-controls-panel h3 {
    font-family: var(--font-title);
    color: var(--color-p1);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 243, 255, 0.15);
    padding-bottom: 0.5rem;
}

.player-controls-panel:nth-child(2) h3 {
    color: var(--color-p2);
    border-bottom-color: rgba(255, 0, 127, 0.15);
}

.player-controls-panel ul {
    list-style-type: none;
}

.player-controls-panel li {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.key {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-bottom-width: 3px;
    border-radius: 4px;
    padding: 0.2rem 0.5rem;
    font-weight: 700;
    margin-right: 0.5rem;
    font-family: var(--font-title);
    font-size: 0.8rem;
    display: inline-block;
    min-width: 30px;
    text-align: center;
}

.instructions-details {
    width: 90%;
    max-width: 900px;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.instructions-details h3 {
    font-family: var(--font-title);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: #ffffff;
}

.instructions-details p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.instructions-details p strong {
    color: #ffffff;
}

#controls-menu, #class-select {
    overflow-y: auto;
    padding: 2rem 0;
}

/* HUD Overlay */
.hud-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none; /* Let clicks pass through to canvas if needed */
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.hud-overlay.active {
    opacity: 1;
}

.player-hud {
    background: rgba(10, 10, 20, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 6px;
    padding: 1rem;
    width: 250px;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.p-indicator {
    font-family: var(--font-title);
    font-weight: 900;
    font-size: 1.1rem;
}

.text-p1 {
    color: var(--color-p1);
    text-shadow: 0 0 10px var(--color-p1-glow);
}

.text-p2 {
    color: var(--color-p2);
    text-shadow: 0 0 10px var(--color-p2-glow);
}

.ship-type-label {
    font-size: 0.8rem;
    letter-spacing: 0.1rem;
    text-transform: uppercase;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.hud-bar-container {
    display: flex;
    align-items: center;
    margin-bottom: 0.4rem;
}

.bar-label {
    font-size: 0.65rem;
    font-weight: 700;
    width: 50px;
    color: rgba(255, 255, 255, 0.5);
}

.hud-bar {
    flex: 1;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.hud-bar .fill {
    height: 100%;
    width: 0%;
    transition: width 0.1s ease-out;
}

.bg-p1 {
    background: linear-gradient(90deg, #0084ff, var(--color-p1));
    box-shadow: 0 0 8px var(--color-p1-glow);
}

.bg-p2 {
    background: linear-gradient(90deg, #c400ff, var(--color-p2));
    box-shadow: 0 0 8px var(--color-p2-glow);
}

.bg-special {
    background: linear-gradient(90deg, #ff6a00, var(--color-special));
    box-shadow: 0 0 8px var(--color-special-glow);
}

.weapon-level {
    font-size: 0.7rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-align: right;
    margin-top: 0.25rem;
    letter-spacing: 0.05rem;
}

/* Center HUD elements */
.center-hud {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(10, 10, 20, 0.4);
    padding: 0.5rem 1.5rem;
    border-radius: 0 0 8px 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-top: none;
    min-width: 180px;
}

#hud-score-label {
    font-size: 0.65rem;
    letter-spacing: 0.2rem;
    color: rgba(255, 255, 255, 0.4);
}

#hud-score {
    font-family: var(--font-title);
    font-size: 1.6rem;
    font-weight: 900;
    letter-spacing: 0.1rem;
    color: #ffffff;
    text-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
}

#hud-wave-container {
    font-size: 0.75rem;
    margin-top: 0.15rem;
    letter-spacing: 0.1rem;
    color: var(--color-special);
    font-weight: 700;
}

/* Results Overlays */
.game-results {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
    text-align: center;
}

/* Animations */
@keyframes pulseGlow {
    from {
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.1), 0 0 30px var(--color-p1-glow);
    }
    to {
        text-shadow: 0 0 30px rgba(255, 255, 255, 0.3), 0 0 60px var(--color-p1-glow);
    }
}

.hidden {
    display: none !important;
}

/* Custom Scrollbar for Selection UI */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Multiplayer Online Setup Styles */
.room-code-display {
    font-family: var(--font-title);
    font-size: 3rem;
    font-weight: 900;
    color: var(--color-special);
    text-shadow: 0 0 15px var(--color-special-glow);
    background: rgba(255, 170, 0, 0.05);
    border: 1px dashed var(--color-special);
    border-radius: 6px;
    padding: 1rem 2rem;
    margin: 1.5rem 0;
    letter-spacing: 0.2rem;
    text-align: center;
}

.connection-status-msg {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    letter-spacing: 0.05rem;
    animation: statusBlink 1.5s ease-in-out infinite alternate;
}

@keyframes statusBlink {
    from { opacity: 0.5; }
    to { opacity: 1.0; }
}

.room-code-input {
    background: rgba(10, 10, 25, 0.8);
    border: 1.5px solid var(--border-color);
    border-radius: 4px;
    color: #ffffff;
    font-family: var(--font-title);
    font-size: 1.8rem;
    padding: 0.8rem 1.5rem;
    text-align: center;
    width: 280px;
    letter-spacing: 0.3rem;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
    outline: none;
    transition: all 0.3s ease;
}

.room-code-input:focus {
    border-color: var(--color-p1);
    box-shadow: 0 0 18px var(--color-p1-glow);
}

/* Settings Menu Custom Styles */
.settings-content {
    width: 90%;
    max-width: 800px;
    max-height: 55vh;
    overflow-y: auto;
    margin: 1.2rem 0;
    padding: 1.2rem;
    background: rgba(10, 10, 25, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.settings-section.row-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1 1 300px;
    align-items: flex-start;
}

.setting-option label {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.05rem;
    color: rgba(255, 255, 255, 0.8);
}

.setting-buttons {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.btn-choice {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    padding: 0.6rem 1rem;
    font-family: var(--font-title);
    font-size: 0.85rem;
    font-weight: 700;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-choice:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-choice.active {
    background: rgba(0, 243, 255, 0.12);
    border-color: var(--color-p1);
    color: #ffffff;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.2);
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

#btn-gfx-low.active {
    background: rgba(255, 170, 0, 0.12);
    border-color: var(--color-special);
    box-shadow: 0 0 10px var(--color-special-glow);
}

.settings-subtitle {
    font-family: var(--font-title);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 0.1rem;
    color: var(--color-special);
    margin: 1.2rem 0 0.8rem 0;
    text-align: center;
    text-shadow: 0 0 10px var(--color-special-glow);
}

.controls-remap-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 600px) {
    .controls-remap-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

.remap-column {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.remap-column .column-header {
    font-family: var(--font-title);
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 0.08rem;
    padding-bottom: 0.4rem;
    border-bottom: 1.5px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.remap-column:first-child .column-header {
    color: var(--color-p1);
    text-shadow: 0 0 8px rgba(0, 243, 255, 0.3);
}

.remap-column:last-child .column-header {
    color: var(--color-p2);
    text-shadow: 0 0 8px rgba(255, 0, 127, 0.3);
}

.binding-rows {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.binding-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    padding: 0.4rem 0.8rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.binding-row span {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.btn-keybind {
    width: 130px;
    background: rgba(10, 10, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    font-family: var(--font-title);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.btn-keybind:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(20, 20, 35, 0.9);
}

.btn-keybind.listening {
    border-color: #ff007f;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
    animation: keybindPulse 1s infinite alternate;
    color: #ff007f;
}

@keyframes keybindPulse {
    from { opacity: 0.6; box-shadow: 0 0 5px rgba(255, 0, 127, 0.2); }
    to { opacity: 1; box-shadow: 0 0 15px rgba(255, 0, 127, 0.6); }
}

.settings-foot button {
    margin: 0.5rem;
}

/* Highscore Table Styling */
.main-menu-layout {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    align-items: stretch;
    justify-content: center;
    margin-top: 1rem;
}

.highscore-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem 2rem;
    width: 380px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.highscore-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--color-p1), var(--color-p2));
}

.highscore-title {
    font-family: var(--font-title);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.15rem;
    text-align: center;
    margin-bottom: 1.2rem;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.highscore-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex-grow: 1;
}

.highscore-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.highscore-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateX(4px);
    border-color: rgba(0, 243, 255, 0.15);
}

.highscore-rank {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: bold;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-right: 0.5rem;
}

/* Medal Styles */
.rank-1 {
    background: rgba(255, 215, 0, 0.2);
    border: 1px solid rgb(255, 215, 0);
    color: rgb(255, 215, 0);
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.rank-2 {
    background: rgba(192, 192, 192, 0.2);
    border: 1px solid rgb(192, 192, 192);
    color: rgb(192, 192, 192);
}

.rank-3 {
    background: rgba(205, 127, 50, 0.2);
    border: 1px solid rgb(205, 127, 50);
    color: rgb(205, 127, 50);
}

.rank-other {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.highscore-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.highscore-score-val {
    font-family: var(--font-title);
    font-size: 1.1rem;
    font-weight: bold;
    color: #ffffff;
}

.highscore-meta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    gap: 0.5rem;
    margin-top: 0.1rem;
}

.highscore-mode-badge {
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: bold;
    letter-spacing: 0.05rem;
}

.badge-solo {
    background: rgba(0, 243, 255, 0.15);
    color: var(--color-p1);
    border: 1px solid rgba(0, 243, 255, 0.3);
}

.badge-coop {
    background: rgba(255, 0, 127, 0.15);
    color: var(--color-p2);
    border: 1px solid rgba(255, 0, 127, 0.3);
}

.btn-reset-highscores {
    margin-top: 1rem;
    padding: 0.5rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.4);
    font-family: var(--font-title);
    font-size: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-reset-highscores:hover {
    border-color: rgba(255, 0, 127, 0.4);
    color: var(--color-p2);
    background: rgba(255, 0, 127, 0.05);
}

@media (max-width: 800px) {
    .main-menu-layout {
        flex-direction: column;
        align-items: center;
        gap: 1.5rem;
    }
}

