/* assets/css/style.css - Desktop First Responsive Dark Fantasy RPG Styles */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;900&family=Press+Start+2P&family=Outfit:wght@400;500;600;700&display=swap');

:root {
    --bg-dark: #0a0b10;
    --bg-panel: #131722;
    --bg-panel-alt: #1a202e;
    --border-color: #2e384d;
    --border-gold: #c69214;
    --primary-gold: #fbbf24;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-green: #22c55e;
    --accent-purple: #8b5cf6;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --font-heading: 'Cinzel', serif;
    --font-retro: 'Press Start 2P', monospace;
    --font-body: 'Outfit', sans-serif;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 8px 10px -6px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 20px rgba(251, 191, 36, 0.25);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: radial-gradient(circle at 50% 20%, #171d2b, var(--bg-dark));
    color: var(--text-main);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ======================================================== */
/* TOP NAVIGATION & HUD BAR */
/* ======================================================== */
.top-navbar {
    background: rgba(19, 23, 34, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid var(--border-color);
    padding: 10px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1280px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}

.brand-crystal {
    font-size: 1.4rem;
    animation: crystalFloat 2.5s infinite ease-in-out;
}

@keyframes crystalFloat {
    0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 4px #f59e0b); }
    50% { transform: translateY(-4px); filter: drop-shadow(0 0 10px #ef4444); }
}

.nav-hud {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(10, 11, 16, 0.8);
    padding: 6px 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.hud-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.hud-stat-item strong {
    color: var(--primary-gold);
}

.bar-wrapper {
    width: 90px;
    height: 10px;
    background: #242b3b;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.bar-fill.hp { background: linear-gradient(90deg, #ef4444, #22c55e); }
.bar-fill.mp { background: linear-gradient(90deg, #2563eb, #60a5fa); }
.bar-fill.exp { background: linear-gradient(90deg, #d97706, #fbbf24); }

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ======================================================== */
/* BUTTONS & CONTROLS */
/* ======================================================== */
.game-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.game-btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(180deg, #2563eb, #1d4ed8);
    color: #ffffff;
    border-color: #3b82f6;
}
.btn-primary:hover {
    background: linear-gradient(180deg, #3b82f6, #1d4ed8);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.btn-secondary {
    background: #1e2638;
    color: #e2e8f0;
    border-color: #334155;
}
.btn-secondary:hover {
    background: #273147;
    border-color: #475569;
}

.btn-success {
    background: linear-gradient(180deg, #16a34a, #15803d);
    color: #ffffff;
    border-color: #22c55e;
}
.btn-success:hover {
    box-shadow: 0 0 15px rgba(34, 197, 94, 0.4);
}

.btn-warning {
    background: linear-gradient(180deg, #d97706, #b45309);
    color: #ffffff;
    border-color: #f59e0b;
}

.btn-danger {
    background: linear-gradient(180deg, #dc2626, #b91c1c);
    color: #ffffff;
    border-color: #ef4444;
}
.btn-danger:hover {
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 5px 10px;
    font-size: 0.8rem;
}

/* ======================================================== */
/* MAIN GAME CONTAINER */
/* ======================================================== */
.main-wrapper {
    flex: 1;
    max-width: 1280px;
    width: 100%;
    margin: 16px auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
}

/* Quest Tracker Banner */
.quest-banner {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.85), rgba(15, 23, 42, 0.95));
    border-left: 4px solid var(--primary-gold);
    border-radius: var(--radius-sm);
    padding: 8px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.quest-title {
    font-weight: 700;
    color: var(--primary-gold);
    display: flex;
    align-items: center;
    gap: 6px;
}

.quest-desc {
    color: #cbd5e1;
    font-size: 0.9rem;
}

/* ======================================================== */
/* WORLD EXPLORATION SCREEN */
/* ======================================================== */
.world-container {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.world-header {
    background: rgba(10, 11, 16, 0.7);
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.area-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: var(--primary-gold);
}

.world-stage-box {
    position: relative;
    height: 360px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 24px;
    background-size: cover;
    background-position: center;
    transition: background 0.5s ease;
}

/* Stage Area Themes */
.bg-desa {
    background: linear-gradient(180deg, #1e3a8a 0%, #064e3b 50%, #14532d 100%);
    box-shadow: inset 0 0 60px rgba(0,0,0,0.8);
}
.bg-hutan {
    background: linear-gradient(180deg, #090e17 0%, #064e3b 40%, #022c22 100%);
    box-shadow: inset 0 0 80px rgba(0,0,0,0.9);
}
.bg-kastil {
    background: linear-gradient(180deg, #2e1065 0%, #450a0a 60%, #180505 100%);
    box-shadow: inset 0 0 100px rgba(0,0,0,0.95);
}

.world-scenery-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.7) 100%);
}

.world-hero-avatar {
    width: 140px;
    height: 140px;
    z-index: 5;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.8));
    animation: heroIdle 3s ease-in-out infinite;
}

@keyframes heroIdle {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.world-actions-panel {
    background: #0f131c;
    padding: 20px;
    border-top: 2px solid var(--border-color);
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.action-full-span {
    grid-column: 1 / -1;
    font-size: 1.05rem;
    padding: 12px 20px;
}

/* ======================================================== */
/* AUTHENTICATION VIEW */
/* ======================================================== */
.auth-box {
    max-width: 440px;
    margin: 40px auto;
    background: var(--bg-panel);
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card), var(--shadow-glow);
    padding: 32px 24px;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    color: var(--primary-gold);
    margin-bottom: 6px;
}

.auth-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.auth-tab-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.auth-tab-btn.active {
    color: var(--primary-gold);
    border-bottom-color: var(--primary-gold);
}

.auth-form-group {
    margin-bottom: 16px;
}

.auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #cbd5e1;
}

.auth-input {
    width: 100%;
    background: #0a0c13;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: #ffffff;
    padding: 10px 14px;
    font-size: 0.95rem;
    outline: none;
    transition: border 0.2s ease;
}

.auth-input:focus {
    border-color: var(--primary-gold);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

/* ======================================================== */
/* MODALS */
/* ======================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-card {
    background: var(--bg-panel);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    width: 100%;
    max-width: 580px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    background: rgba(10, 11, 16, 0.9);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-family: var(--font-heading);
    color: var(--primary-gold);
    font-size: 1.25rem;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
}

.modal-close-btn:hover {
    color: var(--accent-red);
}

.modal-body {
    padding: 20px;
    flex: 1;
}

/* Character & Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.stat-box {
    background: #0a0d14;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
}

.stat-box .label { color: var(--text-muted); }
.stat-box .val { font-weight: 700; color: var(--primary-gold); }

/* Inventory item list in modal */
.inventory-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.inventory-item-card {
    background: #0d111a;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.inv-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.inv-icon {
    font-size: 1.6rem;
}

/* Shop Modal */
.shop-item-row {
    background: #0e131d;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.shop-item-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-item-icon {
    font-size: 1.6rem;
}

.shop-item-action {
    display: flex;
    align-items: center;
    gap: 12px;
}

.shop-price {
    font-weight: 700;
    color: var(--primary-gold);
}

/* Dialogue Box */
.dialogue-box {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.dialogue-avatar {
    font-size: 3rem;
    background: #0a0d14;
    border: 2px solid var(--border-gold);
    border-radius: var(--radius-md);
    padding: 8px 12px;
}

.dialogue-content {
    flex: 1;
    background: #0a0d14;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Save Slots */
.slot-card {
    background: #0e131d;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slot-btn-group {
    display: flex;
    gap: 8px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
    max-width: 360px;
}

.toast-item {
    background: #1e2638;
    border-left: 4px solid var(--primary-gold);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    box-shadow: 0 8px 20px rgba(0,0,0,0.6);
    font-size: 0.9rem;
    animation: toastSlideIn 0.3s ease;
    transition: opacity 0.4s ease;
}

.toast-success { border-left-color: var(--accent-green); }
.toast-danger { border-left-color: var(--accent-red); }
.toast-warning { border-left-color: var(--primary-gold); }

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.toast-item.fade-out {
    opacity: 0;
}

/* Helpers */
.hidden { display: none !important; }
.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.8rem; }
.text-center { text-align: center; }

/* ======================================================== */
/* MOBILE FRIENDLY RESPONSIVENESS */
/* ======================================================== */
@media (max-width: 900px) {
    .nav-container {
        flex-wrap: wrap;
    }
    .nav-hud {
        order: 3;
        width: 100%;
        justify-content: space-around;
        padding: 8px;
    }
}

@media (max-width: 640px) {
    .nav-brand span {
        display: none;
    }
    .hud-stat-item .label-full {
        display: none;
    }
    .world-stage-box {
        height: 260px;
    }
    .world-hero-avatar {
        width: 100px;
        height: 100px;
    }
    .action-grid {
        grid-template-columns: 1fr;
    }
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}
