/* ============================================================================
   BLOCK BASTION: WAVE DEFENSE - STYLES
   ============================================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    /* Color Palette */
    --sky-top: #9ED2FF;
    --sky-bottom: #EAF6FF;
    --ground: #3B6B3B;
    --dirt: #6B4F2A;
    --stone: #9AA3AD;
    --stone-dark: #6E7681;
    --ui-panel: #121826;
    --ui-panel-light: #1E2738;
    --ui-text: #E6EDF6;
    --ui-text-dim: #8A9BB0;
    --accent: #00E5FF;
    --accent-glow: rgba(0, 229, 255, 0.3);
    --danger: #FF3B3B;
    --danger-glow: rgba(255, 59, 59, 0.3);
    --reward: #FFD166;
    --reward-glow: rgba(255, 209, 102, 0.3);
    --success: #4ADE80;
    --health-gate: #4ADE80;
    --health-core: #A78BFA;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--ui-panel);
    touch-action: none;
}

.hidden {
    display: none !important;
}

/* ============================================================================
   GAME CONTAINER & CANVAS
   ============================================================================ */

#game-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

#game-canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* ============================================================================
   LOADING SCREEN
   ============================================================================ */

#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--ui-panel) 0%, #0A0E14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    color: var(--ui-text);
}

.loading-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.loading-content h1 {
    font-size: 36px;
    font-weight: 800;
    letter-spacing: 4px;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--accent) 0%, #00B8D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-content h2 {
    font-size: 18px;
    font-weight: 400;
    letter-spacing: 8px;
    color: var(--ui-text-dim);
    margin-bottom: 40px;
}

.loading-bar {
    width: 250px;
    height: 6px;
    background: var(--ui-panel-light);
    border-radius: 3px;
    margin: 0 auto 20px;
    overflow: hidden;
}

.loading-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent) 0%, #00B8D4 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.loading-text {
    font-size: 14px;
    color: var(--ui-text-dim);
}

/* ============================================================================
   MAIN MENU
   ============================================================================ */

#main-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(18, 24, 38, 0.95) 0%, rgba(10, 14, 20, 0.98) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.menu-content {
    text-align: center;
    max-width: 400px;
    padding: 20px;
}

.menu-title {
    margin-bottom: 40px;
}

.castle-icon {
    font-size: 70px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.menu-title h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: 3px;
    background: linear-gradient(135deg, var(--accent) 0%, #00B8D4 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.menu-title h2 {
    font-size: 16px;
    letter-spacing: 6px;
    color: var(--ui-text-dim);
    margin-top: 5px;
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 30px;
}

.menu-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--stone-dark);
    border-radius: 12px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.menu-btn:hover, .menu-btn:active {
    border-color: var(--accent);
    background: rgba(0, 229, 255, 0.1);
}

.menu-btn.primary {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 184, 212, 0.2) 100%);
}

.menu-btn.primary:hover, .menu-btn.primary:active {
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.3) 0%, rgba(0, 184, 212, 0.3) 100%);
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-icon {
    font-size: 20px;
}

.menu-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: var(--ui-text-dim);
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--reward);
}

/* ============================================================================
   MODALS (How to Play, Settings)
   ============================================================================ */

#how-to-play, #settings-menu, #reset-confirm {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.modal-panel, .confirm-panel {
    background: var(--ui-panel);
    border: 2px solid var(--stone-dark);
    border-radius: 16px;
    padding: 30px;
    max-width: 380px;
    width: 90%;
    text-align: center;
    color: var(--ui-text);
}

.modal-panel h2, .confirm-panel h3 {
    font-size: 24px;
    margin-bottom: 20px;
    color: var(--accent);
}

.instructions {
    text-align: left;
    margin-bottom: 25px;
}

.instruction-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
}

.instruction-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.instruction-item p {
    font-size: 14px;
    color: var(--ui-text-dim);
    line-height: 1.4;
}

.modal-btn {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--stone-dark);
    border-radius: 10px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    border-color: var(--accent);
}

.modal-btn.primary {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 184, 212, 0.2) 100%);
}

/* Settings */
.settings-options {
    margin-bottom: 25px;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--ui-panel-light);
}

.setting-row span {
    font-size: 14px;
}

