/* Cyber Tank War - Cyberpunk Theme Styles */

/* CSS Variables - Color Palette */
:root {
    --sky-dark: #000011;
    --sky-light: #1a0033;
    --neon-green: #00ff41;
    --neon-green-dim: #00aa2a;
    --neon-cyan: #00ffff;
    --neon-cyan-dim: #00aaaa;
    --neon-magenta: #ff00ff;
    --neon-magenta-dim: #aa00aa;
    --plasma: #44ffaa;
    --glitch-red: #ff0044;
    --dark-bg: #0a0a12;
    --panel-bg: rgba(10, 10, 20, 0.85);
    --border-glow: rgba(0, 255, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: #88ffff;
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--sky-dark);
    font-family: 'Courier New', 'Consolas', monospace;
    overflow: hidden;
    color: var(--text-primary);
    user-select: none;
    -webkit-user-select: none;
}

/* Canvas */
#gameCanvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Scanline Overlay */
#scanlines {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    opacity: 0.3;
}

/* UI Overlay */
#ui-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    pointer-events: none;
}

#ui-overlay > * {
    pointer-events: auto;
}

/* Hidden class */
.hidden {
    display: none !important;
}

/* Menu Screens */
.menu-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    border: 2px solid var(--neon-cyan);
    box-shadow:
        0 0 20px var(--neon-cyan),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    padding: 40px 60px;
    text-align: center;
    min-width: 400px;
}

.game-title {
    font-size: 48px;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow:
        0 0 10px var(--neon-cyan),
        0 0 20px var(--neon-cyan),
        0 0 40px var(--neon-cyan);
    letter-spacing: 4px;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 14px;
    color: var(--neon-magenta);
    text-shadow: 0 0 10px var(--neon-magenta);
    letter-spacing: 6px;
    margin-bottom: 40px;
}

.screen-title {
    font-size: 32px;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    margin-bottom: 30px;
    letter-spacing: 3px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

/* Neon Button */
.neon-btn {
    display: inline-block;
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-family: inherit;
    font-size: 18px;
    padding: 15px 40px;
    cursor: pointer;
    letter-spacing: 2px;
    transition: all 0.2s ease;
    text-shadow: 0 0 5px var(--neon-green);
    text-decoration: none;
    text-align: center;
    box-shadow:
        0 0 10px rgba(0, 255, 65, 0.3),
        inset 0 0 10px rgba(0, 255, 65, 0.1);
}

.neon-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.5),
        inset 0 0 20px rgba(0, 255, 65, 0.2);
    transform: scale(1.02);
}

.neon-btn:active {
    transform: scale(0.98);
}

/* Difficulty Display */
.difficulty-display {
    font-size: 14px;
    color: var(--text-secondary);
}

.difficulty-display .label {
    opacity: 0.7;
}

.difficulty-display .value {
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    font-weight: bold;
}

/* Instructions */
.instructions-content {
    text-align: left;
    margin-bottom: 30px;
}

.instruction-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.instruction-item .key {
    color: var(--neon-magenta);
    text-shadow: 0 0 5px var(--neon-magenta);
    font-weight: bold;
}

.instruction-item .action {
    color: var(--text-secondary);
}

/* Score Display */
.score-display {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 30px;
}

.score-item {
    text-align: center;
}

.score-item .label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.score-item .value {
    font-size: 48px;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
}

.result-text {
    font-size: 18px;
    color: var(--plasma);
    margin-bottom: 30px;
}

/* HUD Styles */
#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 10px;
    pointer-events: none;
}

#hud > * {
    pointer-events: auto;
}

/* Exit Button */
.exit-button {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 0, 68, 0.2);
    border: 1px solid var(--glitch-red);
    color: var(--glitch-red);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 10;
}

.exit-button:hover {
    background: rgba(255, 0, 68, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 68, 0.5);
    transform: scale(1.05);
}

.exit-button:active {
    transform: scale(0.95);
}

.exit-icon {
    font-size: 14px;
    font-weight: bold;
}

.exit-text {
    text-transform: uppercase;
}

/* Top Bar */
#top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--panel-bg);
    border: 1px solid var(--border-glow);
    padding: 10px 20px;
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

/* Health Bars */
.health-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.health-label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
    width: 60px;
}

.health-bar {
    width: 150px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-green-dim);
    position: relative;
    overflow: hidden;
}

.health-fill {
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, var(--neon-green-dim), var(--neon-green));
    box-shadow: 0 0 10px var(--neon-green);
    transition: width 0.3s ease;
}

.health-fill.enemy {
    background: linear-gradient(90deg, var(--glitch-red), #ff4466);
    box-shadow: 0 0 10px var(--glitch-red);
}

.hp-text {
    font-size: 14px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    width: 30px;
}

/* Turn Indicator */
#turn-indicator {
    text-align: center;
}

#current-turn {
    font-size: 16px;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    letter-spacing: 2px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Wind Indicator */
#wind-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.wind-label {
    font-size: 12px;
    color: var(--text-secondary);
}

#wind-arrow {
    width: 40px;
    height: 20px;
    position: relative;
}

#wind-arrow::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-left: 15px solid var(--neon-magenta);
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    filter: drop-shadow(0 0 5px var(--neon-magenta));
}

#wind-value {
    font-size: 14px;
    color: var(--neon-magenta);
    text-shadow: 0 0 5px var(--neon-magenta);
    width: 40px;
}

/* Bottom Bar */
#bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 20px;
}

/* Weapon Grid */
#weapon-grid {
    display: flex;
    gap: 10px;
    background: var(--panel-bg);
    padding: 10px;
    border: 1px solid var(--border-glow);
}

.weapon-slot {
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--neon-cyan-dim);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.weapon-slot:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.3);
}

.weapon-slot.selected {
    border-color: var(--neon-green);
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.5),
        inset 0 0 15px rgba(0, 255, 65, 0.2);
}

.weapon-icon {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
}

.weapon-name {
    font-size: 9px;
    color: var(--text-secondary);
    text-align: center;
    letter-spacing: 0.5px;
}

/* Controls */
#controls {
    display: flex;
    align-items: flex-end;
    gap: 20px;
    background: var(--panel-bg);
    padding: 15px 20px;
    border: 1px solid var(--border-glow);
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.control-value {
    font-size: 18px;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

/* Angle Arc Display */
.arc-display {
    width: 100px;
    height: 50px;
    border: 2px solid var(--neon-cyan-dim);
    border-radius: 100px 100px 0 0;
    position: relative;
    background: rgba(0, 255, 255, 0.05);
}

.arc-display .angle-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 4px;
    height: 45px;
    background: var(--neon-green);
    box-shadow: 0 0 10px var(--neon-green);
    transform-origin: bottom center;
    transform: translateX(-50%) rotate(-45deg);
    transition: transform 0.1s ease;
}

/* Power Bar Display */
.bar-display {
    width: 150px;
    height: 25px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--neon-cyan-dim);
    position: relative;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--neon-green-dim), var(--neon-green), var(--neon-cyan));
    box-shadow: 0 0 10px var(--neon-green);
    transition: width 0.1s ease;
}

/* Fire Button */
.fire-button {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glitch-red), #aa0033);
    border: 3px solid #ff4466;
    color: white;
    font-family: inherit;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow:
        0 0 20px rgba(255, 0, 68, 0.5),
        inset 0 0 20px rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
    animation: fire-pulse 2s infinite;
}

