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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, #0a0e27 0%, #1a1a2e 50%, #16213e 100%);
    color: #ffffff;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

:root {
    --left-hud-width: 240px;
    /* adjust to change HUD column width */
}


#game-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-canvas {
    background: #0f0f1e;
    border: 3px solid rgba(138, 43, 226, 0.5);
    box-shadow: 0 0 30px rgba(138, 43, 226, 0.3);
    display: block;
}

/* HUD Styles */
#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

#left-hud {
    position: absolute;
    top: 20px;
    left: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: var(--left-hud-width);
    max-width: 100%;
    box-sizing: border-box;
    padding-right: 10px;
}

#mobile-row-container {
    display: contents;
    /* desktop: behave as if wrapper doesn't exist */
}

.hud-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #00d4ff;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

/* Health Bar */
#health-container {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 15px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

#player-info-container {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hud-info-item {
    font-family: 'Orbitron', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hud-label-inline {
    color: #00d4ff;
    font-size: 11px;
    letter-spacing: 1px;
    font-weight: 700;
}

#nickname-display {
    color: #ffaa00;
    font-weight: 700;
    font-size: 14px;
}

#timer {
    font-family: 'Orbitron', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #00ff88;
    text-shadow: 0 0 10px rgba(0, 255, 136, 0.5);
}

#health-bar-bg {
    position: relative;
    width: 100%;
    height: 30px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#health-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #ff0844 0%, #ff6b6b 100%);
    border-radius: 15px;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 8, 68, 0.6);
}

#health-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1;
}



/* XP Bar */
#xp-container {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    width: 100%;
}

#xp-bar-bg {
    position: relative;
    width: 100%;
    height: 25px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

#xp-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #00d4ff 0%, #0099ff 100%);
    border-radius: 12px;
    transition: width 0.3s ease;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.6);
}

/* Modals */
.modal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 3px solid rgba(138, 43, 226, 0.5);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(138, 43, 226, 0.4);
    backdrop-filter: blur(10px);
    max-width: 800px;
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.game-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 64px;
    font-weight: 900;
    background: linear-gradient(90deg, #00d4ff 0%, #8a2be2 50%, #ff0844 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(138, 43, 226, 0.5);
}

.game-subtitle {
    font-size: 18px;
    color: #aaaaaa;
    margin-bottom: 30px;
}

.modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 48px;
    font-weight: 900;
    color: #00ff88;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.6);
}

.modal-subtitle {
    font-size: 16px;
    color: #aaaaaa;
    margin-bottom: 30px;
}

/* Buttons */
.game-btn {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    padding: 15px 40px;
    margin: 10px;
    background: linear-gradient(135deg, #8a2be2 0%, #6a1bb2 100%);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(138, 43, 226, 0.4);
    pointer-events: auto;
}

.game-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(138, 43, 226, 0.6);
    background: linear-gradient(135deg, #9a3bf2 0%, #7a2bc2 100%);
}

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

.game-btn.secondary {
    background: linear-gradient(135deg, #444 0%, #333 100%);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.game-btn.secondary:hover {
    background: linear-gradient(135deg, #555 0%, #444 100%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* Upgrade Cards */
#upgrade-choices {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.upgrade-card {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.1) 0%, rgba(138, 43, 226, 0.1) 100%);
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 15px;
    padding: 25px;
    width: 220px;
    cursor: pointer;
    transition: all 0.3s ease;
    pointer-events: auto;
}

.upgrade-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: #00ff88;
    box-shadow: 0 10px 40px rgba(0, 255, 136, 0.4);
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2) 0%, rgba(138, 43, 226, 0.2) 100%);
}

.upgrade-card h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    color: #00d4ff;
    margin-bottom: 10px;
}

.upgrade-card p {
    font-size: 14px;
    color: #cccccc;
    line-height: 1.5;
}

/* Game Stats */
#game-stats {
    margin: 30px 0;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 15px 30px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-label {
    font-size: 16px;
    color: #aaaaaa;
}

.stat-value {
    font-family: 'Orbitron', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #00ff88;
}

/* Controls Info */
.controls-info {
    margin: 30px 0;
    padding: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.controls-info p {
    margin: 10px 0;
    font-size: 16px;
    color: #cccccc;
}

.controls-info strong {
    color: #00d4ff;
    font-family: 'Orbitron', sans-serif;
}

/* Seed Input Section */
.seed-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.3);
}

.seed-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

.seed-input {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    padding: 12px 15px;
    font-family: 'Orbitron', monospace;
    font-size: 14px;
    color: #00d4ff;
    outline: none;
    transition: all 0.3s ease;
}

.seed-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Inter', sans-serif;
}

.seed-input:focus {
    border-color: #8a2be2;
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.4);
}

