:root {
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --primary: #4f46e5;
    --secondary: #ec4899;
    --accent: #6366f1;
}

body {
    font-family: 'Space Grotesk', sans-serif;
    background-color: #0f172a;
    color: white;
    overflow-x: hidden;
    margin: 0;
}

/* --- Background Animation --- */
.stars-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(ellipse at bottom, #1B2735 0%, #090A0F 100%);
    overflow: hidden;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--duration) infinite ease-in-out;
    opacity: 0;
}

@keyframes twinkle {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1.2);
    }

    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
}

/* --- Glassmorphism --- */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: 0 10px 30px -10px rgba(99, 102, 241, 0.3);
}

/* --- Modern Hall of Fame (Neon Upgrade) --- */
.hof-container {
    perspective: 1000px;
}

.podium-base {
    position: relative;
    backdrop-filter: blur(20px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: center;
    padding-top: 1rem;
    overflow: hidden;
}

/* Rank 1: Gold/Sun */
.podium-1 {
    background: linear-gradient(180deg, rgba(234, 179, 8, 0.15) 0%, rgba(234, 179, 8, 0.05) 100%);
    border-top: 4px solid #eab308;
    box-shadow: 0 0 50px rgba(234, 179, 8, 0.2), inset 0 0 20px rgba(234, 179, 8, 0.1);
}

.avatar-glow-1 {
    filter: drop-shadow(0 0 15px rgba(234, 179, 8, 0.6));
    animation: pulse-gold 3s infinite;
}

/* Rank 2: Silver/Moon */
.podium-2 {
    background: linear-gradient(180deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.05) 100%);
    border-top: 4px solid #94a3b8;
    box-shadow: 0 0 30px rgba(148, 163, 184, 0.2), inset 0 0 10px rgba(148, 163, 184, 0.1);
}

.avatar-glow-2 {
    filter: drop-shadow(0 0 10px rgba(148, 163, 184, 0.5));
}

/* Rank 3: Bronze/Earth */
.podium-3 {
    background: linear-gradient(180deg, rgba(249, 115, 22, 0.15) 0%, rgba(249, 115, 22, 0.05) 100%);
    border-top: 4px solid #f97316;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.1), inset 0 0 10px rgba(249, 115, 22, 0.05);
}

.avatar-glow-3 {
    filter: drop-shadow(0 0 10px rgba(249, 115, 22, 0.4));
}

/* Spotlight Effect */
.spotlight {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 100px;
    background: radial-gradient(ellipse at bottom, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Animations */
.float {
    animation: float 6s ease-in-out infinite;
}

.float-delayed {
    animation: float 6s ease-in-out 3s infinite;
}

@keyframes float {

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

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

@keyframes pulse-gold {

    0%,
    100% {
        filter: drop-shadow(0 0 15px rgba(234, 179, 8, 0.6));
    }

    50% {
        filter: drop-shadow(0 0 25px rgba(234, 179, 8, 0.9));
    }
}

.crown-anim {
    animation: float 4s ease-in-out infinite, shine-crown 3s infinite;
}

@keyframes shine-crown {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.3);
    }
}

/* Clean up old animations */
.fade-in-item {
    animation: fadeIn 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

/* Character Animations */
.character-jump {
    animation: jump 2s ease-in-out infinite;
}

@keyframes jump {

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

    30% {
        transform: translateY(-20px) scale(1.05);
    }

    50% {
        transform: translateY(-30px) scale(1.1) rotate(-5deg);
    }

    70% {
        transform: translateY(-20px) scale(1.05);
    }
}

.character-clap {
    animation: clap 3s ease-in-out infinite;
}

@keyframes clap {

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

    10%,
    30% {
        transform: scale(1.1) rotate(-3deg);
    }

    20%,
    40% {
        transform: scale(1.1) rotate(3deg);
    }
}

.character-wobble {
    animation: wobble 4s ease-in-out infinite;
}

@keyframes wobble {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-2deg);
    }

    75% {
        transform: rotate(2deg);
    }
}

/* Confetti Particles */
.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: linear-gradient(45deg, #fbbf24, #f59e0b);
    animation: confetti-fall 3s ease-out infinite;
    opacity: 0;
}

