:root {
    --primary: #FF6B6B;
    --secondary: #4ECDC4;
    --accent: #FFE66D;
    --background-start: #1A2980;
    --background-end: #26D0CE;
    --text-dark: #2C3E50;
    --text-light: #FFFFFF;
    --card-bg: rgba(255, 255, 255, 0.95);
    font-family: 'Assistant', 'Varela Round', sans-serif;
}

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

body {
    background: linear-gradient(135deg, var(--background-start), var(--background-end));
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow-x: hidden;
    padding: 20px 0;
}

#app {
    width: 100%;
    max-width: 800px;
    padding: 20px;
    margin: auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

h1 {
    color: var(--text-light);
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: 800;
    text-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2),
        -1px -1px 0px var(--primary),
        1px -1px 0px var(--primary),
        -1px 1px 0px var(--primary),
        1px 1px 0px var(--primary);
    font-family: 'Varela Round', sans-serif;
    letter-spacing: 1px;
    animation: floatTitle 3s ease-in-out infinite;
    line-height: 1.2;
}

.screen {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.screen.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 1;
}

.welcome-box,
.celebration-box {
    background: var(--card-bg);
    padding: clamp(1.5rem, 5vw, 3rem);
    border-radius: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 600px;
    width: 100%;
    border: 5px solid white;
}

.welcome-box h2,
.celebration-box h2 {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
    color: var(--primary);
    margin-bottom: 1rem;
    font-family: 'Varela Round', sans-serif;
}

.welcome-box p,
.celebration-box p {
    font-size: clamp(1.2rem, 4vw, 1.5rem);
    margin-bottom: 2rem;
    color: #444;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    padding: clamp(1.2rem, 4vw, 2rem);
    border-radius: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
    width: 100%;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 5px solid white;
    position: relative;
    overflow: hidden;
}

.image-wrapper {
    width: 100%;
    max-width: min(320px, 45vh);
    aspect-ratio: 2 / 3;
    flex-shrink: 0;
    height: auto;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 4px dashed #ccc;
    margin-left: auto;
    margin-right: auto;
}

#student-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.5s ease;
}

#student-img.fade-out {
    opacity: 0;
    transform: scale(0.95);
}

#student-img.fade-in {
    opacity: 1;
    transform: scale(1);
}

.controls {
    display: flex;
    gap: 15px;
    width: 100%;
    justify-content: center;
}

.question-container {
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.question-bounce {
    font-size: clamp(2rem, 7vw, 3rem);
    color: var(--primary);
    font-family: 'Varela Round', sans-serif;
    animation: bounce 2s infinite;
    text-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.question-hidden {
    visibility: hidden;
}

/* Button Styles */
.btn {
    font-family: 'Assistant', sans-serif;
    font-size: clamp(1.1rem, 4vw, 1.5rem);
    font-weight: 700;
    padding: clamp(10px, 3vw, 15px) clamp(20px, 6vw, 40px);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.2s, background-color 0.2s;
    outline: none;
    text-transform: uppercase;
    color: white;
    /* fallback */
}

.primary-btn {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 8px 0 #D94848, 0 15px 20px rgba(0, 0, 0, 0.2);
}

.primary-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 #D94848, 0 5px 10px rgba(0, 0, 0, 0.2);
}

.secondary-btn {
    background-color: var(--secondary);
    color: white;
    box-shadow: 0 8px 0 #319B93, 0 15px 20px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 300px;
    text-align: center;
}

.secondary-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 #319B93, 0 5px 10px rgba(0, 0, 0, 0.2);
}

.secondary-btn.next-btn {
    background-color: var(--accent);
    color: #333;
    box-shadow: 0 8px 0 #D6C147, 0 15px 20px rgba(0, 0, 0, 0.2);
}

.secondary-btn.next-btn:active {
    transform: translateY(8px);
    box-shadow: 0 0 0 #D6C147, 0 5px 10px rgba(0, 0, 0, 0.2);
}

.pulse {
    animation: pulse 2s infinite;
}

/* Progress */
.progress {
    margin-top: 2rem;
    width: 100%;
    max-width: 600px;
    text-align: center;
}

#progress-text {
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: bold;
    display: block;
    margin-bottom: 0.5rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.progress-bar-container {
    width: 100%;
    height: 15px;
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.5);
}

#progress-bar {
    height: 100%;
    background-color: var(--accent);
    border-radius: 10px;
    transition: width 0.3s ease;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes floatTitle {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-10px) rotate(2deg);
    }
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-20px);
    }

    60% {
        transform: translateY(-10px);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 8px 0 #D94848, 0 0 0 0 rgba(255, 107, 107, 0.7);
    }

    70% {
        transform: scale(1.05);
        box-shadow: 0 8px 0 #D94848, 0 0 0 20px rgba(255, 107, 107, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 8px 0 #D94848, 0 0 0 0 rgba(255, 107, 107, 0);
    }
}

/* Basic confetti for the end screen */
.confetti {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 100;
}