/* =========================
          GLOBAL
========================= */

* {
    box-sizing: border-box;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: black;
    position: fixed;
    touch-action: none;
    pointer-events: auto;
}

body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}


/* =========================
          CANVAS
========================= */

#gameCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    display: none;
    touch-action: none;
    z-index: 1;
    image-rendering: pixelated;
    image-rendering: -webkit-optimize-contrast;
    pointer-events: auto;
}


/* =========================
          SPLASH
========================= */

#splashScreen {
    position: fixed;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background: url("assets/ui/splash-screen.png") center center no-repeat;
    background-size: 100% 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 10000;
    pointer-events: auto;
}

#loadingText {
    font-size: clamp(14px, 4vw, 22px);
    margin-top: 40vh;
    animation: blink 1s infinite;
}

@keyframes blink {

    0% {opacity:1}
    50% {opacity:0.3}
    100% {opacity:1}
}



/* =========================
        MAIN MENU
========================= */

#main-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background: 
        radial-gradient(ellipse at center, rgba(20, 0, 40, 0.9) 0%, rgba(0, 0, 0, 1) 100%),
        url("assets/background.png") center center / cover no-repeat;
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    z-index: 6000;
    opacity: 0;
    transition: opacity 1s ease-in;
    overflow: hidden;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    box-sizing: border-box;
}

#main-menu.show {
    opacity: 1;
}

#gameTitle {
    font-family: 'Orbitron', 'Arial Black', sans-serif;
    font-size: clamp(32px, 10vw, 80px);  /* Balanced size */
    font-weight: 900;
    text-align: center;
    line-height: 1.0;
    margin: 0;
    margin-top: 8vh;
    position: relative;
    z-index: 2;
    text-transform: uppercase;
    letter-spacing: 4px;
    width: 100%;
    max-width: 100%;
    word-break: break-word;
    overflow-wrap: break-word;
}

#main-menu::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, white, transparent),
        radial-gradient(2px 2px at 40px 70px, rgba(255,255,255,0.8), transparent),
        radial-gradient(1px 1px at 90px 40px, white, transparent),
        radial-gradient(2px 2px at 160px 120px, rgba(255,255,255,0.9), transparent),
        radial-gradient(1px 1px at 230px 80px, white, transparent);
    background-size: 250px 250px;
    animation: twinkle 5s ease-in-out infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* =========================
   TITLE CONTAINER
========================= */

.title-container {
    position: relative;
    margin-bottom: 60px;
    perspective: 1000px;
}

/* Individual letter styling */
.letter {
    display: inline-block;
    position: relative;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #0080ff;
    animation: 
        letterBounce 2s ease-in-out infinite,
        letterGlow 1.5s ease-in-out infinite alternate;
    transform-origin: center bottom;
    font-size: 1em;
}

/* Staggered animation delays for wave effect */
.letter:nth-child(1) { animation-delay: 0s, 0s; }
.letter:nth-child(2) { animation-delay: 0.1s, 0.1s; }
.letter:nth-child(3) { animation-delay: 0.2s, 0.2s; }
.letter:nth-child(4) { animation-delay: 0.3s, 0.3s; }
.letter:nth-child(5) { animation-delay: 0.4s, 0.4s; }
.letter:nth-child(6) { animation-delay: 0.5s, 0.5s; }

/* "STRIKE" letters - different color */
.letter.strike {
    color: #ff3366;
    text-shadow: 
        0 0 10px #ff3366,
        0 0 20px #ff3366,
        0 0 40px #ff0066,
        0 0 80px #ff0066,
        0 0 120px #cc0052;
    animation: 
        letterBounce 2s ease-in-out infinite,
        strikeGlow 1.5s ease-in-out infinite alternate;
}

/* Staggered delays for STRIKE letters */
.letter.strike:nth-of-type(1) { animation-delay: 0.6s, 0.6s; }
.letter.strike:nth-of-type(2) { animation-delay: 0.7s, 0.7s; }
.letter.strike:nth-of-type(3) { animation-delay: 0.8s, 0.8s; }
.letter.strike:nth-of-type(4) { animation-delay: 0.9s, 0.9s; }
.letter.strike:nth-of-type(5) { animation-delay: 1.0s, 1.0s; }
.letter.strike:nth-of-type(6) { animation-delay: 1.1s, 1.1s; }

