/* =============================================
   Zarkhen RPG - Main Stylesheet
   Theme: Dark Red Gradient
   ============================================= */

/* Custom Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #3a3a3a 0%, #2a2a2a 100%);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4a4a4a 0%, #3a3a3a 100%);
}

/* Sidebar-specific scrollbar */
.nav::-webkit-scrollbar,
.nav-menu::-webkit-scrollbar {
    width: 6px;
}

.nav::-webkit-scrollbar-track,
.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav::-webkit-scrollbar-thumb,
.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.nav::-webkit-scrollbar-thumb:hover,
.nav-menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox Scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

/* CSS Variables */
:root {
    /* Base Colors - Pure Dark */
    --bg-primary: #080808;
    --bg-secondary: #0f0f0f;
    --bg-tertiary: #1a1a1a;
    --bg-card: linear-gradient(145deg, rgba(30, 30, 30, 0.9) 0%, rgba(15, 15, 15, 0.95) 100%);

    /* Text Colors */
    --text-primary: #f5f5f5;
    --text-secondary: #a3a3a3;
    --text-muted: #525252;

    /* Accent Red (Pure, no bordo) */
    --accent-red: #ef4444;
    --accent-red-dark: #b91c1c;
    --accent-red-glow: rgba(239, 68, 68, 0.4);
    --combat-primary: #ef4444;
    --combat-secondary: #dc2626;
    --combat-glow: rgba(239, 68, 68, 0.4);
    --combat-light: #f87171;

    /* Class Colors */
    --class-archer: #f97316;
    --class-mage: #8b5cf6;
    --class-warrior: #ef4444;
    --class-assassin: #64748b;

    /* Rarity Colors */
    --rarity-common: #9ca3af;
    --rarity-uncommon: #22c55e;
    --rarity-rare: #3b82f6;
    --rarity-epic: #a855f7;
    --rarity-legendary: #f59e0b;

    /* Accent Colors */
    --accent-gold: #fbbf24;
    --accent-success: #22c55e;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;
    --accent-primary: var(--accent-red);
    --accent-secondary: var(--accent-red-dark);

    /* Legacy compatibility -> Race Theme */
    --velias-primary: var(--accent-red);
    --velias-secondary: var(--combat-light);
    --velias-glow: var(--accent-red-glow);
    --nox-primary: #22c55e;
    --nox-secondary: #4ade80;
    --nox-glow: rgba(34, 197, 94, 0.4);

    /* Effects */
    --border-color: rgba(239, 68, 68, 0.12);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.6);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.7);
    --shadow-glow: 0 0 20px;
    --shadow-combat: 0 0 30px var(--accent-red-glow);
    --glass-blur: blur(12px);
    --glass-bg: rgba(20, 20, 20, 0.9);

    /* Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
}

/* Reset & Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    background-color: #080808;
    /* Fix bottom color mismatch */
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: auto;
    /* Revert to auto to allow desktop view scrolling */
    overscroll-behavior: none;
    /* Prevent bounce/slip */
    /* Allow scrolling from desktop mode */
    min-width: 1200px !important;
    /* Force desktop width */
}

/* Background Pattern - Combat Theme */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(220, 38, 38, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(153, 27, 27, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.3) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.25rem;
}

p {
    margin-bottom: var(--spacing-md);
}

a {
    color: var(--velias-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--velias-secondary);
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-lg);
}

/* Cards - Gradient with Glow Line */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
    transition: all var(--transition-normal);
}

/* Red glow line on top */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.6), transparent);
    transition: background var(--transition-normal);
}

.card:hover {
    border-color: rgba(239, 68, 68, 0.25);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.1);
    transform: translateY(-2px);
}

.card:hover::before {
    background: linear-gradient(90deg, transparent, rgba(239, 68, 68, 0.9), transparent);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

/* Buttons - Enhanced */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.96);
}

.btn:focus-visible {
    outline: 2px solid var(--accent-gold);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    animation: none;
}

.btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.6);
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-success {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
    border: 1px solid rgba(74, 222, 128, 0.5);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(34, 197, 94, 0.6);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: rgba(42, 21, 21, 0.8);
    color: var(--text-primary);
    border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: rgba(60, 30, 30, 0.9);
    border-color: rgba(220, 38, 38, 0.5);
}

.btn-glow {
    animation: btnGlow 2s ease-in-out infinite;
}

@keyframes btnGlow {

    0%,
    100% {
        box-shadow: 0 4px 15px rgba(220, 38, 38, 0.4);
    }

    50% {
        box-shadow: 0 4px 30px rgba(220, 38, 38, 0.7), 0 0 50px rgba(220, 38, 38, 0.3);
    }
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 1rem 2.5rem;
    font-size: 1.125rem;
}

.btn-block {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-secondary);
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--velias-primary);
    box-shadow: 0 0 0 3px var(--velias-glow);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Race Selection */
.race-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.race-option {
    position: relative;
    padding: var(--spacing-xl);
    background: var(--bg-card);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-xl);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-align: center;
}

.race-option:hover {
    transform: scale(1.02);
}

.race-option.velias:hover,
.race-option.velias.selected {
    border-color: var(--velias-primary);
    box-shadow: 0 0 30px var(--velias-glow);
}

.race-option.nox:hover,
.race-option.nox.selected {
    border-color: var(--nox-primary);
    box-shadow: 0 0 30px var(--nox-glow);
}

.race-option input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.race-avatar {
    width: 120px;
    height: 120px;
    margin: 0 auto var(--spacing-lg);
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    border: 3px solid var(--border-color);
}

.race-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.race-desc {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.race-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-md);
}

.race-stat {
    padding: 0.25rem 0.75rem;
    background: var(--bg-primary);
    border-radius: var(--radius-full);
    font-size: 0.75rem;
}

/* Stats Display */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.stat-value {
    font-weight: 700;
    font-size: 1.125rem;
}

/* Progress Bars - Legacy */
.progress {
    width: 100%;
    height: 10px;
    background: rgba(42, 21, 21, 0.8);
    border-radius: var(--radius-full);
    overflow: hidden;
    position: relative;
}