@keyframes fire-pulse {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 0, 68, 0.5),
            inset 0 0 20px rgba(255, 255, 255, 0.1);
    }
    50% {
        box-shadow:
            0 0 40px rgba(255, 0, 68, 0.8),
            inset 0 0 30px rgba(255, 255, 255, 0.2);
    }
}

.fire-button:hover {
    transform: scale(1.05);
    box-shadow:
        0 0 40px rgba(255, 0, 68, 0.8),
        inset 0 0 30px rgba(255, 255, 255, 0.2);
}

.fire-button:active {
    transform: scale(0.95);
}

.fire-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    animation: none;
}

/* Round Score */
#round-score {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--panel-bg);
    padding: 5px 20px;
    border: 1px solid var(--border-glow);
    display: flex;
    gap: 20px;
    font-size: 14px;
}

#round-display {
    color: var(--text-secondary);
}

#score-display {
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    font-weight: bold;
}

/* Responsive Adjustments */
@media (max-width: 1200px) {
    .weapon-slot {
        width: 65px;
        height: 65px;
    }

    .weapon-icon {
        width: 30px;
        height: 30px;
    }

    .weapon-name {
        font-size: 8px;
    }

    .health-bar {
        width: 120px;
    }
}

@media (max-width: 900px) {
    .menu-screen {
        padding: 30px 40px;
        min-width: 320px;
    }

    .game-title {
        font-size: 36px;
    }

    #bottom-bar {
        flex-direction: column;
        align-items: center;
    }

    #controls {
        width: 100%;
        justify-content: center;
    }
}

/* ============================================
   MOBILE STYLES
   ============================================ */

/* Mobile Orientation Lock Overlay */
#orientation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 17, 0.98);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#orientation-overlay.hidden {
    display: none;
}

.orientation-content {
    text-align: center;
    animation: pulse-glow 2s infinite;
}

.rotate-icon {
    margin-bottom: 20px;
    animation: rotate-hint 2s ease-in-out infinite;
}

@keyframes rotate-hint {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(90deg); }
}

@keyframes pulse-glow {
    0%, 100% { filter: drop-shadow(0 0 10px var(--neon-cyan)); }
    50% { filter: drop-shadow(0 0 30px var(--neon-cyan)); }
}

.orientation-content h2 {
    font-size: 28px;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
    margin-bottom: 10px;
    letter-spacing: 4px;
}

.orientation-content p {
    font-size: 14px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.orientation-briefing-link {
    display: inline-block;
    margin-top: 30px;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 14px;
    color: var(--neon-green);
    background: transparent;
    border: 2px solid var(--neon-green);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.orientation-briefing-link:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5), 0 0 40px rgba(0, 255, 65, 0.3);
    transform: scale(1.05);
}

.orientation-briefing-link:active {
    transform: scale(0.98);
}

/* Mobile Touch Controls Container */
#mobile-controls {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 150;
    pointer-events: none;
}

#mobile-controls.hidden {
    display: none;
}

#mobile-controls > * {
    pointer-events: auto;
}

/* Control Groups - Left and Right sides */
.mobile-control-group {
    position: absolute;
    bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.left-controls {
    left: 20px;
}

.right-controls {
    right: 20px;
}

.control-label-mobile {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    text-shadow: 0 0 5px var(--neon-cyan);
}

/* Mobile Angle Display */
.mobile-angle-display {
    background: rgba(0, 20, 40, 0.85);
    border: 1px solid var(--neon-cyan-dim);
    border-radius: 6px;
    padding: 4px 12px;
    margin-bottom: 8px;
}

#mobile-angle-value {
    font-size: 16px;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
}

/* Mobile Power Display */
.mobile-power-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 8px;
}

.mobile-power-bar {
    width: 80px;
    height: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-cyan-dim);
    border-radius: 4px;
    overflow: hidden;
}

.mobile-power-fill {
    height: 100%;
    width: 50%;
    background: linear-gradient(90deg, var(--neon-green-dim), var(--neon-green), var(--neon-cyan));
    box-shadow: 0 0 8px var(--neon-green);
    transition: width 0.1s ease;
}

#mobile-power-value {
    font-size: 14px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

/* D-Pad Container */
.dpad-container {
    display: flex;
    gap: 10px;
}

.dpad-container.vertical {
    flex-direction: column;
}

/* D-Pad Buttons */
.dpad-btn {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    background: rgba(0, 20, 40, 0.85);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.3),
        inset 0 0 10px rgba(0, 255, 255, 0.1);
    transition: all 0.1s ease;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dpad-btn:active,
.dpad-btn.active {
    background: rgba(0, 255, 255, 0.3);
    box-shadow:
        0 0 25px rgba(0, 255, 255, 0.6),
        inset 0 0 20px rgba(0, 255, 255, 0.3);
    transform: scale(0.95);
}

.dpad-btn span {
    text-shadow: 0 0 10px var(--neon-cyan);
}

/* Mobile Fire Button */
.mobile-fire-button {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glitch-red), #aa0033);
    border: 4px solid #ff4466;
    color: white;
    font-family: inherit;
    font-size: 20px;
    font-weight: bold;
    letter-spacing: 3px;
    cursor: pointer;
    box-shadow:
        0 0 30px rgba(255, 0, 68, 0.6),
        inset 0 0 25px rgba(255, 255, 255, 0.1);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    animation: fire-pulse 2s infinite;
}

.mobile-fire-button:active {
    transform: translateX(-50%) scale(0.92);
    box-shadow:
        0 0 50px rgba(255, 0, 68, 0.9),
        inset 0 0 35px rgba(255, 255, 255, 0.2);
}

.mobile-fire-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    animation: none;
}

/* Mobile Top Bar with Armory Controls */
#mobile-top-bar {
    position: absolute;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
    padding: 4px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
}

.mobile-top-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 10px;
    background: rgba(10, 10, 20, 0.95);
    border: 2px solid var(--neon-cyan);
    border-radius: 6px;
    color: var(--neon-cyan);
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    min-height: 36px;
}

.mobile-top-btn .shop-icon {
    font-size: 12px;
}

.mobile-top-btn .mobile-credits-value {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
    font-size: 12px;
}

/* Mobile Sound Button */
.mobile-sound-btn {
    padding: 6px 8px;
    min-width: 36px;
}

.mobile-sound-btn .sound-icon {
    font-size: 14px;
}

.mobile-sound-btn.muted {
    border-color: var(--glitch-red);
    opacity: 0.7;
}

/* Mobile Weapon Dropdown */
.mobile-dropdown {
    position: relative;
}

.mobile-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(10, 10, 20, 0.95);
    border: 2px solid var(--neon-green);
    border-radius: 6px;
    color: var(--neon-green);
    font-family: inherit;
    font-size: 10px;
    font-weight: bold;
    cursor: pointer;
    min-width: 100px;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.mobile-dropdown-toggle #mobile-current-weapon {
    flex: 1;
    text-align: left;
    text-shadow: 0 0 8px var(--neon-green);
    letter-spacing: 1px;
}

.mobile-dropdown-toggle .dropdown-arrow {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.mobile-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.mobile-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: rgba(10, 10, 20, 0.98);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    overflow: hidden;
    z-index: 200;
    max-height: 200px;
    overflow-y: auto;
}

.mobile-dropdown-menu.hidden {
    display: none;
}

.mobile-weapon-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(0, 255, 65, 0.2);
    color: var(--neon-cyan);
    font-family: inherit;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
}

.mobile-weapon-option:last-child {
    border-bottom: none;
}

.mobile-weapon-option:active {
    background: rgba(0, 255, 65, 0.2);
}

