:root {
    --bg-color: #0d0a15;
    --text-color: #f0f0f0;
    --accent-gold: #ffcc00;
    --accent-purple: #8b3dff;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --font-heading: 'Cinzel', serif;
    /* Keep Cinzel for the "Genie" magic vibe */
    --font-body: 'Inter', sans-serif;
}

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

body {
    background: radial-gradient(circle at 50% 10%, #1a103c 0%, var(--bg-color) 70%);
    color: var(--text-color);
    font-family: var(--font-body);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

.app-container {
    width: 100%;
    max-width: 480px;
    /* Standard mobile/app width */
    padding: 20px;
    text-align: center;
}

.step-section {
    display: none;
    animation: slideUpFade 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.step-section.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* Landing */
.title {
    font-family: var(--font-heading);
    font-size: 2.8rem;
    /* Balanced size */
    background: linear-gradient(to bottom, #ffd700, #bf9b30);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.subtitle {
    opacity: 0.7;
    margin-bottom: 40px;
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.5;
}

.btn-primary {
    background: linear-gradient(135deg, #7b2cbf, #5a189a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 16px 40px;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    border-radius: 100px;
    /* Pill shape */
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(123, 44, 191, 0.4);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(123, 44, 191, 0.6);
}

/* Wizard */
.question-text {
    font-size: 1.8rem;
    margin-bottom: 25px;
    font-family: var(--font-heading);
    color: #fff;
    line-height: 1.3;
}

.options-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 20px;
}

.option-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: rgba(255, 255, 255, 0.9);
    padding: 18px 20px;
    font-size: 1rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.option-btn:after {
    content: '→';
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.2s;
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    padding-left: 25px;
}

.option-btn:hover:after {
    opacity: 1;
    transform: translateX(0);
}

/* Card Reveal */
.card-scene {
    perspective: 1000px;
    width: 280px;
    /* Elegant poster size */
    height: 420px;
    margin: 0 auto 30px;
    cursor: pointer;
}

.card {
    width: 100%;
    height: 100%;
    position: relative;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

.card.is-flipped {
    transform: rotateY(180deg);
}

.card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    background: #121212;
}

.card-front {
    background: linear-gradient(135deg, #1a0b2e, #000000);
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.card-design {
    font-size: 3rem;
    color: var(--accent-gold);
    opacity: 0.5;
    margin-bottom: 10px;
}

.card-text {
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.card-back {
    transform: rotateY(180deg);
}

.card-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.movie-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 10%, transparent);
    padding: 60px 20px 20px;
    text-align: left;
}

#result-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    color: #fff;
    margin-bottom: 4px;
}

#result-rating {
    color: var(--accent-gold);
    font-size: 0.9rem;
    font-weight: 600;
}

.genie-message-box {
    background: rgba(139, 61, 255, 0.1);
    border-left: 3px solid var(--accent-purple);
    padding: 15px 20px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 30px;
    text-align: left;
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
}

.genie-message-box h3 {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-purple);
    margin-bottom: 8px;
}

/* Loading Scanner Animation */
#scan-scene {
    position: relative;
    width: 100%;
    height: 500px;
    margin: 0 auto;
    overflow: hidden;
    /* Keep cards inside */
    perspective: 1000px;
}

.mystery-card {
    position: absolute;
    width: 80px;
    /* Bigger cards */
    height: 120px;
    background: linear-gradient(135deg, #2a2a2a, #000);
    border: 1px solid rgba(255, 215, 0, 0.2);
    border-radius: 8px;
    opacity: 0;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2rem;
    color: rgba(255, 215, 0, 0.2);
    animation: cardFloat 3s infinite;
    z-index: 1;
    /* Below scanner */
}

/* The Scanner/Genie Dot */
.genie-scanner {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--accent-gold);
    border-radius: 20px;
    /* Keep consistent curvature */
    box-shadow: 0 0 20px var(--accent-gold), 0 0 40px var(--accent-purple);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: left 0.4s cubic-bezier(0.2, 0, 0, 1),
        top 0.4s cubic-bezier(0.2, 0, 0, 1),
        width 0.2s ease,
        transform 0.2s ease;
    will-change: left, top, width, transform;
}

/* The Streak Effect */
.genie-scanner.streaking {
    width: 80px;
    /* Elongate significantly */
    /* Rotate is handled inline by JS */
    box-shadow: 0 0 30px var(--accent-gold), 0 0 60px var(--accent-purple);
}

.genie-scanner::after {
    /* Radar pulse effect remains */
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 120px;
    height: 120px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 50%;
    animation: radarPulse 1s infinite linear;
}

.loading-status {
    margin-top: 40px;
    position: relative;
}

#loading-text {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    color: var(--accent-gold);
}

.scan-line {
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-purple), transparent);
    margin-top: 10px;
    animation: scanLine 1.5s infinite ease-in-out;
}

@keyframes cardFloat {
    0% {
        transform: translateY(50px) scale(0.8) rotate(0deg);
        opacity: 0;
    }

    20% {
        opacity: 0.8;
        filter: blur(0px);
    }

    80% {
        opacity: 0.8;
        filter: blur(2px);
    }

    100% {
        transform: translateY(-50px) scale(1.2) rotate(10deg);
        opacity: 0;
    }
}

@keyframes radarPulse {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

@keyframes scanLine {
    0% {
        transform: scaleX(0);
        opacity: 0;
    }

    50% {
        transform: scaleX(1);
        opacity: 1;
    }

    100% {
        transform: scaleX(0);
        opacity: 0;
    }
}

/* Floating Action Bar */
.action-buttons {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 440px;
    display: flex;
    gap: 15px;
    z-index: 100;
    justify-content: space-between;
    background: rgba(13, 10, 21, 0.85);
    /* Semi-transparent dark background */
    backdrop-filter: blur(12px);
    padding: 10px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.btn-secondary,
.btn-danger {
    flex: 1;
    padding: 16px;
    border-radius: 16px;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    font-weight: 700;
    /* Bolder text */
    transition: transform 0.2s;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-secondary {
    background: var(--accent-gold);
    color: #240046;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-danger {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ffcccc;
}

/* Add padding to container so content doesn't get hidden behind buttons */
.app-container {
    padding-bottom: 100px;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(20px);
        scale: 0.95;
    }

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