/* =========================================
   STYLE.CSS - CORE & INDEX PAGE STYLES
   ========================================= */

/* ===== VARIABLES ===== */
:root {
    --c-bg: #050505;
    --c-panel: #0a0a0a; 
    --c-accent: #5a5238; 
    --c-gold: #cbb26a;    
    --c-text: #dcd6c5;
    --c-sub: #8a8575;
    
    --slot-frame-outer: #2a2a2a;
    --slot-frame-mid: #444;
    --slot-frame-inner: #111;

    --font-head: 'Cinzel', serif;
    --font-body: 'Lato', sans-serif;
    
    --shadow-panel: 0 4px 20px rgba(0,0,0,0.8);
}

/* ===== GLOBAL RESET ===== */
* { box-sizing: border-box; }

body {
    margin: 0; padding: 0;
    font-family: var(--font-body);
    background-color: var(--c-bg);
    background-image: url("https://www.transparenttextures.com/patterns/dark-leather.png");
    color: var(--c-text);
    min-height: 100vh;
    display: flex; flex-direction: column;
}

/* =========================================
   MODERN OBSIDIAN NAVBAR
   ========================================= */

.app-header {
    width: 100%;
    height: 70px;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(203, 178, 106, 0.15);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 5000;
}

/* --- LOGO AREA --- */
.logo-area a {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.2s;
}

.logo-area a:hover {
    transform: scale(1.02);
}

.logo-icon {
    font-size: 24px;
    /* Static Metallic Gold Look */
    filter: sepia(1) saturate(0.5) hue-rotate(5deg) drop-shadow(0 0 2px rgba(0,0,0,0.8));
}

.logo-text {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(to bottom, #fff 40%, #cbb26a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* --- USER NAV AREA --- */
.user-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.token-display {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 16px;
    border-radius: 50px;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: #ffd700;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.5);
}

.currency-icon {
    font-size: 16px;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.4));
}

.nav-link {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
    background: none;
    border: none;
    cursor: pointer;
}