.mobile-weapon-option.selected {
    background: rgba(0, 255, 65, 0.15);
    color: var(--neon-green);
}

.mobile-weapon-option .weapon-name {
    text-shadow: 0 0 5px currentColor;
}

.mobile-weapon-option .weapon-cost {
    font-size: 10px;
    color: var(--neon-green);
    opacity: 0.8;
}

/* Mobile Credit Popup (centered on screen) */
.mobile-credit-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--neon-green);
    border-radius: 8px;
    z-index: 300;
    animation: mobilePopupPulse 0.4s ease-out;
}

.mobile-credit-popup.hidden {
    display: none;
}

.mobile-credit-popup .credit-popup-text {
    color: var(--neon-green);
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 0 15px var(--neon-green);
    letter-spacing: 1px;
}

.mobile-credit-popup.direct-hit {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.2);
}

.mobile-credit-popup.direct-hit .credit-popup-text {
    color: #ffcc00;
    text-shadow: 0 0 20px #ffcc00;
}

.mobile-credit-popup.near-miss {
    border-color: #ff9900;
}

.mobile-credit-popup.near-miss .credit-popup-text {
    color: #ff9900;
}

.mobile-credit-popup.close-miss {
    border-color: #00ff88;
}

.mobile-credit-popup.close-miss .credit-popup-text {
    color: #00ff88;
}

.mobile-credit-popup.far-miss {
    border-color: #888888;
}

.mobile-credit-popup.far-miss .credit-popup-text {
    color: #888888;
}

.mobile-credit-popup.refund {
    border-color: #00ccff;
}

.mobile-credit-popup.refund .credit-popup-text {
    color: #00ccff;
}

@keyframes mobilePopupPulse {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* iOS Install Prompt */
#ios-install-prompt {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(10, 10, 20, 0.98);
    border-top: 2px solid var(--neon-cyan);
    box-shadow: 0 -5px 30px rgba(0, 255, 255, 0.3);
    padding: 15px 20px;
    z-index: 9999;
    animation: slideUp 0.3s ease;
}

#ios-install-prompt.hidden {
    display: none;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.install-content {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.install-content h3 {
    font-size: 14px;
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 8px;
    letter-spacing: 2px;
}

.install-content p {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.install-steps {
    display: flex;
    gap: 20px;
}

.install-steps .step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-primary);
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(0, 255, 255, 0.1);
    border-radius: 6px;
    border: 1px solid var(--neon-cyan-dim);
}

.close-btn {
    position: absolute;
    top: -5px;
    right: 0;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
}

.close-btn:hover {
    color: var(--neon-cyan);
}

/* Mobile-specific HUD adjustments */
body.is-mobile #hud {
    padding: 5px;
}

body.is-mobile #top-bar {
    padding: 6px 12px;
    font-size: 11px;
}

body.is-mobile .health-bar {
    width: 80px;
    height: 14px;
}

body.is-mobile .health-label {
    font-size: 9px;
    width: 45px;
}

body.is-mobile .hp-text {
    font-size: 11px;
}

body.is-mobile #current-turn {
    font-size: 12px;
}

body.is-mobile #wind-indicator {
    gap: 5px;
}

body.is-mobile .wind-label {
    font-size: 9px;
}

body.is-mobile #wind-value {
    font-size: 11px;
    width: 35px;
}

body.is-mobile #round-score {
    top: auto;
    bottom: 160px;
    padding: 4px 12px;
    font-size: 11px;
    gap: 10px;
}

/* Hide desktop controls on mobile */
body.is-mobile #bottom-bar {
    display: none;
}

/* Mobile menu adjustments */
body.is-mobile .menu-screen {
    padding: 25px 35px;
    min-width: 280px;
    max-width: 90vw;
}

body.is-mobile .game-title {
    font-size: 28px;
    letter-spacing: 2px;
}

body.is-mobile .subtitle {
    font-size: 10px;
    letter-spacing: 3px;
    margin-bottom: 25px;
}

body.is-mobile .neon-btn {
    font-size: 14px;
    padding: 12px 30px;
}

body.is-mobile .screen-title {
    font-size: 22px;
}

body.is-mobile .instructions-content {
    font-size: 12px;
}

body.is-mobile .instruction-item {
    padding: 8px 0;
}

body.is-mobile .instruction-item .key {
    font-size: 11px;
}

body.is-mobile .instruction-item .action {
    font-size: 11px;
}

/* Show/hide correct instructions based on mobile */
body.is-mobile .desktop-instructions {
    display: none;
}

body.is-mobile .mobile-instructions {
    display: block;
}

.mobile-instructions {
    display: none;
}

/* Landscape-specific mobile adjustments */
@media (max-height: 500px) and (orientation: landscape) {
    /* Main Menu - optimized for landscape mobile */
    body.is-mobile .menu-screen {
        padding: 15px 40px;
        max-height: 90vh;
        min-width: 500px;
        max-width: 95vw;
        overflow-y: auto;
    }

    body.is-mobile .game-title {
        font-size: 22px;
        margin-bottom: 5px;
    }

    body.is-mobile .subtitle {
        font-size: 9px;
        letter-spacing: 2px;
        margin-bottom: 10px;
    }

    /* Difficulty section - compact horizontal layout */
    body.is-mobile .difficulty-section {
        margin-bottom: 10px;
    }

    body.is-mobile .difficulty-label {
        font-size: 10px;
        margin-bottom: 8px;
    }

    body.is-mobile .difficulty-buttons {
        flex-direction: row;
        gap: 8px;
    }

    body.is-mobile .difficulty-btn {
        padding: 6px 12px;
        min-width: 80px;
        flex: 1;
    }

    body.is-mobile .diff-name {
        font-size: 11px;
    }

    body.is-mobile .diff-desc {
        font-size: 7px;
    }

    /* Menu buttons - horizontal layout */
    body.is-mobile .menu-buttons {
        flex-direction: row;
        gap: 10px;
        margin-bottom: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    body.is-mobile .neon-btn {
        font-size: 11px;
        padding: 8px 16px;
        letter-spacing: 1px;
    }

    /* Menu stats - horizontal compact */
    body.is-mobile .menu-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 15px;
        margin-top: 10px;
        padding-top: 10px;
    }

    body.is-mobile .stat-item {
        font-size: 11px;
    }

    /* Sound toggle button positioning */
    body.is-mobile .sound-toggle-btn {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }

    .mobile-control-group {
        bottom: 10px;
    }

    .dpad-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .mobile-fire-button {
        width: 90px;
        height: 90px;
        font-size: 16px;
        bottom: 15px;
    }

    #mobile-weapon-bar {
        top: 50px;
        padding: 4px 8px;
        gap: 3px;
    }

    #mobile-weapon-name {
        font-size: 8px;
        letter-spacing: 1px;
    }

    .mobile-weapon-buttons {
        gap: 4px;
    }

    .mobile-weapon-btn {
        width: 34px;
        height: 28px;
        font-size: 9px;
    }

    body.is-mobile #round-score {
        bottom: 110px;
    }

    .control-label-mobile {
        font-size: 8px;
    }

    /* Mobile angle/power displays for smaller screens */
    .mobile-angle-display {
        padding: 2px 8px;
        margin-bottom: 4px;
    }

    #mobile-angle-value {
        font-size: 12px;
    }

    .mobile-power-display {
        gap: 2px;
        margin-bottom: 4px;
    }

    .mobile-power-bar {
        width: 60px;
        height: 12px;
    }

    #mobile-power-value {
        font-size: 11px;
    }
}