/* Bouncy animation */
@keyframes letterBounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-10px) scale(1.05, 0.95);
    }
    50% {
        transform: translateY(-20px) scale(0.95, 1.05);
    }
    75% {
        transform: translateY(-5px) scale(1.02, 0.98);
    }
}

/* Glow animations */
@keyframes letterGlow {
    0% {
        text-shadow: 
            0 0 10px #00ffff,
            0 0 20px #00ffff,
            0 0 40px #0080ff;
        filter: brightness(1);
    }
    100% {
        text-shadow: 
            0 0 20px #00ffff,
            0 0 40px #00ffff,
            0 0 80px #0080ff,
            0 0 120px #0040ff,
            0 0 160px #0040ff;
        filter: brightness(1.3);
    }
}

@keyframes strikeGlow {
    0% {
        text-shadow: 
            0 0 10px #ff3366,
            0 0 20px #ff3366,
            0 0 40px #ff0066;
        filter: brightness(1);
    }
    100% {
        text-shadow: 
            0 0 20px #ff3366,
            0 0 40px #ff3366,
            0 0 80px #ff0066,
            0 0 120px #cc0052,
            0 0 160px #cc0052;
        filter: brightness(1.3);
    }
}

/* Background glow effect behind title */
.title-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150%;
    height: 150%;
    background: radial-gradient(ellipse, rgba(0, 255, 255, 0.3) 0%, transparent 70%);
    filter: blur(40px);
    animation: glowPulse 2s ease-in-out infinite;
    z-index: 1;
}

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

/* Lightning bolt decoration */
.title-container::after {
    content: '⚡';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(100px, 20vw, 300px);
    opacity: 0.1;
    filter: blur(2px);
    animation: lightningPulse 1s ease-in-out infinite;
    z-index: 0;
}

@keyframes lightningPulse {
    0%, 100% { opacity: 0.05; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.15; transform: translate(-50%, -50%) scale(1.2); }
}

/* =========================
      MENU BUTTONS
========================= */

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 3000;
    position: relative;
    pointer-events: auto;
    width: 100%;
    max-width: 320px;
    align-items: center;
}

.menu-btn {
    position: relative;
    width: 100%;
    max-width: 280px;
    padding: 18px 50px;
    font-family: 'Orbitron', 'Arial Black', sans-serif;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #fff;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1) 0%, rgba(0, 128, 255, 0.1) 100%);
    border: 2px solid #00ffff;
    border-radius: 50px;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    pointer-events: auto; /* ENSURE CLICKABLE */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
}

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

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

.menu-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        0 10px 30px rgba(0, 255, 255, 0.5),
        0 0 40px rgba(0, 255, 255, 0.4),
        inset 0 0 30px rgba(0, 255, 255, 0.2);
    border-color: #80ffff;
    text-shadow: 0 0 10px #fff;
}

.menu-btn:active {
    transform: translateY(-1px) scale(0.98);
}

/* Play button - special styling */
.play-btn {
    background: linear-gradient(135deg, rgba(0, 255, 128, 0.15) 0%, rgba(0, 200, 100, 0.15) 100%);
    border-color: #00ff80;
    box-shadow: 
        0 0 20px rgba(0, 255, 128, 0.3),
        inset 0 0 20px rgba(0, 255, 128, 0.1);
    animation: playPulse 2s ease-in-out infinite;
}

@keyframes playPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 128, 0.3), inset 0 0 20px rgba(0, 255, 128, 0.1); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 128, 0.6), inset 0 0 30px rgba(0, 255, 128, 0.2); }
}

.play-btn:hover {
    border-color: #80ffc0;
    box-shadow: 
        0 10px 30px rgba(0, 255, 128, 0.5),
        0 0 50px rgba(0, 255, 128, 0.4);
}

/* Shop button - special styling */
.shop-btn {
    background: linear-gradient(135deg, rgba(255, 200, 0, 0.15) 0%, rgba(255, 150, 0, 0.15) 100%);
    border-color: #ffc800;
    box-shadow: 
        0 0 20px rgba(255, 200, 0, 0.3),
        inset 0 0 20px rgba(255, 200, 0, 0.1);
}

.shop-btn:hover {
    border-color: #ffe080;
    box-shadow: 
        0 10px 30px rgba(255, 200, 0, 0.5),
        0 0 50px rgba(255, 200, 0, 0.4);
}

