/* UI Components - Dao of the Endless Sky */

/* ========================================
   INLINE GAME ICONS (.gi)
   SVG/PNG icons replacing emoji fallbacks
   ======================================== */

.gi {
    display: inline-block;
    vertical-align: middle;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    pointer-events: none;
    margin: 0 2px;
}

/* Larger icon contexts */
.skill-card .gi,
.equipment-card .gi,
.item-icon-container .gi {
    width: 24px;
    height: 24px;
}

.section-header .gi,
h3 .gi {
    width: 18px;
    height: 18px;
}

/* Colored dot indicators (difficulty, tier) */
.gi-dot {
    display: inline-block;
    vertical-align: middle;
    border-radius: 50%;
    width: 10px;
    height: 10px;
    margin: 0 2px;
    flex-shrink: 0;
}

/* Active/Inactive status glyphs */
.gi-glyph {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
    vertical-align: middle;
}

.gi-active {
    background: #34D399;
    box-shadow: 0 0 6px #34D399;
}

.gi-inactive {
    background: #64748B;
}

/* Arrow glyphs */
.gi-arrow {
    display: inline-block;
    width: 0;
    height: 0;
    margin: 0 3px;
    vertical-align: middle;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

.gi-up {
    border-bottom: 6px solid #34D399;
}

.gi-down {
    border-top: 6px solid #9CA3AF;
}

/* ========================================
   ULTRA-SIMPLE PURPLE PALETTE
   Colors extracted from background only
   ======================================== */

:root {
    /* === PALETTE "PURPLE + WARM ACCENTS" (Option A) === */
    
    /* Contextual Colors by Game Area */
    --cultivation-primary: #C084FC;    /* Lilac - Cultivation/Qi */
    --combat-primary: #EF4444;         /* Red - Combat/Danger */
    --treasure-primary: #F59E0B;       /* Amber - Currency/Items */
    --growth-primary: #22C55E;         /* Green - Resources/Success */
    --energy-accent: #06B6D4;          /* Cyan - Active effects/Qi energy */
    
    /* Surface Depth Gradient */
    --surface-dark: #0f0e17;           /* Deepest */
    --surface-medium: #1a1625;         /* Mid layer */
    --surface-light: #252036;          /* Card/panel bg */
    --text-bright: #FAFAFA;            /* Pure White */
    
    /* Rarity System */
    --rarity-common: #9CA3AF;
    --rarity-uncommon: #10B981;
    --rarity-rare: #3B82F6;
    --rarity-epic: #8B5CF6;
    --rarity-legendary: #FBBF24;
    --rarity-mythic: #EF4444;
    
    /* === PRIMARY PALETTE === */
    /* Purple (primary) */
    --purple-light: #C084FC;
    --purple-medium: #A855F7;
    --purple-dark: #7C3AED;
    
    /* Warm accent (gold/amber) */
    --gold-warm: #F59E0B;
    --gold-light: #FBBF24;
    --gold-dark: #D97706;
    
    /* Cool accent (cyan/teal) */
    --blue-light: #06B6D4;
    --blue-dark: #0891B2;
    
    /* Text Hierarchy */
    --text-white: #ffffff;
    --text-light: #FAFAFA;
    --text-medium: #A1A1AA;
    --text-muted: #71717A;
    
    /* Glass System - warmer purple tint */
    --glass-ultra-light: rgba(100, 60, 140, 0.12);
    --glass-light: rgba(100, 60, 140, 0.22);
    --glass-medium: rgba(100, 60, 140, 0.32);
    --glass-strong: rgba(100, 60, 140, 0.48);
    --glass-solid: rgba(100, 60, 140, 0.65);
    
    /* Blur */
    --blur-weak: blur(8px);
    --blur-medium: blur(12px);
    --blur-strong: blur(18px);
    
    /* Legacy aliases */
    --accent-color: var(--purple-light);
    --primary-bg: var(--glass-medium);
    --accent-bg: var(--glass-ultra-light);
    --border-color: rgba(192, 132, 252, 0.2);
    --secondary-text: var(--text-medium);
    --primary-text: var(--text-light);
    
    /* Typography */
    --font-heading: 'Cinzel', serif;
    --font-body: 'Inter', 'Segoe UI', sans-serif;
}

/* ========================================
   GLOBAL TEXT READABILITY
   Ensure all text is readable on ultra-transparent backgrounds
   ======================================== */

/* General text shadow for readability */
#game-container {
    color: var(--text-light);
    font-family: var(--font-body);
}

/* Thematic heading font */
h1, h2, h3,
.realm-name,
.game-title,
.stats-card-header,
.settings-section h3 {
    font-family: var(--font-heading);
    letter-spacing: 0.5px;
}

/* All headings get strong shadows */
h1, h2, h3, h4, h5, h6 {
    text-shadow: 
        0 0 12px rgba(155, 127, 199, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

/* Paragraph and general text */
p, span, label, li {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Strong text elements */
strong, b {
    text-shadow: 
        0 1px 4px rgba(0, 0, 0, 0.9);
}

/* Global layout fix for sidebar */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* ========================================
   SIDEBAR LAYOUT (Vertical Navigation)
   ======================================== */

#game-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
    z-index: 1;
    max-width: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
}

#game-header {
    flex-shrink: 0;
    text-align: center;
    padding: 20px;
    background: var(--glass-ultra-light);
    backdrop-filter: var(--blur-strong);
    border-bottom: 2px solid rgba(155, 127, 199, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* === LOGO CONTAINER === */
.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

/* === GAME LOGO === */
.game-logo {
    width: 100px;
    height: 100px;
    filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
    animation: logoFloat 4s ease-in-out infinite, logoGlow 3s ease-in-out infinite;
    transition: transform 0.3s ease;
}

.game-logo:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 35px rgba(168, 85, 247, 1));
}

@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 20px rgba(168, 85, 247, 0.6));
    }
    50% {
        filter: drop-shadow(0 0 35px rgba(168, 85, 247, 0.9));
    }
}

/* === LOGO TEXT CONTAINER === */
.logo-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

/* === GAME TITLE === */
.game-title {
    font-size: 2rem;
    color: var(--text-white);
    margin: 0;
    line-height: 1;
    background: linear-gradient(135deg, #A855F7 0%, #14B8A6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.8)) 
            drop-shadow(0 0 20px rgba(168, 85, 247, 0.5));
    letter-spacing: 1px;
    font-weight: 700;
}

/* === SUBTITLE === */
#game-header .subtitle {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 
        0 0 12px rgba(155, 127, 199, 0.5),
        0 2px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 3px;
    text-transform: uppercase;
    display: block;
    margin-top: 5px;
}

#main-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* Sidebar */
#sidebar {
    width: 220px;
    flex-shrink: 0;
    background: var(--glass-light);
    backdrop-filter: var(--blur-strong);
    border-right: 2px solid rgba(155, 127, 199, 0.4);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: 
        0 0 30px rgba(0, 0, 0, 0.3),
        inset 0 0 20px rgba(255, 255, 255, 0.03);
}

#player-panel-compact {
    padding: 20px 15px;
    border-bottom: 2px solid var(--purple-medium);
    flex-shrink: 0;
    text-align: center;
}

.player-info-compact {
    margin-top: 10px;
}

.player-info-compact h3 {
    margin: 0 0 5px 0;
    font-size: 1.1em;
    color: var(--purple-light);
    text-shadow: 
        0 0 12px rgba(155, 127, 199, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

.player-level-compact {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-medium);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#nav-items {
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: transparent;
    border: 2px solid transparent;
    border-radius: 8px;
    color: var(--text-medium);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    font-size: 0.95em;
    font-weight: 600;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.nav-item:hover {
    background: var(--glass-medium);
    border-color: var(--purple-medium);
    color: var(--purple-light);
    transform: translateX(5px);
}

.nav-item.active {
    background: var(--glass-medium);
    backdrop-filter: var(--blur-medium);
    border-color: var(--purple-light);
    color: var(--text-white);
    box-shadow: 
        0 0 20px rgba(155, 127, 199, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.15);
}

/* === NAVIGATION TABS - CORES CONTEXTUAIS === */
/* Cultivation Tab */
.nav-item[data-tab="cultivation"] {
    color: var(--cultivation-primary);
}
.nav-item[data-tab="cultivation"].active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    border-color: var(--cultivation-primary);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Combat Tab */
.nav-item[data-tab="combat"] {
    color: var(--combat-primary);
}
.nav-item[data-tab="combat"].active {
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.2), rgba(244, 63, 94, 0.1));
    border-color: var(--combat-primary);
    box-shadow: 0 0 20px rgba(244, 63, 94, 0.4);
}

/* Vendor/Inventory Tabs */
.nav-item[data-tab="vendor"],
.nav-item[data-tab="inventory"],
.nav-item[data-tab="equipment"],
.nav-item[data-tab="crafting"] {
    color: var(--treasure-primary);
}
.nav-item[data-tab="vendor"].active,
.nav-item[data-tab="inventory"].active,
.nav-item[data-tab="equipment"].active,
.nav-item[data-tab="crafting"].active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.1));
    border-color: var(--treasure-primary);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
}

/* Gathering/Territory Tabs */
.nav-item[data-tab="gathering"],
.nav-item[data-tab="territories"] {
    color: var(--growth-primary);
}
.nav-item[data-tab="gathering"].active,
.nav-item[data-tab="territories"].active {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border-color: var(--growth-primary);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

/* Lifeskills Tab */
.nav-item[data-tab="lifeskills"] {
    color: var(--cultivation-primary);
}
.nav-item[data-tab="lifeskills"].active {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
    border-color: var(--cultivation-primary);
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
}

/* Quests/Achievements/Statistics Tabs */
.nav-item[data-tab="quests"],
.nav-item[data-tab="achievements"],
.nav-item[data-tab="statistics"] {
    color: var(--energy-accent);
}
.nav-item[data-tab="quests"].active,
.nav-item[data-tab="achievements"].active,
.nav-item[data-tab="statistics"].active {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.2), rgba(20, 184, 166, 0.1));
    border-color: var(--energy-accent);
    box-shadow: 0 0 20px rgba(20, 184, 166, 0.4);
}

.nav-icon {
    font-size: 1.3em;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
}

/* Navigation Icon Images (PNG) */
.nav-icon img {
    width: 100%;
    height: 100%;
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.3));
    transition: all 0.3s ease;
    transform-origin: center;
}

/* Active navigation item - brighter icon */
.nav-item.active .nav-icon img {
    filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8)) 
            brightness(1.2);
}

/* Hover effect - glow intensifies */
.nav-item:hover .nav-icon img {
    filter: drop-shadow(0 0 10px rgba(168, 85, 247, 0.9)) 
            brightness(1.3);
    transform: scale(1.1);
}

/* ========================================
   CONTEXTUAL COLORS PER TAB
   Each tab sets --tab-accent to propagate
   color identity into content area cards,
   headings, progress bars, and buttons.
   ======================================== */

/* Default fallback */
#content-area {
    --tab-accent: var(--cultivation-primary);
    --tab-accent-rgb: 168, 85, 247;
    --tab-glow: rgba(168, 85, 247, 0.25);
}

/* Cultivation */
#content-area[data-active-tab="cultivation"] {
    --tab-accent: var(--cultivation-primary);
    --tab-accent-rgb: 168, 85, 247;
    --tab-glow: rgba(168, 85, 247, 0.25);
}

/* Lifeskills (same as cultivation) */
#content-area[data-active-tab="lifeskills"] {
    --tab-accent: var(--cultivation-primary);
    --tab-accent-rgb: 168, 85, 247;
    --tab-glow: rgba(168, 85, 247, 0.25);
}

/* Combat */
#content-area[data-active-tab="combat"] {
    --tab-accent: var(--combat-primary);
    --tab-accent-rgb: 244, 63, 94;
    --tab-glow: rgba(244, 63, 94, 0.25);
}

/* Equipment / Inventory / Vendor / Crafting */
#content-area[data-active-tab="equipment"],
#content-area[data-active-tab="inventory"],
#content-area[data-active-tab="vendor"],
#content-area[data-active-tab="crafting"] {
    --tab-accent: var(--treasure-primary);
    --tab-accent-rgb: 251, 191, 36;
    --tab-glow: rgba(251, 191, 36, 0.25);
}

/* Gathering / Territories */
#content-area[data-active-tab="gathering"],
#content-area[data-active-tab="territories"] {
    --tab-accent: var(--growth-primary);
    --tab-accent-rgb: 34, 197, 94;
    --tab-glow: rgba(34, 197, 94, 0.25);
}

/* Quests / Achievements / Statistics */
#content-area[data-active-tab="quests"],
#content-area[data-active-tab="achievements"],
#content-area[data-active-tab="statistics"] {
    --tab-accent: var(--energy-accent);
    --tab-accent-rgb: 20, 184, 166;
    --tab-glow: rgba(20, 184, 166, 0.25);
}

/* Settings / Prestige */
#content-area[data-active-tab="settings"],
#content-area[data-active-tab="prestige"] {
    --tab-accent: var(--purple-light);
    --tab-accent-rgb: 155, 127, 199;
    --tab-glow: rgba(155, 127, 199, 0.25);
}

/* --- Apply contextual accent to content elements --- */

/* Tab heading h2 inherits accent color */
#tab-content h2 {
    color: var(--tab-accent);
}

/* Card borders respond to tab accent */
#tab-content .card,
#tab-content .game-card {
    border-color: rgba(var(--tab-accent-rgb), 0.35);
}
#tab-content .card:hover,
#tab-content .game-card:hover {
    border-color: rgba(var(--tab-accent-rgb), 0.7);
    box-shadow: 0 0 20px rgba(var(--tab-accent-rgb), 0.15);
}

/* Card header accent */
#tab-content .card-header {
    color: var(--tab-accent);
    border-bottom-color: rgba(var(--tab-accent-rgb), 0.3);
}

/* Progress bar fills pick up accent */
#tab-content .progress-fill {
    background: linear-gradient(90deg, 
        rgba(var(--tab-accent-rgb), 0.8),
        rgba(var(--tab-accent-rgb), 1));
}

/* Primary buttons inherit accent */
#tab-content .btn-primary,
#tab-content .btn:not(.btn-secondary):not(.btn-danger) {
    background: linear-gradient(135deg, 
        rgba(var(--tab-accent-rgb), 0.7),
        rgba(var(--tab-accent-rgb), 0.5));
    border-color: rgba(var(--tab-accent-rgb), 0.5);
}
#tab-content .btn-primary:hover,
#tab-content .btn:not(.btn-secondary):not(.btn-danger):hover {
    background: linear-gradient(135deg,
        rgba(var(--tab-accent-rgb), 0.9),
        rgba(var(--tab-accent-rgb), 0.7));
    box-shadow: 0 0 15px rgba(var(--tab-accent-rgb), 0.4);
}

.nav-label {
    flex: 1;
}

/* NEW badge for nav items */
.nav-badge-new {
    display: inline-block;
    font-size: 0.6em;
    font-weight: 700;
    background: linear-gradient(135deg, #38BDF8, #818CF8);
    color: #fff;
    padding: 1px 6px;
    border-radius: 8px;
    margin-left: 6px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Title Icons (for h2/h3) */
.title-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    margin-right: 8px;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.4));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

h2 .title-icon {
    width: 32px;
    height: 32px;
}

h3 .title-icon {
    width: 24px;
    height: 24px;
}

/* Content area */
#content-area {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
}

/* Tab content - no background */
#tab-contents {
    background: transparent;
    padding: 20px;
}

/* === CONTENT SECTIONS - BACKGROUND TINTS CONTEXTUAIS === */
/* Cultivation Area */
#cultivation-content {
    position: relative;
}
#cultivation-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Combat Zone */
#combat-content {
    position: relative;
}
#combat-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(244, 63, 94, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Vendor/Inventory/Equipment/Crafting */
#vendor-content,
#inventory-content,
#equipment-content,
#crafting-content {
    position: relative;
}
#vendor-content::before,
#inventory-content::before,
#equipment-content::before,
#crafting-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom left, rgba(251, 191, 36, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Gathering/Territories */
#gathering-content,
#territories-content {
    position: relative;
}
#gathering-content::before,
#territories-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Lifeskills */
#lifeskills-content {
    position: relative;
}
#lifeskills-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(168, 85, 247, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Quests/Achievements/Statistics */
#quests-content,
#achievements-content,
#statistics-content {
    position: relative;
}
#quests-content::before,
#achievements-content::before,
#statistics-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(20, 184, 166, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* Ensure content stays above background tints */
.tab-content > *,
#tab-contents > * {
    position: relative;
    z-index: 1;
}

#player-panel-full {
    flex-shrink: 0;
    padding: 20px;
    background: var(--glass-light);
    backdrop-filter: var(--blur-medium);
    border-bottom: 2px solid rgba(155, 127, 199, 0.3);
    margin: 0;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

#resources-panel-inline {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(6px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 15px;
}

#resources-panel-inline .resource-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

#resources-panel-inline .resource-label {
    color: var(--text-light);
    font-weight: 600;
    font-size: 0.9rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

#resources-panel-inline .resource-amount {
    margin-left: 4px;
    font-weight: bold;
    color: var(--gold-warm);
    text-shadow: 
        0 0 10px rgba(184, 149, 106, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.9);
}

#tab-content {
    flex: 1;
    padding: 20px;
    min-height: 400px;
}

/* Mobile menu toggle */
#mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: var(--purple-medium);
    border: 2px solid var(--purple-light);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.5em;
    cursor: pointer;
    color: var(--text-white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
}