/* ============================================
   ANDURIL SHOP STYLES
   ============================================ */

/* Menu Stats */
.menu-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
}

.stat-item {
    display: flex;
    gap: 8px;
    font-size: 14px;
}

.stat-item .label {
    color: var(--text-secondary);
    opacity: 0.7;
}

.stat-item .value {
    font-weight: bold;
}

.credits-value {
    color: var(--neon-green) !important;
    text-shadow: 0 0 8px var(--neon-green);
}

/* Anduril Button Special Styling */
.anduril-btn {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
    text-shadow: 0 0 5px var(--neon-magenta);
    box-shadow:
        0 0 10px rgba(255, 0, 255, 0.3),
        inset 0 0 10px rgba(255, 0, 255, 0.1);
}

.anduril-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow:
        0 0 20px rgba(255, 0, 255, 0.5),
        inset 0 0 20px rgba(255, 0, 255, 0.2);
}

/* Shop Screen */
.shop-screen {
    min-width: 700px;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 30px 40px;
}

.shop-header {
    text-align: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--neon-magenta);
}

.shop-title {
    color: var(--neon-magenta);
    text-shadow: 0 0 20px var(--neon-magenta);
    font-size: 42px;
    letter-spacing: 8px;
    margin-bottom: 5px;
}

.shop-subtitle {
    color: var(--text-secondary);
    font-size: 12px;
    letter-spacing: 4px;
    margin-bottom: 20px;
}

.credits-display {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid var(--neon-green);
    padding: 10px 30px;
    border-radius: 4px;
}

.credits-label {
    font-size: 10px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.credits-amount {
    font-size: 28px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 15px var(--neon-green);
}

/* Tech Tree Container */
.tech-tree-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tech-tier {
    position: relative;
}

.tier-label {
    font-size: 11px;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 3px solid var(--neon-cyan);
}

.tier-connector {
    position: absolute;
    top: -20px;
    left: 50px;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom, var(--neon-cyan), transparent);
}

.tier-weapons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Shop Weapon Card */
.shop-weapon {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid var(--neon-cyan);
    padding: 15px;
    min-width: 280px;
    flex: 1;
    transition: all 0.2s ease;
}

.shop-weapon:hover {
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.shop-weapon.locked {
    border-color: var(--neon-cyan-dim);
    opacity: 0.8;
}

.shop-weapon.locked.requirements-not-met {
    border-color: #444;
    opacity: 0.5;
}

.shop-weapon.unlocked {
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.1);
}

.weapon-icon-large {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
}

.weapon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.weapon-title {
    font-size: 14px;
    font-weight: bold;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

.shop-weapon.unlocked .weapon-title {
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.weapon-desc {
    font-size: 11px;
    color: var(--text-secondary);
}

.weapon-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 80px;
}

.weapon-cost {
    font-size: 16px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

.weapon-cost::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--neon-green);
    border-radius: 50%;
    margin-right: 5px;
    box-shadow: 0 0 5px var(--neon-green);
}

.status-text {
    font-size: 11px;
    color: var(--neon-green);
    letter-spacing: 1px;
}

/* Buy Button */
.buy-btn {
    background: transparent;
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
    font-family: inherit;
    font-size: 11px;
    padding: 6px 15px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
}

.buy-btn:hover:not(:disabled) {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.buy-btn:disabled {
    border-color: #444;
    color: #666;
    cursor: not-allowed;
}

/* Shop Footer */
.shop-footer {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    text-align: center;
}

.shop-message {
    min-height: 24px;
    font-size: 14px;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

.shop-message.success {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.shop-message.error {
    color: var(--glitch-red);
    text-shadow: 0 0 10px var(--glitch-red);
}

/* Score Breakdown on Game Over */
.score-breakdown {
    background: rgba(0, 20, 40, 0.8);
    border: 1px solid var(--neon-cyan-dim);
    padding: 15px 20px;
    margin: 20px 0;
    text-align: left;
}

.breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    margin-bottom: 10px;
}

.breakdown-title {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 2px;
}

.total-earned {
    font-size: 18px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.breakdown-items {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}

.breakdown-item .item-label {
    color: var(--text-secondary);
}

.breakdown-item .item-value {
    color: var(--plasma);
}

.credits-balance {
    display: flex;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 255, 255, 0.2);
    font-size: 14px;
}

.credits-balance span:first-child {
    color: var(--text-secondary);
}

/* Mobile Shop Adjustments */
@media (max-width: 800px) {
    .shop-screen {
        min-width: 90vw;
        max-width: 95vw;
        padding: 20px;
    }

    .shop-title {
        font-size: 28px;
        letter-spacing: 4px;
    }

    .tier-weapons {
        flex-direction: column;
    }

    .shop-weapon {
        min-width: auto;
    }
}

body.is-mobile .shop-screen {
    padding: 15px;
}

body.is-mobile .shop-title {
    font-size: 24px;
}

body.is-mobile .credits-amount {
    font-size: 22px;
}

body.is-mobile .shop-weapon {
    padding: 10px;
    gap: 10px;
}

body.is-mobile .weapon-icon-large {
    width: 40px;
    height: 40px;
}

body.is-mobile .weapon-title {
    font-size: 12px;
}

body.is-mobile .weapon-desc {
    font-size: 10px;
}

body.is-mobile .menu-stats {
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

/* ============================================
   DIFFICULTY SELECTION STYLES
   ============================================ */

/* Difficulty Section */
.difficulty-section {
    margin-bottom: 25px;
}

.difficulty-label {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 3px;
    margin-bottom: 15px;
}

.difficulty-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

/* Difficulty Button Base */
.difficulty-btn {
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid var(--neon-cyan-dim);
    color: var(--neon-cyan);
    font-family: inherit;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-width: 110px;
    position: relative;
    overflow: hidden;
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 255, 255, 0.1),
        transparent
    );
    transition: left 0.5s ease;
}

.difficulty-btn:hover::before {
    left: 100%;
}

.difficulty-btn:hover {
    border-color: var(--neon-cyan);
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.4),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
    transform: translateY(-2px);
}

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

.diff-name {
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    text-shadow: 0 0 8px currentColor;
}

.diff-desc {
    font-size: 10px;
    opacity: 0.7;
    letter-spacing: 1px;
}

/* Easy Button */
.difficulty-btn[data-difficulty="easy"] {
    border-color: var(--neon-green-dim);
    color: var(--neon-green);
}

.difficulty-btn[data-difficulty="easy"]:hover {
    border-color: var(--neon-green);
    box-shadow:
        0 0 15px rgba(0, 255, 65, 0.4),
        inset 0 0 15px rgba(0, 255, 65, 0.1);
}

.difficulty-btn[data-difficulty="easy"].selected {
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.15);
    box-shadow:
        0 0 20px rgba(0, 255, 65, 0.5),
        0 0 40px rgba(0, 255, 65, 0.2),
        inset 0 0 20px rgba(0, 255, 65, 0.2);
    animation: pulse-green 2s infinite;
}

/* Medium Button */
.difficulty-btn[data-difficulty="medium"] {
    border-color: var(--neon-cyan-dim);
    color: var(--neon-cyan);
}

.difficulty-btn[data-difficulty="medium"]:hover {
    border-color: var(--neon-cyan);
    box-shadow:
        0 0 15px rgba(0, 255, 255, 0.4),
        inset 0 0 15px rgba(0, 255, 255, 0.1);
}