.seed-random-btn {
    background: linear-gradient(135deg, #8a2be2 0%, #6a1bb2 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.seed-random-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.seed-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
    font-style: italic;
}

/* Seed Display in HUD */
.seed-display {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px !important;
}

.seed-display:hover {
    color: #00ff88;
}

.seed-display #seed-text {
    font-family: 'Orbitron', monospace;
    color: #8a2be2;
    font-size: 10px;
}

/* Seed in Game Over */
.seed-stat {
    border: 1px solid rgba(138, 43, 226, 0.3) !important;
}

.seed-value {
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px !important;
}

.seed-value:hover {
    color: #8a2be2 !important;
    text-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    html {
        height: 100%;
        overflow: hidden;
    }

    body {
        overflow: hidden;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
        height: 100%;
        position: fixed;
        width: 100%;
    }

    #game-container {
        padding: 0;
        margin: 0;
        width: 100%;
        height: 100%;
        position: fixed;
        top: 0;
        left: 0;
    }

    #game-canvas {
        border: none;
        box-shadow: none;
        display: block;
        position: absolute;
        top: 0;
        left: 0;
    }

    /* Adjust HUD for mobile */
    #left-hud {
        width: calc(100% - 20px) !important;
        left: 10px !important;
        right: 10px !important;
        max-width: none !important;
        padding-right: 0 !important;
        gap: 10px;
    }

    #health-container {
        width: 100%;
        padding: 10px 15px;
    }

    /* Side by side container for mobile */
    #mobile-row-container {
        display: flex;
        flex-direction: row;
        gap: 10px;
        width: 100%;
    }

    #player-info-container,
    #xp-container {
        flex: 1;
        padding: 10px 12px;
        min-width: 0;
    }

    #bottom-hud {
        display: none;
    }

    .hud-label {
        font-size: 10px;
    }

    #timer {
        font-size: 20px;
    }

    #health-text {
        font-size: 12px;
    }

    /* Modal adjustments */
    .modal-content {
        padding: 15px;
        max-width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .game-title {
        font-size: 28px;
        margin-bottom: 15px;
    }

    /* Mobile override for left HUD width */
    #left-hud {
        width: calc(100% - 40px) !important;
        left: 20px !important;
        right: 20px !important;
        max-width: none !important;
    }

    .upgrades-list {
        width: calc(100% - 40px) !important;
        left: 20px !important;
        top: auto !important;
        bottom: 20px !important;
        max-height: 200px !important;
    }

    .modal-content h2 {
        font-size: 24px;
        margin-bottom: 15px;
    }

    .modal-content p {
        font-size: 14px;
        margin-bottom: 15px;
    }

    .game-btn {
        font-size: 14px;
        padding: 10px 25px;
    }

    /* Weapon selection grid */
    .weapon-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .weapon-card {
        padding: 15px 10px;
    }

    .weapon-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }

    .weapon-card h3 {
        font-size: 16px;
        margin-bottom: 5px;
    }

    .weapon-card p {
        font-size: 12px;
    }

    /* Upgrade cards */
    #upgrade-choices {
        flex-direction: column;
        gap: 10px;
        padding: 0 10px;
    }

    .upgrade-card {
        width: 100%;
        max-width: none;
        padding: 12px;
    }

    .upgrade-card h3 {
        font-size: 14px;
        margin-bottom: 5px;
    }

    .upgrade-card p {
        font-size: 12px;
    }

    .upgrade-level {
        font-size: 11px;
        padding: 3px 8px;
    }

    /* Hide debug panel on mobile */
    #debug-panel {
        display: none !important;
    }
}

/* Prevent pull-to-refresh and overscroll */
html,
body {
    overscroll-behavior: none;
}

/* Disable text selection on game elements */
#game-canvas,
#hud,
.modal {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Upgrades List Styles */
.upgrades-list {
    position: absolute;
    top: 330px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 15px;
    border-radius: 12px;
    border: 2px solid rgba(138, 43, 226, 0.4);
    width: calc(var(--left-hud-width) - 40px);
    max-height: calc(100vh - 360px);
    overflow-y: auto;
    pointer-events: auto;
}


.upgrades-list .hud-label {
    margin-bottom: 10px;
}

#upgrades-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.upgrade-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(138, 43, 226, 0.15);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(138, 43, 226, 0.3);
    font-size: 13px;
}

.upgrade-item-name {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    color: #fff;
}

.upgrade-item-icon {
    font-size: 16px;
}

.upgrade-item-level {
    background: rgba(138, 43, 226, 0.5);
    padding: 2px 8px;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    min-width: 35px;
    text-align: center;
}

.upgrade-item.weapon {
    border-color: rgba(0, 212, 255, 0.4);
    background: rgba(0, 212, 255, 0.1);
}

.upgrade-item.powerup {
    border-color: rgba(255, 100, 200, 0.4);
    background: rgba(255, 100, 200, 0.1);
}

