/* ============================================
   Jungle Blaster - Jungle Edition
   Deep Jungle Theme — Lush, Wild, Alive
   ============================================ */

:root {
    /* === JUNGLE CORE PALETTE === */
    --jungle-deep:     #0b1a0e;   /* deep forest floor */
    --jungle-dark:     #122b16;   /* dark canopy shadow */
    --jungle-mid:      #1a3d1e;   /* mid forest */
    --jungle-green:    #2d6a35;   /* vivid jungle green */
    --jungle-light:    #3d8c47;   /* bright leaf green */
    --jungle-bright:   #52b05e;   /* sunlit leaf */
    --jungle-glow:     #7ed68a;   /* bioluminescent glow */

    /* === BARK & EARTH TONES === */
    --bark-dark:       #1e1208;
    --bark-mid:        #3b2210;
    --bark-light:      #5c3a1e;
    --bark-tan:        #7a5230;
    --earth-red:       #4a1e0e;
    --earth-orange:    #6b3010;

    /* === ACCENT COLORS === */
    --gold:            #f0b840;   /* warm tropical sun */
    --gold-light:      #f8d060;
    --gold-dark:       #c89020;
    --vine:            #4e7c3a;
    --flower-red:      #c0392b;
    --flower-yellow:   #f39c12;
    --flower-purple:   #8e44ad;
    --water-blue:      #1a6b7a;
    --water-light:     #2a9aaf;

    /* === STONE/LEGACY (kept for fallback) === */
    --stone-dark:      #1a2e1a;
    --stone-medium:    #2d5a35;
    --stone-light:     #3d7a47;
    --moss-green:      #2d6a35;
    --moss-light:      #3d8c47;

    /* === UI COLORS === */
    --text-primary:    #e8f5e2;
    --text-secondary:  rgba(232, 245, 226, 0.8);
    --text-muted:      rgba(232, 245, 226, 0.45);
    --border-vine:     rgba(78, 124, 58, 0.5);
    --border-leaf:     rgba(82, 176, 94, 0.4);
    --border-carved:   rgba(82, 176, 94, 0.4);
    --border-stone:    rgba(240, 184, 64, 0.25);
    --warm-highlight:  #e8f5e2;

    /* === SPACING === */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 12px;
    --space-lg: 16px;
    --space-xl: 24px;
    --space-2xl: 32px;

    /* === BORDER RADIUS === */
    --radius-sm:   3px;
    --radius-md:   6px;
    --radius-lg:   10px;
    --radius-stone: 6px;
    --radius-full: 50%;

    /* === FONTS === */
    --font-display: 'Orbitron', serif;
    --font-body:    'Rajdhani', sans-serif;

    /* === TRANSITIONS === */
    --transition-fast:   0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow:   0.5s ease;

    /* === Z-INDEX LAYERS === */
    --z-canvas:   1;
    --z-effects:  5;
    --z-hud:      10;
    --z-buttons:  15;
    --z-floating: 50;
    --z-popups:   60;
    --z-screens:  100;
    --z-ads:      200;

    /* === KEYBOARD THEME TOKENS (default: jungle) === */












}

/* ============================================
   KEYBOARD THEME OVERRIDES
   ============================================ */

/* FIRE theme */

/* OCEAN theme */

/* NIGHT theme */

/* NEON theme */

/* GOLDEN theme */

/* ============================================
   RESET
   ============================================ */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* ============================================
   BODY — Deep Jungle Background
   ============================================ */

body {
    font-family: var(--font-body);
    background:
        /* Canopy light rays */
        radial-gradient(ellipse 60% 40% at 20% 0%, rgba(82,176,94,0.12) 0%, transparent 60%),
        radial-gradient(ellipse 50% 35% at 80% 0%, rgba(120,210,80,0.09) 0%, transparent 55%),
        radial-gradient(ellipse 40% 30% at 50% 0%, rgba(240,184,64,0.07) 0%, transparent 50%),
        /* Ground fog */
        radial-gradient(ellipse 100% 30% at 50% 100%, rgba(11,26,14,0.9) 0%, transparent 100%),
        /* Main gradient — deep jungle */
        linear-gradient(to bottom,
            #0b2e10 0%,
            #0f2614 20%,
            #0d1e0f 45%,
            #0a1a0c 70%,
            #060e07 100%
        );
    color: var(--text-primary);
    overflow: hidden;
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    position: relative;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation;
}

/* ============================================
   JUNGLE AMBIENT LAYER — animated foliage particles
   ============================================ */

.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Floating leaf / firefly particles */
.star {
    position: absolute;
    border-radius: var(--radius-full);
    animation: leafFloat var(--duration, 10s) ease-in-out infinite var(--delay, 0s);
}

/* Even-index: small round leaves (green tones) */
.star:nth-child(even) {
    background: rgba(82, 176, 94, 0.25);
    clip-path: ellipse(60% 100% at 50% 50%);
    width: 6px !important;
    height: 10px !important;
}

/* Odd-index: firefly glow dots */
.star:nth-child(odd) {
    background: radial-gradient(circle, rgba(120, 230, 80, 0.5) 0%, transparent 70%);
    width: 5px !important;
    height: 5px !important;
    box-shadow: 0 0 6px 2px rgba(100, 220, 60, 0.3);
}

@keyframes leafFloat {
    0% {
        transform: translateY(0) translateX(0) rotate(0deg);
        opacity: 0;
    }
    15% { opacity: 0.7; }
    50% {
        transform: translateY(-40px) translateX(18px) rotate(20deg);
        opacity: 0.5;
    }
    85% { opacity: 0.3; }
    100% {
        transform: translateY(-80px) translateX(-10px) rotate(-15deg);
        opacity: 0;
    }
}