#mobile-menu-toggle:hover {
    background: var(--purple-light);
    transform: scale(1.05);
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE – MOBILE OVERHAUL (max-width: 768px)
   Full mobile experience — does NOT affect desktop.
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── 1. ROOT LAYOUT OVERRIDES (fix main.css conflicts) ── */
    body {
        display: block !important;
        justify-content: unset !important;
        align-items: unset !important;
        overflow: hidden !important;
        height: 100% !important;
    }

    #game-container {
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        border-radius: 0 !important;
        max-width: 100% !important;
        box-shadow: none !important;
        height: 100vh !important;
        height: 100dvh !important;
    }

    #game-header {
        padding: 10px 15px !important;
    }

    #main-layout {
        flex: 1;
        overflow: hidden;
    }

    /* ── 2. SIDEBAR (off-canvas left) ── */
    #sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        width: 250px;
        z-index: 1000;
        transition: left 0.3s ease;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.7);
        background: #0f0e17 !important;
        backdrop-filter: none !important;
        border-right: 2px solid rgba(192, 132, 252, 0.3);
    }

    #sidebar.open {
        left: 0;
    }

    #sidebar.open::after {
        content: '';
        position: fixed;
        top: 0; left: 250px; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: -1;
        animation: mqFadeIn 0.3s ease forwards;
    }

    /* mobile-menu-toggle — hidden (bottom nav handles sidebar) */

    /* ── 3. CONTENT AREA – scrollable + readable ── */
    #content-area {
        margin-left: 0;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        height: 100%;
        /* Semi-transparent so background video shows through */
        background: rgba(10, 9, 16, 0.75) !important;
    }

    #tab-contents {
        padding: 12px 10px !important;
        padding-bottom: 80px !important; /* space for mute FAB */
        background: transparent !important;
    }

    .tab-content,
    [id$="-content"] {
        padding: 10px 8px !important;
    }

    /* Ensure text contrast on mobile */
    #content-area,
    #content-area *:not(.btn):not(button):not(a):not(.progress-fill):not([class*="badge"]) {
        color: var(--text-color, rgba(255,255,255,0.9));
    }

    /* Cards need solid readable backgrounds */
    .game-card,
    .card,
    .quest-card,
    .mq-card,
    .sq-card,
    .skill-card,
    .equip-slot,
    .item-card,
    .territory-card,
    .achievement-card,
    .stat-card {
        background: rgba(20, 18, 35, 0.95) !important;
        border-color: rgba(192, 132, 252, 0.2) !important;
    }

    /* ── 4. NAV ITEMS – touch friendly ── */
    .nav-item {
        padding: 14px 16px;
        font-size: 0.92em;
        min-height: 44px;
        background: rgba(255, 255, 255, 0.03) !important;
        margin-bottom: 2px;
    }

    .nav-item.active {
        background: rgba(192, 132, 252, 0.12) !important;
        border-color: rgba(192, 132, 252, 0.4) !important;
    }

    /* ── 5. LOGO – compact ── */
    .logo-container {
        flex-direction: column;
        gap: 5px;
    }

    .game-logo {
        width: 50px;
        height: 42px;
    }

    .logo-text {
        align-items: center;
        text-align: center;
    }

    .game-title {
        font-size: 1.3rem;
    }

    #game-header .subtitle {
        font-size: 0.65rem;
        letter-spacing: 2px;
    }

    /* ── 6. EVENT LOG – compact ── */
    #event-log {
        width: calc(100vw - 40px);
        max-width: 350px;
        bottom: 10px;
        right: 10px;
        font-size: 0.8em;
    }

    #event-log-content {
        max-height: 140px;
    }

    /* ── 7. MUSIC PLAYER – hide full player, show mute FAB ── */
    .music-mini-player {
        /* Hide everything: track info, controls bar */
        top: auto !important;
        bottom: auto !important;
        right: 12px !important;
        top: 8px !important;
        left: auto !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 0 !important;
        border-radius: 50% !important;
        padding: 0 !important;
        justify-content: center !important;
        align-items: center !important;
        z-index: 1002 !important;
        background: rgba(15, 14, 23, 0.92) !important;
        border: 1.5px solid rgba(192, 132, 252, 0.35) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
        overflow: hidden !important;
        gap: 0 !important;
    }

    /* Hide all player elements except mute button */
    .music-mini-player .mmp-track-info,
    .music-mini-player .mmp-controls > *:not(#mmp-mute),
    .music-mini-player .mmp-volume,
    .music-mini-player .mmp-track-name,
    .music-mini-player .mmp-track-icon {
        display: none !important;
    }

    .music-mini-player .mmp-controls {
        gap: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .music-mini-player #mmp-mute {
        font-size: 18px !important;
        width: 42px !important;
        height: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        background: transparent !important;
    }

    /* ── 8. CHAT WIDGET – hidden on mobile ── */
    .chat-widget {
        display: none !important;
    }

    /* ── 9. ICONS – proper sizing on mobile ── */
    .title-icon {
        width: 22px !important;
        height: 22px !important;
        vertical-align: middle;
        object-fit: contain;
    }

    h2 .title-icon {
        width: 26px !important;
        height: 26px !important;
    }

    .nav-icon {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain;
    }

    /* Quest reward inline icons — keep small! */
    .mq-inline-icon {
        width: 16px !important;
        height: 16px !important;
        vertical-align: middle !important;
        object-fit: contain;
    }

    .sq-inline-icon {
        width: 14px !important;
        height: 14px !important;
        vertical-align: middle !important;
        object-fit: contain;
    }

    /* Currency icons in resources panel */
    .currency-icon {
        width: 22px !important;
        height: 22px !important;
        object-fit: contain;
        animation: none !important;
    }

    /* Inline icons in buttons */
    .inline-icon,
    .enchant-res-icon {
        width: 16px !important;
        height: 16px !important;
        vertical-align: middle !important;
        object-fit: contain;
    }

    /* Nav icon images inside spans */
    .nav-icon img {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain;
    }

    /* ── 10. GRIDS – single column on mobile ── */
    #side-quest-container {
        grid-template-columns: 1fr !important;
    }

    .skills-grid,
    .equip-grid,
    .inventory-grid,
    .crafting-grid,
    .recipes-grid,
    .territory-grid,
    #vendor-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* ── 11. BUTTONS – touch-friendly, prevent overflow ── */
    .btn, button {
        min-height: 44px;
        font-size: 0.85em;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Vendor buttons — handled by section 50 below */

    /* Vendor header compact */
    .vendor-header {
        padding: 10px !important;
        gap: 8px !important;
        flex-direction: column !important;
    }

    .vendor-gold {
        font-size: 1em !important;
    }

    .vendor-filters {
        gap: 4px !important;
    }

    .vendor-filter {
        padding: 6px 12px !important;
        font-size: 0.8rem !important;
    }

    /* ── 12. MODALS – full-width on mobile ── */
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        margin: 2.5vh auto !important;
    }

    /* ── 13. PROGRESS BARS – readable ── */
    .progress-bar, .bar-container {
        height: 22px !important;
    }

    .progress-text, .bar-text {
        font-size: 10px !important;
    }

    /* ── 14. PLAYER PANEL (header with bars) – ultra-compact on mobile ── */
    #player-panel-full {
        padding: 8px 10px !important;
        margin-bottom: 8px !important;
        background: rgba(15, 14, 23, 0.95) !important;
        border-radius: 8px !important;
    }

    .player-info {
        margin-bottom: 6px !important;
    }

    #player-name {
        font-size: 1.1rem !important;
        margin-bottom: 0 !important;
    }

    #player-realm-level {
        font-size: 0.8rem !important;
    }

    .player-dao-path {
        font-size: 0.7rem !important;
        margin-top: 0 !important;
    }

    /* Stat bars — compact with smaller ornaments */
    .stat-bars {
        gap: 2px !important;
    }

    .stat-bar-wrapper {
        grid-template-columns: 28px 1fr 28px !important;
        margin: 2px 0 !important;
        filter: none !important;
    }

    .bar-ornament-left,
    .bar-ornament-right {
        width: 28px !important;
        height: 28px !important;
        filter: none !important;
    }

    .bar-ornament-left {
        margin-right: -4px !important;
    }

    .bar-ornament-right {
        margin-left: -4px !important;
    }

    .bar-center {
        height: 22px !important;
    }

    .bar-text {
        font-size: 9px !important;
    }

    /* Resources panel — handled by section 47 below */

    /* Remove shimmer animation that clips text */
    .resource-amount::after {
        display: none !important;
    }

    /* ── 15. QUEST CARDS – proper spacing ── */
    .mq-card, .sq-card {
        padding: 10px !important;
        margin-bottom: 8px !important;
    }

    .mq-card h3, .sq-card h3 {
        font-size: 0.95em !important;
    }

    /* ── 16. PURPLE FRAME CLEANUP — remove unnecessary borders/glows ── */
    .game-card,
    .card,
    .vendor-item,
    .territory-card,
    .skill-card,
    .equip-slot,
    .achievement-card,
    .stat-card,
    .recipe-card,
    .crafting-card {
        border: 1px solid rgba(192, 132, 252, 0.12) !important;
        box-shadow: none !important;
        background: rgba(20, 18, 35, 0.95) !important;
    }

    /* Remove ::before / ::after decorative frames on cards */
    .game-card::before,
    .game-card::after,
    .card::before,
    .card::after,
    .vendor-item::before,
    .vendor-item::after,
    .territory-card::before,
    .territory-card::after,
    .skill-card::before,
    .skill-card::after,
    .achievement-card::before,
    .achievement-card::after,
    .quest-card::before,
    .quest-card::after,
    .prestige-card::before,
    .prestige-card::after {
        display: none !important;
    }

    /* Player panel — cleaner frame */
    #player-panel-full {
        border: 1px solid rgba(155, 127, 199, 0.15) !important;
        border-bottom: 1px solid rgba(155, 127, 199, 0.2) !important;
        box-shadow: none !important;
    }

    /* ── 17. SIDEBAR PLAYER PANEL – compact ── */
    .compact-stats, .player-info-compact {
        font-size: 0.82em;
    }

    .stat-bar-label {
        font-size: 0.7em;
    }

    /* ── 18. TABLES – horizontal scroll ── */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.8em;
    }

    /* ── 19. GENERAL TEXT SIZING ── */
    h2 {
        font-size: 1.2rem !important;
    }

    h3 {
        font-size: 1rem !important;
    }

    p, span, div {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* ── 20. ITEM ICON CONTAINERS – consistent sizing ── */
    .item-icon-container {
        width: 48px !important;
        height: 48px !important;
    }

    .item-icon-container .item-icon-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    /* ── 21. GOLD SINKS / MISC sections – compact ── */
    #gold-sinks-section .game-card,
    .settings-section {
        padding: 10px !important;
    }

    /* ── 22. VENDOR GRID – proper single-column ── */
    #vendor-grid {
        padding: 8px 0 !important;
    }

    /* ── 23. CULTIVATION TAB – compact ── */
    .cultivation-tab-header {
        padding: 10px !important;
    }

    .realm-journey-header {
        flex-direction: column !important;
        gap: 6px !important;
    }

    /* ── 24. ENCHANT TABLE – readable ── */
    .enchant-res-icon {
        width: 14px !important;
        height: 14px !important;
    }

    /* ══════════════════════════════════════════════════════════
       25. TAB CONTENT FRAME — remove on mobile
       The #tab-content border/bg creates a misplaced "frame"
       that wraps tab names and ends awkwardly mid-screen.
       ══════════════════════════════════════════════════════════ */
    #tab-content {
        background: transparent !important;
        border: none !important;
        border-radius: 0 !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 12px 10px !important;
        min-height: auto !important;
    }

    /* Tab titles — cleaner on mobile */
    #tab-content > h2,
    #tab-content > .tab-skills > h2,
    #tab-content > .tab-equipment > h2,
    #tab-content > .tab-inventory > h2,
    #tab-content > .tab-achievements > h2 {
        font-size: 1.15rem !important;
        margin-bottom: 12px !important;
        padding-bottom: 8px !important;
        border-bottom: 1px solid rgba(155, 127, 199, 0.2) !important;
    }

    /* ══════════════════════════════════════════════════════════
       26. LIFESKILLS SUB-TABS — prevent overlap
       4 buttons with icons + text overflow on narrow screens.
       Switch to 2x2 grid layout.
       ══════════════════════════════════════════════════════════ */
    /* Skills subtabs & cards — handled by section 49 below */

    /* Skills overview row — stack vertically */
    .skills-overview {
        flex-direction: column !important;
        gap: 10px !important;
        padding: 10px !important;
    }

    /* Skill cards — compact */
    .skill-card {
        padding: 12px !important;
    }

    .skill-card h3 {
        font-size: 0.95em !important;
    }

    /* ══════════════════════════════════════════════════════════
       27. STATISTICS DASHBOARD — readable on mobile
       Uses 900px/500px breakpoints but needs explicit 768px
       ══════════════════════════════════════════════════════════ */
    #statistics-container {
        padding: 8px !important;
    }

    .stats-dashboard {
        max-width: 100% !important;
    }

    .stats-hero-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .stats-hero-card {
        padding: 12px 8px !important;
    }

    .hero-value {
        font-size: 1.05em !important;
    }

    .hero-label {
        font-size: 0.65em !important;
    }

    .stats-sections-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .stats-card-header {
        padding: 10px 12px !important;
        font-size: 0.85em !important;
    }

    .stat-row {
        padding: 6px 12px !important;
        font-size: 0.82em !important;
        gap: 8px !important;
    }

    .stat-val {
        font-size: 0.85em !important;
    }

    .stat-date {
        font-size: 0.72em !important;
        max-width: 120px !important;
        text-align: right !important;
        word-break: break-word !important;
        white-space: normal !important;
    }

    .milestone-row {
        padding: 6px 12px !important;
    }

    .milestone-info {
        font-size: 0.82em !important;
    }

    /* ══════════════════════════════════════════════════════════
       28. GATHERING / LIFESKILLS – compact nodes
       ══════════════════════════════════════════════════════════ */
    .gathering-section-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        padding: 8px 12px !important;
        margin: 15px 0 10px 0 !important;
    }

    .gathering-section-header h3 {
        font-size: 0.95em !important;
    }

    .gathering-section-info {
        font-size: 0.75em !important;
    }

    .gathering-node-card {
        padding: 12px !important;
        box-sizing: border-box !important;
    }

    .node-header {
        flex-direction: row !important;
        gap: 10px !important;
        align-items: center !important;
    }

    .node-icon {
        font-size: 1.8em !important;
        flex-shrink: 0 !important;
    }

    .node-header > div {
        flex: 1 !important;
        min-width: 0 !important;
        text-align: left !important;
    }

    .node-header h4 {
        font-size: 0.92em !important;
    }

    .node-description {
        font-size: 0.8em !important;
    }

    .node-info {
        font-size: 0.78em !important;
        flex-wrap: wrap !important;
        gap: 6px !important;
        justify-content: flex-start !important;
    }

    .node-info > span {
        white-space: nowrap !important;
    }

    .node-resources {
        font-size: 0.8em !important;
        word-break: break-word !important;
    }

    .node-actions {
        flex-direction: column !important;
        gap: 6px !important;
    }

    .btn-gather,
    .btn-auto-gather {
        width: 100% !important;
        padding: 10px !important;
        font-size: 0.85em !important;
    }

    .gathering-progress-card {
        padding: 12px !important;
    }

    /* Locked overlay — smaller text */
    .gathering-lock-icon {
        font-size: 1.5em !important;
    }

    .gathering-lock-text {
        font-size: 0.8em !important;
    }

    /* ══════════════════════════════════════════════════════════
       29. COMBAT TAB – compact on mobile
       ══════════════════════════════════════════════════════════ */
    #combat-container {
        padding: 0 !important;
    }

    .combat-portrait-container {
        width: 120px !important;
        height: 120px !important;
    }

    .combat-portrait-container img {
        width: 100% !important;
        height: 100% !important;
    }

    .enemy-display {
        padding: 10px !important;
    }

    .enemy-stats {
        flex-direction: column !important;
        gap: 6px !important;
        font-size: 0.85em !important;
    }

    .combat-log {
        max-height: 120px !important;
        font-size: 0.8em !important;
    }

    .btn-attack {
        padding: 12px !important;
        font-size: 0.9em !important;
    }

    /* ══════════════════════════════════════════════════════════
       30. EQUIPMENT TAB – compact, single-column, no overflow
       ══════════════════════════════════════════════════════════ */
    .equipment-section {
        flex-direction: column !important;
    }

    .equipment-slots {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .equip-slot,
    .equipment-slot {
        padding: 10px !important;
        min-height: auto !important;
    }

    .equip-slot .slot-icon,
    .equipment-slot .slot-icon {
        font-size: 1.5em !important;
    }

    /* Equipped item: vertical layout on mobile */
    .equipped-item {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 8px !important;
        width: 100% !important;
    }

    .equipped-icon {
        font-size: 1.8em !important;
    }

    .equipment-icon-img.equipped-size {
        width: 48px !important;
        height: 48px !important;
    }

    .equipped-info {
        width: 100% !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }

    .equipped-info strong {
        font-size: 0.95em !important;
        word-break: break-word !important;
    }

    .equip-description {
        font-size: 0.8em !important;
        word-break: break-word !important;
        overflow-wrap: break-word !important;
    }

    .equip-stats-detail {
        width: 100% !important;
    }

    .equip-stat-row {
        display: flex !important;
        justify-content: space-between !important;
        font-size: 0.82em !important;
        gap: 4px !important;
    }

    .equip-stat-val {
        white-space: nowrap !important;
        font-size: 0.85em !important;
    }

    .equip-stat-bonus {
        font-size: 0.75em !important;
    }

    .equip-tier-tag {
        font-size: 0.7em !important;
    }

    .equip-active-indicator {
        font-size: 0.75em !important;
    }

    .btn-unequip {
        width: 100% !important;
        padding: 8px 10px !important;
        font-size: 0.8em !important;
    }

    /* Available equipment grid */
    .equipment-available-grid,
    .available-equipment-grid {
        grid-template-columns: 1fr !important;
    }

    .equipment-icon-img.available-size {
        width: 48px !important;
        height: 48px !important;
    }

    /* Enchanting section */
    .enchanting-container {
        padding: 8px !important;
    }

    .enchant-guide {
        font-size: 0.85em !important;
    }

    .guide-columns {
        grid-template-columns: 1fr !important;
    }

    /* ══════════════════════════════════════════════════════════
       31. INVENTORY TAB – compact
       ══════════════════════════════════════════════════════════ */
    .inv-subtitle {
        font-size: 0.8em !important;
    }

    .inventory-item {
        padding: 10px !important;
        font-size: 0.85em !important;
    }

    /* ══════════════════════════════════════════════════════════
       32. ACHIEVEMENTS TAB – clean header, compact cards
       ══════════════════════════════════════════════════════════ */
    .achievements-header {
        padding: 10px !important;
        border: 1px solid rgba(184, 149, 106, 0.2) !important;
    }

    .achievement-card {
        padding: 10px !important;
    }

    .achievement-card:hover {
        transform: none !important;
    }

    .achievement-icon {
        font-size: 1.5em !important;
    }

    /* ══════════════════════════════════════════════════════════
       33. TERRITORIES TAB – compact
       ══════════════════════════════════════════════════════════ */
    .territory-info-box {
        padding: 12px !important;
        margin: 10px auto !important;
        font-size: 0.85em !important;
    }

    .territory-header {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .territory-icon {
        font-size: 2em !important;
    }

    /* ══════════════════════════════════════════════════════════
       34. PRESTIGE TAB – compact
       ══════════════════════════════════════════════════════════ */
    .prestige-badge-modern {
        width: 60px !important;
        height: 60px !important;
    }

    .badge-number {
        font-size: 1.2em !important;
    }

    .prestige-title {
        font-size: 1.1em !important;
    }

    .benefits-grid-modern {
        grid-template-columns: 1fr !important;
    }

    /* ══════════════════════════════════════════════════════════
       35. SETTINGS TAB – compact
       ══════════════════════════════════════════════════════════ */
    #settings-container {
        padding: 8px !important;
    }

    .settings-section {
        padding: 12px !important;
        margin-bottom: 12px !important;
    }

    .setting-actions {
        flex-direction: column !important;
    }

    .btn-setting {
        min-width: auto !important;
    }

    /* ══════════════════════════════════════════════════════════
       36. CRAFTING / FORGING / GATHERING – compact, centered
       ══════════════════════════════════════════════════════════ */
    .crafting-card,
    .recipe-card {
        padding: 14px !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .recipe-ingredients {
        font-size: 0.8em !important;
    }

    /* Forging grid */
    #forging-recipes {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 8px 0 !important;
        justify-items: center !important;
    }

    /* Crafting recipes grid */
    #crafting-recipes {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 8px 0 !important;
        justify-items: center !important;
    }

    /* Center section headings */
    #crafting-section,
    #forging-section,
    #gathering-section {
        text-align: center !important;
    }

    #crafting-section h2,
    #forging-section h2,
    #gathering-section h2 {
        text-align: center !important;
    }

    .crafting-hint,
    .gathering-hint {
        text-align: center !important;
    }

    /* Recipe/forging cards keep left-aligned text inside but stretch full width */
    .recipe-card,
    .crafting-card,
    .gathering-node {
        text-align: left !important;
    }

    /* Recipes grid — full width, no side padding */
    .recipes-grid,
    .crafting-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 8px 0 !important;
        justify-items: stretch !important;
    }

    /* Tier filter bar — wrappable */
    .tier-filter-bar {
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: center !important;
    }

    .tier-filter-btn {
        font-size: 0.75em !important;
        padding: 6px 8px !important;
    }

    .tier-filter-toggle {
        font-size: 0.75em !important;
    }

    /* Gathering nodes grid */
    .gathering-nodes {
        grid-template-columns: 1fr !important;
    }

    /* ══════════════════════════════════════════════════════════
       37. CULTIVATION TAB – additional mobile compaction
       ══════════════════════════════════════════════════════════ */
    .cultivation-tab-compact {
        padding: 0 !important;
    }

    .cultivation-main-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .cultivation-stats-compact {
        grid-template-columns: 1fr !important;
    }

    .btn-cultivate,
    .btn-begin-cultivation {
        padding: 12px !important;
        font-size: 0.9em !important;
    }

    .btn-cultivate-compact {
        height: 60px !important;
        font-size: 0.9em !important;
    }

    /* Realm journey */
    .realm-journey-bar {
        height: 20px !important;
    }

    /* Section titles */
    .section-title-compact {
        font-size: 0.95em !important;
    }

    /* ══════════════════════════════════════════════════════════
       38. QUESTS TAB – all sections compact
       ══════════════════════════════════════════════════════════ */
    .quests-header {
        margin-bottom: 15px !important;
    }

    .quests-divider {
        margin: 15px 0 !important;
    }

    #side-quest-container {
        grid-template-columns: 1fr !important;
    }

    .quest-card {
        padding: 10px !important;
    }

    .quest-header {
        flex-direction: column !important;
        gap: 6px !important;
    }

    .quest-footer {
        flex-direction: column !important;
        gap: 6px !important;
    }

    .btn-claim-quest {
        width: 100% !important;
    }

    /* Daily quests */
    .daily-quest-card {
        padding: 10px !important;
    }

    /* ══════════════════════════════════════════════════════════
       39. HOVER EFFECTS — disable on touch devices
       ══════════════════════════════════════════════════════════ */
    .game-card:hover,
    .card:hover,
    .skill-card:hover,
    .territory-card:hover,
    .vendor-item:hover,
    .achievement-card:hover,
    .gathering-node-card:hover,
    .crafting-card:hover,
    .recipe-card:hover,
    .equipment-slot:hover,
    .equip-slot:hover {
        transform: none !important;
        box-shadow: inherit !important;
    }

    /* ══════════════════════════════════════════════════════════
       40. DOUBLE-FRAMED ELEMENTS — remove inner frame
       ══════════════════════════════════════════════════════════ */
    .vendor-header {
        border: none !important;
        background: rgba(255, 215, 0, 0.05) !important;
        padding: 10px !important;
        margin-bottom: 15px !important;
        border-radius: 6px !important;
    }

    .territory-info-box {
        border: 1px solid rgba(255, 215, 0, 0.15) !important;
    }

    .achievements-header {
        border: 1px solid rgba(184, 149, 106, 0.15) !important;
        backdrop-filter: none !important;
    }

    /* ══════════════════════════════════════════════════════════
       41. OFFLINE MODAL — fits small screens
       ══════════════════════════════════════════════════════════ */
    .offline-modal-card {
        width: 92% !important;
        max-width: 350px !important;
    }

    .offline-modal-header {
        padding: 18px 16px 14px !important;
    }

    .offline-items-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    /* ══════════════════════════════════════════════════════════
       42. GENERAL OVERFLOW PREVENTION
       ══════════════════════════════════════════════════════════ */
    #content-area {
        overflow-x: hidden !important;
    }

    #tab-content * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Images must never exceed container */
    #tab-content img:not(.nav-icon):not(.bar-ornament-left):not(.bar-ornament-right) {
        max-width: 100% !important;
        height: auto !important;
    }

    /* But keep inline/quest icons small! */
    #tab-content img.mq-inline-icon,
    #tab-content img.sq-inline-icon,
    #tab-content img.inline-icon,
    #tab-content img.subtab-icon,
    #tab-content img.title-icon,
    #tab-content img.currency-icon,
    #tab-content img.resource-icon-sm,
    #tab-content img.enchant-res-icon,
    #tab-content img.item-icon-img,
    .nav-icon img {
        height: auto;
        max-width: none !important;
    }

    /* ══════════════════════════════════════════════════════════
       43. SAFE AREA INSETS — notched phones (iPhone X+)
       ══════════════════════════════════════════════════════════ */
    body {
        padding-top: env(safe-area-inset-top) !important;
        padding-left: env(safe-area-inset-left) !important;
        padding-right: env(safe-area-inset-right) !important;
    }

    /* ══════════════════════════════════════════════════════════
       44. COMPACT HEADER — hide title on mobile, just logo + ☰
       ══════════════════════════════════════════════════════════ */
    #game-header {
        padding: 6px 12px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: rgba(10, 9, 16, 0.95) !important;
        border-bottom: 1px solid rgba(155, 127, 199, 0.25) !important;
        min-height: 44px !important;
    }

    .logo-container {
        gap: 8px !important;
        flex-direction: row !important;
        align-items: center !important;
    }

    .game-logo {
        width: 32px !important;
        height: 32px !important;
        animation: none !important;
        filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.4)) !important;
    }

    .logo-text {
        align-items: flex-start !important;
        text-align: left !important;
    }

    .game-title {
        font-size: 0.95rem !important;
        line-height: 1.1 !important;
    }

    #game-header .subtitle {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════════════
       45. HAMBURGER ☰ — hidden (replaced by bottom nav "More")
       ══════════════════════════════════════════════════════════ */
    #mobile-menu-toggle {
        display: none !important;
    }

    /* ══════════════════════════════════════════════════════════
       46. BOTTOM NAVIGATION BAR — 5 core tabs at the bottom
       ══════════════════════════════════════════════════════════ */
    .mobile-bottom-nav {
        display: flex !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        z-index: 1001 !important;
        background: rgba(10, 9, 16, 0.97) !important;
        border-top: 1px solid rgba(155, 127, 199, 0.25) !important;
        padding: 4px 0 !important;
        padding-bottom: calc(4px + env(safe-area-inset-bottom)) !important;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.5) !important;
    }

    .bottom-nav-item {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 2px !important;
        padding: 6px 2px 4px !important;
        background: transparent !important;
        border: none !important;
        color: rgba(255, 255, 255, 0.45) !important;
        font-size: 0.62rem !important;
        font-family: var(--font-body, 'Inter', sans-serif) !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: transparent !important;
        transition: color 0.2s ease !important;
    }

    .bottom-nav-item.active {
        color: #c084fc !important;
    }

    .bottom-nav-item.active .bottom-nav-icon {
        filter: brightness(1.3) drop-shadow(0 0 4px rgba(192, 132, 252, 0.5)) !important;
    }

    .bottom-nav-icon {
        width: 22px !important;
        height: 22px !important;
        object-fit: contain !important;
        opacity: 0.7 !important;
        transition: opacity 0.2s ease, filter 0.2s ease !important;
    }

    .bottom-nav-item.active .bottom-nav-icon {
        opacity: 1 !important;
    }

    .bottom-nav-icon-text {
        font-size: 1.3rem !important;
        line-height: 22px !important;
        display: block !important;
        height: 22px !important;
    }

    /* Adjust content padding for bottom nav */
    #tab-contents {
        padding-bottom: calc(70px + env(safe-area-inset-bottom)) !important;
    }

    /* Adjust event-log so it doesn't overlap bottom nav */
    #event-log {
        bottom: calc(65px + env(safe-area-inset-bottom)) !important;
    }

    /* ══════════════════════════════════════════════════════════
       47. RESOURCE HEADER — structural fix
       Show icon + abbreviated label + full number
       ══════════════════════════════════════════════════════════ */
    #resources-panel-inline {
        display: flex !important;
        justify-content: center !important;
        gap: 16px !important;
        padding: 6px 8px !important;
        margin-top: 6px !important;
    }

    #resources-panel-inline .resource-item {
        display: flex !important;
        align-items: center !important;
        gap: 5px !important;
        flex-shrink: 0 !important;
    }

    #resources-panel-inline .resource-label {
        display: none !important;
    }

    #resources-panel-inline .resource-amount {
        font-size: 0.9rem !important;
        font-weight: bold !important;
        white-space: nowrap !important;
    }

    .currency-icon {
        width: 18px !important;
        height: 18px !important;
        flex-shrink: 0 !important;
    }

    /* ══════════════════════════════════════════════════════════
       48. COMBAT — single column, full-width cards, clean layout
       ══════════════════════════════════════════════════════════ */
    .enemy-grid {
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        padding: 0 !important;
        max-width: 100% !important;
    }

    .enemy-card,
    .boss-card {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
    }

    .enemy-portrait-container {
        width: 60px !important;
        height: 60px !important;
        margin: 0 auto 6px !important;
        position: relative !important;
    }

    .enemy-portrait-container .enemy-portrait {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 50% !important;
    }

    /* Boss badge — hidden on mobile, takes too much space on small portraits */
    .boss-badge {
        display: none !important;
    }

    .enemy-card h4 {
        font-size: 0.9em !important;
        margin: 4px 0 !important;
    }

    /* Enemy stats in a row */
    .enemy-stats {
        display: flex !important;
        justify-content: center !important;
        gap: 12px !important;
        flex-wrap: wrap !important;
    }

    .enemy-stats .stat-row {
        display: flex !important;
        align-items: center !important;
        gap: 3px !important;
        font-size: 0.8em !important;
        padding: 0 !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }

    /* Loot/drops — clean list */
    .enemy-loot-preview {
        margin-top: 6px !important;
        padding: 6px 8px !important;
        border-radius: 6px !important;
        background: rgba(0, 0, 0, 0.2) !important;
    }

    .loot-header {
        font-size: 0.7em !important;
        margin-bottom: 4px !important;
        font-weight: bold !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
    }

    .loot-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 2px 0 !important;
        font-size: 0.75em !important;
    }

    .loot-preview-icon {
        width: 14px !important;
        height: 14px !important;
        vertical-align: middle !important;
    }

    /* Card actions — side-by-side buttons */
    .card-actions {
        display: flex !important;
        gap: 6px !important;
        margin-top: 8px !important;
    }

    .card-actions .btn-attack {
        flex: 2 !important;
        padding: 8px !important;
        font-size: 0.8em !important;
    }

    .card-actions .btn-boss-attack {
        flex: 2 !important;
        padding: 8px !important;
        font-size: 0.75em !important;
    }

    .card-actions .btn-auto {
        flex: 1 !important;
        padding: 8px !important;
        font-size: 0.8em !important;
        min-width: 0 !important;
    }

    /* Bosses section title */
    .bosses-section-title {
        font-size: 1.1em !important;
        margin: 16px 0 8px !important;
    }

    /* Combat controls (flee button etc.) */
    .combat-controls {
        display: flex !important;
        gap: 8px !important;
        margin: 10px 0 !important;
    }

    .combat-controls > * {
        flex: 1 !important;
    }

    /* ══════════════════════════════════════════════════════════
       48b. SIDEBAR + SETTINGS
       ══════════════════════════════════════════════════════════ */
    #sidebar #nav-items {
        padding: 8px 6px !important;
        gap: 3px !important;
        overflow-y: auto !important;
        flex: 1 !important;
        -webkit-overflow-scrolling: touch !important;
    }

    #sidebar .nav-item {
        padding: 9px 12px !important;
        font-size: 0.82em !important;
        gap: 8px !important;
        flex-shrink: 0 !important;
    }

    #sidebar .nav-item .nav-icon img,
    #sidebar .nav-item .nav-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Settings gear in header — bright & visible */
    .mobile-settings-btn {
        display: inline-flex !important;
        position: absolute !important;
        right: 8px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        background: rgba(192, 132, 252, 0.25) !important;
        border: 2px solid rgba(192, 132, 252, 0.6) !important;
        border-radius: 50% !important;
        font-size: 1.4em !important;
        cursor: pointer !important;
        padding: 6px !important;
        z-index: 10 !important;
        width: 40px !important;
        height: 40px !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 0 8px rgba(192, 132, 252, 0.3) !important;
    }

    /* Move Settings to TOP of sidebar nav */
    #nav-items {
        display: flex !important;
        flex-direction: column !important;
    }

    #nav-items .nav-item[data-tab="settings"] {
        order: -1 !important;
        background: rgba(192, 132, 252, 0.12) !important;
        border: 1px solid rgba(192, 132, 252, 0.4) !important;
        border-radius: 8px !important;
        margin-bottom: 6px !important;
    }

    /* ══════════════════════════════════════════════════════════
       49. SKILLS — sticky subtabs + centered cards
       ══════════════════════════════════════════════════════════ */
    .skill-subtabs {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        background: rgba(15, 14, 23, 0.97) !important;
        padding: 6px !important;
        margin: 0 -10px 10px !important;
        display: flex !important;
        gap: 4px !important;
        border-bottom: 2px solid rgba(192, 132, 252, 0.3) !important;
    }

    .skill-subtabs .subtab-btn {
        flex: 1 !important;
        padding: 8px 4px !important;
        font-size: 0.72rem !important;
        text-align: center !important;
        white-space: nowrap !important;
        border-radius: 6px !important;
    }

    .skill-subtabs .subtab-icon {
        width: 14px !important;
        height: 14px !important;
        margin-right: 2px !important;
    }

    .skills-grid {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 10px !important;
    }

    .skill-card {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    /* Cycle explainer compact */
    .cycle-explainer {
        padding: 8px !important;
        margin-bottom: 8px !important;
    }

    .cycle-explainer-desc {
        font-size: 0.75em !important;
    }

    /* ══════════════════════════════════════════════════════════
       50. VENDOR — proper card layout + small buttons
       ══════════════════════════════════════════════════════════ */
    #vendor-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        padding: 0 !important;
    }

    .vendor-item {
        width: 100% !important;
        padding: 10px !important;
        min-height: auto !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }

    .vendor-item .card-content {
        gap: 6px !important;
        align-items: stretch !important;
        text-align: left !important;
    }

    .vendor-item-header {
        flex-direction: row !important;
        align-items: center !important;
        gap: 10px !important;
        margin-bottom: 8px !important;
    }

    .vendor-item-header .item-icon-container {
        flex-shrink: 0 !important;
    }

    .vendor-item .item-title {
        flex: 1 !important;
        text-align: left !important;
    }

    .vendor-item .item-title h4 {
        font-size: 0.95em !important;
        margin: 0 0 2px 0 !important;
    }

    .vendor-item .item-description {
        font-size: 0.78em !important;
        line-height: 1.3 !important;
        text-align: left !important;
    }

    .vendor-item .item-prices {
        font-size: 0.82em !important;
        padding: 8px !important;
    }

    .vendor-item .item-stock-info {
        font-size: 0.75em !important;
        display: flex !important;
        justify-content: space-between !important;
        gap: 8px !important;
        padding: 4px 0 !important;
    }

    /* Vendor buttons — compact, fit inside card */
    .vendor-actions {
        display: flex !important;
        gap: 4px !important;
        flex-wrap: wrap !important;
    }

    .vendor-actions .btn-buy,
    .vendor-actions .btn-sell {
        flex: 1 1 auto !important;
        padding: 7px 10px !important;
        font-size: 0.75em !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        white-space: nowrap !important;
    }

    .vendor-actions .btn-sell-all {
        flex: 1 1 100% !important;
        padding: 6px 10px !important;
        font-size: 0.72em !important;
        min-height: 0 !important;
        height: auto !important;
    }

    .vendor-actions .btn-buy .inline-icon,
    .vendor-actions .btn-sell .inline-icon {
        width: 14px !important;
        height: 14px !important;
    }

    /* Special Services */
    .special-services,
    .vendor-special,
    .gold-sink-card,
    #gold-sinks-section .game-card {
        padding: 10px !important;
    }

    .special-services p,
    .vendor-special p,
    .gold-sink-card p {
        font-size: 0.78em !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }

    .special-services .btn,
    .vendor-special .btn,
    .gold-sink-card .btn {
        padding: 8px 12px !important;
        font-size: 0.78em !important;
    }

    /* ══════════════════════════════════════════════════════════
       51. QUEST BUTTONS
       ══════════════════════════════════════════════════════════ */
    .btn-claim-quest,
    .btn-claim,
    .mq-claim-btn {
        padding: 10px 16px !important;
        font-size: 0.82em !important;
        border-radius: 8px !important;
        font-weight: 700 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .btn-claim:disabled {
        opacity: 0.7 !important;
    }

    .daily-quest-card,
    .quest-card {
        padding: 10px !important;
        margin-bottom: 6px !important;
    }

    /* ══════════════════════════════════════════════════════════
       52. PRESTIGE — complete mobile restyle
       ══════════════════════════════════════════════════════════ */

    /* Prestige container — no horizontal overflow */
    #prestige-container {
        max-width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    .prestige-modern {
        padding: 12px 8px !important;
        max-width: 100% !important;
        overflow: visible !important;
    }

    .prestige-available,
    .prestige-locked {
        padding: 16px 12px !important;
        overflow: visible !important;
    }

    .prestige-available h3,
    .prestige-locked h3 {
        font-size: 1.2em !important;
        margin-bottom: 14px !important;
    }

    .prestige-badge-modern {
        width: 56px !important;
        height: 56px !important;
        margin: 0 auto 8px !important;
        animation: none !important;
    }

    .badge-number {
        font-size: 0.9em !important;
    }

    .prestige-title {
        font-size: 1em !important;
    }

    .prestige-desc {
        font-size: 0.82em !important;
    }

    /* Prestige button — clean mobile style */
    .btn-prestige {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 14px !important;
        font-size: 1.1em !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
        -webkit-box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3) !important;
        animation: none !important;
        background: linear-gradient(135deg, #ffd700, #ff8c00) !important;
        background-size: 100% 100% !important;
        border: 2px solid rgba(255, 255, 255, 0.6) !important;
        text-shadow: none !important;
        color: #000 !important;
        font-weight: 700 !important;
        display: block !important;
        text-align: center !important;
        margin: 16px 0 !important;
        letter-spacing: 0.5px !important;
    }

    .btn-prestige:hover,
    .btn-prestige:active {
        transform: none !important;
        box-shadow: 0 2px 12px rgba(255, 215, 0, 0.5) !important;
    }

    /* Hide badge glow on mobile */
    .badge-glow {
        display: none !important;
    }

    .badge-content {
        box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3) !important;
    }

    .btn-prestige-modern {
        width: 100% !important;
        padding: 16px 14px !important;
        font-size: 1em !important;
        box-shadow: none !important;
        animation: none !important;
        border-radius: 12px !important;
        letter-spacing: 0.5px !important;
    }

    /* Prestige info cards — no content cutoff */
    .prestige-current,
    .prestige-rewards,
    .prestige-keeps,
    .prestige-resets,
    .prestige-requirements {
        padding: 12px 10px !important;
        margin-bottom: 10px !important;
        overflow: visible !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .prestige-info {
        overflow: visible !important;
    }

    .prestige-info ul {
        overflow: visible !important;
    }

    .prestige-info li {
        font-size: 0.85em !important;
        padding: 5px 0 !important;
        overflow: visible !important;
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    .prestige-description {
        font-size: 0.88em !important;
        line-height: 1.5 !important;
    }

    /* Benefits grid — 2 columns on mobile to fit better */
    .benefits-grid-modern {
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
    }

    .benefit-card-modern {
        padding: 12px 8px !important;
    }

    .benefit-icon-large {
        font-size: 1.6em !important;
    }

    .benefit-value {
        font-size: 1.2em !important;
    }

    .benefit-name {
        font-size: 0.85em !important;
    }

    .benefit-detail {
        font-size: 0.75em !important;
    }

    /* Progress cards — stack vertically */
    .prestige-progress-section {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .progress-card {
        padding: 14px 12px !important;
    }

    .progress-icon {
        font-size: 2em !important;
        min-width: 44px !important;
    }

    /* Progression table — scrollable, no cutoff */
    .prestige-progression-table {
        padding: 12px 8px !important;
        overflow: visible !important;
    }

    .progression-table-scroll {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    .progression-table th,
    .progression-table td {
        padding: 8px 6px !important;
        font-size: 0.85em !important;
    }

    /* Prestige hint */
    .prestige-hint-modern {
        padding: 12px !important;
        font-size: 0.9em !important;
    }

    /* ══════════════════════════════════════════════════════════
       53. STATISTICS — full readable text, no truncation
       ══════════════════════════════════════════════════════════ */
    .stats-hero-row {
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
    }

    .stats-hero-card {
        padding: 8px 6px !important;
        text-align: center !important;
    }

    .hero-value {
        font-size: 0.9em !important;
        word-break: break-word !important;
    }

    .hero-label {
        font-size: 0.65em !important;
    }

    .stats-sections-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    /* Stat rows — two-column grid: label fills space, value on right */
    .stats-card-body .stat-row {
        display: grid !important;
        grid-template-columns: 1fr auto !important;
        align-items: center !important;
        padding: 5px 8px !important;
        font-size: 0.8em !important;
        gap: 10px !important;
    }

    .stats-card-body .stat-row > span:first-child {
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        min-width: 0 !important;
    }

    .stats-card-body .stat-val {
        text-align: right !important;
        white-space: nowrap !important;
        font-weight: 600 !important;
    }

    /* ══════════════════════════════════════════════════════════
       54. LEADERBOARD — full text visible on tabs
       ══════════════════════════════════════════════════════════ */
    .leaderboard-tabs {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 4px !important;
        justify-content: center !important;
    }

    .lb-tab {
        padding: 6px 10px !important;
        font-size: 0.72em !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        overflow: visible !important;
        text-overflow: unset !important;
        min-width: auto !important;
        flex: 0 0 auto !important;
    }

    .lb-tab-label {
        font-size: 0.85em !important;
    }

    .lb-table {
        font-size: 0.78em !important;
    }

    .lb-table th,
    .lb-table td {
        padding: 6px 4px !important;
    }

    /* ══════════════════════════════════════════════════════════
       55. TUTORIAL — tooltip fits mobile
       ══════════════════════════════════════════════════════════ */
    .tut-tooltip {
        width: calc(100vw - 32px) !important;
        max-width: 320px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .tut-tooltip.tut-floating {
        top: 40% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
    }

    /* ══════════════════════════════════════════════════════════
       56. GLOBAL SCROLL FIX — bottom padding for nav bar
       Prevents content from being hidden behind bottom nav
       ══════════════════════════════════════════════════════════ */
    #content-area {
        padding-bottom: calc(75px + env(safe-area-inset-bottom)) !important;
    }

    #tab-content {
        padding-bottom: 20px !important;
    }

    /* Scrollable containers — remove max-height constraint,
       let normal page scroll work instead */
    .inventory-grid,
    .territory-grid,
    .achievement-grid,
    #vendor-grid,
    .gathering-nodes,
    .crafting-recipes-list,
    .recipes-grid {
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* ── Bottom nav: HIDDEN on desktop ── */
.mobile-bottom-nav {
    display: none;
}

/* ========================================
   AVATAR SELECTION SYSTEM
   ======================================== */

.player-avatar-container {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 0 auto 15px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.player-avatar-container:hover {
    transform: scale(1.05);
}

.player-avatar-container:hover .avatar-edit-badge {
    opacity: 1;
}

.avatar-edit-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--purple-medium);
    border: 2px solid var(--purple-light);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 1;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.modal.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mqFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: var(--glass-solid);
    backdrop-filter: var(--blur-strong);
    border: 2px solid var(--purple-light);
    border-radius: 16px;
    padding: 0;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    background: var(--glass-medium);
    backdrop-filter: var(--blur-medium);
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(155, 127, 199, 0.5);
}

.modal-header h2 {
    margin: 0;
    color: var(--text-white);
    font-size: 1.5em;
    text-shadow: 
        0 0 15px rgba(155, 127, 199, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-light);
    font-size: 1.8em;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-white);
    transform: rotate(90deg);
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Avatar grid */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
}

.avatar-option {
    position: relative;
    aspect-ratio: 1;
    border: 3px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--glass-medium);
}

.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-option:hover {
    border-color: var(--purple-light);
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(155, 127, 199, 0.5);
}

.avatar-option.selected {
    border-color: var(--purple-light);
    box-shadow: 0 0 20px rgba(155, 127, 199, 0.8);
    background: var(--purple-dark);
}

.avatar-checkmark {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--purple-light);
    color: var(--text-white);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.avatar-option.selected .avatar-checkmark {
    opacity: 1;
}

/* ========================================
   MAIN GAME BACKGROUND
   Works with any resolution (1920×1080, 1600×900, etc)
   ======================================== */

.game-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    
    /* Static fallback (shows while video loads or if video disabled) */
    background-image: url('../assets/ui/backgrounds/main_background.png');
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-color: #0f0e17;
}

/* Video background */
.bg-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.85;
    filter: brightness(0.75) saturate(1.4);
    transition: opacity 0.6s ease;
}

.bg-video-hidden {
    display: none;
}

/* Subtle overlay — just enough contrast for text, not hiding the video */
.game-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(15, 14, 23, 0.25) 0%,
        rgba(15, 14, 23, 0.15) 40%,
        rgba(15, 14, 23, 0.30) 100%
    );
    z-index: 1;
}

.game-container {
    position: relative;
    z-index: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    background: var(--glass-light);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(155, 127, 199, 0.3);
    border-radius: 16px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Main Header */
header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    font-size: 2.5rem;
    color: var(--text-white);
    text-shadow: 
        0 0 20px rgba(155, 127, 199, 0.6),
        0 0 40px rgba(155, 127, 199, 0.4);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-medium);
    text-shadow: 0 0 10px rgba(155, 127, 199, 0.3);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Panels */
.panel {
    background: var(--glass-light);
    backdrop-filter: var(--blur-medium);
    border: 2px solid rgba(155, 127, 199, 0.4);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.4),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}

.panel h2,
.panel h3 {
    color: var(--purple-light);
    text-shadow: 
        0 0 12px rgba(155, 127, 199, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

.panel p,
.panel span,
.panel label {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Player Info Panel (OLD - not used, kept for compatibility) */
#player-panel {
    display: none;
}

/* Player Info Panel (NEW - Full version in content area) */
#player-panel-full {
    margin-bottom: 20px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(155, 127, 199, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
}

.player-info {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

/* Hidden on desktop — shown via mobile @media */
.mobile-settings-btn {
    display: none;
}

#player-name {
    font-size: 1.8rem;
    color: var(--purple-light);
    text-shadow: 
        0 0 20px rgba(155, 127, 199, 0.8),
        0 2px 8px rgba(0, 0, 0, 1);
    margin-bottom: 5px;
}

#player-realm-level {
    font-size: 1.1rem;
    color: var(--text-medium);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.player-dao-path {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-top: 2px;
    text-shadow: 0 0 8px currentColor;
}

.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ========================================
   STYLIZED ORNAMENTAL BARS v2
   Tighter integration, more visual effects
   ======================================== */

.stat-bar-wrapper {
    display: grid;
    grid-template-columns: 64px 1fr 64px;
    align-items: center;
    gap: 0; /* ZERO gap for tight integration */
    width: 100%;
    margin: 20px 0;
    position: relative;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.6));
}

/* Ornaments - Colored glows by type */
.bar-ornament-left,
.bar-ornament-right {
    width: 64px;
    height: 64px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    position: relative;
    z-index: 5;
    transition: all 0.3s ease;
}

/* Slight overlap effect - ornaments extend INTO bar area */
.bar-ornament-left {
    margin-right: -8px; /* Overlaps bar slightly */
}

.bar-ornament-right {
    margin-left: -8px; /* Overlaps bar slightly */
}

/* HP ornaments - Green glow */
.bar-ornament-left.hp,
.bar-ornament-right.hp {
    filter: drop-shadow(0 0 12px rgba(46, 204, 113, 0.7));
}

.bar-ornament-left.hp {
    background-image: url('../assets/ui/bars/hp_ornament_left.png');
}

.bar-ornament-right.hp {
    background-image: url('../assets/ui/bars/hp_ornament_right.png');
}

/* Qi ornaments - Blue glow */
.bar-ornament-left.qi,
.bar-ornament-right.qi {
    filter: drop-shadow(0 0 12px rgba(52, 152, 219, 0.7));
}

.bar-ornament-left.qi {
    background-image: url('../assets/ui/bars/qi_ornament_left.png');
}

.bar-ornament-right.qi {
    background-image: url('../assets/ui/bars/qi_ornament_right.png');
}

/* EXP ornaments - Gold glow */
.bar-ornament-left.exp,
.bar-ornament-right.exp {
    filter: drop-shadow(0 0 12px rgba(243, 156, 18, 0.8));
}

.bar-ornament-left.exp {
    background-image: url('../assets/ui/bars/exp_ornament_left.png');
}

.bar-ornament-right.exp {
    background-image: url('../assets/ui/bars/exp_ornament_right.png');
}

/* Enhanced hover effect */
.stat-bar-wrapper:hover .bar-ornament-left,
.stat-bar-wrapper:hover .bar-ornament-right {
    transform: scale(1.15);
}

/* HP ornaments glow brighter on hover */
.stat-bar-wrapper:hover .bar-ornament-left.hp,
.stat-bar-wrapper:hover .bar-ornament-right.hp {
    filter: drop-shadow(0 0 18px rgba(46, 204, 113, 1));
}

/* Qi ornaments glow brighter on hover */
.stat-bar-wrapper:hover .bar-ornament-left.qi,
.stat-bar-wrapper:hover .bar-ornament-right.qi {
    filter: drop-shadow(0 0 18px rgba(52, 152, 219, 1));
}

/* EXP ornaments glow brighter on hover */
.stat-bar-wrapper:hover .bar-ornament-left.exp,
.stat-bar-wrapper:hover .bar-ornament-right.exp {
    filter: drop-shadow(0 0 18px rgba(243, 156, 18, 1));
}

/* HIGHLY STYLIZED BAR CONTAINER - Enhanced with pattern */
.bar-center {
    position: relative;
    height: 40px;
    
    /* Multi-layer background with subtle pattern */
    background: 
        /* Subtle stripe pattern for empty area */
        repeating-linear-gradient(
            90deg,
            rgba(255, 255, 255, 0.015) 0px,
            rgba(255, 255, 255, 0.015) 12px,
            transparent 12px,
            transparent 24px
        ),
        /* Dark gradient base */
        linear-gradient(180deg,
            rgba(0, 0, 0, 0.9) 0%,
            rgba(20, 20, 30, 0.95) 50%,
            rgba(0, 0, 0, 0.9) 100%
        );
    
    background-size: 24px 100%, 100% 100%;
    animation: subtleShift 20s linear infinite;
    
    border-radius: 20px;
    overflow: hidden;
    z-index: 1;
    
    /* Stronger outer border */
    border: 2px solid rgba(255, 255, 255, 0.15);
    
    box-shadow: 
        inset 0 3px 8px rgba(0, 0, 0, 0.8),
        inset 0 -2px 4px rgba(255, 255, 255, 0.05),
        0 0 20px rgba(0, 0, 0, 0.5);
}

/* Subtle pattern animation */
@keyframes subtleShift {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 24px 0, 0 0; }
}

/* Inner decorative border for premium look */
.bar-center::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    right: 2px;
    bottom: 2px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 10;
}

/* STYLIZED BAR FILLS with multiple effects */
.bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0%;
    border-radius: 20px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* === STAT BARS - CORES CONTEXTUAIS === */
/* HP bar - Combat Red Theme */
.bar-fill.hp {
    background: linear-gradient(90deg, var(--combat-primary), #DC2626, #EF4444);
    box-shadow: 
        0 0 12px rgba(244, 63, 94, 0.6),
        inset 0 4px 8px rgba(255, 255, 255, 0.4),
        inset 0 -4px 8px rgba(0, 0, 0, 0.4);
}

/* Qi bar - Cultivation Purple Theme */
.bar-fill.qi {
    background: linear-gradient(90deg, var(--cultivation-primary), #7C3AED, #8B5CF6);
    box-shadow: 
        0 0 12px rgba(168, 85, 247, 0.6),
        inset 0 4px 8px rgba(255, 255, 255, 0.4),
        inset 0 -4px 8px rgba(0, 0, 0, 0.4);
}

/* EXP bar - Treasure Gold Theme */
.bar-fill.exp {
    background: linear-gradient(90deg, var(--treasure-primary), #F59E0B, #FCD34D);
    box-shadow: 
        0 0 12px rgba(155, 127, 199, 0.6),
        inset 0 4px 8px rgba(255, 255, 255, 0.5),
        inset 0 -4px 8px rgba(0, 0, 0, 0.4);
}

/* Animated shine effect on bars */
.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    animation: barShine 4s ease-in-out infinite;
}

@keyframes barShine {
    0% { left: -100%; }
    50% { left: 150%; }
    100% { left: 150%; }
}

/* Glowing particles effect on bar edge */
.bar-fill::before {
    content: '';
    position: absolute;
    right: -3px;
    top: 0;
    width: 6px;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        rgba(255, 255, 255, 0.8) 0%,
        rgba(255, 255, 255, 0.4) 50%,
        transparent 100%
    );
    filter: blur(2px);
}

/* STYLIZED TEXT with stronger shadows */
.bar-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 900;
    font-size: 1em;
    color: #ffffff;
    text-shadow: 
        0 0 8px rgba(0, 0, 0, 1),
        2px 2px 6px rgba(0, 0, 0, 1),
        -1px -1px 3px rgba(0, 0, 0, 0.9),
        0 0 15px rgba(0, 0, 0, 0.7);
    z-index: 15;
    white-space: nowrap;
    letter-spacing: 1px;
    pointer-events: none;
}

/* Pulsing glow on low HP */
@keyframes lowHpPulse {
    0%, 100% {
        box-shadow: 
            0 0 20px rgba(231, 76, 60, 0.8),
            inset 0 2px 4px rgba(255, 255, 255, 0.4),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 
            0 0 35px rgba(231, 76, 60, 1),
            0 0 50px rgba(231, 76, 60, 0.6),
            inset 0 2px 4px rgba(255, 255, 255, 0.4),
            inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    }
}

.bar-fill.hp.low-hp {
    animation: lowHpPulse 1s ease-in-out infinite;
}

/* Legacy support for old stat-bar-container */
.stat-bar-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.stat-value {
    color: var(--accent-color);
    text-shadow: 
        0 0 10px rgba(155, 127, 199, 0.5),
        0 2px 4px rgba(0, 0, 0, 0.9);
}

/* Resources Panel (OLD - not used, kept for compatibility) */
#resources-panel {
    display: none;
}

/* Resources Panel (NEW - Inline version) is styled as #resources-panel-inline above */

.resource-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-bg);
    padding: 12px 20px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    flex: 1;
}

.resource-icon {
    font-size: 1.5rem;
}

.resource-label {
    color: var(--secondary-text);
    font-size: 0.9rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.resource-value {
    margin-left: auto;
    color: var(--text-white);
    font-size: 1.2rem;
    font-weight: 700;
    text-shadow: 
        0 0 10px rgba(255, 255, 255, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.9);
}


/* ========================================
   ICON SIZING - Context-specific
   ======================================== */

/* Currency icons keep their color but subtle glow */
.currency-icon {
    width: 32px !important;
    height: 32px !important;
    object-fit: contain;
    vertical-align: middle;
    filter: 
        brightness(0.8) 
        saturate(0.7)
        drop-shadow(0 0 6px rgba(184, 149, 106, 0.3));
}

.currency-icon-emoji {
    font-size: 1.5em;
}

/* Inventory grid icons - MEDIUM */
.item-icon-container {
    width: 64px;
    height: 64px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.item-icon-img {
    width: 64px !important;
    height: 64px !important;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.item-icon-img:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
}

/* Vendor/Card header icons - MEDIUM-LARGE */
.vendor-item .item-icon-img {
    width: 72px !important;
    height: 72px !important;
}

/* Crafting ingredient icons - SMALL */
.ingredient-icon,
.ingredient-icon-img {
    width: 24px !important;
    height: 24px !important;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
}

.ingredient-icon-emoji {
    font-size: 1.2em;
    margin-right: 6px;
}

/* Crafting recipe main icon - LARGE */
.recipe-icon-large {
    width: 80px !important;
    height: 80px !important;
    object-fit: contain;
    display: block;
    margin: 0 auto 15px;
}

/* Emoji fallback sizes */
.item-icon-emoji {
    font-size: 3em;
}

/* ========================================
   CARD LAYOUT - Flex for buttons at bottom
   ======================================== */

.skill-card,
.recipe-card,
.enemy-card,
.vendor-item,
.territory-card {
    display: flex;
    flex-direction: column;
}

/* Card titles — inherit tab accent */
.skill-card h3,
.vendor-item h4,
.recipe-card h4 {
    color: var(--tab-accent, var(--purple-light));
    text-shadow: 
        0 0 12px rgba(var(--tab-accent-rgb, 155, 127, 199), 0.6),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

/* Card text readability */
.skill-card p,
.vendor-item p,
.recipe-card p {
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

/* Card content area (grows to push button down) */
.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    color: var(--primary-text);
}

/* Button container at bottom */
.card-actions {
    margin-top: auto;
    padding-top: 8px;
    display: flex;
    gap: 6px;
    width: 100%;
}

/* Ensure buttons same size */
.btn-train-skill,
.btn-craft,
.btn-gather,
.btn-attack,
.btn-buy,
.btn-sell {
    width: 100%;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    border: 2px solid;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Primary action buttons - Purple theme */
.btn-train-skill,
.btn-craft,
.btn-gather,
.btn-cultivate {
    background: linear-gradient(135deg, 
        var(--purple-dark), 
        var(--purple-medium));
    color: var(--text-white);
    border-color: var(--purple-light);
    box-shadow: 
        0 4px 12px rgba(125, 91, 166, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-train-skill:hover:not(:disabled),
.btn-craft:hover:not(:disabled),
.btn-gather:hover:not(:disabled) {
    background: linear-gradient(135deg, 
        var(--purple-medium), 
        var(--purple-light));
    box-shadow: 
        0 6px 18px rgba(155, 127, 199, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Secondary buttons - Blue theme */
.btn-buy,
.btn-attack {
    background: linear-gradient(135deg, 
        var(--blue-dark), 
        var(--blue-light));
    color: var(--text-white);
    border-color: var(--blue-light);
    box-shadow: 
        0 4px 12px rgba(106, 140, 199, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-buy:hover:not(:disabled),
.btn-attack:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--blue-light), #89b5f0);
    box-shadow: 
        0 6px 18px rgba(106, 140, 199, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* Danger/sell buttons - Neutral */
.btn-sell {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    color: var(--text-white);
    border-color: #95a5a6;
    box-shadow: 0 4px 12px rgba(127, 140, 141, 0.3);
}

.btn-sell:hover:not(:disabled) {
    background: linear-gradient(135deg, #95a5a6, #a8b4b6);
    transform: translateY(-2px);
}

/* Tab Navigation (OLD - Hidden, using sidebar now) */
#tab-navigation {
    display: none;
}

#tab-navigation::-webkit-scrollbar {
    height: 6px;
}

#tab-navigation::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

#tab-navigation::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

.tab-button {
    padding: 12px 24px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(6px);
    border: 2px solid transparent;
    color: var(--text-medium);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    border-radius: 8px 8px 0 0;
}

.tab-button:hover {
    background: var(--glass-light);
    border-color: rgba(155, 127, 199, 0.4);
    color: var(--purple-light);
}

.tab-button.active {
    background: var(--purple-medium);
    color: var(--text-white);
    border-color: var(--purple-light);
    box-shadow: 
        0 0 20px rgba(155, 127, 199, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#tab-content {
    min-height: 400px;
    padding: 20px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(6px);
    border-radius: 8px;
    border: 1px solid rgba(155, 127, 199, 0.2);
}

/* Event Log - HIDDEN (was overlapping chat/UI) */
#event-log {
    display: none !important;
}

/* Event log header */
#event-log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(155, 127, 199, 0.3);
}

#event-log-title {
    font-weight: bold;
    color: var(--purple-light);
    text-shadow: 0 0 10px rgba(155, 127, 199, 0.6);
}

/* Event log can be minimized */
#event-log.minimized {
    max-height: 45px;
    overflow: hidden;
}

#event-log-toggle {
    background: transparent;
    border: none;
    color: var(--text-medium);
    cursor: pointer;
    font-size: 1.2em;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

#event-log-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
}

#event-log-content {
    max-height: 180px;
    overflow-y: auto;
}

/* Event entries */
.log-message,
.event-entry {
    padding: 6px 8px;
    margin: 4px 0;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.3);
    font-size: 0.85em;
    line-height: 1.4;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

/* Event types */
.event-success {
    border-left: 3px solid #2ecc71;
}

.event-warning {
    border-left: 3px solid #f39c12;
}

.event-error {
    border-left: 3px solid #e74c3c;
}

.event-info {
    border-left: 3px solid var(--blue-light);
}

/* Scrollbar styling */
#event-log::-webkit-scrollbar,
#event-log-content::-webkit-scrollbar {
    width: 6px;
}

#event-log::-webkit-scrollbar-track,
#event-log-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

#event-log::-webkit-scrollbar-thumb,
#event-log-content::-webkit-scrollbar-thumb {
    background: var(--purple-medium);
    border-radius: 3px;
}

.log-container {
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.log-message {
    display: flex;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.log-timestamp {
    color: var(--secondary-text);
    font-family: monospace;
    white-space: nowrap;
}

.log-text {
    color: var(--primary-text);
}

/* Scrollbar Styling */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: var(--primary-bg);
}

.log-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: var(--accent-color);
    color: var(--primary-bg);
}

.btn-primary:hover {
    background: #00b8e6;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 212, 255, 0.4);
}

.btn-secondary {
    background: var(--accent-bg);
    color: var(--primary-text);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Danger button for delete/reset */
.btn-danger {
    background: var(--danger-color);
    color: white;
    border: 1px solid var(--danger-color);
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Cultivation Button */
.btn-cultivate {
    padding: 20px 40px;
    border: 2px solid var(--accent-color);
    border-radius: 10px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(135deg, 
        var(--purple-dark), 
        var(--purple-light));
    color: var(--text-white);
    box-shadow: 0 0 20px rgba(155, 127, 199, 0.5);
    position: relative;
    overflow: hidden;
}

.btn-cultivate:hover:not(:disabled) {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 0 30px rgba(155, 127, 199, 0.8);
}

.btn-cultivate:active:not(:disabled) {
    transform: translateY(-1px) scale(0.98);
}

.btn-cultivate:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    background: var(--secondary-bg);
    color: var(--secondary-text);
    border-color: var(--border-color);
    box-shadow: none;
}

.btn-cultivate.cooldown {
    background: var(--secondary-bg);
    color: var(--danger-color);
    border-color: var(--danger-color);
}

.btn-cultivate.disabled {
    background: var(--secondary-bg);
    color: var(--secondary-text);
}

/* Cards */
.card {
    background: var(--accent-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 0 15px rgba(0, 212, 255, 0.2);
}

.card-header {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

/* ========================================
   UTILITY CLASSES — Inline Style Migration
   ======================================== */

/* Accent-colored highlight text */
.stat-highlight {
    color: var(--tab-accent, var(--accent-color));
    font-weight: bold;
}

/* Training progress card */
.card-training-active {
    margin-bottom: 20px;
    border: 2px solid var(--tab-accent, var(--accent-color));
}
.card-training-active .training-label {
    margin-bottom: 10px;
    color: var(--primary-text);
}

/* Locked skills divider in grid */
.locked-skills-divider {
    grid-column: 1 / -1;
}
.locked-skills-divider h3 {
    color: var(--combat-primary);
    margin-top: 20px;
    margin-bottom: 15px;
}

/* Danger zone card (settings) */
.card-danger {
    margin-top: 20px;
    border: 2px solid var(--combat-primary);
}
.card-danger .card-header {
    color: var(--combat-primary);
}

/* Spacing helpers */
.mt-sm { margin-top: 10px; }
.mb-sm { margin-bottom: 10px; }
.mb-md { margin-bottom: 20px; }

/* Muted text */
.text-muted {
    color: var(--secondary-text);
}
.text-success {
    color: var(--growth-primary);
}

/* Progress Bars */
.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--primary-bg);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    margin: 10px 0;
    border: 1px solid var(--border-color);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
}

.progress-text {
    position: absolute;
    width: 100%;
    text-align: center;
    line-height: 24px;
    color: var(--primary-text);
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Stats Display */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.stat-item {
    background: var(--primary-bg);
    padding: 15px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-color);
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-bg);
    padding: 15px 20px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    max-width: 300px;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

/* Responsive UI */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .notification {
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* PROMPT 9: Skills Grid Layout */
.skills-overview {
    display: flex;
    gap: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 20px;
}

.skills-overview p {
    margin: 0;
    font-size: 1.1em;
}

/* ========================================
   GRID LAYOUTS - Optimized spacing
   ======================================== */

.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    padding: 25px;
}

/* enemy grid is defined in Combat section below */

.crafting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    padding: 25px;
}

#vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    padding: 25px;
}

.territories-grid,
#territories-container {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 14px !important;
    padding: 14px !important;
    max-width: 960px;
    margin: 0 auto;
}