.confetti:nth-child(2n) {
    background: linear-gradient(45deg, #ec4899, #db2777);
}

.confetti:nth-child(3n) {
    background: linear-gradient(45deg, #8b5cf6, #7c3aed);
}

.confetti:nth-child(4n) {
    background: linear-gradient(45deg, #3b82f6, #2563eb);
}

@keyframes confetti-fall {
    0% {
        top: -10%;
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }

    100% {
        top: 100%;
        opacity: 0;
        transform: translateX(var(--x-offset, 50px)) rotate(720deg);
    }
}

/* Sparkle Effect */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: sparkle-twinkle 2s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

@keyframes sparkle-twinkle {

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

    50% {
        opacity: 1;
        transform: scale(1.5);
    }
}


@keyframes shake {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

.shake-anim {
    animation: shake 0.5s ease-in-out infinite;
}

/* --- Scan Line for AI --- */
@keyframes scan {
    0% {
        top: 0%;
        opacity: 0;
    }

    10% {
        opacity: 1;
    }

    90% {
        opacity: 1;
    }

    100% {
        top: 100%;
        opacity: 0;
    }
}

.scan-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: #06b6d4;
    box-shadow: 0 0 10px #06b6d4, 0 0 20px #06b6d4;
    animation: scan 2s linear infinite;
    z-index: 10;
}

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

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

/* --- Form Elements --- */
.glass-input,
.glass-select {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    outline: none;
    transition: all 0.2s;
}

.glass-input:focus,
.glass-select:focus {
    border-color: var(--accent);
    background: rgba(15, 23, 42, 0.8);
}

.glass-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
}

/* --- Boss Raid Bar --- */
.raid-bar-container {
    position: relative;
    height: 28px;
    background: rgba(15, 23, 42, 0.8);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.raid-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #dc2626, #ef4444);
    width: 100%;
    transition: width 1s ease-out;
    position: relative;
}

.raid-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transform: skewX(-20deg) translateX(-150%);
    animation: shine 3s infinite;
}

@keyframes shine {
    100% {
        transform: skewX(-20deg) translateX(250%);
    }
}

/* --- Cosmetics --- */
.frame-gold {
    border: 3px solid #fbbf24;
    box-shadow: 0 0 15px #fbbf24, inset 0 0 10px #fbbf24;
}

.frame-neon {
    border: 3px solid #22d3ee;
    box-shadow: 0 0 15px #22d3ee, inset 0 0 10px #22d3ee;
}

.frame-mythic {
    border: 3px solid #c084fc;
    box-shadow: 0 0 20px #c084fc, inset 0 0 15px #c084fc;
    animation: border-pulse 2s infinite;
}

@keyframes border-pulse {
    0% {
        box-shadow: 0 0 10px #c084fc;
        border-color: #c084fc;
    }

    50% {
        box-shadow: 0 0 25px #e879f9;
        border-color: #e879f9;
    }

    100% {
        box-shadow: 0 0 10px #c084fc;
        border-color: #c084fc;
    }
}

/* --- Announcement Bar --- */
.announcement-bar {
    background: rgba(99, 102, 241, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    white-space: nowrap;
    height: 30px;
    display: flex;
    align-items: center;
}

.announcement-content {
    display: inline-block;
    padding-left: 100%;
    animation: marquee 20s linear infinite;
    font-size: 0.8rem;
    color: #a5b4fc;
}

@keyframes marquee {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(-100%, 0);
    }
}

/* --- Quest Widget --- */
.quest-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 50;
}

.quest-list {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 250px;
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Modal Overlay --- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    /* display, align-items, justify-content handled by utility classes */
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    padding: 1rem;
}

.modal-content {
    position: relative;
    z-index: 101;
}

.modal-open {
    overflow: hidden;
}

/* --- Boss Battle Animations --- */

/* Boss Character Animations */
.boss-character {
    display: inline-block;
    transform-origin: center bottom;
}

.boss-idle {
    animation: boss-idle-float 3s ease-in-out infinite;
}

@keyframes boss-idle-float {

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

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

.boss-shake {
    animation: boss-shake-anim 0.5s ease-in-out infinite;
}

@keyframes boss-shake-anim {

    0%,
    100% {
        transform: translateX(0) rotate(0deg);
    }

    25% {
        transform: translateX(-5px) rotate(-3deg);
    }

    75% {
        transform: translateX(5px) rotate(3deg);
    }
}

.boss-defeated-anim {
    animation: boss-defeated-fall 1s ease-out forwards;
}

@keyframes boss-defeated-fall {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(20px) rotate(15deg);
        opacity: 0.5;
    }
}

/* Boss Particle Effects */
.boss-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, #ef4444, #dc2626);
    border-radius: 50%;
    animation: boss-particle-float 4s ease-in-out infinite;
    opacity: 0.6;
}

@keyframes boss-particle-float {

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

    50% {
        transform: translateY(0%) scale(1);
        opacity: 0.8;
    }
}

/* HP Bar Shine Animation */
@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

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

.animate-shine {
    animation: shine 3s ease-in-out infinite;
}

/* Boss Enraged State */
.boss-enraged {
    animation: boss-enraged-pulse 1s ease-in-out infinite;
}

@keyframes boss-enraged-pulse {

    0%,
    100% {
        box-shadow: 0 0 30px rgba(220, 38, 38, 0.2);
    }

    50% {
        box-shadow: 0 0 50px rgba(220, 38, 38, 0.4), 0 0 80px rgba(220, 38, 38, 0.2);
    }
}

/* Boss Defeated State */
.boss-defeated {
    opacity: 0.8;
    filter: grayscale(0.3);
}