/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

:root {
    --primary-dark: #0a0a1a;
    --secondary-dark: #14142b;
    --space-blue: #00d4ff;
    --space-purple: #9d4edd;
    --nebula-red: #ff2e63;
    --star-yellow: #ffd166;
    --nebula-green: #06d6a0;
    --crystal-purple: #9d4edd;
    --text-light: #f8f9fa;
    --text-dim: #adb5bd;
    --card-bg: rgba(20, 20, 43, 0.95);
    --border-radius: 8px;
    --box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --glow: 0 0 15px;
    --header-height: 70px;
    --sidebar-width: 280px;
}

body {
    font-family: 'Exo 2', sans-serif;
    background: radial-gradient(circle at center, #0a0a1a 0%, #050510 100%);
    color: var(--text-light);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(0, 212, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(157, 78, 221, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(255, 46, 99, 0.1) 0%, transparent 50%);
    z-index: -1;
    animation: nebula 20s ease-in-out infinite;
}

@keyframes nebula {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 0.9; }
}

.container {
    width: 100vw;
    height: 100vh;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ===== COMPACT HEADER ===== */
.header {
    background: linear-gradient(135deg, rgba(10, 10, 26, 0.95), rgba(20, 20, 43, 0.95));
    backdrop-filter: blur(10px);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: var(--box-shadow);
    height: var(--header-height);
    min-height: var(--header-height);
    flex-shrink: 0;
    position: relative;
    z-index: 100;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 1.6rem;
    color: var(--space-blue);
    text-shadow: 0 0 10px var(--space-blue);
    animation: pulse 2s ease-in-out infinite;
}

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

.logo h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--space-blue), var(--space-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    letter-spacing: 1px;
}

.game-state-compact {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.state-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 70px;
}

.state-item i {
    font-size: 1rem;
}

.state-item:nth-child(1) i { color: var(--nebula-red); }
.state-item:nth-child(2) i { color: var(--star-yellow); }
.state-item:nth-child(3) i { color: var(--crystal-purple); }
.state-item:nth-child(4) i { color: var(--nebula-green); }

.state-item span {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    color: var(--text-light);
}

.wave-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
    flex: 1;
}

.wave-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 600;
}

.wave-info strong {
    color: var(--star-yellow);
    font-family: 'Orbitron', sans-serif;
}

.separator {
    color: var(--space-blue);
    opacity: 0.5;
}

.controls {
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.control-btn {
    padding: 8px 15px;
    border: none;
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    min-height: 36px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.control-btn.start-btn {
    background: linear-gradient(135deg, var(--nebula-green), #06b58a);
    color: white;
    box-shadow: 0 4px 12px rgba(6, 214, 160, 0.3);
}

.control-btn.start-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 214, 160, 0.4);
}

.control-btn.start-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.btn-text {
    display: inline;
}

.control-btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    flex-shrink: 0;
}

.pause-btn {
    background: linear-gradient(135deg, var(--star-yellow), #ffb347);
    color: var(--primary-dark);
}

.pause-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 209, 102, 0.3);
}

.speed-btn {
    background: linear-gradient(135deg, var(--space-purple), #7b3cad);
    color: white;
}

.speed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
}