.nav-link:hover { color: #fff; }
.logout-link:hover { color: #ff5f5f; }

.btn-nav-cta {
    padding: 8px 24px;
    background: linear-gradient(to bottom, #cbb26a, #8f7b3e);
    border: 1px solid #cbb26a;
    border-radius: 4px;
    color: #12100b;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.btn-nav-cta:hover {
    background: linear-gradient(to bottom, #e6d3a3, #b09955);
    box-shadow: 0 0 15px rgba(203, 178, 106, 0.3);
    transform: translateY(-1px);
}

/* Mobile Nav */
@media (max-width: 600px) {
    .app-header { padding: 0 15px; height: 60px; }
    .logo-text { font-size: 18px; }
    .logo-icon { font-size: 20px; }
    .user-nav { gap: 10px; }
    .token-display { padding: 4px 10px; font-size: 12px; }
    .btn-nav-cta { padding: 6px 14px; font-size: 11px; }
    .nav-link { font-size: 11px; }
}

/* ===== BUTTONS (SHARED) ===== */
button, .nav-btn {
    padding: 8px 18px; font-family: var(--font-head); font-weight: 700;
    text-transform: uppercase; font-size: 13px; letter-spacing: 1px;
    background: #1a1a1a;
    color: #ccc; border: 1px solid #444; border-radius: 4px;
    cursor: pointer; text-decoration: none; display: inline-block;
    transition: all 0.2s; box-shadow: 0 2px 5px rgba(0,0,0,0.5);
}
button:hover, .nav-btn:hover { 
    background: #252525; border-color: #666; color: #fff;
    transform: translateY(-1px);
}

.btn-cta { 
    background: linear-gradient(to bottom, #5a2e88, #341852); 
    border-color: #784ba0; 
    color: #fff;
}
.btn-cta:hover { 
    background: linear-gradient(to bottom, #6a369e, #431f69); 
}

.btn-refresh-stone {
    background: rgba(20, 19, 17, 0.9); border: 1px solid rgba(255, 255, 255, 0.12); color: #aaa;
    display: inline-flex !important; flex-direction: row !important; align-items: center !important; justify-content: center; gap: 10px;
    padding: 10px 18px; border-radius: 4px; cursor: pointer; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-head); text-transform: uppercase; font-size: 12px; font-weight: bold; letter-spacing: 1.5px; line-height: normal;
    box-shadow: inset 0 1px 3px rgba(255,255,255,0.05), 0 4px 10px rgba(0,0,0,0.5);
}
.btn-refresh-stone:hover { color: #fff; background: rgba(255, 255, 255, 0.05); border-color: rgba(255, 255, 255, 0.3); box-shadow: 0 4px 15px rgba(0,0,0,0.6), inset 0 0 10px rgba(0,0,0,0.5); transform: translateY(-1px); }

/* ===== MAIN CONTENT WRAPPER ===== */
.main-content {
    flex: 1; width: 100%; max-width: 900px; margin: 0 auto;
    padding: 30px 20px; display: flex; flex-direction: column; gap: 30px;
    overflow: visible !important; 
}

/* ===== RPG PANELS ===== */
.rpg-panel, .hiscore-content, .menu-panel {
    background-color: #0a0a0a;
    border: 1px solid #333; 
    border-radius: 8px; 
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
    position: relative;
    box-shadow: inset 0 0 60px rgba(0,0,0,0.2); 
}

.rpg-panel::before, .rpg-panel::after { content: none; }

.section-title { 
    font-family: var(--font-head); color: #888; text-align: center;
    border-bottom: 1px solid #222; padding-bottom: 12px; margin-bottom: 25px; 
    font-size: 14px; letter-spacing: 3px; text-transform: uppercase;
    display: flex; align-items: center; justify-content: center; gap: 15px;
}
.section-title::before, .section-title::after { content: "❖"; color: #333; font-size: 10px; }

/* ===== FOOTER ===== */
.app-footer {
    margin-top: auto; padding: 20px; background: #050505; border-top: 1px solid #222;
    text-align: center; font-size: 11px; color: #444; letter-spacing: 1px;
}

/* ===== MODALS ===== */
.modal-overlay { 
    position: fixed; top: 0; left: 0; right: 0; bottom: 0; 
    background-color: rgba(0, 0, 0, 0.85); backdrop-filter: blur(5px); 
    z-index: 9999; display: flex; align-items: center; justify-content: center; 
}
.modal-hidden { display: none !important; }
.modal-visible { display: flex !important; }

.modal-box { 
    background: #0f0f0f; border: 1px solid #333; 
    padding: 40px 30px; border-radius: 8px; width: 90%; max-width: 500px; 
    box-shadow: 0 20px 60px rgba(0,0,0,0.9); position: relative; text-align: center; 
    animation: scaleIn 0.3s ease; 
}
@keyframes scaleIn { from {transform: scale(0.95); opacity: 0;} to {transform: scale(1); opacity: 1;} }

.close-modal-btn { position: absolute; top: 15px; right: 15px; font-size: 24px; cursor: pointer; color: #555; }
.close-modal-btn:hover { color: #fff; }

.tooltip { 
    position: absolute; background: rgba(10, 10, 10, 0.95); 
    border: 1px solid var(--c-gold); color: #fff; padding: 8px 12px; 
    border-radius: 4px; pointer-events: none; z-index: 10000; font-size: 12px; display: none; white-space: nowrap; 
}

/* --- THE ARTIFACT (SEARCH BAR) --- */
.input-artifact {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 550px;
    height: 60px;
    margin: 0 auto;
    background: #0a0a0a;
    border: 1px solid #444;
    border-radius: 50px;
    padding: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.input-artifact:focus-within {
    border-color: #cbb26a;
    background: #000;
    box-shadow: 0 10px 40px rgba(203, 178, 106, 0.15), inset 0 0 0 1px rgba(203, 178, 106, 0.2);
    transform: translateY(-2px);
}

.artifact-icon {
    width: 50px; 
    height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #666;
    padding-left: 10px;
}

.input-artifact input {
    flex: 1;
    height: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    font-family: 'Lato', sans-serif;
    outline: none;
    padding: 0 10px;
    /* FIX: Force sharp text */
    text-shadow: none; 
    -webkit-font-smoothing: antialiased;
}

.input-artifact input::placeholder {
    color: #555;
    font-style: italic;
    text-shadow: none;
}

.input-artifact button {
    height: 100%;
    border-radius: 40px;
    padding: 0 35px;
    background: linear-gradient(to bottom, #cbb26a, #8f7b3e);
    color: #12100b;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid #cbb26a;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: all 0.2s;
    white-space: nowrap;
    
    /* FIX: Remove blurry text shadow and ensure crispness */
    text-shadow: none !important;
    -webkit-font-smoothing: antialiased; 
    -moz-osx-font-smoothing: grayscale;
}

.input-artifact button:hover {
    background: linear-gradient(to bottom, #e6d3a3, #b09955);
    color: #000;
    box-shadow: 0 0 20px rgba(203, 178, 106, 0.4);
}
/* =========================================
   PROFILE HEADER (PRESERVED LAYOUT)
   ========================================= */

.unified-identity-panel { padding: 0 !important; overflow: hidden; }

.nested-profile-header {
    width: 100%;
    background: linear-gradient(90deg, rgba(90, 82, 56, 0.15) 0%, rgba(17, 16, 14, 0.4) 50%, rgba(90, 82, 56, 0.1) 100%);
    padding: 30px;
    border-bottom: 1px solid rgba(203, 178, 106, 0.1);
    position: relative;
    margin-bottom: 1rem;
    animation: fadeIn 0.5s ease-out;
}

/* --- STATUS BADGE (PRESERVED) --- */
.status-indicator {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border-radius: 4px;
    opacity: .6;
}

.status-text {
    font-size: 10px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-dot {
    width: 6px;
    height: 6px;
    background: #4fa84f;
    border-radius: 50%;
    box-shadow: 0 0 5px #4fa84f;
}

.header-flex-container { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.nested-auth-row { display: flex; align-items: flex-start !important; gap: 20px; }
.auth-accent-bar { width: 4px; height: auto !important; min-height: 40px; background: linear-gradient(to bottom, #cbb26a, #5a5238); box-shadow: 0 0 15px rgba(203, 178, 106, 0.3); align-self: stretch !important; }
.auth-text-stack { display: flex; flex-direction: column; justify-content: flex-start !important; margin-top: 2px !important; }
.auth-player-name {
    font-family: var(--font-head); font-size: 38px; margin: 0; color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    background: linear-gradient(to bottom, #fff, #cbb26a); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.header-right-info { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.header-action-row { margin-top: 12px; display: flex; justify-content: flex-end; }

/* Title Shelf */
#titlePickerContainer {
    position: static !important; top: auto !important; left: auto !important;
    display: none; flex-direction: row !important; align-items: center; justify-content: flex-start; gap: 6px !important;
    margin: 0 !important; margin-top: 8px !important; padding: 0 !important;
    flex: 1; min-width: 0; width: 100%; overflow-x: auto; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none;
}
#titlePickerContainer::-webkit-scrollbar { display: none; }

/* Badge Styling */
.title-badge { flex: 0 0 24px !important; width: 24px !important; height: 24px !important; display: flex; align-items: center; justify-content: center; background: #0D0D09; border: 1px solid #3d3522; border-radius: 3px; cursor: pointer; font-family: 'Cinzel', serif; font-size: 10px !important; color: #8a8575; transition: all 0.2s ease; box-shadow: inset 0 2px 4px rgba(0,0,0,0.8); position: relative; }
.title-badge.active { border-color: #cbb26a; background: #0D0D09; color: #fff; box-shadow: 0 0 10px rgba(203, 178, 106, 0.2); }
.badge-rare.active { border-color: #4facfe; box-shadow: 0 0 12px rgba(79, 172, 254, 0.4); }
.badge-epic.active { border-color: #bf5af2; box-shadow: 0 0 12px rgba(191, 90, 242, 0.4); }
.badge-legendary.active { border-color: #ff9f0a; box-shadow: 0 0 15px rgba(255, 159, 10, 0.5); }
.title-badge:hover::after { content: attr(data-title); position: absolute; top: 130%; left: 50%; transform: translateX(-50%); background: rgba(8, 8, 8, 0.95); color: #cbb26a; padding: 4px 8px; border: 1px solid #3d3522; font-size: 10px; text-transform: uppercase; white-space: nowrap; z-index: 100; pointer-events: none; }

/* MOBILE FIX FOR HEADER */
@media (max-width: 768px) {
    .header-flex-container { flex-direction: column; align-items: flex-start; gap: 15px; }
    .header-right-info { width: 100%; flex-direction: row; justify-content: space-between; align-items: center; margin-top: 5px; }
    #refreshBtn.btn-refresh-stone { margin-top: 0 !important; }
    #titlePickerContainer { width: 100%; }
}

/* =========================================
   LEVEL & XP SECTION
   ========================================= */

.app-level-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    background: #080808;
    border-top: 1px solid #333;
    margin-top: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.8);
}

.level-badge {
    font-family: 'Cinzel', serif;
    font-weight: bold;
    font-size: 1.2rem;
    color: #f1d592;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

#userLevel { color: #fff; font-size: 1.4rem; }

.xp-text {
    font-family: 'monospace';
    font-size: 0.9rem;
    color: #cbb26a;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px #000;
}

#currentXP { color: #e6d3a3; font-weight: bold; }
#nextLevelXP { opacity: 0.8; }

.xp-bar-outer {
    width: 100%;
    height: 14px;
    background: #000;
    border: 1px solid #444;
    border-radius: 7px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #8a6d3b 0%, #cbb26a 50%, #f1d592 100%);
    box-shadow: 0 0 12px rgba(203, 178, 106, 0.6);
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

#xpBarFill {
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(90deg, #cbb26a 0%, #e6d3a3 50%, #cbb26a 100%);
    background-size: 200% auto;
}

/* =========================================
   GAME ELEMENTS
   ========================================= */

.slots-panel { 
    background-color: #0c0b0a; 
    border-top: 1px solid #333; 
}
.slot-grid { display: flex; justify-content: center; gap: 25px; }

.slot {
    width: 140px; height: 140px; background: #111;
    border: 1px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);      
    border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
    position: relative; cursor: pointer; transition: all 0.2s ease; margin: 6px; 
}
.slot:hover { 
    transform: translateY(-5px); 
    border-color: #555;
    background: #161616;
}

.slot img { width: 64px; height: 64px; object-fit: contain; filter: drop-shadow(0 5px 10px #000); transition: transform 0.3s ease; opacity: 0.9; }
.slot:hover img { transform: scale(1.15); opacity: 1; }

.slot.rarity-common { border-bottom: 3px solid #555; }
.slot.rarity-uncommon { border-bottom: 3px solid #4fa84f; }
.slot.rarity-rare { border-bottom: 3px solid #4facfe; }
.slot.rarity-epic { border-bottom: 3px solid #bf5af2; }
.slot.rarity-legendary { border-bottom: 3px solid #ff9f0a; }

.slot-name { font-size: 13px; font-weight: bold; color: var(--c-gold); margin-top: 10px; text-align: center; letter-spacing: 0.5px; }
.slot-text { font-size: 11px; color: #666; text-align: center; }
.slot-level { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.9); border: 1px solid #333; font-size: 10px; padding: 2px 5px; border-radius: 2px; color: #00bcd4; }

.btn-reroll {
    display: flex; align-items: center; gap: 10px; padding: 10px 20px;
    background: linear-gradient(to bottom, #2a2a2a, #1a1a1a); 
    border: 1px solid #444;
    color: #ccc; font-size: 14px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); transition: all 0.2s;
    border-radius: 4px;
}
.btn-reroll:hover {
    background: #333; border-color: #cbb26a; color: #fff;
    transform: translateY(-2px);
}
.cost-badge {
    background: rgba(0,0,0,0.4); padding: 2px 6px; border-radius: 4px;
    font-size: 12px; color: #ffd700; font-family: monospace; border: 1px solid rgba(255, 215, 0, 0.3);
}

/* PANEL 3: QUEST LOG */
#challengesWrapper { background: #0e0e0e; }
#challengesWrapper {
    scroll-margin-top: 120px; 
}
   #achievementsWrapper {
        scroll-margin-top: 0px;
    }

    /* The Glow Effect */
    .accepted-challenge-glow {
        position: relative !important;
        z-index: 10 !important;
        outline: 2px solid #cbb26a !important;
        outline-offset: 2px;
        animation: gold-pulse-card 2.5s ease-out !important;
    }

    @keyframes gold-pulse-card {
        0% { 
            transform: scale(1); 
            box-shadow: 0 0 0px transparent;
        }
        20% { 
            transform: scale(1.04); 
            box-shadow: 0 0 30px rgba(203, 178, 106, 0.8);
            background-color: rgba(203, 178, 106, 0.1) !important;
        }
        100% { 
            transform: scale(1); 
            box-shadow: 0 0 0px transparent;
        }
    }
#challengeList, #challengeHistory { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

.challenge, .challenge_complete {
    width: 130px; background: #161616; border: 1px solid #333; border-radius: 4px; padding: 10px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); font-size: 12px; position: relative;
}
.challenge img, .challenge_complete img { width: 32px; height: 32px; margin-bottom: 5px; filter: drop-shadow(0 2px 2px #000); }
.challenge_complete { opacity: 0.6; }
.progress-bar { width: 100%; height: 4px; background: #000; border-radius: 2px; margin-top: 6px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--c-gold); width: 0%; transition: width 0.5s; }

/* ===== HISCORES SECTION ===== */
.hiscores-panel { background-color: #0c0b0a; }
.hiscores-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 4px; padding: 8px; background: #080808; border-radius: 4px; border: 1px solid #222; }
.skill-cell { display: flex; align-items: center; justify-content: space-between; background: #161616; border: 1px solid #2a2a2a; padding: 4px 8px; border-radius: 2px; transition: background 0.2s; }
.skill-cell:hover { background: #222; }
.skill-icon-small { width: 18px; height: 18px; }
.skill-val { color: #ffd966; font-family: monospace; font-size: 13px; font-weight: bold; }
.hiscores-footer { display: flex; justify-content: space-around; background: #111; padding: 8px; margin-top: 5px; border-top: 1px solid #333; font-family: var(--font-head); font-size: 13px; color: #888; }
.hs-total b, .hs-combat b { color: #fff; margin-left: 5px; }

/* =========================================
   ACHIEVEMENTS (PRESERVED LAYOUT)
   ========================================= */

.achievements-panel { 
    background: radial-gradient(circle at center, #1a1917 0%, #0e0d0c 100%); 
}

/* GRID: Forces 2 columns on mobile */
.achievement-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr); /* 2 Columns by default */
    gap: 8px; 
}

/* CARD: Vertical Layout for Mobile (Icon Top, Text Bottom) */
.achievement-card { 
    background: #181818; 
    padding: 10px; 
    border-radius: 4px; 
    display: flex; 
    flex-direction: column; /* Stack vertical */
    align-items: center;    /* Center content */
    text-align: center;     /* Center text */
    gap: 8px; 
    position: relative; 
    overflow: hidden; 
    border: 1px solid #333; 
    transition: transform 0.2s; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); 
    min-height: 110px; /* Ensure uniform height */
}

.achievement-card:hover { 
    transform: translateY(-2px); 
    background: #1e1e1e; 
}

/* ICON: Slightly smaller on mobile */
.ach-icon { 
    width: 34px; height: 34px; 
    display: flex; align-items: center; justify-content: center; 
    border-radius: 3px; font-size: 18px; flex-shrink: 0; 
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8); 
    text-shadow: 0 2px 2px rgba(0,0,0,0.8); 
}

.ach-info { 
    display: flex; flex-direction: column; 
    width: 100%;
}

.ach-title { 
    font-weight: bold; font-family: var(--font-head); 
    font-size: 11px; margin-bottom: 3px; letter-spacing: 0.5px; 
    color: #ddd;
}

.ach-desc { 
    font-size: 10px; color: #777; line-height: 1.3; 
}

/* TIER COLORS */
.ach-bronze { border-top: 3px solid #8d6e63; } /* Border Top on mobile looks better */
.ach-bronze .ach-icon { background: #3e2723; border: 1px solid #8d6e63; color: #d7ccc8; }
.ach-bronze .ach-title { color: #a1887f; }

.ach-silver { border-top: 3px solid #78909c; }
.ach-silver .ach-icon { background: #263238; border: 1px solid #78909c; color: #eceff1; }
.ach-silver .ach-title { color: #b0bec5; }

.ach-gold { border: 1px solid #5a5238; border-top: 3px solid #ffd700; background: linear-gradient(to bottom, #1a1814, #181818); }
.ach-gold .ach-icon { background: #252015; border: 1px solid #ffd700; color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.1); }
.ach-gold .ach-title { color: #f0e68c; }

/* LOCKED STATE */
.achievement-card.locked { opacity: 0.4; filter: grayscale(1); border-color: #333 !important; }
.achievement-card.locked .ach-icon { background: #111 !important; color: #555 !important; border-color: #333 !important; box-shadow: none; }
.achievement-card.locked:hover { transform: none; background: #181818; }

/* =========================================
   DESKTOP OVERRIDES (Width > 600px)
   ========================================= */
@media (min-width: 600px) {
    .achievement-grid { 
        /* Switch to auto-fit rows for wider screens */
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); 
        gap: 15px; 
    }

    .achievement-card { 
        flex-direction: row; /* Side-by-side */
        text-align: left;    /* Left align */
        padding: 15px; 
        gap: 15px; 
        min-height: auto;
    }

    .ach-icon { width: 40px; height: 40px; font-size: 20px; }
    .ach-title { font-size: 13px; }
    .ach-desc { font-size: 11px; }

    /* Switch borders back to left side for desktop list view */
    .ach-bronze { border-top: 1px solid #333; border-left: 3px solid #8d6e63; }
    .ach-silver { border-top: 1px solid #333; border-left: 3px solid #78909c; }
    .ach-gold   { border-top: 1px solid #5a5238; border-left: 3px solid #ffd700; background: linear-gradient(to right, #1a1814, #181818); }
}

.header-action-row { width: 100%; margin-top: 1rem; }
    #refreshBtn { width: 100%; }

/* =========================================
   VERIFICATION CARD (PRESERVED)
   ========================================= */
.verification-card { display: flex; align-items: center; justify-content: center; gap: 20px; background: rgba(20, 20, 20, 0.9); border: 1px solid var(--c-gold); border-left: 4px solid var(--c-gold); padding: 15px 25px; margin: 15px auto; max-width: 90%; border-radius: 4px; box-shadow: 0 4px 15px rgba(0,0,0,0.8); animation: slideIn 0.3s ease-out; }
@keyframes slideIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.vc-icon img { width: 48px; height: 48px; object-fit: contain; filter: drop-shadow(0 0 8px rgba(255, 217, 102, 0.3)); display: block; }
.vc-content { display: flex; flex-direction: column; text-align: center; }
.vc-title { font-family: var(--font-head); color: var(--c-gold); font-size: 15px; text-transform: uppercase; letter-spacing: 1px; font-weight: bold; }
.vc-desc { font-size: 13px; color: #e0e0e0; line-height: 1.4; margin-bottom: 4px; }
.vc-skill { color: #fff; font-weight: bold; text-decoration: underline; text-decoration-color: var(--c-accent); }
.vc-footer { font-size: 11px; color: #888; padding-top: 4px; border-top: 1px solid #333; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; }
.vc-timer { color: #4fa84f; font-weight: bold; font-family: monospace; font-size: 13px; }

/* ===== MISC UI ===== */
.panel-guide-note {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    margin: 20px auto 10px; padding: 10px 20px; max-width: 80%;
    background: rgba(203, 178, 106, 0.05); border: 1px dashed rgba(203, 178, 106, 0.2);
    border-radius: 4px; animation: fadeIn 1s ease-in;
}
.panel-guide-note p { margin: 0; font-size: 12px; color: var(--c-sub); font-style: italic; }
.guide-icon { font-size: 14px; opacity: 0.7; }

/* Onboarding */
.onboarding-hint {
    position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%);
    background: #cbb26a; color: #000; padding: 8px 16px; border-radius: 4px;
    font-family: 'Cinzel', serif; font-size: 0.8rem; font-weight: bold;
    text-align: center; white-space: nowrap; z-index: 1000; pointer-events: none;
    animation: hint-bounce 2s infinite ease-in-out;
}
.onboarding-hint::after {
    content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    border: 8px solid transparent; border-top-color: #cbb26a;
}
@keyframes hint-bounce { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }

/* Vault Panel */
.vault-panel { border: 1px dashed #444; background: rgba(0,0,0,0.2); text-align: center; }
.skill-dropdown { background: #0f0e0d; border: 1px solid #444; color: #ccc; padding: 12px; width: 100%; max-width: 300px; margin: 10px auto; border-radius: 2px; cursor: pointer; position: relative; }
.skill-dropdown .options-container { position: absolute; top: 100%; left: 0; width: 100%; max-height: 200px; overflow-y: auto; background: #111; border: 1px solid #444; z-index: 1000; display: none; box-shadow: 0 5px 15px rgba(0,0,0,0.9); }
.skill-dropdown .options-container.show { display: block; }
.skill-dropdown .option { padding: 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid #222; }
.skill-dropdown .option:hover { background: #222; }
.skill-dropdown img.icon { width: 20px; height: 20px; }


/* =========================================
   AUTH MODAL REDESIGN (Obsidian Theme)
   ========================================= */

/* Modal Box Override */
.auth-modal {
    background: #080808;
    border: 1px solid #333;
    border-top: 3px solid #cbb26a; /* Gold Top Border */
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(203, 178, 106, 0.05);
    max-width: 420px;
    padding: 40px;
    text-align: left; /* Reset text align for better form flow */
}

/* Header Section */
.modal-header {
    text-align: center;
    margin-bottom: 30px;
}

.modal-sigil {
    font-size: 32px;
    margin-bottom: 10px;
    filter: drop-shadow(0 0 10px rgba(203, 178, 106, 0.3));
    animation: floatSigil 3s ease-in-out infinite;
}

.modal-header h2 {
    font-family: 'Cinzel', serif;
    color: #fff;
    font-size: 24px;
    margin: 0 0 5px 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.modal-header p {
    color: #666;
    font-size: 13px;
    margin: 0;
}

/* Input Styling */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: #cbb26a;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 1px;
}

.auth-input {
    width: 100%;
    padding: 14px;
    background: #0f0f0f;
    border: 1px solid #333;
    border-radius: 4px;
    color: #fff;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
    transition: all 0.2s ease;
    outline: none;
}

.auth-input:focus {
    border-color: #cbb26a;
    background: #141414;
    box-shadow: 0 0 15px rgba(203, 178, 106, 0.1);
}

.auth-input::placeholder {
    color: #444;
}

/* Auth Button */
.auth-btn {
    width: 100%;
    padding: 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    margin-top: 10px;
}

.auth-message {
    margin-top: 15px;
    font-size: 12px;
    text-align: center;
    min-height: 18px; /* Prevent layout jump */
}

/* Magic Notice (The Tooltip) */
.magic-notice {
    margin-top: 25px;
    background: rgba(203, 178, 106, 0.05);
    border: 1px dashed rgba(203, 178, 106, 0.2);
    padding: 12px;
    border-radius: 6px;
    display: flex;
    gap: 12px;
    align-items: center;
}

.notice-icon {
    font-size: 20px;
}

.notice-text strong {
    display: block;
    color: #e0dcc8;
    font-size: 12px;
    margin-bottom: 2px;
}

.notice-text p {
    margin: 0;
    font-size: 11px;
    color: #8a8575;
    line-height: 1.4;
}

@keyframes floatSigil {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}/* =========================================
   PORTAL MODAL (LOGIN REDESIGN)
   ========================================= */

/* 1. The Lighter Overlay */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    /* User Requested: Lighter Opacity */
    background-color: rgba(0, 0, 0, 0.5); 
    backdrop-filter: blur(8px); /* Heavy blur does the heavy lifting */
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

/* 2. The Portal Box (Main Container) */
.portal-modal {
    background: #080808;
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    border: 1px solid #333;
    /* Gold accent top */
    border-top: 4px solid #cbb26a; 
    box-shadow: 
        0 20px 50px rgba(0,0,0,0.8), 
        0 0 0 1px rgba(203, 178, 106, 0.1); /* Subtle ring */
    padding: 0; /* Layout handled inside */
    overflow: hidden;
    position: relative;
    transform: translateY(0);
    animation: slideUp 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 3. Close Button */
.portal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    color: #444;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
    line-height: 1;
    z-index: 10;
}
.portal-close:hover {
    color: #fff;
    transform: scale(1.2) rotate(90deg);
}

/* 4. Header Section */
.portal-header {
    background: linear-gradient(to bottom, #111, #080808);
    padding: 40px 30px 20px 30px;
    text-align: center;
    border-bottom: 1px solid #222;
}

.portal-icon {
    font-size: 40px;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(203, 178, 106, 0.3));
}

.portal-header h2 {
    font-family: 'Cinzel', serif;
    color: #fff;
    font-size: 26px;
    margin: 0 0 8px 0;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 4px 10px rgba(0,0,0,0.8);
}

.portal-header p {
    color: #888;
    font-size: 13px;
    margin: 0;
    font-family: 'Lato', sans-serif;
}

/* 5. Body Section */
.portal-body {
    padding: 30px;
}

.portal-step {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.portal-input-group label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: #cbb26a;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    margin-left: 5px;
}

/* Reusing the Artifact Style, but modifying for Full Width */
.input-artifact.full-width {
    width: 100%;
    max-width: none; /* Override the hero max-width */
    height: 55px;
    padding: 0;
    background: #0f0f0f;
}

.input-artifact.full-width input {
    width: 100%;
    padding: 0 20px;
    color: #fff;
}

/* 6. Action Button */
.btn-portal-action {
    width: 100%;
    padding: 16px;
    background: linear-gradient(to bottom, #cbb26a, #8f7b3e);
    border: 1px solid #cbb26a;
    border-radius: 50px; /* Pill shape matches inputs */
    color: #1a1814;
    font-family: 'Cinzel', serif;
    font-weight: 800;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-portal-action:hover {
    background: linear-gradient(to bottom, #e6d3a3, #b09955);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(203, 178, 106, 0.3);
}

.portal-message {
    text-align: center;
    font-size: 13px;
    min-height: 20px;
    color: #ff5f5f; /* Default error color */
    font-weight: bold;
}

/* 7. The Scroll Notice (Help Text) */
.scroll-notice {
    margin-top: 10px;
    background: rgba(203, 178, 106, 0.08);
    border: 1px dashed #5a5238;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.scroll-icon {
    font-size: 24px;
    opacity: 0.8;
}

.scroll-text strong {
    display: block;
    color: #e0dcc8;
    font-size: 12px;
    margin-bottom: 2px;
    font-family: 'Cinzel', serif;
}

.scroll-text p {
    margin: 0;
    font-size: 11px;
    color: #aaa;
    line-height: 1.4;
}

/* =========================================
   TOAST NOTIFICATIONS (Obsidian Style)
   ========================================= */

#toast-container {
    position: fixed;
    top: 90px; /* Starts below the navbar */
    right: 20px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Allows clicking through the empty container */
}

.toast-message {
    background: #0f0f0f; /* Dark background */
    color: #e0dcc8;      /* Off-white text */
    padding: 14px 20px;
    border-radius: 4px;
    border: 1px solid #333;
    border-left: 4px solid #cbb26a; /* Gold accent border */
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    min-width: 260px;
    max-width: 320px;
    pointer-events: auto; /* Re-enable clicks on the toast itself */
    animation: toastSlideIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Error Variation */
.toast-message.toast-error {
    border-left-color: #d32f2f; /* Red accent */
    background: #1a0a0a; /* Slightly red-tinted dark bg */
}

/* Animations */
@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastFadeOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(20px); }
}

/* --- MOBILE RESPONSIVE TOASTS --- */
@media (max-width: 600px) {
    #toast-container {
        top: 20px; /* Higher up on mobile */
        left: 50%;
        transform: translateX(-50%);
        right: auto;
        width: 90%; /* Occupy 90% of screen width */
        max-width: 400px;
        align-items: center;
    }

    .toast-message {
        width: 100%;
        min-width: auto;
        max-width: none;
        justify-content: center;
        text-align: center;
        box-shadow: 0 5px 20px rgba(0,0,0,0.9);
        border-left: 1px solid #cbb26a; /* Full border look on mobile is often cleaner */
        border-top: 3px solid #cbb26a;  /* Move accent to top */
    }
    
    .toast-message.toast-error {
        border-left: 1px solid #d32f2f;
        border-top: 3px solid #d32f2f;
    }
}


/* Mobile Tweak */
@media (max-width: 600px) {
    .portal-modal {
        width: 95%;
        max-width: 95%;
    }
    .portal-header { padding: 30px 20px; }
    .portal-body { padding: 20px; }
}
/* ===== MOBILE TWEAKS (Global) ===== */
@media (max-width: 600px) {
    .btn-reroll { width: 100%; justify-content: center; }
    .slot-grid { gap: 10px; flex-wrap: nowrap; padding-left: 10px; padding-right: 10px;} 
    .slot { width: 30%; height: auto; aspect-ratio: 1/1; padding: 5px; margin: 2px; }
    .slot img { width: 50%; height: 50%; }
    .slot-name { font-size: 10px; }
    .slot-text { display: none; } 
    .reroll-area { padding-left: 15px; padding-right: 15px; }
    #challengeList, #challengeHistory { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
    .challenge, .challenge_complete { width: 100%; font-size: 10px; padding: 5px; }
    .challenge img, .challenge_complete img { width: 24px; height: 24px; }
    .progress-bar { height: 4px; }
    .hiscores-grid { grid-template-columns: repeat(3, 1fr); }
}

/* Title Manager Colors */
#playerActiveTitle { display: block; font-family: var(--font-head); font-size: 10px; text-transform: uppercase; letter-spacing: 3px; margin-bottom: -2px; font-weight: 700; position: relative; display: inline-block; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); }
.title-uncommon { color: var(--c-sub); opacity: 0.8; }
.title-rare { color: #4facfe; text-shadow: 0 0 10px rgba(79, 172, 254, 0.5); }
.title-epic { color: #bf5af2; text-shadow: 0 0 12px rgba(191, 90, 242, 0.6); background: linear-gradient(to right, #bf5af2, #ff2d55); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.title-legendary { color: #ff9f0a; font-weight: 900; letter-spacing: 4px; background: linear-gradient(90deg, #ff9f0a, #ffd60a, #ff9f0a); background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent; animation: titleShine 3s linear infinite; filter: drop-shadow(0 0 5px rgba(255, 159, 10, 0.4)); }
.title-epic::before { content: "[ "; opacity: 0.5; -webkit-text-fill-color: #bf5af2; }
.title-epic::after { content: " ]"; opacity: 0.5; -webkit-text-fill-color: #bf5af2; }
.title-legendary::before { content: "❖ "; -webkit-text-fill-color: #ff9f0a; }
.title-legendary::after { content: " ❖"; -webkit-text-fill-color: #ff9f0a; }
@keyframes titleShine { to { background-position: 200% center; } }
@keyframes toastFadeIn { from { opacity: 0; transform: translateX(50px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastFadeOut { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
.toast-message { transition: all 0.3s ease; }
#slotsPanel, #challengesWrapper, #achievementsWrapper, #hiscoresWrapper { animation: fadeIn 0.4s ease-in-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.achievement-unlock-glow { position: relative; z-index: 50; outline: 4px solid #f1d592 !important; outline-offset: 2px; background: rgba(203, 178, 106, 0.25) !important; animation: achievement-celebrate 3s ease-out forwards; }
@keyframes achievement-celebrate { 0% { transform: scale(1); box-shadow: 0 0 0px transparent; } 15% { transform: scale(1.08); box-shadow: 0 0 30px #f1d592; } 30% { transform: scale(1.02); } 100% { transform: scale(1); box-shadow: 0 0 10px rgba(241, 213, 146, 0.5); } }