:root {
    --bg-dark: #0a0a0a;
    --text-light: #f5f5f5;
    --accent-gold: #d4af37;
    --glass-bg: rgba(20, 20, 20, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image: radial-gradient(circle at center, #1a1a2e 0%, #000000 100%);
    color: var(--text-light);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

h1, h2 {
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.container {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 3rem 2rem;
    text-align: center;
    max-width: 450px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    animation: fadeIn 1s ease-out;
}

.form-section {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.form-section.fade-out {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.glass-card h1 {
    color: var(--accent-gold);
    margin-bottom: 0.5rem;
    font-size: 2.2rem;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.glass-card p {
    margin-bottom: 2rem;
    color: #aaa;
    font-weight: 300;
}

input[type="text"] {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: none;
    border-bottom: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    font-size: 1.1rem;
    font-family: 'Outfit', sans-serif;
    border-radius: 8px 8px 0 0;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-bottom-color: var(--accent-gold);
    background: rgba(255, 255, 255, 0.1);
}

button {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #d4af37 0%, #aa801b 100%);
    color: #111;
    font-size: 1.2rem;
    font-family: 'Cinzel', serif;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    justify-content: center;
    align-items: center;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(212, 175, 55, 0.4);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Result Section */
.result-section {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transform: scale(1.1);
    transition: opacity 1s ease, transform 1s ease, background-color 1s ease;
    z-index: 10;
    pointer-events: none;
}

.result-section.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.hidden {
    display: none !important;
}

.result-content {
    padding: 2rem;
    animation: slideUp 1s ease 0.5s both;
}

#participant-name {
    font-size: 2.5rem;
    margin: 0;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.result-content p {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.8);
    margin-bottom: 2rem;
    font-style: italic;
}

.house-title {
    font-size: 5rem;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 5px;
    color: #ffffff; /* Letra blanca pura para máximo contraste */
    text-shadow: 0 5px 25px rgba(0,0,0,0.9), 0 0 10px rgba(0,0,0,0.8); /* Doble sombra para resaltar */
    animation: pulse 2s infinite ease-in-out;
}

/* Efectos base para logos (Se llenarán por JS o CSS más adelante si hay imágenes reales) */
.house-logo {
    width: 200px;
    height: 200px;
    margin: 0 auto 1.5rem;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    filter: drop-shadow(0 0 20px rgba(255,255,255,0.2));
}

/* House Colors */
.house-gryffindor { background-color: #740001; }
.house-slytherin { background-color: #1A472A; }
.house-ravenclaw { background-color: #0E1A40; }
.house-hufflepuff { background-color: #FFDB00; }

.house-hufflepuff #participant-name, 
.house-hufflepuff .result-content p {
    color: #111;
    text-shadow: none;
}
.house-hufflepuff .house-title {
    color: #111;
    text-shadow: 0 2px 10px rgba(255,255,255,0.5);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* --- Efectos de Magia (Fondo) --- */
.magic-particles {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden;
    z-index: 1; /* Detrás de la interfaz */
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px #fff, 0 0 20px #d4af37, 0 0 30px #d4af37;
    animation: floatParticle 8s infinite linear, glowParticle 2s infinite alternate;
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) translateX(0) scale(0.5); opacity: 0; }
    10% { opacity: 0.8; }
    50% { transform: translateY(50vh) translateX(50px) scale(1.2); }
    90% { opacity: 0.8; }
    100% { transform: translateY(-10vh) translateX(-50px) scale(0.5); opacity: 0; }
}

@keyframes glowParticle {
    from { filter: brightness(1) drop-shadow(0 0 5px var(--accent-gold)); }
    to { filter: brightness(1.5) drop-shadow(0 0 15px var(--accent-gold)); }
}
