/* ============================================
   الصعل العماني - The Omani Saal
   Cyberpunk Desert Theme - Professional PBR
   ============================================ */

:root {
    --bg-dark: #1f1710;
    --bg-panel: #3a2a1a;
    --bg-panel-light: #5a4530;
    --bg-overlay: rgba(31, 23, 16, 0.92);
    --omani-red: #c41e3a;
    --omani-green: #006400;
    --omani-white: #f5f5f0;
    --neon-gold: #C9AA80;
    --neon-gold-dim: #8C6A3F;
    --neon-blue: #8C6A3F;
    --neon-purple: #8C6A3F;
    --neon-pink: #B35A2A;
    --desert-sand: #bda385;
    --desert-terracotta: #b35a2a;
    --desert-burgundy: #722f37;
    --desert-ochre: #9b7953;
    --text-primary: #f0e6d3;
    --text-secondary: #b8a88a;
    --text-muted: #6b5b4f;
    --text-gold: #C9AA80;
    --gradient-gold: linear-gradient(135deg, #C9AA80, #8C6A3F, #C9AA80);
    --gradient-omani: linear-gradient(90deg, #c41e3a 33%, #f5f5f0 33%, #f5f5f0 66%, #006400 66%);
    --gradient-cyberpunk: linear-gradient(180deg, rgba(201,170,128,0.1) 0%, rgba(0,0,0,0) 100%);
    --shadow-gold: 0 0 20px rgba(201, 170, 128, 0.3), 0 0 40px rgba(201, 170, 128, 0.1);
    --shadow-neon: 0 0 15px rgba(140, 106, 63, 0.4);
    --font-arabic: 'Almarai', 'Amiri', sans-serif;
    --font-display: 'Aref Ruqaa', 'Almarai', serif;
    --transition-fast: 0.2s ease;
    --transition-medium: 0.4s ease;
    --transition-slow: 0.8s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font-arabic);
    background: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
    direction: rtl;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    touch-action: none;
}

.hidden { display: none !important; }
.visible { display: flex !important; }

/* ============================================
   LOADING SCREEN
   ============================================ */
#loading-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-dark); display: flex;
    align-items: center; justify-content: center; z-index: 10000;
    flex-direction: column;
}
.loading-content { text-align: center; animation: fadeIn 1s ease-out; }

.loading-omani-flag {
    width: 120px; height: 80px; margin: 0 auto 2rem;
    border-radius: 8px; overflow: hidden; display: flex;
    direction: ltr;
    box-shadow: var(--shadow-gold);
    animation: flagWave 2s ease-in-out infinite;
}
.flag-hoist {
    width: 30%; height: 100%; background: var(--omani-red);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 6px;
}
.flag-bands { flex: 1; display: flex; flex-direction: column; }
.flag-stripe { height: 33.33%; width: 100%; }
.flag-stripe.red { background: var(--omani-red); }
.flag-stripe.white { background: var(--omani-white); }
.flag-emblem { font-size: 1.1rem; animation: emblemPulse 1.5s ease-in-out infinite; }
.flag-stripe.green { background: var(--omani-green); }

@keyframes flagWave {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(10deg); }
}
@keyframes emblemPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

.loading-title {
    font-family: var(--font-display); font-size: 3rem; font-weight: 900;
    color: var(--neon-gold); text-shadow: var(--shadow-gold);
    margin-bottom: 0.5rem;
    animation: titleGlow 2s ease-in-out infinite alternate;
}
@keyframes titleGlow {
    from { text-shadow: 0 0 20px rgba(201, 170, 128, 0.3); }
    to { text-shadow: 0 0 40px rgba(201, 170, 128, 0.6), 0 0 80px rgba(201, 170, 128, 0.2); }
}

.loading-subtitle {
    font-size: 1.2rem; color: var(--text-secondary);
    letter-spacing: 0.3rem; margin-bottom: 2rem; font-weight: 300;
}

.loading-bar-container { width: 300px; margin: 0 auto; }
.loading-bar {
    width: 100%; height: 8px; background: var(--bg-panel-light);
    border-radius: 4px; overflow: hidden; margin-bottom: 1rem;
    border: 1px solid rgba(201, 170, 128, 0.2);
}
.loading-bar-fill {
    height: 100%; width: 0%; background: var(--gradient-gold);
    border-radius: 4px; transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(201, 170, 128, 0.5);
}
.loading-text {
    font-size: 0.9rem; color: var(--text-secondary);
    animation: textPulse 1.5s ease-in-out infinite;
}
@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* ============================================
   MAIN MENU
   ============================================ */
