:root {
    --gold: #d4af37;
    --burgundy: #740001;
    --dark-bg: rgba(15, 15, 15, 0.9);
    --glass: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: #0a0a0a url('./img/fondo-castillo.jpg') no-repeat center center fixed;
    background-size: cover;
    color: #f0e68c;
    font-family: 'Fauna One', serif;
    min-height: 100vh;
}

@media (max-width: 768px) {
    body {
        background-image: url('./img/fondo-movil.jpeg');
        background-attachment: fixed;
        background-position: center center;
    }
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.9) 100%);
    z-index: -1;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

header {
    padding: 40px 20px;
    text-align: center;
}

.glow-text {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    color: var(--gold);
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

/* --- TARJETAS DE PREGUNTAS --- */
.question-card,
.result-card,
#loading-section {
    background: var(--dark-bg);
    border: 1px solid var(--gold);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.question-card p {
    font-family: 'Cinzel', serif;
    color: var(--gold);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

/* --- BOTONES DE RADIO MÁGICOS --- */
.question-card input[type="radio"] {
    display: none;
}

.question-card label {
    display: block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 15px 20px;
    margin: 10px 0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.question-card label:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: var(--gold);
    transform: translateX(10px);
}

/* Estilo cuando está seleccionado */
.question-card input[type="radio"]:checked+span {
    font-weight: bold;
    color: white;
}

.question-card label:has(input:checked) {
    background: linear-gradient(90deg, rgba(116, 0, 1, 0.6), rgba(212, 175, 55, 0.2));
    border-color: var(--gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* --- RESULTADOS --- */
.result-main-content {
    display: flex;
    align-items: center;
    gap: 30px;
    text-align: left;
}

.result-image-container img {
    width: 200px;
    height: 200px;
    border-radius: 15px;
    border: 2px solid var(--gold);
    object-fit: cover;
}

.score-badge {
    margin-top: 15px;
    font-size: 1.4rem;
    font-weight: bold;
    color: var(--gold);
}

/* --- SNITCH Y CARGA --- */
.snitch-animation {
    text-align: center;
}

.snitch-animation img {
    width: 120px;
    filter: drop-shadow(0 0 10px var(--gold));
    animation: snitchBounce 2s ease-in-out infinite alternate;
}

@keyframes snitchBounce {
    from {
        transform: translateY(0) rotate(0deg);
    }

    to {
        transform: translateY(-30px) rotate(5deg);
    }
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #222;
    border-radius: 10px;
    margin-top: 20px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    animation: load 5s linear forwards;
}

@keyframes load {
    to {
        width: 100%;
    }
}

/* --- BOTÓN GENERAL --- */
.magic-btn {
    background: var(--burgundy);
    color: white;
    border: 2px solid var(--gold);
    padding: 15px 40px;
    font-family: 'Cinzel', serif;
    cursor: pointer;
    border-radius: 50px;
    transition: 0.3s;
    display: block;
    margin: 20px auto;
}

.magic-btn:hover {
    box-shadow: 0 0 20px var(--gold);
    transform: scale(1.05);
}

.hidden {
    display: none;
}

.fade-in {
    animation: fadeIn 1s forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (max-width: 600px) {
    .result-main-content {
        flex-direction: column;
        text-align: center;
    }
}