/* ============================================
   CSS Syntax Blaster - Temple Run Edition
   Ancient Temple Theme with Jungle Environment
   ============================================ */

:root {
    /* Temple/Jungle Color Palette */
    --stone-dark: #2a2419;
    --stone-medium: #4a3f2f;
    --stone-light: #6b5d47;
    --moss-green: #3d5a3d;
    --moss-light: #5a7a4d;
    --gold: #d4a855;
    --gold-light: #e8c077;
    --gold-dark: #b8903d;
    --vine-green: #4a6b3a;
    --earth-brown: #3f2f1f;
    --warm-highlight: #f4e8d0;
    
    /* UI Colors */
    --text-primary: #f4e8d0;
    --text-secondary: rgba(244, 232, 208, 0.8);
    --text-muted: rgba(244, 232, 208, 0.5);
    --border-stone: rgba(212, 168, 85, 0.3);
    --border-carved: rgba(212, 168, 85, 0.5);
    
    /* 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: 8px;
    --radius-stone: 4px;
    --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;
}

*,
*::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 {
    font-family: var(--font-body);
    /* Jungle/temple gradient background */
    background: linear-gradient(to bottom, #1a2e1a 0%, #2a2419 50%, #1f1710 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;
}

/* Ambient jungle/temple background effect */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    /* Subtle vignette for depth */
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.4) 100%);
}

/* Replace stars with subtle floating particles (dust, leaves) */
.star {
    position: absolute;
    background: rgba(212, 168, 85, 0.15);
    border-radius: var(--radius-full);
    animation: float var(--duration, 8s) ease-in-out infinite;
    opacity: 0.3;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0px) translateX(0px);
        opacity: 0.2;
    }
    50% { 
        transform: translateY(-20px) translateX(10px);
        opacity: 0.4;
    }
}

#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;
}

/* Stone texture utility class */
.stone-texture {
    background: 
        linear-gradient(135deg, rgba(0,0,0,0.1) 0%, transparent 50%, rgba(255,255,255,0.05) 100%),
        linear-gradient(to bottom, var(--stone-medium), var(--stone-dark));
}

/* Carved stone bevel effect */
.carved-bevel {
    box-shadow: 
        inset 2px 2px 4px rgba(0,0,0,0.5),
        inset -2px -2px 4px rgba(255,255,255,0.1),
        0 2px 8px rgba(0,0,0,0.3);
}

/* Gold glow effect */
.gold-glow {
    text-shadow: 0 0 8px rgba(212, 168, 85, 0.6), 0 0 16px rgba(212, 168, 85, 0.3);
}

/* Scrollbar - stone themed */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--stone-dark);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: var(--radius-sm);
    border: 1px solid var(--stone-medium);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}

* {
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dark) var(--stone-dark);
}

::selection {
    background: rgba(212, 168, 85, 0.3);
    color: var(--text-primary);
}

/* ============================================
   LOADING SCREEN - Temple Style
   ============================================ */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #1a2e1a 0%, #2a2419 50%, #1f1710 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(--gold);
    margin-bottom: var(--space-xs);
    text-shadow: 
        2px 2px 4px rgba(0,0,0,0.8),
        0 0 20px rgba(212, 168, 85, 0.4);
    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(--stone-dark);
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: var(--space-lg);
    position: relative;
    border: 1px solid var(--border-stone);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.loading-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold), var(--gold-light));
    border-radius: var(--radius-sm);
    transition: width 0.3s ease;
    position: relative;
    box-shadow: 0 0 10px rgba(212, 168, 85, 0.6);
}

.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;
}