.toggle-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid var(--accent);
    border-radius: 6px;
    background: rgba(0, 229, 255, 0.15);
    color: var(--accent);
    cursor: pointer;
    min-width: 60px;
}

.toggle-btn.off {
    border-color: var(--stone-dark);
    background: transparent;
    color: var(--ui-text-dim);
}

.settings-danger {
    margin-bottom: 20px;
}

.danger-btn {
    padding: 10px 20px;
    font-size: 13px;
    border: 2px solid var(--danger);
    border-radius: 8px;
    background: rgba(255, 59, 59, 0.1);
    color: var(--danger);
    cursor: pointer;
}

.confirm-panel p {
    font-size: 14px;
    color: var(--ui-text-dim);
    margin-bottom: 20px;
}

.confirm-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--stone-dark);
    border-radius: 8px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    cursor: pointer;
}

.confirm-btn.danger {
    border-color: var(--danger);
    background: rgba(255, 59, 59, 0.2);
    color: var(--danger);
}

/* ============================================================================
   HUD
   ============================================================================ */

#hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    pointer-events: none;
    z-index: 50;
}

.hud-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 10px;
    gap: 8px;
    flex-wrap: wrap;
}

.hud-panel {
    background: rgba(18, 24, 38, 0.9);
    border: 2px solid var(--stone-dark);
    border-radius: 10px;
    padding: 8px 12px;
    pointer-events: auto;
}

.hud-label {
    display: block;
    font-size: 10px;
    color: var(--ui-text-dim);
    letter-spacing: 1px;
    margin-bottom: 2px;
}

.hud-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--ui-text);
}

.wave-info .hud-value {
    color: var(--accent);
}

.coins-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.2) 0%, rgba(255, 180, 50, 0.2) 100%);
    border-color: var(--reward);
    padding: 10px 16px;
}

.coin-icon {
    font-size: 26px;
}

.coins-info .hud-value {
    color: var(--reward);
    font-size: 24px;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.5);
}

/* Health Bars */
.health-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.health-bar-bg {
    width: 80px;
    height: 12px;
    background: var(--ui-panel-light);
    border-radius: 6px;
    overflow: hidden;
}

.health-bar {
    height: 100%;
    width: 100%;
    border-radius: 6px;
    transition: width 0.3s ease;
}

.gate-bar {
    background: linear-gradient(90deg, var(--health-gate) 0%, #22C55E 100%);
}

.core-bar {
    background: linear-gradient(90deg, var(--health-core) 0%, #8B5CF6 100%);
}

.health-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--ui-text);
    min-width: 35px;
}

/* Bottom HUD */
.hud-bottom {
    position: absolute;
    bottom: 140px;
    left: 10px;
    display: flex;
    gap: 10px;
}

.unit-info, .enemy-info {
    background: rgba(18, 24, 38, 0.9);
    border: 2px solid var(--stone-dark);
    border-radius: 10px;
    padding: 8px 14px;
    pointer-events: auto;
}

.unit-label, .enemy-label {
    display: block;
    font-size: 9px;
    color: var(--ui-text-dim);
    letter-spacing: 1px;
}

.unit-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent);
}

.enemy-count {
    font-size: 16px;
    font-weight: 700;
    color: var(--danger);
}

/* ============================================================================
   ACTION BUTTONS
   ============================================================================ */

#action-buttons {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 60;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: rgba(18, 24, 38, 0.95);
    border: 2px solid var(--stone-dark);
    border-radius: 14px;
    color: var(--ui-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover, .action-btn:active {
    border-color: var(--accent);
    background: rgba(0, 229, 255, 0.1);
    transform: translateY(-2px);
}

.action-btn:disabled {
    opacity: 0.5;
    pointer-events: none;
}

.action-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.action-label {
    font-size: 10px;
    font-weight: 600;
}

.action-cost {
    font-size: 11px;
    color: var(--reward);
    font-weight: 700;
}

.spawn-btn:hover {
    border-color: var(--success);
}

.build-btn:hover {
    border-color: var(--accent);
}

.repair-btn:hover {
    border-color: var(--reward);
}

/* ============================================================================
   START WAVE BUTTON
   ============================================================================ */

#start-wave-container {
    position: absolute;
    bottom: 110px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 60;
}

.start-wave-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.3) 0%, rgba(220, 38, 38, 0.3) 100%);
    border: 2px solid var(--danger);
    border-radius: 12px;
    color: var(--ui-text);
    cursor: pointer;
    transition: all 0.2s ease;
    animation: pulse-danger 2s infinite;
}

