:root {
    --bg-color: #0d0202;
    --accent-red: #8b0000;
    --accent-gold: #d4af37;
    --text-primary: #f0e6e6;
    --text-secondary: #bdc3c7;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50%;
    animation: pulseOrb 8s infinite ease-in-out;
}

@keyframes pulseOrb {

    0%,
    100% {
        transform: translateX(-50%) scale(1);
        opacity: 0.5;
    }

    50% {
        transform: translateX(-50%) scale(1.1);
        opacity: 0.8;
    }
}

/* Audio Toggle */
.audio-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    color: var(--accent-gold);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.audio-toggle:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.1);
}

.audio-icon {
    fill: currentColor;
}

/* Typography & Layout */
.container {
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    z-index: 10;
    text-align: center;
}

.main-header {
    margin-bottom: 3rem;
    opacity: 0;
    animation: fadeInDown 1s ease-out forwards;
}

.title {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.title .highlight {
    color: var(--accent-red);
    /* Fallback */
    background: linear-gradient(to right, var(--accent-red), #ff4d4d);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-style: italic;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

/* Glassmorphism Card */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    opacity: 0;
    animation: fadeUp 1s ease-out 0.3s forwards;
}

/* Mode Tabs */
.mode-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 30px;
    padding: 4px;
    margin-bottom: 2rem;
    border: 1px solid var(--glass-border);
}

.mode-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.6rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.mode-tab.active {
    background: var(--accent-gold);
    color: #0d0202;
    font-weight: 600;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
}

.mode-tab:hover:not(.active) {
    color: #fff;
}


/* Form Styling */
.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

label {
    display: block;
    font-size: 0.85rem;
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-heading);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

input:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.2);
    background: rgba(0, 0, 0, 0.5);
}

.divider-icon {
    color: var(--accent-red);
    margin: -0.5rem 0 1rem;
    opacity: 0.7;
    animation: rotateIcon 4s infinite linear;
    /* Subtle movement */
}

/* Button */
.cta-button {
    width: 100%;
    padding: 1.2rem;
    background: linear-gradient(135deg, var(--accent-red), #500000);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-top: 1rem;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(139, 0, 0, 0.4);
}

.btn-glow {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shine 3s infinite;
}

/* Processing Visuals */
.processing-visual {
    padding: 3rem 0;
    text-align: center;
}

.pulsing-heart {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--accent-red);
    animation: heartbeat 1.2s infinite ease-in-out;
}

.heart-svg {
    fill: currentColor;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(139, 0, 0, 0.5));
}

.processing-text {
    color: var(--accent-gold);
    font-family: var(--font-heading);
    font-style: italic;
    animation: shimmer 2s infinite linear;
}

/* Results */
.final-result {
    text-align: center;
}

/* Cosmic Ring */
.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 2rem;
}

.progress-ring__circle {
    transition: stroke-dashoffset 1.5s ease-in-out;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    stroke-linecap: round;
    filter: drop-shadow(0 0 8px var(--accent-gold));
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 700;
    color: #fff;
}

.percent {
    font-size: 1.5rem;
    color: var(--accent-gold);
    margin-left: 2px;
}

/* FLAMES UI */
.flames-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.flame-letter {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--text-secondary);
    opacity: 0.5;
    transition: all 0.5s ease;
    position: relative;
}

.flame-letter.active {
    color: var(--accent-red);
    opacity: 1;
    text-shadow: 0 0 10px rgba(139, 0, 0, 0.8);
    transform: scale(1.2);
}

.flame-letter.struck {
    color: rgba(255, 255, 255, 0.1);
    opacity: 0.3;
}

.flame-letter.struck::after {
    content: '';
    position: absolute;
    top: 50%;
    left: -10%;
    width: 120%;
    height: 2px;
    background: var(--accent-red);
    transform: rotate(-20deg);
}

.flames-status {
    font-family: var(--font-heading);
    font-size: 3rem;
    color: var(--accent-gold);
    min-height: 4rem;
    margin-bottom: 1rem;
    animation: fadeUp 1s ease-out;
}

/* General Result Text */
.result-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    color: var(--accent-gold);
    margin-bottom: 1rem;
}

.result-message {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    justify-content: center;
    align-items: center;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--accent-gold);
    color: var(--accent-gold);
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.share-button:hover {
    background: var(--accent-gold);
    color: #000;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.reset-button {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 0.8rem 2rem;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.reset-button:hover {
    border-color: #fff;
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.main-footer {
    margin-top: 4rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.2);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

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

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

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

@keyframes shine {
    0% {
        left: -100%;
    }

    50%,
    100% {
        left: 100%;
    }
}

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

    25% {
        transform: scale(1.15);
    }

    40% {
        transform: scale(1);
    }

    60% {
        transform: scale(1.15);
    }

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

/* Mobile Tweaks */
@media (max-width: 480px) {
    .title {
        font-size: 2.5rem;
    }

    .score-circle {
        width: 160px;
        height: 160px;
    }

    .score-text {
        font-size: 2.8rem;
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .flame-letter {
        font-size: 2rem;
    }

    .flames-status {
        font-size: 2.5rem;
    }
}