/* ========================================
   UNIVERSAL CARD SYSTEM - Unified Base
   Uses contextual --tab-accent colors
   ======================================== */

/* Base card styling */
.game-card,
.skill-card,
.enemy-card,
.vendor-item,
.recipe-card {
    background: linear-gradient(135deg, 
        rgba(30, 25, 35, 0.95), 
        rgba(20, 15, 25, 0.95));
    border: 2px solid rgba(var(--tab-accent-rgb, 155, 127, 199), 0.35);
    border-radius: 12px;
    padding: 20px;
    margin: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    backdrop-filter: var(--blur-medium);
}
/* Territory card — compact, NO margin (grid gap handles spacing) */
.territory-card {
    background: linear-gradient(135deg, 
        rgba(30, 25, 35, 0.95), 
        rgba(20, 15, 25, 0.95));
    border: 2px solid rgba(var(--tab-accent-rgb, 155, 127, 199), 0.35);
    border-radius: 10px;
    padding: 10px;
    margin: 0;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    transition: all 0.3s ease;
    backdrop-filter: var(--blur-medium);
}

.game-card:hover,
.skill-card:hover:not(.locked),
.enemy-card:hover,
.vendor-item:hover,
.recipe-card:hover {
    transform: translateY(-4px);
    border-color: rgba(var(--tab-accent-rgb, 155, 127, 199), 0.7);
    box-shadow: 
        0 8px 25px rgba(var(--tab-accent-rgb, 155, 127, 199), 0.25),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
}
.territory-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--tab-accent-rgb, 155, 127, 199), 0.7);
    box-shadow: 0 6px 20px rgba(var(--tab-accent-rgb, 155, 127, 199), 0.2);
}

/* Specific card sizes */
.skill-card {
    width: 280px;
    min-height: 400px;
    position: relative;
}

.skill-card.locked {
    opacity: 0.6;
    filter: grayscale(70%);
}

.enemy-card {
    width: auto;
    min-height: auto;
    text-align: center;
}

.vendor-item {
    width: 300px;
    min-height: 350px;
}

.recipe-card {
    width: 280px;
    min-height: 450px;
}

/* Recipe card internal layout alignment */
.recipe-card .card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: center;
}

.recipe-card .recipe-description {
    min-height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88em;
    color: #aab;
    line-height: 1.4;
    margin-bottom: 12px;
}

.recipe-card .recipe-info {
    flex-shrink: 0;
}

.recipe-card .recipe-ingredients {
    text-align: left;
    flex-shrink: 0;
}

.recipe-card .card-actions {
    margin-top: auto;
    padding-top: 10px;
}

.recipe-card .recipe-tier-badge {
    display: inline-block;
    margin: 0 auto 8px;
    padding: 3px 12px;
    border-radius: 10px;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

/* territory-card sizing already defined above — no width/min-height needed */

.territory-card.conquered {
    border-image: linear-gradient(135deg, #4caf50, #66bb6a) 1;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.skill-header.locked {
    opacity: 0.6;
}

/* Skill icon container */
.skill-icon-container {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

/* Skill icon image */
.skill-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.5));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.skill-icon-img:hover {
    transform: scale(1.1);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8));
}

/* Emoji fallback */
.skill-icon-emoji {
    font-size: 4em;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

/* Locked skill icons */
.skill-card.locked .skill-icon-img {
    filter: grayscale(100%) drop-shadow(0 0 5px rgba(255, 255, 255, 0.2));
}

.skill-card.locked .skill-icon-emoji {
    filter: grayscale(100%);
    opacity: 0.6;
}


/* Item icon container */
.item-icon-container {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Item icon image */
.item-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.item-icon-img:hover {
    transform: scale(1.15);
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.6));
}

/* Smaller icons for ingredients/recipes */
.ingredient-icon-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 8px;
}

/* Emoji fallback for items */
.item-icon-emoji {
    font-size: 3em;
}
.skill-title {
    flex: 1;
}

.skill-title h3 {
    margin: 0 0 5px 0;
    color: var(--accent-color);
    font-size: 1.3em;
}

.skill-level {
    font-size: 0.9em;
    color: #aaa;
}

.skill-description {
    font-size: 0.95em;
    color: #ccc;
    margin-bottom: 10px;
    line-height: 1.4;
}

.unlock-requirement {
    color: var(--danger-color);
    font-weight: bold;
    font-size: 1.1em;
    margin: 10px 0;
}

.skill-category {
    margin: 10px 0;
}

.category-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.category-badge.offensive { 
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
}

.category-badge.crafting { 
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    color: white;
}

.category-badge.gathering { 
    background: linear-gradient(135deg, #2196F3, #1565C0);
    color: white;
}

.category-badge.support { 
    background: linear-gradient(135deg, #9C27B0, #6A1B9A);
    color: white;
}

.skill-progress {
    margin: 15px 0;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #aaa;
}

.bar {
    width: 100%;
    height: 22px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 11px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bar-fill {
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 11px;
}

.bar-fill.skill-exp {
    background: linear-gradient(90deg, #2196F3, #00BCD4, #4FC3F7);
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.5);
}

.skill-benefits {
    margin: 15px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid var(--accent-color);
    border-radius: 4px;
    font-size: 0.9em;
}

.skill-benefits strong {
    color: var(--accent-color);
}

.skill-benefits p {
    margin: 5px 0 0 0;
    color: #4CAF50;
}

.skill-milestone {
    margin: 10px 0;
}

.milestone-next {
    display: block;
    font-size: 0.9em;
    color: #00ff00;
    padding: 8px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 4px;
    border-left: 3px solid #00ff00;
}

.btn-train-skill {
    width: 100%;
    padding: 12px;
    margin-top: auto;
    background: linear-gradient(135deg, 
        var(--purple-dark), 
        var(--purple-medium));
    color: var(--text-white);
    border: 2px solid var(--purple-light);
    border-radius: 6px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(125, 91, 166, 0.4);
}

.btn-train-skill:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(155, 127, 199, 0.6);
    background: linear-gradient(135deg, 
        var(--purple-medium), 
        var(--purple-light));
}

.btn-train-skill:disabled,
.btn-train-skill.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #444);
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* PROMPT 10: Crafting System Styles */
.skill-subtabs {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.subtab-btn {
    flex: 1;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 6px;
    color: var(--primary-text);
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
}

.subtab-btn:hover {
    border-color: var(--accent-color);
    background: rgba(255, 215, 0, 0.1);
}

.subtab-btn.active {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 215, 0, 0.1));
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

/* Subtab icon sizing */
.subtab-icon {
    width: 20px;
    height: 20px;
    margin-right: 4px;
    vertical-align: middle;
}

/* ========================================
   AUTO-CYCLE EXPLAINER CARD
   ======================================== */

.cycle-explainer {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(233, 69, 96, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    margin: 10px 0 16px;
    transition: all 0.3s ease;
}
.cycle-explainer.cycle-active {
    border-color: rgba(233, 69, 96, 0.6);
    background: rgba(233, 69, 96, 0.08);
    box-shadow: 0 0 15px rgba(233, 69, 96, 0.15);
}

.cycle-explainer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}
.cycle-explainer-title {
    font-weight: 700;
    font-size: 0.95em;
    color: #e94560;
}
.cycle-explainer-desc {
    font-size: 0.82em;
    color: var(--secondary-text);
    margin: 0 0 6px;
    line-height: 1.4;
}

.cycle-status {
    font-size: 0.85em;
    color: var(--primary-text);
    padding: 6px 10px;
    background: rgba(233, 69, 96, 0.1);
    border-radius: 6px;
    margin-bottom: 6px;
}
.cycle-status-label {
    color: var(--secondary-text);
}
.cycle-status-count {
    color: var(--secondary-text);
    font-size: 0.9em;
}

.cycle-warning {
    font-size: 0.78em;
    color: #e9a545;
    opacity: 0.8;
}

/* Cycle button — CSS-only, no inline styles */
.btn-cycle-train {
    padding: 4px 14px;
    font-size: 0.85em;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid #e94560;
    background: transparent;
    color: #e94560;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.btn-cycle-train:hover {
    background: rgba(233, 69, 96, 0.15);
    box-shadow: 0 0 10px rgba(233, 69, 96, 0.3);
}
.btn-cycle-train.active {
    background: #e94560;
    color: #fff;
    box-shadow: 0 0 12px rgba(233, 69, 96, 0.5);
}

.crafting-hint {
    color: var(--secondary-text);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.recipes-grid,
.crafting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    padding: 25px;
}

/* CRAFTING CARDS - Using universal .game-card styles above */

/* Remove the ::before overlay that might hide frames */
.recipe-card::before {
    display: none;
}

.recipe-card > * {
    position: relative;
    z-index: 1;
}

.recipe-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.recipe-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 10px rgba(76, 175, 80, 0.5));
}

.recipe-title {
    flex: 1;
}

.recipe-title h3 {
    margin: 0 0 5px 0;
    color: #4CAF50;
    font-size: 1.2em;
}

.recipe-description {
    font-size: 0.9em;
    color: #aaa;
    margin: 0;
    line-height: 1.4;
}

.recipe-info {
    display: flex;
    justify-content: space-around;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9em;
    gap: 10px;
}

.recipe-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.recipe-ingredients {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #4CAF50;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
    line-height: 1.6;
}

.recipe-ingredients strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 5px;
}

.no-recipes {
    text-align: center;
    padding: 40px 20px;
    color: var(--secondary-text);
    font-size: 1.1em;
}

.btn-craft {
    width: 100%;
    padding: 12px;
    margin-top: auto;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-craft:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.5);
    background: linear-gradient(135deg, #5CBF60, #42A5F5);
}

.btn-craft:disabled,
.btn-craft.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #444);
}

.crafting-progress-card {
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.3);
}

.craft-header {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-bottom: 10px;
}

.craft-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 15px rgba(76, 175, 80, 0.7));
    animation: pulse 2s infinite;
}

.craft-header h3 {
    margin: 0;
    color: #4CAF50;
    font-size: 1.5em;
}

.craft-progress-fill {
    background: linear-gradient(90deg, #4CAF50, #66BB6A, #81C784);
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.7);
    animation: pulse 2s infinite;
}

/* PROMPT 10: Inventory Styles */

.inv-subtitle {
    color: var(--secondary-text);
    margin-bottom: 16px;
    font-size: 0.95em;
}

/* Category filter tabs */
.inv-category-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.inv-tab {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 8px 18px;
    color: var(--secondary-text);
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.inv-tab:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.inv-tab.active {
    background: rgba(255, 215, 0, 0.12);
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.inv-tab-count {
    background: rgba(255, 255, 255, 0.1);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.85em;
}

.inv-tab.active .inv-tab-count {
    background: rgba(255, 215, 0, 0.2);
}

.inv-empty {
    color: var(--secondary-text);
    text-align: center;
    padding: 40px;
    font-style: italic;
}

/* Inventory grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    padding: 4px 0;
}

.inventory-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid #666;
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    transition: all 0.25s;
    position: relative;
    overflow: hidden;
}

.inventory-item:hover {
    background: rgba(255, 255, 255, 0.07);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Rarity border colors */
.inv-rarity-common { border-left-color: #888; }
.inv-rarity-uncommon { border-left-color: #4CAF50; }
.inv-rarity-rare { border-left-color: #2196F3; }
.inv-rarity-epic { border-left-color: #9C27B0; }
.inv-rarity-legendary { border-left-color: #FFD700; }

.inv-rarity-uncommon:hover { box-shadow: 0 4px 16px rgba(76, 175, 80, 0.15); }
.inv-rarity-rare:hover { box-shadow: 0 4px 16px rgba(33, 150, 243, 0.15); }
.inv-rarity-epic:hover { box-shadow: 0 4px 16px rgba(156, 39, 176, 0.15); }
.inv-rarity-legendary:hover { box-shadow: 0 4px 16px rgba(255, 215, 0, 0.2); }

/* Rarity tag */
.inv-rarity-tag {
    position: absolute;
    top: 6px;
    right: 8px;
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    opacity: 0.7;
}

.inv-rarity-common .inv-rarity-tag { color: #888; }
.inv-rarity-uncommon .inv-rarity-tag { color: #4CAF50; }
.inv-rarity-rare .inv-rarity-tag { color: #2196F3; }
.inv-rarity-epic .inv-rarity-tag { color: #9C27B0; }
.inv-rarity-legendary .inv-rarity-tag { color: #FFD700; }

/* Item icon area */
.item-icon-container {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-icon-img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.2));
}

.item-icon-emoji {
    font-size: 2em;
}

/* Item info area */
.item-info {
    flex: 1;
    min-width: 0;
}

.inv-item-name {
    margin: 0 0 4px 0;
    color: var(--text-color);
    font-size: 0.95em;
    font-weight: 600;
}

.inv-rarity-uncommon .inv-item-name { color: #66BB6A; }
.inv-rarity-rare .inv-item-name { color: #42A5F5; }
.inv-rarity-epic .inv-item-name { color: #BA68C8; }
.inv-rarity-legendary .inv-item-name { color: #FFD700; }

.inv-item-desc {
    margin: 0 0 8px 0;
    color: var(--secondary-text);
    font-size: 0.78em;
    line-height: 1.4;
    opacity: 0.8;
}

/* Footer with amount + use button */
.inv-item-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-amount {
    margin: 0;
    color: var(--secondary-text);
    font-weight: bold;
    font-size: 0.9em;
}

/* Use button for consumables */
.inv-use-btn {
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.4);
    color: #66BB6A;
    padding: 3px 14px;
    border-radius: 4px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s;
}

.inv-use-btn:hover {
    background: rgba(76, 175, 80, 0.3);
    border-color: #66BB6A;
    box-shadow: 0 0 8px rgba(76, 175, 80, 0.3);
}

/* ─── Inventory v2 polish ─── */

/* Capacity bar */
.inv-capacity-bar {
    position: relative;
    height: 20px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    margin-bottom: 14px;
    overflow: hidden;
}

.inv-capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(192, 132, 252, 0.3), rgba(192, 132, 252, 0.5));
    border-radius: 10px;
    transition: width 0.4s ease;
}

.inv-capacity-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #D4D4D8;
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* Toolbar (tabs + sort) */
.inv-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.inv-toolbar .inv-category-tabs {
    margin-bottom: 0;
}

/* Sort dropdown */
.inv-sort-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.inv-sort-label {
    font-size: 0.78rem;
    color: #71717A;
}

.inv-sort-select {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    color: #D4D4D8;
    font-size: 0.8rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    cursor: pointer;
    outline: none;
}

.inv-sort-select:focus {
    border-color: rgba(192, 132, 252, 0.4);
}

.inv-sort-select option {
    background: #1a1625;
    color: #D4D4D8;
}

/* Discard button */
.inv-discard-btn {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 4px;
}

.inv-discard-btn:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: #EF4444;
    color: #EF4444;
}

/* PROMPT 11: Gathering System Styles */
.gathering-hint {
    color: var(--secondary-text);
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.gathering-progress-card {
    background: rgba(33, 150, 243, 0.1);
    border: 2px solid #2196F3;
    border-radius: 12px;
    padding: 30px;
    margin: 20px 0;
    box-shadow: 0 5px 20px rgba(33, 150, 243, 0.3);
}

.gather-header {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-content: center;
    margin-bottom: 10px;
}

.gather-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 15px rgba(33, 150, 243, 0.7));
    animation: pulse 2s infinite;
}

.gather-header h3 {
    margin: 0;
    color: #2196F3;
    font-size: 1.5em;
}

.gather-progress-fill {
    background: linear-gradient(90deg, #2196F3, #64B5F6, #90CAF9);
    box-shadow: 0 0 15px rgba(33, 150, 243, 0.7);
    animation: pulse 2s infinite;
}

.gathering-skill-section {
    margin-bottom: 30px;
}

.gathering-node-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.gathering-node-card:hover {
    border-color: #2196F3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.3);
}

.node-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: flex-start;
}

.node-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 10px rgba(33, 150, 243, 0.5));
}

.node-description {
    font-size: 0.9em;
    color: #aaa;
    margin: 5px 0 0 0;
    line-height: 1.4;
}

.node-info {
    display: flex;
    gap: 20px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.node-resources {
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #2196F3;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 0.9em;
    line-height: 1.6;
}

.node-resources strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 5px;
}

.node-actions {
    display: flex;
    gap: 10px;
}

.btn-gather {
    flex: 2;
    padding: 12px;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-gather:hover:not(:disabled) {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 0.5);
}

.btn-gather:disabled,
.btn-gather.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #444);
}

.btn-auto-gather {
    flex: 1;
    padding: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid #666;
    border-radius: 6px;
    font-weight: bold;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-auto-gather:hover {
    border-color: var(--purple-light);
    background: rgba(155, 127, 199, 0.1);
}

.btn-auto-gather.active {
    background: linear-gradient(135deg, 
        var(--purple-dark), 
        var(--purple-light));
    border-color: var(--purple-light);
    box-shadow: 0 0 15px rgba(155, 127, 199, 0.5);
}

.btn-auto-gather.disabled,
.btn-auto-gather:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

/* Gathering Section Header */
.gathering-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 25px 0 15px 0;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
}

.gathering-section-header h3 {
    color: var(--accent-color);
    margin: 0;
    font-size: 1.1em;
    letter-spacing: 1px;
}

.gathering-section-info {
    font-size: 0.85em;
    color: var(--secondary-text);
    background: rgba(0,0,0,0.3);
    padding: 4px 10px;
    border-radius: 12px;
}

/* Locked Gathering Node */
.gathering-node-locked {
    position: relative;
    border-color: #333 !important;
    pointer-events: none;
    filter: brightness(0.5) saturate(0.3);
}

.gathering-node-locked:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: #333 !important;
}

.gathering-locked-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    z-index: 5;
    pointer-events: auto;
    cursor: default;
}

.gathering-lock-icon {
    font-size: 2em;
    filter: drop-shadow(0 0 8px rgba(255, 180, 0, 0.4));
}

.gathering-lock-text {
    color: #ffb74d;
    font-weight: 600;
    font-size: 0.95em;
    letter-spacing: 0.3px;
}

.gathering-lock-bar {
    width: 120px;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.gathering-lock-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff9800, #ffb74d);
    border-radius: 3px;
    transition: width 0.3s;
}

.gathering-lock-pct {
    font-size: 0.8em;
    color: #999;
}

.resource-emoji-icon {
    font-size: 1em;
    margin-right: 2px;
}

/* ========================================
   PROMPT 12: EQUIPMENT SYSTEM STYLES
   ======================================== */

/* Equipment Slots Container */
.equipment-slots-container {
    margin-bottom: 30px;
}

.equipment-slots-container h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.equipment-slots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 30px;
}

.equipment-slot {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 20px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.equipment-slot:hover {
    border-color: #ffd700;
}

/* Empty Slot */
.empty-slot {
    text-align: center;
    opacity: 0.5;
}

.slot-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.slot-label {
    font-size: 0.9em;
    color: #aaa;
    text-transform: uppercase;
    font-weight: bold;
}

/* Equipped Item */
.equipped-item {
    display: flex;
    align-items: center;
    gap: 15px;
    width: 100%;
}

.equipped-item[data-tier="common"] {
    border-left: 3px solid #999;
    padding-left: 10px;
}

.equipped-item[data-tier="rare"] {
    border-left: 3px solid #4169E1;
    padding-left: 10px;
}

.equipped-item[data-tier="epic"] {
    border-left: 3px solid #9370DB;
    padding-left: 10px;
}

.equipped-item[data-tier="legendary"] {
    border-left: 3px solid #FFD700;
    padding-left: 10px;
}

.equipped-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* Equipment Icon Images (PNG) */
.equipment-icon-img {
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
}

.equipment-icon-img.equipped-size {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.equipment-icon-img.available-size {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.equipped-info {
    flex: 1;
}

.equipped-info strong {
    display: block;
    color: var(--accent-color);
    margin-bottom: 5px;
    font-size: 1.1em;
}

.item-stats {
    font-size: 0.85em;
    color: #66ff66;
    margin: 5px 0;
}

/* Unequip Button */
.btn-unequip {
    padding: 8px 15px;
    background: #ff4444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.9em;
}

.btn-unequip:hover {
    background: #ff6666;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 68, 68, 0.5);
}

/* Equipment Bonuses */
.equipment-bonuses {
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-left: 3px solid #ffd700;
    border-radius: 5px;
    margin-bottom: 30px;
}

.equipment-bonuses p {
    margin: 5px 0;
    color: var(--primary-text);
}

.equipment-bonuses strong {
    color: var(--accent-color);
}

/* Available Equipment Container */
.available-equipment-container {
    margin-top: 30px;
}

.available-equipment-container h3 {
    color: var(--accent-color);
    margin-bottom: 15px;
    font-size: 1.3em;
}

#available-equipment {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.no-equipment {
    text-align: center;
    color: var(--secondary-text);
    padding: 40px;
    font-size: 1.1em;
}

/* Equipment Item Card */
.equipment-item {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s;
}

.equipment-item:hover {
    border-color: #ffd700;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.equipment-item.tier-common { 
    border-left: 3px solid #999; 
}

.equipment-item.tier-rare { 
    border-left: 3px solid #4169E1; 
}

.equipment-item.tier-epic { 
    border-left: 3px solid #9370DB; 
}

.equipment-item.tier-legendary { 
    border-left: 3px solid #FFD700; 
}

.equip-item-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.3));
}

.equip-item-icon .equipment-icon-img {
    width: 80px;
    height: 80px;
}

/* Item Details */
.item-details {
    flex: 1;
}

.item-details strong {
    display: block;
    color: var(--accent-color);
    margin-bottom: 5px;
    font-size: 1.1em;
}

.item-tier {
    font-size: 0.8em;
    font-weight: bold;
    text-transform: uppercase;
    margin: 5px 0;
}

.tier-common { color: #999; }
.tier-rare { color: var(--blue-light); }
.tier-epic { color: var(--purple-light); }
.tier-legendary { color: var(--gold-warm); }

.item-description {
    font-size: 0.85em;
    color: #aaa;
    margin: 5px 0;
    line-height: 1.4;
}

/* Equip Button */
.btn-equip-item {
    padding: 10px 20px;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    font-size: 0.9em;
    white-space: nowrap;
}

.btn-equip-item:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.5);
}

.btn-equip-item:disabled,
.btn-equip-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #444);
}

/* ========================================
   PROMPT 13: BREAKTHROUGH SYSTEM STYLES
   ======================================== */

/* Breakthrough Section */
.breakthrough-section {
    margin-top: 30px;
    padding: 25px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(8px);
    border: 2px solid var(--gold-warm);
    border-radius: 15px;
}

/* Breakthrough Flash Animation */
@keyframes breakthroughFlash {
    0%, 100% { background-color: rgba(155, 127, 199, 0); }
    50% { background-color: rgba(155, 127, 199, 0.3); }
}

body.breakthrough-flash {
    animation: breakthroughFlash 1s ease 3;
}

/* Realm Comparison */
.realm-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 25px 0;
}

.realm-box {
    flex: 1;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
}

.realm-box.current {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #666;
}

.realm-box.next {
    background: var(--glass-light);
    border: 2px solid var(--gold-warm);
    box-shadow: 0 0 20px rgba(184, 149, 106, 0.3);
}

.realm-box h4 {
    color: var(--secondary-text);
    margin-bottom: 10px;
    font-size: 0.9em;
    text-transform: uppercase;
}

.realm-name {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--gold-warm);
    margin: 10px 0;
    text-shadow: 0 0 10px rgba(184, 149, 106, 0.4);
}

.realm-desc {
    font-size: 0.9em;
    color: #aaa;
    margin: 10px 0;
    line-height: 1.4;
}

.realm-cap {
    font-size: 0.85em;
    color: #66ff66;
    font-weight: bold;
    margin-top: 10px;
}

.arrow {
    font-size: 3em;
    color: var(--purple-light);
    text-shadow: 0 0 15px rgba(155, 127, 199, 0.7);
    animation: pulse 2s infinite;
}

/* Breakthrough Cost */
.breakthrough-cost {
    padding: 20px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(6px);
    border-left: 4px solid var(--gold-warm);
    border-radius: 8px;
    margin: 20px 0;
}

.breakthrough-cost h4 {
    color: var(--gold-warm);
    margin-bottom: 15px;
    font-size: 1.1em;
}

.breakthrough-cost p {
    margin: 8px 0;
    font-size: 1em;
    color: var(--primary-text);
}

.warning {
    color: #ff6666 !important;
    font-weight: bold;
    font-size: 1.05em !important;
}

/* Breakthrough Button */
.btn-breakthrough {
    width: 100%;
    padding: 20px;
    font-size: 1.3em;
    background: linear-gradient(135deg, var(--gold-dark), var(--gold-warm));
    color: var(--text-white);
    border: 3px solid var(--gold-warm);
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 30px rgba(184, 149, 106, 0.5);
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-breakthrough:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(184, 149, 106, 0.8);
    background: linear-gradient(135deg, var(--gold-warm), #cfb07d);
}

.btn-breakthrough:disabled,
.btn-breakthrough.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #444);
    box-shadow: none;
}

/* Breakthrough States */
.breakthrough-locked,
.breakthrough-maxed {
    text-align: center;
    padding: 30px;
}

.breakthrough-locked h3,
.breakthrough-maxed h3 {
    color: var(--purple-light);
    margin-bottom: 15px;
    font-size: 1.3em;
}

.breakthrough-locked p,
.breakthrough-maxed p {
    color: var(--secondary-text);
    margin: 10px 0;
    font-size: 1em;
}

.levels-needed {
    font-size: 1.2em;
    color: var(--purple-light);
    font-weight: bold;
    margin-top: 15px;
    text-shadow: 0 0 10px rgba(155, 127, 199, 0.5);
}

.breakthrough-available h3 {
    text-align: center;
    color: var(--gold-warm);
    font-size: 1.5em;
    margin-bottom: 20px;
    text-shadow: 0 0 15px rgba(184, 149, 106, 0.6);
}

/* Responsive Breakthrough */
@media (max-width: 768px) {
    .realm-comparison {
        flex-direction: column;
        gap: 15px;
    }
    
    .arrow {
        transform: rotate(90deg);
        font-size: 2em;
    }
    
    .realm-box {
        width: 100%;
    }
}

/* ========================================
   PROMPT 14: ACHIEVEMENT SYSTEM STYLES
   ======================================== */

/* Achievement Notification Popup */
.achievement-notification {
    position: fixed;
    top: 20px;
    right: -400px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(255, 215, 0, 0.6);
    display: flex;
    gap: 15px;
    z-index: 10000;
    max-width: 350px;
    transition: right 0.5s ease;
    border: 3px solid #fff;
}

.achievement-notification.show {
    right: 20px;
}

.achievement-notification .achievement-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.8));
}

.achievement-content {
    flex: 1;
}

.achievement-content strong {
    display: block;
    font-size: 1.1em;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 1.1em;
    font-weight: bold;
    margin: 5px 0;
}

.achievement-reward {
    color: #333;
    font-weight: bold;
    margin-top: 5px;
}

/* Achievements Header */
.achievements-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: var(--glass-ultra-light);
    backdrop-filter: blur(6px);
    border: 2px solid var(--gold-warm);
    border-radius: 10px;
}

.achievements-stats {
    font-size: 1.2em;
    color: var(--gold-warm);
    font-weight: bold;
}

/* Achievement Categories */
.achievement-category {
    margin-bottom: 40px;
}

.achievement-category h3 {
    color: var(--gold-warm);
    border-bottom: 2px solid var(--gold-warm);
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-size: 1.2em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Achievement Card */
.achievement-card {
    display: flex;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 10px;
    margin-bottom: 15px;
    transition: all 0.3s;
}

.achievement-card.completed {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-card:hover {
    transform: translateX(5px);
}

.achievement-card.completed:hover {
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.achievement-card .achievement-icon {
    font-size: 3em;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.4));
}

/* Achievement Info */
.achievement-info {
    flex: 1;
}

.achievement-info h4 {
    margin: 0 0 8px 0;
    color: #ffd700;
    font-size: 1.2em;
}

.achievement-desc {
    color: #aaa;
    margin: 5px 0;
    line-height: 1.4;
}

/* Achievement Status */
.achievement-status {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    margin-top: 10px;
    text-transform: uppercase;
}

.achievement-status.completed {
    background: #4CAF50;
    color: white;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.achievement-status.locked {
    background: #666;
    color: #aaa;
}

/* Achievement Progress */
.achievement-progress {
    margin-top: 8px;
    font-size: 0.9em;
    color: #66ff66;
    font-weight: bold;
}

/* Achievement Rewards */
.achievement-rewards {
    margin-top: 8px;
    font-size: 0.9em;
    color: #ffd700;
    font-weight: bold;
}

/* Responsive Achievements */
@media (max-width: 768px) {
    .achievement-notification {
        max-width: 280px;
        padding: 15px;
    }
    
    .achievement-notification .achievement-icon {
        font-size: 2em;
    }
    
    .achievement-card {
        flex-direction: column;
        gap: 15px;
    }
    
    .achievement-card .achievement-icon {
        font-size: 2.5em;
        text-align: center;
    }
}

/* ===== PROMPT 16: DAILY QUESTS ===== */

/* Quest Header */
.quests-header {
    text-align: center;
    margin-bottom: 30px;
}

.quests-header h2 {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.quest-reset-timer {
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.quest-reset-timer span {
    color: var(--accent-color);
    font-weight: bold;
}

/* Quest Container */
#daily-quests-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Quest cards need DIFFERENT styling (they're wider) */
.quest-card {
    position: relative;
    padding: 25px 30px;
    margin: 15px 0;
    min-height: 200px;
    
    /* Clean gradient background */
    background: linear-gradient(135deg, 
        rgba(20, 20, 30, 0.95) 0%, 
        rgba(30, 25, 40, 0.95) 100%);
    
    /* Simple clean border instead of ornate */
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    
    transition: all 0.3s ease;
}

.quest-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3);
}

.quest-card.quest-complete {
    border-color: transparent;
    box-shadow: 0 4px 15px rgba(0, 255, 127, 0.3);
    background: linear-gradient(135deg, 
        rgba(20, 30, 20, 0.95) 0%, 
        rgba(20, 35, 20, 0.95) 100%);
}

.quest-card.quest-claimed {
    opacity: 0.7;
}

/* Remove ::before overlay */
.quest-card::before {
    display: none;
}

.quest-card > * {
    position: relative;
    z-index: 1;
}

/* Quest Header */
.quest-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.quest-title {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.quest-difficulty {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    text-transform: uppercase;
}

.quest-difficulty.easy {
    background: rgba(0, 255, 127, 0.2);
    color: #00ff7f;
    border: 1px solid #00ff7f;
}

.quest-difficulty.medium {
    background: rgba(255, 215, 0, 0.2);
    color: #ffd700;
    border: 1px solid #ffd700;
}

.quest-difficulty.hard {
    background: rgba(255, 69, 0, 0.2);
    color: #ff4500;
    border: 1px solid #ff4500;
}

/* Quest Description */
.quest-description {
    color: var(--secondary-text);
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Quest Progress */
.quest-progress {
    margin-bottom: 15px;
}

.quest-progress-text {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.quest-progress-text span:first-child {
    color: var(--secondary-text);
}

.quest-progress-text span:last-child {
    color: var(--accent-color);
    font-weight: bold;
}

.quest-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    overflow: hidden;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), var(--success-color));
    border-radius: 10px;
    transition: width 0.5s ease;
}

.quest-complete .quest-progress-fill {
    background: var(--success-color);
}

/* Quest Footer */
.quest-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.quest-reward {
    color: var(--secondary-text);
    font-size: 0.95rem;
}

.quest-reward-value {
    color: var(--accent-color);
    font-weight: bold;
}

/* Quest Claim Button */
.btn-claim-quest {
    padding: 8px 20px;
    background: var(--accent-color);
    color: var(--bg-primary);
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-claim-quest:hover:not(:disabled) {
    background: var(--success-color);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 255, 127, 0.5);
}

.btn-claim-quest:disabled {
    background: rgba(128, 128, 128, 0.3);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.btn-claim-quest.ready {
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 10px rgba(0, 255, 127, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 127, 0.8);
    }
}

/* Completion Bonus Banner */
.quest-completion-bonus {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(0, 255, 127, 0.2));
    border: 2px solid var(--success-color);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    margin-top: 20px;
    animation: glow 2s ease-in-out infinite;
}

.quest-completion-bonus h3 {
    color: var(--success-color);
    margin-bottom: 10px;
}

.quest-completion-bonus p {
    color: var(--accent-color);
    font-size: 1.2rem;
    font-weight: bold;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 127, 0.3);
    }
    50% {
        box-shadow: 0 0 30px rgba(0, 255, 127, 0.6);
    }
}

/* Responsive Quests */
@media (max-width: 768px) {
    .quest-card {
        padding: 15px;
    }
    
    .quest-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .quest-footer {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .btn-claim-quest {
        width: 100%;
    }
}

/* ========================================
   COMBAT ACTIVE VIEW — Portrait + Player Status
   ======================================== */

/* Player Status Bar */
.combat-player-status {
    background: linear-gradient(135deg, rgba(30, 60, 40, 0.6), rgba(20, 40, 30, 0.6));
    border: 1px solid rgba(100, 200, 130, 0.3);
    border-radius: 12px;
    padding: 12px 18px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.combat-player-info {
    display: flex;
    flex-direction: column;
    min-width: 120px;
}

.combat-player-name {
    font-weight: 700;
    font-size: 1em;
    color: #88eea4;
}

.combat-player-level {
    font-size: 0.8em;
    color: var(--secondary-text);
}

.combat-player-bars {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.combat-bar-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.combat-bar-row .bar-label {
    font-size: 0.75em;
    font-weight: 700;
    width: 22px;
    text-align: right;
    color: var(--secondary-text);
}

.combat-bar-row .bar {
    flex: 1;
    height: 14px;
}

.combat-bar-row .bar-value {
    font-size: 0.75em;
    min-width: 80px;
    text-align: right;
    color: var(--secondary-text);
}

.bar-fill.qi {
    background: linear-gradient(90deg, #6b5ce7, #a78bfa);
}

/* Portrait Container */
.combat-portrait-container {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 10px auto;
    border-radius: 16px;
    overflow: hidden;
    border: 3px solid rgba(155, 89, 182, 0.5);
    box-shadow: 0 0 20px rgba(155, 89, 182, 0.3);
}

.combat-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.combat-portrait-fallback {
    width: 100%;
    height: 100%;
    font-size: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 15, 30, 0.8);
}

/* Hit Flash Overlay */
.combat-hit-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 50, 50, 0.6), transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s;
}

.combat-hit-flash.active {
    animation: hitFlash 0.3s ease-out;
}

@keyframes hitFlash {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Shake Animation */
.combat-shake {
    animation: combatShake 0.3s ease-out;
}

@keyframes combatShake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px) rotate(-1deg); }
    30% { transform: translateX(6px) rotate(1deg); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(4px); }
    75% { transform: translateX(-2px); }
}