.difficulty-btn[data-difficulty="medium"].selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.15);
    box-shadow:
        0 0 20px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.2),
        inset 0 0 20px rgba(0, 255, 255, 0.2);
    animation: pulse-cyan 2s infinite;
}

/* Hard Button */
.difficulty-btn[data-difficulty="hard"] {
    border-color: var(--glitch-red);
    color: var(--glitch-red);
}

.difficulty-btn[data-difficulty="hard"]:hover {
    border-color: #ff4466;
    box-shadow:
        0 0 15px rgba(255, 0, 68, 0.4),
        inset 0 0 15px rgba(255, 0, 68, 0.1);
}

.difficulty-btn[data-difficulty="hard"].selected {
    border-color: var(--glitch-red);
    background: rgba(255, 0, 68, 0.15);
    box-shadow:
        0 0 20px rgba(255, 0, 68, 0.5),
        0 0 40px rgba(255, 0, 68, 0.2),
        inset 0 0 20px rgba(255, 0, 68, 0.2);
    animation: pulse-red 2s infinite;
}

/* Hard mode skull icon */
.difficulty-btn[data-difficulty="hard"] .diff-name::before {
    content: '☠ ';
    font-size: 14px;
}

/* Pulse animations */
@keyframes pulse-green {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 255, 65, 0.5),
            0 0 40px rgba(0, 255, 65, 0.2),
            inset 0 0 20px rgba(0, 255, 65, 0.2);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 255, 65, 0.7),
            0 0 60px rgba(0, 255, 65, 0.3),
            inset 0 0 25px rgba(0, 255, 65, 0.3);
    }
}

@keyframes pulse-cyan {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(0, 255, 255, 0.5),
            0 0 40px rgba(0, 255, 255, 0.2),
            inset 0 0 20px rgba(0, 255, 255, 0.2);
    }
    50% {
        box-shadow:
            0 0 30px rgba(0, 255, 255, 0.7),
            0 0 60px rgba(0, 255, 255, 0.3),
            inset 0 0 25px rgba(0, 255, 255, 0.3);
    }
}

@keyframes pulse-red {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 0, 68, 0.5),
            0 0 40px rgba(255, 0, 68, 0.2),
            inset 0 0 20px rgba(255, 0, 68, 0.2);
    }
    50% {
        box-shadow:
            0 0 30px rgba(255, 0, 68, 0.7),
            0 0 60px rgba(255, 0, 68, 0.3),
            inset 0 0 25px rgba(255, 0, 68, 0.3);
    }
}

/* Difficulty Indicator in HUD */
#difficulty-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
    font-size: 12px;
}

#ai-difficulty-label {
    color: var(--text-secondary);
    opacity: 0.7;
}

#ai-difficulty-value {
    font-weight: bold;
    letter-spacing: 1px;
}

#ai-difficulty-value.easy {
    color: var(--neon-green);
    text-shadow: 0 0 8px var(--neon-green);
}

#ai-difficulty-value.medium {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px var(--neon-cyan);
}

#ai-difficulty-value.hard {
    color: var(--glitch-red);
    text-shadow: 0 0 8px var(--glitch-red);
}

#ai-difficulty-value.hard::before {
    content: '☠ ';
}

/* Mobile Difficulty Button Adjustments */
body.is-mobile .difficulty-section {
    margin-bottom: 20px;
}

body.is-mobile .difficulty-buttons {
    gap: 10px;
}

body.is-mobile .difficulty-btn {
    padding: 10px 15px;
    min-width: 90px;
}

body.is-mobile .diff-name {
    font-size: 12px;
}

body.is-mobile .diff-desc {
    font-size: 8px;
}

body.is-mobile #difficulty-indicator {
    font-size: 10px;
}

/* Small screens - stack difficulty buttons vertically */
@media (max-width: 500px) {
    .difficulty-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .difficulty-btn {
        width: 100%;
    }
}

/* ============================================
   AUDIO CONTROLS STYLES
   ============================================ */

/* Audio Controls in Pause Menu */
.audio-controls {
    background: rgba(0, 20, 40, 0.6);
    border: 1px solid var(--neon-cyan-dim);
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.audio-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 255, 255, 0.1);
}

.audio-control-row:last-child {
    border-bottom: none;
}

.audio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.audio-icon {
    font-size: 16px;
}

/* Toggle Button */
.toggle-btn {
    background: transparent;
    border: 2px solid var(--glitch-red);
    color: var(--glitch-red);
    font-family: inherit;
    font-size: 11px;
    padding: 6px 16px;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.2s ease;
    min-width: 60px;
}

.toggle-btn.on {
    border-color: var(--neon-green);
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.toggle-btn:hover {
    transform: scale(1.05);
}

.toggle-btn.on:hover {
    background: rgba(0, 255, 65, 0.15);
}

.toggle-btn:not(.on):hover {
    background: rgba(255, 0, 68, 0.15);
}

/* Volume Slider */
.volume-slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 120px;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--neon-cyan-dim);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--neon-cyan);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: all 0.2s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--neon-cyan);
}

.volume-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--neon-cyan);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.volume-value {
    font-size: 12px;
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
    min-width: 40px;
    text-align: right;
}

/* Menu Sound Toggle Button */
.sound-toggle-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.sound-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.5);
}

.sound-toggle-btn.muted {
    border-color: var(--glitch-red);
    color: var(--glitch-red);
    box-shadow: 0 0 10px rgba(255, 0, 68, 0.3);
}

.sound-toggle-btn.muted:hover {
    box-shadow: 0 0 20px rgba(255, 0, 68, 0.5);
}

.sound-icon {
    font-size: 20px;
}

/* HUD Sound Button */
.hud-sound-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 20, 40, 0.8);
    border: 2px solid var(--neon-cyan);
    color: var(--neon-cyan);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
    z-index: 10;
}

.hud-sound-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 255, 255, 0.5);
}

.hud-sound-btn.muted {
    border-color: var(--glitch-red);
    color: var(--glitch-red);
    box-shadow: 0 0 10px rgba(255, 0, 68, 0.3);
    animation: mute-pulse 1.5s infinite;
}

@keyframes mute-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 0, 68, 0.3);
    }
    50% {
        box-shadow: 0 0 20px rgba(255, 0, 68, 0.6);
    }
}

.hud-sound-btn .sound-icon {
    font-size: 18px;
}

/* Mobile Audio Controls */
body.is-mobile .sound-toggle-btn {
    width: 38px;
    height: 38px;
    top: 10px;
    right: 10px;
}

body.is-mobile .sound-toggle-btn .sound-icon {
    font-size: 16px;
}

body.is-mobile .hud-sound-btn {
    width: 34px;
    height: 34px;
    top: auto;
    bottom: 10px;
    right: auto;
    left: 10px;
}

body.is-mobile .hud-sound-btn .sound-icon {
    font-size: 14px;
}

body.is-mobile .audio-controls {
    padding: 10px 15px;
}

body.is-mobile .audio-control-row {
    padding: 8px 0;
}

body.is-mobile .audio-label {
    font-size: 10px;
}

body.is-mobile .volume-slider {
    width: 80px;
}

body.is-mobile .volume-value {
    font-size: 10px;
    min-width: 32px;
}

/* ============================================
   AI CALCULATING INDICATOR (HARD MODE)
   ============================================ */

#ai-calculating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    padding: 8px 16px;
    background: rgba(255, 0, 68, 0.15);
    border: 1px solid var(--glitch-red);
    border-radius: 4px;
    animation: calculating-pulse 1.5s infinite;
}