.speed-btn.active {
    background: linear-gradient(135deg, var(--nebula-green), #06b58a);
    box-shadow: 0 0 12px rgba(6, 214, 160, 0.5);
}

.shop-btn {
    background: linear-gradient(135deg, var(--crystal-purple), #7b3cad);
    color: white;
}

.shop-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
}

.info-btn {
    background: linear-gradient(135deg, var(--space-blue), #0099cc);
    color: white;
}

.info-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

/* ===== GAME AREA ===== */
.game-area {
    flex: 1;
    display: flex;
    gap: 8px;
    min-height: 0;
    overflow: hidden;
    padding: 8px;
    flex-direction: row;
}

.game-board {
    flex: 1;
    background: rgba(10, 10, 26, 0.7);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0, 212, 255, 0.3);
    box-shadow: 
        inset 0 0 20px rgba(0, 212, 255, 0.1),
        0 0 20px rgba(0, 212, 255, 0.1);
    min-width: 0;
    min-height: 300px;
    display: flex;
    flex-direction: column;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    background: radial-gradient(ellipse at center, #0a0a1a 0%, #050510 100%);
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Selection Indicator */
.selection-indicator {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(20, 20, 43, 0.95);
    backdrop-filter: blur(5px);
    border-radius: 15px;
    border: 2px solid var(--star-yellow);
    font-size: 0.85rem;
    color: var(--star-yellow);
    box-shadow: 0 4px 16px rgba(255, 209, 102, 0.3);
    z-index: 10;
    animation: pulse-glow 2s ease-in-out infinite;
    display: none;
    max-width: 250px;
}

@keyframes pulse-glow {
    0%, 100% { 
        box-shadow: 0 4px 16px rgba(255, 209, 102, 0.3);
        border-color: var(--star-yellow);
    }
    50% { 
        box-shadow: 0 4px 24px rgba(255, 209, 102, 0.6);
        border-color: #ffed99;
    }
}

.selection-indicator i {
    font-size: 0.9rem;
}

/* Tower Info Panel */
.tower-info-compact {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(20, 20, 43, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    width: 250px;
    max-width: calc(100% - 20px);
    border: 1px solid var(--space-blue);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        inset 0 0 15px rgba(0, 212, 255, 0.1);
    display: none;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tower-info-header {
    background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(157, 78, 221, 0.2));
    padding: 10px 12px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.tower-info-header h4 {
    color: var(--text-light);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
}

.tower-info-header i {
    color: var(--space-blue);
}

.tower-info-body {
    padding: 12px;
}

.tower-stats-mini {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.tower-stat-mini {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.stat-label-mini {
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 4px;
    font-weight: 600;
}

.stat-value-mini {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--star-yellow);
    font-family: 'Orbitron', sans-serif;
}

.level-center {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--space-blue), var(--space-purple));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 0.9rem;
    color: white;
    margin-top: 2px;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.5);
}

.tower-actions-mini {
    display: flex;
    gap: 8px;
}

.action-btn-mini {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: var(--transition);
    min-height: 36px;
}

.action-btn-mini.upgrade-btn {
    background: linear-gradient(135deg, var(--star-yellow), #ffb347);
    color: var(--primary-dark);
}

.action-btn-mini.upgrade-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 209, 102, 0.3);
}

.action-btn-mini.sell-btn {
    background: linear-gradient(135deg, var(--nebula-red), #d91e5a);
    color: white;
}

.action-btn-mini.sell-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 46, 99, 0.3);
}

.action-btn-mini .cost {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    margin-left: 4px;
    font-size: 0.8rem;
}

.action-btn-mini:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.2rem;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
    flex-shrink: 0;
}

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

/* ===== COMPACT SIDEBAR ===== */
.sidebar-compact {
    flex: 0 0 var(--sidebar-width);
    max-width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.sidebar-compact::-webkit-scrollbar {
    width: 4px;
}

.sidebar-compact::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

.sidebar-compact::-webkit-scrollbar-thumb {
    background: var(--space-blue);
    border-radius: 2px;
}

.section-header-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.section-header-mini i {
    font-size: 0.95rem;
    color: var(--space-blue);
}

.section-header-mini h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    color: var(--text-light);
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Shop Section */
.shop-section-compact {
    background: rgba(20, 20, 43, 0.8);
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid rgba(0, 212, 255, 0.2);
    box-shadow: var(--box-shadow);
    flex-shrink: 0;
}

.stations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.station-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 10px;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-height: 90px;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
}

.station-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateY(-2px);
}

.station-item.selected {
    border-color: var(--star-yellow);
    background: rgba(255, 209, 102, 0.1);
    box-shadow: 0 0 12px rgba(255, 209, 102, 0.2);
}

.station-item.unlocked {
    animation: unlockPulse 3s ease-in-out infinite;
}