#main-menu {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 1000; display: flex; align-items: center; justify-content: center;
}
.menu-background {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: 
        radial-gradient(ellipse at 50% 0%, rgba(201, 170, 128, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(0, 100, 0, 0.05) 0%, transparent 40%),
        var(--bg-dark);
    overflow: hidden;
}
.cyberpunk-grid {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        linear-gradient(rgba(201, 170, 128, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(201, 170, 128, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}
@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) translateY(50px); }
}
.particles-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
}
.menu-content {
    position: relative; z-index: 10; text-align: center;
    padding: 2rem; max-width: 500px; width: 100%;
}

/* Game Logo */
.game-logo { margin-bottom: 3rem; animation: fadeInUp 1s ease-out; }
.logo-omani-emblem {
    font-size: 4rem; margin-bottom: 1rem;
    animation: emblemFloat 3s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(201, 170, 128, 0.5));
}
@keyframes emblemFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.logo-title {
    font-family: var(--font-display); font-size: 3.5rem; font-weight: 900;
    color: var(--neon-gold); text-shadow: var(--shadow-gold);
    margin-bottom: 0.5rem; line-height: 1.2;
}
.logo-subtitle {
    font-size: 1.3rem; color: var(--text-secondary);
    letter-spacing: 0.2rem; font-weight: 300; margin-bottom: 1rem;
}
.logo-tagline {
    font-size: 1rem; color: var(--desert-terracotta); font-weight: 500;
    padding: 0.5rem 1.5rem; border: 1px solid rgba(179, 90, 42, 0.3);
    border-radius: 20px; display: inline-block;
    background: rgba(179, 90, 42, 0.05);
}

/* Menu Buttons */
.menu-buttons { display: flex; flex-direction: column; gap: 0.8rem; margin-bottom: 2rem; }
.menu-btn {
    position: relative; display: flex; align-items: center; justify-content: center;
    gap: 0.8rem; padding: 1rem 2rem; background: var(--bg-panel);
    border: 1px solid rgba(201, 170, 128, 0.2); border-radius: 12px;
    color: var(--text-primary); font-family: var(--font-arabic);
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition-medium); overflow: hidden;
    backdrop-filter: blur(10px);
}
.menu-btn:hover {
    background: var(--bg-panel-light); border-color: var(--neon-gold);
    transform: translateX(-5px); box-shadow: var(--shadow-gold);
}
.menu-btn.primary {
    background: var(--gradient-gold); color: var(--bg-dark);
    border: none; font-weight: 800; font-size: 1.2rem; padding: 1.2rem 2rem;
}
.menu-btn.primary:hover {
    transform: translateX(-5px) scale(1.02);
    box-shadow: 0 0 30px rgba(201, 170, 128, 0.4);
}
.btn-icon { font-size: 1.3rem; }
.btn-text { position: relative; z-index: 2; }

/* Menu Footer */
.menu-footer {
    margin-top: 2rem; padding-top: 1rem;
    border-top: 1px solid rgba(201, 170, 128, 0.1);
}
.menu-footer p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.menu-footer .version { font-size: 0.75rem; color: var(--text-muted); opacity: 0.7; }

/* ============================================
   GAME HUD
   ============================================ */
#game-hud {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none; z-index: 100;
}
#game-hud > * { pointer-events: auto; }

/* Top Bar */
.hud-top {
    position: absolute; top: 0; left: 0; right: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(180deg, rgba(10, 10, 15, 0.9) 0%, transparent 100%);
    pointer-events: none; flex-wrap: wrap; gap: 0.5rem;
}
.hud-top > * { pointer-events: auto; }

/* Health Hearts */
.hud-health {
    display: flex; align-items: center; gap: 0.3rem;
    background: rgba(74, 53, 32, 0.8); padding: 0.5rem 1rem;
    border-radius: 20px; border: 1px solid rgba(201, 170, 128, 0.2);
    backdrop-filter: blur(10px);
}
.health-hearts { display: flex; gap: 0.2rem; }
.health-hearts .heart { font-size: 1.2rem; filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.5)); }
.health-hearts .heart.empty { opacity: 0.3; filter: grayscale(1); }

