@keyframes move {
    100% {
        transform: translate3d(0, 0, 1px) rotate(360deg);
    }
}

.background {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: #000000e3;
    overflow: hidden;
    z-index: -1;
    pointer-events: none;
    border-radius: 20px;
    display: none;
}

.ball {
    position: absolute;
    width: 20vmin;
    height: 20vmin;
    border-radius: 50%;
    backface-visibility: hidden;
    animation: move linear infinite;
}

.ball:nth-child(odd) {
        color: #006D5B;
}

.ball:nth-child(even) {
        color: #FF6F61;
}

/* Using a custom attribute for variability */
.ball:nth-child(1) {
    top: 77%;
    left: 88%;
    animation-duration: 40s;
    animation-delay: -3s;
    transform-origin: 16vw -2vh;
    box-shadow: 40vmin 0 5.703076368487546vmin currentColor;
}
.ball:nth-child(2) {
    top: 42%;
    left: 2%;
    animation-duration: 53s;
    animation-delay: -29s;
    transform-origin: -19vw 21vh;
    box-shadow: -40vmin 0 5.17594621519026vmin currentColor;
}
.ball:nth-child(3) {
    top: 28%;
    left: 18%;
    animation-duration: 49s;
    animation-delay: -8s;
    transform-origin: -22vw 3vh;
    box-shadow: 40vmin 0 5.248179047256236vmin currentColor;
}
.ball:nth-child(4) {
    top: 50%;
    left: 79%;
    animation-duration: 26s;
    animation-delay: -21s;
    transform-origin: -17vw -6vh;
    box-shadow: 40vmin 0 5.279749632220298vmin currentColor;
}
.ball:nth-child(5) {
    top: 46%;
    left: 15%;
    animation-duration: 36s;
    animation-delay: -40s;
    transform-origin: 4vw 0vh;
    box-shadow: -40vmin 0 5.964309466052033vmin currentColor;
}
.ball:nth-child(6) {
    top: 77%;
    left: 16%;
    animation-duration: 31s;
    animation-delay: -10s;
    transform-origin: 18vw 4vh;
    box-shadow: 40vmin 0 5.178483653434181vmin currentColor;
}
.ball:nth-child(7) {
    top: 22%;
    left: 17%;
    animation-duration: 55s;
    animation-delay: -6s;
    transform-origin: 1vw -23vh;
    box-shadow: -40vmin 0 5.703026794398318vmin currentColor;
}
.ball:nth-child(8) {
    top: 41%;
    left: 47%;
    animation-duration: 43s;
    animation-delay: -28s;
    transform-origin: 25vw -3vh;
    box-shadow: 40vmin 0 5.196265905749415vmin currentColor;
}

/* ===== LAYOUT: BODY & MAIN CONTAINERS ===== */
body {
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
    align-items: flex-start;
    height: 100vh;
    background-color: #000000e3;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    overflow: hidden;
    gap: 20px;
    position: relative;
    box-sizing: border-box;
}

/* ===== UI SIDEBAR (Left column) ===== */
#ui-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: auto;
    max-height: calc(100vh - 40px);
    overflow: hidden;
    flex-shrink: 0;
    z-index: 50;
}

/* Top row: Upgrade + Right column (HUD + Stats) */
#sidebar-top-row {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: auto;
}

/* Right column within sidebar: HUD window, Stats window, and Buttons stacked */
#right-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: auto;
}

/* ===== UPGRADE WINDOW ===== */
#upgrade-window {
    position: relative;
    width: 250px;
    max-height: 600px;
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95) 0%, rgba(40, 40, 70, 0.95) 100%);
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 14px;
    text-align: center;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
    display: none;
}

#upgrade-window h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
}

#upgrade-text {
    margin-bottom: 8px;
    font-size: 13px;
    color: #ffd700;
    font-weight: 500;
    min-height: 18px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.upgrade-button-container {
    margin: 6px 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: visible;
}

.upgrade-button-container.maxed-out {
    transform: scale(0.9);
    opacity: 0.6;
}

.upgrade-button-container.collapsed {
    height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
}

#upgrade-window button {
    width: 100%;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(220, 220, 230, 0.95) 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

#upgrade-window button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2);
}

#upgrade-window button:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#upgrade-window button:disabled {
    background: linear-gradient(135deg, rgba(60, 60, 70, 0.9) 0%, rgba(45, 45, 55, 0.9) 100%) !important;
    color: rgba(150, 150, 160, 0.8) !important;
    cursor: not-allowed !important;
    pointer-events: auto;
    box-shadow: none;
}

#upgrade-window button {
    position: relative;
}

/* Tooltip styling */
#upgrade-window button::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.98) 0%, rgba(40, 40, 70, 0.98) 100%);
    color: #fff;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-left: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

#upgrade-window button:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
}

/* ===== HUD WINDOW ===== */
#hud-window {
    position: relative;
    width: 100px;
    padding: 10px 10px;
    font-size: 15px;
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95) 0%, rgba(40, 40, 70, 0.95) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

#hud-window h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

#hud-content {
    line-height: 1.6;
    font-size: 14px;
    font-weight: 500;
}