/* Mobile upgrades list */
.upgrades-section {
    margin: 20px 0;
    padding-top: 20px;
    border-top: 2px solid rgba(138, 43, 226, 0.3);
}

.upgrades-list-mobile {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

/* Scrollbar styling */
.upgrades-list::-webkit-scrollbar,
.upgrades-list-mobile::-webkit-scrollbar {
    width: 6px;
}

.upgrades-list::-webkit-scrollbar-track,
.upgrades-list-mobile::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.upgrades-list::-webkit-scrollbar-thumb,
.upgrades-list-mobile::-webkit-scrollbar-thumb {
    background: rgba(138, 43, 226, 0.6);
    border-radius: 3px;
}

.upgrades-list::-webkit-scrollbar-thumb:hover,
.upgrades-list-mobile::-webkit-scrollbar-thumb:hover {
    background: rgba(138, 43, 226, 0.8);
}

/* Responsive adjustments for upgrades */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .mobile-only {
        display: none !important;
    }
}

/* XP Multiplier Bar Styles */
.xp-multiplier-container {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 10px;
    border: 2px solid rgba(255, 215, 0, 0.4);
    min-width: 200px;
    pointer-events: none;
    z-index: 100;
}

.xp-multiplier-label {
    font-family: 'Orbitron', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 5px;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
    text-align: center;
}

.xp-multiplier-bar-bg {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.xp-multiplier-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, #FFD700, #FFA500, #FFD700);
    background-size: 200% 100%;
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    animation: xpMultiplierPulse 2s ease-in-out infinite;
    transition: width 0.1s linear;
}

@keyframes xpMultiplierPulse {

    0%,
    100% {
        background-position: 0% 50%;
        box-shadow: 0 0 10px rgba(255, 215, 0, 0.6);
    }

    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 20px rgba(255, 215, 0, 1);
    }
}

/* Permanent state */
.xp-multiplier-container.permanent .xp-multiplier-bar {
    background: linear-gradient(90deg, #FFD700, #FFFF00, #FFD700);
    animation: xpMultiplierPermanent 1.5s ease-in-out infinite;
}

@keyframes xpMultiplierPermanent {

    0%,
    100% {
        background-position: 0% 50%;
        box-shadow: 0 0 15px rgba(255, 215, 0, 1);
    }

    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 25px rgba(255, 255, 0, 1);
    }
}

.xp-multiplier-container.permanent .xp-multiplier-label::after {
    content: ' ⭐';
}

/* Performance: Disable backdrop-filter for browsers with issues (Opera) */
html.no-blur .modal,
html.no-blur .modal-content,
html.no-blur #health-container,
html.no-blur #player-info-container,
html.no-blur #xp-container,
html.no-blur .upgrades-list,
html.no-blur .xp-multiplier-container,
html.no-blur .auth-modal,
html.no-blur .auth-modal-content {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Gamepad Indicator Styles */
.gamepad-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 10px 16px;
    border-radius: 10px;
    border: 2px solid rgba(0, 212, 255, 0.5);
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #00d4ff;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 50;
    animation: gamepadSlideIn 0.4s ease-out;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.3);
}

@keyframes gamepadSlideIn {
    from {
        transform: translateX(100px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.gamepad-indicator::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #00ff88;
    border-radius: 50%;
    animation: gamepadPulse 1.5s ease-in-out infinite;
}

@keyframes gamepadPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 255, 136, 0.6);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(0, 255, 136, 0);
    }
}

/* Controller type specific styling */
.gamepad-indicator.playstation {
    border-color: rgba(0, 112, 209, 0.5);
    color: #0070d1;
    box-shadow: 0 4px 20px rgba(0, 112, 209, 0.3);
}

.gamepad-indicator.xbox {
    border-color: rgba(16, 124, 16, 0.5);
    color: #107c10;
    box-shadow: 0 4px 20px rgba(16, 124, 16, 0.3);
}

/* Gamepad navigation highlight for menus */
.gamepad-selected {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.7), 0 0 40px rgba(255, 255, 255, 0.3) !important;
}

/* Mobile: hide gamepad indicator */
@media (max-width: 768px) {
    .gamepad-indicator {
        top: auto;
        bottom: 20px;
        right: 20px;
        font-size: 10px;
        padding: 8px 12px;
    }
}

/* ============================================
   GOOGLE ADS - RIGHT SIDEBAR
   ============================================ */

#left-ad-container {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 160px;
    z-index: 5;
    padding: 10px;
    background: rgba(10, 14, 39, 0.8);
    border-left: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 12px 0 0 12px;
    backdrop-filter: blur(10px);
}

/* Ad styling */
#left-ad-container .adsbygoogle {
    width: 160px;
    height: 600px;
    display: block;
}

