/* Modern Color Variables - Orange Theme */
:root {
    --primary: 30, 90%, 55%;
    /* Orange */
    --primary-light: 35, 95%, 65%;
    --blue-accent: 208, 73%, 43%;
    /* For progress bar */

    --bg-gradient-start: 35, 95%, 60%;
    --bg-gradient-end: 25, 90%, 50%;

    --white: 0, 0%, 100%;
    --slate-50: 0, 0%, 98%;
    --slate-100: 0, 0%, 94%;
    --slate-200: 0, 0%, 90%;
    --slate-300: 0, 0%, 80%;
    --slate-600: 0, 0%, 40%;
    --slate-800: 0, 0%, 50%;

    --success-bg: 140, 80%, 90%;
    --success-border: 140, 60%, 50%;
    --success-text: 140, 10%, 20%;

    --error-bg: 0, 80%, 92%;
    --error-border: 0, 60%, 60%;
    --error-text: 0, 10%, 20%;

    --shadow-soft: 0 10px 40px -10px rgba(0, 0, 0, 0.15);

    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-main: 24px;
    --radius-btn: 16px;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, hsl(var(--bg-gradient-start)), hsl(var(--bg-gradient-end)));
    color: hsl(var(--slate-800));
    font-family: var(--font-body);
    font-size: 16px;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#app {
    width: 95%;
    max-width: 420px;
    /* Mobile width */
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: var(--radius-main);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.logo {
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
}

h2 {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: hsl(var(--blue-accent));
    text-align: center
}

/* Screens */
.container {
    padding: 2rem 1.5rem;
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    background: white;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#screen-quiz {
    justify-content: flex-start;
    /* Align content to top */
}

.hidden {
    opacity: 0;
    pointer-events: none;
    z-index: -1;
    transform: translateX(20px);
}

.active {
    opacity: 1;
    pointer-events: all;
    z-index: 10;
    transform: translateX(0);
}

/* Header Grid (Progress & Score) */
.quiz-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    color: hsl(var(--slate-600));
    font-family: var(--font-heading);
}

/* Progress Bar */
.timer-container {
    width: 100%;
    height: 6px;
    background: hsl(var(--slate-100));
    border-radius: 99px;
    margin-bottom: 3rem;
    /* Space below header */
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    width: 100%;
    background: hsl(var(--blue-accent));
    transform-origin: left;
}

/* Typography and Layout */
.word-display {
    font-family: var(--font-heading);
    font-size: 3rem;
    font-weight: 700;
    color: hsl(var(--slate-800));
    margin-bottom: 1rem;
    text-align: center;
    line-height: 1.1;
    margin-top: 2rem;
}

#hint-text {
    color: hsl(var(--slate-600));
    font-size: 1.1rem;
    margin-bottom: 3rem;
    text-align: center;
}

/* Answer Options */
.options-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin-top: auto;
    /* Push to bottom if needed, or adjust spacing */
    margin-bottom: 2rem;
}

.option-btn {
    background: hsl(var(--slate-50));
    border: 1px solid hsl(var(--slate-200));
    padding: 1.7rem;
    border-radius: var(--radius-btn);
    color: hsl(var(--slate-600));
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.option-btn:hover:not(:disabled) {
    background: white;
    border-color: hsl(var(--slate-300));
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* States for options */
.option-btn.correct {
    background: hsl(var(--success-bg));
    border-color: hsl(var(--success-border));
    color: hsl(var(--success-text));
}

.option-btn.wrong {
    background: hsl(var(--error-bg));
    border-color: hsl(var(--error-border));
    color: hsl(var(--error-text));
}

/* Start/Result Screens specific */
#screen-start,
#screen-result {
    justify-content: center;
}

h1 {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: hsl(var(--slate-800));
    text-align: center
}

.btn-primary {
    background: hsl(var(--blue-accent));
    color: white;
    border: none;
    padding: 1rem 3rem;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px -5px hsl(var(--blue-accent), 0.1);
    transition: transform 0.2s;
    margin-top: 2rem;
}

.btn-primary:active {
    transform: scale(0.98);
}

.result-score {
    font-size: 5rem;
    font-weight: 800;
    color: hsl(var(--primary));
    margin: 1rem 0;
    line-height: 1;
}

.coupon-card {
    background: hsl(var(--slate-50));
    border: 2px dashed hsl(var(--primary));
    padding: 2rem;
    border-radius: 20px;
    width: 100%;
    margin-top: 2rem;
    color: hsl(var(--slate-800));
}

.coupon-code {
    background: hsl(var(--primary));
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-family: monospace;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-top: 1rem;
    display: inline-block;
}

/* Helpers */
.shake {
    animation: shake 0.4s cubic-bezier(.36, .07, .19, .97) both;
}

@keyframes shake {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fadeUp 0.4s ease forwards;
}