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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #87CEEB 0%, #b8e6ff 40%, #d4f0ff 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #333;
}

/* Clouds */
.clouds {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.cloud {
    position: absolute;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
    animation: cloudFloat linear infinite;
}

.cloud::before, .cloud::after {
    content: '';
    position: absolute;
    background: white;
    border-radius: 50%;
}

@keyframes cloudFloat {
    0% { transform: translateX(-150px); }
    100% { transform: translateX(calc(100vw + 150px)); }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 15px;
    position: relative;
    z-index: 1;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 1.8em;
    color: #2c5f2d;
    text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
    margin-bottom: 8px;
}

.progress-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.95em;
}

.progress-item {
    background: rgba(255,255,255,0.7);
    padding: 6px 14px;
    border-radius: 20px;
    color: #555;
}

/* Scene area */
.scene {
    position: relative;
    border-radius: 20px;
    height: 260px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 2px solid rgba(0,0,0,0.1);
    background: linear-gradient(180deg, #87CEEB 0%, #a8d8ea 50%, #7ec850 78%, #5da83a 82%, #4a8c2a 100%);
}

/* Sun */
.sun {
    position: absolute;
    top: 20px;
    right: 40px;
    width: 50px;
    height: 50px;
    background: radial-gradient(circle, #FFD700 30%, #FFA500 70%, transparent 100%);
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(255,200,0,0.5);
    animation: sunPulse 3s ease-in-out infinite;
}

@keyframes sunPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(255,200,0,0.5); }
    50% { box-shadow: 0 0 50px rgba(255,200,0,0.7); }
}

/* Hills */
.hills {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 120px;
}

.hill {
    position: absolute;
    bottom: 0;
    border-radius: 50% 50% 0 0;
}

.hill-1 {
    left: -10%;
    width: 50%;
    height: 100px;
    background: #5da83a;
}

.hill-2 {
    left: 30%;
    width: 45%;
    height: 80px;
    background: #4a8c2a;
}

.hill-3 {
    right: -5%;
    width: 40%;
    height: 90px;
    background: #5da83a;
}

/* Road */
.road {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 35px;
    background: #888;
    border-top: 3px solid #666;
}

.road::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 3px;
    background: repeating-linear-gradient(90deg, #FFD700 0px, #FFD700 20px, transparent 20px, transparent 40px);
    transform: translateY(-50%);
}

/* House */
.house {
    position: absolute;
    bottom: 35px;
    left: 8%;
    z-index: 3;
}

