/* ==================== IMPORTS & VARIABLES ==================== */
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=Inter:wght@300;400;500;600;700;800;900&family=Space+Grotesk:wght@400;500;600;700&display=swap');

:root {
    /* Game / Retro Theme */
    --retro-bg: #0a0a0f;
    --retro-primary: #00ff88;
    --retro-secondary: #00bfff;
    --retro-accent: #ffff00;
    --retro-warning: #ff6600;
    --retro-purple: #8a2be2;
    
    /* Modern / Beige Theme */
    --beige-bg: #EAE0D5;
    --beige-text: #222222;
    --beige-rust: #D35400; /* Rust/Orange */
    --beige-accent: #A04000;
    --beige-card: #F2EBE5;
    --beige-border: rgba(0,0,0,0.05);
    
    /* Legacy Modern Vars (mapped for compatibility if needed) */
    --modern-bg: var(--beige-bg);
    --modern-text: var(--beige-text);
    --modern-primary: var(--beige-rust);
    
    --font-pixel: 'Press Start 2P', monospace;
    --font-modern: 'Inter', sans-serif;
    --glass: rgba(0,0,0,0.6);
    --glass-border: rgba(255,255,255,0.1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: var(--font-pixel); background: var(--retro-bg); color: var(--retro-primary); overflow-x: hidden; }
body.modern-mode { font-family: var(--font-modern); background: var(--beige-bg); color: var(--beige-text); }

/* ==================== GLASSMORPHISM ==================== */
.glass-panel {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
}

/* ==================== PRESS START ==================== */
.press-start-overlay {
    position: fixed; inset: 0; z-index: 10000;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #0f0f1a 100%);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.8s ease;
}
.press-start-overlay.hidden { opacity: 0; pointer-events: none; transform: scale(1.1); }
.start-scanlines { position: absolute; inset: 0; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,136,0.03) 2px, rgba(0,255,136,0.03) 4px); pointer-events: none; }
.start-content { text-align: center; position: relative; z-index: 1; }
.start-hints { display: flex; gap: 20px; justify-content: center; margin-bottom: 40px; }
.hint-item { display: flex; align-items: center; gap: 8px; font-size: 10px; color: var(--retro-secondary); padding: 10px 16px; border: 2px solid rgba(0,191,255,0.3); border-radius: 8px; background: rgba(0,191,255,0.1); }
.hint-icon { font-size: 16px; }
.title-container { margin-bottom: 40px; }
.title-decoration { font-size: 12px; color: var(--retro-accent); margin: 10px 0; letter-spacing: 10px; }
.start-title { font-size: 42px; color: var(--retro-accent); text-shadow: 4px 4px 0 var(--retro-warning), 0 0 40px rgba(255,255,0,0.3); animation: titlePulse 3s infinite alternate; }
.title-tagline { font-size: 11px; color: var(--retro-primary); margin-top: 15px; letter-spacing: 3px; }
.start-stats { display: flex; gap: 40px; justify-content: center; margin-bottom: 40px; }
.start-stat { text-align: center; }
.start-stat .stat-num { display: block; font-size: 24px; color: var(--retro-accent); }
.start-stat .stat-desc { font-size: 8px; color: var(--retro-muted); }
.press-start-btn { background: linear-gradient(145deg, var(--retro-primary), #00cc66); border: 4px solid #fff; padding: 20px 50px; font-family: var(--font-pixel); font-size: 14px; color: #000; cursor: pointer; box-shadow: 0 6px 0 #006633, 0 0 40px rgba(0,255,136,0.4); display: flex; align-items: center; gap: 15px; margin: 0 auto 20px; transition: all 0.2s; }
.press-start-btn:hover { transform: translateY(-4px); box-shadow: 0 10px 0 #006633, 0 0 60px rgba(0,255,136,0.6); }
.btn-icon { animation: blink 1s infinite; }
.start-instruction { font-size: 10px; color: #555; }

@keyframes titlePulse { from { transform: scale(1); } to { transform: scale(1.02); text-shadow: 4px 4px 0 var(--retro-accent), 0 0 60px rgba(255,255,0,0.5); } }
@keyframes blink { 0%,50% { opacity: 1; } 51%,100% { opacity: 0; } }

/* ==================== CRT & PARTICLES ==================== */
.crt-overlay { position: fixed; inset: 0; pointer-events: none; z-index: 1000; background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.1) 2px, rgba(0,0,0,0.1) 4px); transition: opacity 0.5s; }
.crt-overlay.hidden { opacity: 0; }
.particle-system, .star-field { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.particle { position: absolute; width: 3px; height: 3px; background: var(--retro-primary); border-radius: 50%; animation: floatUp 8s infinite linear; }
@keyframes floatUp { 0% { transform: translateY(100vh); opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }

/* ==================== GAME CONTAINER ==================== */
.game-container { min-height: 100vh; background: radial-gradient(ellipse at 50% 0%, rgba(0,100,200,0.1), transparent 50%), var(--retro-bg); padding: 20px; position: relative; }
.game-container.hidden { display: none; }

/* Day/Night */
.day-night-cycle { position: fixed; top: 20px; right: 20px; z-index: 1000; width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(145deg, #ffcc00, #ff9900); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 30px rgba(255,200,0,0.5); transition: all 0.5s; }
.cycle-icon { font-size: 24px; }

/* ==================== HUD ==================== */
.hud { position: fixed; top: 80px; left: 20px; z-index: 999; width: 260px; padding: 20px; }
.hud-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 1px solid var(--glass-border); padding-bottom: 10px; }
.hud-title { font-size: 10px; color: var(--retro-muted); }
.hud-level { font-size: 14px; color: var(--retro-accent); }
.hud-class { font-size: 12px; color: var(--retro-primary); margin-bottom: 15px; }
.hud-stats { display: flex; flex-direction: column; gap: 12px; margin-bottom: 15px; }
.hud-stat-row { display: flex; align-items: center; gap: 10px; font-size: 10px; }
.cloud-1 { width: 100px; height: 40px; top: 10px; left: -100px; animation-duration: 25s; }
.cloud-2 { width: 80px; height: 30px; top: 40px; left: -80px; animation-delay: 10s; animation-duration: 35s; }
.cloud-3 { width: 120px; height: 50px; top: 20px; left: -120px; animation-delay: 20s; animation-duration: 40s; }
@keyframes cloudFloat { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 200px)); } }

/* Ground */
.ground-layer { position: absolute; bottom: 0; left: 0; right: 0; height: 100px; }
.grass-row { height: 15px; background: repeating-linear-gradient(90deg, #2d5a2d 0px, #3d7a3d 10px, #2d5a2d 20px); }
.dirt-layer { height: 85px; background: linear-gradient(180deg, #5c4033 0%, #3d2817 100%); }

/* Floating Platforms */
.floating-platform { position: absolute; height: 20px; background: linear-gradient(180deg, #6b8e6b, #4a6a4a); border: 3px solid #3d5a3d; border-radius: 4px; animation: platformFloat 3s ease-in-out infinite; }
.platform-1 { width: 120px; left: 25%; bottom: 180px; }
.platform-2 { width: 100px; right: 30%; bottom: 220px; animation-delay: 1.5s; }
@keyframes platformFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ==================== CHARACTER ==================== */
.character { position: absolute; width: 64px; height: 96px; bottom: 100px; left: 80px; background: url('./assets/sprite.png') no-repeat center; background-size: contain; image-rendering: pixelated; z-index: 100; transition: left 0.4s ease, bottom 0.3s ease; }
.character-shadow { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); width: 50px; height: 15px; background: radial-gradient(ellipse, rgba(0,0,0,0.4), transparent); border-radius: 50%; }

/* ==================== GAME COINS ==================== */
.game-coin {
    position: absolute;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6), inset 0 -3px 5px rgba(0,0,0,0.2);
    animation: coinBob 1s ease-in-out infinite, coinGlow 2s linear infinite;
    z-index: 50;
}
.game-coin .coin-icon { font-size: 24px; }
.game-coin.collected { animation: coinCollect 0.3s ease forwards; pointer-events: none; }
@keyframes coinBob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes coinGlow { from { box-shadow: 0 0 10px rgba(255,215,0,0.4); } to { box-shadow: 0 0 25px rgba(255,215,0,0.8); } }

/* ==================== SKILL COINS ==================== */
.skill-coin { position: absolute; width: 40px; height: 40px; cursor: pointer; z-index: 200; animation: coinBounce 2s ease-in-out infinite; }
.skill-coin .coin-visual { width: 100%; height: 100%; background: radial-gradient(circle at 30% 30%, #ffff80, #ffd700, #cc9900); border: 3px solid #aa7700; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; box-shadow: 0 0 20px rgba(255,215,0,0.6); transition: all 0.3s; }
.skill-coin:hover .coin-visual { transform: scale(1.2); box-shadow: 0 0 30px rgba(255,215,0,0.9); }
.skill-coin .coin-label { position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); font-size: 8px; color: var(--retro-accent); white-space: nowrap; opacity: 0; transition: opacity 0.3s; }
.skill-coin:hover .coin-label { opacity: 1; }
.skill-coin.collected { animation: coinCollect 0.6s ease forwards; pointer-events: none; }
@keyframes coinBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes coinCollect { 0% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.5) translateY(-30px); } 100% { transform: scale(0) translateY(-60px); opacity: 0; } }

/* Skill reveal popup */
.skill-reveal { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 2000; padding: 30px 50px; text-align: center; animation: skillRevealIn 0.5s ease; }
.skill-reveal .skill-icon { font-size: 48px; margin-bottom: 15px; }
.skill-reveal .skill-name { font-size: 16px; color: var(--retro-accent); margin-bottom: 10px; }
.skill-reveal .skill-desc { font-size: 10px; color: var(--retro-primary); }
.skill-reveal .skill-xp { font-size: 12px; color: var(--retro-secondary); margin-top: 15px; }
@keyframes skillRevealIn { from { transform: translate(-50%, -50%) scale(0); opacity: 0; } to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }

/* ==================== PORTAL ==================== */
.portal-container { position: absolute; right: 80px; bottom: 80px; width: 100px; height: 140px; cursor: pointer; z-index: 150; }
.portal-ring { position: absolute; border-radius: 50%; border: 4px solid; animation: portalSpin 4s linear infinite; }
.ring-1 { width: 80px; height: 100px; top: 20px; left: 10px; border-color: #6366f1; }
.ring-2 { width: 60px; height: 80px; top: 30px; left: 20px; border-color: #a855f7; animation-direction: reverse; animation-duration: 3s; }
.ring-3 { width: 40px; height: 60px; top: 40px; left: 30px; border-color: #ec4899; animation-duration: 2s; }
.portal-core { position: absolute; width: 30px; height: 40px; top: 50px; left: 35px; background: radial-gradient(ellipse, #fff, #a855f7, transparent); border-radius: 50%; animation: portalPulse 1.5s ease-in-out infinite; }
.portal-label { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); font-size: 9px; color: var(--retro-accent); white-space: nowrap; }
@keyframes portalSpin { from { transform: rotateY(0deg); } to { transform: rotateY(360deg); } }
@keyframes portalPulse { 0%,100% { opacity: 0.7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.2); } }

/* Portal Active State - Shine Effect */
.portal-container.active {
    animation: portalShine 1.5s ease-in-out infinite;
}
.portal-container.active .portal-core {
    background: radial-gradient(ellipse, #fff, #00ff88, transparent);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.8);
}
.portal-container.active .portal-label {
    color: var(--retro-primary);
    text-shadow: 0 0 10px var(--retro-primary);
}
@keyframes portalShine {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.5) drop-shadow(0 0 20px rgba(0, 255, 136, 0.8)); }
}

/* Skill Popup - Notification when collecting coin */
.skill-popup {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    padding: 20px 40px;
    text-align: center;
    background: rgba(10, 10, 15, 0.95);
    border: 2px solid var(--retro-primary);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.4);
    animation: popupIn 0.4s ease;
}
.skill-popup .popup-icon { font-size: 42px; margin-bottom: 10px; }
.skill-popup .popup-name { font-size: 14px; color: var(--retro-accent); margin-bottom: 5px; }
.skill-popup .popup-desc { font-size: 10px; color: #aaa; }
.skill-popup.fade-out { animation: popupOut 0.3s ease forwards; }
@keyframes popupIn { from { opacity: 0; transform: translateX(-50%) translateY(-20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes popupOut { from { opacity: 1; } to { opacity: 0; transform: translateX(-50%) translateY(-20px); } }

/* ==================== MINI MAP ==================== */
.mini-map { position: absolute; top: 10px; right: 10px; width: 150px; height: 100px; background: rgba(0,0,0,0.7); border: 2px solid var(--retro-primary); border-radius: 8px; overflow: hidden; }
.mini-map-content { position: relative; width: 100%; height: 100%; }
.mini-player { position: absolute; width: 8px; height: 8px; background: var(--retro-accent); border-radius: 50%; box-shadow: 0 0 10px var(--retro-accent); transition: all 0.3s; }

/* ==================== PROGRESS PANEL ==================== */
.progress-panel { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 20px 30px; z-index: 999; }
.progress-title { font-size: 10px; color: var(--retro-accent); margin-bottom: 15px; text-align: center; }
.progress-items { display: flex; gap: 30px; }
.progress-item { display: flex; align-items: center; gap: 10px; }
.progress-icon { font-size: 20px; }
.progress-info { display: flex; flex-direction: column; gap: 5px; }
.progress-name { font-size: 9px; color: var(--retro-muted); }
.progress-bar { width: 80px; height: 8px; background: rgba(0,0,0,0.5); border: 1px solid var(--retro-primary); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--retro-primary); transition: width 0.5s; }
.progress-count { font-size: 10px; color: var(--retro-accent); }

/* ==================== UNLOCK NOTIFICATION ==================== */
.unlock-notification { position: fixed; top: 100px; left: 50%; transform: translateX(-50%); z-index: 3000; padding: 20px 40px; text-align: center; animation: unlockSlide 0.5s ease; }
.unlock-notification.hidden { display: none; }
.unlock-title { font-size: 14px; color: var(--retro-accent); margin-bottom: 10px; }
.unlock-desc { font-size: 10px; color: var(--retro-primary); }
@keyframes unlockSlide { from { transform: translateX(-50%) translateY(-50px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }

/* ==================== MODALS ==================== */
.world-map-modal, .modal { position: fixed; inset: 0; background: rgba(0,0,0,0.9); backdrop-filter: blur(10px); z-index: 2000; display: none; align-items: center; justify-content: center; }
.world-map-content, .modal-content { max-width: 1100px; width: 95%; max-height: 90vh; overflow-y: auto; padding: 40px; position: relative; }
.close-button { position: absolute; top: 20px; right: 20px; width: 40px; height: 40px; background: rgba(255,0,0,0.2); border: 2px solid #ff4444; border-radius: 50%; color: #ff4444; font-size: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.close-button:hover { background: #ff4444; color: #fff; }
.map-header { text-align: center; margin-bottom: 30px; }
.world-map-title { font-size: 20px; color: var(--retro-accent); margin-bottom: 10px; }
.map-subtitle { font-size: 10px; color: var(--retro-muted); }
.regions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.region { padding: 25px; cursor: pointer; transition: all 0.3s; border: 2px solid transparent; }
.region:hover { border-color: var(--retro-primary); transform: translateY(-5px); }
.region.locked { opacity: 0.4; pointer-events: none; }
.region.unlocked { border-color: var(--retro-secondary); }
.region-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.region-icon { font-size: 32px; }
.region-title { font-size: 12px; color: var(--retro-accent); }
.region-lock { font-size: 10px; color: var(--retro-muted); }
.region-description { font-size: 9px; line-height: 16px; color: #aaa; }

/* ==================== CHATBOT (Game Mode) ==================== */
.chatbot { position: fixed; bottom: 20px; right: 20px; width: 380px; height: 500px; z-index: 1500; display: flex; flex-direction: column; overflow: hidden; transition: all 0.4s; }
.chatbot.minimized { height: 60px; }
.chatbot-header { display: flex; align-items: center; gap: 12px; padding: 15px; border-bottom: 1px solid var(--glass-border); }
.chat-avatar { width: 36px; height: 36px; background: linear-gradient(135deg, var(--retro-primary), var(--retro-secondary)); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; }
.chat-info { flex: 1; }
.chat-title { display: block; font-size: 11px; color: var(--retro-primary); }
.chat-status { font-size: 8px; color: var(--retro-muted); }
.chat-minimize { background: none; border: none; color: var(--retro-muted); font-size: 20px; cursor: pointer; padding: 5px 10px; }
.chatbot-messages { flex: 1; padding: 15px; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; }
.message { display: flex; gap: 10px; animation: msgIn 0.3s ease; }
.msg-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--retro-primary); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.msg-content { background: rgba(0,255,136,0.1); border: 1px solid rgba(0,255,136,0.2); border-radius: 12px; padding: 12px 15px; font-size: 10px; line-height: 16px; color: #ccc; }
.msg-content p { margin-bottom: 8px; }
.msg-content p:last-child { margin-bottom: 0; }
.user-message { flex-direction: row-reverse; }
.user-message .msg-content { background: rgba(0,100,255,0.2); border-color: rgba(0,100,255,0.3); }
@keyframes msgIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.chat-suggestions { display: flex; gap: 8px; padding: 10px 15px; flex-wrap: wrap; }
.suggestion-chip { background: rgba(0,255,136,0.1); border: 1px solid var(--retro-primary); color: var(--retro-primary); padding: 6px 12px; border-radius: 20px; font-size: 9px; cursor: pointer; font-family: var(--font-pixel); transition: all 0.3s; }
.suggestion-chip:hover { background: var(--retro-primary); color: #000; }
.chatbot-input { display: flex; gap: 10px; padding: 15px; border-top: 1px solid var(--glass-border); }
.chatbot-input input { flex: 1; background: rgba(0,0,0,0.5); border: 2px solid var(--retro-primary); padding: 12px 15px; color: var(--retro-primary); font-family: var(--font-pixel); font-size: 9px; border-radius: 8px; outline: none; }
.chatbot-input input:focus { border-color: var(--retro-accent); box-shadow: 0 0 15px rgba(255,255,0,0.3); }
.send-btn { width: 44px; height: 44px; background: var(--retro-primary); border: none; border-radius: 8px; color: #000; font-size: 18px; cursor: pointer; transition: all 0.3s; }
.send-btn:hover { transform: scale(1.1); }

/* ==================== NOTIFICATIONS ==================== */
.level-up-notification { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 10000; display: none; padding: 30px 50px; text-align: center; animation: levelUp 0.5s ease; }
.notif-icon { font-size: 48px; margin-bottom: 15px; animation: iconBounce 0.5s ease infinite alternate; }
.notif-title { font-size: 18px; color: var(--retro-accent); display: block; margin-bottom: 10px; }
.notif-desc { font-size: 12px; color: var(--retro-primary); }
@keyframes levelUp { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); } }
@keyframes iconBounce { from { transform: translateY(0); } to { transform: translateY(-10px); } }

.achievement-popup { position: fixed; bottom: 100px; right: 30px; z-index: 3000; padding: 20px; display: none; animation: achIn 0.5s ease; }
.achievement-content { display: flex; align-items: center; gap: 15px; }
.achievement-icon { font-size: 36px; }
.ach-title { display: block; font-size: 10px; color: var(--retro-accent); margin-bottom: 5px; }
.ach-desc { display: block; font-size: 9px; color: var(--retro-primary); margin-bottom: 5px; }
.ach-reward { font-size: 10px; color: var(--retro-secondary); }
@keyframes achIn { from { transform: translateX(100px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==================== ACTION ORBS (MAP, AI, QUESTS) ==================== */
.action-orbs {
    position: fixed;
    top: 100px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 999;
}
.action-orb {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.15), rgba(0, 191, 255, 0.15));
    border: 2px solid var(--retro-primary);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.2);
}
.action-orb:hover {
    background: linear-gradient(135deg, rgba(0, 255, 136, 0.3), rgba(0, 191, 255, 0.3));
    border-color: var(--retro-accent);
    transform: translateX(-5px);
    box-shadow: 0 0 25px rgba(0, 255, 136, 0.5);
}
.orb-icon {
    font-size: 20px;
}
.orb-label {
    font-family: var(--font-pixel);
    font-size: 10px;
    color: var(--retro-primary);
    letter-spacing: 1px;
}
.action-orb:hover .orb-label {
    color: var(--retro-accent);
}

/* ==================== CONTROL DOCK ==================== */
.control-dock { position: fixed; bottom: 20px; left: 20px; display: flex; gap: 10px; z-index: 999; }
.dock-btn { width: 44px; height: 44px; border-radius: 12px; background: var(--glass); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); color: #888; font-size: 18px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.3s; }
.dock-btn:hover { border-color: var(--retro-primary); color: var(--retro-primary); }
.dock-btn.active { background: rgba(0,255,136,0.2); color: var(--retro-primary); border-color: var(--retro-primary); }

/* How to Play */
.how-to-play-menu { position: fixed; bottom: 80px; left: 20px; width: 280px; padding: 20px; z-index: 999; display: none; }
.how-to-play-menu.visible { display: block; animation: menuIn 0.3s ease; }
.help-title { font-size: 12px; color: var(--retro-accent); margin-bottom: 15px; }
.help-list { list-style: none; }
.help-list li { font-size: 10px; color: #aaa; padding: 8px 0; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; gap: 10px; }
.key { background: rgba(0,255,136,0.2); border: 1px solid var(--retro-primary); padding: 3px 8px; border-radius: 4px; color: var(--retro-primary); }
@keyframes menuIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==================== TRANSITION ==================== */
.transition-container { position: fixed; inset: 0; background: var(--beige-bg); z-index: 9999; display: none; align-items: center; justify-content: center; flex-direction: column; }
.transition-container.active { display: flex; }
.transition-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(211,84,0,0.1) 1px, transparent 1px), linear-gradient(90deg, rgba(211,84,0,0.1) 1px, transparent 1px); background-size: 50px 50px; animation: gridPulse 2s ease infinite; }
@keyframes gridPulse { 0%,100% { opacity: 0.3; } 50% { opacity: 0.6; } }
.transition-content { position: relative; z-index: 1; text-align: center; }
.loading-dots { display: flex; gap: 10px; justify-content: center; margin-bottom: 20px; }
.loading-dots span { width: 12px; height: 12px; background: var(--beige-rust); border-radius: 50%; animation: dotPulse 1.4s ease-in-out infinite; }
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse { 0%,60%,100% { transform: scale(1); opacity: 0.4; } 30% { transform: scale(1.3); opacity: 1; } }
.transition-text { font-family: var(--font-modern); font-size: 18px; color: var(--beige-rust); letter-spacing: 5px; font-weight: 700; }

/* ==================== PORTAL PROMPT ==================== */
.portal-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10000;
    padding: 30px;
    text-align: center;
    background: rgba(10, 10, 15, 0.95);
    border: 2px solid var(--retro-primary);
    box-shadow: 0 0 40px rgba(0, 255, 136, 0.3);
    animation: promptIn 0.4s ease;
}
.prompt-icon { font-size: 48px; margin-bottom: 15px; animation: spin 4s linear infinite; }
.prompt-title { font-size: 18px; color: var(--retro-accent); margin-bottom: 10px; }
.prompt-text { font-size: 12px; color: #ccc; margin-bottom: 25px; }
.prompt-buttons { display: flex; gap: 15px; justify-content: center; }
.prompt-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-family: var(--font-pixel);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.prompt-btn.primary { background: var(--retro-primary); color: #000; }
.prompt-btn.primary:hover { transform: scale(1.05); box-shadow: 0 0 15px var(--retro-primary); }
.prompt-btn.secondary { background: transparent; border: 1px solid #666; color: #888; }
.prompt-btn.secondary:hover { border-color: #fff; color: #fff; }
@keyframes promptIn { from { opacity: 0; transform: translate(-50%, -40%); } to { opacity: 1; transform: translate(-50%, -50%); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* ==================== BEIGE DESIGN PORTFOLIO ==================== */
.modern-portfolio { display: none; font-family: var(--font-modern); background: var(--beige-bg); color: var(--beige-text); }
.modern-portfolio.active { display: block; }

/* Navigation */
.beige-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 30px 60px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(234, 224, 213, 0.9);
    backdrop-filter: blur(10px);
}
.nav-link {
    text-decoration: none;
    color: var(--beige-text);
    font-size: 14px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-left: 40px;
    transition: color 0.3s;
}
.nav-link:hover { color: var(--beige-rust); }
.nav-left .nav-link { margin-left: 0; }

/* Hero Section */
.beige-hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 60px;
}
.hero-logo-container {
    width: 100%;
    max-width: 1200px;
    text-align: center;
}
.hero-logo-img {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Split Layout Utilities */
.split-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 100px 60px;
    align-items: start;
}
.section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--beige-rust);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 30px;
}
.section-lead {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--beige-text);
    margin-bottom: 40px;
}

/* Projects Section */
.project-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.tag-pill {
    padding: 8px 16px;
    border: 1px solid var(--beige-rust);
    border-radius: 20px;
    font-size: 12px;
    color: var(--beige-rust);
    font-weight: 600;
    text-transform: uppercase;
}
.beige-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.grid-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s;
}
.grid-card-link:hover {
    transform: translateY(-5px);
}
.grid-card {
    display: flex;
    flex-direction: column;
    gap: 15px;
}
.card-image {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 12px;
    background-size: cover;
    background-position: center;
}
.placeholder-rust { background-color: #D35400; }
.placeholder-beige { background-color: #C0B0A0; }
.card-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 5px; }
.card-info p { font-size: 14px; color: #666; }

/* About Section */
.about-desc {
    font-size: 18px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 40px;
}
.expert-label {
    font-size: 14px;
    font-style: italic;
    color: var(--beige-rust);
    margin-bottom: 20px;
}
.about-photo-container {
    position: relative;
    margin-bottom: 40px;
}
.about-photo {
    width: 100%;
    border-radius: 12px;
    display: block;
}
.photo-overlay-text {
    position: absolute;
    bottom: 20px;
    right: 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}
.giant-text-right {
    font-size: 120px;
    font-weight: 900;
    color: var(--beige-rust);
    line-height: 0.8;
    text-align: right;
    opacity: 0.2;
}
.skills-chips-container {
    padding: 0 60px 100px;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.skill-chip {
    padding: 10px 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--beige-rust);
    text-transform: uppercase;
}

/* Footer Section */
.beige-footer {
    background: var(--beige-bg);
    padding-top: 60px;
    border-top: 1px solid var(--beige-border);
}
.footer-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 60px 80px;
}
.testimonial {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    color: var(--beige-text);
}
.testimonial-quote {
    font-size: 18px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
    font-style: italic;
}
.testimonial-author {
    font-size: 14px;
    font-weight: 700;
    color: var(--beige-rust);
}
.author-role {
    font-size: 10px;
    color: #888;
    display: block;
    margin-top: 4px;
}
.footer-giant-logo {
    padding: 40px 60px;
    text-align: center;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}
.footer-logo-img {
    width: 100%;
    max-width: 1200px;
    height: auto;
}
.footer-bottom-bar {
    display: flex;
    justify-content: space-between;
    padding: 30px 60px;
    font-size: 12px;
    font-weight: 600;
    color: var(--beige-rust);
    text-transform: uppercase;
}
.footer-socials { display: flex; gap: 30px; }
.footer-socials a, .footer-links a { text-decoration: none; color: var(--beige-rust); }

/* Modern Chat (Beige Theme) */
.modern-chat { position: fixed; bottom: 30px; right: 30px; z-index: 10000; font-family: 'Inter', sans-serif; }
.beige-fab {
    width: 60px; height: 60px; border-radius: 50%;
    background: var(--beige-rust); color: white;
    border: none; box-shadow: 0 4px 20px rgba(211, 84, 0, 0.4);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.3s;
}
.beige-fab:hover { transform: scale(1.1); }
.fab-icon { font-size: 24px; }
.chat-panel {
    position: absolute; bottom: 80px; right: 0;
    width: 350px; height: 500px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    display: none; flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}
.chat-panel.active { display: flex; animation: panelIn 0.3s ease; }
.beige-chat-header {
    padding: 20px;
    background: var(--beige-rust);
    color: white;
    display: flex; align-items: center; gap: 15px;
}
.chat-avatar-modern {
    width: 40px; height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.chat-panel-info { flex: 1; display: flex; flex-direction: column; }
.chat-panel-title { font-weight: 700; font-size: 16px; }
.chat-panel-status { font-size: 12px; opacity: 0.8; }
.chat-panel-close { background: none; border: none; color: white; font-size: 24px; cursor: pointer; }
.chat-panel-messages {
    flex: 1; padding: 20px; overflow-y: auto;
    display: flex; flex-direction: column; gap: 15px;
    background: #FAFAFA;
}
.modern-message {
    max-width: 80%; padding: 12px 16px; border-radius: 12px;
    font-size: 14px; line-height: 1.5;
}
.modern-message.bot {
    align-self: flex-start;
    background: white;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.modern-message.user {
    align-self: flex-end;
    background: var(--beige-rust);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-panel-input {
    padding: 15px; background: white;
    border-top: 1px solid #eee;
    display: flex; gap: 10px;
}
.chat-panel-input input {
    flex: 1; padding: 10px 15px;
    border: 1px solid #eee; border-radius: 20px;
    font-family: 'Inter', sans-serif; font-size: 14px; outline: none;
}
.chat-panel-input input:focus { border-color: var(--beige-rust); }
.chat-panel-input button {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--beige-rust); color: white;
    border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}

/* ==================== MOBILE CONTROLS ==================== */
/* Hidden by default everywhere - JS adds 'visible' class, CSS shows only on mobile */
.mobile-controls {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    gap: 80px;
}

/* Only show on mobile/tablet when 'visible' class is added by JS */
@media (max-width: 768px) {
    .mobile-controls.visible {
        display: flex;
    }
}

.mobile-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(145deg, rgba(0, 255, 136, 0.3), rgba(0, 191, 255, 0.3));
    border: 3px solid var(--retro-primary);
    color: var(--retro-primary);
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 255, 136, 0.4);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: all 0.2s;
}

.mobile-btn:active {
    background: var(--retro-primary);
    color: #000;
    transform: scale(0.95);
}

/* ==================== RESPONSIVE STYLES ==================== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .split-container { gap: 40px; padding: 80px 40px; }
    .beige-nav { padding: 20px 40px; }
    .hud { width: 220px; left: 10px; top: 70px; padding: 15px; }
    .action-orbs { right: 10px; }
    .progress-panel { display: none; }
    .chatbot { width: 340px; right: 10px; }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    
    /* Game Container - Full screen */
    .game-container {
        min-height: 100vh;
        padding: 0;
        overflow: hidden;
    }
    
    /* Game World Container - position at bottom of screen */
    .game-world-container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 200px;
        overflow: visible;
    }
    
    /* Ground layer - at bottom */
    .ground-layer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 100px;
    }
    .grass-row { height: 15px; }
    .dirt-layer { height: 85px; }
    
    /* Character - above ground */
    .character {
        position: fixed !important;
        bottom: 100px !important;
        width: 48px;
        height: 72px;
        z-index: 200;
    }
    
    /* Coins - position above ground, spaced across screen */
    .game-coin {
        position: fixed !important;
        bottom: 110px !important;
        width: 40px;
        height: 40px;
        z-index: 150;
    }
    .game-coin .coin-icon { font-size: 18px; }
    
    /* Portal - fixed position on right */
    .portal-container {
        position: fixed !important;
        right: 20px !important;
        bottom: 100px !important;
        width: 70px;
        height: 100px;
        transform: scale(0.7);
        z-index: 180;
    }
    
    /* Hide floating platforms on mobile */
    .floating-platform { display: none; }
    
    /* Control Dock - Move to right side, vertical stack */
    .control-dock {
        position: fixed !important;
        bottom: auto !important;
        left: auto !important;
        top: 200px !important;
        right: 10px !important;
        flex-direction: column !important;
        gap: 8px !important;
        z-index: 1000 !important;
    }
    .dock-btn {
        width: 36px !important;
        height: 36px !important;
        font-size: 14px !important;
    }
    
    /* Chatbot - Full screen modal on mobile */
    .chatbot {
        display: none;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        border-radius: 0 !important;
        z-index: 10000 !important;
    }
    .chatbot.open {
        display: flex !important;
    }
    .chatbot.minimized {
        display: none !important;
    }
    
    /* Hide keyboard-only elements */
    .how-to-play-menu .help-list li:nth-child(1) { display: none; }
    
    /* Modern Portfolio - Single column */
    .split-container { grid-template-columns: 1fr; padding: 60px 20px; }
    .reverse-mobile { display: flex; flex-direction: column-reverse; }
    .beige-hero { padding: 0 20px; }
    .giant-text-right { font-size: 60px; text-align: center; }
    .footer-split { grid-template-columns: 1fr; padding: 0 20px 60px; }
    .footer-bottom-bar { flex-direction: column; gap: 20px; padding: 30px 20px; text-align: center; }
    .nav-link { margin-left: 20px; font-size: 12px; }
    .beige-nav { padding: 15px 20px; }
    .beige-grid { grid-template-columns: 1fr; }
    .skills-chips-container { padding: 0 20px 60px; }
    
    /* Game Section */
    .game-container { padding: 10px; }
    
    /* HUD - Smaller and repositioned */
    .hud { 
        width: 180px; 
        top: 60px; 
        left: 10px; 
        padding: 12px;
        font-size: 8px;
    }
    .hud-title { font-size: 8px; }
    .hud-level { font-size: 12px; }
    .hud-class { font-size: 10px; }
    .hud-stat-row { font-size: 8px; gap: 6px; }
    .inventory-items { gap: 5px; }
    .inv-item { font-size: 16px; }
    
    /* Action orbs - Horizontal at top */
    .action-orbs {
        position: fixed;
        top: 10px;
        right: 50%;
        transform: translateX(50%);
        flex-direction: row;
        gap: 8px;
    }
    .action-orb {
        padding: 8px 12px;
    }
    .orb-label { display: none; }
    .orb-icon { font-size: 18px; }
    
    /* Progress panel hidden on mobile */
    .progress-panel { display: none; }
    
    /* Chatbot - Full width on mobile */
    .chatbot {
        width: calc(100% - 20px);
        right: 10px;
        left: 10px;
        bottom: 120px; /* Above mobile controls */
        height: 400px;
    }
    .chatbot.minimized { height: 50px; }
    
    /* Modern chat */
    .modern-chat { bottom: 100px; right: 20px; }
    .chat-panel { 
        width: calc(100vw - 40px); 
        right: -10px;
        height: 450px;
    }
    
    /* Portal */
    .portal-container { right: 50px; }
    
    /* Character */
    .character { width: 48px; height: 72px; }
    
    /* Press Start - Responsive */
    .start-title { font-size: 24px; }
    .title-tagline { font-size: 9px; }
    .start-hints { flex-direction: column; gap: 10px; }
    .hint-item { font-size: 8px; padding: 8px 12px; }
    .start-stats { gap: 20px; flex-wrap: wrap; justify-content: center; }
    .start-stat .stat-num { font-size: 18px; }
    .press-start-btn { padding: 15px 30px; font-size: 12px; }
    
    /* Control dock */
    .control-dock { bottom: 110px; }
}

/* Small phones (max-width: 480px) */
@media (max-width: 480px) {
    .mobile-btn {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
    .mobile-controls { gap: 60px; }
    
    .hud { 
        width: 150px; 
        padding: 10px;
    }
    .inventory-title { font-size: 7px; }
    
    .start-title { font-size: 20px; }
    .start-hints { display: none; }
    .start-stats { gap: 15px; }
    .start-stat .stat-num { font-size: 16px; }
    .start-stat .stat-desc { font-size: 7px; }
    
    .beige-nav { 
        padding: 10px 15px; 
    }
    .nav-link { margin-left: 10px; font-size: 10px; }
    
    .hero-logo-img { max-width: 100%; }
    
    .section-title { font-size: 14px; }
    .section-lead { font-size: 22px; }
    .about-desc { font-size: 16px; }
    .testimonial { font-size: 24px; }
    
    .chatbot { bottom: 100px; height: 350px; }
    .chat-panel { height: 400px; }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .mobile-controls { bottom: 10px; }
    .mobile-btn { width: 50px; height: 50px; font-size: 20px; }
    .hud { top: 10px; }
    .game-world-container { height: 60vh; }
    .press-start-overlay { padding: 20px; }
    .start-content { transform: scale(0.8); }
}