/* Settings button - special styling */
.settings-btn {
    background: linear-gradient(135deg, rgba(200, 0, 255, 0.15) 0%, rgba(150, 0, 200, 0.15) 100%);
    border-color: #c800ff;
    box-shadow: 
        0 0 20px rgba(200, 0, 255, 0.3),
        inset 0 0 20px rgba(200, 0, 255, 0.1);
}

.settings-btn:hover {
    border-color: #e080ff;
    box-shadow: 
        0 10px 30px rgba(200, 0, 255, 0.5),
        0 0 50px rgba(200, 0, 255, 0.4);
}

/* Button text */
.btn-text {
    position: relative;
    z-index: 2;
}

/* Shine effect */
.btn-shine {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.1) 50%,
        transparent 70%
    );
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) rotate(30deg); }
    100% { transform: translateX(100%) rotate(30deg); }
}


#dailyRewardPopup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.rewardBox {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid gold;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    animation: pop 0.3s ease;
}

.rewardBox h2 {
    color: gold;
}

.rewardBox button {
    margin-top: 15px;
    padding: 10px 25px;
    border-radius: 20px;
    border: none;
    background: gold;
    font-weight: bold;
    cursor: pointer;
}


/* =========================
      DAILY REWARD
========================= */

#dailyReward {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);

    display: none;
    justify-content: center;
    align-items: center;

    z-index: 6000;
}

.dailyBox {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #00ffff;
    border-radius: 20px;

    padding: 25px;
    text-align: center;

    width: 90%;
    max-width: 400px;
}

.dailyBox h2 {
    color: white;
    margin-bottom: 15px;
}

/* Grid */
.dailyGrid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

/* Each day */
.day {
    padding: 10px;
    border-radius: 10px;
    border: 2px solid #555;
    color: white;
    font-size: 12px;
}

/* States */
.day.active {
    border-color: #00ffff;
    box-shadow: 0 0 10px cyan;
}

.day.claimed {
    background: #00ff88;
    color: black;
}

/* CHEST */
#rewardChest {
    font-size: 60px;
    margin: 15px auto;
    cursor: pointer;
    animation: chestBounce 1.2s infinite;
}

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

.flyingCoin {
    position: fixed;
    font-size: 24px;
    z-index: 9999;
    transition: transform 0.7s ease-in, opacity 0.7s ease-in;
}

/* =========================
            HUD
========================= */

#hud {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    color: white;
    font-family: 'Orbitron', Arial, sans-serif;
    z-index: 2000;
    pointer-events: none;
}

/* Curved top bar */
.hud-top-bar {
    position: relative;
    width: 100%;
    height: 70px;
    background: linear-gradient(180deg, rgba(10, 20, 40, 0.95) 0%, rgba(5, 10, 25, 0.9) 100%);
    border-bottom-left-radius: 50% 20px;
    border-bottom-right-radius: 50% 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    padding-top: max(10px, env(safe-area-inset-top));
    box-shadow: 
        0 4px 20px rgba(0, 150, 255, 0.3),
        inset 0 -2px 10px rgba(0, 200, 255, 0.1);
    pointer-events: auto;
}

/* Blue glow border effect */
.hud-top-bar::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 5%;
    right: 5%;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #00aaff 20%, 
        #00ffff 50%, 
        #00aaff 80%, 
        transparent 100%
    );
    border-radius: 50%;
    filter: blur(1px);
}

/* Left section - Ship icon + Energy */
.hud-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.ship-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid #00aaff;
    background: rgba(0, 100, 200, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
}

.ship-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.energy-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.energy-text {
    font-size: clamp(12px, 3.5vw, 16px);
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(0, 170, 255, 0.8);
    letter-spacing: 1px;
}

.energy-bar-container {
    width: clamp(100px, 30vw, 180px);
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(0, 170, 255, 0.3);
    overflow: hidden;
    position: relative;
}

.energy-bar {
    height: 100%;
    width: 90%; /* Default, update via JS */
    background: linear-gradient(90deg, #0066cc 0%, #00aaff 50%, #00ffff 100%);
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
    transition: width 0.3s ease;
}

/* Right section - Coins */
.hud-right {
    display: flex;
    align-items: center;
}

.coin-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 200, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 200, 0, 0.2);
}

.coin-display img {
    width: 24px;
    height: 24px;
    filter: drop-shadow(0 0 5px rgba(255, 200, 0, 0.8));
}

.coin-display span {
    font-size: clamp(14px, 4vw, 18px);
    font-weight: 700;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 200, 0, 0.6);
}