@keyframes unlockPulse {
    0%, 100% { 
        box-shadow: 0 4px 8px rgba(157, 78, 221, 0.3);
        border-color: rgba(157, 78, 221, 0.5);
    }
    50% { 
        box-shadow: 0 4px 16px rgba(157, 78, 221, 0.6);
        border-color: rgba(157, 78, 221, 0.8);
    }
}

.station-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    color: white;
    transition: var(--transition);
}

.station-item:hover .station-icon {
    transform: scale(1.1);
}

.laser-station {
    background: linear-gradient(135deg, var(--nebula-red), #d91e5a);
    box-shadow: 0 4px 8px rgba(255, 46, 99, 0.3);
}

.plasma-station {
    background: linear-gradient(135deg, var(--nebula-green), #06b58a);
    box-shadow: 0 4px 8px rgba(6, 214, 160, 0.3);
}

.railgun-station {
    background: linear-gradient(135deg, var(--space-blue), #0099cc);
    box-shadow: 0 4px 8px rgba(0, 212, 255, 0.3);
}

.tesla-station {
    background: linear-gradient(135deg, var(--star-yellow), #ffb347);
    box-shadow: 0 4px 8px rgba(255, 209, 102, 0.3);
}

.quantum-station {
    background: linear-gradient(135deg, var(--crystal-purple), #7b3cad);
    box-shadow: 0 4px 8px rgba(157, 78, 221, 0.3);
}

.station-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 100%;
}

.station-name {
    font-size: 0.8rem;
    color: var(--text-light);
    font-weight: 600;
    text-align: center;
    line-height: 1.2;
}

.station-cost {
    font-size: 0.85rem;
    color: var(--star-yellow);
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
    display: flex;
    align-items: center;
    gap: 4px;
}

.station-cost i {
    color: var(--crystal-purple);
    font-size: 0.75rem;
}

.station-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: center;
}

.stat-tag {
    font-size: 0.7rem;
    color: var(--text-dim);
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    white-space: nowrap;
}

/* Wave Preview */
.wave-preview-mini {
    background: rgba(20, 20, 43, 0.8);
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid rgba(255, 46, 99, 0.2);
    box-shadow: var(--box-shadow);
    flex-shrink: 0;
}

.wave-info-detailed {
    margin-bottom: 12px;
}

.wave-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wave-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.wave-stat i {
    color: var(--space-blue);
    font-size: 0.85rem;
}

.wave-stat strong {
    color: var(--star-yellow);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
}

.enemy-preview-mini {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.enemy-preview-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid;
}

.enemy-preview-item i {
    font-size: 0.85rem;
}

.enemy-preview-name {
    font-size: 0.8rem;
    color: var(--text-light);
    flex: 1;
}

.enemy-preview-count {
    font-size: 0.85rem;
    color: var(--star-yellow);
    font-weight: 700;
    font-family: 'Orbitron', sans-serif;
}

.wave-crystals-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px;
    background: rgba(157, 78, 221, 0.1);
    border-radius: 6px;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.wave-crystals-indicator i {
    color: var(--crystal-purple);
}

.wave-crystals-indicator strong {
    color: var(--crystal-purple);
    font-family: 'Orbitron', sans-serif;
}

/* Base Section */
.base-section-mini {
    background: rgba(20, 20, 43, 0.8);
    border-radius: var(--border-radius);
    padding: 12px;
    border: 1px solid rgba(157, 78, 221, 0.2);
    box-shadow: var(--box-shadow);
    flex-shrink: 0;
}

.base-info-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.base-level-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.base-level-label {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.base-level-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--space-purple);
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 8px var(--space-purple);
}

.base-upgrade-btn-compact {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: linear-gradient(135deg, var(--space-purple), #7b3cad);
    border: none;
    border-radius: 6px;
    color: white;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 36px;
}

.base-upgrade-btn-compact:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.3);
}

.base-upgrade-btn-compact:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.base-bonuses {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
}

.bonus-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.bonus-item i {
    color: var(--space-blue);
    font-size: 0.8rem;
}

.bonus-item strong {
    color: var(--star-yellow);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
}

/* ===== MINIMAL FOOTER ===== */
.game-footer-mini {
    background: rgba(20, 20, 43, 0.95);
    backdrop-filter: blur(5px);
    border-radius: var(--border-radius);
    padding: 8px 12px;
    border-top: 1px solid rgba(0, 212, 255, 0.2);
    height: 40px;
    min-height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
    margin: 0 8px 8px;
}

.message-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    padding-right: 10px;
    min-width: 0;
    overflow: hidden;
}