/* Hide ads on mobile and small screens */
@media (max-width: 1024px) {
    #left-ad-container {
        display: none;
    }
}

/* Score Submission Loading Overlay */
.score-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(5px);
}

.score-loading-overlay.hidden {
    display: none;
}

.score-loading-content {
    text-align: center;
    color: #fff;
}

.score-loading-content h3 {
    font-size: 24px;
    margin: 20px 0 10px;
    color: #00ff88;
    text-shadow: 0 0 20px rgba(0, 255, 136, 0.5);
}

.score-loading-content p {
    font-size: 14px;
    color: #888;
}

.score-loading-spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto;
    border: 4px solid rgba(0, 255, 136, 0.2);
    border-top: 4px solid #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Player Customization Modal */
.customization-content {
    max-width: 450px;
}

.customization-preview {
    display: flex;
    justify-content: center;
    margin: 15px 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    padding: 15px;
}

#player-preview-canvas {
    background: #0f0f1e;
    border: 2px solid rgba(138, 43, 226, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(138, 43, 226, 0.3);
}

.customization-section {
    margin: 20px 0;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    border: 1px solid rgba(138, 43, 226, 0.2);
}

.customization-section h3 {
    color: #8a2be2;
    margin-bottom: 12px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.shape-options, .color-options {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.shape-btn {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(138, 43, 226, 0.3);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
}

.shape-btn:hover {
    border-color: rgba(138, 43, 226, 0.7);
    background: rgba(138, 43, 226, 0.2);
}

.shape-btn.selected {
    border-color: #8a2be2;
    background: rgba(138, 43, 226, 0.3);
    box-shadow: 0 0 15px rgba(138, 43, 226, 0.5);
}

.color-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.color-btn:hover {
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.color-btn.selected {
    border-color: #fff;
    transform: scale(1.15);
    box-shadow: 0 0 20px currentColor;
}

.custom-color-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.custom-color-wrapper label {
    color: #888;
    font-size: 12px;
}

#custom-color-picker {
    width: 50px;
    height: 35px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

#custom-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

#custom-color-picker::-webkit-color-swatch {
    border-radius: 6px;
    border: 2px solid rgba(138, 43, 226, 0.5);
}

.glow-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
}

.glow-slider-wrapper input[type="range"] {
    flex: 1;
    max-width: 200px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    outline: none;
    -webkit-appearance: none;
}

.glow-slider-wrapper input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #8a2be2;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(138, 43, 226, 0.5);
}

#glow-value {
    color: #8a2be2;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.customization-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.customization-buttons .game-btn {
    min-width: 120px;
}

/* Mobile adjustments for customization */
@media (max-width: 768px) {
    .customization-content {
        max-width: 95%;
        padding: 20px;
    }

    .shape-btn {
        padding: 8px 10px;
        font-size: 11px;
    }

    .color-btn {
        width: 35px;
        height: 35px;
    }

    .customization-buttons {
        flex-direction: column;
    }

    .customization-buttons .game-btn {
        width: 100%;
    }
}

/* ========== ACHIEVEMENTS MODAL ========== */
.achievements-content {
    max-width: 500px;
    max-height: 80vh;
    overflow-y: auto;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    margin-top: 15px;
}

.achievement-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.achievement-item.unlocked {
    background: rgba(0, 255, 136, 0.1);
    border-color: rgba(0, 255, 136, 0.3);
}

.achievement-item.locked {
    opacity: 0.6;
    filter: grayscale(70%);
}

.achievement-icon {
    font-size: 28px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    flex-shrink: 0;
}

.achievement-item.unlocked .achievement-icon {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.achievement-info {
    flex: 1;
    min-width: 0;
}

.achievement-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
}

.achievement-item.unlocked .achievement-name {
    color: #00ff88;
}

.achievement-description {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
}

.achievement-reward {
    font-size: 11px;
    color: #ffd700;
    font-weight: 600;
}

.achievement-item.locked .achievement-reward {
    color: rgba(255, 215, 0, 0.5);
}

.achievement-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.achievement-checkmark {
    font-size: 20px;
    color: #00ff88;
}

.achievement-progress {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.achievement-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #8a2be2, #00d4ff);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.achievement-progress-text {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile responsiveness for achievements */
@media (max-width: 600px) {
    .achievements-content {
        max-width: 95vw;
        padding: 15px;
    }

    .achievements-list {
        max-height: 50vh;
    }

    .achievement-item {
        padding: 10px 12px;
        gap: 10px;
    }

    .achievement-icon {
        font-size: 24px;
        width: 38px;
        height: 38px;
    }

    .achievement-name {
        font-size: 12px;
    }

    .achievement-description {
        font-size: 10px;
    }

    .achievement-reward {
        font-size: 10px;
    }

    .achievement-progress {
        width: 60px;
    }
}