/* Mission Counter */
.mission-counter {
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 20, 40, 0.8);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 255, 0.3);
    backdrop-filter: blur(10px);
    pointer-events: auto;
}

.mission-label {
    font-size: clamp(10px, 3vw, 14px);
    color: #aaddff;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.mission-progress {
    font-size: clamp(12px, 3.5vw, 16px);
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.5);
}

/* Hearts - repositioned to bottom left */
#hearts {
    position: fixed;
    bottom: 20px;
    left: 15px;
    display: flex;
    gap: 6px;
    pointer-events: none;
    filter: drop-shadow(0 0 5px rgba(255, 0, 100, 0.5));
}

.heart {
    width: clamp(24px, 6vw, 32px);
    height: clamp(24px, 6vw, 32px);
    transition: transform 0.2s;
}

.heart.lost {
    filter: grayscale(100%) brightness(0.3);
    transform: scale(0.9);
}

/* Pause Button - repositioned to bottom right */
#pauseBtn {
    position: fixed;
    bottom: 20px;
    right: 15px;
    pointer-events: auto;
    padding: 10px 20px;
    font-size: clamp(12px, 3vw, 14px);
    font-family: 'Orbitron', sans-serif;
    background: rgba(0, 100, 200, 0.3);
    border: 2px solid #00aaff;
    color: #00ffff;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

#pauseBtn:hover {
    background: rgba(0, 170, 255, 0.4);
    box-shadow: 0 0 25px rgba(0, 200, 255, 0.6);
    transform: scale(1.05);
}

#pauseBtn:active {
    transform: scale(0.95);
}

/* Boss Bar - adjusted for new layout */
#bossBar {
    position: fixed;
    top: 130px;
    left: 50%;
    transform: translateX(-50%);
    width: 70%;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #ff4444;
    border-radius: 6px;
    display: none;
    z-index: 400;
    overflow: hidden;
}

#bossHealth {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #ff4444 0%, #ff8844 100%);
    box-shadow: 0 0 15px rgba(255, 100, 0, 0.6);
    transition: width 0.2s ease;
}

/* Responsive adjustments */
@media (max-height: 700px) {
    .hud-top-bar {
        height: 60px;
    }
    
    .mission-counter {
        top: 65px;
        padding: 6px 15px;
    }
    
    #bossBar {
        top: 110px;
    }
}

/* =========================
          WARNING
========================= */

#bossWarning {

    position: fixed;

    top: 40%;
    left: 50%;

    transform: translate(-50%, -50%);

    color: red;

    font-size: 40px;

    display: none;

    animation: blink 0.5s infinite;
}

#coinWarning {
    position: fixed;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(255, 0, 80, 0.9);
    color: white;
    padding: 12px 25px;
    border-radius: 30px;
    font-family: Orbitron, sans-serif;
    font-size: 16px;
    font-weight: bold;
    opacity: 0;
    z-index: 9999;
    transition: all 0.3s ease;
    box-shadow: 0 0 20px rgba(255, 0, 80, 0.7);
}

#coinWarning.show {
    opacity: 1;
    transform: translateX(-50%) scale(1);
}

/* =========================
      LEVEL COMPLETE
========================= */

#levelComplete {

    position: fixed;

    width: 100vw;
    height: 100vh;

    background: black;

    display: none;

    z-index: 900;

    justify-content: center;
    align-items: center;

    flex-direction: column;
}



/* =========================
           SHOP
========================= */

#shop {
    position: fixed;
    inset: 0;
    background: #000;
    color: white;
    font-family: 'Orbitron', Arial, sans-serif;
    display: none;
    flex-direction: column;
    align-items: center;
    padding: 20px;
    padding-bottom: 30px;
    gap: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    z-index: 9999;
}

#shop[style*="flex"] {
    display: flex !important;
}

#shop .menu-btn {
    margin-top: auto;
}

.shopSection {
    width: 100%;
    max-width: 500px;
    margin-bottom: 10px;
    text-align: center;

    background: rgba(255,255,255,0.05);
    border: 2px solid #00ffff;
    border-radius: 15px;

    padding: 15px;
}
.shopSection h2 {
    color: #ffffff;
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* SKINS GRID */
#skins {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.skinBtn {
    position: relative;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #444;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.skinBtn.unlocked {
    border-color: #00ff88 !important;
    box-shadow: 0 0 15px #00ff88;
}

.skinBtn.locked {
    border-color: #ff4444;
    opacity: 0.8;
}

.skinBtn:active {
    transform: scale(0.95);
}