/* Floating Damage Number */
.combat-damage-float {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.8rem;
    font-weight: 900;
    color: #ff4444;
    text-shadow: 0 0 8px rgba(255, 0, 0, 0.8), 2px 2px 4px rgba(0, 0, 0, 0.9);
    pointer-events: none;
    animation: damageFloat 0.9s ease-out forwards;
    z-index: 10;
}

@keyframes damageFloat {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.3); }
    60% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-60px) scale(0.8); }
}

/* Crit damage styling */
.combat-damage-float.crit {
    font-size: 2.4rem;
    color: #FFD700;
    text-shadow: 0 0 12px rgba(255, 215, 0, 0.9), 0 0 24px rgba(255, 100, 0, 0.6), 2px 2px 4px rgba(0, 0, 0, 0.9);
    animation: damageFloatCrit 1s ease-out forwards;
}

@keyframes damageFloatCrit {
    0% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1.8); }
    20% { transform: translateX(-50%) translateY(-10px) scale(1.4); }
    60% { opacity: 1; }
    100% { opacity: 0; transform: translateX(-50%) translateY(-80px) scale(0.9); }
}

/* ========================================
   FORGING TIER FILTER BAR
   ======================================== */

.tier-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    background: rgba(20, 15, 30, 0.6);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    align-items: center;
}

.tier-filter-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: var(--secondary-text);
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tier-filter-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.tier-filter-btn.active {
    color: #fff;
    border-color: var(--tab-accent, var(--accent-color));
    background: rgba(var(--tab-accent-rgb, 155, 127, 199), 0.2);
    box-shadow: 0 0 8px rgba(var(--tab-accent-rgb, 155, 127, 199), 0.3);
}

.tier-filter-btn.tier-common.active {
    border-color: #aaa;
    background: rgba(170, 170, 170, 0.15);
}

.tier-filter-btn.tier-rare.active {
    border-color: #4a9eff;
    background: rgba(74, 158, 255, 0.15);
    color: #7ab8ff;
}

.tier-filter-btn.tier-epic.active {
    border-color: #b94aff;
    background: rgba(185, 74, 255, 0.15);
    color: #d08aff;
}

.tier-filter-btn.tier-legendary.active {
    border-color: #ffb938;
    background: rgba(255, 185, 56, 0.15);
    color: #ffd080;
}

.tier-filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    font-size: 0.8em;
    color: var(--secondary-text);
    cursor: pointer;
}

.tier-filter-toggle input[type="checkbox"] {
    accent-color: var(--tab-accent, var(--accent-color));
}

/* ========================================
   GATHERING — Resource Icon Small (inline)
   ======================================== */

.resource-icon-sm {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    margin-right: 3px;
}

/* ========================================
   ENEMY CARD — Loot Preview Section
   ======================================== */

.enemy-loot-preview {
    width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.loot-header {
    font-size: 0.68em;
    font-weight: 700;
    color: #e0b050;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loot-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1px 0;
    font-size: 0.72em;
}

.loot-item {
    color: var(--secondary-text);
    display: flex;
    align-items: center;
    gap: 3px;
}

.loot-preview-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
}

.loot-emoji-fallback {
    font-size: 0.9em;
    vertical-align: middle;
}

.loot-chance {
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.85em;
    font-weight: 600;
}

/* ========================================
   COMBAT LOG — Formatted Entries
   ======================================== */

.combat-log {
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    margin: 12px 0;
}

.combat-log-entry {
    padding: 3px 8px;
    margin: 2px 0;
    border-radius: 4px;
    font-size: 0.85em;
    line-height: 1.5;
    border-left: 3px solid transparent;
}

.combat-log-entry.log-player-attack {
    color: #66ee88;
    border-left-color: #44cc66;
    background: rgba(68, 204, 102, 0.06);
}

.combat-log-entry.log-enemy-attack {
    color: #ff7777;
    border-left-color: #cc4444;
    background: rgba(204, 68, 68, 0.06);
}

.combat-log-entry.log-victory {
    color: #ffd700;
    border-left-color: #ffd700;
    background: rgba(255, 215, 0, 0.08);
    font-weight: 700;
}

.combat-log-entry.log-defeat {
    color: #ff5555;
    border-left-color: #cc2222;
    background: rgba(204, 34, 34, 0.08);
    font-weight: 700;
}

.combat-log-entry.log-loot {
    color: #e0b050;
    border-left-color: #cc9933;
    background: rgba(204, 153, 51, 0.06);
}

.combat-log-entry.log-exp {
    color: #88bbff;
    border-left-color: #5599dd;
    background: rgba(85, 153, 221, 0.06);
}

.combat-log-entry.log-warning {
    color: #ffaa44;
    border-left-color: #dd8822;
    background: rgba(221, 136, 34, 0.06);
}

.combat-log-entry.log-neutral {
    color: var(--secondary-text);
    border-left-color: rgba(255, 255, 255, 0.1);
}

/* ===== PROMPT 17: COMBAT SYSTEM ===== */

/* ========================================
   COMBAT GRID - ADJUSTED FOR LARGER CARDS
   ======================================== */

.enemy-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    padding: 16px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
}

/* Separate section for bosses */
.bosses-section {
    margin-top: 30px;
    padding-top: 24px;
    border-top: 2px solid rgba(255, 215, 0, 0.3);
}

.bosses-section-title {
    text-align: center;
    font-size: 1.4em;
    color: #ffd700;
    margin-bottom: 20px;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.8);
    font-weight: 900;
    letter-spacing: 2px;
}

/* ========================================
   ENEMY CARDS - FIXED SPACING & CENTERING
   ======================================== */

/* Base enemy card - Glass theme */
.enemy-card {
    background: var(--glass-light);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(125, 91, 166, 0.4);
    border-radius: 12px;
    padding: 14px;
    width: auto;
    min-height: auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.enemy-card:hover {
    border-color: var(--purple-medium);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.4);
    transform: translateY(-4px);
}

/* Locked enemy card */
.enemy-card.enemy-locked {
    opacity: 0.55;
    filter: grayscale(0.6);
    pointer-events: none;
    position: relative;
}
.enemy-card.enemy-locked .locked-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.enemy-card.enemy-locked .locked-text {
    background: rgba(0,0,0,0.75);
    color: #9CA3AF;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.enemy-card.enemy-locked .btn-attack {
    background: rgba(100,100,100,0.3) !important;
    border-color: rgba(100,100,100,0.3) !important;
    color: #666 !important;
    cursor: not-allowed;
}

/* Ensure all child elements respect card width */
.enemy-card * {
    box-sizing: border-box;
}

/* Boss card - Subtle bronze theme */
.boss-card {
    border: 2px solid var(--gold-dark);
    background: var(--glass-medium);
    backdrop-filter: blur(10px);
    width: auto;
    min-height: auto;
    box-shadow: 
        0 0 20px rgba(184, 149, 106, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.boss-card:hover {
    border-color: var(--gold-warm);
    box-shadow: 0 0 35px rgba(184, 149, 106, 0.5);
}

/* Portrait container - PROPER CENTERING */
.enemy-portrait-container {
    width: 120px;
    height: 120px;
    margin: 0 auto 10px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #8b4513;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Boss portrait - LARGER */
.boss-portrait {
    width: 140px;
    height: 140px;
    border: 3px solid #ffd700;
}

/* CRITICAL: Portrait image CENTERED properly */
.enemy-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}

.enemy-card:hover .enemy-portrait {
    transform: scale(1.1);
}

/* Vignette overlay */
.enemy-portrait-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(
        circle at center,
        transparent 30%,
        rgba(0, 0, 0, 0.6) 100%
    );
    pointer-events: none;
}

/* Boss badge */
.boss-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700);
    color: #000;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 900;
    font-size: 0.8em;
    letter-spacing: 1.5px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.8);
    z-index: 10;
    animation: bossBadgePulse 2s ease-in-out infinite;
}

@keyframes bossBadgePulse {
    0%, 100% {
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.8);
    }
    50% { 
        box-shadow: 0 4px 20px rgba(255, 215, 0, 1);
    }
}

/* Emoji fallback */
.enemy-icon-emoji {
    font-size: 5em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

/* Old enemy icon for backward compatibility */
.enemy-icon {
    font-size: 4em;
    margin-bottom: 10px;
}

/* Enemy name - MORE SPACING */
.enemy-name {
    font-size: 0.95em;
    font-weight: bold;
    color: #ff6b6b;
    text-align: center;
    margin: 0 0 6px 0;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.6);
    line-height: 1.2;
}

.boss-card .enemy-name {
    font-size: 1.1em;
    color: #ffd700;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8);
    margin-bottom: 8px;
}

/* Level display - MORE SPACING */
.enemy-level {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    margin: 0 0 8px 0;
    box-shadow: 0 2px 6px rgba(231, 76, 60, 0.5);
    white-space: nowrap;
}

.boss-level {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 0.8em;
    padding: 5px 12px;
}

/* Difficulty badge (not shown for bosses) */
.difficulty-badge {
    font-size: 0.7em;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-left: 6px;
    display: inline-block;
}

/* Stats section - MORE SPACING */
.enemy-stats {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    padding: 8px 8px;
    margin: 8px 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

.enemy-stats .stat-row {
    display: grid;
    grid-template-columns: 24px 35px 1fr;
    align-items: center;
    gap: 4px;
    margin: 3px 0;
    font-size: 0.82em;
    width: 100%;
}

.enemy-stats .stat-icon {
    font-size: 1em;
    text-align: center;
    grid-column: 1;
}

.enemy-stats .stat-label {
    color: #999;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.7em;
    letter-spacing: 0.5px;
    grid-column: 2;
    text-align: left;
}

.enemy-stats .stat-value {
    color: #fff;
    font-weight: bold;
    font-size: 0.95em;
    text-align: right;
    grid-column: 3;
}

.boss-card .stat-value {
    color: #ffd700;
}

/* Old stats display for backward compatibility */
.enemy-stats-small {
    display: flex;
    justify-content: space-around;
    margin: 10px 0;
    font-size: 0.85em;
    color: var(--secondary-text);
}

/* Rewards section - MORE SPACING */
.enemy-rewards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
    max-width: 100%;
    padding: 8px 8px;
    background: rgba(255, 215, 0, 0.08);
    border-radius: 8px;
    border: 1px solid rgba(255, 215, 0, 0.2);
    margin: 8px 0;
    overflow: hidden;
    box-sizing: border-box;
}

.boss-card .enemy-rewards {
    background: rgba(255, 215, 0, 0.15);
    border-color: rgba(255, 215, 0, 0.4);
    padding: 10px;
}

.reward-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.82em;
}

.exp-reward {
    color: #f39c12;
    font-weight: bold;
}

.boss-card .exp-reward {
    color: #ffd700;
    font-size: 1em;
}

/* Difficulty-based border colors */
.enemy-card[data-difficulty="easy"] .enemy-portrait-container {
    border-image: linear-gradient(135deg, #27ae60, #2ecc71, #27ae60) 1;
}

.enemy-card[data-difficulty="medium"] .enemy-portrait-container {
    border-image: linear-gradient(135deg, #3498db, #5dade2, #3498db) 1;
}

.enemy-card[data-difficulty="hard"] .enemy-portrait-container {
    border-image: linear-gradient(135deg, #9b59b6, #bb8fce, #9b59b6) 1;
}

.enemy-card[data-difficulty="very-hard"] .enemy-portrait-container {
    border-image: linear-gradient(135deg, #e74c3c, #ec7063, #e74c3c) 1;
}

.enemy-card[data-difficulty="boss"] .enemy-portrait-container {
    border-image: linear-gradient(135deg, #ffd700, #ffed4e, #ffd700) 1;
}

/* Animated threat pulse for bosses */
.boss-card::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 14px;
    border: 2px solid #ffd700;
    animation: bossThreatPulse 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes bossThreatPulse {
    0%, 100% {
        opacity: 0.3;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.02);
    }
}

/* ========================================
   RESPONSIVE COMBAT LAYOUT
   ======================================== */

/* 4 cards on large screens */
@media (min-width: 1400px) {
    .enemy-grid {
        grid-template-columns: repeat(5, 1fr);
        max-width: 1400px;
        margin: 0 auto;
    }
}

/* 3 cards on medium screens */
@media (min-width: 900px) and (max-width: 1399px) {
    .enemy-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* 2 cards on small screens */
@media (min-width: 600px) and (max-width: 899px) {
    .enemy-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 1 card on mobile */
@media (max-width: 599px) {
    .enemy-grid {
        grid-template-columns: 1fr;
    }
    
    .enemy-card,
    .boss-card {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Enemy Card - Old styles for backward compatibility */
.enemy-card h4 {
    color: var(--primary-text);
    margin: 10px 0;
}

/* Enemy Actions */
.enemy-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Attack button - MORE SPACING */
.btn-attack {
    width: 100%;
    padding: 10px;
    margin-top: auto;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.88em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(231, 76, 60, 0.5);
}

.btn-attack:hover {
    background: linear-gradient(135deg, #c0392b, #a93226);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.7);
}

.btn-attack:active {
    transform: translateY(0);
}

/* Boss attack button - Golden styling */
.btn-boss-attack {
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #000;
    font-size: 0.9em;
    padding: 10px;
    box-shadow: 0 3px 12px rgba(255, 215, 0, 0.6);
}

.btn-boss-attack:hover {
    background: linear-gradient(135deg, #ffed4e, #ffd700);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.9);
}

.btn-auto {
    flex: 1;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid #666;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.82em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-auto:hover {
    border-color: #ff9800;
    transform: scale(1.05);
}

.btn-auto.active {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    border-color: #ff9800;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.5);
}

/* Combat Active View */
.combat-active {
    max-width: 700px;
    margin: 0 auto;
    padding: 20px;
}

.enemy-display {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #ff4444;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 68, 68, 0.3);
}

.enemy-display h3 {
    color: #ff6666;
    margin: 15px 0;
}

.enemy-description {
    color: var(--secondary-text);
    font-size: 0.9em;
    margin: 10px 0;
    font-style: italic;
}

.enemy-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
    font-size: 1.1em;
}

.enemy-stats span {
    color: var(--primary-text);
    font-weight: bold;
}

/* Enemy HP Bar */
.enemy-hp-bar {
    margin-top: 15px;
}

.enemy-hp-bar .bar {
    width: 100%;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #444;
}

.enemy-hp-bar .bar-fill.hp {
    height: 100%;
    background: linear-gradient(90deg, #ff4444, #ff6666);
    border-radius: 10px;
    transition: width 0.5s ease;
}

.hp-text {
    display: block;
    margin-top: 8px;
    font-weight: bold;
    color: #ff6666;
    font-size: 1.1em;
}

/* Combat Log */
.combat-log {
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
}

.combat-log p {
    margin: 8px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 0.3s ease;
    color: var(--primary-text);
}

.combat-log p:last-child {
    border-bottom: none;
}

/* Combat Controls */
.combat-controls {
    display: flex;
    gap: 15px;
}

.btn-flee {
    flex: 1;
    padding: 15px;
    background: #ff9800;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-flee:hover {
    background: #ffb74d;
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.5);
}

/* Combat Hint */
.combat-hint {
    text-align: center;
    color: var(--secondary-text);
    margin-bottom: 20px;
    font-size: 0.95em;
}

/* Responsive Combat */
@media (max-width: 768px) {
    .enemy-grid {
        grid-template-columns: 1fr;
        padding: 10px;
    }
    
    .combat-active {
        padding: 10px;
    }
    
    .enemy-display {
        padding: 15px;
    }
    
    .enemy-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .combat-log {
        max-height: 200px;
        font-size: 0.9em;
    }
}

/* ===== PROMPT 18: TERRITORY CONQUEST SYSTEM ===== */

/* Territories Header */
.territories-header {
    text-align: center;
    padding: 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid var(--border-color);
}

.territories-header p {
    margin: 5px 0;
    font-size: 1.1rem;
}

.territories-hint {
    color: var(--secondary-text);
    margin-top: 10px;
    font-size: 0.95rem;
}

/* Territory Info Box */
.territory-info-box {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    text-align: center;
}

.territory-info-box p {
    margin: 8px 0;
    font-size: 1.1rem;
}

.info-text {
    color: #aaa;
    font-size: 0.9em;
    margin-top: 10px;
}

/* Territories Container — handled by inline JS + base rule above */

/* Territory Card - Using universal .game-card styles above */
.territory-card.conquered {
    border-image: linear-gradient(135deg, #4caf50, #66bb6a) 1;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.4);
}

/* Territory Header */
.territory-header {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

.territory-icon {
    font-size: 4em;
}

.territory-title {
    flex: 1;
}

.territory-title h3 {
    margin: 0 0 8px 0;
    color: var(--accent-color);
    font-size: 1.4rem;
}

.conquered-badge {
    display: inline-block;
    padding: 5px 12px;
    background: var(--success-color);
    color: white;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: bold;
}

/* Territory Description */
.territory-description {
    color: var(--secondary-text);
    margin-bottom: 20px;
    line-height: 1.6;
}

/* Boss Info */
.boss-info {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 68, 68, 0.3);
}

.boss-info h4 {
    color: #ff4444;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.boss-details {
    display: flex;
    gap: 15px;
    align-items: center;
}

.boss-icon {
    font-size: 3em;
}

.boss-details > div {
    flex: 1;
}

.boss-details p {
    margin: 5px 0;
    color: var(--primary-text);
}

.boss-details strong {
    color: #ff6666;
    font-size: 1.1rem;
}

.boss-stats {
    display: flex;
    gap: 15px;
    margin-top: 8px;
    font-size: 0.9em;
    color: var(--secondary-text);
}

/* Territory Bonus */
.territory-bonus {
    background: rgba(255, 215, 0, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 12px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.territory-bonus strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 5px;
}

.territory-bonus p {
    margin: 5px 0;
    color: var(--primary-text);
}

.bonus-active {
    display: inline-block;
    margin-top: 8px;
    color: var(--success-color);
    font-weight: bold;
}

/* Challenge Button */
.btn-challenge {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-challenge:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 5px 25px rgba(255, 68, 68, 0.6);
}

.btn-challenge:disabled {
    background: var(--success-color);
    cursor: not-allowed;
    opacity: 0.8;
}

/* Responsive Territories — uses compact breakpoints defined in redesign section below */
@media (max-width: 768px) {
    .territory-header {
        flex-direction: column;
        text-align: center;
    }
    
    .territory-icon {
        font-size: 3em;
    }
    
    .boss-details {
        flex-direction: column;
        text-align: center;
    }
    
    .boss-icon {
        font-size: 2.5em;
    }
    
    .boss-stats {
        flex-direction: column;
        gap: 8px;
    }
}

/* ===== PROMPT 19: BASIC VENDOR/SHOP SYSTEM ===== */

/* Vendor Greeting */
.vendor-greeting {
    text-align: center;
    font-style: italic;
    color: var(--secondary-text);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

/* Vendor Header */
.vendor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
    margin-bottom: 30px;
    border: 2px solid var(--border-color);
    flex-wrap: wrap;
    gap: 20px;
}

.vendor-gold {
    font-size: 1.3em;
    font-weight: bold;
    color: var(--accent-color);
}

/* Vendor Filters */
.vendor-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vendor-filter {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid #666;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.vendor-filter:hover {
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.vendor-filter.active {
    background: var(--accent-color);
    color: var(--bg-primary);
    border-color: var(--accent-color);
}

/* Vendor Grid */
#vendor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px;
}

/* Vendor Item Card - Using universal .game-card styles above */

/* Vendor Item Header */
.vendor-item-header {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.vendor-item-header .item-icon {
    font-size: 3em;
}

.item-title {
    flex: 1;
}

.item-title h4 {
    margin: 0 0 5px 0;
    color: var(--accent-color);
    font-size: 1.1rem;
}

.item-category {
    font-size: 0.8em;
    color: var(--secondary-text);
    text-transform: uppercase;
    margin: 0;
    font-weight: 600;
}

/* Item Description */
.item-description {
    color: var(--secondary-text);
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.5;
}

/* Item Prices */
.item-prices {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}

.price-row {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.price-label {
    color: var(--secondary-text);
    font-weight: 600;
}

.price-value {
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.price-value.buy {
    color: #ff6666;
}

.price-value.sell {
    color: #66ff66;
}

/* Currency icon + amount inline display */
.currency-amount {
    margin-left: 4px;
    font-weight: bold;
    color: var(--gold-warm);
    text-shadow: 0 0 8px rgba(184, 149, 106, 0.4);
}

.quest-rewards,
.enemy-rewards,
.achievement-rewards {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.exp-reward {
    color: #f39c12;
    font-weight: bold;
}
.vendor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.vendor-actions .btn-buy,
.vendor-actions .btn-sell {
    flex: 1 1 45%;
    padding: 8px 6px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vendor-actions .btn-sell-all {
    flex: 1 1 100%;
    padding: 6px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8rem;
    text-align: center;
}

.btn-buy {
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
}

.btn-sell {
    background: linear-gradient(135deg, #ff9800, #ff5722);
    color: white;
}

.btn-sell-all {
    background: linear-gradient(135deg, #f44336, #e91e63);
    color: white;
    font-size: 0.8em;
}

.btn-buy:hover:not(:disabled),
.btn-sell:hover:not(:disabled),
.btn-sell-all:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.btn-buy:disabled,
.btn-sell:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(128, 128, 128, 0.5);
}

/* Responsive Vendor */
@media (max-width: 768px) {
    .vendor-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vendor-filters {
        justify-content: center;
    }
    
    #vendor-grid {
        grid-template-columns: 1fr;
        padding: 8px;
        gap: 8px;
    }
    
    .vendor-item {
        padding: 12px;
        width: 100% !important;
        min-height: auto !important;
        margin: 0 !important;
    }
    
    .vendor-item-header .item-icon {
        font-size: 2em;
    }
}

/* ===========================
   PRESTIGE SYSTEM STYLES
   =========================== */

@keyframes prestigeFlash {
    0%, 100% { 
        background: radial-gradient(circle, rgba(255,215,0,0) 0%, rgba(255,215,0,0) 100%);
    }
    50% { 
        background: radial-gradient(circle, rgba(255,215,0,0.6) 0%, rgba(255,215,0,0) 70%);
    }
}

body.prestige-flash {
    animation: prestigeFlash 2s ease 3;
}

#prestige-container {
    max-width: 800px;
    margin: 0 auto;
}

.prestige-available,
.prestige-locked {
    background: rgba(255, 215, 0, 0.1);
    border: 2px solid #ffd700;
    border-radius: 15px;
    padding: 30px;
}

.prestige-available h3,
.prestige-locked h3 {
    text-align: center;
    color: #ffd700;
    font-size: 2em;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

.prestige-description {
    text-align: center;
    color: #ccc;
    margin-bottom: 30px;
    line-height: 1.6;
}

.prestige-current,
.prestige-rewards,
.prestige-keeps,
.prestige-resets,
.prestige-requirements {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.prestige-current h4,
.prestige-rewards h4,
.prestige-keeps h4,
.prestige-resets h4,
.prestige-requirements p {
    color: #ffd700;
    margin-bottom: 15px;
}

.prestige-info ul {
    list-style: none;
    padding: 0;
}

.prestige-info li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.prestige-info li:last-child {
    border-bottom: none;
}

.reward-highlight {
    color: #00ff00;
    font-weight: bold;
    font-size: 1.1em;
}

.reset-list li {
    color: #ff6666;
}

.btn-prestige {
    width: 100%;
    padding: 25px;
    font-size: 1.5em;
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ffd700);
    background-size: 200% 200%;
    color: #000;
    border: 3px solid #fff;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.8);
    animation: gradientShift 3s ease infinite;
    transition: all 0.3s;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.btn-prestige:hover {
    transform: scale(1.05);
    box-shadow: 0 0 60px rgba(255, 215, 0, 1);
}

.prestige-hint {
    text-align: center;
    color: #aaa;
    font-style: italic;
    margin-top: 20px;
}

.prestige-requirements ul {
    list-style: none;
    padding: 0;
}

.prestige-requirements li {
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    margin: 5px 0;
    border-radius: 5px;
}

/* ===========================
   PRESTIGE MODERN STYLES
   =========================== */

.prestige-modern {
    max-width: 900px;
    margin: 0 auto;
    padding: 25px 30px;
}

/* Hero Section with Badge */
.prestige-hero {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.prestige-badge-modern {
    width: 90px;
    height: 90px;
    margin: 0 auto 15px;
    position: relative;
    animation: floatBadge 3s ease-in-out infinite;
}

@keyframes floatBadge {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.badge-glow {
    position: absolute;
    inset: -15px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.4), transparent);
    border-radius: 50%;
    animation: pulseGlow 2s ease-in-out infinite;
}

@keyframes pulseGlow {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}

.badge-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #ffd700 0%, #ff8c00 50%, #ffd700 100%);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid rgba(255, 255, 255, 0.3);
    box-shadow: 
        0 8px 32px rgba(255, 215, 0, 0.4),
        inset 0 2px 10px rgba(255, 255, 255, 0.3),
        inset 0 -2px 10px rgba(0, 0, 0, 0.2);
}

.badge-label {
    font-size: 0.75em;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.badge-number {
    font-size: 2.2em;
    font-weight: 900;
    color: #000;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    line-height: 1;
}

.prestige-title {
    color: #ffd700;
    font-size: 1.6em;
    margin: 0 0 6px 0;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.prestige-desc {
    color: var(--secondary-text);
    font-size: 1.1em;
    margin: 0;
    font-style: italic;
}

/* Progress Overview Section */
.prestige-progress-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 22px;
}

.progress-card {
    background: rgba(0, 0, 0, 0.3);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    transition: all 0.3s;
}

.progress-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 215, 0, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.progress-card.complete {
    border-color: #2ecc71;
    background: rgba(46, 204, 113, 0.1);
}

.progress-icon {
    font-size: 2.5em;
    min-width: 60px;
    text-align: center;
}

.progress-info {
    flex: 1;
}

.progress-label {
    color: var(--secondary-text);
    font-size: 0.9em;
    margin-bottom: 8px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-bar-container {
    position: relative;
    height: 28px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.progress-bar-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.5s ease;
    border-radius: 14px;
}

.progress-card.complete .progress-bar-fill {
    background: linear-gradient(90deg, #2ecc71, #27ae60);
}

.progress-text {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-weight: 700;
    font-size: 0.95em;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Benefits Showcase */
.prestige-benefits-modern {
    margin-bottom: 22px;
}

.section-heading {
    color: #ffd700;
    font-size: 1.2em;
    margin: 0 0 14px 0;
    text-align: center;
    font-weight: 600;
}

.benefits-grid-modern {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.benefit-card-modern {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px 12px;
    text-align: center;
    transition: all 0.3s;
    cursor: default;
}

.benefit-card-modern:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.benefit-card-modern.exp {
    border-color: rgba(52, 152, 219, 0.5);
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.1), rgba(41, 128, 185, 0.1));
}

.benefit-card-modern.resources {
    border-color: rgba(155, 89, 182, 0.5);
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.1), rgba(142, 68, 173, 0.1));
}

.benefit-card-modern.stats {
    border-color: rgba(231, 76, 60, 0.5);
    background: linear-gradient(135deg, rgba(231, 76, 60, 0.1), rgba(192, 57, 43, 0.1));
}

.benefit-card-modern.progress {
    border-color: rgba(46, 204, 113, 0.5);
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.1), rgba(39, 174, 96, 0.1));
}

.benefit-icon-large {
    font-size: 2em;
    margin-bottom: 6px;
    filter: drop-shadow(0 0 10px currentColor);
}

.benefit-value {
    font-size: 1.5em;
    font-weight: 900;
    color: #ffd700;
    margin-bottom: 4px;
    display: block;
}

.benefit-name {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 5px;
    display: block;
}

.benefit-detail {
    font-size: 0.85em;
    color: var(--secondary-text);
    font-style: italic;
}

/* Current Bonuses Showcase */
.prestige-current-modern {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.15), rgba(39, 174, 96, 0.15));
    border: 2px solid #2ecc71;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
}

.current-bonuses-showcase {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.current-bonus-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(46, 204, 113, 0.3);
}

.bonus-icon {
    font-size: 2.5em;
}

.bonus-amount {
    font-size: 2em;
    font-weight: 900;
    color: #2ecc71;
    text-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

.bonus-label {
    font-size: 0.9em;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Hint Section */
.prestige-hint-modern {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 152, 0, 0.1));
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.hint-icon {
    font-size: 1.8em;
}

.hint-text {
    flex: 1;
    color: #ffc107;
    font-size: 1em;
    font-weight: 500;
}

/* Progression Table */
.prestige-progression-table {
    margin-bottom: 22px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 18px;
}

.progression-subtitle {
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.95em;
    margin: -5px 0 15px 0;
    font-style: italic;
}

.progression-table-scroll {
    overflow-x: auto;
    border-radius: 10px;
}

.progression-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 10px;
    overflow: hidden;
}

.progression-table thead {
    background: rgba(255, 215, 0, 0.08);
}

.progression-table th {
    padding: 12px;
    text-align: center;
    color: #ffd700;
    font-weight: 700;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.2);
}

.progression-table td {
    padding: 12px 15px;
    text-align: center;
    color: var(--text-color);
    font-weight: 600;
    font-size: 1em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.progression-table tbody tr {
    transition: all 0.2s;
}

.progression-table tbody tr:hover {
    background: rgba(255, 215, 0, 0.08);
}

.progression-table tbody tr.current-level {
    background: rgba(46, 204, 113, 0.2);
    border-left: 4px solid #2ecc71;
}

.progression-table tbody tr.current-level td {
    color: #2ecc71;
    font-weight: 700;
}

.progression-table .level-cell {
    font-size: 1.2em;
    font-weight: 900;
    color: #ffd700;
}

.progression-table .total-power {
    font-weight: 900;
    color: #ff8c00;
    font-size: 1.1em;
}

/* Prestige Button Modern */
.btn-prestige-modern {
    width: 100%;
    padding: 20px;
    font-size: 1.3em;
    background: linear-gradient(135deg, #555, #777);
    color: #aaa;
    border: 3px solid #666;
    border-radius: 15px;
    font-weight: 800;
    cursor: not-allowed;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    text-shadow: none;
}

.btn-prestige-modern .btn-icon {
    font-size: 1.2em;
}

.btn-prestige-modern:not(:disabled) {
    background: linear-gradient(135deg, #ffd700, #ff8c00, #ffd700);
    background-size: 200% 200%;
    color: #000;
    border-color: #fff;
    cursor: pointer;
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.6);
    animation: gradientShift 3s ease infinite;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.btn-prestige-modern:not(:disabled):hover {
    transform: scale(1.02);
    box-shadow: 0 0 60px rgba(255, 215, 0, 0.9);
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .benefits-grid-modern {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .prestige-progress-section {
        grid-template-columns: 1fr;
    }
    
    .benefits-grid-modern {
        grid-template-columns: 1fr 1fr;
    }
    
    .current-bonuses-showcase {
        flex-direction: column;
    }
    
    .prestige-badge-modern {
        width: 56px;
        height: 56px;
    }
    
    .badge-number {
        font-size: 0.9em;
    }
    
    .prestige-title {
        font-size: 1em;
    }
}

/* ===========================
   STATISTICS DASHBOARD STYLES
   =========================== */

#statistics-container {
    padding: 20px;
}

.stats-dashboard {
    max-width: 900px;
    margin: 0 auto;
}

/* Hero cards row */
.stats-hero-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.stats-hero-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px 16px;
    text-align: center;
    border-top: 3px solid #666;
}

.hero-playtime { border-top-color: #42A5F5; }
.hero-kills { border-top-color: #EF5350; }
.hero-gold { border-top-color: #FFD700; }
.hero-level { border-top-color: #AB47BC; }

.hero-value {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-label {
    font-size: 0.7em;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Sections grid (2 columns) */
.stats-sections-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

/* Stats card */
.stats-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    overflow: hidden;
}

.stats-card-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.95em;
    color: var(--text-color);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 8px;
}

.stats-card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.dot-time { background: #42A5F5; }
.dot-actions { background: #66BB6A; }
.dot-progress { background: #AB47BC; }
.dot-economy { background: #FFD700; }
.dot-combat { background: #EF5350; }
.dot-milestones { background: #FF7043; }

.stats-card-body {
    padding: 8px 0;
}

/* Stat rows */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 7px 16px;
    font-size: 0.88em;
    color: var(--secondary-text);
    transition: background 0.2s;
    gap: 16px;
}

.stat-row > span:first-child {
    flex: 1;
    min-width: 0;
}

.stat-row:hover {
    background: rgba(255, 255, 255, 0.03);
}

.stat-val {
    color: var(--text-color);
    font-weight: 600;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.stat-highlight {
    color: var(--accent-color);
}

.stat-date {
    font-size: 0.82em;
    opacity: 0.8;
}

/* Milestone progress bars */
.milestone-row {
    padding: 8px 16px;
    margin-bottom: 4px;
}

.milestone-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.88em;
    color: var(--secondary-text);
    margin-bottom: 6px;
    white-space: nowrap;
    gap: 12px;
}

.milestone-info .stat-val {
    color: var(--text-color);
    font-weight: 600;
}

.milestone-bar-bg {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.milestone-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF7043, #FF9800);
    border-radius: 3px;
    transition: width 0.4s ease;
    min-width: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .stats-hero-row {
        grid-template-columns: repeat(2, 1fr);
    }
    .stats-sections-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 500px) {
    .stats-hero-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .stats-hero-card {
        padding: 14px 10px;
    }
    .hero-value {
        font-size: 1.1em;
    }
}

/* ===========================
   SETTINGS SYSTEM STYLES
   =========================== */

#settings-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.settings-section {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid #444;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
}

.settings-section h3 {
    color: #ffd700;
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffd700;
}

.setting-item {
    margin-bottom: 20px;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.setting-label {
    color: #fff;
    font-weight: bold;
}

.setting-description {
    color: #aaa;
    font-size: 0.9em;
    margin: 5px 0 0 30px;
}

.setting-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.setting-item input[type="number"] {
    width: 80px;
    padding: 5px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #666;
    border-radius: 5px;
    color: white;
    text-align: center;
}

.setting-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-setting {
    flex: 1;
    min-width: 150px;
    padding: 12px 20px;
    background: linear-gradient(135deg, #4CAF50, #2196F3);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-setting:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.5);
}

.btn-setting.danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
}

.btn-setting.danger:hover {
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.5);
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 10px;
}

.info-label {
    color: #aaa;
}

.info-value {
    color: #fff;
    font-weight: bold;
}

/* No animations mode */
body.no-animations * {
    animation: none !important;
    transition: none !important;
}

/* Compact mode */
body.compact-mode .skill-card,
body.compact-mode .recipe-card,
body.compact-mode .enemy-card,
body.compact-mode .territory-card,
body.compact-mode .vendor-item,
body.compact-mode .quest-card {
    padding: 10px;
}

body.compact-mode h2 {
    font-size: 1.5em;
}

body.compact-mode .stat-bars {
    gap: 8px;
}

body.compact-mode .panel {
    padding: 12px;
}

/* ===================================
   PROMPT 23: BUG FIXES & POLISH
   ================================== */

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.5);
    margin-bottom: 30px;
    animation: pulse 2s ease-in-out infinite;
}

.loading-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 215, 0, 0.2);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading-content p {
    color: var(--secondary-text);
    font-size: 1.1rem;
}

/* Error Notifications */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    z-index: 9999;
    animation: slideInFromTop 0.3s ease-out;
    border-left: 4px solid #ff5252;
}

@keyframes slideInFromTop {
    from {
        transform: translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.error-notification strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1.1rem;
}

/* Tooltips */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    z-index: 9998;
    pointer-events: none;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 215, 0, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.tooltip.show {
    opacity: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--accent-bg);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--accent-color) 0%, #ffd700 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #ffd700 0%, var(--accent-color) 100%);
}

/* Focus States for Accessibility */
button:focus,
.skill-card:focus,
.recipe-card:focus,
.enemy-card:focus,
.territory-card:focus,
.vendor-item:focus,
.quest-card:focus,
select:focus,
input:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

/* Disabled State Consistency */
button:disabled,
.skill-card.disabled,
.recipe-card.disabled,
.enemy-card.disabled,
.territory-card.disabled,
.vendor-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* No Animations Mode */
body.no-animations *,
body.no-animations *::before,
body.no-animations *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
}

/* Adjust stats for smaller cards if needed */
@media (max-width: 1200px) {
    .stat-row {
        font-size: 0.85em;
        padding: 0 6px;
    }
    
    .stat-label {
        min-width: 50px;
        font-size: 0.8em;
    }
}

/* Force correct stat layout - override any conflicts */
.enemy-card .stat-row,
.boss-card .stat-row {
    display: grid !important;
    grid-template-columns: 30px 45px 1fr !important;
}

.enemy-card .stat-icon,
.boss-card .stat-icon {
    display: block !important;
}

.enemy-card .stat-label,
.boss-card .stat-label {
    display: block !important;
}

.enemy-card .stat-value,
.boss-card .stat-value {
    display: block !important;
}

/* ========================================
   PLAYER AVATAR STYLES
   ======================================== */

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--purple-light);
    box-shadow: 
        0 0 20px rgba(155, 127, 199, 0.6),
        inset 0 0 15px rgba(0, 0, 0, 0.5);
    object-fit: cover;
    margin: 0 auto 15px;
    display: block;
}

.player-avatar-container {
    position: relative;
    width: 86px;
    height: 86px;
    margin: 0 auto 15px;
}

.player-avatar-glow {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--purple-light), transparent);
    animation: avatarPulse 3s ease-in-out infinite;
    z-index: -1;
}

@keyframes avatarPulse {
    0%, 100% { opacity: 0.3; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.1); }
}

/* ========================================
   SMOOTH CARD ANIMATIONS
   ======================================== */

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.skill-card,
.vendor-item,
.recipe-card,
.enemy-card {
    animation: fadeIn 0.3s ease-out;
}

/* ========================================
   CULTIVATION STAT BOXES - Visual Polish
   ======================================== */

.cultivation-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0 30px;
}

.stat-box {
    background: var(--glass-light);
    backdrop-filter: var(--blur-medium);
    border: 2px solid rgba(155, 127, 199, 0.4);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: var(--purple-light);
    box-shadow: 0 0 20px rgba(155, 127, 199, 0.3);
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    font-size: 0.85em;
    color: var(--text-medium);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: var(--purple-light);
    text-shadow: 
        0 0 12px rgba(155, 127, 199, 0.6),
        0 2px 6px rgba(0, 0, 0, 0.9);
}

/* ========================================
   SETTINGS INFO GRID - Clean Layout
   ======================================== */

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 10px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(155, 127, 199, 0.2);
}

.info-label {
    font-weight: 600;
    color: var(--text-medium);
    font-size: 0.9em;
}

.info-value {
    font-weight: bold;
    color: var(--text-light);
}

/* ========================================
   BUTTON POLISH - Ripple Effect
   ======================================== */

.btn-cultivate,
.btn-train-skill,
.btn-craft,
.btn-attack,
.btn-gather {
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

/* Click animation - scale down */
.btn-cultivate:active,
.btn-train-skill:active,
.btn-craft:active,
.btn-attack:active,
.btn-gather:active {
    transform: scale(0.95);
    box-shadow: 
        0 2px 8px rgba(125, 91, 166, 0.4),
        inset 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Ripple effect overlay */
.btn-cultivate::after,
.btn-train-skill::after,
.btn-craft::after,
.btn-attack::after,
.btn-gather::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s, opacity 0.6s;
    opacity: 0;
    pointer-events: none;
}

.btn-cultivate.clicked::after,
.btn-train-skill.clicked::after,
.btn-craft.clicked::after,
.btn-attack.clicked::after,
.btn-gather.clicked::after {
    width: 200px;
    height: 200px;
    opacity: 0;
}

/* ========================================
   PARTICLES - Cultivation Sparkles
   ======================================== */

.particle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #b370c9, transparent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 999;
    animation: particleRise 2s ease-out forwards;
}

@keyframes particleRise {
    0% {
        opacity: 1;
        transform: translateY(0) translateX(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-150px) translateX(var(--drift)) scale(0.3);
    }
}

/* Purple energy particles */
.particle.energy {
    background: radial-gradient(circle, #b370c9, #7d5ba6);
    box-shadow: 0 0 8px rgba(179, 112, 201, 0.8);
}

/* Gold particles for rewards */
.particle.gold {
    background: radial-gradient(circle, #f39c12, #e67e22);
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.8);
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 1200px) {
    :root {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    /* root font-size removed — 12px was too aggressive, broke rem sizing */
    
    .player-avatar {
        width: 60px;
        height: 60px;
    }
}

/* ========================================
   ANIMISTA ANIMATIONS - Professional Polish
   ======================================== */

/* Cards slide in when appearing */
@keyframes slide-in-bottom {
    0% {
        transform: translateY(100px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.slide-in-bottom {
    animation: slide-in-bottom 0.6s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

/* Button hover jello */
@keyframes jello-horizontal {
    0% {
        transform: scale3d(1, 1, 1);
    }
    30% {
        transform: scale3d(1.15, 0.85, 1);
    }
    40% {
        transform: scale3d(0.85, 1.15, 1);
    }
    50% {
        transform: scale3d(1.05, 0.95, 1);
    }
    65% {
        transform: scale3d(0.97, 1.03, 1);
    }
    75% {
        transform: scale3d(1.02, 0.98, 1);
    }
    100% {
        transform: scale3d(1, 1, 1);
    }
}

.jello-horizontal {
    animation: jello-horizontal 0.7s cubic-bezier(0.785, 0.135, 0.150, 0.860) both;
}

/* Level up scale */
@keyframes scale-up-center {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.scale-up-center {
    animation: scale-up-center 0.5s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}

/* Floating bounce */
@keyframes bounce-in-top {
    0% {
        transform: translateY(-500px);
        animation-timing-function: ease-in;
        opacity: 0;
    }
    38% {
        transform: translateY(0);
        animation-timing-function: ease-out;
        opacity: 1;
    }
    55% {
        transform: translateY(-65px);
        animation-timing-function: ease-in;
    }
    72% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    81% {
        transform: translateY(-28px);
        animation-timing-function: ease-in;
    }
    90% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
    95% {
        transform: translateY(-8px);
        animation-timing-function: ease-in;
    }
    100% {
        transform: translateY(0);
        animation-timing-function: ease-out;
    }
}

.bounce-in-top {
    animation: bounce-in-top 1.1s both;
}

/* ========================================
   APPLY ANIMATIONS TO GAME ELEMENTS
   ======================================== */

/* Cards slide in with stagger */
.skill-card,
.vendor-item,
.recipe-card,
.enemy-card,
.boss-card {
    animation: slide-in-bottom 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}

/* Stagger animation (cards appear in sequence) */
.skill-card:nth-child(1) { animation-delay: 0s; }
.skill-card:nth-child(2) { animation-delay: 0.1s; }
.skill-card:nth-child(3) { animation-delay: 0.2s; }
.skill-card:nth-child(4) { animation-delay: 0.3s; }
.skill-card:nth-child(5) { animation-delay: 0.4s; }
.skill-card:nth-child(6) { animation-delay: 0.5s; }
.skill-card:nth-child(7) { animation-delay: 0.6s; }
.skill-card:nth-child(8) { animation-delay: 0.7s; }

/* Same for vendor/recipe cards */
.vendor-item:nth-child(1),
.recipe-card:nth-child(1) { animation-delay: 0s; }
.vendor-item:nth-child(2),
.recipe-card:nth-child(2) { animation-delay: 0.1s; }
.vendor-item:nth-child(3),
.recipe-card:nth-child(3) { animation-delay: 0.15s; }
.vendor-item:nth-child(4),
.recipe-card:nth-child(4) { animation-delay: 0.2s; }
.vendor-item:nth-child(5),
.recipe-card:nth-child(5) { animation-delay: 0.25s; }
.vendor-item:nth-child(6),
.recipe-card:nth-child(6) { animation-delay: 0.3s; }

.enemy-card:nth-child(1) { animation-delay: 0s; }
.enemy-card:nth-child(2) { animation-delay: 0.1s; }
.enemy-card:nth-child(3) { animation-delay: 0.15s; }
.enemy-card:nth-child(4) { animation-delay: 0.2s; }
.enemy-card:nth-child(5) { animation-delay: 0.25s; }
.enemy-card:nth-child(6) { animation-delay: 0.3s; }

/* Buttons jello on hover */
.btn-cultivate:hover,
.btn-train-skill:hover,
.btn-craft:hover,
.btn-attack:hover,
.btn-buy:hover,
.btn-gather:hover {
    animation: jello-horizontal 0.7s cubic-bezier(0.785, 0.135, 0.150, 0.860) both;
}

/* Nav items hover */
.nav-item:hover {
    animation: jello-horizontal 0.6s cubic-bezier(0.785, 0.135, 0.150, 0.860) both;
}

/* ========================================
   GLOWING EFFECTS - Premium look
   ======================================== */

/* Pulsing glow for important elements */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(155, 127, 199, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(155, 127, 199, 0.8);
    }
}

/* Active tab glows */
.nav-item.active {
    animation: pulseGlow 3s ease-in-out infinite;
}

/* Cultivate button glows when ready */
.btn-cultivate:not(:disabled) {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Avatar glows */
.player-avatar {
    animation: pulseGlow 4s ease-in-out infinite;
}

/* HP/Qi bar glow */
@keyframes barGlow {
    0%, 100% {
        filter: brightness(1) drop-shadow(0 0 8px currentColor);
    }
    50% {
        filter: brightness(1.2) drop-shadow(0 0 15px currentColor);
    }
}

.bar-fill.hp {
    animation: barGlow 3s ease-in-out infinite;
}

.bar-fill.qi {
    animation: barGlow 2.5s ease-in-out infinite;
}

.bar-fill.exp {
    animation: barGlow 2s ease-in-out infinite;
}

/* ========================================
   SHIMMER EFFECT
   ======================================== */

/* Shimmer effect for rare items/bosses */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.boss-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 215, 0, 0.3),
        transparent
    );
    animation: shimmer 3s infinite;
    pointer-events: none;
    z-index: 1;
}

/* Gold shimmer on currency */
.resource-amount {
    position: relative;
    overflow: hidden;
}

.resource-amount::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(243, 156, 18, 0.6),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* ========================================
   FLOATING ANIMATION
   ======================================== */

/* Floating elements (idle animation) */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Avatar floats gently */
.player-avatar-container {
    animation: float 3s ease-in-out infinite;
}

/* Resource icons float */
.currency-icon {
    animation: float 2.5s ease-in-out infinite;
}

/* Event log floats */
#event-log {
    animation: float 4s ease-in-out infinite;
}

/* ========================================
   CSS PURE PARTICLES - No JavaScript!
   ======================================== */

/* Cultivation button sparkles */
.btn-cultivate::before,
.btn-cultivate::after {
    content: '✨';
    position: absolute;
    font-size: 1.2em;
    opacity: 0;
    pointer-events: none;
}

.btn-cultivate:hover::before {
    animation: sparkleLeft 1.5s ease-out infinite;
}

.btn-cultivate:hover::after {
    animation: sparkleRight 1.5s ease-out infinite 0.5s;
}

@keyframes sparkleLeft {
    0% {
        left: 20%;
        bottom: 50%;
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        left: 0%;
        bottom: 100%;
        opacity: 0;
        transform: scale(0.3);
    }
}

@keyframes sparkleRight {
    0% {
        right: 20%;
        bottom: 50%;
        opacity: 0;
        transform: scale(0.5);
    }
    50% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        right: 0%;
        bottom: 100%;
        opacity: 0;
        transform: scale(0.3);
    }
}

/* ========================================
   RIPPLE CLICK EFFECT
   ======================================== */

/* Ripple on click (pure CSS!) */
.btn-cultivate:active::after,
.btn-train-skill:active::after,
.btn-attack:active::after,
.btn-craft:active::after,
.btn-gather:active::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: translate(-50%, -50%);
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    to {
        width: 300px;
        height: 300px;
        opacity: 0;
    }
}

/* ========================================
   TEXT GLITCH EFFECT
   ======================================== */

/* Glitch effect for critical moments */
@keyframes glitch {
    0%, 100% {
        transform: translate(0);
    }
    20% {
        transform: translate(-2px, 2px);
    }
    40% {
        transform: translate(-2px, -2px);
    }
    60% {
        transform: translate(2px, 2px);
    }
    80% {
        transform: translate(2px, -2px);
    }
}

/* Apply on level up */
.level-up-text {
    animation: 
        glitch 0.3s ease-in-out,
        scale-up-center 0.5s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
    color: #ffd700;
    font-size: 2em;
    font-weight: bold;
    text-shadow: 
        0 0 20px rgba(255, 215, 0, 1),
        0 0 40px rgba(255, 215, 0, 0.6),
        2px 2px 0 #ff0000,
        -2px -2px 0 #00ffff;
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    background: var(--glass-strong);
    backdrop-filter: var(--blur-strong);
    border: 2px solid var(--purple-light);
    border-radius: 12px;
    padding: 15px 20px;
    min-width: 250px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5);
    animation: 
        bounce-in-top 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55),
        fadeOut 0.5s ease-out 2.5s forwards;
    pointer-events: auto;
}

.toast.success {
    border-color: #2ecc71;
}

.toast.warning {
    border-color: #f39c12;
}

.toast.error {
    border-color: #e74c3c;
}

.toast.level-up {
    border-color: #ffd700;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
}

.toast-title {
    font-weight: bold;
    font-size: 1.1em;
    margin-bottom: 5px;
    color: var(--text-light);
}

.toast-message {
    font-size: 0.9em;
    color: var(--text-medium);
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

/* ========================================
   FLOATING NUMBERS - Enhanced
   ======================================== */

.floating-number.critical {
    color: #ff0000;
    font-size: 2.5em;
    animation: floatUpCrit 1.5s ease-out forwards;
}

@keyframes floatUpCrit {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.3) rotate(-10deg);
    }
    15% {
        opacity: 1;
        transform: translateY(-15px) scale(1.5) rotate(5deg);
    }
    30% {
        transform: translateY(-25px) scale(1.3) rotate(-3deg);
    }
    50% {
        opacity: 1;
        transform: translateY(-50px) scale(1.1) rotate(2deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5) rotate(0deg);
    }
}

/* ========================================
   BACKGROUND EFFECTS
   ======================================== */

/* Animated gradient overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(
            circle at 20% 50%,
            rgba(155, 127, 199, 0.08) 0%,
            transparent 50%
        ),
        radial-gradient(
            circle at 80% 80%,
            rgba(106, 140, 199, 0.08) 0%,
            transparent 50%
        );
    animation: gradientShift 10s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes gradientShift {
    0%, 100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Vignette effect */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        ellipse at center,
        transparent 0%,
        rgba(0, 0, 0, 0.4) 100%
    );
    pointer-events: none;
    z-index: -1;
}

/* ========================================
   SMOOTH TRANSITIONS - Professional feel
   ======================================== */

/* All interactive elements */
button:not(:disabled),
.nav-item,
.skill-card,
.vendor-item,
input,
select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Scale up on hover */
.skill-card:hover,
.vendor-item:hover,
.recipe-card:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Buttons press down */
button:active {
    transform: scale(0.95);
}

/* Progress bars animate */
.progress-fill,
.bar-fill {
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Tab content fade in */
#tab-content {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Disabled buttons */
button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
    animation: none !important;
}

button:disabled:hover {
    transform: none;
    animation: none !important;
}

/* ========================================
   BOTÕES CONTEXTUAIS - Cores por Área
   ======================================== */

/* Cultivation button - Purple Theme */
.btn-cultivate {
    background: linear-gradient(135deg, var(--cultivation-primary), #7C3AED) !important;
    border: 2px solid var(--cultivation-primary) !important;
}

/* Attack button - Combat Red Theme */
.btn-attack {
    background: linear-gradient(135deg, var(--combat-primary), #DC2626) !important;
    border: 2px solid var(--combat-primary) !important;
}

/* Buy/Sell buttons - Treasure Gold Theme */
.btn-buy,
.btn-sell {
    background: linear-gradient(135deg, var(--treasure-primary), #F59E0B) !important;
    border: 2px solid var(--treasure-primary) !important;
    color: #000 !important;
    font-weight: bold !important;
}

.btn-sell-all {
    background: linear-gradient(135deg, var(--treasure-primary), #F59E0B) !important;
    border: 2px solid var(--treasure-primary) !important;
    color: #000 !important;
}

/* Gather button - Growth Green Theme */
.btn-gather {
    background: linear-gradient(135deg, var(--growth-primary), #16A34A) !important;
    border: 2px solid var(--growth-primary) !important;
}

/* Craft button - Treasure Theme */
.btn-craft {
    background: linear-gradient(135deg, var(--treasure-primary), #F59E0B) !important;
    border: 2px solid var(--treasure-primary) !important;
    color: #000 !important;
    font-weight: bold !important;
}

/* Train skill button - Cultivation Theme */
.btn-train-skill {
    background: linear-gradient(135deg, var(--cultivation-primary), #7C3AED) !important;
    border: 2px solid var(--cultivation-primary) !important;
}

/* ========================================
   SISTEMA DE RARIDADE VISUAL
   ======================================== */

/* Common - Gray */
.item-tier-common,
.tier-common {
    border: 2px solid var(--rarity-common) !important;
    box-shadow: 0 2px 8px rgba(156, 163, 175, 0.2) !important;
}

/* Uncommon - Green */
.item-tier-uncommon,
.tier-uncommon {
    border: 2px solid var(--rarity-uncommon) !important;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

/* Rare - Blue */
.item-tier-rare,
.tier-rare {
    border: 2px solid var(--rarity-rare) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4) !important;
}

/* Epic - Purple */
.item-tier-epic,
.tier-epic {
    border: 2px solid var(--rarity-epic) !important;
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.5) !important;
}

/* Legendary - Gold */
.item-tier-legendary,
.tier-legendary {
    border: 3px solid var(--rarity-legendary) !important;
    box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6) !important;
    animation: legendaryPulse 2s ease-in-out infinite;
    position: relative;
}

.item-tier-legendary::after,
.tier-legendary::after {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: inherit;
    border: 2px solid var(--rarity-legendary);
    animation: legendaryRing 2s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes legendaryPulse {
    0%, 100% { box-shadow: 0 8px 25px rgba(251, 191, 36, 0.6); }
    50% { box-shadow: 0 12px 35px rgba(251, 191, 36, 0.9); }
}

@keyframes legendaryRing {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.05); opacity: 1; }
}

/* Mythic - Red */
.item-tier-mythic,
.tier-mythic {
    border: 3px solid var(--rarity-mythic) !important;
    box-shadow: 0 10px 30px rgba(239, 68, 68, 0.7) !important;
    animation: mythicGlow 1.5s ease-in-out infinite;
}

@keyframes mythicGlow {
    0%, 100% { box-shadow: 0 10px 30px rgba(239, 68, 68, 0.7); }
    50% { box-shadow: 0 15px 45px rgba(239, 68, 68, 1); }
}

/* ===== AUTO-CULTIVATION TOGGLE ===== */
.auto-cultivation-toggle {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px;
    background: var(--glass-light);
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

.toggle-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 12px;
}

.toggle-label input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    width: 50px;
    height: 26px;
    background: var(--glass-light);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 13px;
    transition: all 0.3s ease;
    position: relative;
    flex-shrink: 0;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider {
    background: var(--accent-color);
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

.toggle-label input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-text {
    color: var(--primary-text);
    font-size: 14px;
    font-weight: 500;
    user-select: none;
}

.toggle-label:hover .toggle-slider {
    border-color: rgba(168, 85, 247, 0.5);
}

/* ===== OFFLINE GAINS MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(46, 16, 101, 0.95) 100%);
    border: 2px solid var(--accent-color);
    border-radius: 16px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(168, 85, 247, 0.4);
    animation: slideUp 0.4s ease;
}

.modal-content h2 {
    color: var(--primary-text);
    font-size: 32px;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 0 20px rgba(168, 85, 247, 0.8);
}

.modal-subtitle {
    color: var(--secondary-text);
    text-align: center;
    font-size: 16px;
    margin-bottom: 30px;
}

.offline-gains-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: var(--glass-light);
    border-radius: 12px;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

.gain-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    transition: transform 0.2s ease;
}

.gain-item:hover {
    transform: translateX(5px);
    background: rgba(168, 85, 247, 0.1);
}

.gain-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.gain-label {
    color: var(--secondary-text);
    flex-grow: 1;
    font-size: 16px;
}

.gain-value {
    color: var(--accent-color);
    font-size: 20px;
    font-weight: bold;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ===== SKILL CARD TOOLTIPS ===== */
.skill-card-tooltip {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: rgba(0, 0, 0, 0.98);
    border: 2px solid var(--accent-color);
    padding: 15px;
    border-radius: 12px;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    min-width: 250px;
    max-width: 350px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8), 0 0 20px rgba(168, 85, 247, 0.4);
}

.skill-card:hover .skill-card-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(calc(-100% - 10px));
}

.skill-card-tooltip p {
    margin: 8px 0;
    color: var(--primary-text);
    font-size: 14px;
    line-height: 1.5;
}

.skill-card-tooltip strong {
    color: var(--accent-color);
    display: block;
    margin-bottom: 4px;
}

/* ===== INLINE ICON STYLING ===== */
.inline-icon {
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
    filter: drop-shadow(0 0 4px rgba(255, 215, 0, 0.3));
}

/* ===== PRESTIGE TAB IMPROVEMENTS ===== */
.prestige-requirements-card {
    background: var(--glass-light);
    border: 2px solid var(--accent-color);
    border-radius: 12px;
    padding: 25px;
    margin: 20px 0;
}

.prestige-requirements-card h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 20px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    margin: 10px 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 4px solid transparent;
    transition: all 0.3s ease;
}

.requirement-item.met {
    border-left-color: var(--success-color);
    background: rgba(76, 175, 80, 0.1);
}

.requirement-item.unmet {
    border-left-color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

.req-check {
    font-size: 24px;
    flex-shrink: 0;
}

.req-label {
    color: var(--secondary-text);
    font-size: 16px;
    flex-grow: 1;
}

.req-value {
    color: var(--primary-text);
    font-weight: bold;
    font-size: 18px;
}

.requirements-hint {
    margin-top: 15px;
    color: var(--secondary-text);
    font-style: italic;
    font-size: 14px;
}

.prestige-benefits-section {
    margin: 30px 0;
}

.prestige-benefits-section h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.prestige-benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.benefit-item {
    background: var(--glass-light);
    border: 2px solid rgba(168, 85, 247, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    border-color: var(--accent-color);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.4);
}

.benefit-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.benefit-item p {
    margin: 8px 0;
    color: var(--primary-text);
}

.benefit-item strong {
    color: var(--accent-color);
    font-size: 16px;
}

.benefit-desc {
    color: var(--secondary-text);
    font-size: 14px;
}

/* ===== COMBAT ATTACK ANIMATIONS ===== */
@keyframes attackPulseHit {
    0% { 
        transform: scale(1); 
        filter: brightness(1);
    }
    25% {
        transform: scale(0.95) translateX(-8px);
        filter: brightness(0.7) hue-rotate(-20deg);
    }
    50% { 
        transform: scale(1.05) translateX(8px);
        filter: brightness(1.3) hue-rotate(20deg);
    }
    75% {
        transform: scale(0.98) translateX(-4px);
    }
    100% { 
        transform: scale(1);
        filter: brightness(1);
    }
}

@keyframes attackPulseStrike {
    0% { 
        transform: scale(1) translateY(0); 
        filter: brightness(1);
    }
    30% {
        transform: scale(1.15) translateY(-10px);
        filter: brightness(1.5) drop-shadow(0 0 15px rgba(255, 0, 0, 0.8));
    }
    60% {
        transform: scale(1.08) translateY(5px);
        filter: brightness(1.2);
    }
    100% { 
        transform: scale(1) translateY(0);
        filter: brightness(1);
    }
}

.attack-animation-hit {
    animation: attackPulseHit 0.5s ease;
}

.attack-animation-strike {
    animation: attackPulseStrike 0.5s ease;
}

/* ===== SKILL AUTO-TRAINING STYLES ===== */
.btn-auto-train-skill {
    padding: 10px 16px;
    font-size: 0.9em;
    font-weight: 600;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border: 2px solid #3498db;
    border-radius: 8px;
    color: white;
    margin-top: 10px;
    width: 100%;
    transition: all 0.3s ease;
}

.btn-auto-train-skill:hover {
    background: linear-gradient(135deg, #5dade2, #3498db);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.5);
    transform: translateY(-2px);
}

.btn-auto-train-skill.active {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #2ecc71;
    box-shadow: 0 0 20px rgba(46, 204, 113, 0.6);
}

.auto-training-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: bold;
    animation: autoPulse 2s ease-in-out infinite;
    box-shadow: 0 0 15px rgba(52, 152, 219, 0.6);
    z-index: 10;
}

@keyframes autoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.05); }
}

/* ===== IMPROVED TERRITORY CARD STYLES ===== */
.territory-icon-large {
    font-size: 5em;
    text-align: center;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(168, 85, 247, 0.6));
    animation: territoryFloat 3s ease-in-out infinite;
}

@keyframes territoryFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.territory-header-section {
    text-align: center;
    margin-bottom: 6px;
}

.territory-header-section h3 {
    margin: 0 0 4px;
    color: var(--accent-color);
    font-size: 1em;
}

.territory-level-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(168, 85, 247, 0.5));
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    font-size: 0.72em;
    font-weight: bold;
    margin: 0 3px;
}

.conquered-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.3), rgba(46, 204, 113, 0.5));
    border: 1px solid #2ecc71;
    border-radius: 10px;
    font-size: 0.72em;
    font-weight: bold;
    color: #2ecc71;
    margin: 0 3px;
}

