/* ── UI VARIABLES & FONTS ── */
:root {
    --primary-red: #d31027; --dark-red: #8a0303;
    --neon-green: #00ffcc; --gold: #f6d365;
    --void-bg: rgba(10, 5, 15, 0.7); --glass-border: rgba(255, 255, 255, 0.1);
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100vh;
    background-color: #000; color: #fff;
    font-family: 'Rajdhani', sans-serif; overflow: hidden;
}

#game-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }
#game-container canvas { cursor: crosshair !important; }
#ui-layer { 
    position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 10; pointer-events: none; 
    display: none; /* အသစ်ထည့်လိုက်သောလိုင်း (စစချင်း ဖျောက်ထားမည်မို့ Glitch လုံးဝ မဖြစ်တော့ပါ) */
}
.interactive { pointer-events: auto; }
.interactive-none { pointer-events: none; }

/* ── HEADER ── */
header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 40px; box-sizing: border-box; background: linear-gradient(to bottom, rgba(0,0,0,0.9), transparent);
}
.brand { display: flex; align-items: center; gap: 15px; }
.brand img { width: 45px; filter: drop-shadow(0 0 10px var(--primary-red)); }
.brand h1 { 
    font-family: 'Cinzel', serif; font-size: 26px; margin: 0; 
    background: linear-gradient(to right, #fff, #888); 
    -webkit-background-clip: text; 
    background-clip: text; /* အသစ်ထည့်လိုက်သောလိုင်း (VS Code Error ပျောက်သွားပါမည်) */
    color: transparent; letter-spacing: 2px; 
}

.top-actions { display: flex; gap: 15px; }
.pill-btn {
    background: var(--void-bg); backdrop-filter: blur(8px); border: 1px solid var(--glass-border);
    color: #ccc; padding: 8px 20px; border-radius: 30px; font-family: 'Rajdhani', sans-serif; font-size: 15px; font-weight: bold; cursor: pointer; transition: 0.3s ease;
}
.pill-btn:hover { background: rgba(255,255,255,0.1); color: #fff; box-shadow: 0 0 15px rgba(255,255,255,0.2); }
.btn-wallet { border-color: rgba(0, 255, 204, 0.4); color: var(--neon-green); }
.btn-exchange { border-color: rgba(246, 211, 101, 0.4); color: var(--gold); }

/* ── HUD ── */
.player-hud {
    position: absolute; top: 90px; left: 30px; background: var(--void-bg); backdrop-filter: blur(10px);
    border-left: 3px solid var(--primary-red); padding: 15px 20px; border-radius: 0 12px 12px 0; box-shadow: 10px 10px 30px rgba(0,0,0,0.8);
}
.stat-row { display: flex; justify-content: space-between; width: 160px; margin-bottom: 6px; font-size: 16px; }
.stat-label { color: #888; }
.stat-val { color: #fff; font-weight: bold; }

/* ── HP BAR OVERLAY (Top Center) ── */
.boss-info {
    position: absolute; top: 12%; left: 50%; transform: translateX(-50%);
    text-align: center; width: 400px; pointer-events: none;
}
.boss-name { font-family: 'Cinzel', serif; font-size: 24px; color: #ddd; letter-spacing: 3px; margin: 0 0 10px 0; text-shadow: 0 2px 10px #000; }
.hp-track { width: 100%; height: 14px; background: rgba(20,0,0,0.8); border: 1px solid #440000; outline: 1px solid #000; outline-offset: 2px; box-shadow: 0 0 20px rgba(211, 16, 39, 0.5); }
.hp-fill { width: 100%; height: 100%; background: linear-gradient(90deg, var(--dark-red), var(--primary-red), #ff4d4d); box-shadow: 0 0 10px var(--primary-red); transition: width 0.2s ease-out; }
.hp-text { font-size: 15px; margin-top: 8px; color: #fff; letter-spacing: 1px; font-weight: bold; text-shadow: 1px 1px 2px #000; }
.tap-hint { position: absolute; bottom: 22%; left: 50%; transform: translateX(-50%); font-size: 16px; color: #888; letter-spacing: 5px; animation: blink 1.5s infinite; pointer-events: none; font-weight: bold; }

/* ── ACTION DOCK ── */
.action-dock {
    position: absolute; bottom: 25px; left: 50%; transform: translateX(-50%); display: flex; gap: 20px;
    background: rgba(10, 5, 15, 0.7); backdrop-filter: blur(15px); padding: 12px 25px; border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.05); box-shadow: 0 20px 50px rgba(0,0,0,0.9);
}
.dock-item { display: flex; flex-direction: column; align-items: center; width: 85px; cursor: pointer; transition: 0.3s; }
.dock-item img { width: 55px; height: 55px; object-fit: contain; filter: drop-shadow(0 5px 10px rgba(0,0,0,0.5)); transition: 0.3s; }
.dock-item span { margin-top: 8px; font-size: 13px; color: #888; font-weight: bold; text-transform: uppercase; transition: 0.3s; }
.dock-item:hover { transform: translateY(-12px); }
.dock-item:hover img { filter: drop-shadow(0 0 15px var(--gold)); transform: scale(1.1); }
.dock-item:hover span { color: #fff; }
.dock-item.summon img { filter: drop-shadow(0 0 10px #ff00ff); }
.dock-item.summon:hover img { filter: drop-shadow(0 0 25px #ff00ff); }

/* ── MODAL GLOBALS (Fixed CSS Issue) ── */
.hidden { display: none !important; }
#modal-container { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 100; display: flex; justify-content: center; align-items: center; }
.modal-bg { position: absolute; width: 100%; height: 100%; background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); }
.modal-box { position: relative; z-index: 101; }

.m-box { background: rgba(10,5,15,0.95); border: 1px solid #5522aa; box-shadow: 0 0 30px rgba(85,34,170,0.5); padding: 30px; border-radius: 12px; color: #fff; text-align: center; position: relative; }
.m-close { position: absolute; top: 10px; right: 20px; font-size: 24px; cursor: pointer; color: #888; transition: 0.3s; }
.m-close:hover { color: #fff; }
.m-title { font-family: 'Cinzel', serif; font-size: 24px; color: #d31027; margin-bottom: 20px; text-shadow: 0 2px 5px #000; }
.m-btn { background: #1a0d2e; border: 1px solid #d31027; color: #fff; padding: 10px 20px; font-family: 'Rajdhani'; font-size: 16px; font-weight: bold; cursor: pointer; border-radius: 4px; transition: 0.3s; }
.m-btn:hover { background: #d31027; box-shadow: 0 0 15px #d31027; }
.m-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 15px; margin-top: 20px; }
.inv-card { background: rgba(0,0,0,0.5); border: 1px solid #444; padding: 15px 10px; border-radius: 8px; text-align: center; }
.inv-card img { width: 80px; height: 80px; margin-bottom: 10px; object-fit: contain; }
.quest-row { display: flex; justify-content: space-between; align-items: center; background: rgba(30,10,50,0.5); padding: 10px 15px; border: 1px solid #5522aa; margin-bottom: 8px; border-radius: 4px; }

@keyframes blink { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
}
/* =========================================================
   📱 MOBILE RESPONSIVE LAYOUT (Phone စခရင်အတွက် အထူးဒီဇိုင်း)
   ========================================================= */
@media (max-width: 768px) {
    /* 1. Top Header ကို သေးမည် */
    header { padding: 10px; flex-wrap: wrap; justify-content: center; gap: 10px; }
    .brand img { width: 35px; }
    .brand h1 { font-size: 20px; }
    .top-actions { gap: 8px; justify-content: center; width: 100%; }
    .pill-btn { padding: 6px 12px; font-size: 13px; }

    /* 2. Player HUD ကို ဘယ်ဘက်မှ အပေါ်(အလယ်) သို့ ရွှေ့မည် */
    .player-hud {
        top: 110px; left: 50%; transform: translateX(-50%);
        width: 90%; border-radius: 8px; border-left: none; border-top: 3px solid var(--primary-red);
        padding: 10px 15px; display: flex; flex-wrap: wrap; justify-content: space-between;
        box-sizing: border-box;
    }
    .stat-row { width: 45%; margin-bottom: 5px; font-size: 14px; }
    /* Buff Box ကို အောက်ဆုံးမှာ အပြည့်ထားမည် */
    .player-hud > div[onclick] { width: 100%; height: 40px !important; margin-top: 5px !important; } 

    /* 3. Boss HP Bar ကို HUD အောက်သို့ ချမည် */
    .boss-info { top: 250px; width: 90%; }
    .boss-name { font-size: 18px; margin-bottom: 5px; }
    .hp-track { height: 10px; }
    .hp-text { font-size: 13px; margin-top: 5px; }
    
    /* Tap To Kill စာသားကို ရှင်းလင်းရေးအတွက် ဖျောက်ထားမည် သို့မဟုတ် နေရာရွှေ့မည် */
    .tap-hint { bottom: 120px; font-size: 12px; }

    /* 4. Action Dock ကို ဖုန်းနှင့် ကိုက်ညီအောင် သေးမည် */
    .action-dock {
        width: 95%; padding: 10px; gap: 5px; justify-content: space-between; bottom: 10px;
        box-sizing: border-box;
    }
    .dock-item { width: 18%; }
    .dock-item img { width: 35px; height: 35px; }
    .dock-item span { font-size: 9px; margin-top: 5px; }

    /* 5. Modals (Popup) များကို ဖုန်းထဲ ဝင်ဆံ့အောင် ပြင်မည် */
    .m-box { width: 95% !important; padding: 20px 15px !important; box-sizing: border-box; }
    .m-title { font-size: 20px !important; }
    
    /* Inventory & Quests ကို ဖုန်းပေါ်တွင် အဆင်ပြေအောင် ချုံ့မည် */
    .grid-5 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
    .quest-row { flex-direction: column; gap: 8px; text-align: center; }
    .quest-row span { width: 100% !important; text-align: center !important; font-size: 13px !important; }
    
    /* Summon နှင့် Exchange Box များကို Column ပုံစံ ပြောင်းမည် */
    #summon-box > div:nth-child(3) { flex-direction: column !important; align-items: center; gap: 15px !important; }
    .inv-card { width: 100% !important; box-sizing: border-box; }
}