#ai-calculating.hidden {
    display: none;
}

@keyframes calculating-pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(255, 0, 68, 0.3);
        border-color: var(--glitch-red);
    }
    50% {
        box-shadow: 0 0 25px rgba(255, 0, 68, 0.6);
        border-color: #ff4466;
    }
}

/* Spinner animation */
.calculating-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 0, 68, 0.3);
    border-top-color: var(--glitch-red);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.calculating-text {
    font-size: 11px;
    font-weight: bold;
    color: var(--glitch-red);
    text-shadow: 0 0 8px var(--glitch-red);
    letter-spacing: 2px;
    animation: text-flicker 0.5s infinite;
}

@keyframes text-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.calculating-progress {
    font-size: 12px;
    font-weight: bold;
    color: #ff4466;
    text-shadow: 0 0 5px var(--glitch-red);
    min-width: 35px;
    text-align: right;
}

/* Mobile adjustments for calculating indicator */
body.is-mobile #ai-calculating {
    margin-top: 6px;
    padding: 5px 10px;
    gap: 6px;
}

body.is-mobile .calculating-spinner {
    width: 12px;
    height: 12px;
}

body.is-mobile .calculating-text {
    font-size: 9px;
    letter-spacing: 1px;
}

body.is-mobile .calculating-progress {
    font-size: 10px;
    min-width: 28px;
}

/* ========================================
   BLACK MARKET SHOP (Per-Turn)
   ======================================== */

.black-market-screen {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px 35px;
    background: linear-gradient(135deg, rgba(10, 10, 20, 0.95) 0%, rgba(30, 10, 40, 0.95) 100%);
    border: 2px solid var(--neon-magenta);
    box-shadow:
        0 0 30px rgba(255, 0, 255, 0.4),
        inset 0 0 40px rgba(255, 0, 255, 0.1);
}

.black-market-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
}

.black-market-title {
    font-size: 28px;
    color: var(--neon-magenta);
    text-shadow:
        0 0 10px var(--neon-magenta),
        0 0 20px var(--neon-magenta);
    letter-spacing: 4px;
    margin-bottom: 5px;
}

.black-market-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    letter-spacing: 2px;
    margin-bottom: 15px;
}

.black-market-credits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 18px;
}

.black-market-credits .credits-label {
    color: var(--text-secondary);
    font-size: 12px;
}

.black-market-credits .credits-amount {
    color: var(--neon-green);
    font-size: 24px;
    text-shadow: 0 0 10px var(--neon-green);
    font-weight: bold;
}

.black-market-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.black-market-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 0, 255, 0.2);
}

.selection-label {
    color: var(--neon-magenta);
    font-size: 12px;
    letter-spacing: 2px;
}

.selection-slots {
    display: flex;
    gap: 10px;
}

.shop-slot {
    width: 50px;
    height: 50px;
    border: 2px solid rgba(255, 0, 255, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    transition: all 0.2s ease;
}

.shop-slot.filled {
    border-color: var(--neon-green);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.shop-slot.empty {
    border-style: dashed;
}

.shop-slot .slot-placeholder {
    color: rgba(255, 0, 255, 0.5);
    font-size: 24px;
}

.shop-weapon-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 350px;
    overflow-y: auto;
    padding: 10px;
}

.shop-tier-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.shop-tier-label {
    font-size: 11px;
    color: var(--neon-magenta);
    letter-spacing: 2px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.2);
}

.shop-tier-weapons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.shop-weapon-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 6px;
    transition: all 0.2s ease;
}

.shop-weapon-card:hover {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.05);
}

.shop-weapon-card.selected {
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.2);
}

.shop-weapon-card.unaffordable {
    opacity: 0.5;
    filter: grayscale(0.5);
}

.shop-weapon-card.free {
    border-color: var(--neon-cyan);
}

.shop-weapon-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.shop-weapon-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.shop-weapon-name {
    font-size: 11px;
    color: var(--neon-cyan);
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-weapon-desc {
    font-size: 9px;
    color: var(--text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-weapon-cost {
    text-align: right;
    min-width: 50px;
}

.shop-weapon-cost .cost-value {
    color: var(--neon-green);
    font-size: 14px;
    font-weight: bold;
}

.shop-weapon-cost .free-label {
    color: var(--neon-cyan);
    font-size: 11px;
    letter-spacing: 1px;
}

.shop-weapon-btn {
    padding: 5px 10px;
    font-size: 10px;
    font-family: inherit;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.shop-weapon-btn:hover:not(:disabled) {
    background: rgba(0, 255, 255, 0.2);
}

.shop-weapon-btn.selected {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.shop-weapon-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.black-market-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 0, 255, 0.3);
}

.black-market-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.shop-skip-btn {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.shop-skip-btn:hover {
    background: rgba(136, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(136, 255, 255, 0.3);
}

.shop-confirm-btn {
    border-color: var(--neon-green);
    color: var(--neon-green);
    padding: 12px 30px;
    font-size: 14px;
}

.shop-confirm-btn:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
}

/* Match Credits Display (HUD) */
.match-credits {
    position: fixed;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    background: rgba(10, 10, 20, 0.8);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    z-index: 100;
}

.match-credits .credits-icon {
    color: var(--neon-green);
    font-size: 14px;
    font-weight: bold;
}

.match-credits #match-credits-value {
    color: var(--neon-green);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-green);
}

/* Credit Popup Animation */
.credit-popup {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid var(--neon-green);
    border-radius: 4px;
    z-index: 150;
    animation: popupSlide 0.3s ease-out;
}

.credit-popup.fade-out {
    animation: popupFade 1s ease-out forwards;
}

.credit-popup .credit-popup-text {
    color: var(--neon-green);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 0 10px var(--neon-green);
}

.credit-popup.damage .credit-popup-text {
    color: var(--glitch-red);
    text-shadow: 0 0 10px var(--glitch-red);
}

.credit-popup.damage {
    border-color: var(--glitch-red);
}

.credit-popup.income .credit-popup-text {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.credit-popup.income {
    border-color: var(--neon-cyan);
}

/* Shot point type styles */
.credit-popup.direct-hit {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.2);
}

.credit-popup.direct-hit .credit-popup-text {
    color: #ffcc00;
    text-shadow: 0 0 15px #ffcc00, 0 0 30px #ffcc00;
    font-size: 18px;
}

.credit-popup.near-miss {
    border-color: #ff9900;
}

.credit-popup.near-miss .credit-popup-text {
    color: #ff9900;
    text-shadow: 0 0 10px #ff9900;
}

.credit-popup.close-miss {
    border-color: #00ff88;
}

.credit-popup.close-miss .credit-popup-text {
    color: #00ff88;
    text-shadow: 0 0 10px #00ff88;
}

.credit-popup.far-miss {
    border-color: #888888;
}

.credit-popup.far-miss .credit-popup-text {
    color: #888888;
    text-shadow: 0 0 5px #888888;
}

.credit-popup.off-screen {
    border-color: #555555;
}

.credit-popup.off-screen .credit-popup-text {
    color: #555555;
    text-shadow: none;
}

.credit-popup.refund {
    border-color: #00ccff;
    background: rgba(0, 204, 255, 0.15);
}

.credit-popup.refund .credit-popup-text {
    color: #00ccff;
    text-shadow: 0 0 10px #00ccff;
}

@keyframes popupSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes popupFade {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
}

/* Mobile adjustments for Black Market Shop */
body.is-mobile .black-market-screen {
    padding: 15px 20px;
    max-height: 95vh;
    min-width: auto;
    width: 95vw;
}

body.is-mobile .black-market-title {
    font-size: 20px;
}

body.is-mobile .black-market-subtitle {
    font-size: 10px;
}

body.is-mobile .shop-tier-weapons {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

body.is-mobile .shop-weapon-card {
    padding: 8px;
}

body.is-mobile .shop-weapon-name {
    font-size: 10px;
}

body.is-mobile .shop-weapon-desc {
    font-size: 8px;
}

body.is-mobile .shop-slot {
    width: 40px;
    height: 40px;
}

/* Hide desktop credits/shop and sound button on mobile - using mobile top bar instead */
body.is-mobile .match-credits {
    display: none !important;
}

body.is-mobile .hud-sound-btn {
    display: none !important;
}

/* Glitch animation for shop */
.black-market-screen.glitch {
    animation: glitchEffect 0.1s ease-in-out;
}

@keyframes glitchEffect {
    0%, 100% {
        transform: translate(-50%, -50%);
    }
    25% {
        transform: translate(-50.5%, -50%) skew(0.5deg);
    }
    50% {
        transform: translate(-49.5%, -50.5%) skew(-0.5deg);
    }
    75% {
        transform: translate(-50%, -49.5%);
    }
}

/* ========================================
   SHOP OPEN BUTTON (HUD)
   ======================================== */

.shop-open-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(255, 0, 255, 0.2);
    border: 2px solid var(--neon-magenta);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-right: 8px;
}

.shop-open-btn:hover {
    background: rgba(255, 0, 255, 0.4);
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
    transform: scale(1.1);
}

.shop-open-btn:active {
    transform: scale(0.95);
}

.shop-open-btn .shop-icon {
    font-size: 16px;
}

/* ========================================
   HORIZONTAL SHOP BAR (Black Market)
   ======================================== */

.black-market-bar {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 95%;
    max-width: 900px;
    max-height: 85vh;
    background: linear-gradient(to top, rgba(10, 10, 20, 0.98) 0%, rgba(30, 10, 40, 0.95) 100%);
    border: 2px solid var(--neon-magenta);
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.4);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 15px;
    gap: 12px;
    overflow-y: auto;
    animation: fadeInModal 0.3s ease-out;
}

/* Dark backdrop behind shop */
.black-market-bar::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: -1;
}

