/* ===== CSS VARIABLES ===== */
:root {
    --primary-color: #ff6b6b;
    --secondary-color: #4ecdc4;
    --accent-color: #ffe66d;
    --success-color: #95e87e;
    --error-color: #ff6b6b;
    --text-dark: #2d3436;
    --text-light: #636e72;
    --bg-primary: #fff9f0;
    --bg-card: #ffffff;
    --bg-gradient: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #4ecdc4 100%);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 40px rgba(0,0,0,0.2);
    --border-radius: 16px;
    --transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --primary-color: #ff8e8e;
    --secondary-color: #6ee7de;
    --accent-color: #ffeaa7;
    --text-dark: #f5f5f5;
    --text-light: #b2bec3;
    --bg-primary: #1a1a2e;
    --bg-card: #16213e;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.4);
}

/* ===== RESET & BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito', sans-serif;
    background: var(--bg-primary);
    color: var(--text-dark);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== APP CONTAINER ===== */
.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
}

/* ===== HEADER ===== */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--bg-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-controls {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    background: var(--bg-primary);
    border: 2px solid var(--secondary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    transform: scale(1.1);
    background: var(--secondary-color);
    color: white;
}

/* ===== MAIN AREA ===== */
.game-main {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.screen {
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.5s ease;
}

.hidden {
    display: none !important;
}

/* ===== START SCREEN ===== */
.welcome-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: var(--bg-gradient);
}

.welcome-card h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.welcome-card p {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.food-icons {
    font-size: 2rem;
    margin: 2rem 0;
    animation: bounce 2s infinite;
}

/* ===== BUTTONS ===== */
.btn {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn-submit {
    background: var(--secondary-color);
    color: white;
    padding: 0.8rem 1.5rem;
}

.btn-submit:hover {
    background: #3dbdb5;
    transform: scale(1.05);
}

.btn-hint {
    background: var(--accent-color);
    color: var(--text-dark);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    margin-top: 1rem;
}

.btn-hint:hover {
    background: #f9d74e;
}

.btn-next {
    background: var(--success-color);
    color: white;
    padding: 0.8rem 2rem;
}

.btn-next:hover {
    background: #7dd06d;
}

.btn-restart {
    background: var(--primary-color);
    color: white;
    font-size: 1.2rem;
    padding: 1rem 3rem;
}

.btn-restart:hover {
    background: #ff5252;
    transform: scale(1.05);
}

/* ===== GAME SCREEN ===== */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
}

#levelIndicator {
    color: var(--primary-color);
}

#scoreDisplay {
    color: var(--secondary-color);
}

.progress-bar {
    height: 12px;
    background: var(--bg-card);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.progress-fill {
    height: 100%;
    background: var(--bg-gradient);
    border-radius: 50px;
    transition: width 0.5s ease;
    width: 14%;
}

/* Timer */
.timer-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    box-shadow: var(--shadow-sm);
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 1.2rem;
}

.timer-icon {
    font-size: 1.5rem;
}

#timerDisplay {
    color: var(--secondary-color);
}

.timer-warning {
    color: var(--primary-color) !important;
    animation: pulse 1s infinite;
}

/* ===== CLUE CARD ===== */
.clue-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.clue-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: var(--bg-gradient);
}

.clue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.clue-number {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.3rem;
    color: var(--primary-color);
    font-weight: 600;
}

.clue-icon {
    font-size: 2rem;
    animation: shake 2s infinite;
}

.clue-question {
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--text-dark);
    margin-bottom: 2rem;
    text-align: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 12px;
}

/* Answer Section */
.answer-section {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.answer-input {
    flex: 1;
    padding: 1rem;
    font-size: 1rem;
    border: 3px solid var(--secondary-color);
    border-radius: 50px;
    outline: none;
    transition: var(--transition);
    font-family: 'Nunito', sans-serif;
}

.answer-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
}

.answer-input::placeholder {
    color: var(--text-light);
}

/* Hint */
.hint-text {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 230, 109, 0.3);
    border-radius: 12px;
    color: #b8860b;
    font-weight: 600;
    margin-top: 1rem;
    animation: fadeIn 0.3s ease;
}

/* Error Message */
.error-message {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 107, 107, 0.2);
    border-radius: 12px;
    color: var(--error-color);
    font-weight: 600;
    margin-top: 1rem;
    animation: shake 0.5s ease;
}

/* ===== REWARD SECTION ===== */
.reward-section {
    margin-top: 1.5rem;
}

.reward-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    text-align: center;
    border: 3px solid var(--success-color);
    animation: celebrate 0.5s ease;
}

.reward-icon {
    font-size: 4rem;
    animation: bounce 1s infinite;
}

.reward-card h3 {
    font-family: 'Fredoka', sans-serif;
    color: var(--success-color);
    font-size: 1.5rem;
    margin: 1rem 0;
}

.reward-tip {
    background: rgba(149, 232, 126, 0.2);
    padding: 1.5rem;
    border-radius: 12px;
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

/* ===== FINAL SCREEN ===== */
.final-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.trophy-icon {
    font-size: 5rem;
    animation: bounce 1s infinite;
}

.final-card h1 {
    font-family: 'Fredoka', sans-serif;
    color: var(--primary-color);
    font-size: 2rem;
    margin: 1rem 0;
}

.congrats-text {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.final-score {
    background: var(--bg-gradient);
    padding: 1.5rem;
    border-radius: 16px;
    margin-bottom: 1rem;
    color: white;
}

.score-label {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    opacity: 0.9;
}

.score-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 3rem;
    font-weight: 700;
}

.time-taken {
    font-family: 'Fredoka', sans-serif;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Recipe Reveal */
.recipe-reveal {
    background: var(--bg-primary);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
    text-align: left;
}

.recipe-reveal h2 {
    font-family: 'Fredoka', sans-serif;
    color: var(--secondary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.recipe-name {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px dashed var(--secondary-color);
}

.recipe-content {
    color: var(--text-dark);
    line-height: 1.8;
}

.recipe-content h4 {
    color: var(--secondary-color);
    margin: 1rem 0 0.5rem;
    font-family: 'Fredoka', sans-serif;
}

.recipe-content ul {
    padding-left: 1.5rem;
}

.recipe-content li {
    margin: 0.5rem 0;
}

.recipe-content ol {
    padding-left: 1.5rem;
}

.recipe-content ol li {
    margin: 0.8rem 0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes shake {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(5deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes celebrate {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .game-header {
        padding: 1rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .game-main {
        padding: 1rem;
    }
    
    .welcome-card, .clue-card, .final-card {
        padding: 1.5rem;
    }
    
    .welcome-card h1 {
        font-size: 1.5rem;
    }
    
    .clue-question {
        font-size: 1rem;
    }
    
    .answer-section {
        flex-direction: column;
    }
    
    .btn-submit {
        width: 100%;
    }
    
    .food-icons {
        font-size: 1.5rem;
    }
    
    .score-value {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .header-controls {
        gap: 0.3rem;
    }
    
    .icon-btn {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .clue-header {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .timer {
        font-size: 1rem;
        padding: 0.6rem 1rem;
    }
    
    .progress-info {
        font-size: 0.9rem;
    }
}