/* ═══════════════════════════════════════════════════════════════════════════
   VEILWALKERS II - PREMIUM THEME (The "Trophy" Look)
   Style: Glassmorphism, Neon Accents, Crisp Typography
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&family=JetBrains+Mono:wght@400;700&display=swap');

:root {
    --glass-bg: rgba(13, 17, 23, 0.75);
    --glass-border: rgba(255, 255, 255, 0.12);
    --glass-highlight: rgba(255, 255, 255, 0.05);
    --accent-gold: #fbbf24;
    --accent-danger: #ef4444;
    --accent-magic: #8b5cf6;
    --font-ui: 'Inter', system-ui, sans-serif;
    --font-code: 'JetBrains Mono', monospace;
}

body {
    margin: 0;
    overflow: hidden;
    background: #050914;
    font-family: var(--font-ui);
    color: white;
    user-select: none;
    -webkit-user-select: none;
}

#canvas-container {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at center, #1a1f2e 0%, #050914 100%); /* Placeholder bg */
}

/* ═══════════════════════════════════════════════════════════════════════════
   LOADING SCREEN (The Entrance)
   ═══════════════════════════════════════════════════════════════════════════ */
#loading-screen {
    position: fixed;
    inset: 0;
    background: #050914;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(20px);
}
#loading-screen.active { pointer-events: auto; }
#loading-screen:not(.active) { opacity: 0; pointer-events: none; }

.loader {
    width: 48px; height: 48px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-gold);
    border-radius: 50%;
    animation: spin 0.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.2);
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-text {
    margin-top: 24px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: var(--font-code);
}

/* ═══════════════════════════════════════════════════════════════════════════
   SURVIVOR HUD (Tactical, Clean)
   ═══════════════════════════════════════════════════════════════════════════ */
#hud-top {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 20px;
    padding-top: max(20px, env(safe-area-inset-top));
    display: flex;
    justify-content: space-between;
    pointer-events: none;
}

#stat-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 160px;
    background: var(--glass-bg);
    padding: 12px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.stat-bar-group { display: flex; align-items: center; gap: 10px; }
.stat-icon { font-size: 14px; width: 16px; text-align: center; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5)); }
.bar-track { flex: 1; height: 6px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; transition: width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); border-radius: 3px; }

#time-display {
    background: var(--glass-bg);
    padding: 8px 16px;
    border-radius: 99px;
    display: flex;
    gap: 10px;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #e2e8f0;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    height: fit-content;
}

/* ═══════════════════════════════════════════════════════════════════════════
   ARCHITECT UI (Divine Cockpit)
   ═══════════════════════════════════════════════════════════════════════════ */
#architect-bottom-bar {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    pointer-events: auto;
    background: var(--glass-bg);
    padding: 12px 24px;
    border-radius: 24px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
    transition: transform 0.3s;
}

.spell-btn {
    width: 64px; height: 64px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.spell-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.spell-btn:active { transform: translateY(-1px) scale(0.96); }

.spell-btn.active {
    border-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.15);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.25);
}

.spell-btn .label {
    position: absolute;
    bottom: -22px;
    font-size: 10px;
    width: 160%;
    left: -30%;
    text-align: center;
    opacity: 0.7;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-family: var(--font-ui);
    pointer-events: none;
    transition: opacity 0.2s;
}
.spell-btn:hover .label { opacity: 1; color: var(--accent-gold); }

/* Invite Button (Architect Only) */
#invite-btn {
    position: absolute;
    top: 90px; right: 20px;
    width: 44px; height: 44px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.2s;
    z-index: 200;
}
#invite-btn:hover { background: rgba(255,255,255,0.1); transform: scale(1.05); }
#invite-btn:active { transform: scale(0.95); }

/* ═══════════════════════════════════════════════════════════════════════════
   SURVIVOR CONTROLS (Mobile)
   ═══════════════════════════════════════════════════════════════════════════ */
#mobile-controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 20;
}

#joystick-base {
    position: absolute;
    bottom: 40px; left: 40px;
    width: 140px; height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 70%);
    border: 2px solid rgba(255,255,255,0.1);
    pointer-events: auto;
    backdrop-filter: blur(4px);
}

#joystick-knob {
    width: 60px; height: 60px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    position: absolute;
    top: 50%; left: 50%;
    margin: -30px 0 0 -30px;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

#mobile-action-btns {
    position: absolute;
    bottom: 50px; right: 40px;
    display: flex;
    gap: 24px;
    pointer-events: auto;
}

.mobile-btn {
    width: 72px; height: 72px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.1);
    color: white;
    font-size: 28px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    transition: transform 0.1s;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}
.mobile-btn:active { background: rgba(255,255,255,0.25); transform: scale(0.92); }

#btn-action { background: linear-gradient(135deg, rgba(245, 158, 11, 0.4), rgba(245, 158, 11, 0.1)); border-color: rgba(245, 158, 11, 0.3); }
#btn-jump { background: linear-gradient(135deg, rgba(59, 130, 246, 0.4), rgba(59, 130, 246, 0.1)); border-color: rgba(59, 130, 246, 0.3); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOAST & HOTBAR
   ═══════════════════════════════════════════════════════════════════════════ */
#hotbar-container {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}
#hotbar {
    display: flex;
    gap: 10px;
    background: var(--glass-bg);
    padding: 8px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    pointer-events: auto;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.hotbar-slot {
    width: 52px; height: 52px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}
.hotbar-slot:hover { background: rgba(255,255,255,0.08); }
.hotbar-slot.active {
    border-color: var(--accent-gold);
    background: rgba(251, 191, 36, 0.1);
    box-shadow: inset 0 0 12px rgba(251, 191, 36, 0.1);
    transform: translateY(-2px);
}
.hotbar-count {
    position: absolute;
    bottom: 2px; right: 4px;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    font-family: var(--font-code);
    text-shadow: 0 1px 2px black;
}

#toast {
    position: fixed;
    top: 100px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 23, 42, 0.9);
    padding: 12px 24px;
    border-radius: 99px;
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.5px;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.success { border-color: #22c55e; color: #22c55e; background: rgba(6, 30, 15, 0.95); }
#toast.error { border-color: #ef4444; color: #ef4444; background: rgba(30, 10, 10, 0.95); }