.territory-description {
    text-align: center;
    color: var(--secondary-text);
    font-size: 0.78em;
    margin-bottom: 6px;
    line-height: 1.4;
    padding: 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.territory-boss-section {
    background: rgba(231, 76, 60, 0.1);
    border: 1px solid rgba(231, 76, 60, 0.25);
    border-radius: 6px;
    padding: 6px;
    margin: 4px 0;
}

.boss-header-mini {
    text-align: center;
    margin-bottom: 4px;
}

.boss-label {
    font-size: 0.65em;
    color: #e74c3c;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.boss-card-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px;
    border-radius: 8px;
}

.boss-icon-mini {
    font-size: 3em;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(231, 76, 60, 0.2);
    border: 2px solid #e74c3c;
    border-radius: 10px;
    flex-shrink: 0;
}

.boss-info-mini {
    flex: 1;
}

.boss-name-mini {
    font-weight: bold;
    color: var(--primary-text);
    margin-bottom: 2px;
    font-size: 0.85em;
}

.boss-level-mini {
    color: var(--secondary-text);
    font-size: 0.75em;
    margin-bottom: 4px;
}

.boss-stats-mini {
    display: flex;
    gap: 6px;
    font-size: 0.72em;
    color: var(--primary-text);
}

.territory-rewards-section {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-radius: 6px;
    padding: 5px 8px;
    margin: 4px 0;
}

.rewards-header-mini {
    text-align: center;
    font-size: 0.68em;
    color: #ffd700;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: bold;
}

.rewards-list-mini {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.reward-item-mini {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 5px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.reward-icon-mini {
    font-size: 1em;
    flex-shrink: 0;
}

.reward-text-mini {
    color: var(--primary-text);
    font-weight: 600;
    font-size: 0.72em;
}

.bonus-active-mini {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-radius: 6px;
    color: white;
    font-size: 0.75em;
    font-weight: bold;
    text-align: center;
    margin-top: 4px;
}

.territory-passive-section {
    background: rgba(46, 204, 113, 0.1);
    border: 1px solid rgba(46, 204, 113, 0.25);
    border-radius: 6px;
    padding: 5px 8px;
    margin: 4px 0;
}

.passive-header-mini {
    text-align: center;
    font-size: 0.68em;
    color: #2ecc71;
    margin-bottom: 4px;
    font-weight: bold;
}

.passive-list-mini {
    display: flex;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
}

.passive-item-mini {
    padding: 2px 6px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    font-size: 0.72em;
    color: var(--primary-text);
    font-weight: 600;
}

.btn-territory-action {
    width: 100%;
    padding: 8px 10px;
    font-size: 0.8em;
    font-weight: bold;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: 1px solid #e74c3c;
    border-radius: 8px;
    color: white;
    margin-top: auto;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

.btn-territory-action:hover:not(:disabled) {
    background: linear-gradient(135deg, #ff6b59, #e74c3c);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
    transform: translateY(-3px);
}

.btn-territory-action:disabled {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    border-color: #95a5a6;
    color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

.territory-card.conquered .btn-territory-action:disabled {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #2ecc71;
    color: white;
}

/* ===== TERRITORY REDESIGN — Compact 3-col Grid ===== */
/* NOTE: base .territory-card already has margin:0, padding:12px (defined in universal card section) */

/* Compact cards — additional overrides */
.territory-card {
    position: relative;
    min-height: auto;
    overflow: hidden;
}

.territory-card-inner {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ═══ Territory Background Banner ═══ */
.territory-banner {
    position: relative;
    width: calc(100% + 24px);
    margin: -12px -12px 10px -12px;
    height: 120px;
    overflow: hidden;
    border-radius: 10px 10px 0 0;
}
.territory-banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
    transition: transform 0.4s ease;
}
.territory-card:hover .territory-banner-img {
    transform: scale(1.05);
}
.territory-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        transparent 20%,
        rgba(15, 10, 25, 0.3) 50%,
        rgba(15, 10, 25, 0.85) 85%,
        rgba(15, 10, 25, 1) 100%
    );
    pointer-events: none;
}
.territory-banner-name {
    position: absolute;
    bottom: 6px;
    left: 12px;
    right: 12px;
    font-size: 0.85em;
    font-weight: 800;
    color: #f0e6d0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 12px rgba(139,69,19,0.4);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    z-index: 1;
}
/* Conquered banner — golden tint */
.territory-card.conquered .territory-banner-overlay {
    background: linear-gradient(
        to bottom,
        rgba(46, 204, 113, 0.08) 0%,
        rgba(15, 10, 25, 0.3) 50%,
        rgba(15, 10, 25, 0.85) 85%,
        rgba(15, 10, 25, 1) 100%
    );
}
.territory-card.conquered .territory-banner-name {
    color: #2ecc71;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9), 0 0 8px rgba(46,204,113,0.3);
}
/* Locked banner — desaturated */
.territory-card.territory-locked .territory-banner-img {
    filter: grayscale(70%) brightness(0.5);
}
.territory-card.territory-locked .territory-banner-name {
    color: #777;
}

/* Step number badge (top–left corner) */
.territory-step-marker {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72em;
    font-weight: 900;
    z-index: 2;
    border: 2px solid;
}
.step-conquered { background: #2ecc71; border-color: #27ae60; color: #fff; }
.step-available { background: #e74c3c; border-color: #c0392b; color: #fff; animation: stepPulse 2s ease-in-out infinite; }
.step-locked    { background: rgba(100,100,100,0.5); border-color: #555; color: #888; }
@keyframes stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.4); }
    50%      { box-shadow: 0 0 12px 4px rgba(231,76,60,0.2); }
}

/* Hide connectors (no longer needed in grid) */
.territory-connector { display: none; }

/* Compact icon */
.territory-card .territory-icon-large { font-size: 2em; margin-bottom: 4px; }

/* Compact header */
.territory-card .territory-header-section h3 { font-size: 1em; margin: 4px 0 2px; }
.territory-card .territory-description { font-size: 0.78em; line-height: 1.4; margin-bottom: 8px; color: #99a; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Compact boss card */
.boss-card-mini { padding: 8px 10px; gap: 8px; }
.boss-icon-mini { font-size: 1.6em; }
.boss-name-mini { font-size: 0.82em; }
.boss-stats-mini { font-size: 0.72em; gap: 6px; }
.boss-header-mini { padding: 4px 0; }
.boss-header-mini .boss-label { font-size: 0.65em; letter-spacing: 1px; }

/* Territory boss portrait (aligned with combat card style) */
.territory-portrait-container {
    width: 55px;
    height: 55px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid #8b4513;
    flex-shrink: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 15, 30, 0.8);
}
.territory-portrait-container .enemy-portrait {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
}
.territory-portrait-container .enemy-icon-emoji {
    font-size: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.boss-portrait-glow {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}
.territory-portrait-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 30%, rgba(0,0,0,0.5) 100%);
    pointer-events: none;
}

/* Compact rewards / passive — main definitions above are already compact */

/* Compact action button */
.btn-territory-action { font-size: 0.8em; padding: 8px 12px; margin-top: auto; }

/* Locked card styling */
.territory-card.territory-locked {
    opacity: 0.5;
    filter: grayscale(40%);
    border-color: rgba(100,100,100,0.25) !important;
}
.territory-card.territory-locked:hover { transform: none; opacity: 0.6; }
.territory-card.territory-locked .territory-icon-large { filter: grayscale(60%) brightness(0.7); animation: none; }

/* Locked overlay */
.territory-locked-overlay {
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 8px;
    padding: 12px;
    margin: 8px 0;
    text-align: center;
}
.locked-requirement { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #888; font-size: 0.85em; }
.locked-icon { font-size: 1.5em; opacity: 0.6; }
.locked-progress-bar { width: 100%; max-width: 160px; height: 5px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.locked-progress-fill { height: 100%; background: linear-gradient(90deg,#3498db,#9b59b6); border-radius: 3px; transition: width 0.5s; }
.locked-progress-text { font-size: 0.75em; color: #666; }

/* Badges row */
.territory-badges { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.territory-level-badge.badge-locked { background: rgba(100,100,100,0.3); border-color: #555; color: #888; }

/* Difficulty badge */
.territory-diff-badge { display: inline-block; padding: 3px 8px; border-radius: 10px; font-size: 0.72em; font-weight: bold; letter-spacing: 0.5px; }
.diff-easy   { background: rgba(46,204,113,0.2);  border: 1px solid rgba(46,204,113,0.5);  color: #2ecc71; }
.diff-fair   { background: rgba(52,152,219,0.2);  border: 1px solid rgba(52,152,219,0.5);  color: #3498db; }
.diff-hard   { background: rgba(243,156,18,0.2);  border: 1px solid rgba(243,156,18,0.5);  color: #f39c12; }
.diff-deadly { background: rgba(231,76,60,0.2);   border: 1px solid rgba(231,76,60,0.5);   color: #e74c3c; }

/* Boss section on locked cards */
.boss-locked { opacity: 0.45; filter: grayscale(30%); }
.boss-locked .boss-label { color: #666 !important; }

/* Locked reward/passive sections */
.rewards-locked, .passive-locked { opacity: 0.5; border-style: dashed !important; }
.passive-active { border-color: rgba(46,204,113,0.5) !important; background: rgba(46,204,113,0.12) !important; }

/* Mobile: responsive territory grid */
@media (max-width: 768px) {
    #territories-container { grid-template-columns: repeat(2, 1fr) !important; max-width: 600px; }
    .territory-banner { height: 100px; }
    .territory-banner-name { font-size: 0.75em; }
}
@media (max-width: 480px) {
    #territories-container { grid-template-columns: 1fr !important; max-width: 380px; }
    .territory-banner { height: 130px; }
    .territory-banner-name { font-size: 0.82em; }
}

/* ── Territory Info Box Redesign ── */
.territory-info-box {
    max-width: 960px !important;
    padding: 14px 20px !important;
    margin: 0 auto 8px !important;
}
.territory-info-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}
.territory-info-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.territory-info-label {
    font-size: 0.7em;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.territory-info-value {
    font-size: 1.05em;
    font-weight: 700;
    color: #ffd700;
}
.territory-progress-global {
    margin-bottom: 8px;
}
.territory-progress-bar-global {
    height: 5px;
    background: rgba(255,255,255,0.06);
    border-radius: 3px;
    overflow: hidden;
}
.territory-progress-fill-global {
    height: 100%;
    background: linear-gradient(90deg,#2ecc71,#ffd700);
    border-radius: 3px;
    transition: width 0.5s;
}

/* ============================================
   CULTIVATION TAB COMPACT
   ============================================ */

.cultivation-tab-compact {
    max-width: 1100px;
    margin: 0 auto;
    padding: 15px;
}

/* Tab Header */
.cultivation-tab-header {
    text-align: center;
    margin-bottom: 20px;
}

.cultivation-tab-header h2 {
    font-size: 1.8em;
    margin: 0 0 6px 0;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    letter-spacing: 1px;
}

.cultivation-tab-intro {
    font-size: 0.9em;
    color: var(--secondary-text);
    margin: 0;
    opacity: 0.85;
}

/* Realm Icon — CSS-only replacement for emoji */
.realm-journey-icon-css {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(155, 127, 199, 0.4), rgba(155, 127, 199, 0.1));
    border: 2px solid rgba(155, 127, 199, 0.5);
    flex-shrink: 0;
    position: relative;
}
.realm-journey-icon-css::after {
    content: '';
    position: absolute;
    inset: 6px;
    border-radius: 50%;
    border: 2px solid rgba(255, 215, 0, 0.4);
    animation: realm-icon-pulse 3s ease-in-out infinite;
}
@keyframes realm-icon-pulse {
    0%, 100% { transform: scale(1); opacity: 0.5; }
    50% { transform: scale(1.15); opacity: 1; }
}

/* Realm Icon — actual image */
.realm-journey-icon-img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(155, 127, 199, 0.5);
    box-shadow: 0 0 12px rgba(139, 92, 246, 0.35);
    flex-shrink: 0;
    animation: realm-icon-pulse 3s ease-in-out infinite;
}

/* Stat Colored Dots */
.stat-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 4px;
    vertical-align: middle;
}
.stat-dot-hp { background: #ef5350; box-shadow: 0 0 4px rgba(239, 83, 80, 0.5); }
.stat-dot-qi { background: #42a5f5; box-shadow: 0 0 4px rgba(66, 165, 245, 0.5); }
.stat-dot-atk { background: #ff9800; box-shadow: 0 0 4px rgba(255, 152, 0, 0.5); }
.stat-dot-def { background: #66bb6a; box-shadow: 0 0 4px rgba(102, 187, 106, 0.5); }
.stat-dot-exp { background: #ab47bc; box-shadow: 0 0 4px rgba(171, 71, 188, 0.5); }
.stat-dot-regen { background: #26c6da; box-shadow: 0 0 4px rgba(38, 198, 218, 0.5); }

/* Section title accent — replaces emoji in section headers */
.cultivation-col-manual .section-title-compact {
    border-left: 3px solid var(--purple-light, #9b7fc7);
    padding-left: 10px;
}
.cultivation-col-auto .section-title-compact {
    border-left: 3px solid #4CAF50;
    padding-left: 10px;
}

/* Auto-cult warning — orange text, no emoji */
.auto-cult-warning {
    color: #ff9800 !important;
    font-size: 0.78em !important;
}

/* Cultivation Hint below manual column */
.cultivation-hint {
    font-size: 0.8em;
    color: var(--secondary-text);
    text-align: center;
    margin: 10px 0 0 0;
    opacity: 0.7;
    line-height: 1.4;
    font-style: italic;
}

/* Column Accent Colors */
.cultivation-col-manual {
    border-color: rgba(155, 127, 199, 0.35) !important;
}

.cultivation-col-auto {
    border-color: rgba(76, 175, 80, 0.25) !important;
}

/* Progress bar percentage label */
.realm-progress-pct {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    font-weight: 600;
    color: rgba(255,255,255,0.8);
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    z-index: 2;
}

/* Session Summary Panel */
.cultivation-session-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.cult-summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
}

.cult-summary-label {
    font-size: 0.75em;
    color: var(--secondary-text);
    text-align: center;
    line-height: 1.3;
}

.cult-summary-value {
    font-size: 1.1em;
    font-weight: 700;
    color: var(--accent-color);
}

/* Breakthrough explanation */
.bt-explanation {
    font-size: 0.82em;
    color: var(--secondary-text);
    margin-top: 10px;
    opacity: 0.75;
    font-style: italic;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .cultivation-session-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Header - Compact */
.cultivation-header {
    text-align: center;
    margin-bottom: 20px;
}

.cultivation-header h2 {
    font-size: 2em;
    margin: 0 0 5px 0;
    color: var(--accent-color);
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.cultivation-subtitle {
    font-size: 0.95em;
    color: var(--secondary-text);
    margin: 0;
}

/* Stats Overview - Mini Cards */
.cultivation-stats-compact {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-mini {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.8), rgba(16, 16, 30, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-mini.exp { border-color: #ffd700; box-shadow: 0 0 10px rgba(255, 215, 0, 0.15); }
.stat-mini.qi { border-color: #3498db; box-shadow: 0 0 10px rgba(52, 152, 219, 0.15); }
.stat-mini.realm { border-color: #9b59b6; box-shadow: 0 0 10px rgba(155, 89, 182, 0.15); }

.stat-mini-icon {
    font-size: 2em;
    line-height: 1;
}

.stat-mini-info {
    flex: 1;
}

.stat-mini-label {
    font-size: 0.75em;
    color: var(--secondary-text);
    margin-bottom: 2px;
}

.stat-mini-value {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--accent-color);
}

/* Main Grid - 2 Columns */
.cultivation-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.cultivation-column {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.9), rgba(16, 16, 30, 0.9));
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
}

.section-title-compact {
    font-size: 1.1em;
    color: var(--text-color);
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Manual Cultivation - Compact Button */
.btn-cultivate-compact {
    width: 100%;
    height: 80px;
    background: linear-gradient(135deg, #8e44ad, #9b59b6);
    border: 2px solid #9b59b6;
    border-radius: 10px;
    color: white;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.3);
    margin-bottom: 12px;
}

.btn-cultivate-compact:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.5);
}

.btn-cultivate-compact:active {
    transform: scale(0.98);
}

.btn-cultivate-compact .cultivate-icon {
    font-size: 2em;
}

.btn-cultivate-compact .cultivate-main {
    font-size: 1.1em;
    margin-bottom: 3px;
}

.btn-cultivate-compact .cultivate-cost {
    font-size: 0.65em;
    opacity: 0.9;
}

.cultivation-info-compact {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
}

.info-row-compact {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 0.9em;
}

.info-row-compact:first-child {
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Auto-Cultivation - Compact */
.auto-toggle-compact {
    margin-bottom: 12px;
}

.auto-toggle-label-compact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.95em;
    user-select: none;
}

.auto-toggle-switch-compact {
    position: relative;
    width: 55px;
    height: 28px;
}

.auto-toggle-input {
    opacity: 0;
    width: 0;
    height: 0;
}

.auto-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #34495e;
    transition: 0.3s;
    border-radius: 28px;
    border: 2px solid var(--border-color);
}

.auto-toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.auto-toggle-input:checked + .auto-toggle-slider {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #2ecc71;
}

.auto-toggle-input:checked + .auto-toggle-slider:before {
    transform: translateX(27px);
}

.auto-stats-compact {
    margin-bottom: 12px;
}

.auto-stat-compact {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 0.9em;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.auto-stat-compact:last-child {
    border-bottom: none;
}

.auto-stat-compact .highlight {
    font-weight: bold;
    color: var(--accent-color);
}

.progress-bar-compact {
    position: relative;
    width: 100%;
    height: 32px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.progress-fill-compact {
    position: absolute;
    top: 0;
    left: 0;
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    transition: width 0.3s ease;
}

@keyframes progressPulse {
    0%, 100% { 
        opacity: 0.8;
        background: linear-gradient(90deg, #2ecc71, #27ae60);
    }
    50% { 
        opacity: 1;
        background: linear-gradient(90deg, #27ae60, #2ecc71);
    }
}

@keyframes autoShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.progress-text-compact {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 0.85em;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    z-index: 1;
}

/* Offline Info - Compact Grid */
.offline-info-compact {
    background: linear-gradient(135deg, rgba(41, 128, 185, 0.1), rgba(44, 62, 80, 0.1));
    border: 2px solid rgba(52, 152, 219, 0.3);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
}

.offline-items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.offline-item-mini {
    background: rgba(26, 26, 46, 0.6);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid rgba(52, 152, 219, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85em;
}

.offline-icon-mini {
    font-size: 1.5em;
}

/* ============================================= */
/* TIER BORDERS — Crafting & Enchanting Cards     */
/* ============================================= */
.tier-border-common {
    border: 2px solid #aaa;
}
.tier-border-rare {
    border: 2px solid #4fc3f7;
    box-shadow: 0 0 12px rgba(79, 195, 247, 0.4), inset 0 0 20px rgba(79, 195, 247, 0.06);
    animation: rare-glow 3s ease-in-out infinite;
}
.tier-border-epic {
    border: 2px solid #ce93d8;
    box-shadow: 0 0 16px rgba(206, 147, 216, 0.5), inset 0 0 25px rgba(171, 71, 188, 0.08);
    animation: epic-glow 2.5s ease-in-out infinite;
}
.tier-border-legendary {
    border: 2px solid #ffd54f;
    box-shadow: 0 0 20px rgba(255, 213, 79, 0.6), inset 0 0 30px rgba(255, 213, 79, 0.08);
    animation: legendary-pulse 3s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}
.tier-border-legendary::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,213,79,0.08), transparent, rgba(255,213,79,0.05), transparent);
    animation: legendary-rotate 6s linear infinite;
    pointer-events: none;
    z-index: 0;
}
.tier-border-legendary > * { position: relative; z-index: 1; }
@keyframes rare-glow {
    0%, 100% { box-shadow: 0 0 12px rgba(79, 195, 247, 0.4), inset 0 0 20px rgba(79, 195, 247, 0.06); }
    50% { box-shadow: 0 0 24px rgba(79, 195, 247, 0.7), inset 0 0 30px rgba(79, 195, 247, 0.1); }
}
@keyframes epic-glow {
    0%, 100% { box-shadow: 0 0 16px rgba(206, 147, 216, 0.5), inset 0 0 25px rgba(171, 71, 188, 0.08); }
    50% { box-shadow: 0 0 32px rgba(206, 147, 216, 0.8), inset 0 0 40px rgba(171, 71, 188, 0.12); }
}
@keyframes legendary-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255, 213, 79, 0.6), inset 0 0 30px rgba(255, 213, 79, 0.08); }
    50% { box-shadow: 0 0 40px rgba(255, 213, 79, 0.9), inset 0 0 50px rgba(255, 213, 79, 0.15); }
}
@keyframes legendary-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================= */
/* 6C. MATERIAL AVAILABILITY INDICATOR            */
/* ============================================= */
.recipe-card.craftable {
    border-color: rgba(76, 230, 120, 0.7) !important;
    box-shadow: 0 0 16px rgba(76, 230, 120, 0.35), inset 0 0 30px rgba(76, 230, 120, 0.06) !important;
}
.recipe-card.craftable .btn-craft {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    box-shadow: 0 0 12px rgba(46, 204, 113, 0.5);
    font-size: 1.05em;
}
.recipe-card:not(.craftable) {
    opacity: 0.82;
}
.recipe-card:not(.craftable):hover {
    opacity: 1;
}

/* ============================================= */
/* 6E. ANIMATED ICONS — Gentle pulse on cards     */
/* ============================================= */
.recipe-card.craftable .recipe-icon-large,
.recipe-card.craftable .item-icon-emoji {
    animation: icon-breathe 2.5s ease-in-out infinite;
}
.gathering-node-card:not(.gathering-node-locked) .node-icon {
    animation: icon-breathe 3s ease-in-out infinite;
}
@keyframes icon-breathe {
    0%, 100% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.08); filter: brightness(1.25); }
}

/* ============================================= */
/* PHASE 2: FURNACE / CRAFTING ANIMATIONS         */
/* ============================================= */
.crafting-progress-card,
.gathering-progress-card {
    position: relative;
    overflow: hidden;
}
.crafting-progress-card::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(0deg,
        rgba(255, 120, 30, 0.12) 0%,
        rgba(255, 80, 20, 0.06) 40%,
        transparent 100%);
    animation: furnace-flicker 1.5s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}
.crafting-progress-card > * { position: relative; z-index: 1; }
@keyframes furnace-flicker {
    0% { opacity: 0.6; transform: scaleY(1); }
    30% { opacity: 1; transform: scaleY(1.05); }
    60% { opacity: 0.8; transform: scaleY(0.98); }
    100% { opacity: 0.7; transform: scaleY(1.02); }
}

/* Progress bar glow intensifies near completion */
.craft-progress-fill {
    transition: width 0.3s linear, box-shadow 0.5s ease;
}
.craft-progress-fill[style*="9"] {
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.8), 0 0 40px rgba(76, 175, 80, 0.4);
}

/* Anvil shake on forging cards */
.crafting-progress-card.forging-shake {
    animation: anvil-shake 0.3s ease-in-out;
}
@keyframes anvil-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-3px) rotate(-0.5deg); }
    40% { transform: translateX(3px) rotate(0.5deg); }
    60% { transform: translateX(-2px); }
    80% { transform: translateX(2px); }
}

/* ============================================= */
/* PHASE 2: ITEM POP — Craft completion           */
/* ============================================= */
.craft-result-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10000;
    background: radial-gradient(ellipse at center, rgba(20,15,30,0.97), rgba(10,8,18,0.95));
    border: 2px solid rgba(155, 127, 199, 0.5);
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 0 60px rgba(0,0,0,0.8);
    animation: craft-pop-in 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    pointer-events: auto;
}
.craft-result-popup.success { border-color: rgba(76, 230, 120, 0.7); }
.craft-result-popup.fail { border-color: rgba(255, 80, 80, 0.7); }
.craft-result-popup .popup-icon {
    font-size: 3em;
    display: block;
    margin-bottom: 10px;
    animation: item-bounce 0.6s ease-out 0.3s both;
}
.craft-result-popup .popup-icon img {
    width: 64px; height: 64px;
}
.craft-result-popup .popup-title {
    font-size: 1.3em;
    font-weight: 700;
    margin-bottom: 6px;
    color: #e8e0f0;
}
.craft-result-popup.success .popup-title { color: #66ff88; }
.craft-result-popup.fail .popup-title { color: #ff6666; }
.craft-result-popup .popup-subtitle {
    font-size: 0.9em;
    color: #aab;
}
.craft-result-popup.tier-legendary { border-color: rgba(255,213,79,0.8); box-shadow: 0 0 60px rgba(255,213,79,0.3); }
.craft-result-popup.tier-epic { border-color: rgba(171,71,188,0.8); box-shadow: 0 0 40px rgba(171,71,188,0.25); }
.craft-result-popup.tier-rare { border-color: rgba(79,195,247,0.8); box-shadow: 0 0 30px rgba(79,195,247,0.2); }
@keyframes craft-pop-in {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
@keyframes item-bounce {
    0% { transform: translateY(10px) scale(0.8); opacity: 0; }
    50% { transform: translateY(-8px) scale(1.1); }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.craft-result-popup.fade-out {
    animation: craft-pop-out 0.3s ease-in forwards;
}
@keyframes craft-pop-out {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
}

/* ============================================= */
/* PHASE 3: GATHERING NODE IDLE ANIMATIONS        */
/* ============================================= */
.gathering-node-card:not(.gathering-node-locked) {
    position: relative;
    overflow: hidden;
}
.gathering-node-card:not(.gathering-node-locked)::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.03), transparent);
    animation: node-shimmer 5s ease-in-out infinite;
    pointer-events: none;
}
@keyframes node-shimmer {
    0%, 100% { left: -100%; }
    50% { left: 150%; }
}

/* Per-node ambient colors (applied via JS data attributes) */
.gathering-node-card[data-node-type="forest"]     { border-color: rgba(76,175,80,0.4); }
.gathering-node-card[data-node-type="mine"]        { border-color: rgba(158,158,158,0.5); }
.gathering-node-card[data-node-type="beast"]       { border-color: rgba(255,152,0,0.4); }
.gathering-node-card[data-node-type="crystal"]     { border-color: rgba(100,181,246,0.5); }
.gathering-node-card[data-node-type="garden"]      { border-color: rgba(129,212,250,0.4); }
.gathering-node-card[data-node-type="dragon"]      { border-color: rgba(244,67,54,0.4); }
.gathering-node-card[data-node-type="phoenix"]     { border-color: rgba(255,138,101,0.4); }
.gathering-node-card[data-node-type="void"]        { border-color: rgba(149,117,205,0.5); }
.gathering-node-card[data-node-type="spirit_vein"] { border-color: rgba(0,188,212,0.4); }

/* Node icon per-type animations */
.gathering-node-card[data-node-type="forest"] .node-icon    { animation: sway-tree 3s ease-in-out infinite; }
.gathering-node-card[data-node-type="mine"] .node-icon      { animation: pickaxe-hit 2s ease-in-out infinite; }
.gathering-node-card[data-node-type="crystal"] .node-icon   { animation: crystal-sparkle 2.5s ease-in-out infinite; }
.gathering-node-card[data-node-type="garden"] .node-icon    { animation: sway-tree 4s ease-in-out infinite; }
.gathering-node-card[data-node-type="dragon"] .node-icon    { animation: flame-flicker 1.5s ease-in-out infinite; }
.gathering-node-card[data-node-type="phoenix"] .node-icon   { animation: flame-flicker 2s ease-in-out infinite; }
.gathering-node-card[data-node-type="void"] .node-icon      { animation: void-pulse 3s ease-in-out infinite; }
.gathering-node-card[data-node-type="spirit_vein"] .node-icon { animation: crystal-sparkle 3s ease-in-out infinite; }

@keyframes sway-tree {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(3deg); }
    75% { transform: rotate(-3deg); }
}
@keyframes pickaxe-hit {
    0%, 70%, 100% { transform: rotate(0deg); }
    80% { transform: rotate(-12deg); }
    90% { transform: rotate(5deg); }
}
@keyframes crystal-sparkle {
    0%, 100% { filter: brightness(1) drop-shadow(0 0 6px rgba(100,181,246,0.3)); }
    50% { filter: brightness(1.4) drop-shadow(0 0 14px rgba(100,181,246,0.7)); }
}
@keyframes flame-flicker {
    0%, 100% { transform: scale(1) translateY(0); filter: brightness(1); }
    25% { transform: scale(1.05) translateY(-2px); filter: brightness(1.2); }
    50% { transform: scale(0.97) translateY(1px); filter: brightness(0.9); }
    75% { transform: scale(1.03) translateY(-1px); filter: brightness(1.15); }
}
@keyframes void-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); filter: hue-rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); filter: hue-rotate(30deg); }
}

/* Gathering loot fly-in */
.loot-fly-item {
    position: fixed;
    z-index: 9999;
    font-size: 1.2em;
    pointer-events: none;
    animation: loot-fly 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    text-shadow: 0 0 8px rgba(255,255,255,0.5);
}
.loot-fly-item img { width: 24px; height: 24px; }
@keyframes loot-fly {
    0% { opacity: 1; transform: translate(0, 0) scale(1.2); }
    80% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--fly-dx, 0px), var(--fly-dy, -80px)) scale(0.5); }
}

/* Node depletion flash */
.gathering-node-card.just-gathered {
    animation: node-deplete 1s ease forwards;
}
@keyframes node-deplete {
    0% { filter: brightness(1.6); }
    100% { filter: brightness(1); }
}

/* ============================================= */
/* PHASE 4: RARE DROP POPUP                       */
/* ============================================= */
.rare-drop-popup {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    z-index: 10001;
    background: radial-gradient(ellipse at center, rgba(25,20,40,0.98), rgba(12,10,20,0.96));
    border: 2px solid #ffd54f;
    border-radius: 16px;
    padding: 30px 40px;
    text-align: center;
    box-shadow: 0 0 80px rgba(255,213,79,0.4), inset 0 0 40px rgba(255,213,79,0.05);
    animation: rare-drop-in 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    min-width: 250px;
}
.rare-drop-popup .rare-label {
    font-size: 0.8em;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #ffd54f;
    margin-bottom: 8px;
    animation: rare-label-flash 0.5s ease 0.3s both;
}
.rare-drop-popup .rare-icon {
    font-size: 3.5em;
    display: block;
    margin: 10px 0;
    animation: item-bounce 0.6s ease-out 0.2s both;
}
.rare-drop-popup .rare-icon img { width: 72px; height: 72px; }
.rare-drop-popup .rare-name {
    font-size: 1.2em;
    font-weight: 700;
    color: #e8e0f0;
    margin: 8px 0 4px;
}
.rare-drop-popup .rare-amount {
    font-size: 0.95em;
    color: #aab;
}
@keyframes rare-drop-in {
    0% { transform: translate(-50%, -50%) scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: translate(-50%, -50%) scale(1.1) rotate(2deg); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1) rotate(0deg); opacity: 1; }
}
@keyframes rare-label-flash {
    0% { opacity: 0; letter-spacing: 8px; }
    100% { opacity: 1; letter-spacing: 2px; }
}
.rare-drop-popup.fade-out {
    animation: craft-pop-out 0.3s ease-in forwards;
}

/* ============================================= */
/* CUSTOM CONFIRM MODAL (replaces browser confirm) */
/* ============================================= */
.dao-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: modal-overlay-in 0.25s ease;
    backdrop-filter: blur(4px);
}
@keyframes modal-overlay-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}
.dao-modal {
    background: linear-gradient(135deg, rgba(30,25,40,0.98), rgba(18,14,28,0.98));
    border: 2px solid rgba(155, 127, 199, 0.5);
    border-radius: 16px;
    padding: 0;
    width: 90%;
    max-width: 420px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8), 0 0 40px rgba(155,127,199,0.15);
    animation: modal-slide-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
@keyframes modal-slide-in {
    0% { transform: translateY(30px) scale(0.95); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}
.dao-modal-header {
    padding: 18px 24px 14px;
    border-bottom: 1px solid rgba(155, 127, 199, 0.2);
    display: flex;
    align-items: center;
    gap: 12px;
}
.dao-modal-header .modal-icon {
    font-size: 1.6em;
    flex-shrink: 0;
}
.dao-modal-header .modal-title {
    font-size: 1.15em;
    font-weight: 700;
    color: #e8e0f0;
}
.dao-modal-header.danger .modal-icon { color: #ff6b6b; }
.dao-modal-header.danger { border-bottom-color: rgba(255,107,107,0.3); }
.dao-modal-header.warning .modal-icon { color: #ffd54f; }
.dao-modal-header.warning { border-bottom-color: rgba(255,213,79,0.3); }
.dao-modal-header.info .modal-icon { color: #64b5f6; }
.dao-modal-body {
    padding: 20px 24px;
    color: #ccc;
    font-size: 0.95em;
    line-height: 1.6;
    white-space: pre-line;
}
.dao-modal-footer {
    padding: 14px 24px 18px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}
.dao-modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}
.dao-modal-btn.cancel {
    background: rgba(255,255,255,0.08);
    color: #aab;
    border: 1px solid rgba(255,255,255,0.15);
}
.dao-modal-btn.cancel:hover {
    background: rgba(255,255,255,0.15);
    color: #ddd;
}
.dao-modal-btn.confirm {
    background: linear-gradient(135deg, #7c3aed, #9b59b6);
    color: #fff;
    box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}
.dao-modal-btn.confirm:hover {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    box-shadow: 0 6px 16px rgba(124,58,237,0.4);
    transform: translateY(-1px);
}
.dao-modal-btn.confirm.danger {
    background: linear-gradient(135deg, #dc2626, #ef4444);
    box-shadow: 0 4px 12px rgba(220,38,38,0.3);
}
.dao-modal-btn.confirm.danger:hover {
    background: linear-gradient(135deg, #ef4444, #f87171);
    box-shadow: 0 6px 16px rgba(220,38,38,0.4);
}
.dao-modal-btn.confirm.warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
    box-shadow: 0 4px 12px rgba(217,119,6,0.3);
}
.dao-modal-btn.confirm.warning:hover {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .tier-border-rare, .tier-border-epic, .tier-border-legendary,
    .gathering-node-card .node-icon,
    .recipe-card .recipe-icon-large,
    .loot-fly-item, .craft-result-popup, .rare-drop-popup {
        animation: none !important;
    }
    .tier-border-legendary::after { animation: none !important; }
}

/* ============================================= */
/* RECIPE TIER BADGE                              */
/* ============================================= */
.recipe-tier-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 0.65em;
    font-weight: bold;
    letter-spacing: 1px;
    color: #111;
    vertical-align: middle;
    margin-left: 8px;
    text-shadow: 0 1px 0 rgba(255,255,255,0.3);
}

/* ============================================= */
/* RECIPE COST / SUCCESS DISPLAY                  */
/* ============================================= */
.recipe-costs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.85em;
    color: #ccc;
}
.recipe-costs span {
    background: rgba(255,255,255,0.06);
    padding: 2px 8px;
    border-radius: 6px;
}
.recipe-success-rate {
    margin-top: 6px;
    font-size: 0.85em;
    color: #81C784;
    font-weight: bold;
}
.recipe-success-rate.rate-high { color: #66BB6A; }
.recipe-success-rate.rate-medium { color: #FFA726; }
.recipe-success-rate.rate-low { color: #EF5350; }

/* ============================================= */
/* ENCHANTING SYSTEM                              */
/* ============================================= */
.enchant-level {
    font-weight: bold;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

/* Enchant glow tiers */
.enchant-glow-1 { color: #b0bec5; text-shadow: 0 0 4px rgba(176, 190, 197, 0.5); }
.enchant-glow-2 { color: #90caf9; text-shadow: 0 0 6px rgba(144, 202, 249, 0.5); }
.enchant-glow-3 { color: #80cbc4; text-shadow: 0 0 8px rgba(128, 203, 196, 0.6); }
.enchant-glow-4 { color: #4fc3f7; text-shadow: 0 0 10px rgba(79, 195, 247, 0.6); }
.enchant-glow-5 { color: #7c4dff; text-shadow: 0 0 12px rgba(124, 77, 255, 0.7); }
.enchant-glow-6 { color: #e040fb; text-shadow: 0 0 14px rgba(224, 64, 251, 0.7); }
.enchant-glow-7 { color: #ff6e40; text-shadow: 0 0 16px rgba(255, 110, 64, 0.7); }
.enchant-glow-8 { color: #ffd740; text-shadow: 0 0 18px rgba(255, 215, 64, 0.8); animation: enchant-shimmer 2s ease-in-out infinite; }
.enchant-glow-9 { color: #ff1744; text-shadow: 0 0 22px rgba(255, 23, 68, 0.9); animation: enchant-shimmer 1.5s ease-in-out infinite; }
.enchant-glow-10 { color: #ff9100; text-shadow: 0 0 30px rgba(255, 145, 0, 1), 0 0 60px rgba(255, 213, 79, 0.5); animation: enchant-shimmer 1s ease-in-out infinite, legendary-pulse 3s ease-in-out infinite; }

@keyframes enchant-shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.4); }
}

/* Enchant Slot Cards — Redesigned */
.enchant-slot-card {
    background: linear-gradient(145deg, rgba(30, 30, 55, 0.9), rgba(20, 20, 40, 0.95));
    border: 1px solid rgba(124, 77, 255, 0.2);
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}
.enchant-slot-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--cultivation-primary), transparent);
    opacity: 0.5;
}
.enchant-slot-card:hover {
    transform: translateY(-2px);
    background: linear-gradient(145deg, rgba(40, 40, 70, 0.95), rgba(30, 30, 55, 0.98));
    border-color: rgba(124, 77, 255, 0.4);
    box-shadow: 0 6px 20px rgba(124, 77, 255, 0.15);
}
.enchant-slot-icon {
    font-size: 2.5em;
    filter: drop-shadow(0 0 8px rgba(100, 180, 255, 0.4));
    flex-shrink: 0;
}
.enchant-slot-info {
    flex: 1;
    min-width: 0;
}
.enchant-slot-info strong {
    display: block;
    color: #e0e0e0;
    font-size: 1.05em;
    margin-bottom: 4px;
}
.enchant-slot-label {
    display: inline-block;
    background: rgba(100, 180, 255, 0.15);
    color: #90caf9;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 0.75em;
    margin-left: 6px;
    vertical-align: middle;
}
.enchant-slot-stats {
    font-size: 0.82em;
    color: #aaa;
    margin-top: 4px;
}

/* Enchant Actions */
.enchant-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
    min-width: 200px;
}
.btn-enchant {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    background: linear-gradient(135deg, #7c4dff, #651fff);
    color: #fff;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-enchant:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(124, 77, 255, 0.5);
    background: linear-gradient(135deg, #9c7cff, #7c4dff);
}
.btn-enchant.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: linear-gradient(135deg, #555, #444);
}
.btn-temper {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.9em;
    background: linear-gradient(135deg, #ff6d00, #e65100);
    color: #fff;
    transition: all 0.3s ease;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}
.btn-temper:hover:not(.disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255, 110, 0, 0.5);
    background: linear-gradient(135deg, #ff9100, #ff6d00);
}
.btn-temper.disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: linear-gradient(135deg, #555, #444);
}
.enchant-cost {
    font-size: 0.78em;
    color: #b0bec5;
    display: block;
    margin-top: 2px;
}
.enchant-risk {
    font-size: 0.75em;
    color: #ef9a9a;
    display: block;
    font-style: italic;
}
.enchant-max {
    display: inline-block;
    padding: 6px 14px;
    background: linear-gradient(135deg, #ffd54f, #ffb300);
    color: #333;
    border-radius: 8px;
    font-weight: bold;
    font-size: 0.85em;
    text-shadow: 0 1px 0 rgba(255,255,255,0.4);
}
.temper-max-info {
    font-size: 0.8em;
    color: #aaa;
    font-style: italic;
}

/* Enchanting Progress (tempering timer) */
.enchant-progress-card {
    background: rgba(255, 110, 0, 0.1);
    border: 2px solid #ff6d00;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    text-align: center;
    box-shadow: 0 5px 20px rgba(255, 110, 0, 0.2);
}
.enchant-progress-card h4 {
    margin: 0 0 12px 0;
    color: #ff9100;
    font-size: 1.1em;
}
.enchant-progress-card .progress-bar {
    height: 12px;
    background: rgba(0,0,0,0.3);
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
}
.enchant-progress-card .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #ff6d00, #ff9100, #ffc107);
    border-radius: 6px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 110, 0, 0.5);
}

/* Enchanting panel header */
#enchanting-panel h3 {
    color: #ce93d8;
    margin: 20px 0 12px 0;
    font-size: 1.2em;
    border-bottom: 1px solid rgba(206, 147, 216, 0.3);
    padding-bottom: 8px;
}
#enchanting-panel .enchant-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 30px;
}

/* ============================================= */
/* FORGING SECTION                                */
/* ============================================= */
#forging-section {
    padding: 10px 0;
}
#forging-section h3 {
    color: #ff8a65;
    margin: 0 0 12px 0;
    font-size: 1.1em;
}
#forging-recipes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cultivation-stats-compact {
        grid-template-columns: 1fr;
    }
    
    .cultivation-main-grid {
        grid-template-columns: 1fr;
    }
    
    .offline-items-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-cultivate-compact {
        height: 70px;
        font-size: 1em;
    }

    .enchant-slot-card {
        flex-direction: column;
        text-align: center;
    }
    .enchant-actions {
        min-width: unset;
        width: 100%;
    }
    #forging-recipes {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   OFFLINE GAINS MODAL — Redesigned
   ============================================= */
.offline-modal-card {
    background: linear-gradient(165deg, #1a1a2e 0%, #16213e 50%, #1a1a2e 100%);
    border: 1px solid rgba(168, 85, 247, 0.3);
    border-radius: 18px;
    padding: 0;
    max-width: 400px;
    width: 92%;
    color: #fff;
    box-shadow: 0 0 60px rgba(168, 85, 247, 0.15), 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: modalAppear 0.4s ease-out;
}

@keyframes modalAppear {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.offline-modal-header {
    position: relative;
    text-align: center;
    padding: 28px 24px 20px;
    background: linear-gradient(180deg, rgba(168, 85, 247, 0.15), transparent);
}
.offline-modal-header h2 {
    margin: 0 0 6px;
    font-size: 1.4em;
    color: #e0d0ff;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.offline-modal-glow {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 100px;
    background: radial-gradient(ellipse, rgba(168, 85, 247, 0.25), transparent 70%);
    pointer-events: none;
}
.offline-time-label {
    color: #9ca3af;
    font-size: 0.92em;
    margin: 0;
}
.offline-time-label strong {
    color: var(--cultivation-primary);
}

.offline-gains-grid {
    padding: 8px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.offline-gain-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    transition: all 0.2s ease;
}
.offline-gain-row.has-value {
    background: rgba(168, 85, 247, 0.06);
    border-color: rgba(168, 85, 247, 0.12);
}
.offline-gain-row.no-value {
    opacity: 0.5;
}
.offline-gain-left {
    display: flex;
    align-items: center;
    gap: 10px;
}
.offline-gain-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.3));
}
.offline-gain-name {
    color: #ccc;
    font-size: 0.92em;
}
.offline-gain-amount {
    font-weight: 700;
    font-size: 1.05em;
    color: #888;
    font-family: 'Segoe UI', monospace;
}
.offline-gain-amount.positive {
    color: var(--growth-primary);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

.offline-modal-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 6px 24px 24px;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--cultivation-primary), #7c3aed);
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.3px;
}
.offline-modal-btn:hover {
    background: linear-gradient(135deg, #b97aff, var(--cultivation-primary));
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.4);
    transform: translateY(-1px);
}

/* =============================================
   ENCHANTING UI — Enhanced Layout
   ============================================= */
.enchant-item-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.enchant-item-icon {
    flex-shrink: 0;
}
.enchant-item-icon img,
.enchant-item-icon .item-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(124, 77, 255, 0.3));
}
.enchant-level {
    font-weight: 800;
    margin-left: 4px;
}
.enchant-details {
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    margin-top: 4px;
}
.enchant-cost-line {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.88em;
    color: #b0bec5;
}
.enchant-cost-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.enchant-cost-item img {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}
.enchant-stat-preview {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(34, 197, 94, 0.08);
    border-left: 3px solid var(--growth-primary);
    border-radius: 0 6px 6px 0;
    font-size: 0.85em;
    color: #a0e0a0;
}
.enchant-pity {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding: 3px 8px;
    background: rgba(255, 204, 0, 0.1);
    border-radius: 6px;
    font-size: 0.82em;
    color: #ffcc00;
}
.enchant-risk {
    font-size: 0.8em;
    color: #ef9a9a;
    display: block;
    font-style: italic;
    margin-top: 4px;
}

/* =============================================
   FIRST-TIME TIP — Softer Banner Style
   ============================================= */
.tip-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}
.tip-card {
    background: linear-gradient(165deg, #1a1a2e, #16213e);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 14px;
    padding: 28px;
    max-width: 420px;
    width: 90%;
    color: #fff;
    text-align: center;
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.15);
    animation: modalAppear 0.35s ease-out;
}
.tip-card h3 {
    color: var(--cultivation-primary);
    margin: 0 0 14px;
    font-size: 1.2em;
    font-weight: 700;
}
.tip-card p {
    color: #bbb;
    line-height: 1.65;
    margin: 0 0 20px;
    white-space: pre-line;
    font-size: 0.95em;
}
.tip-card button {
    background: linear-gradient(135deg, var(--cultivation-primary), #7c3aed);
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95em;
    font-weight: 600;
    transition: all 0.3s ease;
}
.tip-card button:hover {
    background: linear-gradient(135deg, #b97aff, var(--cultivation-primary));
    box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Currency icon in inline text */
.currency-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin: 0 1px;
}

/* =============================================
   EQUIPPED ITEM — Enhanced Display
   ============================================= */
.equip-tier-tag {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.equip-description {
    font-size: 0.82em;
    color: #9CA3AF;
    margin: 2px 0 6px;
    font-style: italic;
    line-height: 1.4;
}
.equip-stats-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}
.equip-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    padding: 2px 0;
}
.equip-stat-name {
    color: #b0bec5;
}
.equip-stat-val {
    color: #66ff66;
    font-weight: 600;
    font-family: 'Segoe UI', monospace;
}
.equip-stat-bonus {
    color: #44dd66;
    font-size: 0.85em;
    font-weight: normal;
}

/* =============================================
   ENCHANTING GUIDE — Toggle Section
   ============================================= */
.enchant-guide-toggle {
    margin-bottom: 12px;
}
.btn-guide-toggle {
    background: rgba(168, 85, 247, 0.12);
    color: var(--cultivation-primary);
    border: 1px solid rgba(168, 85, 247, 0.3);
    padding: 8px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: all 0.3s ease;
}
.btn-guide-toggle:hover {
    background: rgba(168, 85, 247, 0.22);
    border-color: var(--cultivation-primary);
}
.enchant-guide {
    background: linear-gradient(165deg, rgba(30, 30, 55, 0.9), rgba(20, 20, 40, 0.95));
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 18px;
    animation: fadeIn 0.3s ease;
}
.enchant-guide.hidden {
    display: none;
}
.guide-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}
.guide-col {
    padding: 14px;
    border-radius: 10px;
}
.guide-col-enchant {
    background: rgba(124, 77, 255, 0.08);
    border: 1px solid rgba(124, 77, 255, 0.2);
}
.guide-col-temper {
    background: rgba(255, 109, 0, 0.08);
    border: 1px solid rgba(255, 109, 0, 0.2);
}
.guide-col h4 {
    margin: 0 0 10px;
    font-size: 1.05em;
}
.guide-col-enchant h4 { color: #b388ff; }
.guide-col-temper h4 { color: #ffab40; }
.guide-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.guide-col li {
    font-size: 0.88em;
    color: #bbb;
    padding: 3px 0;
    line-height: 1.5;
}
.guide-col li strong {
    color: #ddd;
}
.guide-note {
    text-align: center;
    font-size: 0.85em;
    color: #888;
    padding-top: 8px;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* =============================================
   ENCHANTING — Stat Comparison Table
   ============================================= */
.enchant-stats-table-wrap {
    margin: 10px 0;
    overflow-x: auto;
}
.enchant-stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}
.enchant-stats-table thead th {
    text-align: left;
    padding: 6px 10px;
    font-weight: 600;
    color: #aaa;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    font-size: 0.9em;
    white-space: nowrap;
}
.enchant-stats-table tbody td {
    padding: 5px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.stat-label {
    color: #b0bec5;
    white-space: nowrap;
}
.stat-base {
    color: #888;
    font-family: 'Segoe UI', monospace;
}
.stat-current {
    color: #66ff66;
    font-weight: 600;
    font-family: 'Segoe UI', monospace;
}
.stat-next {
    color: #90caf9;
    font-weight: 600;
    font-family: 'Segoe UI', monospace;
}
.stat-diff-plus {
    color: #44dd66;
    font-size: 0.85em;
    font-weight: bold;
}
.stat-mult {
    font-size: 0.8em;
    color: #888;
    font-weight: normal;
}
.stat-max {
    color: #ffd740;
}

/* =============================================
   ENCHANTING — Path Cards (Enchant vs Temper)
   ============================================= */
.enchant-paths {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 10px;
}
.enchant-path-section {
    border-radius: 10px;
    padding: 14px;
}
.enchant-path-enchant {
    background: rgba(124, 77, 255, 0.06);
    border: 1px solid rgba(124, 77, 255, 0.18);
}
.enchant-path-temper {
    background: rgba(255, 109, 0, 0.06);
    border: 1px solid rgba(255, 109, 0, 0.18);
}
.enchant-path-max {
    grid-column: 1 / -1;
    text-align: center;
    padding: 16px;
    background: rgba(255, 215, 64, 0.06);
    border: 1px solid rgba(255, 215, 64, 0.2);
}
.enchant-path-temper-done {
    background: rgba(255, 109, 0, 0.04);
    border: 1px solid rgba(255, 109, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}
.path-header {
    font-weight: 700;
    font-size: 1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.enchant-path-enchant .path-header { color: #b388ff; }
.enchant-path-temper .path-header { color: #ffab40; }
.path-safe-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.2);
    color: #22C55E;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.path-details {
    margin-bottom: 10px;
}
.path-cost-row {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.path-cost {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.88em;
    color: #ccc;
}
.enchant-res-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}
.path-rate-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.path-rate-label {
    font-size: 0.82em;
    color: #999;
    flex-shrink: 0;
}
.path-rate-bar-bg {
    flex: 1;
    height: 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}
.path-rate-bar-fill {
    height: 100%;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    min-width: 30px;
}
.path-rate-bar-fill span {
    font-size: 0.75em;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.path-risk {
    font-size: 0.82em;
    color: #ef9a9a;
    font-style: italic;
    margin-bottom: 2px;
}
.path-pity {
    font-size: 0.82em;
    color: #ffcc00;
    background: rgba(255, 204, 0, 0.08);
    padding: 3px 8px;
    border-radius: 5px;
    margin-top: 4px;
    display: inline-block;
}
.path-pity.pity-ready {
    background: rgba(34, 197, 94, 0.12);
    color: #22C55E;
    font-weight: 700;
    animation: enchant-shimmer 1.5s ease-in-out infinite;
}
.path-requirement {
    font-size: 0.82em;
    color: #F97316;
    margin-top: 4px;
}

/* Enchant/Temper buttons inside path cards */
.enchant-path-section .btn-enchant,
.enchant-path-section .btn-temper {
    width: 100%;
    margin-top: 6px;
}

/* Empty state */
.enchant-empty-state {
    text-align: center;
    padding: 30px 20px;
    color: #888;
}
.enchant-empty-hint {
    font-size: 0.88em;
    color: #666;
    margin-top: 6px;
}

/* Enchant item info */
.enchant-item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.enchant-item-desc {
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

/* =============================================
   RESPONSIVE — Enchanting
   ============================================= */
@media (max-width: 768px) {
    .guide-columns {
        grid-template-columns: 1fr;
    }
    .enchant-paths {
        grid-template-columns: 1fr;
    }
    .enchant-slot-card {
        flex-direction: column;
    }
    .enchant-stats-table {
        font-size: 0.8em;
    }
    .enchant-stat-row {
        flex-direction: column;
        gap: 2px;
    }
    .enchant-roadmap .roadmap-nodes {
        font-size: 0.7em;
    }
}

/* =============================================
   ENCHANTING — Stats Contribution Block (v2)
   ============================================= */
.enchant-stats-block {
    margin: 10px 0;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.enchant-stats-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 6px;
}
.enchant-stats-title {
    font-weight: 700;
    font-size: 0.9em;
    color: #ddd;
}
.enchant-active-badge {
    font-size: 0.78em;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: 600;
}
.enchant-active-badge.base {
    background: rgba(34, 197, 94, 0.12);
    color: #66BB6A;
    border: 1px solid rgba(34, 197, 94, 0.25);
}
.enchant-active-badge.boost {
    background: rgba(124, 77, 255, 0.15);
    color: #b388ff;
    border: 1px solid rgba(124, 77, 255, 0.3);
    animation: enchant-shimmer 2s ease-in-out infinite;
}
.enchant-stat-rows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.enchant-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
    gap: 8px;
    flex-wrap: wrap;
}
.enchant-stat-row:hover {
    background: rgba(255, 255, 255, 0.05);
}
.enchant-stat-name {
    color: #b0bec5;
    font-size: 0.88em;
    min-width: 80px;
}
.enchant-stat-contribution {
    color: #66ff66;
    font-size: 0.88em;
    font-weight: 600;
    flex: 1;
}
.enchant-bonus-tag {
    font-size: 0.8em;
    color: #b388ff;
    background: rgba(124, 77, 255, 0.12);
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}
.enchant-stat-after {
    font-size: 0.85em;
    color: #90caf9;
    text-align: right;
    min-width: 100px;
}
.stat-next-val {
    font-weight: 600;
}
.stat-pct {
    font-size: 0.85em;
    color: #888;
    font-weight: normal;
}
.stat-diff-plus {
    color: #44dd66;
    font-size: 0.85em;
    font-weight: bold;
    margin-left: 2px;
}
.stat-max-badge {
    display: inline-block;
    background: rgba(255, 215, 64, 0.15);
    color: #ffd740;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85em;
}
.enchant-stats-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.82em;
    color: #888;
    text-align: center;
}
.enchant-stats-footer strong {
    color: #90caf9;
}

/* =============================================
   ENCHANTING — Progress Roadmap (+0 → +10)
   ============================================= */
.enchant-roadmap {
    margin: 12px 0;
    padding: 14px;
    background: rgba(0, 0, 0, 0.18);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}
.roadmap-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.roadmap-fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E, #A855F7, #F43F5E);
    border-radius: 3px;
    transition: width 0.5s ease;
}
.roadmap-nodes {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}
.roadmap-node {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
    font-weight: 700;
    cursor: default;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}
/* Zone colors for undone nodes */
.roadmap-node.zone-safe {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}
.roadmap-node.zone-risk {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border-color: rgba(251, 191, 36, 0.2);
}
.roadmap-node.zone-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.2);
}
/* Completed nodes */
.roadmap-node.done {
    background: linear-gradient(135deg, #22C55E, #16a34a);
    color: #fff;
    border-color: #22C55E;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}
/* Current target node */
.roadmap-node.current {
    border-color: #A855F7;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
    animation: roadmap-pulse 1.5s ease-in-out infinite;
    transform: scale(1.15);
}
@keyframes roadmap-pulse {
    0%, 100% { box-shadow: 0 0 8px rgba(168, 85, 247, 0.4); }
    50% { box-shadow: 0 0 18px rgba(168, 85, 247, 0.7); }
}
.roadmap-zones {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.zone-label {
    font-size: 0.7em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    flex: 1;
    text-align: center;
}
.zone-label.zone-safe {
    background: rgba(34, 197, 94, 0.08);
    color: #4ade80;
}
.zone-label.zone-risk {
    background: rgba(251, 191, 36, 0.08);
    color: #fbbf24;
}
.zone-label.zone-danger {
    background: rgba(239, 68, 68, 0.08);
    color: #f87171;
}

/* =============================================
   ENCHANTING — Meditation Requirement Badge
   ============================================= */
.path-req {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 6px;
}
.path-req .req-icon {
    font-size: 1.1em;
}
.path-req-met {
    background: rgba(34, 197, 94, 0.1);
    color: #66BB6A;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.path-req-met .req-check {
    color: #22C55E;
    font-weight: 700;
    font-size: 1.1em;
}
.path-req-missing {
    background: rgba(239, 68, 68, 0.1);
    color: #ef9a9a;
    border: 1px solid rgba(239, 68, 68, 0.2);
}
.path-req-missing .req-current {
    color: #EF5350;
    font-weight: 700;
}

/* =============================================
   ENCHANTING — Stronger Visual Differentiation
   ============================================= */
/* Enchant path — Electric Blue/Purple theme */
.enchant-path-enchant {
    background: linear-gradient(165deg, rgba(66, 50, 130, 0.15), rgba(30, 20, 70, 0.2));
    border: 1px solid rgba(124, 77, 255, 0.25);
    position: relative;
    overflow: hidden;
}
.enchant-path-enchant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #7c4dff, #b388ff, #7c4dff);
    opacity: 0.7;
}
.enchant-path-enchant .path-header {
    color: #b388ff;
    font-size: 1.05em;
}
.enchant-path-enchant .btn-enchant {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.3), rgba(124, 77, 255, 0.15));
    border: 1px solid rgba(124, 77, 255, 0.4);
    color: #d4b5ff;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 8px;
}
.enchant-path-enchant .btn-enchant:hover:not(.disabled) {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.5), rgba(124, 77, 255, 0.3));
    box-shadow: 0 0 20px rgba(124, 77, 255, 0.3);
    transform: translateY(-1px);
}
.enchant-path-enchant .btn-enchant.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Temper path — Warm Forge/Fire theme */
.enchant-path-temper {
    background: linear-gradient(165deg, rgba(130, 70, 20, 0.12), rgba(70, 30, 10, 0.15));
    border: 1px solid rgba(255, 152, 0, 0.2);
    position: relative;
    overflow: hidden;
}
.enchant-path-temper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff6d00, #ffab40, #ff6d00);
    opacity: 0.7;
}
.enchant-path-temper .path-header {
    color: #ffab40;
    font-size: 1.05em;
}
.enchant-path-temper .btn-temper {
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.25), rgba(255, 109, 0, 0.1));
    border: 1px solid rgba(255, 152, 0, 0.4);
    color: #ffcc80;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 8px;
}
.enchant-path-temper .btn-temper:hover:not(.disabled) {
    background: linear-gradient(135deg, rgba(255, 109, 0, 0.4), rgba(255, 109, 0, 0.2));
    box-shadow: 0 0 20px rgba(255, 109, 0, 0.3);
    transform: translateY(-1px);
}
.enchant-path-temper .btn-temper.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.5);
}