@keyframes pulse-danger {
    0%, 100% { box-shadow: 0 0 0 0 var(--danger-glow); }
    50% { box-shadow: 0 0 20px 5px var(--danger-glow); }
}

.start-wave-btn:hover {
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.5) 0%, rgba(220, 38, 38, 0.5) 100%);
    transform: scale(1.05);
}

.wave-icon {
    font-size: 20px;
}

.shop-btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    background: var(--ui-panel-light);
    border: 2px solid var(--reward);
    border-radius: 10px;
    color: var(--reward);
    cursor: pointer;
}

.shop-btn:hover {
    background: rgba(255, 209, 102, 0.15);
}

/* Wave Active Indicator */
#wave-active {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(255, 59, 59, 0.2);
    border: 2px solid var(--danger);
    border-radius: 10px;
    color: var(--danger);
    font-weight: 600;
    font-size: 14px;
    z-index: 55;
}

.wave-pulse {
    width: 12px;
    height: 12px;
    background: var(--danger);
    border-radius: 50%;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

/* ============================================================================
   SHOP PANEL
   ============================================================================ */

#shop-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 150;
}

.shop-content {
    background: var(--ui-panel);
    border: 2px solid var(--stone-dark);
    border-radius: 16px;
    padding: 20px;
    max-width: 500px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--ui-panel-light);
}

.shop-header h2 {
    font-size: 22px;
    color: var(--accent);
}

.shop-coins {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--reward);
}

.close-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 8px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    font-size: 20px;
    cursor: pointer;
}

.upgrades-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.upgrade-card {
    background: var(--ui-panel-light);
    border: 2px solid var(--stone-dark);
    border-radius: 12px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.2s;
}

.upgrade-card:hover {
    border-color: var(--accent);
}

.upgrade-icon {
    font-size: 32px;
    text-align: center;
}

.upgrade-details h3 {
    font-size: 14px;
    color: var(--ui-text);
    margin-bottom: 2px;
}

.upgrade-desc {
    font-size: 11px;
    color: var(--ui-text-dim);
    margin-bottom: 6px;
}

.upgrade-level {
    font-size: 11px;
    color: var(--ui-text-dim);
}

.upgrade-level span {
    color: var(--accent);
    font-weight: 700;
}

.upgrade-effect {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

.upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    border: 2px solid var(--reward);
    border-radius: 8px;
    background: rgba(255, 209, 102, 0.15);
    color: var(--reward);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.upgrade-btn:hover {
    background: rgba(255, 209, 102, 0.3);
}

.upgrade-btn:disabled {
    border-color: var(--stone-dark);
    background: transparent;
    color: var(--ui-text-dim);
    cursor: not-allowed;
}

.upgrade-btn.maxed {
    border-color: var(--success);
    background: rgba(74, 222, 128, 0.15);
    color: var(--success);
}

.coin-small {
    font-size: 14px;
}

.shop-close-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid var(--accent);
    border-radius: 10px;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 184, 212, 0.2) 100%);
    color: var(--ui-text);
    cursor: pointer;
}

/* ============================================================================
   WAVE COMPLETE
   ============================================================================ */

#wave-complete {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 160;
}

.complete-panel {
    background: var(--ui-panel);
    border: 2px solid var(--success);
    border-radius: 16px;
    padding: 30px;
    max-width: 350px;
    width: 90%;
    text-align: center;
    color: var(--ui-text);
    animation: pop-in 0.3s ease;
}

@keyframes pop-in {
    0% { transform: scale(0.8); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.complete-panel h2 {
    font-size: 24px;
    color: var(--success);
    margin-bottom: 10px;
}

.complete-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

.complete-stats {
    margin-bottom: 20px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--ui-panel-light);
}

.stat-row span:last-child {
    color: var(--reward);
    font-weight: 600;
}

.stat-row.total {
    border-bottom: none;
    font-size: 18px;
    font-weight: 700;
    padding-top: 12px;
}

.stat-row.total span:last-child {
    color: var(--success);
}

.next-wave-preview {
    background: var(--ui-panel-light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 13px;
}

.next-wave-preview .difficulty {
    font-weight: 700;
    margin-left: 8px;
}

.difficulty.easy { color: var(--success); }
.difficulty.medium { color: var(--reward); }
.difficulty.hard { color: var(--danger); }

.complete-buttons {
    display: flex;
    gap: 12px;
}

.complete-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--stone-dark);
    border-radius: 10px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    cursor: pointer;
}