.message-bar i {
    color: var(--space-blue);
    font-size: 0.9rem;
    flex-shrink: 0;
}

.message-bar span {
    color: var(--text-light);
    font-size: 0.8rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.high-score {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-dim);
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(255, 209, 102, 0.1);
    border: 1px solid rgba(255, 209, 102, 0.3);
}

.high-score i {
    color: var(--star-yellow);
    font-size: 0.9rem;
}

.high-score strong {
    color: var(--star-yellow);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
}

/* ===== МАГАЗИН ===== */
.shop-modal {
    max-width: 700px;
    max-height: 80vh;
    width: 90%;
}

.shop-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.shop-currency {
    padding: 12px;
    background: rgba(157, 78, 221, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(157, 78, 221, 0.3);
}

.currency-display {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.currency-label {
    color: var(--text-dim);
    font-size: 1rem;
}

.currency-value {
    color: #9d4edd;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.5);
}

.shop-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
    padding-bottom: 8px;
    flex-wrap: wrap;
}

.shop-tab {
    flex: 1;
    padding: 8px 12px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-dim);
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    font-size: 0.85rem;
    min-width: 80px;
}

.shop-tab:hover {
    color: var(--text-light);
}

.shop-tab.active {
    color: var(--space-blue);
    border-bottom-color: var(--space-blue);
}

.shop-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    max-height: 350px;
    overflow-y: auto;
    padding-right: 8px;
}

.shop-items::-webkit-scrollbar {
    width: 5px;
}

.shop-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.shop-items::-webkit-scrollbar-thumb {
    background: var(--space-blue);
    border-radius: 3px;
}

.shop-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 12px;
    border: 2px solid transparent;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 180px;
}

.shop-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--space-blue);
    transform: translateY(-2px);
}

.shop-item.locked {
    opacity: 0.6;
    cursor: not-allowed;
}

.shop-item.owned {
    border-color: var(--nebula-green);
}

.shop-item-icon {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    margin: 0 auto;
}

.shop-item-icon.weapon {
    background: linear-gradient(135deg, var(--nebula-red), #d91e5a);
}

.shop-item-icon.satellite {
    background: linear-gradient(135deg, var(--space-blue), #0099cc);
}

.shop-item-icon.harvester {
    background: linear-gradient(135deg, var(--star-yellow), #ffb347);
}

.shop-item-icon.cosmetic {
    background: linear-gradient(135deg, #9d4edd, #7b3cad);
}

.shop-item-name {
    text-align: center;
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.85rem;
    line-height: 1.2;
}

.shop-item-desc {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.75rem;
    line-height: 1.3;
    flex: 1;
}

.shop-item-price {
    text-align: center;
    color: #9d4edd;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.shop-item-price i {
    font-size: 0.8rem;
}

.buy-btn {
    width: 100%;
    padding: 6px;
    background: linear-gradient(135deg, var(--nebula-green), #06b58a);
    border: none;
    border-radius: 4px;
    color: white;
    font-family: 'Exo 2', sans-serif;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.8rem;
}

.buy-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(6, 214, 160, 0.3);
}

.buy-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===== MODAL WINDOWS ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 15px;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, rgba(20, 20, 43, 0.95), rgba(10, 10, 26, 0.95));
    border-radius: var(--border-radius);
    padding: 20px;
    max-width: 500px;
    width: 100%;
    max-height: 70vh;
    overflow-y: auto;
    border: 1px solid var(--space-blue);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.5),
        inset 0 0 20px rgba(0, 212, 255, 0.1);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 212, 255, 0.3);
}

.modal-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    color: var(--space-blue);
    display: flex;
    align-items: center;
    gap: 8px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.3rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    color: var(--text-dim);
    line-height: 1.5;
    font-size: 0.9rem;
}