/* Safe badge — larger, more prominent */
.path-safe-badge {
    display: inline-block;
    background: rgba(34, 197, 94, 0.25);
    color: #22C55E;
    font-size: 0.75em;
    padding: 3px 10px;
    border-radius: 5px;
    font-weight: 800;
    letter-spacing: 0.8px;
    border: 1px solid rgba(34, 197, 94, 0.35);
    text-shadow: 0 0 8px rgba(34, 197, 94, 0.3);
}

/* =============================================
   ENCHANTING — Guide Tabs (Quick Start / Table / FAQ)
   ============================================= */
.guide-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0;
}
.guide-tab {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #888;
    padding: 8px 16px;
    cursor: pointer;
    font-size: 0.88em;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
}
.guide-tab:hover {
    color: #bbb;
    border-bottom-color: rgba(168, 85, 247, 0.3);
}
.guide-tab.active {
    color: var(--cultivation-primary);
    border-bottom-color: var(--cultivation-primary);
}
.guide-tab-content {
    animation: fadeIn 0.3s ease;
}
.guide-tab-content.hidden {
    display: none;
}
.guide-summary {
    margin-bottom: 14px;
    color: #bbb;
    font-size: 0.92em;
    line-height: 1.6;
}
.guide-col-tagline {
    font-size: 0.82em;
    color: #888;
    font-style: italic;
    margin-bottom: 8px;
}