/* Time Display */
.hud-time {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(74, 53, 32, 0.8); padding: 0.5rem 1rem;
    border-radius: 20px; border: 1px solid rgba(140, 106, 63, 0.2);
    backdrop-filter: blur(10px);
}
.time-icon { font-size: 1.2rem; }
.time-text { font-size: 1.1rem; color: var(--neon-blue); font-weight: 700; }
.time-period { font-size: 0.8rem; color: var(--text-secondary); }

/* Quest Info */
.hud-quest {
    display: flex; align-items: center; gap: 0.8rem;
    background: rgba(74, 53, 32, 0.8); padding: 0.5rem 1rem;
    border-radius: 12px; border: 1px solid rgba(140, 106, 63, 0.2);
    backdrop-filter: blur(10px); max-width: 300px;
}
.quest-icon { font-size: 1.5rem; }
.quest-title { font-size: 0.75rem; color: var(--neon-blue); font-weight: 700; margin-bottom: 0.2rem; }
.quest-desc { font-size: 0.85rem; color: var(--text-primary); font-weight: 500; }

/* Score */
.hud-score {
    display: flex; align-items: center; gap: 0.5rem;
    background: rgba(74, 53, 32, 0.8); padding: 0.5rem 1rem;
    border-radius: 20px; border: 1px solid rgba(201, 170, 128, 0.2);
    backdrop-filter: blur(10px);
}
.score-icon { font-size: 1.2rem; }
.score-text { font-size: 1.2rem; color: var(--neon-gold); font-weight: 800; }

/* Bottom Bar */
.hud-bottom {
    position: absolute; bottom: 0; left: 0; right: 0;
    display: flex; align-items: flex-end; justify-content: space-between;
    padding: 1rem 1.5rem;
    background: linear-gradient(0deg, rgba(10, 10, 15, 0.9) 0%, transparent 100%);
    pointer-events: none; flex-wrap: wrap; gap: 1rem;
}
.hud-bottom > * { pointer-events: auto; }

/* Inventory */
.hud-inventory {
    background: rgba(74, 53, 32, 0.8); padding: 0.8rem 1rem;
    border-radius: 12px; border: 1px solid rgba(201, 170, 128, 0.15);
    backdrop-filter: blur(10px);
}
.inventory-title { font-size: 0.7rem; color: var(--text-muted); margin-bottom: 0.5rem; text-align: center; }
.inventory-slots { display: flex; gap: 0.5rem; }
.inv-slot {
    width: 50px; height: 50px; background: var(--bg-panel-light);
    border: 2px solid rgba(201, 170, 128, 0.2); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; transition: all var(--transition-fast); cursor: pointer;
}
.inv-slot:hover { border-color: var(--neon-gold); box-shadow: var(--shadow-gold); transform: scale(1.1); }
.inv-slot[data-item="empty"] { opacity: 0.5; }
.inv-slot[data-item="empty"] .inv-icon { font-size: 1rem; opacity: 0.3; }

/* Controls Hint */
.hud-controls-hint {
    display: flex; gap: 1rem; background: rgba(74, 53, 32, 0.6);
    padding: 0.5rem 1rem; border-radius: 8px; backdrop-filter: blur(10px);
    flex-wrap: wrap;
}
.control-hint { display: flex; align-items: center; gap: 0.3rem; font-size: 0.75rem; color: var(--text-muted); }
.control-hint kbd {
    background: var(--bg-panel-light); border: 1px solid rgba(201, 170, 128, 0.2);
    border-radius: 4px; padding: 0.15rem 0.4rem; font-family: monospace;
    font-size: 0.7rem; color: var(--neon-gold);
}
.control-hint span { font-size: 0.7rem; }

/* Weather Indicator */
.weather-indicator {
    position: absolute; top: 80px; right: 20px;
    background: rgba(74, 53, 32, 0.8); padding: 0.5rem 1rem;
    border-radius: 20px; border: 1px solid rgba(201, 170, 128, 0.2);
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 0.9rem; color: var(--text-primary); pointer-events: auto;
}

