:root {
    --bg-color: #050510;
    --text-color: #e0e0e0;
    --accent-color: #ffd700;
    --glow-color: #fff9c4;
    --error-color: #ff4d4d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Montserrat', sans-serif;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    transition: background-color 2s ease;
}

.container {
    text-align: center;
    position: relative;
    z-index: 10;
}

.title {
    font-family: 'Cinzel', serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    opacity: 0;
    animation: fadeIn 2s ease forwards;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.subtitle {
    font-size: 1rem;
    margin-bottom: 2rem;
    opacity: 0;
    animation: fadeIn 2s ease 1s forwards;
    letter-spacing: 2px;
}

.input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
    opacity: 0;
    animation: fadeIn 2s ease 1.5s forwards;
}

input {
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px 15px;
    font-size: 1.2rem;
    color: var(--glow-color);
    text-align: center;
    width: 250px;
    font-family: 'Cinzel', serif;
    outline: none;
    transition: all 0.3s ease;
}

input:focus {
    border-bottom-color: var(--glow-color);
    box-shadow: 0 10px 20px -10px rgba(255, 249, 196, 0.2);
}

.glow-effect {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow-color) 0%, transparent 70%);
    opacity: 0;
    pointer-events: none;
    transition: width 0.5s ease, height 0.5s ease, opacity 0.5s ease;
}

.magic-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
    padding: 10px 30px;
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.4s ease;
    opacity: 0;
    animation: fadeIn 2s ease 2s forwards;
}

.magic-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--glow-color);
    color: var(--glow-color);
    box-shadow: 0 0 15px rgba(255, 249, 196, 0.3);
    transform: translateY(-2px);
}

.error-message {
    color: var(--error-color);
    margin-top: 1rem;
    font-size: 0.9rem;
    min-height: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.hidden {
    opacity: 0;
}

.light-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

@keyframes shake {

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

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

/* Success State Classes */
body.lumos-active {
    background-color: #fdfbf7;
    /* Slight warm white */
    overflow-y: auto;
    /* Allow scrolling for content */
}

body.lumos-active .title,
body.lumos-active .subtitle,
body.lumos-active .input-wrapper,
body.lumos-active .magic-btn {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

.wand-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="white" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="2" y1="22" x2="16" y2="8"></line><line x1="8" y1="2" x2="22" y2="16"></line><path d="M12 2l4 4-2 2-4-4z"></path></svg>') 0 24, auto;
}

/* Main Content Section */
#main-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 2s ease;
    pointer-events: none;
    /* Initially disabled */
}

body.lumos-active #main-content {
    opacity: 1;
    pointer-events: auto;
}

/* Sorting Hat Section */
#sorting-hat-section {
    text-align: center;
    margin-top: 5vh;
    margin-bottom: 3rem;
    animation: float 6s ease-in-out infinite;
}

.hat-image {
    width: 200px;
    height: auto;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.3));
    margin-bottom: 1rem;
}

.house-announcement {
    font-family: 'Cinzel', serif;
    font-size: 4rem;
    font-weight: 700;
    color: #740001;
    /* Gryffindor Red */
    text-shadow: 2px 2px 0px #d3a625;
    /* Gryffindor Gold */
    margin-top: 0;
    opacity: 0;
    transform: scale(0.8);
    animation: announceHouse 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) 1s forwards;
}

.house-subtitle {
    font-family: 'Montserrat', sans-serif;
    color: #333;
    font-size: 1.2rem;
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeIn 1s ease 2s forwards;
}

/* Daily Prophet Section */
#daily-prophet-section {
    width: 100%;
    max-width: 800px;
    margin-top: 2rem;
    opacity: 0;
    transform: translateY(30px);
    transition: all 1.5s ease;
    animation: fadeInUp 1.5s ease 3s forwards;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

#daily-prophet-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(transparent,
            transparent 2px,
            rgba(0, 0, 0, 0.03) 2px,
            rgba(0, 0, 0, 0.03) 4px);
    pointer-events: none;
}

.prophet-header {
    font-family: 'Cinzel', serif;
    font-size: 3rem;
    border-bottom: 3px double #333;
    border-top: 3px double #333;
    padding: 10px 0;
    margin-bottom: 1.5rem;
    color: #222;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.prophet-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

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

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

@keyframes announceHouse {
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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