@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* Custom CSS Variables */
:root {
    --primary-red: #7A0E1D;
    --ember-accent: #FF3B3B;
    --dark-wine: #3A0B12;
    --text-primary: #EDE9E6;
    --text-secondary: #B7B0AA;
    --glass-base: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --shadow-red: rgba(122, 14, 29, 0.3);
    --shadow-dark: rgba(0, 0, 0, 0.5);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #050507;
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Font Classes */
.font-serif {
    font-family: 'Cinzel', serif;
}

/* Background Effects */
.bg-noise {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    opacity: 0.15;
}

.bg-gradient {
    background: radial-gradient(
        circle at 20% 10%,
        rgba(122, 14, 29, 0.15) 0%,
        transparent 40%
    ),
    radial-gradient(
        circle at 80% 90%,
        rgba(255, 59, 59, 0.1) 0%,
        transparent 40%
    ),
    linear-gradient(
        180deg,
        rgba(5, 5, 7, 0.95) 0%,
        rgba(58, 11, 18, 0.3) 50%,
        rgba(5, 5, 7, 0.95) 100%
    );
}

/* Liquid Glass Card Base */
.liquid-glass-card {
    background: var(--glass-base);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    box-shadow: 
        0 8px 32px var(--shadow-dark),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 0 1px rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.liquid-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    z-index: 1;
}

.liquid-glass-card.compact {
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.05);
}

.liquid-glass-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px var(--shadow-red),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* Interactive Elements */
.interactive-press {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.interactive-press:active {
    transform: scale(0.98);
    box-shadow: 
        0 4px 16px var(--shadow-dark),
        inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Glass Button */
.glass-button {
    background: linear-gradient(
        135deg,
        rgba(122, 14, 29, 0.8),
        rgba(58, 11, 18, 0.9)
    );
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    color: var(--text-primary);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

.glass-button:hover::before {
    left: 100%;
}

.glass-button:hover {
    background: linear-gradient(
        135deg,
        rgba(122, 14, 29, 0.9),
        rgba(58, 11, 18, 1)
    );
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 20px rgba(122, 14, 29, 0.4);
}

.glass-button:active {
    transform: scale(0.98);
}

/* Badge Styles */
.rank-badge {
    background: linear-gradient(
        135deg,
        rgba(255, 215, 0, 0.1),
        rgba(255, 140, 0, 0.15)
    );
    border: 1px solid rgba(255, 215, 0, 0.3);
    color: #FFD700;
}

.energy-meter {
    background: linear-gradient(
        90deg,
        rgba(255, 59, 59, 0.2),
        transparent
    );
    border: 1px solid rgba(255, 59, 59, 0.3);
}

/* Safe Area Padding for Modern Mobile Devices */
.safe-area-padding {
    padding-top: env(safe-area-inset-top, 0);
    padding-bottom: env(safe-area-inset-bottom, 0);
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
}

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

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

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        to bottom,
        var(--primary-red),
        var(--dark-wine)
    );
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(
        to bottom,
        #8A0F21,
        var(--primary-red)
    );
}

/* Animation Classes */
@keyframes glowPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 59, 59, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 59, 59, 0.5);
    }
}

.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

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

.slide-in {
    animation: slideIn 0.4s ease-out forwards;
}

/* Utility Classes */
.text-shadow-sm {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.glass-edge-highlight {
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 1px 0 rgba(255, 255, 255, 0.05);
}