/* Interaction Prompt */
.interaction-prompt {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    display: flex; align-items: center; gap: 0.8rem;
    background: rgba(74, 53, 32, 0.9); padding: 0.8rem 1.5rem;
    border-radius: 12px; border: 2px solid var(--neon-gold);
    box-shadow: var(--shadow-gold);
    animation: promptPulse 1.5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes promptPulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    50% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.9; }
}
.prompt-key {
    width: 36px; height: 36px; background: var(--gradient-gold);
    color: var(--bg-dark); border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem;
}
.prompt-text { font-size: 1rem; font-weight: 600; color: var(--text-primary); }

/* Dialog Box */
.dialog-box {
    position: absolute; bottom: 120px; left: 50%;
    transform: translateX(-50%); width: 90%; max-width: 700px;
    background: rgba(74, 53, 32, 0.95); border: 2px solid rgba(201, 170, 128, 0.3);
    border-radius: 16px; padding: 1.5rem; display: flex; gap: 1rem;
    backdrop-filter: blur(20px); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: dialogSlideUp 0.3s ease-out;
}
@keyframes dialogSlideUp {
    from { transform: translateX(-50%) translateY(20px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}
.dialog-character { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; min-width: 80px; }
.dialog-avatar {
    font-size: 3rem; width: 70px; height: 70px; background: var(--bg-panel-light);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    border: 2px solid rgba(201, 170, 128, 0.3);
}
.dialog-name { font-size: 0.8rem; color: var(--neon-gold); font-weight: 700; }
.dialog-text-container { flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.dialog-text { font-size: 1.1rem; line-height: 1.8; color: var(--text-primary); min-height: 60px; }
.dialog-continue { font-size: 0.8rem; color: var(--neon-gold); text-align: left; margin-top: 0.5rem; animation: blink 1s ease-in-out infinite; }
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Minimap */
.minimap-container {
    position: absolute; top: 80px; left: 20px;
    background: rgba(74, 53, 32, 0.8); border: 1px solid rgba(201, 170, 128, 0.2);
    border-radius: 12px; padding: 0.8rem; backdrop-filter: blur(10px); pointer-events: auto;
}
.minimap-title { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.5rem; text-align: center; }
#minimap { border-radius: 8px; background: rgba(0, 0, 0, 0.3); border: 1px solid rgba(201, 170, 128, 0.1); }
.minimap-legend { display: flex; gap: 0.8rem; margin-top: 0.5rem; font-size: 0.65rem; color: var(--text-muted); }
.legend-item { display: flex; align-items: center; gap: 0.2rem; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.legend-dot.player { background: var(--neon-gold); }
.legend-dot.quest { background: var(--neon-blue); }
.legend-dot.npc { background: var(--neon-pink); }
.legend-dot.enemy { background: #ff0000; }

/* Pause Menu */
.pause-menu {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 200; display: flex; align-items: center; justify-content: center;
}
.pause-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px);
}
.pause-content {
    position: relative; z-index: 10; background: var(--bg-panel);
    border: 2px solid rgba(201, 170, 128, 0.3); border-radius: 20px;
    padding: 2.5rem; text-align: center; min-width: 350px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.pause-title { font-size: 2rem; color: var(--neon-gold); margin-bottom: 2rem; font-weight: 800; }
.pause-buttons { display: flex; flex-direction: column; gap: 0.8rem; }
.pause-btn {
    padding: 1rem 2rem; background: var(--bg-panel-light);
    border: 1px solid rgba(201, 170, 128, 0.2); border-radius: 10px;
    color: var(--text-primary); font-family: var(--font-arabic);
    font-size: 1.1rem; font-weight: 600; cursor: pointer;
    transition: all var(--transition-medium);
}
.pause-btn:hover { background: rgba(201, 170, 128, 0.1); border-color: var(--neon-gold); transform: translateX(-3px); }

/* ============================================
   SCREEN OVERLAYS
   ============================================ */
.screen-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 500; display: flex; align-items: center; justify-content: center;
    background: var(--bg-overlay); backdrop-filter: blur(10px);
    overflow-y: auto; padding: 2rem;
}
.screen-overlay > div {
    max-width: 700px; width: 100%; background: var(--bg-panel);
    border: 2px solid rgba(201, 170, 128, 0.2); border-radius: 20px;
    padding: 2.5rem; max-height: 85vh; overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.back-btn {
    display: block; margin: 2rem auto 0; padding: 0.8rem 2rem;
    background: transparent; border: 2px solid var(--neon-gold); border-radius: 10px;
    color: var(--neon-gold); font-family: var(--font-arabic);
    font-size: 1rem; font-weight: 700; cursor: pointer;
    transition: all var(--transition-medium);
}
.back-btn:hover { background: var(--neon-gold); color: var(--bg-dark); }

/* Story Screen */
.story-title { font-size: 2rem; color: var(--neon-gold); text-align: center; margin-bottom: 2rem; font-weight: 800; }
.story-scroll { max-height: 60vh; overflow-y: auto; padding-right: 1rem; }
.story-chapter { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(201, 170, 128, 0.1); }
.story-chapter:last-child { border-bottom: none; }
.story-chapter h3 { font-size: 1.3rem; color: var(--neon-blue); margin-bottom: 1rem; font-weight: 700; }
.story-chapter p { font-size: 1rem; line-height: 1.8; color: var(--text-secondary); margin-bottom: 0.8rem; }

/* Controls Screen */
.controls-title { font-size: 2rem; color: var(--neon-gold); text-align: center; margin-bottom: 2rem; font-weight: 800; }
.controls-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.control-item { display: flex; align-items: center; gap: 1rem; background: var(--bg-panel-light); padding: 1rem; border-radius: 10px; border: 1px solid rgba(201, 170, 128, 0.1); }
.control-item kbd {
    background: var(--bg-dark); border: 1px solid rgba(201, 170, 128, 0.3);
    border-radius: 6px; padding: 0.3rem 0.6rem; font-family: monospace;
    font-size: 0.9rem; color: var(--neon-gold); min-width: 40px; text-align: center;
}
.control-keys { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.wasd-row { display: flex; gap: 0.2rem; }
.control-desc { font-size: 0.9rem; color: var(--text-secondary); flex: 1; }
.mouse-icon { font-size: 1.5rem; }
.controls-tips { background: rgba(140, 106, 63, 0.05); border: 1px solid rgba(140, 106, 63, 0.2); border-radius: 12px; padding: 1.5rem; margin-bottom: 1.5rem; }
.controls-tips h3 { font-size: 1.1rem; color: var(--neon-blue); margin-bottom: 1rem; }
.controls-tips ul { list-style: none; padding: 0; }
.controls-tips li { font-size: 0.9rem; color: var(--text-secondary); padding: 0.5rem 0; padding-right: 1.5rem; position: relative; }
.controls-tips li::before { content: "✦"; position: absolute; right: 0; color: var(--neon-gold); }

/* Achievements Screen */
.achievements-title { font-size: 2rem; color: var(--neon-gold); text-align: center; margin-bottom: 2rem; font-weight: 800; }
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.achievement-card {
    background: var(--bg-panel-light); border: 2px solid rgba(201, 170, 128, 0.1);
    border-radius: 12px; padding: 1.5rem; text-align: center;
    transition: all var(--transition-medium);
}
.achievement-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-gold); }
.achievement-card.locked { opacity: 0.5; filter: grayscale(1); }
.achievement-card.unlocked { opacity: 1; filter: grayscale(0); border-color: var(--neon-gold); }
.achievement-icon { font-size: 3rem; margin-bottom: 0.5rem; }
.achievement-card h3 { font-size: 1.1rem; color: var(--neon-gold); margin-bottom: 0.5rem; }
.achievement-card p { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 0.5rem; }
.achievement-status { font-size: 0.8rem; color: var(--text-muted); font-weight: 700; }

/* Settings Screen */
.settings-title { font-size: 2rem; color: var(--neon-gold); text-align: center; margin-bottom: 2rem; font-weight: 800; }
.settings-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(201, 170, 128, 0.1); }
.settings-section:last-of-type { border-bottom: none; }
.settings-section h3 { font-size: 1.1rem; color: var(--neon-blue); margin-bottom: 1rem; font-weight: 700; }
.setting-item { display: flex; align-items: center; justify-content: space-between; padding: 0.8rem 0; gap: 1rem; }
.setting-item label { font-size: 0.95rem; color: var(--text-primary); font-weight: 500; }
.setting-item input[type="range"] { width: 150px; accent-color: var(--neon-gold); }
.setting-item select { background: var(--bg-panel-light); border: 1px solid rgba(201, 170, 128, 0.2); border-radius: 6px; padding: 0.4rem 0.8rem; color: var(--text-primary); font-family: var(--font-arabic); font-size: 0.9rem; cursor: pointer; }
.setting-item input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--neon-gold); cursor: pointer; }
.setting-value { font-size: 0.85rem; color: var(--neon-gold); font-weight: 700; min-width: 40px; text-align: left; }