.black-market-bar.hidden {
    display: none;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Shop Bar Header */
.shop-bar-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
    position: relative;
    z-index: 1;
}

.shop-bar-title {
    font-size: 11px;
    color: var(--neon-magenta);
    text-shadow: 0 0 8px var(--neon-magenta);
    letter-spacing: 2px;
    font-weight: bold;
}

.shop-bar-credits {
    display: flex;
    align-items: center;
    gap: 4px;
}

.shop-bar-credits .credits-icon {
    color: var(--neon-green);
    font-size: 12px;
    font-weight: bold;
}

.shop-bar-credits #black-market-credits-value {
    color: var(--neon-green);
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 8px var(--neon-green);
}

/* Shop Bar Weapons (Horizontal Scroll) */
.shop-bar-weapons {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: visible;
    width: 100%;
    min-height: 80px;
    padding: 10px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--neon-magenta) rgba(0, 0, 0, 0.3);
}

.shop-bar-weapons::-webkit-scrollbar {
    height: 6px;
}

.shop-bar-weapons::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.shop-bar-weapons::-webkit-scrollbar-thumb {
    background: var(--neon-magenta);
    border-radius: 3px;
}

/* Individual Weapon Item */
.shop-weapon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    min-width: 70px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: inherit;
    color: inherit;
}

.shop-weapon-item:hover:not(:disabled) {
    border-color: var(--neon-cyan);
    background: rgba(0, 255, 255, 0.1);
}

.shop-weapon-item.selected {
    border-color: var(--neon-green);
    background: rgba(0, 255, 65, 0.15);
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.3);
}

.shop-weapon-item.free {
    border-color: var(--neon-cyan);
}

.shop-weapon-item.free.selected {
    border-color: var(--neon-green);
}

.shop-weapon-item:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.shop-weapon-item .weapon-name {
    font-size: 9px;
    color: var(--neon-cyan);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60px;
}

.shop-weapon-item.selected .weapon-name {
    color: var(--neon-green);
}

.shop-weapon-item .weapon-cost {
    font-size: 10px;
    color: var(--neon-green);
    font-weight: bold;
}

.shop-weapon-item .weapon-cost.free {
    color: var(--neon-cyan);
    font-size: 9px;
}

.shop-weapon-item .weapon-icon-canvas {
    width: 32px;
    height: 32px;
}

/* Shop Bar Selection (Loadout) */
.shop-bar-selection {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 10px 0;
    border-top: 1px solid rgba(255, 0, 255, 0.3);
    position: relative;
    z-index: 1;
}

.shop-bar-selection .selection-label {
    font-size: 10px;
    color: var(--neon-magenta);
    letter-spacing: 1px;
    white-space: nowrap;
}

.shop-bar-selection .selection-slots {
    display: flex;
    gap: 6px;
}

.shop-bar-selection .shop-slot {
    width: 36px;
    height: 36px;
    border: 2px solid rgba(255, 0, 255, 0.4);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.shop-bar-selection .shop-slot.filled {
    border-color: var(--neon-green);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.shop-bar-selection .shop-slot.empty {
    border-style: dashed;
}

.shop-bar-selection .shop-slot .slot-placeholder {
    color: rgba(255, 0, 255, 0.4);
    font-size: 18px;
}

/* Quantity badge in shop slots */
.shop-bar-selection .shop-slot .slot-quantity {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: var(--neon-green);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.shop-bar-selection .shop-slot {
    position: relative;
}

/* Quantity badge on weapon items in shop grid */
.quantity-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--neon-green);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
    z-index: 10;
}

.weapon-icon-canvas {
    position: relative;
}

/* Quantity controls (+/-) in shop */
.quantity-controls {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.qty-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--neon-cyan);
    background: rgba(0, 0, 0, 0.5);
    color: var(--neon-cyan);
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: rgba(0, 255, 255, 0.2);
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.qty-minus:hover {
    border-color: var(--neon-magenta);
    color: var(--neon-magenta);
}

/* Quantity badge in HUD weapon grid */
.weapon-quantity-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--neon-green);
    color: #000;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.weapon-icon {
    position: relative;
}

/* Shop Bar Actions */
.shop-bar-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 10px 0 0 0;
    border-top: 1px solid rgba(255, 0, 255, 0.3);
    position: relative;
    z-index: 1;
}

.shop-bar-message {
    font-size: 10px;
    color: var(--plasma);
    min-width: 80px;
    text-align: center;
}

.shop-bar-btn {
    padding: 8px 16px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: 1px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
}

.shop-bar-btn.confirm {
    border: 2px solid var(--neon-green);
    color: var(--neon-green);
}

.shop-bar-btn.confirm:hover {
    background: rgba(0, 255, 65, 0.2);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.4);
}

.shop-bar-btn.close {
    border: 2px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 8px 12px;
}

.shop-bar-btn.close:hover {
    background: rgba(136, 255, 255, 0.1);
}

/* Mobile Adjustments for Shop */
body.is-mobile .shop-open-btn {
    width: 28px;
    height: 28px;
    margin-right: 6px;
}

body.is-mobile .shop-open-btn .shop-icon {
    font-size: 14px;
}

