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

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
    position: relative;
    padding: 20px;
}

/* Animated background particles */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.3), transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.2), transparent),
        radial-gradient(1px 1px at 90px 40px, rgba(255,255,255,0.4), transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.3), transparent),
        radial-gradient(1px 1px at 230px 80px, rgba(255,255,255,0.2), transparent),
        radial-gradient(2px 2px at 300px 150px, rgba(255,255,255,0.4), transparent),
        radial-gradient(1px 1px at 400px 60px, rgba(255,255,255,0.3), transparent);
    background-size: 500px 200px;
    animation: twinkle 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

h1 {
    font-family: 'Russo One', sans-serif;
    font-size: 2.5rem;
    color: #e94560;
    text-shadow: 
        0 0 10px rgba(233, 69, 96, 0.8),
        0 0 20px rgba(233, 69, 96, 0.6),
        0 0 40px rgba(233, 69, 96, 0.4);
    margin-bottom: 15px;
    letter-spacing: 4px;
    z-index: 1;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { text-shadow: 0 0 10px rgba(233, 69, 96, 0.8), 0 0 20px rgba(233, 69, 96, 0.6); }
    to { text-shadow: 0 0 20px rgba(233, 69, 96, 1), 0 0 40px rgba(233, 69, 96, 0.8), 0 0 60px rgba(233, 69, 96, 0.6); }
}

.game-container {
    position: relative;
    z-index: 1;
}

#gameCanvas {
    border-radius: 20px;
    box-shadow: 
        0 0 0 4px rgba(233, 69, 96, 0.5),
        0 0 30px rgba(233, 69, 96, 0.3),
        0 20px 60px rgba(0, 0, 0, 0.5);
    background: linear-gradient(180deg, #1a1a2e 0%, #0d1b2a 100%);
}

/* Controls Info */
.controls-info {
    display: flex;
    justify-content: space-between;
    width: 800px;
    margin-top: 1.5rem;
    z-index: 1;
}