.house-body {
    width: 60px;
    height: 45px;
    background: linear-gradient(135deg, #e8a87c, #d4956b);
    border-radius: 3px;
    position: relative;
}

.house-roof {
    width: 0;
    height: 0;
    border-left: 38px solid transparent;
    border-right: 38px solid transparent;
    border-bottom: 30px solid #c0392b;
    position: relative;
    left: -8px;
}

.house-door {
    width: 16px;
    height: 25px;
    background: #8B4513;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
}

.house-window {
    width: 14px;
    height: 14px;
    background: #87CEEB;
    border: 2px solid #fff;
    position: absolute;
    top: 8px;
    border-radius: 2px;
}

.house-window.left { left: 5px; }
.house-window.right { right: 5px; }

/* Boy in scene */
.scene-boy {
    position: absolute;
    bottom: 38px;
    left: 25%;
    font-size: 2.5em;
    z-index: 4;
    transition: all 0.8s ease;
}

.scene-boy.excited {
    animation: boyJump 0.5s ease infinite;
}

@keyframes boyJump {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* Trees in scene */
.scene-tree {
    position: absolute;
    bottom: 35px;
    font-size: 2em;
    z-index: 2;
}

/* Speech bubble */
.speech-bubble {
    position: absolute;
    bottom: 95px;
    left: 12%;
    background: white;
    color: #333;
    padding: 8px 14px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    z-index: 5;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: opacity 0.3s;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 30px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

/* Equipment grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.equipment-slot {
    background: rgba(255,255,255,0.6);
    border: 2px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 10px 5px;
    text-align: center;
    transition: all 0.5s ease;
    min-height: 85px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.equipment-slot .eq-icon {
    font-size: 1.8em;
    margin-bottom: 4px;
    filter: grayscale(1) brightness(0.6);
    transition: all 0.5s ease;
}

.equipment-slot .eq-name {
    font-size: 0.7em;
    color: #999;
    transition: all 0.5s ease;
}

.equipment-slot.earned {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4CAF50;
    animation: equipEarned 0.6s ease;
}

.equipment-slot.earned .eq-icon {
    filter: none;
}

.equipment-slot.earned .eq-name {
    color: #2e7d32;
    font-weight: bold;
}

.equipment-slot.missed {
    background: rgba(244, 67, 54, 0.12);
    border-color: #e57373;
}

.equipment-slot.missed .eq-icon {
    filter: grayscale(1) brightness(0.4);
}

.equipment-slot.missed .eq-name {
    color: #c62828;
}

.equipment-slot.missed::after {
    content: '\2717';
    position: absolute;
    font-size: 1.5em;
    color: #e57373;
    font-weight: bold;
}

.equipment-slot.current {
    border-color: #FF9800;
    background: rgba(255, 152, 0, 0.15);
    animation: currentPulse 1.5s ease infinite;
}

@keyframes currentPulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255,152,0,0.3); }
    50% { box-shadow: 0 0 20px rgba(255,152,0,0.5); }
}

@keyframes equipEarned {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Question panel */
.question-panel {
    background: rgba(255,255,255,0.85);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.question {
    font-size: 1.6em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    min-height: 1.6em;
}

.answers {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.answer-btn {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 1.3em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 80px;
}

.answer-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46, 125, 50, 0.4);
}

.answer-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.answer-btn.shake {
    animation: shake 0.5s ease;
    background: linear-gradient(135deg, #e53935, #c62828);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-5px); }
    80% { transform: translateX(5px); }
}

/* Feedback */
.feedback {
    margin-top: 12px;
    font-size: 1.1em;
    font-weight: bold;
    min-height: 1.3em;
}

.feedback.correct { color: #2e7d32; }
.feedback.wrong { color: #c62828; }

/* End screen */
.end-screen {
    display: none;
    text-align: center;
    padding: 20px;
}

.end-screen.show {
    display: block;
    animation: fadeIn 0.5s ease;
}

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

/* ====== RIDE ANIMATION SCENE ====== */
.ride-scene {
    position: relative;
    height: 320px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    background: linear-gradient(180deg, #87CEEB 0%, #a8d8ea 55%, #7ec850 78%, #5da83a 82%, #888 92%, #888 95%, #5da83a 95%, #4a8c2a 100%);
}

.ride-scene .sun {
    top: 15px;
    right: 30px;
}

/* Scrolling landscape */
.landscape {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 300%;
    height: 200px;
    z-index: 1;
}

.landscape.scrolling {
    animation: landscapeScroll 8s linear infinite;
}

@keyframes landscapeScroll {
    0% { transform: translateX(-33.33%); }
    100% { transform: translateX(0); }
}

.landscape-item {
    position: absolute;
    bottom: 30px;
    font-size: 2em;
}

/* Road in ride scene */
.ride-road {
    position: absolute;
    bottom: 20px;
    left: 0;
    right: 0;
    height: 30px;
    background: #888;
    z-index: 2;
}

.ride-road::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    width: 300%;
    height: 3px;
    background: repeating-linear-gradient(90deg, #FFD700 0px, #FFD700 20px, transparent 20px, transparent 40px);
    transform: translateY(-50%);
}

.ride-road.scrolling::after {
    animation: roadLines 1s linear infinite;
}

@keyframes roadLines {
    0% { transform: translateY(-50%) translateX(0); }
    100% { transform: translateY(-50%) translateX(40px); }
}

/* Boy on bike */
.bike-boy {
    position: absolute;
    bottom: 42px;
    left: 35%;
    font-size: 2.5em;
    z-index: 5;
    transition: all 0.5s ease;
}

.bike-boy.riding {
    animation: bikeRide 0.4s ease infinite;
}

@keyframes bikeRide {
    0%, 100% { transform: translateY(0) rotate(-2deg); }
    50% { transform: translateY(-4px) rotate(2deg); }
}

/* Speed lines */
.speed-line {
    position: absolute;
    height: 2px;
    background: rgba(255,255,255,0.6);
    z-index: 3;
    animation: speedLineMove 0.5s linear forwards;
}

@keyframes speedLineMove {
    0% { opacity: 1; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(200px); }
}

/* Butterflies and birds */
.flying-thing {
    position: absolute;
    z-index: 3;
    animation: flyAround 3s ease-in-out infinite;
}

@keyframes flyAround {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25% { transform: translateY(-15px) rotate(5deg); }
    75% { transform: translateY(5px) rotate(-5deg); }
}

/* Wind effect */
.wind-particle {
    position: absolute;
    font-size: 0.8em;
    z-index: 4;
    opacity: 0.5;
    animation: windBlow 1.5s linear forwards;
}

@keyframes windBlow {
    0% { opacity: 0.5; transform: translateX(0); }
    100% { opacity: 0; transform: translateX(300px); }
}

/* ====== SAD ANIMATION SCENE ====== */
.sad-scene {
    position: relative;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    background: linear-gradient(180deg, #b0bec5 0%, #cfd8dc 50%, #7ec850 78%, #5da83a 82%, #4a8c2a 100%);
}

/* Rain */
.rain-drop {
    position: absolute;
    width: 2px;
    height: 15px;
    background: linear-gradient(180deg, transparent, rgba(100,150,200,0.6));
    animation: rainFall 0.8s linear infinite;
    z-index: 2;
}

@keyframes rainFall {
    0% { transform: translateY(-20px); opacity: 1; }
    100% { transform: translateY(320px); opacity: 0.3; }
}

.sad-boy {
    position: absolute;
    bottom: 50px;
    font-size: 2.5em;
    z-index: 4;
}

.sad-boy.walking-home {
    animation: walkHome 5s ease-in forwards;
}

@keyframes walkHome {
    0% { left: 60%; }
    90% { left: 10%; }
    95% { left: 10%; transform: scale(0.8); }
    100% { left: 10%; transform: scale(0); }
}

.sad-house {
    position: absolute;
    bottom: 40px;
    left: 5%;
    z-index: 3;
}

.sad-bubble {
    position: absolute;
    bottom: 100px;
    background: white;
    color: #333;
    padding: 8px 14px;
    border-radius: 15px;
    font-size: 0.85em;
    font-weight: bold;
    z-index: 5;
    white-space: nowrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    animation: sadBubbleFollow 5s ease-in forwards;
}

.sad-bubble::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 20px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid white;
}

@keyframes sadBubbleFollow {
    0% { left: 52%; opacity: 1; }
    60% { opacity: 0.8; }
    85% { left: 5%; opacity: 0.5; }
    100% { left: 5%; opacity: 0; }
}

/* Door animation */
.door-open {
    animation: doorSwing 0.5s ease forwards;
    transform-origin: left center;
}

@keyframes doorSwing {
    0% { transform: perspective(100px) rotateY(0deg); }
    100% { transform: perspective(100px) rotateY(-70deg); }
}

/* End stats */
.end-stats {
    background: rgba(255,255,255,0.8);
    border-radius: 15px;
    padding: 20px;
    margin: 15px 0;
}

.end-stats p {
    margin: 8px 0;
    font-size: 1.1em;
    color: #555;
}

.end-message {
    font-size: 1.3em;
    margin: 15px 0;
    font-style: italic;
    color: #2e7d32;
}

.end-message.sad {
    color: #c62828;
}

.btn-restart {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: white;
    border: none;
    padding: 14px 35px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    margin: 8px;
    transition: all 0.3s;
}

.btn-restart:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(46,125,50,0.4);
}

/* Responsive */
@media (max-width: 600px) {
    .header h1 { font-size: 1.3em; }
    .equipment-grid { grid-template-columns: repeat(5, 1fr); gap: 5px; }
    .equipment-slot { padding: 6px 3px; min-height: 70px; }
    .equipment-slot .eq-icon { font-size: 1.4em; }
    .equipment-slot .eq-name { font-size: 0.6em; }
    .question { font-size: 1.3em; }
    .answer-btn { padding: 10px 20px; font-size: 1.1em; }
    .scene { height: 200px; }
    .scene-boy { font-size: 2em; }
    .speech-bubble { font-size: 0.75em; }
}