/* Mobile: smaller modal width and tighter spacing */
body.is-mobile .black-market-bar {
    max-width: 700px;
    max-height: 80vh;
    padding: 12px;
    gap: 10px;
}

body.is-mobile .shop-bar-title {
    font-size: 9px;
}

body.is-mobile .shop-bar-credits #black-market-credits-value {
    font-size: 14px;
}

body.is-mobile .shop-weapon-item {
    padding: 6px 8px;
    min-width: 55px;
}

body.is-mobile .shop-weapon-item .weapon-name {
    font-size: 8px;
    max-width: 50px;
}

body.is-mobile .shop-weapon-item .weapon-cost {
    font-size: 9px;
}

body.is-mobile .shop-weapon-item .weapon-icon-canvas {
    width: 28px;
    height: 28px;
}

body.is-mobile .shop-bar-weapons {
    padding: 8px 0;
}

body.is-mobile .shop-bar-selection {
    padding: 8px 0;
}

body.is-mobile .shop-bar-actions {
    padding: 8px 0 0 0;
    gap: 10px;
}

body.is-mobile .shop-bar-message {
    display: none;
}

body.is-mobile .shop-bar-btn {
    padding: 10px 20px;
    font-size: 12px;
}

body.is-mobile .shop-bar-btn.close {
    padding: 10px 15px;
}

/* ======================================
   BUY POINTS BUTTON AND MODAL
   ====================================== */

/* Modal Overlay (full-screen) */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none !important;
}

.modal .modal-content {
    background: var(--panel-bg);
    border: 2px solid var(--neon-cyan);
    box-shadow:
        0 0 20px var(--neon-cyan),
        inset 0 0 30px rgba(0, 255, 255, 0.1);
    padding: 30px;
    text-align: center;
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
}

.modal .modal-close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal .modal-close-btn:hover {
    color: var(--glitch-red);
}

/* Buy Points Button in Main Menu */
.buy-points-btn {
    border-color: gold !important;
    color: gold !important;
    text-shadow: 0 0 5px gold !important;
    box-shadow:
        0 0 10px rgba(255, 215, 0, 0.3),
        inset 0 0 10px rgba(255, 215, 0, 0.1) !important;
}

.buy-points-btn:hover {
    background: rgba(255, 215, 0, 0.2) !important;
    box-shadow:
        0 0 20px rgba(255, 215, 0, 0.5),
        inset 0 0 20px rgba(255, 215, 0, 0.2) !important;
}

.buy-points-btn .buy-icon {
    margin-right: 8px;
}

/* Buy Points Modal */
.buy-points-content {
    max-width: 400px;
    padding: 30px;
}

.buy-points-content .modal-title {
    font-size: 28px;
    color: gold;
    text-shadow: 0 0 15px gold;
    margin-bottom: 10px;
}

.buy-points-content .modal-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
    margin-bottom: 20px;
}

/* Pricing Grid */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 10px 0 20px;
}

.price-tier {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid var(--neon-cyan);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.price-tier:hover {
    transform: scale(1.05);
    box-shadow: 0 0 25px currentColor;
}

.price-tier.popular {
    border-color: gold;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.price-tier.tier-overlord {
    border-color: var(--neon-magenta);
}

.tier-points {
    font-size: 32px;
    font-weight: bold;
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
}

.tier-label {
    font-size: 10px;
    letter-spacing: 2px;
    color: var(--text-secondary);
    margin: 4px 0;
}

.tier-price {
    font-size: 18px;
    font-weight: bold;
    color: gold;
}

.popular-badge,
.value-badge {
    position: absolute;
    top: -10px;
    font-size: 9px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: bold;
}

.popular-badge {
    background: gold;
    color: black;
}

.value-badge {
    background: var(--neon-green);
    color: black;
}

/* Pulsing glow on Specialist tier (recommended) */
.tier-specialist::before {
    content: '';
    position: absolute;
    inset: -4px;
    border: 2px solid gold;
    border-radius: 10px;
    animation: pulseGlow 2s infinite;
    pointer-events: none;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; box-shadow: 0 0 30px gold; }
}

.secure-notice {
    font-size: 11px;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 10px;
}

/* Buy Points Link in Anduril Shop */
.buy-points-link {
    display: inline-block;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    text-decoration: none;
    margin-top: 8px;
    cursor: pointer;
    padding: 0;
}

.buy-points-link:hover {
    color: var(--neon-cyan);
}

.buy-points-link .buy-cta {
    color: gold;
    font-weight: bold;
}

.buy-points-link:hover .buy-cta {
    text-shadow: 0 0 5px gold;
}

/* ======================================
   PURCHASE SUCCESS OVERLAY
   ====================================== */

.purchase-success-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.success-content {
    text-align: center;
    animation: scaleIn 0.5s ease;
    z-index: 10000;
}

.success-icon {
    font-size: 80px;
    animation: pulse 1s infinite;
}

.success-title {
    font-size: 36px;
    color: gold;
    text-shadow: 0 0 30px gold;
    margin: 20px 0;
    letter-spacing: 2px;
}

.points-added {
    font-size: 48px;
    color: var(--neon-green);
    text-shadow: 0 0 20px var(--neon-green);
    font-weight: bold;
}

.success-message {
    color: var(--text-secondary);
    margin: 20px 0 30px;
    font-size: 16px;
}

.success-btn {
    margin: 10px;
    padding: 15px 30px;
    font-size: 14px;
}

.success-btn.open-armory {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.success-btn.dismiss {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

#confetti-canvas {
    position: fixed;
    inset: 0;
    z-index: 9998;
    pointer-events: none;
}

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

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ======================================
   LOCKED WEAPONS IN CONSUMABLES SHOP
   ====================================== */

.shop-weapon-item.locked {
    opacity: 0.5;
    filter: grayscale(70%);
    cursor: pointer;
    position: relative;
}

.shop-weapon-item.locked:hover {
    opacity: 0.7;
    border-color: var(--neon-magenta);
}

.weapon-locked {
    font-size: 8px;
    color: var(--neon-magenta);
    letter-spacing: 1px;
}

/* Locked Weapon Modal */
.locked-weapon-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 600;
    display: flex;
    align-items: center;
    justify-content: center;
}

.locked-modal-content {
    background: var(--dark-bg);
    border: 2px solid var(--neon-magenta);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    max-width: 300px;
    position: relative;
}

.locked-weapon-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.locked-modal-content h3 {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
    margin-bottom: 10px;
    font-size: 18px;
}

.locked-modal-content p {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 20px;
}

.locked-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.locked-btn {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 12px;
}

.locked-btn.go-armory {
    border-color: var(--neon-green);
    color: var(--neon-green);
}

.locked-btn.buy-now {
    background: gold;
    border-color: gold;
    color: black;
    font-weight: bold;
}

.locked-btn.buy-now:hover {
    background: #ffdd44;
}

.locked-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
}

.locked-close:hover {
    color: var(--neon-magenta);
}

/* Mobile adjustments for Buy Points Modal */
@media (max-width: 500px) {
    .buy-points-content {
        max-width: 320px;
        padding: 20px;
    }

    .buy-points-content .modal-title {
        font-size: 22px;
    }

    .pricing-grid {
        gap: 8px;
    }

    .price-tier {
        padding: 15px 10px;
    }

    .tier-points {
        font-size: 26px;
    }

    .tier-price {
        font-size: 16px;
    }

    .success-title {
        font-size: 28px;
    }

    .points-added {
        font-size: 36px;
    }

    .success-icon {
        font-size: 60px;
    }
}