.progress-bar {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width var(--transition-normal);
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

.progress-health {
    background: linear-gradient(90deg, #ef4444, #22c55e);
}

.progress-energy {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.progress-exp {
    background: linear-gradient(90deg, #a855f7, #d946ef);
}

/* Clean Progress Bars */
.progress-tube {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.progress-tube-fill {
    height: 100%;
    border-radius: 5px;
    position: relative;
    transition: width 0.4s ease-out;
    overflow: hidden;
}

/* Subtle glass highlight on top */
.progress-tube-fill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 5px 5px 0 0;
}

/* Shine sweep animation */
.progress-tube-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shineSweep 3s ease-in-out infinite;
}

@keyframes shineSweep {
    0% {
        left: -50%;
    }

    50% {
        left: 150%;
    }

    100% {
        left: 150%;
    }
}

.tube-health {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.tube-energy {
    background: linear-gradient(90deg, #2563eb, #3b82f6);
    box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.tube-exp {
    background: linear-gradient(90deg, #d97706, #fbbf24);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.4);
}

/* Low value pulse - subtle */
.progress-tube.low .progress-tube-fill {
    animation: lowPulse 2s ease-in-out infinite;
}

@keyframes lowPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

/* Bubble particles - hidden */
.bubble-particles,
.bubble-particles span {
    display: none;
}

/* Player List */
.player-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.player-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.player-item:hover {
    background: var(--bg-secondary);
}

.player-item.velias {
    border-left: 3px solid var(--velias-primary);
}

.player-item.nox {
    border-left: 3px solid var(--nox-primary);
}

.player-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-primary);
}

.player-info {
    flex: 1;
}

.player-name {
    font-weight: 600;
}

.player-details {
    display: flex;
    gap: var(--spacing-md);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Inventory Items */
.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.item-card {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.item-card.equipped {
    border-color: var(--accent-gold);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.item-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
}

.item-info {
    flex: 1;
}

.item-name {
    font-weight: 600;
}

.item-name.common {
    color: var(--rarity-common);
}

.item-name.uncommon {
    color: var(--rarity-uncommon);
}

.item-name.rare {
    color: var(--rarity-rare);
}

.item-name.epic {
    color: var(--rarity-epic);
}

.item-name.legendary {
    color: var(--rarity-legendary);
}

.item-stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Battle Log */
.battle-log {
    max-height: 300px;
    overflow-y: auto;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
}

.battle-log-entry {
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.battle-log-entry:last-child {
    border-bottom: none;
}

.battle-log-entry.critical {
    color: var(--accent-gold);
    font-weight: 600;
}

.battle-log-entry.win {
    color: var(--accent-success);
}

.battle-log-entry.lose {
    color: var(--accent-danger);
}

/* Navigation - Left Sidebar */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 220px;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    /* Deep black/dark */
    border-right: 1px solid var(--border-color);
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    z-index: 2000;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1001;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: var(--spacing-sm);
}

.nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 0;
}

.nav-logo {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ff1a1a, #990000);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px rgba(255, 0, 0, 0.4);
    padding: 2rem 1rem;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    letter-spacing: 1px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    padding: 1.5rem 1rem;
    flex: 1;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: 0.85rem 1rem;
    color: var(--text-secondary);
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
    /* Permanent Red Box Style */
    border: 1px solid rgba(220, 38, 38, 0.25);
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.05), transparent);
    cursor: pointer;
}

.nav-link:hover {
    color: #fff;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.15), transparent);
    border-color: rgba(220, 38, 38, 0.5);
    transform: translateX(5px);
    box-shadow: -5px 0 15px rgba(220, 38, 38, 0.15);
}

.nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.25), transparent);
    border: 1px solid rgba(220, 38, 38, 0.8);
    box-shadow: 0 0 20px rgba(220, 38, 38, 0.3);
    font-weight: 600;
}

.nav-user {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.3);
    margin-top: auto;
}

.nav-gold {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--accent-gold);
    font-weight: 700;
    justify-content: center;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.nav-user .btn {
    width: 100%;
}

/* Page Layout - Adjusted for Sidebar */
.page {
    margin-left: 220px;
    padding: var(--spacing-lg);
    padding-bottom: var(--spacing-xl);
    min-height: 100vh;
}

.page-header {
    margin-bottom: var(--spacing-xl);
}

.page-title {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.page-subtitle {
    color: var(--text-secondary);
}

/* Grid Layout */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Auth Page */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-xl);
    background: url('../img/bg-hero.png') no-repeat center center;
    background-size: cover;
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 0;
}

