/* =========================================
   EonOnline - Game CSS
   ========================================= */

/* === BASE === */
:root {
    --gold: #d4a843;
    --gold-light: #f0d078;
    --gold-dark: #a07820;
    --dark-900: #0a0a0f;
    --dark-800: #12121a;
    --dark-700: #1a1a2e;
    --dark-600: #252540;
    --health: #2ecc71;
    --mana: #1e90ff;
    --xp: #a855f7;
    --blood: #8b0000;
}

* { box-sizing: border-box; }

body {
    background: var(--dark-900);
    background-image:
        radial-gradient(ellipse at 20% 50%, rgba(212,168,67,0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(30,144,255,0.02) 0%, transparent 50%);
}

/* === BUTTONS === */
.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: var(--dark-900);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-primary:hover {
    box-shadow: 0 0 20px rgba(212,168,67,0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--dark-600);
    color: var(--gold);
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--gold-dark);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.btn-secondary:hover {
    background: var(--dark-500, #2d2d4a);
    border-color: var(--gold);
}

.btn-danger {
    background: linear-gradient(135deg, #dc2626, #991b1b);
    color: white;
    font-weight: 600;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-danger:hover {
    box-shadow: 0 0 20px rgba(220,38,38,0.3);
}

/* === NAV LINKS === */
.nav-link {
    color: #9ca3af;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
}
.nav-link:hover {
    color: var(--gold);
    background: rgba(212,168,67,0.1);
}

/* === BARS (HP, MP, XP) === */
.bar-container {
    height: 20px;
    background: var(--dark-700);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--dark-600);
}
.bar-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}
.bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.15), transparent);
    border-radius: 10px 10px 0 0;
}
.bar-hp .bar-fill { background: linear-gradient(90deg, #16a34a, #2ecc71); }
.bar-mp .bar-fill { background: linear-gradient(90deg, #2563eb, #1e90ff); }
.bar-xp .bar-fill { background: linear-gradient(90deg, #7c3aed, #a855f7); }
.bar-enemy .bar-fill { background: linear-gradient(90deg, #dc2626, #ef4444); }
.bar-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    z-index: 1;
}

/* === CARDS === */
.game-card {
    background: linear-gradient(145deg, var(--dark-800), var(--dark-700));
    border: 1px solid var(--dark-600);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s;
}
.game-card:hover {
    border-color: rgba(212,168,67,0.3);
    box-shadow: 0 0 30px rgba(212,168,67,0.05);
}
.game-card-highlight {
    border-color: var(--gold-dark);
    box-shadow: 0 0 20px rgba(212,168,67,0.1);
}

/* === RARITY COLORS === */
.rarity-common { color: #9ca3af; border-color: #4b5563; }
.rarity-uncommon { color: #22c55e; border-color: #16a34a; }
.rarity-rare { color: #3b82f6; border-color: #2563eb; }
.rarity-epic { color: #a855f7; border-color: #9333ea; }
.rarity-legendary { color: #f59e0b; border-color: #d97706; }
.rarity-mythic { color: #ef4444; border-color: #dc2626; }
.rarity-ancestral { color: #f97316; border-color: #ea580c; }

.bg-rarity-common { background: rgba(156,163,175,0.1); border: 1px solid #4b5563; }
.bg-rarity-uncommon { background: rgba(34,197,94,0.1); border: 1px solid #16a34a; }
.bg-rarity-rare { background: rgba(59,130,246,0.1); border: 1px solid #2563eb; }
.bg-rarity-epic { background: rgba(168,85,247,0.1); border: 1px solid #9333ea; }
.bg-rarity-legendary { background: rgba(245,158,11,0.1); border: 1px solid #d97706; }
.bg-rarity-mythic { background: rgba(239,68,68,0.1); border: 1px solid #dc2626; }

/* === ITEM SLOT === */
.item-slot {
    width: 64px;
    height: 64px;
    background: var(--dark-700);
    border: 2px solid var(--dark-600);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    font-size: 24px;
}
.item-slot:hover {
    border-color: var(--gold);
    box-shadow: 0 0 10px rgba(212,168,67,0.2);
}
.item-slot.equipped {
    border-color: var(--gold);
    background: rgba(212,168,67,0.1);
}
.item-slot .item-icon {
    font-size: 1.5rem;
}

/* === COMBAT === */
.combat-arena {
    background: linear-gradient(180deg, #0a0a0f 0%, #12121a 50%, #1a1a2e 100%);
    border: 2px solid var(--dark-600);
    border-radius: 1rem;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}
.combat-arena::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 80%, rgba(139,0,0,0.1), transparent 70%);
    pointer-events: none;
}

.combat-entity {
    text-align: center;
    padding: 1rem;
}
.combat-entity .sprite {
    font-size: 4rem;
    filter: drop-shadow(0 0 10px rgba(0,0,0,0.5));
}
.combat-entity.player .sprite { filter: drop-shadow(0 0 10px rgba(212,168,67,0.3)); }
.combat-entity.enemy .sprite { filter: drop-shadow(0 0 10px rgba(239,68,68,0.3)); }

/* === DAMAGE POPUP === */
.damage-popup {
    position: absolute;
    font-weight: 900;
    font-size: 1.5rem;
    animation: floatUp 1.2s ease-out forwards;
    pointer-events: none;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    z-index: 50;
}
.damage-popup.crit { font-size: 2rem; color: #f59e0b; }
.damage-popup.heal { color: #2ecc71; }
.damage-popup.miss { color: #6b7280; font-size: 1rem; }

@keyframes floatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    50% { opacity: 1; transform: translateY(-40px) scale(1.1); }
    100% { opacity: 0; transform: translateY(-80px) scale(0.8); }
}

/* === FLASH MESSAGE === */
.flash-message {
    animation: slideDown 0.3s ease;
}
.flash-success { background: rgba(34,197,94,0.1); border-color: #16a34a; color: #86efac; }
.flash-error { background: rgba(239,68,68,0.1); border-color: #dc2626; color: #fca5a5; }
.flash-info { background: rgba(59,130,246,0.1); border-color: #2563eb; color: #93c5fd; }
.flash-warning { background: rgba(245,158,11,0.1); border-color: #d97706; color: #fcd34d; }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === DUNGEON CARD === */
.dungeon-card {
    background: linear-gradient(145deg, var(--dark-800), var(--dark-700));
    border: 1px solid var(--dark-600);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s;
    cursor: pointer;
}
.dungeon-card:hover {
    transform: translateY(-4px);
    border-color: var(--gold-dark);
    box-shadow: 0 10px 40px rgba(0,0,0,0.3), 0 0 20px rgba(212,168,67,0.1);
}
.dungeon-card .dungeon-img {
    height: 160px;
    background: linear-gradient(135deg, var(--dark-700), var(--dark-600));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

/* === DIFFICULTY BADGES === */
.difficulty-normal { color: #9ca3af; }
.difficulty-hard { color: #3b82f6; }
.difficulty-nightmare { color: #a855f7; }
.difficulty-inferno { color: #ef4444; }
.difficulty-abyss { color: #f97316; }

/* === SCROLLBAR === */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--dark-900); }
::-webkit-scrollbar-thumb { background: var(--dark-600); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--dark-500, #2d2d4a); }

/* === TOOLTIP === */
.tooltip {
    position: relative;
}
.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-700);
    color: #e5e7eb;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    border: 1px solid var(--dark-600);
    transition: opacity 0.2s;
    z-index: 100;
    pointer-events: none;
}
.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* === LOADING SPINNER === */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dark-600);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === STAT BONUS === */
.stat-positive { color: #22c55e; }
.stat-negative { color: #ef4444; }
.stat-neutral { color: #9ca3af; }

/* === SELECTION / RACE CARD === */
.race-card {
    background: var(--dark-800);
    border: 2px solid var(--dark-600);
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}
.race-card:hover {
    border-color: var(--gold-dark);
    transform: translateY(-2px);
}
.race-card.selected {
    border-color: var(--gold);
    box-shadow: 0 0 30px rgba(212,168,67,0.2);
    background: rgba(212,168,67,0.05);
}
.race-card .race-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .item-slot { width: 52px; height: 52px; font-size: 18px; }
    .bar-container { height: 16px; }
    .combat-entity .sprite { font-size: 3rem; }
}