/* ===== STATS WINDOW ===== */
#stats-window {
    position: relative;
    width: 100px;
    padding: 10px;
    font-size: 14px;
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.95) 0%, rgba(40, 40, 70, 0.95) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    display: none;
    flex-direction: column;
    gap: 0px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

#stats-window h3 {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

#stats-content {
    line-height: 1.6;
    font-size: 13px;
}

#stats-money {
    font-size: 22px;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    font-weight: 600;
}

/* ===== AUDIO CONTROLS ===== */
#audio-controls {
    position: relative;
    width: 250px;
    padding: 10px 10px;
    font-size: 13px;
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.95) 0%, rgba(40, 40, 60, 0.95) 100%);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: none;
    flex-direction: column;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    flex-shrink: 0;
}

#audio-controls label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    letter-spacing: 0.5px;
}

#audio-controls input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

#audio-controls input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s ease;
}

#audio-controls input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#audio-controls input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #fff 0%, #ccc 100%);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* ===== CONTROL BUTTONS (Pause & Restart) ===== */
#pause-button {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(30, 30, 30, 0.95) 0%, rgba(50, 50, 50, 0.95) 100%);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    display: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    width: 100%;
}

#pause-button:hover {
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.95) 0%, rgba(70, 70, 70, 0.95) 100%);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

#restart-button {
    padding: 10px 15px;
    font-size: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(180, 30, 30, 0.9) 0%, rgba(120, 20, 20, 0.9) 100%);
    color: #fff;
    border: 2px solid rgba(255, 100, 100, 0.3);
    border-radius: 12px;
    cursor: pointer;
    text-align: center;
    display: none;
    box-shadow: 0 4px 15px rgba(180, 30, 30, 0.3);
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    width: 100%;
}

#restart-button:hover {
    background: linear-gradient(135deg, rgba(220, 40, 40, 0.95) 0%, rgba(160, 30, 30, 0.95) 100%);
    border-color: rgba(255, 100, 100, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 40, 40, 0.5);
}

/* ===== GAME CONTAINER (Right side - main play zone) ===== */
#game-container {
    position: relative;
    flex: 1;
    height: calc(100vh - 40px);
    background-color: transparent;
    overflow: hidden;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 400px;
    max-width: 100%;
}

.upgrade-button-container.maxed-out {
    transform: scale(0.9);
    opacity: 0.6;
}

.upgrade-button-container.collapsed {
    height: 0;
    margin: 0;
    padding: 0;
    opacity: 0;
}

/* ===== MODERN UPGRADE BUTTONS ===== */
#upgrade-window button {
    width: 100%;
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(220, 220, 230, 0.95) 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

#upgrade-window button:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(255, 255, 255, 0.2);
}

#upgrade-window button:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

#upgrade-window button:disabled {
    background: linear-gradient(135deg, rgba(60, 60, 70, 0.9) 0%, rgba(45, 45, 55, 0.9) 100%) !important;
    color: rgba(150, 150, 160, 0.8) !important;
    cursor: not-allowed !important;
    pointer-events: auto;
    box-shadow: none;
}

#upgrade-window button {
    position: relative;
}

/* Tooltip styling */
#upgrade-window button::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    left: 100%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.98) 0%, rgba(40, 40, 70, 0.98) 100%);
    color: #fff;
    padding: 10px 15px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    z-index: 1000001;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    margin-left: 15px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(5px);
}

#upgrade-window button:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(5px);
}

/* ===== START BUTTON (Modal overlay) ===== */
#start-text {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 28px;
    font-weight: 300;
    text-align: center;
    z-index: 30;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

#start-button {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    font-size: 22px;
    font-weight: 600;
    background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 30;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

#start-button:hover {
    transform: translate(-50%, -50%) scale(1.08);
    box-shadow: 
        0 15px 40px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(255, 255, 255, 0.4);
}

#start-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    animation: pulse 2s infinite;
    z-index: -1;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

/* ===== GAME CONTAINER CANVAS ===== */
#game-container canvas {
    display: none;
    width: 100%;
    height: auto;
    aspect-ratio: 800 / 600;
    background-color: transparent;
    border-radius: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 0 30px rgba(255, 255, 255, 0.1),
        0 0 60px rgba(255, 255, 255, 0.05),
        inset 0 0 30px rgba(255, 255, 255, 0.02);
    transition: all 0.3s ease;
}

#game-container canvas:hover {
    border-color: rgba(255, 255, 255, 0.5);
    box-shadow: 
        0 0 40px rgba(255, 255, 255, 0.15),
        0 0 80px rgba(255, 255, 255, 0.08),
        inset 0 0 40px rgba(255, 255, 255, 0.03);
}
/* ===== MODERN HUD (canvas internal) ===== */
#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    color: #fff;
    font-size: 18px;
    z-index: 10;
    display: none;
}

/* ===== GAME OVER / WIN SCREENS ===== */
#game-over {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff4444;
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    z-index: 30;
    display: none;
    text-shadow: 
        0 0 30px rgba(255, 68, 68, 0.6),
        0 0 60px rgba(255, 68, 68, 0.3);
    letter-spacing: 4px;
}