.auth-page>* {
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

/* Logo Styles */
.logo-container {
    position: relative;
    display: inline-block;
}

.logo-fire {
    max-width: 300px;
    animation: logoFloat 6s ease-in-out infinite;
    filter: drop-shadow(0 0 10px rgba(255, 69, 0, 0.6)) drop-shadow(0 0 20px rgba(255, 0, 0, 0.4)) drop-shadow(0 0 30px rgba(255, 140, 0, 0.2));
}

.logo-fire:hover {
    filter: drop-shadow(0 0 15px rgba(255, 69, 0, 0.8)) drop-shadow(0 0 30px rgba(255, 0, 0, 0.6)) drop-shadow(0 0 45px rgba(255, 140, 0, 0.4));
    transform: scale(1.02);
    transition: all 0.3s ease;
}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.auth-logo {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.auth-logo h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--velias-primary), var(--nox-primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-tabs {
    display: flex;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.auth-tab {
    flex: 1;
    padding: var(--spacing-md);
    background: var(--bg-tertiary);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.auth-tab.active {
    background: var(--velias-primary);
    color: white;
}

/* Alerts & Messages */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
}

.alert-success {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid var(--accent-success);
    color: var(--accent-success);
}

.alert-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid var(--accent-warning);
    color: var(--accent-warning);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.animate-fadeIn {
    animation: fadeIn 0.5s ease;
}

.animate-slideUp {
    animation: slideUp 0.5s ease;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Responsive */
@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }

    .race-selection {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    /* Mobile Sidebar - Collapsed */
    .nav {
        width: 60px;
        overflow: hidden;
    }

    .nav-logo {
        font-size: 1.2rem;
        padding: 1rem 0.5rem;
        white-space: nowrap;
        overflow: hidden;
    }

    .nav-menu {
        padding: 0.5rem 0.25rem;
    }

    .nav-link {
        padding: 0.75rem 0.5rem;
        justify-content: center;
        font-size: 1.2rem;
    }

    .nav-link span:last-child {
        display: none;
    }

    .nav-user {
        padding: 0.5rem;
    }

    .nav-gold {
        font-size: 0.75rem;
    }

    .nav-user .btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    /* Page adjusts */
    .page {
        margin-left: 60px;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .container {
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 400px) {

    /* Hide sidebar completely on very small screens */
    .nav {
        display: none;
    }

    .page {
        margin-left: 0;
    }

    /* Scale Inventory for very small screens */
    .equipment-container {
        transform: scale(0.85);
        transform-origin: top center;
        margin-bottom: -50px;
    }
}

/* --- ITEM GLOW EFFECTS --- */
@keyframes iceGlow {
    0% {
        box-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff inset;
        border-color: #00ffff;
    }

    50% {
        box-shadow: 0 0 20px #00ffff, 0 0 15px #00aaff inset;
        border-color: #fff;
    }

    100% {
        box-shadow: 0 0 5px #00ffff, 0 0 10px #00ffff inset;
        border-color: #00ffff;
    }
}

@keyframes fireGlow {
    0% {
        box-shadow: 0 0 5px #ff0000, 0 0 10px #ff4500 inset;
        border-color: #ff0000;
    }

    50% {
        box-shadow: 0 0 20px #ff0000, 0 0 15px #ff8800 inset;
        border-color: #ffff00;
    }

    100% {
        box-shadow: 0 0 5px #ff0000, 0 0 10px #ff4500 inset;
        border-color: #ff0000;
    }
}

.glow-ice {
    animation: iceGlow 1.5s infinite alternate;
    border: 1px solid #00ffff !important;
}

.glow-fire {
    animation: fireGlow 1.0s infinite alternate;
    border: 1px solid #ff0000 !important;
}

/* Message Notification Glow - Static (no animation) */
.msg-notify {
    position: relative;
    text-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444, 0 0 30px #ef4444 !important;
    color: #ff6b6b !important;
}

.msg-notify::after {
    content: '';
    position: absolute;
    top: -3px;
    right: -8px;
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444, 0 0 12px #ef4444;
}

/* Fire Glow Animation */
.text-glow-fire {
    color: #ff4500;
    animation: firePulse 1.5s infinite alternate;
    font-weight: 800;
    letter-spacing: 0.5px;
}

@keyframes firePulse {
    0% {
        text-shadow: 0 0 2px #ff0000;
        color: #ff4500;
    }

    100% {
        text-shadow: 0 0 10px #ff0000, 0 0 20px #ff8c00;
        color: #ffeb3b;
    }
}

/* =============================================
   Chat Widget
   ============================================= */
#zarkhen-chat-root {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button */
.chat-widget-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.chat-widget-btn.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-icon {
    font-size: 1.8rem;
    color: white;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    animation: bounceIn 0.3s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #1e1e24;
    /* Dark refined background */
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.chat-header-title {
    font-weight: 700;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-close-btn:hover {
    color: white;
}

/* Body */
.chat-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #121216;
}

.chat-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    background: #121216;
}

.chat-view.active {
    transform: translateX(0);
}

/* Conversations List */
.chat-search-bar {
    padding: 0.75rem;
    border-bottom: 1px solid #2a2a35;
}

.chat-search-bar input {
    width: 100%;
    background: #1e1e24;
    border: 1px solid #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.chat-search-bar input:focus {
    border-color: #3b82f6;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-conv-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #1e1e24;
    gap: 1rem;
}

.chat-conv-item:hover {
    background: #1e1e24;
}

.chat-conv-item.unread {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: #2a2a35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-conv-info {
    flex: 1;
    min-width: 0;
}

.chat-conv-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.chat-conv-preview {
    font-size: 0.75rem;
    color: #94a3b8;
}

.chat-unread-badge {
    background: #3b82f6;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Message View */
.chat-user-bar {
    padding: 0.75rem;
    background: #1a1a2e;
    border-bottom: 1px solid #2a2a35;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-weight: 600;
}

.chat-back-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-msg.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg.received {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg.sent .chat-bubble {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-msg.received .chat-bubble {
    background: #2a2a35;
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.chat-time {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 2px;
}

.chat-input-area {
    padding: 0.75rem;
    border-top: 1px solid #2a2a35;
    display: flex;
    gap: 0.5rem;
    background: #1e1e24;
}

#chat-input {
    flex: 1;
    background: #121216;
    border: 1px solid #333;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

#chat-send-btn {
    background: #3b82f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-loading,
.chat-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
    font-size: 0.9rem;
}

/* Responsive */
/* Mobile view disabled */

/* =============================================
   Chat Widget
   ============================================= */
#zarkhen-chat-root {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    font-family: 'Inter', sans-serif;
}

/* Toggle Button */
.chat-widget-btn {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.chat-widget-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.6);
}

.chat-widget-btn.hidden {
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.chat-icon {
    font-size: 1.8rem;
    color: white;
}

.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    min-width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    animation: bounceIn 0.3s;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }

    80% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Chat Window */
.chat-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: #1e1e24;
    /* Dark refined background */
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform-origin: bottom right;
    transform: scale(0);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    pointer-events: none;
}

.chat-window.active {
    transform: scale(1);
    opacity: 1;
    pointer-events: all;
}

/* Header */
.chat-header {
    background: linear-gradient(90deg, #1a1a2e, #16213e);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #333;
}

.chat-header-title {
    font-weight: 700;
    color: white;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-close-btn {
    background: none;
    border: none;
    color: #999;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.chat-close-btn:hover {
    color: white;
}

/* Body */
.chat-body {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: #121216;
}

.chat-view {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    background: #121216;
}

.chat-view.active {
    transform: translateX(0);
}

/* Conversations List */
.chat-search-bar {
    padding: 0.75rem;
    border-bottom: 1px solid #2a2a35;
}

.chat-search-bar input {
    width: 100%;
    background: #1e1e24;
    border: 1px solid #333;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

.chat-search-bar input:focus {
    border-color: #3b82f6;
}

.chat-list {
    flex: 1;
    overflow-y: auto;
}

.chat-conv-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #1e1e24;
    gap: 1rem;
}

.chat-conv-item:hover {
    background: #1e1e24;
}

.chat-conv-item.unread {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid #3b82f6;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    background: #2a2a35;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.chat-conv-info {
    flex: 1;
    min-width: 0;
}

.chat-conv-name {
    font-weight: 600;
    color: #e2e8f0;
    font-size: 0.95rem;
}

.chat-conv-preview {
    font-size: 0.75rem;
    color: #94a3b8;
}

.chat-unread-badge {
    background: #3b82f6;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
}

/* Message View */
.chat-user-bar {
    padding: 0.75rem;
    background: #1a1a2e;
    border-bottom: 1px solid #2a2a35;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
    font-weight: 600;
}

.chat-back-btn {
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 1.2rem;
    cursor: pointer;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    display: flex;
    flex-direction: column;
    max-width: 80%;
}

.chat-msg.sent {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg.received {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 0.6rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

.chat-msg.sent .chat-bubble {
    background: #3b82f6;
    color: white;
    border-bottom-right-radius: 2px;
}

.chat-msg.received .chat-bubble {
    background: #2a2a35;
    color: #e2e8f0;
    border-bottom-left-radius: 2px;
}

.chat-time {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 2px;
}

.chat-input-area {
    padding: 0.75rem;
    border-top: 1px solid #2a2a35;
    display: flex;
    gap: 0.5rem;
    background: #1e1e24;
}

#chat-input {
    flex: 1;
    background: #121216;
    border: 1px solid #333;
    padding: 0.6rem 1rem;
    border-radius: 20px;
    color: white;
    font-size: 0.9rem;
    outline: none;
}

#chat-send-btn {
    background: #3b82f6;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-loading,
.chat-empty {
    text-align: center;
    color: #94a3b8;
    padding: 2rem;
    font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 480px) {
    .chat-window {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
}

/* =============================================
   Legendary Upgrade Effects
   ============================================= */

/* Processing: Yellow/Gold Pulse */
@keyframes legendaryProcessing {
    0% {
        box-shadow: 0 0 10px #f59e0b, 0 0 20px #f59e0b, inset 0 0 10px #f59e0b;
        border-color: #fbbf24;
    }

    50% {
        box-shadow: 0 0 25px #fbbf24, 0 0 50px #fbbf24, inset 0 0 20px #fbbf24;
        border-color: #fff;
    }

    100% {
        box-shadow: 0 0 10px #f59e0b, 0 0 20px #f59e0b, inset 0 0 10px #f59e0b;
        border-color: #fbbf24;
    }
}

.glow-processing {
    animation: legendaryProcessing 1.5s infinite ease-in-out !important;
    border: 2px solid #fbbf24 !important;
    position: relative;
    z-index: 10;
}


@keyframes barProcessing {
    0% {
        background-position: 0% 50%;
        box-shadow: 0 0 10px #f59e0b;
    }

    50% {
        background-position: 100% 50%;
        box-shadow: 0 0 25px #fbbf24, 0 0 10px #f59e0b inset;
    }

    100% {
        background-position: 0% 50%;
        box-shadow: 0 0 10px #f59e0b;
    }
}

.glow-line-processing {
    background: linear-gradient(270deg, #f59e0b, #fbbf24, #d97706, #fbbf24) !important;
    background-size: 200% 200% !important;
    animation: barProcessing 1s ease infinite !important;
    box-shadow: 0 0 20px #f59e0b !important;
    height: 100% !important;
}

/* Success: Green/Emerald Legendary Burst */
@keyframes legendarySuccess {
    0% {
        box-shadow: 0 0 20px #22c55e, 0 0 40px #22c55e;
        transform: scale(1);
        border-color: #22c55e;
    }

    50% {
        box-shadow: 0 0 60px #4ade80, 0 0 100px #22c55e, inset 0 0 30px #4ade80;
        transform: scale(1.05);
        border-color: #fff;
    }

    100% {
        box-shadow: 0 0 20px #22c55e, 0 0 40px #22c55e;
        transform: scale(1);
        border-color: #22c55e;
    }
}

.glow-success {
    animation: legendarySuccess 2s ease-in-out infinite !important;
    /* Pulse even after done for a bit */
    border: 2px solid #4ade80 !important;
    z-index: 11;
}

@keyframes barSuccess {
    0% {
        box-shadow: 0 0 20px #22c55e;
        filter: brightness(1);
    }

    50% {
        box-shadow: 0 0 50px #4ade80, 0 0 20px #fff inset;
        filter: brightness(1.3);
    }

    100% {
        box-shadow: 0 0 20px #22c55e;
        filter: brightness(1);
    }
}

.glow-line-success {
    background: linear-gradient(90deg, #22c55e, #86efac, #16a34a) !important;
    background-size: 200% 200% !important;
    animation: barSuccess 1.5s ease-in-out infinite !important;
    box-shadow: 0 0 40px #22c55e !important;
}

/* Failure: Red/Crimson Legendary Impact */
@keyframes legendaryFailure {
    0% {
        box-shadow: 0 0 10px #dc2626;
        transform: translateX(0);
        border-color: #dc2626;
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    50% {
        box-shadow: 0 0 50px #ef4444, inset 0 0 30px #991b1b;
        border-color: #fff;
        /* Flash white */
    }

    60% {
        transform: translateX(-5px);
    }

    80% {
        transform: translateX(5px);
    }

    100% {
        box-shadow: 0 0 10px #dc2626;
        transform: translateX(0);
        border-color: #dc2626;
    }
}

.glow-failure {
    animation: legendaryFailure 0.5s ease-in-out !important;
    border: 2px solid #ef4444 !important;
    z-index: 11;
}

@keyframes barFailure {

    0%,
    100% {
        background-color: #dc2626;
        box-shadow: 0 0 20px #dc2626;
    }

    50% {
        background-color: #ef4444;
        box-shadow: 0 0 50px #ef4444, inset 0 0 20px #7f1d1d;
    }
}

.glow-line-failure {
    background: linear-gradient(90deg, #dc2626, #991b1b, #ef4444) !important;
    background-size: 200% 200% !important;
    animation: barFailure 0.5s ease-in-out infinite !important;
    box-shadow: 0 0 30px #dc2626 !important;
}

/* Beam Effect for Upgrade Bar */
@keyframes beamMove {
    0% {
        left: -50%;
        opacity: 0;
    }

    50% {
        opacity: 1;
    }

    100% {
        left: 150%;
        opacity: 0;
    }
}

.glow-line-processing,
.glow-line-success,
.glow-line-failure {
    position: relative;
    overflow: hidden;
}

.glow-line-processing::after,
.glow-line-success::after,
.glow-line-failure::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
    transform: skewX(-20deg);
    filter: blur(5px);
    animation: beamMove 1.5s infinite linear;
    pointer-events: none;
}

/* Specific Beam Colors/Intensities */
.glow-line-processing::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.9), transparent);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
    animation-duration: 1s;
    /* Faster for processing */
}

.glow-line-success::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 1), transparent);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.8);
    animation-duration: 2s;
    /* Slower, majestic */
}

.glow-line-failure::after {
    background: linear-gradient(90deg, transparent, rgba(255, 100, 100, 0.8), transparent);
    animation-duration: 0.5s;
    /* Violent fast flash */
}

/* Inventory Item Quantity Badge */
.inv-item {
    position: relative !important;
    /* Ensure relative positioning for badge */
}

.qty-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffd700;
    /* Gold text */
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

/* =============================================
   Floating Particles Animation (Login Page)
   ============================================= */

.particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* Increased z-index to be above background */
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    bottom: -20px;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.8) 0%, rgba(239, 68, 68, 0.2) 60%, transparent 100%);
    border-radius: 50%;
    animation: particleRise linear infinite;
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.6), 0 0 20px rgba(239, 68, 68, 0.3);
}

@keyframes particleRise {
    0% {
        bottom: -20px;
        opacity: 0;
        transform: translateX(0) scale(0.5);
    }

    10% {
        opacity: 1;
        transform: translateX(-10px) scale(1);
    }

    30% {
        transform: translateX(10px) scale(0.8);
    }

    50% {
        transform: translateX(-5px) scale(1.1);
    }

    70% {
        transform: translateX(8px) scale(0.9);
        opacity: 0.8;
    }

    90% {
        opacity: 0.3;
        transform: translateX(-3px) scale(0.6);
    }

    100% {
        bottom: 110%;
        opacity: 0;
        transform: translateX(0) scale(0.3);
    }
}

/* Particle variations */
.particle:nth-child(1) {
    left: 5%;
    animation-duration: 8s;
    animation-delay: 0s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(2) {
    left: 12%;
    animation-duration: 10s;
    animation-delay: 1s;
    width: 6px;
    height: 6px;
}

.particle:nth-child(3) {
    left: 20%;
    animation-duration: 7s;
    animation-delay: 0.5s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(4) {
    left: 28%;
    animation-duration: 9s;
    animation-delay: 2s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(5) {
    left: 35%;
    animation-duration: 11s;
    animation-delay: 0.3s;
    width: 7px;
    height: 7px;
}

.particle:nth-child(6) {
    left: 42%;
    animation-duration: 8s;
    animation-delay: 1.5s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(7) {
    left: 50%;
    animation-duration: 10s;
    animation-delay: 0.8s;
    width: 6px;
    height: 6px;
}

.particle:nth-child(8) {
    left: 58%;
    animation-duration: 7s;
    animation-delay: 2.5s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(9) {
    left: 65%;
    animation-duration: 9s;
    animation-delay: 1.2s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(10) {
    left: 72%;
    animation-duration: 12s;
    animation-delay: 0.7s;
    width: 6px;
    height: 6px;
}

.particle:nth-child(11) {
    left: 80%;
    animation-duration: 8s;
    animation-delay: 1.8s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(12) {
    left: 88%;
    animation-duration: 10s;
    animation-delay: 0.4s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(13) {
    left: 95%;
    animation-duration: 9s;
    animation-delay: 2.2s;
    width: 6px;
    height: 6px;
}

.particle:nth-child(14) {
    left: 8%;
    animation-duration: 11s;
    animation-delay: 3s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(15) {
    left: 25%;
    animation-duration: 7s;
    animation-delay: 1.7s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(16) {
    left: 45%;
    animation-duration: 9s;
    animation-delay: 2.8s;
    width: 7px;
    height: 7px;
}

.particle:nth-child(17) {
    left: 62%;
    animation-duration: 10s;
    animation-delay: 0.2s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(18) {
    left: 78%;
    animation-duration: 8s;
    animation-delay: 1.3s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(19) {
    left: 33%;
    animation-duration: 12s;
    animation-delay: 0.9s;
    width: 6px;
    height: 6px;
}

.particle:nth-child(20) {
    left: 55%;
    animation-duration: 9s;
    animation-delay: 2.1s;
    width: 5px;
    height: 5px;
}

/* Sidebar User Section (Premium Style) */
.nav-user {
    margin-top: auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-balance-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.nav-balance-card:hover {
    transform: translateX(5px);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.nav-balance-card.gold {
    border-color: rgba(251, 191, 36, 0.2);
}

.nav-balance-card.gold:hover {
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.15);
}

.nav-balance-card.crystal {
    border-color: rgba(168, 85, 247, 0.2);
}

.nav-balance-card.crystal:hover {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.balance-icon {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.balance-info {
    display: flex;
    flex-direction: column;
}

.balance-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
}

.balance-value {
    font-family: 'Cinzel', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.nav-balance-card.gold .balance-value {
    color: #fbbf24;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.3);
}

.nav-balance-card.crystal .balance-value {
    color: #a855f7;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.logout-btn {
    margin-top: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.logout-btn:hover {
    opacity: 1;
}

/* Mobile Grid Stacking */
/* Mobile Grid Removed */

/* Item Icons - Global Safe Style */
.item-img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Ensure containers have strict centering */
.item-icon,
.equip-icon,
#modal-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    /* Critical for containment */
}

/* Specific Modal Icon Sizing */
#modal-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
    font-size: 3.5rem;
    /* Fallback for emoji */
}

/* Specific Equip Icon Sizing fix */
.equip-icon {
    width: 100%;
    height: 100%;
}