.skinBtn img {
    width: 70%;
    height: 70%;
    object-fit: contain;
    image-rendering: pixelated;
}

.skinBtn .lockIcon {
    position: absolute;
    top: 5px;
    left: 5px;
    transition: opacity 0.3s ease;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    opacity: 0.9;
}

.skinLabel {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffffff;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 4px black;
    padding: 2px;
    background: rgba(0, 0, 0, 0.6);
}

.skinPrice {
    position: absolute;
    bottom: 5px;
    left: 0;
    right: 0;
    text-align: center;
    color: #ffd700;
    font-size: 12px;
    font-weight: bold;
    text-shadow: 0 0 4px black;
    padding: 2px;
    background: rgba(0, 0, 0, 0.6);
}

.skinPrice {
    color: #ffd700;
}

.equippedBadge {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* SHOP CONTROLS */
.shopControls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.shopBtn {
    padding: 12px;
    border: 2px solid #00ffff;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    background: rgba(0,255,255,0.1);
    transition: 0.2s;
    font-family: 'Orbitron', sans-serif;
    color: white;
    font-weight: bold;
    letter-spacing: 1px;
}

.shopBtn:active {
    transform: scale(0.98);
    background: linear-gradient(135deg, #1a5f9e 0%, #16213e 100%);
}

.shopBtn:hover {
    background: rgba(0,255,255,0.3);
}

.shopBtn span {
    color: #ffffff;
}

#shop > button:last-child,
#shop > .menu-btn:last-child {
    margin-top: auto;
    margin-bottom: 25px;
    align-self: center;
    width: 80%;
    max-width: 300px;
    border-radius: 50px;
    border: 3px solid #00ffff;
    background: rgba(0, 50, 100, 0.3);
}

#shopCoins {
    margin-top: 5px;
    font-size: 18px;
    font-weight: bold;
    color: #ffd700;
    position: sticky;
    bottom: 10px;
}

/* =========================
        COIN PACKS
========================= */

.coinPacks {
    display: flex;
    gap: 12px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.coinCard {
    flex: 1;
    min-width: 90px;

    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border: 2px solid #00ffff;
    border-radius: 15px;

    padding: 15px 10px;
    text-align: center;

    cursor: pointer;
    transition: all 0.2s ease;

    position: relative;
}

/* Hover / Tap feel */
.coinCard:active {
    transform: scale(0.95);
    box-shadow: 0 0 20px cyan;
}

/* Amount */
.coinAmount {
    font-size: 20px;
    font-weight: bold;
    color: #ffd700;
}

/* Label */
.coinLabel {
    font-size: 12px;
    color: white;
}

/* Price */
.coinPrice {
    margin-top: 8px;
    font-size: 14px;
    color: #00ffcc;
    font-weight: bold;
}

/* BEST DEAL highlight */
.coinCard.popular {
    border-color: #00ff88;
    box-shadow: 0 0 15px rgba(0,255,136,0.5);
}

/* Badge */
.badge {
    position: absolute;
    top: -8px;
    right: -8px;

    background: #00ff88;
    color: black;

    font-size: 10px;
    font-weight: bold;

    padding: 3px 6px;
    border-radius: 6px;
}

/* =========================
      REWARDED AD BUTTON
========================= */

.rewardAdBox {
    margin-top: 15px;
    text-align: center;
}

.rewardText {
    color: white;
    font-size: 14px;
    margin-bottom: 8px;
    opacity: 0.8;
}

/* Reuse your menu button style */
.rewardBtn {
    width: 100%;
    max-width: 300px;

    border-color: #ffcc00;
    color: #ffcc00;

    box-shadow:
        0 0 15px rgba(255, 204, 0, 0.4),
        inset 0 0 10px rgba(255, 204, 0, 0.2);
}

/* Cool glow pulse */
.rewardBtn {
    animation: rewardPulse 2s infinite;
}

@keyframes rewardPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(255,204,0,0.3); }
    50% { box-shadow: 0 0 25px rgba(255,204,0,0.8); }
}

#bossRewardPopup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 15px 0;
}

.day {
    background: #111;
    border: 1px solid #555;
    border-radius: 8px;
    padding: 5px;
    font-size: 10px;
    text-align: center;
    color: white;
}

.day b {
    display: block;
    color: gold;
    font-size: 12px;
}

.day.claimed {
    background: #00aa55;
    border-color: #00ff88;
}