/* ============================================
   JUNGLE TREE SILHOUETTES — CSS decorative elements
   Left and right side of the screen
   ============================================ */

body::before,
body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 140px;
    z-index: 0;
    pointer-events: none;
}

/* Left tree wall */
body::before {
    left: 0;
    background:
        /* Vines hanging down */
        repeating-linear-gradient(
            175deg,
            transparent 0px,
            transparent 18px,
            rgba(30, 80, 30, 0.15) 18px,
            rgba(30, 80, 30, 0.15) 20px
        ),
        /* Tree trunk silhouette */
        linear-gradient(to right,
            rgba(8, 18, 8, 0.95) 0%,
            rgba(12, 30, 12, 0.85) 40%,
            rgba(18, 40, 18, 0.5) 70%,
            transparent 100%
        );
    mask-image: linear-gradient(to right, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black 50%, transparent 100%);
}

/* Right tree wall */
body::after {
    right: 0;
    background:
        repeating-linear-gradient(
            -175deg,
            transparent 0px,
            transparent 18px,
            rgba(30, 80, 30, 0.15) 18px,
            rgba(30, 80, 30, 0.15) 20px
        ),
        linear-gradient(to left,
            rgba(8, 18, 8, 0.95) 0%,
            rgba(12, 30, 12, 0.85) 40%,
            rgba(18, 40, 18, 0.5) 70%,
            transparent 100%
        );
    mask-image: linear-gradient(to left, black 50%, transparent 100%);
    -webkit-mask-image: linear-gradient(to left, black 50%, transparent 100%);
}

/* ============================================
   JUNGLE CANOPY TOP EDGE
   ============================================ */

#gameContainer::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px;
    background:
        /* Dappled light from canopy */
        radial-gradient(ellipse 30% 60% at 15% 0%, rgba(60,150,40,0.2) 0%, transparent 70%),
        radial-gradient(ellipse 25% 50% at 40% 0%, rgba(80,170,50,0.15) 0%, transparent 65%),
        radial-gradient(ellipse 35% 55% at 65% 0%, rgba(50,140,35,0.18) 0%, transparent 70%),
        radial-gradient(ellipse 28% 45% at 88% 0%, rgba(70,160,45,0.16) 0%, transparent 65%),
        /* Canopy shadow band */
        linear-gradient(to bottom, rgba(5,15,5,0.7) 0%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}

/* Ground foliage strip */
#gameContainer::after {
    content: '';
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to top, rgba(5,12,5,0.8) 0%, transparent 100%);
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   GAME CONTAINER
   ============================================ */

#gameContainer {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: var(--z-canvas);
    display: block;
}

#hiddenInput {
    position: absolute;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    width: 0;
    height: 0;
    border: none;
    outline: none;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.stone-texture {
    background:
        linear-gradient(135deg, rgba(0,0,0,0.15) 0%, transparent 50%, rgba(255,255,255,0.04) 100%),
        linear-gradient(to bottom, var(--jungle-mid), var(--jungle-dark));
}

.carved-bevel {
    box-shadow:
        inset 2px 2px 4px rgba(0,0,0,0.55),
        inset -2px -2px 4px rgba(82,176,94,0.08),
        0 2px 8px rgba(0,0,0,0.4);
}

.gold-glow {
    text-shadow: 0 0 8px rgba(240, 184, 64, 0.7), 0 0 18px rgba(240, 184, 64, 0.35);
}

/* ============================================
   SCROLLBAR — vine-styled
   ============================================ */

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track {
    background: var(--jungle-dark);
    border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb {
    background: var(--jungle-green);
    border-radius: var(--radius-sm);
    border: 1px solid var(--jungle-mid);
}
::-webkit-scrollbar-thumb:hover { background: var(--jungle-light); }

* {
    scrollbar-width: thin;
    scrollbar-color: var(--jungle-green) var(--jungle-dark);
}

::selection {
    background: rgba(82, 176, 94, 0.3);
    color: var(--text-primary);
}

/* ============================================
   LOADING SCREEN — Jungle Entry
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(45,106,53,0.25) 0%, transparent 60%),
        linear-gradient(to bottom, #061a08 0%, #0d1e0f 50%, #060e07 100%);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loading-screen.loaded {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    padding: var(--space-xl);
    max-width: 400px;
    width: 90%;
}

.loading-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 8vw, 52px);
    font-weight: 900;
    color: var(--jungle-bright);
    margin-bottom: var(--space-xs);
    text-shadow:
        2px 2px 4px rgba(0,0,0,0.9),
        0 0 24px rgba(82, 176, 94, 0.6),
        0 0 48px rgba(82, 176, 94, 0.25);
    letter-spacing: 2px;
}

.loading-subtitle {
    font-family: var(--font-display);
    font-size: clamp(10px, 3vw, 13px);
    color: var(--text-muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-bottom: var(--space-2xl);
}

.loading-bar-container {
    width: 100%;
    height: 8px;
    background: var(--jungle-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    border: 1px solid var(--border-vine);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--jungle-green), var(--jungle-light), var(--jungle-bright));
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
    box-shadow: 0 0 12px rgba(82, 176, 94, 0.7);
}

.loading-bar::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 30px; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
    animation: loadingShine 1.5s ease infinite;
}

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

.loading-status {
    font-family: var(--font-display);
    font-size: 11px;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: var(--space-xl);
}

.loading-tip {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}