.complete-btn.primary {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.2) 0%, rgba(0, 184, 212, 0.2) 100%);
}

/* ============================================================================
   GAME OVER
   ============================================================================ */

#game-over {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 170;
}

.gameover-panel {
    background: var(--ui-panel);
    border: 2px solid var(--danger);
    border-radius: 16px;
    padding: 30px;
    max-width: 480px;
    width: 90%;
    text-align: center;
    color: var(--ui-text);
    animation: shake-in 0.5s ease;
}

@keyframes shake-in {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-10px); }
    40%, 80% { transform: translateX(10px); }
}

.gameover-panel h2 {
    font-size: 26px;
    color: var(--danger);
    margin-bottom: 10px;
}

.gameover-icon {
    font-size: 60px;
    margin-bottom: 10px;
}

.gameover-panel p {
    font-size: 14px;
    color: var(--ui-text-dim);
    margin-bottom: 20px;
}

.gameover-stats {
    display: flex;
    justify-content: space-around;
    margin-bottom: 25px;
}

.go-stat {
    text-align: center;
}

.go-label {
    display: block;
    font-size: 10px;
    color: var(--ui-text-dim);
    margin-bottom: 4px;
}

.go-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--reward);
}

.gameover-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.gameover-btn {
    flex: 1;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid var(--stone-dark);
    border-radius: 10px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    cursor: pointer;
}

.gameover-btn.primary {
    border-color: var(--danger);
    background: rgba(255, 59, 59, 0.2);
}

/* ============================================================================
   PLACEMENT MODE
   ============================================================================ */

#placement-mode {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 229, 255, 0.2);
    border: 2px solid var(--accent);
    border-radius: 10px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 65;
}

.placement-info span {
    font-size: 14px;
    color: var(--ui-text);
}

.cancel-btn {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border: 2px solid var(--danger);
    border-radius: 6px;
    background: rgba(255, 59, 59, 0.2);
    color: var(--danger);
    cursor: pointer;
}

/* ============================================================================
   PAUSE
   ============================================================================ */

#pause-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    font-size: 20px;
    background: rgba(18, 24, 38, 0.9);
    border: 2px solid var(--accent);
    border-radius: 10px;
    color: var(--ui-text);
    cursor: pointer;
    z-index: 70;
}

#pause-menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 180;
}

.pause-panel {
    background: var(--ui-panel);
    border: 2px solid var(--accent);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    min-width: 250px;
}

.pause-panel h2 {
    font-size: 28px;
    color: var(--accent);
    margin-bottom: 25px;
}

.pause-menu-btn {
    display: block;
    width: 100%;
    padding: 14px;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    border: 2px solid var(--stone-dark);
    border-radius: 10px;
    background: var(--ui-panel-light);
    color: var(--ui-text);
    cursor: pointer;
}

.pause-menu-btn:hover {
    border-color: var(--accent);
}

/* ============================================================================
   FLOATING TEXT
   ============================================================================ */

#floating-text-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 200;
    overflow: hidden;
}

.floating-text {
    position: absolute;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    animation: float-up 1.5s ease-out forwards;
    white-space: nowrap;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
}

.floating-text.damage {
    color: var(--danger);
    font-size: 18px;
}

.floating-text.coins {
    color: var(--reward);
    font-size: 16px;
}

.floating-text.heal {
    color: var(--success);
    font-size: 16px;
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 500px) {
    .hud-top {
        padding: 8px;
        gap: 6px;
    }

    .hud-panel {
        padding: 6px 10px;
    }

    .hud-value {
        font-size: 16px;
    }

    .health-bar-bg {
        width: 60px;
        height: 10px;
    }

    .action-btn {
        width: 64px;
        height: 64px;
    }

    .action-icon {
        font-size: 18px;
    }

    .action-label {
        font-size: 9px;
    }

    #action-buttons {
        gap: 8px;
    }

    .upgrades-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-height: 600px) {
    .hud-bottom {
        bottom: 120px;
    }

    #start-wave-container {
        bottom: 90px;
    }
}
