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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, #0a0a2e 0%, #1a1a4e 40%, #2d1b69 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: white;
}

/* Stars background */
.stars {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle 2s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.3; }
    100% { opacity: 1; }
}

.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;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    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.1);
    padding: 6px 14px;
    border-radius: 20px;
}

/* Scene area */
.scene {
    position: relative;
    background: linear-gradient(180deg, #0a0a2e 0%, #1a1a4e 60%, #3a2a1a 95%, #5a4a2a 100%);
    border-radius: 20px;
    height: 280px;
    margin-bottom: 15px;
    overflow: hidden;
    border: 2px solid rgba(255,255,255,0.1);
}

/* Ground */
.ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(180deg, #4a6741 0%, #3a5731 100%);
    border-radius: 0 0 18px 18px;
}

.ground::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(180deg, transparent, #4a6741);
}

/* Launch pad */
.launch-pad {
    position: absolute;
    bottom: 45px;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 15px;
    background: linear-gradient(180deg, #888, #666);
    border-radius: 3px;
    z-index: 2;
}

.launch-pad::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 10%;
    right: 10%;
    height: 8px;
    background: #555;
    border-radius: 0 0 3px 3px;
}

/* Rocket */
.rocket-wrapper {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    transition: all 0.5s ease;
}

.rocket {
    width: 60px;
    height: 120px;
    position: relative;
}

.rocket-nose {
    width: 0;
    height: 0;
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 35px solid #e74c3c;
    position: absolute;
    top: 0;
}

.rocket-body {
    width: 60px;
    height: 70px;
    background: linear-gradient(90deg, #ccc 0%, #fff 40%, #ccc 100%);
    position: absolute;
    top: 33px;
    border-radius: 0 0 5px 5px;
}

.rocket-window {
    width: 22px;
    height: 22px;
    background: radial-gradient(circle at 40% 40%, #87CEEB, #4a90d9);
    border-radius: 50%;
    border: 3px solid #999;
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    overflow: hidden;
}

.rocket-wing {
    width: 20px;
    height: 35px;
    position: absolute;
    bottom: 0;
    background: #e74c3c;
}

.rocket-wing.left {
    left: -15px;
    border-radius: 10px 0 0 5px;
    transform: skewY(15deg);
}

.rocket-wing.right {
    right: -15px;
    border-radius: 0 10px 5px 0;
    transform: skewY(-15deg);
}

/* Dog in scene */
.scene-dog {
    position: absolute;
    bottom: 50px;
    left: 30%;
    font-size: 2.5em;
    z-index: 4;
    transition: all 0.8s ease;
}

.scene-dog.excited {
    animation: dogJump 0.5s ease infinite;
}

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

/* Speech bubble */
.speech-bubble {
    position: absolute;
    bottom: 95px;
    left: 15%;
    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.3);
    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.08);
    border: 2px solid rgba(255,255,255,0.15);
    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;
}

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

.equipment-slot .eq-name {
    font-size: 0.7em;
    opacity: 0.4;
    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 {
    opacity: 1;
    color: #81c784;
}

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

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

.equipment-slot.missed .eq-name {
    opacity: 0.6;
    color: #ef9a9a;
}

.equipment-slot.missed::after {
    content: '✗';
    position: absolute;
    font-size: 1.5em;
    color: #f44336;
}

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

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

@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.1);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(5px);
}

.question {
    font-size: 1.6em;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    min-height: 1.6em;
}

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

.answer-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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(102, 126, 234, 0.4);
}

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

.answer-btn.shake {
    animation: shake 0.5s ease;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

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

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

.feedback.correct { color: #81c784; }
.feedback.wrong { color: #ef9a9a; }

/* 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); }
}

/* Launch animation scene */
.launch-scene {
    position: relative;
    height: 350px;
    background: linear-gradient(180deg, #0a0a2e 0%, #1a1a4e 60%, #3a2a1a 95%, #5a4a2a 100%);
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid rgba(255,255,255,0.1);
}

.launch-scene .ground {
    border-radius: 0 0 18px 18px;
}

/* Launch rocket animation */
.launch-rocket {
    position: absolute;
    bottom: 58px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
}

.launch-rocket.launching {
    animation: rocketLaunch 3s ease-in forwards;
}

@keyframes rocketLaunch {
    0% { bottom: 58px; }
    10% { bottom: 55px; }
    20% { bottom: 60px; }
    30% { bottom: 58px; }
    40% { bottom: 70px; }
    60% { bottom: 150px; }
    100% { bottom: 450px; }
}

/* Flame */
.rocket-flame {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 15px;
    background: radial-gradient(ellipse at center, #ff6600 0%, #ff3300 50%, transparent 100%);
    border-radius: 0 0 50% 50%;
    opacity: 0;
    transition: all 0.3s;
}

.rocket-flame.active {
    opacity: 1;
    animation: flameFlicker 0.1s ease infinite alternate;
    height: 40px;
    width: 30px;
}

.rocket-flame.boost {
    height: 80px;
    width: 40px;
}

@keyframes flameFlicker {
    0% { height: 35px; opacity: 0.9; }
    100% { height: 45px; opacity: 1; }
}

/* Smoke */
.smoke-particle {
    position: absolute;
    border-radius: 50%;
    background: rgba(200, 200, 200, 0.6);
    z-index: 2;
    animation: smokeRise 1.5s ease-out forwards;
}

@keyframes smokeRise {
    0% { opacity: 0.8; transform: scale(1); }
    100% { opacity: 0; transform: scale(3) translateY(-50px); }
}

/* Dog in window during launch */
.dog-in-window {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7em;
    z-index: 10;
}

/* Countdown */
.countdown {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 5em;
    font-weight: bold;
    z-index: 10;
    text-shadow: 0 0 30px rgba(255,200,0,0.8);
    animation: countPulse 0.8s ease;
}

@keyframes countPulse {
    0% { transform: translate(-50%, -50%) scale(2); opacity: 0; }
    50% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0.8; }
}

/* Sad walk animation */
.sad-dog {
    position: absolute;
    bottom: 50px;
    font-size: 2.5em;
    z-index: 4;
}

.sad-dog.walking {
    animation: sadWalk 4s ease-in forwards;
}

@keyframes sadWalk {
    0% { left: 30%; transform: scaleX(1); }
    10% { left: 30%; transform: scaleX(-1); }
    100% { left: -15%; transform: scaleX(-1); }
}

.sad-bubble {
    position: absolute;
    bottom: 95px;
    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.3);
    animation: sadBubbleFollow 4s ease-in forwards;
    opacity: 1;
}

.sad-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;
}

@keyframes sadBubbleFollow {
    0% { left: 15%; opacity: 1; }
    10% { left: 15%; opacity: 1; }
    50% { opacity: 0.8; }
    80% { opacity: 0; }
    100% { left: -20%; opacity: 0; }
}

/* Tear drop */
.tear {
    position: absolute;
    font-size: 0.5em;
    animation: tearDrop 1s ease-in infinite;
    z-index: 5;
}

@keyframes tearDrop {
    0% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(20px); }
}

/* Celebration stars flying */
.celebration-star {
    position: absolute;
    font-size: 1.5em;
    z-index: 10;
    animation: starShoot 1s ease-out forwards;
}

@keyframes starShoot {
    0% { opacity: 1; transform: scale(0); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(0.5) translateY(-100px); }
}

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

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

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

.btn-restart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    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(102, 126, 234, 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: 220px; }
    .scene-dog { font-size: 2em; }
    .speech-bubble { font-size: 0.75em; }
}