.control-group {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group h3 {
    color: #e94560;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.key-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.key {
    width: 40px;
    height: 40px;
    background: linear-gradient(145deg, #2a2a4a, #1a1a2e);
    border: 2px solid #e94560;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 1.1rem;
    box-shadow: 
        0 4px 0 #0f3460,
        0 0 15px rgba(233, 69, 96, 0.3);
    transition: all 0.1s ease;
}

.key.active {
    transform: translateY(2px);
    box-shadow: 
        0 2px 0 #0f3460,
        0 0 25px rgba(233, 69, 96, 0.6);
    background: linear-gradient(145deg, #e94560, #c73e54);
}

.key-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
}

/* Game Over Modal */
.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 1.5rem 2rem;
    border-radius: 20px;
    border: 2px solid #e94560;
    text-align: center;
    z-index: 10;
    display: none;
    max-height: 90vh;
    overflow-y: auto;
}

.game-over h2 {
    color: #e94560;
    font-family: 'Russo One', sans-serif;
    font-size: 2rem;
    margin-bottom: 1rem;
}

.game-over p {
    color: #fff;
    margin-bottom: 1.5rem;
}

.restart-btn {
    background: linear-gradient(145deg, #e94560, #c73e54);
    border: none;
    color: #fff;
    padding: 0.75rem 2rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

.restart-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(233, 69, 96, 0.6);
}

.enter-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    margin-top: 0.75rem;
}

/* Header Buttons Container */
.header-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

.header-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.header-btn:hover {
    background: rgba(233, 69, 96, 0.3);
    border-color: #e94560;
    transform: scale(1.1);
}

.settings-btn:hover {
    transform: scale(1.1) rotate(45deg);
}

.leaderboard-btn {
    font-size: 1.2rem;
}

/* Settings Overlay */
.settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.settings-overlay.active {
    display: flex;
}

.settings-panel {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid #e94560;
    border-radius: 20px;
    padding: 2rem;
    max-width: 450px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(233, 69, 96, 0.3);
}

.settings-panel h2 {
    font-family: 'Russo One', sans-serif;
    color: #e94560;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
}

.setting-group {
    margin-bottom: 1.5rem;
}

.setting-group h3 {
    color: #00d9ff;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
}

.setting-options {
    display: flex;
    gap: 0.5rem;
}

.setting-option {
    flex: 1;
    padding: 0.75rem 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    text-align: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    transition: all 0.2s ease;
}

.setting-option:hover {
    border-color: rgba(233, 69, 96, 0.5);
    background: rgba(233, 69, 96, 0.1);
}

.setting-option.selected {
    border-color: #e94560;
    background: rgba(233, 69, 96, 0.2);
    color: #fff;
}

.setting-option .color-preview {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    margin: 0 auto 0.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.setting-option .color-preview.white {
    background: radial-gradient(circle at 30% 30%, #ffffff, #cccccc);
}

.setting-option .color-preview.red {
    background: radial-gradient(circle at 30% 30%, #ff7b94, #e94560);
}

.setting-option .color-preview.black {
    background: radial-gradient(circle at 30% 30%, #444444, #111111);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Toggle Switch */
.toggle-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.toggle-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.music-credit {
    color: #50fa7b;
    text-decoration: none;
    transition: all 0.2s ease;
}

.music-credit:hover {
    color: #7dffab;
    text-decoration: underline;
}

.toggle-switch {
    width: 50px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 13px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toggle-switch.on {
    background: rgba(233, 69, 96, 0.5);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: all 0.2s ease;
}

.toggle-switch.on::after {
    left: 27px;
    background: #e94560;
}

/* Settings Close Button */
.settings-close {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: linear-gradient(145deg, #e94560, #c73e54);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.settings-close:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

.settings-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 1.5rem 0;
}

/* Audio Toggle Option */
.audio-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.audio-icon {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Music icon - speaker with notes */
.icon-music {
    position: relative;
    width: 28px;
    height: 22px;
}

.icon-music::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 10px;
    background: linear-gradient(180deg, #50fa7b 0%, #00cc55 100%);
    border-radius: 2px;
}

.icon-music::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-left: 10px solid #50fa7b;
}

/* Music notes decoration */
.toggle-option:has(.icon-music) .icon-music {
    animation: music-pulse 1.5s ease-in-out infinite;
}

.toggle-switch.on + .toggle-option .icon-music,
.toggle-option:has(.toggle-switch.on) .icon-music {
    animation: music-pulse 1.5s ease-in-out infinite;
}

@keyframes music-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Power-up Options */
.powerup-option {
    flex-direction: row;
    align-items: center;
}

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

.powerup-icon {
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Custom power-up icons to match in-game graphics */
.icon-shield {
    background: linear-gradient(180deg, #e8f4fc 0%, #4a90d9 40%, #2e5a8b 70%, #1a3a5c 100%);
    clip-path: polygon(50% 100%, 0% 35%, 0% 0%, 100% 0%, 100% 35%);
    border-radius: 2px;
}

.icon-wide-platform {
    position: relative;
    width: 28px;
    height: 10px;
    background: linear-gradient(180deg, #80ecff 0%, #00d9ff 50%, #0099cc 100%);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
}
.icon-wide-platform::before,
.icon-wide-platform::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-right-color: #fff;
}
.icon-wide-platform::before { left: -10px; }
.icon-wide-platform::after { 
    right: -10px; 
    border-right-color: transparent;
    border-left-color: #fff;
}

.icon-narrow-platform {
    position: relative;
    width: 20px;
    height: 10px;
    background: linear-gradient(180deg, #ff6666 0%, #ff3333 50%, #cc2828 100%);
    border-radius: 3px;
    box-shadow: 0 0 8px rgba(255, 51, 51, 0.6);
}
.icon-narrow-platform::before,
.icon-narrow-platform::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 5px solid transparent;
    border-left-color: #ffaaaa;
}
.icon-narrow-platform::before { left: -12px; }
.icon-narrow-platform::after { 
    right: -12px; 
    border-left-color: transparent;
    border-right-color: #ffaaaa;
}

.icon-magnet {
    width: 24px;
    height: 20px;
    border: 5px solid #ff6b35;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    position: relative;
    box-shadow: 0 0 8px rgba(255, 107, 53, 0.6);
}
.icon-magnet::before,
.icon-magnet::after {
    content: '';
    position: absolute;
    bottom: -8px;
    width: 5px;
    height: 8px;
}
.icon-magnet::before { left: -5px; background: #cc0000; }
.icon-magnet::after { right: -5px; background: #0066cc; }

.icon-shrink-ball {
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #cc88ff, #9932ff, #6600cc);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(153, 50, 255, 0.6);
}

.icon-big-ballz {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 30% 30%, #ffaa44, #ff8c00, #cc6600);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 140, 0, 0.6);
    position: relative;
}
.icon-big-ballz::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #804400;
}
.icon-big-ballz::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #804400;
}

.icon-time-freeze {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle, #66ffff, #00dddd, #008888);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.6);
    position: relative;
}
.icon-time-freeze::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 3px;
    height: 8px;
    background: #003333;
    transform: translate(-50%, -90%) rotate(-20deg);
    transform-origin: bottom center;
}
.icon-time-freeze::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 6px;
    background: #003333;
    transform: translate(-50%, -85%) rotate(45deg);
    transform-origin: bottom center;
}

.icon-extra-ball {
    width: 32px;
    height: 24px;
    position: relative;
}
.icon-extra-ball::before {
    content: '';
    position: absolute;
    top: 0;
    right: 2px;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #ffee88, #ffdd00, #cc9900);
    border-radius: 50%;
    border: 1px solid #ffaa00;
    box-shadow: 0 0 8px rgba(255, 221, 0, 0.6);
}
.icon-extra-ball::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 2px;
    width: 16px;
    height: 16px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #ffee88, #cc9900);
    border-radius: 50%;
    border: 1px solid #ffcc00;
    box-shadow: 0 0 8px rgba(255, 221, 0, 0.6);
}

.icon-random {
    width: 22px;
    height: 22px;
    background: linear-gradient(135deg, #ffffff 0%, #eeeeee 50%, #cccccc 100%);
    border-radius: 4px;
    border: 2px solid #ff00ff;
    box-shadow: 0 0 10px rgba(255, 0, 255, 0.6);
    position: relative;
    animation: rainbow-glow 2s linear infinite;
}
@keyframes rainbow-glow {
    0% { border-color: #ff0000; box-shadow: 0 0 10px rgba(255, 0, 0, 0.6); }
    33% { border-color: #00ff00; box-shadow: 0 0 10px rgba(0, 255, 0, 0.6); }
    66% { border-color: #0088ff; box-shadow: 0 0 10px rgba(0, 136, 255, 0.6); }
    100% { border-color: #ff0000; box-shadow: 0 0 10px rgba(255, 0, 0, 0.6); }
}
.icon-random::before {
    content: '?';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 16px;
    font-weight: bold;
    color: #cc00cc;
    font-family: Arial, sans-serif;
}

.icon-ice-mode {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ffffff 0%, #ccf4ff 30%, #88ddff 60%, #55bbdd 100%);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(136, 221, 255, 0.6);
    position: relative;
}
.icon-ice-mode::before {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 1px;
    background: rgba(255, 255, 255, 0.8);
    transform: rotate(-45deg);
}

.icon-blinking-eye {
    width: 26px;
    height: 16px;
    background: radial-gradient(ellipse at center, #ffffff 0%, #ffeeee 60%, #ffcccc 100%);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 102, 255, 0.6);
    position: relative;
    border: 2px solid #cc66cc;
}
.icon-blinking-eye::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #ff00ff 0%, #cc00cc 50%, #990099 100%);
    border-radius: 50%;
}
.icon-blinking-eye::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #000000;
    border-radius: 50%;
}

.icon-earthquake {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 40% 40%, #d2691e, #8b4513, #654321);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(139, 69, 19, 0.6);
    position: relative;
}
.icon-earthquake::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 14px;
    background: #3d2314;
}
.icon-earthquake::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    width: 2px;
    height: 10px;
    background: #3d2314;
}

.powerup-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.powerup-desc {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.4);
}

/* Power-Down styling - red tint to indicate negative effect */
.powerdown-option {
    border-color: rgba(255, 51, 51, 0.3);
    background: rgba(255, 51, 51, 0.05);
}

.powerdown-option:hover {
    border-color: rgba(255, 51, 51, 0.5);
    background: rgba(255, 51, 51, 0.1);
}

.powerdown-label {
    color: #ff6666 !important;
}

.powerdown-option .toggle-switch.on {
    background: rgba(255, 51, 51, 0.5);
}

.powerdown-option .toggle-switch.on::after {
    background: #ff3333;
}

/* ==================== LEADERBOARD STYLES ==================== */

/* Leaderboard Overlay */
.leaderboard-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.leaderboard-overlay.active {
    display: flex;
}

.leaderboard-panel {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 1.5rem;
    max-width: 700px;
    width: 95%;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3);
}

.leaderboard-panel h2 {
    font-family: 'Russo One', sans-serif;
    color: #ffd700;
    text-align: center;
    margin-bottom: 1rem;
    font-size: 1.6rem;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* Leaderboard Table */
.leaderboard-table-wrapper {
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.leaderboard-table-wrapper.mini {
    max-height: 200px;
    overflow-y: auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Orbitron', sans-serif;
}

.leaderboard-table thead {
    background: #1a1a2e;
}

.leaderboard-table th {
    padding: 0.4rem 0.5rem;
    text-align: left;
    color: #00d9ff;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid rgba(0, 217, 255, 0.3);
}

.leaderboard-table td {
    padding: 0.35rem 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Rank column */
.leaderboard-table .rank {
    text-align: center;
    width: 50px;
    font-size: 1rem;
}

/* Top 3 styling */
.leaderboard-table tr.top-1 td {
    color: #ffd700;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.leaderboard-table tr.top-2 td {
    color: #c0c0c0;
    text-shadow: 0 0 5px rgba(192, 192, 192, 0.5);
}

.leaderboard-table tr.top-3 td {
    color: #cd7f32;
    text-shadow: 0 0 5px rgba(205, 127, 50, 0.5);
}

/* Score column */
.leaderboard-table .score {
    color: #00d9ff;
    font-weight: bold;
    text-align: right;
    width: 70px;
}

/* Date column */
.leaderboard-table .date {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    width: 80px;
}

/* Message column */
.leaderboard-table .message {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    font-style: italic;
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Loading/Empty states */
.leaderboard-table .loading,
.leaderboard-table .no-scores {
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    padding: 1rem;
    font-style: italic;
}

.leaderboard-close {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: 0.6rem;
    background: linear-gradient(145deg, #ffd700, #cc9900);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.leaderboard-close:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
}

/* Score Submission Section */
.submit-score-section {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 1rem;
    margin: 1rem 0;
}

.rank-info {
    color: #ffd700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.5);
}

.submit-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.submit-form input {
    padding: 0.6rem 0.8rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.submit-form input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.submit-form input.error {
    border-color: #ff3333;
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.3);
}

.submit-form input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.submit-form button {
    padding: 0.6rem 1rem;
    background: linear-gradient(145deg, #ffd700, #cc9900);
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-form button:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.4);
}

.submit-form button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-success {
    color: #50fa7b;
    font-size: 1rem;
    text-align: center;
    padding: 0.5rem;
}

/* Mini Leaderboard in Game Over (Top 3 only) */
.mini-leaderboard {
    margin: 1rem 0;
}

.mini-leaderboard h3 {
    color: #ffd700;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.mini-leaderboard .leaderboard-table {
    font-size: 0.8rem;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
}

.mini-leaderboard .leaderboard-table th {
    padding: 0.5rem 0.4rem;
    font-size: 0.7rem;
    background: rgba(255, 215, 0, 0.1);
}

.mini-leaderboard .leaderboard-table td {
    padding: 0.5rem 0.4rem;
    font-size: 0.8rem;
}

/* Loading spinner animation */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #00d9ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Waking up state - golden color */
.loading.waking-up .loading-spinner {
    border-top-color: #ffd700;
}

.loading.waking-up {
    color: #ffd700;
}

/* Rank info loading state */
.rank-info .loading-spinner {
    border-top-color: #ffd700;
}

/* ==================== HELP OVERLAY STYLES ==================== */

.help-btn {
    font-family: 'Russo One', sans-serif;
    font-size: 1.3rem;
}

.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.help-overlay.active {
    display: flex;
}

.help-panel {
    background: linear-gradient(145deg, #1a1a2e, #16213e);
    border: 2px solid #00d9ff;
    border-radius: 20px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 0 40px rgba(0, 217, 255, 0.3);
}

.help-panel h2 {
    font-family: 'Russo One', sans-serif;
    color: #00d9ff;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    text-shadow: 0 0 10px rgba(0, 217, 255, 0.5);
}

.help-section {
    margin-bottom: 1.5rem;
}

.help-section h3 {
    color: #e94560;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid rgba(233, 69, 96, 0.3);
    padding-bottom: 0.5rem;
}

.help-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
}

.help-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.help-control-group {
    flex: 1;
    min-width: 120px;
}

.help-control-group h4 {
    color: #00d9ff;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.help-key-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.help-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 28px;
    padding: 0 8px;
    background: linear-gradient(145deg, #2a2a4a, #1a1a2e);
    border: 2px solid #e94560;
    border-radius: 6px;
    color: #fff;
    font-weight: bold;
    font-size: 0.8rem;
    box-shadow: 0 2px 0 #0f3460;
}

.help-score-balls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-top: 0.75rem;
}

.help-ball {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #000;
    text-align: center;
}

.help-ball.gold {
    width: 40px;
    height: 40px;
    font-size: 0.7rem;
    background: radial-gradient(circle at 30% 30%, #fff, #ffd700, #cc9900);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.help-ball.green {
    width: 35px;
    height: 35px;
    font-size: 0.65rem;
    background: radial-gradient(circle at 30% 30%, #fff, #50fa7b, #00cc55);
    box-shadow: 0 0 10px rgba(80, 250, 123, 0.5);
}

.help-ball.purple {
    width: 28px;
    height: 28px;
    font-size: 0.55rem;
    background: radial-gradient(circle at 30% 30%, #fff, #bd93f9, #9932ff);
    box-shadow: 0 0 10px rgba(189, 147, 249, 0.5);
}

.help-tips {
    list-style: none;
    padding: 0;
    margin: 0;
}

.help-tips li {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    padding: 0.4rem 0;
    padding-left: 1.2rem;
    position: relative;
}

.help-tips li::before {
    content: '•';
    color: #e94560;
    position: absolute;
    left: 0;
}

.help-close {
    display: block;
    width: 100%;
    margin-top: 1.5rem;
    padding: 0.75rem;
    background: linear-gradient(145deg, #00d9ff, #0099cc);
    border: none;
    border-radius: 10px;
    color: #1a1a2e;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.help-close:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(0, 217, 255, 0.4);
}