/* Credits Screen */
.credits-title { font-size: 2rem; color: var(--neon-gold); text-align: center; margin-bottom: 2rem; font-weight: 800; }
.credits-scroll { max-height: 50vh; overflow-y: auto; padding-right: 1rem; }
.credits-section { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid rgba(201, 170, 128, 0.1); text-align: center; }
.credits-section:last-child { border-bottom: none; }
.credits-section h3 { font-size: 1.2rem; color: var(--neon-blue); margin-bottom: 1rem; font-weight: 700; }
.credits-section p { font-size: 0.95rem; color: var(--text-secondary); line-height: 1.6; margin-bottom: 0.5rem; }
.credits-section strong { color: var(--neon-gold); }
.credits-footer { text-align: center; margin: 2rem 0; padding: 1.5rem; background: rgba(201, 170, 128, 0.05); border-radius: 12px; border: 1px solid rgba(201, 170, 128, 0.1); }
.credits-footer p { font-size: 1rem; color: var(--text-primary); margin-bottom: 0.5rem; }

/* ============================================
   GAME CANVAS
   ============================================ */
#game-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
#game-canvas { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; display: block; }

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInDown { from { opacity: 0; transform: translateY(-30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }

/* ============================================
   RESPONSIVE - MOBILE OPTIMIZED
   ============================================ */
@media (max-width: 768px) {
    .logo-title { font-size: 2.5rem; }
    .menu-content { padding: 1rem; }
    .hud-top { flex-wrap: wrap; gap: 0.5rem; }
    .hud-bottom { flex-direction: column; align-items: center; gap: 1rem; }
    .hud-controls-hint { display: none; }
    .controls-grid { grid-template-columns: 1fr; }
    .minimap-container { display: none; }
    .dialog-box { width: 95%; padding: 1rem; }
    .dialog-avatar { width: 50px; height: 50px; font-size: 2rem; }
    .dialog-text { font-size: 0.95rem; }
    .achievements-grid { grid-template-columns: 1fr; }
    .weather-indicator { display: none; }
}

@media (max-width: 480px) {
    .logo-title { font-size: 2rem; }
    .loading-title { font-size: 2rem; }
    .menu-btn { padding: 0.8rem 1.5rem; font-size: 1rem; }
    .hud-quest { display: none; }
    .hud-time { display: none; }
    .screen-overlay > div { padding: 1.5rem; }
    .achievement-card { padding: 1rem; }
}

/* Touch controls for mobile */
.touch-controls {
    display: none;
    position: fixed; bottom: 20px; left: 20px; z-index: 200;
}
@media (max-width: 768px) {
    .touch-controls { display: block; }
}
.touch-dpad {
    width: 120px; height: 120px; position: relative;
}
.touch-btn {
    position: absolute; width: 40px; height: 40px;
    background: rgba(201, 170, 128, 0.2); border: 2px solid rgba(201, 170, 128, 0.4);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: var(--neon-gold); backdrop-filter: blur(5px);
}
.touch-btn.up { top: 0; left: 40px; }
.touch-btn.down { bottom: 0; left: 40px; }
.touch-btn.left { top: 40px; left: 0; }
.touch-btn.right { top: 40px; right: 0; }
.touch-action-btns {
    position: fixed; bottom: 20px; right: 20px; z-index: 200;
    display: flex; flex-direction: column; gap: 10px;
}
.touch-action-btn {
    width: 60px; height: 60px; border-radius: 50%;
    background: rgba(201, 170, 128, 0.2); border: 2px solid rgba(201, 170, 128, 0.4);
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; color: var(--neon-gold); backdrop-filter: blur(5px);
}

/* ============================================
   SCROLLBAR & SELECTION
   ============================================ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-dark); border-radius: 4px; }
::-webkit-scrollbar-thumb { background: rgba(201, 170, 128, 0.3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(201, 170, 128, 0.5); }
::selection { background: rgba(201, 170, 128, 0.3); color: var(--text-primary); }