/* Info Modal Content */
.modal-section {
    margin-bottom: 20px;
}

.modal-section h3 {
    font-family: 'Orbitron', sans-serif;
    color: var(--space-blue);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}

.modal-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.modal-item {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border-left: 3px solid var(--space-blue);
}

.modal-item h4 {
    color: var(--text-light);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.modal-item p {
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}

.hotkey-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.hotkey-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.hotkey {
    background: var(--space-blue);
    color: var(--primary-dark);
    padding: 3px 6px;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    min-width: 35px;
    text-align: center;
    font-size: 0.8rem;
}

.hotkey-text {
    flex: 1;
    color: var(--text-light);
    font-size: 0.8rem;
}

/* Game Over Modal */
.game-over-modal {
    max-width: 450px;
    text-align: center;
}

.game-over-header {
    margin-bottom: 20px;
    padding: 15px;
    border-radius: var(--border-radius);
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.2), rgba(6, 214, 160, 0.2));
    border: 1px solid;
}

.game-over-header.victory {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.3), rgba(0, 212, 255, 0.3));
    border-color: var(--nebula-green);
}

.game-over-header.defeat {
    background: linear-gradient(135deg, rgba(255, 46, 99, 0.3), rgba(255, 209, 102, 0.3));
    border-color: var(--nebula-red);
}

.game-over-header h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.game-over-header.victory h2 {
    color: var(--nebula-green);
    text-shadow: 0 0 15px rgba(6, 214, 160, 0.5);
}

.game-over-header.defeat h2 {
    color: var(--nebula-red);
    text-shadow: 0 0 15px rgba(255, 46, 99, 0.5);
}

.game-over-header p {
    color: var(--text-light);
    font-size: 1rem;
}

.game-over-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.game-over-stats .stat {
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-over-stats .stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.game-over-stats .stat-value {
    display: block;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--star-yellow);
    font-family: 'Orbitron', sans-serif;
}

.restart-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, var(--space-blue), var(--space-purple));
    border: none;
    border-radius: 6px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.5px;
}

.restart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.4);
}