/* Full enchant table */
.guide-full-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82em;
}
.guide-full-table thead th {
    text-align: left;
    padding: 6px 8px;
    color: #aaa;
    font-weight: 600;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9em;
    white-space: nowrap;
}
.guide-full-table tbody td {
    padding: 5px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    color: #ccc;
}
.guide-full-table tr.zone-safe td:first-child { color: #4ade80; }
.guide-full-table tr.zone-risk td:first-child { color: #fbbf24; }
.guide-full-table tr.zone-danger td:first-child { color: #f87171; }
.guide-full-table tr.zone-safe { background: rgba(34, 197, 94, 0.03); }
.guide-full-table tr.zone-risk { background: rgba(251, 191, 36, 0.03); }
.guide-full-table tr.zone-danger { background: rgba(239, 68, 68, 0.03); }

/* FAQ */
.guide-faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-item {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    border-left: 3px solid var(--cultivation-primary);
}
.faq-item strong {
    color: #ddd;
    font-size: 0.92em;
    display: block;
    margin-bottom: 4px;
}
.faq-item p {
    color: #aaa;
    font-size: 0.88em;
    line-height: 1.55;
    margin: 0;
}

/* =============================================
   EQUIPPED ITEM — Active Indicator
   ============================================= */
.equip-active-indicator {
    display: inline-block;
    font-size: 0.78em;
    padding: 2px 8px;
    border-radius: 4px;
    margin: 2px 0 4px;
    font-weight: 600;
    background: rgba(34, 197, 94, 0.1);
    color: #66BB6A;
    border: 1px solid rgba(34, 197, 94, 0.2);
}
.equip-active-indicator.boosted {
    background: rgba(124, 77, 255, 0.12);
    color: #b388ff;
    border-color: rgba(124, 77, 255, 0.25);
}

/* =============================================
   GAME TOOLTIP SYSTEM
   ============================================= */
.game-tooltip {
    position: fixed;
    z-index: 10000;
    max-width: 320px;
    min-width: 200px;
    padding: 0;
    background: linear-gradient(165deg, #1a1a2e, #0f0f1e);
    border: 1px solid rgba(168, 85, 247, 0.35);
    border-radius: 10px;
    color: #eee;
    font-size: 0.88em;
    line-height: 1.5;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.7), 0 0 15px rgba(168, 85, 247, 0.15);
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.game-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
.tt-equip, .tt-stat, .tt-resource {
    padding: 12px 14px;
}
.tt-header {
    font-weight: 700;
    font-size: 1.05em;
    margin-bottom: 4px;
}
.tt-tier {
    font-size: 0.78em;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 2px;
}
.tt-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 6px 0;
}
.tt-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0;
    font-size: 0.9em;
    color: #bbb;
}
.tt-stat-row .tt-stat-val {
    color: #66ff66;
    font-weight: 600;
    font-family: 'Segoe UI', monospace;
}
.tt-stat-row.tt-equip-src {
    padding-left: 8px;
    font-size: 0.85em;
    color: #999;
}
.tt-stat-row.tt-equip-src .tt-stat-val {
    color: #90caf9;
}
.tt-stat-row.tt-total {
    font-weight: 700;
    color: #ddd;
}
.tt-stat-row.tt-total .tt-stat-val {
    color: #fff;
    font-size: 1.05em;
}
.tt-enchant-info {
    font-size: 0.82em;
    color: #b388ff;
    margin-top: 4px;
}
.tt-desc {
    font-size: 0.85em;
    color: #999;
    font-style: italic;
    line-height: 1.5;
}
.tt-hint {
    font-size: 0.78em;
    color: #666;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════════════════
   PHASE 3: Cultivation Tab Revamp
   ═══════════════════════════════════════════════════════════ */

/* ── Realm Journey Card ── */
.realm-journey-card {
    background: linear-gradient(135deg, rgba(139,92,246,0.10) 0%, rgba(59,130,246,0.08) 100%);
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    transition: all 0.5s ease;
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.05);
}
.realm-journey-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(139,92,246,0.03) 0%, transparent 70%);
    animation: realmAmbient 8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes realmAmbient {
    0%, 100% { transform: translate(0, 0); opacity: 0.5; }
    50% { transform: translate(20px, -10px); opacity: 1; }
}

.realm-journey-card.realm-card-near {
    background: linear-gradient(135deg, rgba(234,179,8,0.08) 0%, rgba(139,92,246,0.10) 100%);
    border-color: rgba(234,179,8,0.35);
    box-shadow: 0 0 20px rgba(234,179,8,0.1), 0 4px 24px rgba(0,0,0,0.3);
}
.realm-journey-card.realm-card-ready {
    background: linear-gradient(135deg, rgba(234,179,8,0.12) 0%, rgba(245,158,11,0.08) 100%);
    border-color: rgba(234,179,8,0.6);
    box-shadow: 0 0 30px rgba(234,179,8,0.15), 0 4px 24px rgba(0,0,0,0.3);
    animation: realmReadyPulse 2s ease-in-out infinite;
}
@keyframes realmReadyPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(234,179,8,0.1); }
    50% { box-shadow: 0 0 40px rgba(234,179,8,0.25); }
}

.realm-journey-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}
.realm-journey-title {
    display: flex;
    gap: 12px;
    align-items: center;
}
.realm-journey-icon {
    font-size: 2em;
    filter: drop-shadow(0 0 8px rgba(139,92,246,0.4));
}
.realm-name-display {
    font-size: 1.3em;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}
.realm-flavour {
    font-size: 0.82em;
    color: var(--secondary-text);
    font-style: italic;
    margin: 4px 0 0;
    line-height: 1.4;
}

.bt-ready-badge {
    background: linear-gradient(135deg, #eab308, #f59e0b);
    color: #1a1a2e;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75em;
    font-weight: 700;
    animation: btBadgePulse 1.5s ease-in-out infinite;
    white-space: nowrap;
}
@keyframes btBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
.bt-near-badge {
    background: rgba(234,179,8,0.15);
    color: #eab308;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
    border: 1px solid rgba(234,179,8,0.3);
}

/* Realm Progress */
.realm-progress-section {
    margin-bottom: 14px;
}
.realm-progress-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.78em;
    color: var(--secondary-text);
    margin-bottom: 6px;
}
.realm-progress-bar {
    height: 10px;
    background: rgba(255,255,255,0.06);
    border-radius: 5px;
    overflow: visible;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
}
.realm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tab-accent, #8b5cf6), #a78bfa);
    border-radius: 5px;
    transition: width 0.5s ease;
    position: relative;
}
.realm-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
    border-radius: 0 5px 5px 0;
}

/* Realm Stats Row */
.realm-stats-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.realm-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 55px;
    padding: 6px 4px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.05);
}
.realm-stat-label {
    font-size: 0.65em;
    color: var(--secondary-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.realm-stat-value {
    font-size: 0.95em;
    font-weight: 700;
    color: var(--text-color);
}

/* Next Realm Preview */
.realm-next-preview {
    text-align: center;
    font-size: 0.8em;
    color: var(--secondary-text);
    padding: 8px;
    background: rgba(255,255,255,0.02);
    border-radius: 8px;
    border: 1px dashed rgba(255,255,255,0.08);
}
.realm-next-preview.realm-max {
    border-color: rgba(234,179,8,0.2);
    color: #eab308;
}

/* ── Dao Path Info Card (Cultivation Tab) ── */
.dao-path-info-card {
    background: rgba(var(--dpc-rgb, 139, 92, 246), 0.04);
    border: 1px solid rgba(var(--dpc-rgb, 139, 92, 246), 0.15);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 0;
}
.dao-info-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.dao-info-icon { font-size: 1.6rem; line-height: 1; }
.dao-info-titles { display: flex; flex-direction: column; gap: 1px; }
.dao-info-name {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1rem;
    font-weight: 700;
    color: var(--dpc, #C084FC);
}
.dao-info-title {
    font-size: 0.7rem;
    color: rgba(161, 161, 170, 0.6);
    font-style: italic;
    letter-spacing: 1px;
}
.dao-info-bonuses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    margin-bottom: 8px;
}
.dao-info-bonus {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.025);
    border-radius: 8px;
    font-size: 0.72rem;
}
.dao-bonus-icon { font-size: 0.85rem; }
.dao-bonus-label { color: rgba(161, 161, 170, 0.65); }
.dao-bonus-val {
    margin-left: auto;
    color: var(--dpc, #C084FC);
    font-weight: 600;
}
.dao-info-philosophy {
    text-align: center;
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.7rem;
    color: rgba(var(--dpc-rgb, 139, 92, 246), 0.5);
    font-style: italic;
    margin: 0;
    letter-spacing: 0.5px;
}

/* ── Cultivate Circle Button ── */
.cultivate-circle-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin: 12px 0;
}
.btn-cultivate-circle {
    position: relative;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 3px solid var(--tab-accent, #8b5cf6);
    background: radial-gradient(circle, rgba(139,92,246,0.15) 0%, rgba(139,92,246,0.04) 70%);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    overflow: hidden;
    padding: 0;
}
.btn-cultivate-circle:hover:not(:disabled) {
    border-color: #a78bfa;
    box-shadow: 0 0 25px rgba(139,92,246,0.3);
    transform: scale(1.03);
}
.btn-cultivate-circle:active:not(:disabled) {
    transform: scale(0.97);
}
.btn-cultivate-circle:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.btn-cultivate-circle.cooldown {
    border-color: rgba(255,255,255,0.15);
}
.btn-cultivate-circle.cooldown .cultivate-icon {
    animation: none;
}

.cultivate-circle-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 1;
}
.cultivate-circle-inner .cultivate-icon {
    font-size: 2em;
}
.cultivate-circle-inner .cultivate-main {
    font-size: 0.85em;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: 1px;
}
.cultivate-circle-inner .cultivate-cost {
    font-size: 0.65em;
    color: var(--secondary-text);
}

/* Cooldown Ring overlay */
.cultivate-cooldown-ring {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

/* Ripple effect */
.cultivate-ripple-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    width: 150px;
    height: 150px;
}
.cultivate-ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2px solid var(--tab-accent, #8b5cf6);
    animation: cultivateRipple 0.8s ease-out forwards;
}
@keyframes cultivateRipple {
    0% { width: 10px; height: 10px; opacity: 1; }
    100% { width: 160px; height: 160px; opacity: 0; }
}

/* Auto-Cult pulsing glow on circle when auto is active */
.auto-cult-active ~ .cultivation-column .btn-cultivate-circle,
body[data-auto-cult="active"] .btn-cultivate-circle {
    /* reserved for auto-synergy effects */
    outline: none;
}

/* ── Auto-Cultivation Card ── */
.auto-cult-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 16px;
    transition: all 0.3s ease;
}
.auto-cult-card.auto-cult-active {
    border-color: rgba(46,204,113,0.3);
    background: rgba(46,204,113,0.05);
    box-shadow: 0 0 15px rgba(46,204,113,0.08);
}
.auto-cult-card.auto-cult-warning {
    border-color: rgba(230,126,34,0.3);
    background: rgba(230,126,34,0.05);
}
.auto-cult-card.auto-cult-inactive {
    border-color: rgba(255,255,255,0.06);
}

.auto-cult-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.auto-cult-status-badge {
    font-size: 0.75em;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
}
.auto-cult-status-badge.auto-cult-active {
    color: #2ecc71;
    background: rgba(46,204,113,0.12);
}
.auto-cult-status-badge.auto-cult-warning {
    color: #e67e22;
    background: rgba(230,126,34,0.12);
}
.auto-cult-status-badge.auto-cult-inactive {
    color: var(--secondary-text);
    background: rgba(255,255,255,0.05);
}

.auto-cult-stats {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.auto-cult-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.82em;
    color: var(--secondary-text);
}
.auto-cult-stat-row .highlight {
    color: var(--text-color);
    font-weight: 600;
}

.auto-cult-qi-bar {
    height: 22px;
    background: rgba(255,255,255,0.06);
    border-radius: 11px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 10px;
}
.auto-cult-qi-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
    border-radius: 11px;
    transition: width 0.5s ease;
}
.auto-cult-qi-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.72em;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.auto-cult-session {
    font-size: 0.82em;
    color: var(--secondary-text);
    text-align: center;
    margin-bottom: 6px;
}
.auto-cult-warning {
    font-size: 0.72em;
    color: #e67e22;
    text-align: center;
    opacity: 0.7;
}

/* ── Breakthrough Section Revamp ── */
.bt-golden-ready {
    background: linear-gradient(135deg, rgba(234,179,8,0.08) 0%, rgba(245,158,11,0.05) 100%) !important;
    border: 1px solid rgba(234,179,8,0.3) !important;
    animation: btGoldenPulse 3s ease-in-out infinite;
}
@keyframes btGoldenPulse {
    0%, 100% { box-shadow: 0 0 10px rgba(234,179,8,0.05); }
    50% { box-shadow: 0 0 25px rgba(234,179,8,0.15); }
}
.bt-ready-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}
.bt-ready-header h3 {
    margin: 0;
    color: #eab308;
    font-size: 1.1em;
}
.bt-lightning {
    font-size: 1.3em;
    animation: btLightningFlash 2s ease-in-out infinite;
}
@keyframes btLightningFlash {
    0%, 70%, 100% { opacity: 1; }
    75% { opacity: 0.3; }
    80% { opacity: 1; }
    85% { opacity: 0.3; }
}

.realm-comparison {
    display: flex;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
}
.realm-box {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
}
.realm-box.current {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.realm-box.next {
    background: rgba(234,179,8,0.06);
    border: 1px solid rgba(234,179,8,0.2);
}
.realm-box-label {
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-text);
}
.realm-box .realm-name {
    font-size: 1em;
    font-weight: 700;
    margin: 4px 0;
    color: var(--text-color);
}
.realm-box .realm-desc {
    font-size: 0.75em;
    color: var(--secondary-text);
    font-style: italic;
}
.realm-box .realm-cap {
    font-size: 0.75em;
    color: var(--secondary-text);
    margin-top: 4px;
}
.realm-comparison .arrow {
    display: flex;
    align-items: center;
    font-size: 1.5em;
    color: #eab308;
}

.breakthrough-cost {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.bt-cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
}
.bt-cost-row.bt-have {
    color: #2ecc71;
}
.bt-cost-row.bt-need {
    color: #e74c3c;
}
.bt-cost-row.bt-info {
    color: var(--secondary-text);
}

.btn-breakthrough {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-bt-ready {
    background: linear-gradient(135deg, #eab308, #f59e0b);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(234,179,8,0.3);
}
.btn-bt-ready:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(234,179,8,0.4);
}
.btn-bt-locked {
    background: rgba(255,255,255,0.06);
    color: var(--secondary-text);
    cursor: not-allowed;
}

.breakthrough-maxed {
    text-align: center;
    padding: 20px;
    background: rgba(234,179,8,0.06);
    border: 1px solid rgba(234,179,8,0.15);
    border-radius: 14px;
}
.breakthrough-maxed h3 {
    color: #eab308;
    margin: 0 0 8px;
}
.bt-max-desc {
    color: var(--secondary-text);
    font-size: 0.85em;
}

.breakthrough-locked {
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    text-align: center;
    transition: all 0.5s ease;
}
.breakthrough-locked.bt-almost-there {
    border-color: rgba(234,179,8,0.25);
    background: rgba(234,179,8,0.04);
}
.breakthrough-locked h3 {
    margin: 0 0 8px;
    color: var(--secondary-text);
}
.breakthrough-locked.bt-almost-there h3 {
    color: #eab308;
}
.breakthrough-locked p {
    font-size: 0.85em;
    color: var(--secondary-text);
    margin: 4px 0;
}

.bt-countdown-bar {
    height: 8px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    margin-top: 12px;
}
.bt-countdown-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--tab-accent, #8b5cf6), #a78bfa);
    border-radius: 4px;
    transition: width 0.5s ease;
}
.bt-countdown-fill.bt-countdown-near {
    background: linear-gradient(90deg, #eab308, #f59e0b);
}
.bt-countdown-text {
    position: absolute;
    top: -18px;
    right: 0;
    font-size: 0.7em;
    color: var(--secondary-text);
}

/* ── Breakthrough Modal ── */
.bt-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.bt-modal-overlay.bt-modal-visible {
    opacity: 1;
}
.bt-modal {
    background: linear-gradient(135deg, #1e1e3a 0%, #1a1a2e 100%);
    border: 2px solid rgba(234,179,8,0.4);
    border-radius: 20px;
    max-width: 440px;
    width: 90%;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 0 60px rgba(234,179,8,0.15);
}
.bt-modal-visible .bt-modal {
    transform: scale(1);
}

.bt-modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(234,179,8,0.12) 0%, rgba(245,158,11,0.06) 100%);
    border-bottom: 1px solid rgba(234,179,8,0.2);
}
.bt-modal-header h2 {
    margin: 0;
    color: #eab308;
    font-size: 1.2em;
}
.bt-modal-icon {
    font-size: 1.5em;
}

.bt-modal-body {
    padding: 20px;
}
.bt-modal-realms {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}
.bt-modal-realm {
    text-align: center;
    padding: 12px 16px;
    border-radius: 12px;
    flex: 1;
}
.bt-modal-realm.bt-from {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.bt-modal-realm.bt-to {
    background: rgba(234,179,8,0.08);
    border: 1px solid rgba(234,179,8,0.25);
}
.bt-realm-label {
    font-size: 0.6em;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--secondary-text);
    display: block;
}
.bt-realm-name {
    font-size: 1em;
    font-weight: 700;
    color: var(--text-color);
    display: block;
    margin-top: 4px;
}
.bt-modal-arrow {
    font-size: 1.5em;
    color: #eab308;
}

.bt-modal-costs {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}
.bt-modal-cost-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85em;
    padding: 6px 10px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    color: var(--text-color);
}
.bt-modal-info {
    margin-bottom: 12px;
}
.bt-modal-success {
    font-size: 0.85em;
    color: #2ecc71;
    margin-bottom: 6px;
}
.bt-modal-warning {
    font-size: 0.8em;
    color: #e74c3c;
    opacity: 0.9;
}
.bt-modal-reward {
    text-align: center;
    font-size: 0.8em;
    color: #a78bfa;
    padding: 8px;
    background: rgba(139,92,246,0.06);
    border-radius: 8px;
    border: 1px solid rgba(139,92,246,0.15);
}

/* ===========================
   MUSIC MINI PLAYER
   =========================== */

.music-mini-player {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 9999;
    background: rgba(15, 14, 23, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 10px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-body);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    transition: opacity 0.3s;
}

.music-mini-player:hover {
    border-color: rgba(192, 132, 252, 0.4);
}

.mmp-track-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    max-width: 160px;
}

.mmp-icon {
    color: var(--cultivation-primary);
    font-size: 1em;
    animation: mmpPulse 2s infinite ease-in-out;
}

@keyframes mmpPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.mmp-track-name {
    color: var(--text-light);
    font-size: 0.78em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mmp-controls {
    display: flex;
    align-items: center;
    gap: 4px;
}

.mmp-btn {
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 0.85em;
    cursor: pointer;
    padding: 3px 5px;
    border-radius: 4px;
    transition: all 0.2s;
    line-height: 1;
}

.mmp-btn:hover {
    color: var(--text-light);
    background: rgba(255, 255, 255, 0.08);
}

.mmp-play {
    font-size: 1em;
    color: var(--cultivation-primary);
}

.mmp-shuffle.active {
    color: var(--energy-accent);
}

.mmp-volume {
    width: 60px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.mmp-volume::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cultivation-primary);
    cursor: pointer;
}

.mmp-volume::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--cultivation-primary);
    border: none;
    cursor: pointer;
}

/* ===========================
   AMBIENT ANIMATIONS
   =========================== */

/* Qi Particles - floating spiritual energy */
.qi-particle {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
}

@keyframes qiFloat {
    0% {
        transform: translateY(0) translateX(0) scale(0);
        opacity: 0;
    }
    15% {
        opacity: var(--qi-opacity, 0.4);
        transform: translateY(-10vh) translateX(5px) scale(0.8);
    }
    85% {
        opacity: var(--qi-opacity, 0.2);
    }
    100% {
        transform: translateY(-100vh) translateX(-10px) scale(1.2);
        opacity: 0;
    }
}

/* Realm Aura - bottom glow that changes with realm */
.realm-aura {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    pointer-events: none;
    z-index: 0;
    background: radial-gradient(ellipse at 50% 100%, 
        var(--realm-aura-color, rgba(192, 132, 252, 0.08)) 0%, 
        transparent 70%);
    animation: realmBreathe 6s infinite ease-in-out;
}

@keyframes realmBreathe {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 0.8; }
}

/* Panel breathing - subtle border glow */
.game-container,
.game-sidebar {
    animation: panelBreathe 8s infinite ease-in-out;
}

@keyframes panelBreathe {
    0%, 100% { border-color: rgba(192, 132, 252, 0.15); }
    50% { border-color: rgba(192, 132, 252, 0.3); }
}

/* Star twinkle effect */
.star-twinkle {
    position: fixed;
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    animation: twinkle var(--twinkle-duration, 3s) infinite ease-in-out;
    animation-delay: var(--twinkle-delay, 0s);
}

@keyframes twinkle {
    0%, 100% { opacity: 0; transform: scale(0.5); }
    50% { opacity: var(--twinkle-max, 0.6); transform: scale(1); }
}

/* No-animation mode support */
.no-animations .qi-particle,
.no-animations .realm-aura,
.no-animations .star-twinkle,
.no-animations .music-mini-player .mmp-icon {
    animation: none !important;
}

.no-animations .game-container,
.no-animations .game-sidebar {
    animation: none !important;
}

.bt-modal-actions {
    display: flex;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.bt-modal-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
}
.bt-modal-cancel {
    background: rgba(255,255,255,0.06);
    color: var(--secondary-text);
}
.bt-modal-cancel:hover {
    background: rgba(255,255,255,0.1);
}
.bt-modal-confirm {
    background: linear-gradient(135deg, #eab308, #f59e0b);
    color: #1a1a2e;
    box-shadow: 0 4px 15px rgba(234,179,8,0.3);
}
.bt-modal-confirm:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(234,179,8,0.4);
}

/* ══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ══════════════════════════════════════════════════════════ */

.login-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hide event log when login is visible */
body:has(.login-screen[style*="flex"]) #event-log {
    display: none !important;
}

.login-screen.login-fade-out {
    animation: loginFadeOut 0.5s ease forwards;
}

@keyframes loginFadeOut {
    to { opacity: 0; transform: scale(1.02); }
}

.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 20px;
    max-width: 420px;
    width: 100%;
    margin: auto;
}

/* Header */
.login-header {
    text-align: center;
    margin-bottom: 4px;
}

/* Logo — large, floating, glowing */
.login-logo {
    width: 180px;
    height: 180px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 30px rgba(192, 132, 252, 0.5))
            drop-shadow(0 0 60px rgba(124, 58, 237, 0.3));
    animation: loginLogoFloat 5s ease-in-out infinite;
}

@keyframes loginLogoFloat {
    0%, 100% {
        transform: translateY(0);
        filter: drop-shadow(0 0 25px rgba(192, 132, 252, 0.5))
                drop-shadow(0 0 50px rgba(124, 58, 237, 0.25));
    }
    50% {
        transform: translateY(-12px);
        filter: drop-shadow(0 0 40px rgba(192, 132, 252, 0.7))
                drop-shadow(0 0 80px rgba(124, 58, 237, 0.4))
                drop-shadow(0 10px 30px rgba(245, 158, 11, 0.15));
    }
}

.login-subtitle {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    color: rgba(161, 161, 170, 0.7);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 0;
}

/* Panel — glass card */
.login-panel {
    width: 100%;
    background: rgba(15, 14, 23, 0.65);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(192, 132, 252, 0.18);
    border-radius: 20px;
    padding: 30px 28px;
    box-shadow:
        0 12px 50px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(124, 58, 237, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    animation: loginPanelAppear 0.6s ease-out;
}

@keyframes loginPanelAppear {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-heading {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.2rem;
    color: rgba(192, 132, 252, 0.9);
    text-align: center;
    margin: 0 0 18px 0;
    letter-spacing: 1.5px;
    font-weight: 600;
}

/* Google Button */
.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f1f1f;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-google:hover {
    background: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(255, 255, 255, 0.15);
}

.btn-google:active {
    transform: translateY(0);
}

/* Guest Play Button */
.btn-guest {
    width: 100%;
    padding: 11px;
    background: transparent;
    border: 1px solid rgba(192, 132, 252, 0.3);
    color: #c084fc;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Cinzel', serif;
}
.btn-guest:hover {
    background: rgba(192, 132, 252, 0.1);
    border-color: rgba(192, 132, 252, 0.5);
}
.btn-guest:active {
    transform: scale(0.98);
}
.guest-hint {
    text-align: center;
    color: #71717A;
    font-size: 0.72rem;
    margin: 6px 0 0;
}

/* Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0;
    color: #71717A;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(192, 132, 252, 0.15);
}

/* Inputs */
.auth-input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 10px;
    color: #FAFAFA;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
    box-sizing: border-box;
}

.auth-input::placeholder {
    color: rgba(113, 113, 122, 0.7);
}

.auth-input:focus {
    border-color: rgba(192, 132, 252, 0.6);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.1),
                0 0 20px rgba(124, 58, 237, 0.06);
}

/* Submit Button */
.btn-auth-submit {
    display: block;
    width: 100%;
    padding: 13px 16px;
    margin-top: 8px;
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #7C3AED 100%);
    background-size: 200% 100%;
    color: white;
    border: none;
    border-radius: 10px;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-auth-submit:hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(168, 85, 247, 0.35),
                0 0 40px rgba(124, 58, 237, 0.12);
}

/* Links */
.auth-switch, .auth-forgot {
    text-align: center;
    margin-top: 14px;
    font-size: 0.85rem;
    color: #A1A1AA;
}

.auth-switch a,
.auth-forgot a {
    color: #C084FC;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover,
.auth-forgot a:hover {
    text-decoration: underline;
    color: #D8B4FE;
}

.auth-forgot {
    margin-top: 8px;
    font-size: 0.8rem;
}

/* Error */
.auth-error {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
}

.auth-error-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #FCA5A5;
}

.auth-error-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86EFAC;
}

/* Loading State */
.auth-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
}

.auth-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(192, 132, 252, 0.2);
    border-top-color: #C084FC;
    border-radius: 50%;
    animation: authSpin 0.8s linear infinite;
}

@keyframes authSpin {
    to { transform: rotate(360deg); }
}

.auth-loading-state p {
    color: #A1A1AA;
    font-size: 0.9rem;
    text-align: center;
}

/* Footer */
.login-footer {
    color: rgba(82, 82, 91, 0.6);
    font-size: 0.7rem;
    letter-spacing: 1.5px;
    margin: 0;
}

/* ── Login Qi Orbs (ambient decoration) ── */
.login-qi-orb {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 9998;
    animation: loginOrbFloat linear infinite;
}

@keyframes loginOrbFloat {
    0%   { transform: translateY(0) scale(0); opacity: 0; }
    10%  { opacity: 1; transform: scale(1); }
    90%  { opacity: 0.5; }
    100% { transform: translateY(-105vh) scale(0.3); opacity: 0; }
}

/* Hide game background static image when video loads */
.game-background.video-active {
    background-image: none;
}

/* ── Login screen: mobile compact ── */
@media (max-width: 768px) {
    .login-logo {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 4px !important;
    }
    .login-panel {
        padding: 20px 16px !important;
        border-radius: 14px !important;
    }
    .login-container {
        padding: 12px !important;
    }
    .auth-heading {
        font-size: 1rem !important;
    }
    .btn-google {
        min-height: 44px !important;
    }
    .auth-input {
        min-height: 44px !important;
        font-size: 16px !important; /* prevents iOS zoom on focus */
    }
    .btn-auth-submit {
        min-height: 44px !important;
    }
}

/* ── Login screen: short viewports (itch.io iframe) ── */
@media (max-height: 700px) {
    .login-screen {
        align-items: flex-start !important;
    }
    .login-logo {
        width: 100px !important;
        height: 100px !important;
        margin-bottom: 4px !important;
    }
    .login-subtitle {
        font-size: 0.7rem !important;
        letter-spacing: 2px !important;
    }
    .login-container {
        gap: 8px !important;
        padding: 10px 16px !important;
    }
    .login-panel {
        padding: 18px 20px !important;
    }
    .auth-divider {
        margin: 10px 0 !important;
    }
    .auth-input {
        padding: 9px 14px !important;
        margin-bottom: 8px !important;
    }
    .btn-auth-submit {
        padding: 10px 14px !important;
    }
    .btn-google {
        padding: 9px 14px !important;
    }
    .btn-guest {
        padding: 8px !important;
    }
    .auth-switch, .auth-forgot {
        margin-top: 8px !important;
    }
}

@media (max-height: 500px) {
    .login-logo {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 2px !important;
    }
    .login-subtitle {
        display: none !important;
    }
    .login-container {
        gap: 4px !important;
        padding: 6px 12px !important;
    }
    .login-panel {
        padding: 12px 16px !important;
    }
    .auth-heading {
        font-size: 0.9rem !important;
        margin-bottom: 10px !important;
    }
    .auth-divider {
        margin: 6px 0 !important;
    }
    .auth-input {
        padding: 7px 12px !important;
        margin-bottom: 6px !important;
    }
}

/* ══════════════════════════════════════════════════════════
   GLOBAL CHAT WIDGET
   ══════════════════════════════════════════════════════════ */

.chat-widget {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 320px;
    z-index: 8000;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(15, 14, 23, 0.88);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(192, 132, 252, 0.2);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: height 0.3s ease, box-shadow 0.3s ease;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.chat-collapsed {
    height: 40px;
}

.chat-expanded {
    height: 420px;
}

/* Chat Header */
.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: rgba(100, 60, 140, 0.3);
    cursor: pointer;
    user-select: none;
    min-height: 40px;
    box-sizing: border-box;
}

.chat-header:hover {
    background: rgba(100, 60, 140, 0.4);
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-icon {
    display: flex;
    color: #C084FC;
}

.chat-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #E4E4E7;
    letter-spacing: 0.5px;
}

.chat-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    background: #EF4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
}

.chat-collapse-icon {
    color: #71717A;
    font-size: 0.7rem;
}

/* Chat Body */
.chat-body {
    display: flex;
    flex-direction: column;
    height: calc(100% - 40px);
}

.chat-collapsed .chat-body {
    display: none;
}

/* Messages Area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(192, 132, 252, 0.2) transparent;
}

.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(192, 132, 252, 0.3);
    border-radius: 2px;
}

.chat-welcome {
    text-align: center;
    color: #71717A;
    font-size: 0.75rem;
    padding: 8px;
    font-style: italic;
}

/* Message */
.chat-msg {
    padding: 4px 0;
}

.chat-msg-me {
    /* Subtle highlight for own messages */
    outline: none;
}

.chat-msg-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    flex-wrap: wrap;
}

.chat-msg-realm {
    color: #06B6D4;
    font-size: 0.65rem;
    font-weight: 500;
    opacity: 0.8;
}

.chat-msg-name {
    color: #C084FC;
    font-size: 0.78rem;
    font-weight: 600;
}

.chat-msg-me .chat-msg-name {
    color: #F59E0B;
}

.chat-msg-time {
    color: #52525B;
    font-size: 0.6rem;
    margin-left: auto;
}

.chat-msg-text {
    color: #D4D4D8;
    font-size: 0.8rem;
    line-height: 1.4;
    word-break: break-word;
    padding-left: 2px;
}

/* Input Area */
.chat-input-area {
    display: flex;
    gap: 6px;
    padding: 8px 10px;
    border-top: 1px solid rgba(192, 132, 252, 0.12);
    background: rgba(0, 0, 0, 0.2);
}

#chat-input {
    flex: 1;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 6px;
    color: #FAFAFA;
    font-size: 0.8rem;
    font-family: var(--font-body, 'Inter', sans-serif);
    outline: none;
    transition: border-color 0.2s;
}

#chat-input:focus {
    border-color: #C084FC;
}

#chat-input::placeholder {
    color: #52525B;
}

.chat-send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: rgba(192, 132, 252, 0.2);
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 6px;
    color: #C084FC;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: rgba(192, 132, 252, 0.35);
    transform: scale(1.05);
}

/* ─── Chat improvements v2 ─── */

/* Grouped messages (same user, < 2 min apart) */
.chat-msg-grouped {
    padding: 1px 0 1px 2px;
}

.chat-msg-grouped .chat-msg-text {
    font-size: 0.8rem;
}

/* Your own messages highlight */
.chat-msg-me {
    background: rgba(192, 132, 252, 0.04);
    border-radius: 4px;
    padding: 4px 4px;
    margin: 0 -4px;
}

/* Input wrap with char counter */
.chat-input-wrap {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.chat-input-wrap #chat-input {
    width: 100%;
    padding-right: 50px;
}

.chat-char-count {
    position: absolute;
    right: 8px;
    font-size: 0.58rem;
    color: #52525B;
    pointer-events: none;
    user-select: none;
    transition: color 0.2s;
}

.chat-char-warn {
    color: #F59E0B;
}

.chat-char-limit {
    color: #EF4444;
    font-weight: 600;
}

/* Welcome icon */
.chat-welcome-icon {
    font-size: 1.2rem;
    margin-right: 4px;
}

/* ══════════════════════════════════════════════════════════
   LEADERBOARD
   ══════════════════════════════════════════════════════════ */

.leaderboard-container {
    max-width: 800px;
    margin: 0 auto;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 20px;
}