#try-again-button {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    z-index: 30;
    display: none;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.4),
        0 0 20px rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

#try-again-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(255, 255, 255, 0.3);
}

#next-level-button {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 36px;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #4CAF50 0%, #2E7D32 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    z-index: 30;
    display: none;
    box-shadow: 
        0 8px 30px rgba(76, 175, 80, 0.4),
        0 0 20px rgba(76, 175, 80, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

#next-level-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 
        0 12px 40px rgba(76, 175, 80, 0.5),
        0 0 30px rgba(76, 175, 80, 0.4);
}

#level-complete {
    position: absolute;
    top: 36%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4CAF50;
    font-size: 44px;
    font-weight: 700;
    text-align: center;
    z-index: 30;
    display: none;
    text-shadow: 
        0 0 30px rgba(76, 175, 80, 0.6),
        0 0 60px rgba(76, 175, 80, 0.3);
    letter-spacing: 4px;
}

#game-win {
    position: fixed;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ffd700;
    font-size: 72px;
    font-weight: 700;
    text-align: center;
    z-index: 10;
    display: none;
    text-shadow: 
        0 0 40px rgba(255, 215, 0, 0.6),
        0 0 80px rgba(255, 215, 0, 0.3),
        0 0 120px rgba(255, 215, 0, 0.2);
    letter-spacing: 6px;
    animation: winGlow 2s ease-in-out infinite;
}

@keyframes winGlow {
    0%, 100% { 
        text-shadow: 
            0 0 40px rgba(255, 215, 0, 0.6),
            0 0 80px rgba(255, 215, 0, 0.3),
            0 0 120px rgba(255, 215, 0, 0.2);
    }
    50% { 
        text-shadow: 
            0 0 60px rgba(255, 215, 0, 0.8),
            0 0 100px rgba(255, 215, 0, 0.5),
            0 0 150px rgba(255, 215, 0, 0.3);
    }
}

#infinite-mode-button {
    position: fixed;
    top: calc(40% + 150px);
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 16px 36px;
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, #9C27B0 0%, #6A1B9A 100%);
    color: #fff;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    z-index: 10;
    display: none;
    text-align: center;
    box-shadow: 
        0 8px 30px rgba(156, 39, 176, 0.4),
        0 0 20px rgba(156, 39, 176, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 1px;
}

#infinite-mode-button:hover {
    transform: translate(-50%, -50%) scale(1.05);
    box-shadow: 
        0 12px 40px rgba(156, 39, 176, 0.5),
        0 0 30px rgba(156, 39, 176, 0.4);
}

#game-paused {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff9800;
    font-size: 42px;
    font-weight: 700;
    text-align: center;
    z-index: 30;
    display: none;
    text-shadow: 
        0 0 30px rgba(255, 152, 0, 0.6),
        0 0 60px rgba(255, 152, 0, 0.3);
    letter-spacing: 4px;
    animation: pausePulse 1.5s ease-in-out infinite;
}

@keyframes pausePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ===== RESTART CONFIRM MODAL ===== */
#restart-confirm {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.98) 0%, rgba(40, 40, 70, 0.98) 100%);
    padding: 30px 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 24px;
    text-align: center;
    z-index: 10;
    display: none;
    backdrop-filter: blur(10px);
}

#restart-confirm h2 {
    margin: 0 0 25px 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
}

#restart-confirm button {
    margin: 0 15px;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 1px;
}

#restart-confirm button:hover {
    transform: translateY(-3px);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.3),
        0 0 15px rgba(255, 255, 255, 0.2);
}

#restart-confirm button:first-of-type {
    background: linear-gradient(135deg, #f44336 0%, #c62828 100%);
    color: #fff;
}

#restart-confirm button:first-of-type:hover {
    box-shadow: 
        0 8px 25px rgba(244, 67, 54, 0.4),
        0 0 15px rgba(244, 67, 54, 0.3);
}

/* ===== LAVA ORIENTATION POPUP ===== */
#lava-orientation-popup {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 20, 35, 0.98) 0%, rgba(40, 40, 70, 0.98) 100%);
    padding: 25px 35px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 20px;
    text-align: center;
    z-index: 10;
    display: none;
    backdrop-filter: blur(10px);
}

#lava-orientation-popup h2 {
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.95);
}

#lava-orientation-popup button {
    margin: 0 12px;
    padding: 12px 28px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    letter-spacing: 0.5px;
}

#lava-orientation-popup button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* ===== CANVAS STYLING ===== */
canvas {
    display: block;
    background-color: transparent;
    border-radius: 20px;
}

/* ===== ACCESSIBILITY ===== */
button:focus,
input:focus {
    outline: none;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

#upgrade-window::-webkit-scrollbar {
    width: 6px;
}

#upgrade-window::-webkit-scrollbar-thumb {
    background: rgba(150, 150, 200, 0.4);
    border-radius: 3px;
}

#upgrade-window::-webkit-scrollbar-thumb:hover {
    background: rgba(150, 150, 200, 0.6);
}