/* ===== УВЕДОМЛЕНИЯ ===== */
.notification {
    position: fixed;
    top: 15px;
    right: 15px;
    background: rgba(20, 20, 43, 0.95);
    border-left: 3px solid;
    padding: 12px;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    max-width: 250px;
    animation: slideIn 0.3s ease, slideOut 0.3s ease 2.7s forwards;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

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

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

.notification.crystal {
    border-left-color: var(--crystal-purple);
}

.notification.crystal i {
    color: var(--crystal-purple);
}

.notification.success {
    border-left-color: var(--nebula-green);
}

.notification.success i {
    color: var(--nebula-green);
}

.notification.error {
    border-left-color: var(--nebula-red);
}

.notification.error i {
    color: var(--nebula-red);
}

.notification.info {
    border-left-color: var(--space-blue);
}

.notification.info i {
    color: var(--space-blue);
}

/* ===== АДАПТИВНЫЕ СТИЛИ ===== */
@media (max-width: 1200px) {
    :root {
        --sidebar-width: 250px;
    }
    
    .header {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .game-state-compact {
        gap: 8px;
    }
    
    .state-item {
        min-width: 65px;
        padding: 5px 8px;
        font-size: 0.85rem;
    }
    
    .controls {
        gap: 4px;
    }
    
    .control-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .btn-text {
        display: inline;
    }
    
    .control-btn-icon {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
}

@media (max-width: 992px) {
    .header {
        padding: 8px 10px;
    }
    
    .logo-section {
        width: 100%;
        justify-content: space-between;
    }
    
    .wave-controls {
        width: 100%;
        align-items: center;
    }
    
    .wave-info {
        width: 100%;
        justify-content: center;
        margin-bottom: 5px;
    }
    
    .controls {
        width: 100%;
        justify-content: center;
    }
    
    .game-area {
        flex-direction: column;
        padding: 6px;
    }
    
    .sidebar-compact {
        max-width: none;
        flex: 0 0 auto;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        max-height: 220px;
        overflow-x: auto;
        overflow-y: hidden;
        order: 2;
        margin-top: 8px;
    }
    
    .shop-section-compact,
    .base-section-mini,
    .wave-preview-mini {
        flex: 1;
        min-width: 220px;
        max-height: 200px;
    }
    
    .stations-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .base-bonuses {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .game-board {
        min-height: 400px;
        order: 1;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 6px 8px;
        gap: 6px;
        height: 65px;
        min-height: 65px;
    }
    
    .logo h1 {
        font-size: 1.4rem;
    }
    
    .logo i {
        font-size: 1.4rem;
    }
    
    .game-state-compact {
        gap: 5px;
    }
    
    .state-item {
        min-width: 55px;
        padding: 4px 6px;
        font-size: 0.8rem;
    }
    
    .state-item span {
        font-size: 0.9rem;
    }
    
    .wave-info {
        font-size: 0.8rem;
    }
    
    .controls {
        gap: 3px;
    }
    
    .control-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
        min-height: 32px;
    }
    
    .btn-text {
        display: inline;
    }
    
    .control-btn-icon {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    
    .game-area {
        padding: 5px;
        flex-direction: column;
    }
    
    .sidebar-compact {
        flex-direction: row;
        max-height: 180px;
        gap: 6px;
    }
    
    .shop-section-compact,
    .base-section-mini,
    .wave-preview-mini {
        min-width: 220px;
        max-height: 170px;
    }
    
    .stations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .base-bonuses {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-board {
        min-height: 350px;
    }
    
    .tower-info-compact {
        width: calc(100% - 10px);
        right: 5px;
        bottom: 5px;
    }
    
    .selection-indicator {
        font-size: 0.7rem;
        padding: 6px 10px;
        max-width: 200px;
    }
    
    .game-footer-mini {
        padding: 6px 8px;
        margin: 0 5px 5px;
    }
    
    .message-bar span {
        font-size: 0.75rem;
    }
    
    .high-score {
        font-size: 0.75rem;
        padding: 3px 8px;
    }
}

@media (max-width: 576px) {
    .header {
        padding: 5px;
        height: 60px;
        min-height: 60px;
        flex-direction: column;
        gap: 5px;
    }
    
    .logo-section {
        width: 100%;
        justify-content: space-between;
    }
    
    .logo {
        gap: 6px;
    }
    
    .logo i {
        font-size: 1.2rem;
    }
    
    .logo h1 {
        font-size: 1.2rem;
    }
    
    .game-state-compact {
        gap: 3px;
    }
    
    .state-item {
        min-width: 50px;
        padding: 3px 5px;
        font-size: 0.7rem;
    }
    
    .state-item span {
        font-size: 0.8rem;
    }
    
    .wave-controls {
        width: 100%;
        align-items: center;
    }
    
    .wave-info {
        font-size: 0.7rem;
        justify-content: center;
        margin-bottom: 3px;
    }
    
    .controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .control-btn {
        flex: 1;
        max-width: 120px;
        padding: 4px 8px;
        font-size: 0.7rem;
        min-height: 30px;
        justify-content: center;
    }
    
    .btn-text {
        display: inline;
    }
    
    .control-btn-icon {
        flex: 1;
        max-width: 50px;
        min-width: 30px;
        height: 30px;
    }
    
    .game-area {
        padding: 4px;
        flex-direction: column;
    }
    
    .sidebar-compact {
        flex-direction: column;
        max-height: 200px;
        gap: 5px;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .shop-section-compact,
    .base-section-mini,
    .wave-preview-mini {
        min-width: 100%;
        max-height: none;
    }
    
    .stations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-board {
        min-height: 300px;
        order: 1;
    }
    
    .shop-items {
        grid-template-columns: 1fr;
    }
    
    .shop-tabs {
        flex-wrap: wrap;
    }
    
    .shop-tab {
        flex: 1 0 calc(50% - 4px);
        font-size: 0.75rem;
        padding: 6px 8px;
    }
    
    .game-over-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-grid {
        grid-template-columns: 1fr;
    }
    
    .game-footer-mini {
        flex-direction: column;
        height: auto;
        min-height: 55px;
        gap: 5px;
        padding: 6px;
        margin: 4px;
    }
    
    .message-bar {
        width: 100%;
        padding-right: 0;
        justify-content: center;
        text-align: center;
    }
    
    .footer-right {
        width: 100%;
        justify-content: center;
    }
}

/* Портретный режим для мобилок */
@media (max-width: 480px) and (orientation: portrait) {
    .container {
        height: 100vh;
    }
    
    .header {
        height: 70px;
        min-height: 70px;
        padding: 5px 8px;
    }
    
    .logo-section {
        margin-bottom: 3px;
    }
    
    .game-state-compact {
        justify-content: space-around;
        width: 100%;
        margin-top: 3px;
    }
    
    .state-item {
        flex: 1;
        min-width: auto;
        justify-content: center;
    }
    
    .wave-controls {
        margin-top: 5px;
    }
    
    .game-area {
        flex-direction: column;
        padding: 4px;
        height: calc(100vh - 140px);
    }
    
    .game-board {
        min-height: calc(100vh - 300px);
        height: 60vh;
        order: 1;
    }
    
    .sidebar-compact {
        order: 2;
        max-height: 150px;
        margin-top: 5px;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
    
    .shop-section-compact,
    .base-section-mini,
    .wave-preview-mini {
        min-width: 250px;
        height: 140px;
    }
    
    .stations-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .game-footer-mini {
        height: 40px;
        min-height: 40px;
        margin: 4px;
        order: 3;
    }
}

/* Landscape mode для мобилок */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        height: 55px;
        min-height: 55px;
        padding: 4px 6px;
    }
    
    .game-area {
        flex-direction: row;
        height: calc(100vh - 95px);
    }
    
    .game-board {
        min-height: calc(100vh - 150px);
        height: auto;
    }
    
    .sidebar-compact {
        max-height: calc(100vh - 150px);
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        min-width: 200px;
    }
    
    .shop-section-compact,
    .base-section-mini,
    .wave-preview-mini {
        min-width: 100%;
        max-height: none;
    }
    
    .stations-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .game-footer-mini {
        display: none;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .station-item:hover,
    .control-btn:hover,
    .action-btn-mini:hover,
    .base-upgrade-btn-compact:hover,
    .shop-item:hover,
    .buy-btn:hover {
        transform: none !important;
    }
    
    .station-item:active,
    .control-btn:active,
    .action-btn-mini:active,
    .base-upgrade-btn-compact:active,
    .shop-item:active,
    .buy-btn:active {
        transform: scale(0.95) !important;
    }
    
    .control-btn-icon:active,
    .close-btn:active,
    .close-modal:active {
        transform: scale(0.9) !important;
    }
    
    .btn-text {
        display: inline !important;
    }
}

/* Selection Effects */
.station-item.selected .station-icon {
    animation: station-pulse 2s ease-in-out infinite;
}

@keyframes station-pulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 4px 8px rgba(255, 209, 102, 0.3);
    }
    50% { 
        transform: scale(1.1);
        box-shadow: 0 4px 16px rgba(255, 209, 102, 0.6);
    }
}

/* Pulse animation for gold and crystals */
.pulse {
    animation: pulse 0.3s ease-in-out;
}

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

/* Hide scrollbars globally except where needed */
.container {
    overflow: hidden;
}

.game-area {
    overflow: hidden;
}

.sidebar-compact {
    overflow-y: auto;
    overflow-x: hidden;
}

.shop-items {
    overflow-y: auto;
}

.modal-content {
    overflow-y: auto;
}

/* Prevent blue overflow scroll */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--space-blue) rgba(255, 255, 255, 0.05);
}

*::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

*::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
}

*::-webkit-scrollbar-thumb {
    background: var(--space-blue);
    border-radius: 2px;
}

*::-webkit-scrollbar-thumb:hover {
    background: var(--space-blue);
}

/* Ensure game canvas scales properly */
#gameCanvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}