.leaderboard-title {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.6rem;
    color: #F59E0B;
    margin: 0 0 4px 0;
    text-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.leaderboard-subtitle {
    color: #A1A1AA;
    font-size: 0.85rem;
    margin: 0;
}

/* Category Tabs */
.leaderboard-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.lb-tab {
    flex: 1;
    min-width: 80px;
    padding: 8px 14px;
    background: rgba(100, 60, 140, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 8px;
    color: #A1A1AA;
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.lb-tab:hover {
    background: rgba(100, 60, 140, 0.25);
    color: #E4E4E7;
}

.lb-tab-active {
    background: rgba(192, 132, 252, 0.2);
    border-color: rgba(192, 132, 252, 0.4);
    color: #C084FC;
    font-weight: 600;
}

/* Table */
.leaderboard-table-wrap {
    background: rgba(15, 14, 23, 0.4);
    border: 1px solid rgba(192, 132, 252, 0.12);
    border-radius: 12px;
    overflow: hidden;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
}

.lb-table thead th {
    padding: 10px 14px;
    text-align: left;
    color: #71717A;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(192, 132, 252, 0.1);
    background: rgba(100, 60, 140, 0.1);
}

.lb-table tbody tr {
    border-bottom: 1px solid rgba(192, 132, 252, 0.06);
    transition: background 0.15s;
}

.lb-table tbody tr:hover {
    background: rgba(192, 132, 252, 0.06);
}

.lb-table tbody td {
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #D4D4D8;
}

/* Rank Column */
.lb-col-rank {
    width: 50px;
    text-align: center !important;
    font-weight: 700;
}

.lb-crown, .lb-silver, .lb-bronze {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.75rem;
}

.lb-crown {
    background: linear-gradient(135deg, #F59E0B, #EAB308);
    color: #1a1625;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.lb-silver {
    background: linear-gradient(135deg, #94A3B8, #CBD5E1);
    color: #1a1625;
}

.lb-bronze {
    background: linear-gradient(135deg, #D97706, #B45309);
    color: #FEF3C7;
}

/* Name Column */
.lb-col-name {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Realm Badge */
.lb-realm-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.72rem;
    font-weight: 500;
    background: rgba(192, 132, 252, 0.12);
    color: #C084FC;
    border: 1px solid rgba(192, 132, 252, 0.2);
}

.lb-realm-qi-condensation { color: #06B6D4; border-color: rgba(6, 182, 212, 0.3); background: rgba(6, 182, 212, 0.1); }
.lb-realm-foundation-establishment { color: #A855F7; border-color: rgba(168, 85, 247, 0.3); background: rgba(168, 85, 247, 0.1); }
.lb-realm-core-formation { color: #F59E0B; border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.1); }
.lb-realm-nascent-soul { color: #EF4444; border-color: rgba(239, 68, 68, 0.3); background: rgba(239, 68, 68, 0.1); }
.lb-realm-spirit-severing { color: #F43F5E; border-color: rgba(244, 63, 94, 0.3); background: rgba(244, 63, 94, 0.1); }
.lb-realm-dao-seeking { color: #FBBF24; border-color: rgba(251, 191, 36, 0.3); background: rgba(251, 191, 36, 0.1); }
.lb-realm-immortal-ascension { color: #FFD700; border-color: rgba(255, 215, 0, 0.4); background: rgba(255, 215, 0, 0.1); }

/* Value Column */
.lb-col-value {
    text-align: right !important;
    font-weight: 600;
    color: #F59E0B;
}

/* Top 3 Row Highlights */
.lb-top-1 { background: rgba(245, 158, 11, 0.08) !important; }
.lb-top-2 { background: rgba(148, 163, 184, 0.06) !important; }
.lb-top-3 { background: rgba(217, 119, 6, 0.05) !important; }

/* Current Player Highlight */
.lb-me {
    background: rgba(192, 132, 252, 0.1) !important;
    border-left: 3px solid #C084FC;
}

.lb-me .lb-col-name {
    color: #C084FC;
    font-weight: 700;
}

/* Status Messages */
.lb-loading, .lb-empty, .lb-error, .lb-my-rank {
    text-align: center;
    padding: 30px 20px;
    color: #71717A;
    font-size: 0.9rem;
}

.lb-error {
    color: #FCA5A5;
}

.lb-my-rank {
    padding: 14px;
    font-size: 0.82rem;
    color: #A1A1AA;
    font-style: italic;
    border-top: 1px solid rgba(192, 132, 252, 0.1);
}

/* Footer */
.leaderboard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    gap: 10px;
}

.btn-lb-refresh {
    padding: 8px 16px;
    background: rgba(192, 132, 252, 0.15);
    border: 1px solid rgba(192, 132, 252, 0.25);
    border-radius: 8px;
    color: #C084FC;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body, 'Inter', sans-serif);
}

.btn-lb-refresh:hover {
    background: rgba(192, 132, 252, 0.25);
}

.lb-update-info {
    color: #52525B;
    font-size: 0.72rem;
}

/* ─── Podium (Top 3 Visual) ─── */
.lb-podium {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 12px;
    padding: 24px 16px 20px;
    border-bottom: 1px solid rgba(192, 132, 252, 0.1);
}

.lb-podium-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 16px 12px;
    border-radius: 12px;
    background: rgba(15, 14, 23, 0.6);
    border: 1px solid rgba(192, 132, 252, 0.1);
    min-width: 110px;
    flex: 1;
    max-width: 180px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lb-podium-slot:hover {
    transform: translateY(-3px);
}

/* Gold — center, tallest */
.lb-podium-1 {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12) 0%, rgba(15, 14, 23, 0.6) 100%);
    border-color: rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.12);
    padding-top: 20px;
    padding-bottom: 16px;
    order: 0;
}

/* Silver — left */
.lb-podium-2 {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.1) 0%, rgba(15, 14, 23, 0.6) 100%);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 0 12px rgba(148, 163, 184, 0.08);
    order: -1;
}

/* Bronze — right */
.lb-podium-3 {
    background: linear-gradient(180deg, rgba(217, 119, 6, 0.1) 0%, rgba(15, 14, 23, 0.6) 100%);
    border-color: rgba(217, 119, 6, 0.2);
    box-shadow: 0 0 12px rgba(217, 119, 6, 0.06);
}

.lb-podium-me {
    border-color: rgba(192, 132, 252, 0.5) !important;
    box-shadow: 0 0 18px rgba(192, 132, 252, 0.15) !important;
}

.lb-podium-medal {
    font-size: 2rem;
    line-height: 1;
}

.lb-podium-1 .lb-podium-medal {
    font-size: 2.6rem;
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.5));
}

.lb-podium-name {
    font-weight: 600;
    font-size: 0.88rem;
    color: #E4E4E7;
    text-align: center;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-podium-realm {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 6px;
    background: rgba(192, 132, 252, 0.1);
    color: #A1A1AA;
}

.lb-podium-value {
    font-weight: 700;
    font-size: 1.05rem;
    color: #F59E0B;
    margin-top: 2px;
}

.lb-podium-1 .lb-podium-value {
    font-size: 1.2rem;
    text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.lb-podium-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-top: 6px;
    background: rgba(192, 132, 252, 0.12);
}

.lb-podium-1 .lb-podium-bar { background: linear-gradient(90deg, #F59E0B, #EAB308); }
.lb-podium-2 .lb-podium-bar { background: linear-gradient(90deg, #94A3B8, #CBD5E1); }
.lb-podium-3 .lb-podium-bar { background: linear-gradient(90deg, #D97706, #B45309); }

/* ─── Loading Spinner ─── */
.lb-loading-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(192, 132, 252, 0.15);
    border-top-color: #C084FC;
    border-radius: 50%;
    animation: lb-spin 0.8s linear infinite;
    margin: 0 auto 10px;
}

@keyframes lb-spin {
    to { transform: rotate(360deg); }
}

/* ─── YOU Badge ─── */
.lb-you-badge {
    display: inline-block;
    padding: 1px 6px;
    margin-left: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: #1a1625;
    background: linear-gradient(135deg, #C084FC, #A855F7);
    border-radius: 4px;
    vertical-align: middle;
}

/* ─── Player Name ─── */
.lb-player-name {
    vertical-align: middle;
}

/* ─── Rank Number (non-medal) ─── */
.lb-rank-num {
    color: #71717A;
    font-size: 0.82rem;
    font-weight: 600;
}

/* ─── Icon-style states (error, empty, my-rank) ─── */
.lb-error-icon,
.lb-empty-icon,
.lb-my-rank-icon {
    display: block;
    font-size: 2rem;
    margin-bottom: 8px;
}

.lb-error p,
.lb-empty p {
    margin: 6px 0 12px;
}

/* ─── Tab icon / label ─── */
.lb-tab-icon {
    margin-right: 4px;
}

/* ─── Title area ─── */
.lb-title-area {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ─── Leaderboard Content wrapper ─── */
.leaderboard-content {
    min-height: 120px;
}

/* ═══ Responsive podium ═══ */
@media (max-width: 768px) {
    .leaderboard-container {
        padding: 12px 8px !important;
    }
    .lb-tab {
        padding: 6px 8px !important;
        font-size: 0.75rem !important;
        min-width: 60px !important;
    }
    .lb-table thead th,
    .lb-table td {
        padding: 8px 6px !important;
        font-size: 0.78rem !important;
    }
    .leaderboard-table-wrap {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
}

@media (max-width: 600px) {
    .lb-podium {
        gap: 6px;
        padding: 16px 8px;
    }
    .lb-podium-slot {
        min-width: 80px;
        padding: 10px 8px;
    }
    .lb-podium-medal { font-size: 1.5rem; }
    .lb-podium-1 .lb-podium-medal { font-size: 2rem; }
    .lb-podium-name { font-size: 0.78rem; max-width: 90px; }
    .lb-podium-value { font-size: 0.9rem; }
}

/* ══════════════════════════════════════════════════════════
   ACCOUNT SECTION (Settings)
   ══════════════════════════════════════════════════════════ */

.account-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    background: rgba(100, 60, 140, 0.12);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 10px;
    margin-bottom: 12px;
}

.account-avatar-icon {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(192, 132, 252, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    border: 2px solid rgba(192, 132, 252, 0.3);
}

.account-info {
    flex: 1;
    min-width: 0;
}

.account-name {
    font-weight: 600;
    color: #E4E4E7;
    font-size: 0.95rem;
}

.account-email {
    color: #71717A;
    font-size: 0.78rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    padding: 7px 14px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.25);
    border-radius: 6px;
    color: #FCA5A5;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body, 'Inter', sans-serif);
    white-space: nowrap;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #EF4444;
}

/* Leaderboard nav item SVG alignment */
.nav-item .nav-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

/* ══════════════════════════════════════════════════════
   CHARACTER CREATION WIZARD
   ══════════════════════════════════════════════════════ */

.char-creation-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 5, 12, 0.55);
    backdrop-filter: blur(10px);
    animation: charOverlayIn 0.6s ease-out;
}
@keyframes charOverlayIn { from { opacity: 0; } to { opacity: 1; } }

.char-creation-overlay.fade-out {
    animation: charOverlayOut 0.6s ease forwards;
}
@keyframes charOverlayOut { to { opacity: 0; transform: scale(1.04); } }

.char-creation-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 520px;
    width: 100%;
    padding: 16px 20px;
}

/* ── Wizard Progress Bar ── */
.wizard-progress {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 4px;
}
.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}
.wizard-step span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.8rem;
    font-weight: 700;
    background: rgba(192, 132, 252, 0.1);
    border: 2px solid rgba(192, 132, 252, 0.2);
    color: rgba(161, 161, 170, 0.5);
    transition: all 0.4s ease;
}
.wizard-step.active span,
.wizard-step.done span {
    background: rgba(124, 58, 237, 0.6);
    border-color: rgba(192, 132, 252, 0.7);
    color: #fff;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.3);
}
.wizard-step.done span {
    background: rgba(34, 197, 94, 0.5);
    border-color: rgba(34, 197, 94, 0.6);
}
.wizard-step small {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.6rem;
    color: rgba(161, 161, 170, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.4s;
}
.wizard-step.active small { color: rgba(192, 132, 252, 0.8); }
.wizard-step.done small { color: rgba(34, 197, 94, 0.7); }

.wizard-line {
    width: 40px;
    height: 2px;
    background: rgba(192, 132, 252, 0.12);
    margin: 0 6px;
    margin-bottom: 16px;
    transition: background 0.4s;
}
.wizard-line.active {
    background: rgba(192, 132, 252, 0.4);
}

/* ── Wizard Pages ── */
.wizard-page {
    display: none;
    width: 100%;
    animation: wizardPageIn 0.4s ease-out;
}
.wizard-page.active {
    display: block;
}
@keyframes wizardPageIn {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}

.wizard-page-header {
    text-align: center;
    margin-bottom: 12px;
}

.char-creation-title {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: #FAFAFA;
    text-shadow: 0 0 20px rgba(192, 132, 252, 0.4);
    letter-spacing: 1.5px;
    margin: 0;
}

.char-creation-subtitle {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.75rem;
    color: rgba(161, 161, 170, 0.6);
    letter-spacing: 2px;
    margin-top: 4px;
}

.char-creation-panel {
    width: 100%;
    background: rgba(15, 14, 23, 0.7);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 18px;
    padding: 24px 22px;
    box-shadow:
        0 12px 50px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

/* ── Avatar Preview Ring ── */
.avatar-preview-ring {
    width: 100px;
    height: 100px;
    margin: 0 auto 16px;
    border-radius: 50%;
    border: 3px solid rgba(192, 132, 252, 0.5);
    overflow: hidden;
    box-shadow: 0 0 30px rgba(124, 58, 237, 0.2);
    animation: previewPulse 3s ease-in-out infinite;
}
.avatar-preview-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
@keyframes previewPulse {
    0%, 100% { box-shadow: 0 0 25px rgba(124, 58, 237, 0.2); }
    50%      { box-shadow: 0 0 40px rgba(192, 132, 252, 0.35); }
}

/* ── Avatar Grid ── */
.avatar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.avatar-option {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid rgba(192, 132, 252, 0.1);
    cursor: pointer;
    transition: all 0.25s ease;
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.03);
}
.avatar-option img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}
.avatar-option:hover {
    border-color: rgba(192, 132, 252, 0.35);
    transform: translateY(-2px);
}
.avatar-option:hover img { transform: scale(1.06); }
.avatar-option.selected {
    border-color: rgba(192, 132, 252, 0.7);
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.2);
}

/* ── Name Preview Card ── */
.name-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(192, 132, 252, 0.12);
    border-radius: 14px;
    padding: 14px 18px;
    margin-bottom: 18px;
}
.name-card-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(192, 132, 252, 0.3);
    object-fit: cover;
}
.name-card-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.name-card-name {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.15rem;
    color: #FAFAFA;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.name-card-realm {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.7rem;
    color: rgba(192, 132, 252, 0.6);
    letter-spacing: 1px;
}

/* ── Name Input ── */
.char-name-input {
    display: block;
    width: 100%;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(192, 132, 252, 0.15);
    border-radius: 12px;
    color: #FAFAFA;
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.05rem;
    text-align: center;
    letter-spacing: 1px;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}
.char-name-input::placeholder {
    color: rgba(113, 113, 122, 0.4);
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.85rem;
    letter-spacing: 0;
}
.char-name-input:focus {
    border-color: rgba(192, 132, 252, 0.5);
    box-shadow: 0 0 0 3px rgba(192, 132, 252, 0.08);
}
.char-name-hint {
    font-size: 0.65rem;
    color: rgba(113, 113, 122, 0.5);
    text-align: center;
    margin-top: 6px;
}
.char-creation-error {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.8rem;
    text-align: center;
    margin-top: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

/* ── Dao Path Grid ── */
.dao-path-panel {
    max-height: 75vh;
    overflow-y: auto;
}
.dao-path-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}
.dao-path-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 6px 10px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}
.dao-path-card:hover {
    border-color: var(--path-color, rgba(192, 132, 252, 0.4));
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.dao-path-card.selected {
    border-color: var(--path-color, rgba(192, 132, 252, 0.7));
    background: rgba(var(--path-rgb, 192, 132, 252), 0.08);
    box-shadow: 0 0 24px rgba(var(--path-rgb, 192, 132, 252), 0.15);
}
.dao-path-card .dpc-icon {
    font-size: 1.8rem;
    line-height: 1;
}
.dao-path-card .dpc-name {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.65rem;
    color: rgba(250, 250, 250, 0.8);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* ── Dao Path Detail Panel ── */
.dao-path-detail {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(192, 132, 252, 0.1);
    border-radius: 14px;
    padding: 16px 18px;
    margin-bottom: 14px;
    animation: dpdSlideIn 0.35s ease-out;
}
@keyframes dpdSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.dpd-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.dpd-icon {
    font-size: 2rem;
    line-height: 1;
}
.dpd-name {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 1.1rem;
    color: #FAFAFA;
    margin: 0;
    font-weight: 700;
}
.dpd-title {
    font-family: var(--font-body, 'Inter', sans-serif);
    font-size: 0.7rem;
    color: var(--path-detail-color, rgba(192, 132, 252, 0.7));
    letter-spacing: 1px;
    font-style: italic;
}
.dpd-lore {
    font-size: 0.78rem;
    color: rgba(161, 161, 170, 0.7);
    line-height: 1.5;
    margin-bottom: 6px;
}
.dpd-philosophy {
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.75rem;
    color: var(--path-detail-color, rgba(192, 132, 252, 0.6));
    font-style: italic;
    margin-bottom: 12px;
    text-align: center;
}
.dpd-bonuses {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.dpd-bonus-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    font-size: 0.72rem;
}
.dpd-bonus-item .bonus-icon {
    font-size: 0.9rem;
}
.dpd-bonus-item .bonus-stat {
    color: rgba(161, 161, 170, 0.7);
}
.dpd-bonus-item .bonus-value {
    margin-left: auto;
    color: #FAFAFA;
    font-weight: 600;
}
.dpd-bonus-item .bonus-scale {
    font-size: 0.6rem;
    color: rgba(34, 197, 94, 0.5);
    margin-left: 2px;
}
.dpd-scaling-note {
    font-size: 0.6rem;
    text-align: center;
    color: rgba(34, 197, 94, 0.4);
    margin-top: 8px;
    letter-spacing: 1px;
}

/* ── Wizard Navigation Buttons ── */
.wizard-nav {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.btn-wizard-next,
.btn-wizard-back {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.btn-wizard-next {
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #7C3AED 100%);
    background-size: 200% 100%;
    color: #fff;
}
.btn-wizard-next:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(168, 85, 247, 0.3);
}
.btn-wizard-back {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(161, 161, 170, 0.7);
    border: 1px solid rgba(192, 132, 252, 0.1);
}
.btn-wizard-back:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #FAFAFA;
}

/* Begin Button (Step 3) */
.btn-begin-cultivation {
    flex: 1.5;
    padding: 13px 20px;
    background: linear-gradient(135deg, #7C3AED 0%, #A855F7 50%, #7C3AED 100%);
    background-size: 200% 100%;
    color: white;
    border: none;
    border-radius: 12px;
    font-family: var(--font-heading, 'Cinzel', serif);
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
}
.btn-begin-cultivation:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}
.btn-begin-cultivation:not(:disabled):hover {
    background-position: 100% 0;
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(168, 85, 247, 0.35);
}
.btn-begin-cultivation:not(:disabled)::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: linear-gradient(45deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
    animation: btnShine 3s infinite;
}
@keyframes btnShine {
    0%   { transform: translateX(-100%) rotate(25deg); }
    100% { transform: translateX(100%) rotate(25deg); }
}

/* ── Wizard Mobile Responsive ── */

/* ══════════════════════════════════════════════════════════════
   GOLD SINKS — Special Services Cards
   ══════════════════════════════════════════════════════════════ */
.gs-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(192, 132, 252, 0.15);
}
.gs-title {
    color: #fbbf24;
    font-size: 1.1rem;
    margin-bottom: 4px;
}
.gs-subtitle {
    color: #888;
    font-style: italic;
    font-size: 0.85em;
    margin-bottom: 16px;
}
.gs-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.gs-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    transition: border-color 0.2s, background 0.2s;
}
.gs-card:hover {
    border-color: rgba(192, 132, 252, 0.25);
    background: rgba(255, 255, 255, 0.05);
}
.gs-card.gs-owned {
    opacity: 0.65;
    border-color: rgba(34, 197, 94, 0.25);
}
.gs-card.gs-active-card {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(251, 191, 36, 0.04);
}
.gs-icon {
    font-size: 1.8em;
    min-width: 40px;
    text-align: center;
}
.gs-info {
    flex: 1;
    min-width: 0;
}
.gs-name {
    color: #e0e0e0;
    font-size: 0.95em;
    margin: 0 0 2px;
}
.gs-desc {
    color: #999;
    font-size: 0.78em;
    margin: 0;
    line-height: 1.3;
}
.gs-badge {
    display: inline-block;
    font-size: 0.7em;
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-weight: 600;
}
.gs-badge.gs-purchased {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}
.gs-badge.gs-active {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}
.gs-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.gs-price {
    font-size: 0.85em;
    color: #fbbf24;
    white-space: nowrap;
}
.gs-stone-cost {
    font-size: 0.75em;
    color: #818cf8;
    white-space: nowrap;
}
.btn-gs-buy {
    padding: 6px 14px;
    font-size: 0.78em;
    border-radius: 6px;
    border: 1px solid rgba(192, 132, 252, 0.3);
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(192, 132, 252, 0.05));
    color: #c084fc;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.btn-gs-buy:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(192, 132, 252, 0.3), rgba(192, 132, 252, 0.1));
    border-color: rgba(192, 132, 252, 0.5);
    color: #e0b0ff;
}
.btn-gs-buy:disabled,
.btn-gs-buy.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 560px) {
    .gs-card {
        flex-wrap: wrap;
    }
    .gs-actions {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
}

@media (max-width: 560px) {
    .char-creation-container {
        max-width: 100%;
        padding: 12px 10px;
    }
    .dao-path-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .dpd-bonuses {
        grid-template-columns: 1fr;
    }
    .char-creation-title {
        font-size: 1.15rem;
    }
    .avatar-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 6px;
    }
}

/* ══════════════════════════════════════════════════════════════
   MOBILE PERFORMANCE MODE
   Kills expensive CSS effects on small screens to reduce lag:
   - backdrop-filter (GPU re-composition per frame)
   - infinite animations that animate box-shadow/filter/border
   - video background filter
   - ambient particle visibility
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* ══════════════════════════════════════════════════════════
       MOBILE PERFORMANCE — BALANCED
       Kill expensive effects but KEEP life/animations that matter.
       The user said "0 animação, completamente sem vida" — we need
       to preserve essential motion while being perf-conscious.
       ══════════════════════════════════════════════════════════ */

    /* ── Kill backdrop-filter globally (expensive GPU compositing) ── */
    *,
    *::before,
    *::after {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    /* ── Disable particle systems (heavy DOM + animation) ── */
    .qi-particle,
    .star-twinkle,
    .realm-aura {
        display: none !important;
    }

    /* ── Kill purely decorative pseudo-element animations ── */
    .territory-card::before,
    .territory-card::after,
    .enemy-portrait-frame::before,
    .enemy-portrait-frame::after,
    .equipment-slot::before,
    .equipment-slot::after,
    .achievement-card::before,
    .skill-card::before,
    .skill-card::after,
    .crafting-card::before,
    .vendor-item::before,
    .vendor-item::after,
    .quest-card::before,
    .quest-card::after,
    .prestige-card::before,
    .prestige-card::after {
        animation: none !important;
        opacity: 0 !important;
    }

    /* ── Video: keep playing but reduce GPU load ── */
    .bg-video {
        filter: brightness(0.6) saturate(1.0) !important;
        opacity: 0.6 !important;
    }

    /* ── KEEP these animations alive for interactivity ── */
    /* pulseGlow on active nav / cultivate button */
    .nav-item.active {
        animation: pulseGlow 3s ease-in-out infinite !important;
    }

    .btn-cultivate:not(:disabled) {
        animation: pulseGlow 2.5s ease-in-out infinite !important;
    }

    /* Button hover jello — keep for responsiveness */
    .btn-cultivate:hover,
    .btn-train-skill:hover,
    .btn-craft:hover,
    .btn-attack:hover,
    .btn-buy:hover,
    .btn-gather:hover {
        animation: jello-horizontal 0.7s cubic-bezier(0.785, 0.135, 0.150, 0.860) both !important;
    }

    /* Bar glow — keep but simplify */
    .bar-fill.hp,
    .bar-fill.qi,
    .bar-fill.exp {
        animation: barGlow 4s ease-in-out infinite !important;
    }

    /* Tab content fade-in — keep */
    #tab-content {
        animation: fadeIn 0.35s ease !important;
    }

    /* Floating numbers (damage/XP/gold) — essential feedback */
    .floating-number {
        animation: floatUp 1.2s ease-out forwards !important;
    }

    /* Level up flash */
    body.level-up-flash::before {
        animation: levelUpFlash 0.6s ease 2 !important;
    }

    /* Loading spinner — must stay */
    .loading-spinner {
        animation: spin 0.8s linear infinite !important;
    }

    /* Quest claim button pulse — important feedback */
    .btn-claim-quest.ready {
        animation: pulse 2s infinite !important;
    }

    /* Equipment tier glow — visual quality indicator */
    .equipment-item.tier-rare,
    .equipped-item.tier-rare {
        animation: tierGlowRare 3s infinite !important;
    }
    .equipment-item.tier-epic,
    .equipped-item.tier-epic {
        animation: tierGlowEpic 3s infinite !important;
    }
    .equipment-item.tier-legendary,
    .equipped-item.tier-legendary {
        animation: tierGlowLegendary 3s infinite !important;
    }

    /* Hit flash — combat feedback */
    .hit,
    .enemy-display.hit {
        animation: hitFlash 0.3s ease !important;
    }

    /* Button active press */
    .btn:active,
    .btn-primary:active,
    .btn-cultivate:active {
        animation: pulse 0.3s ease !important;
    }

    /* Achievement notification slide */
    .slide-in-right {
        animation: slideInRight 0.5s ease-out !important;
    }
    .slide-out-right {
        animation: slideOutRight 0.5s ease-out forwards !important;
    }

    /* Crafting progress bar */
    .crafting-progress-bar {
        animation: craftingProgress var(--craft-time, 2s) linear !important;
    }

    /* Card slide-in — keep but speed up */
    .slide-in-bottom {
        animation: slide-in-bottom 0.4s cubic-bezier(0.250, 0.460, 0.450, 0.940) both !important;
    }

    /* ── Simplify box-shadows (reduce GPU compositing) ── */
    .territory-card,
    .enemy-card,
    .skill-card,
    .crafting-card,
    .vendor-item,
    .equipment-slot,
    .achievement-card,
    .quest-card,
    .prestige-card,
    .settings-section {
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
    }

    /* ── nav-item pseudo keep clean (no heavy pseudo anims) ── */
    .nav-item::before,
    .nav-item::after {
        animation: none !important;
        opacity: 0 !important;
    }

    /* ── Button pseudo-element glow kill ── */
    .btn-craft::after,
    .btn-attack::after,
    .btn-cultivate::after,
    .btn-gather::after,
    .btn-begin-cultivation::after {
        animation: none !important;
        opacity: 0 !important;
    }

    /* ── Disable heavy shimmer on non-essential elements ── */
    .shimmer-effect {
        animation: none !important;
    }

    /* ── Bar fill gradient animation — simplify ── */
    .stat-bar-fill,
    .resource-bar-fill,
    .hp-bar-fill,
    .qi-bar-fill,
    .exp-bar-fill {
        background-size: auto !important;
    }
}

/* ── Lite Mode (toggled via Settings) ── */
body.lite-mode *,
body.lite-mode *::before,
body.lite-mode *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    animation-duration: 0s !important;
    animation: none !important;
    transition-duration: 0.05s !important;
}

/* Preserve sidebar slide transition in lite mode */
body.lite-mode #sidebar {
    transition-duration: 0.25s !important;
    transition-property: left !important;
    transition-timing-function: ease !important;
}

body.lite-mode #sidebar::after {
    animation-duration: 0.2s !important;
    animation: mqFadeIn 0.2s ease forwards !important;
}

body.lite-mode .qi-particle,
body.lite-mode .star-twinkle,
body.lite-mode .realm-aura {
    display: none !important;
}

body.lite-mode .bg-video {
    display: none !important;
}

body.lite-mode .territory-card,
body.lite-mode .enemy-card,
body.lite-mode .skill-card,
body.lite-mode .crafting-card,
body.lite-mode .vendor-item,
body.lite-mode .equipment-slot,
body.lite-mode .achievement-card,
body.lite-mode .quest-card,
body.lite-mode .prestige-card,
body.lite-mode .settings-section {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3) !important;
}

/* ══════════════════════════════════════════════════════════════
   PREFERS-REDUCED-MOTION (System-level a11y setting)
   Matches the rule in animations.css but covers all ui.css anims
   ══════════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .qi-particle,
    .star-twinkle,
    .realm-aura {
        display: none !important;
    }

    .bg-video {
        filter: none !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   ACHIEVEMENT FILTER BAR
   ═══════════════════════════════════════════════════════════ */
.achievement-filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ach-filter-btn {
    flex: 1 1 auto;
    padding: 8px 14px;
    border: 1px solid rgba(192, 132, 252, 0.3);
    border-radius: 8px;
    background: rgba(20, 18, 35, 0.8);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    min-height: 0;
}

.ach-filter-btn.active {
    background: rgba(192, 132, 252, 0.2);
    border-color: rgba(192, 132, 252, 0.6);
    color: #c084fc;
}

.ach-filter-btn:hover {
    background: rgba(192, 132, 252, 0.15);
    border-color: rgba(192, 132, 252, 0.5);
}

/* ========================================
   AUTO-SYSTEM INDICATOR BADGES (nav items)
   ======================================== */
.auto-nav-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    padding: 0 4px;
    pointer-events: none;
    z-index: 50;
    background: rgba(46, 204, 113, 0.9);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    animation: auto-badge-pulse 2s ease-in-out infinite;
}

@keyframes auto-badge-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(0.92); }
}

/* Bottom nav auto badge — positioned for the bottom bar */
.bottom-nav-item .auto-nav-badge {
    top: 2px;
    right: 8px;
    font-size: 8px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
}

/* ============================================= */
/* CRAFTING PROGRESS BANNER (inline, compact)     */
/* ============================================= */
.crafting-progress-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(76, 175, 80, 0.08);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    position: relative;
    overflow: hidden;
    gap: 12px;
}
.crafting-progress-banner::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 60%;
    background: linear-gradient(0deg,
        rgba(255, 120, 30, 0.12) 0%,
        rgba(255, 80, 20, 0.05) 40%,
        transparent 100%);
    animation: furnace-flicker 1.5s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}
.crafting-progress-banner > * { position: relative; z-index: 1; }
.banner-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}
.banner-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}
.banner-info {
    flex: 1;
    min-width: 0;
}
.banner-title {
    font-size: 0.95em;
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.craft-banner-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.5));
}
.craft-banner-emoji {
    font-size: 2em;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(76, 175, 80, 0.5));
}
.craft-queue-badge {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
    border: 1px solid rgba(255, 193, 7, 0.4);
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 0.8em;
    font-weight: 600;
    white-space: nowrap;
}
.craft-queue-badge.repeat-badge {
    background: rgba(76, 175, 80, 0.2);
    color: #66ff88;
    border-color: rgba(76, 175, 80, 0.4);
    animation: auto-badge-pulse 2s ease-in-out infinite;
}

/* Repeat & Batch buttons */
.btn-repeat-banner,
.btn-repeat {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 1.1em;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--secondary-text);
    flex-shrink: 0;
}
.btn-repeat-banner:hover,
.btn-repeat:hover {
    background: rgba(76, 175, 80, 0.15);
    border-color: rgba(76, 175, 80, 0.4);
}
.btn-repeat-banner.active,
.btn-repeat.active {
    background: rgba(76, 175, 80, 0.25);
    border-color: #4CAF50;
    color: #66ff88;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}
.btn-batch {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 0.85em;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--primary-text);
    flex-shrink: 0;
}
.btn-batch:hover:not(.disabled) {
    background: rgba(33, 150, 243, 0.2);
    border-color: rgba(33, 150, 243, 0.5);
    transform: scale(1.05);
}
.btn-batch.disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Card actions — flex row for all buttons */
.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    padding: 0 10px 10px;
}
.card-actions .btn-craft {
    flex: 1;
    min-width: 80px;
    width: auto;
}

/* Active crafting recipe card */
.recipe-card.crafting-now {
    border-color: #4CAF50 !important;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.3), inset 0 0 30px rgba(76, 175, 80, 0.05) !important;
    animation: crafting-pulse 2s ease-in-out infinite;
}
@keyframes crafting-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(76, 175, 80, 0.3), inset 0 0 30px rgba(76, 175, 80, 0.05); }
    50% { box-shadow: 0 0 30px rgba(76, 175, 80, 0.5), inset 0 0 40px rgba(76, 175, 80, 0.08); }
}

/* Mobile: stack batch buttons */
@media (max-width: 480px) {
    .card-actions {
        gap: 6px;
    }
    .btn-batch {
        padding: 6px 10px;
        font-size: 0.8em;
    }
    .crafting-progress-banner {
        flex-direction: column;
        gap: 8px;
    }
    .banner-right {
        width: 100%;
        justify-content: flex-end;
    }
}

/* ═══════════════════════════════════════════════════════
   Community Tab
   ═══════════════════════════════════════════════════════ */
.community-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.2);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

@media (max-width: 480px) {
    .community-card {
        padding: 12px 8px !important;
    }
    .community-card span:first-child {
        font-size: 1.3em !important;
    }
}

/* ═══════════════════════════════════════════════════════
   Landscape Rotation Overlay (Mobile Only)
   ═══════════════════════════════════════════════════════ */
.rotate-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(135deg, #0a0a1a 0%, #1a1a2e 50%, #0a0a1a 100%);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #E2E8F0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.rotate-content {
    animation: rotateFadeIn 0.5s ease;
}

.rotate-phone-icon {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
    animation: rotateWiggle 2s ease-in-out infinite;
}

.rotate-arrow {
    position: absolute;
    top: -8px; right: -20px;
    font-size: 28px;
    color: #C084FC;
    animation: rotateArrowPulse 1.5s ease-in-out infinite;
}

.rotate-content p {
    margin: 8px 0;
    font-size: 1.1em;
}

.rotate-subtitle {
    color: #9CA3AF;
    font-size: 0.9em !important;
}

@keyframes rotateWiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    75% { transform: rotate(-15deg); }
}

@keyframes rotateArrowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes rotateFadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Show overlay ONLY on mobile landscape */
@media (orientation: landscape) and (max-height: 500px) {
    .rotate-overlay {
        display: flex !important;
    }
}

/* ══════════════════════════════════════════════════════════════════════
   EVENT SYSTEM STYLES
   ══════════════════════════════════════════════════════════════════════ */

/* Event Banner (top of content area) */
.event-banner {
    background: linear-gradient(135deg, rgba(192,132,252,0.15) 0%, rgba(245,158,11,0.12) 100%);
    border: 1px solid rgba(192,132,252,0.3);
    border-radius: 8px;
    margin: 8px 12px;
    padding: 0;
    cursor: pointer;
    animation: eventBannerGlow 3s ease-in-out infinite;
    transition: all 0.3s ease;
}

.event-banner:hover {
    border-color: rgba(192,132,252,0.6);
    background: linear-gradient(135deg, rgba(192,132,252,0.22) 0%, rgba(245,158,11,0.18) 100%);
}

.event-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
}

.event-banner-icon {
    font-size: 1.4em;
    flex-shrink: 0;
}

.event-banner-text {
    flex: 1;
    font-size: 0.9em;
    color: #E2E8F0;
}

.event-banner-text strong {
    color: #F59E0B;
}

.event-banner-arrow {
    color: rgba(192,132,252,0.7);
    font-size: 1.2em;
    flex-shrink: 0;
}

@keyframes eventBannerGlow {
    0%, 100% { box-shadow: 0 0 8px rgba(192,132,252,0.1); }
    50% { box-shadow: 0 0 16px rgba(192,132,252,0.25); }
}

/* Events Header */
.events-header {
    text-align: center;
    margin-bottom: 20px;
    position: relative;
}

.events-header-banner {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 10px;
    margin-bottom: 12px;
    opacity: 0.9;
}

.events-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.6em;
    color: #F59E0B;
    margin-bottom: 4px;
}

.events-subtitle {
    color: #9CA3AF;
    font-size: 0.92em;
}

/* Event Section (each event block) */
.event-section {
    background: rgba(15, 14, 30, 0.6);
    border: 1px solid rgba(192,132,252,0.2);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}

.event-section.event-active {
    border-color: rgba(245,158,11,0.4);
}

.event-section.event-completed {
    border-color: rgba(34,197,94,0.4);
    opacity: 0.85;
}

.event-section.event-expired {
    border-color: rgba(100,100,100,0.3);
    opacity: 0.5;
}

.event-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.event-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    flex-shrink: 0;
}

.event-section-info h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.15em;
    color: #E2E8F0;
    margin: 0;
}

.event-status {
    color: #F59E0B;
    font-size: 0.82em;
    margin: 2px 0 0 0;
}

.event-completed .event-status {
    color: #22C55E;
}

.event-expired .event-status {
    color: #6B7280;
}

.event-description {
    color: #9CA3AF;
    font-size: 0.88em;
    margin-bottom: 12px;
    line-height: 1.5;
}

/* Founder Badge Claim Button */
.btn-event-claim {
    display: inline-block;
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-founder-claim {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: #1a1a2e;
    animation: founderPulse 2s ease-in-out infinite;
}

.btn-founder-claim:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(245,158,11,0.5);
}

@keyframes founderPulse {
    0%, 100% { box-shadow: 0 0 8px rgba(245,158,11,0.3); }
    50% { box-shadow: 0 0 20px rgba(245,158,11,0.6); }
}

/* 7-Day Challenge Grid */
.seven-day-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.seven-day-card {
    background: rgba(26,22,37,0.7);
    border: 1px solid rgba(192,132,252,0.15);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s;
    position: relative;
}

.seven-day-card.locked {
    opacity: 0.4;
    pointer-events: none;
}

.seven-day-card.completed {
    border-color: rgba(34,197,94,0.5);
    background: rgba(34,197,94,0.08);
}

.seven-day-card.claimed {
    border-color: rgba(34,197,94,0.3);
    background: rgba(34,197,94,0.05);
    opacity: 0.7;
}

.day-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.day-number {
    font-family: 'Cinzel', serif;
    font-size: 0.82em;
    color: #C084FC;
    font-weight: 600;
}

.day-star {
    width: 22px;
    height: 22px;
}

.day-title {
    font-size: 0.88em;
    color: #E2E8F0;
    margin: 4px 0;
}

.day-desc {
    font-size: 0.78em;
    color: #9CA3AF;
    margin-bottom: 6px;
}

.day-progress {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin: 6px 0 2px;
    overflow: hidden;
}

.day-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #C084FC, #F59E0B);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.day-progress-text {
    font-size: 0.72em;
    color: #9CA3AF;
}

.day-reward {
    font-size: 0.75em;
    color: #F59E0B;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.btn-claim-day {
    display: block;
    width: 100%;
    margin-top: 8px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
    font-size: 0.82em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    animation: claimPulse 2s ease-in-out infinite;
}

.btn-claim-day:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(34,197,94,0.5);
}

@keyframes claimPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(34,197,94,0.2); }
    50% { box-shadow: 0 0 12px rgba(34,197,94,0.5); }
}

/* Disciple Journey Missions */
.disciple-missions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.disciple-mission {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(26,22,37,0.5);
    border: 1px solid rgba(192,132,252,0.1);
    border-radius: 6px;
    transition: all 0.3s;
}

.disciple-mission.completed {
    border-color: rgba(34,197,94,0.4);
    background: rgba(34,197,94,0.08);
}

.disciple-mission.claimed {
    opacity: 0.6;
    border-color: rgba(34,197,94,0.2);
}

.mission-icon {
    font-size: 1.1em;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

.mission-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mission-name {
    font-size: 0.88em;
    color: #E2E8F0;
    font-weight: 500;
}

.mission-desc {
    font-size: 0.76em;
    color: #9CA3AF;
}

.btn-claim-mission {
    padding: 4px 14px;
    border: none;
    border-radius: 4px;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
    font-size: 0.78em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.btn-claim-mission:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(34,197,94,0.4);
}

/* Disciple Final Progress */
.disciple-final {
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.2);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    margin-top: 8px;
}

.disciple-final.claimed {
    background: rgba(34,197,94,0.08);
    border-color: rgba(34,197,94,0.3);
}

.disciple-final p {
    font-size: 0.85em;
    color: #CBD5E1;
    margin-top: 8px;
}

.disciple-progress {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
}

.disciple-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #F59E0B, #22C55E);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Player Badge & Title Display */
.player-badge-icon {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 4px;
}

.player-title-text {
    font-size: 0.72em;
    color: #F59E0B;
    font-style: italic;
}

/* Nav badge for Events */
.nav-badge-event {
    display: inline-block;
    background: #F59E0B;
    color: #1a1a2e;
    font-size: 0.6em;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 8px;
    margin-left: 4px;
    vertical-align: middle;
    animation: eventBadgePulse 2s ease-in-out infinite;
}

@keyframes eventBadgePulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; }
}

/* Mobile responsive events */
@media (max-width: 768px) {
    .seven-day-grid {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 8px;
    }
    
    .seven-day-card {
        padding: 10px 8px;
    }
    
    .event-section {
        padding: 12px;
    }
    
    .events-header h2 {
        font-size: 1.3em;
    }
    
    .event-banner-content {
        padding: 8px 12px;
    }
    
    .event-banner-text {
        font-size: 0.82em;
    }
}