.day.today {
    background: #0044aa;
    border-color: #00ffff;
    transform: scale(1.1);
}

/* =========================
        PAUSE MENU
========================= */

#pauseMenu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 5000;
    animation: fadeIn 0.3s ease;
}

#pauseBox {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 3px solid #00ffff;
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    box-shadow: 
        0 0 40px rgba(0, 255, 255, 0.4),
        inset 0 0 20px rgba(0, 255, 255, 0.1);
    min-width: 280px;
    max-width: 90%;
    animation: pop 0.3s ease;
}

#pauseBox h2 {
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(24px, 6vw, 32px);
    margin: 0 0 30px 0;
    text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
    letter-spacing: 3px;
}

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

.pauseBtn {
    padding: 15px 40px;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(16px, 4vw, 20px);
    font-weight: 700;
    border: 2px solid;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.resumeBtn {
    background: linear-gradient(135deg, rgba(0, 255, 128, 0.2) 0%, rgba(0, 200, 100, 0.2) 100%);
    border-color: #00ff80;
    color: #00ff80;
    box-shadow: 0 0 20px rgba(0, 255, 128, 0.3);
}

.resumeBtn:hover {
    background: linear-gradient(135deg, rgba(0, 255, 128, 0.4) 0%, rgba(0, 200, 100, 0.4) 100%);
    box-shadow: 0 0 30px rgba(0, 255, 128, 0.6);
    transform: scale(1.05);
}

.resumeBtn:active {
    transform: scale(0.95);
}

.quitBtn {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.2) 0%, rgba(200, 50, 50, 0.2) 100%);
    border-color: #ff4444;
    color: #ff4444;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.quitBtn:hover {
    background: linear-gradient(135deg, rgba(255, 68, 68, 0.4) 0%, rgba(200, 50, 50, 0.4) 100%);
    box-shadow: 0 0 30px rgba(255, 68, 68, 0.6);
    transform: scale(1.05);
}

.quitBtn:active {
    transform: scale(0.95);
}


/* =========================
        SETTINGS
========================= */

#settings {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    width: 100vw;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    min-height: -webkit-fill-available;
    display: none; /* Hidden by default */
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    z-index: 4000; /* ABOVE MAIN MENU */
    padding: 20px;
    pointer-events: auto;
}

.settingsPanel {
    width: 100%;
    max-width: 400px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #00ffff;
    border-radius: 20px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.3);
    pointer-events: auto;
}

.settingsPanel h2 {
    color: #00ffff;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(24px, 6vw, 32px);
    margin: 0 0 30px 0;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    text-align: center;
}

/* HORIZONTAL BUTTON CONTAINER */
.settingsButtons {
    display: flex;
    flex-direction: row; /* Horizontal layout */
    gap: 15px;
    width: 100%;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap; /* Wrap on small screens */
}

.settingsBtn {
    flex: 1;
    min-width: 120px;
    max-width: 180px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #0f3460 0%, #16213e 100%);
    border: 2px solid #00ffff;
    border-radius: 25px;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(14px, 3.5vw, 16px);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.settingsBtn:active {
    transform: scale(0.95);
    background: linear-gradient(135deg, #1a5f9e 0%, #16213e 100%);
}

.soundBtn.sound-off {
    border-color: #ff4444;
    opacity: 0.7;
}

#soundIcon {
    font-size: 20px;
}

.settingsOptions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.settingItem {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    color: white;
    font-family: 'Orbitron', sans-serif;
    font-size: 14px;
}

.settingItem label {
    flex: 1;
}

.settingItem input[type="range"] {
    flex: 2;
    max-width: 150px;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.settingItem input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #00ffff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}


#gameOverScreen{

    position: fixed;

    left:0;
    top:0;

    width:100vw;
    height:100vh;

    background: black;

    display:none;

    justify-content:center;
    align-items:center;
    flex-direction:column;

    z-index:5000;

    animation: fadeIn 0.5s;

}

#gameOverScreen h1{

    color:white;

    font-size:50px;

    text-shadow:
        0 0 10px red,
        0 0 20px orange,
        0 0 40px red;

    animation: pop 0.4s;

}

#gameOverScreen button{

    margin:10px;
    padding:10px 20px;

    font-size:20px;

}

@keyframes fadeIn{

    from{opacity:0}
    to{opacity:1}

}

@keyframes pop{

    from{
        transform:scale(0.5);
    }

    to{
        transform:scale(1);
    }

}
