* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    overflow-x: hidden;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 1100px;
    width: 100%;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
}

.story-box {
    background: #e8eaf6;
    border-left: 5px solid #5c6bc0;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.story-box p {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 10px;
}

.story-box ul {
    margin: 15px 0;
    padding-left: 30px;
}

.story-box li {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 8px;
}

.story-box .question {
    color: #3949ab;
    font-weight: bold;
    font-size: 17px;
    margin-top: 15px;
}

/* Field Trip Scene */
.field-trip-scene {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
}

.destination {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 3px solid transparent;
}

.destination:hover {
    transform: translateY(-5px);
}

.science-museum {
    border-color: #2196f3;
}

.art-gallery {
    border-color: #ff9800;
}

.historical-site {
    border-color: #4caf50;
}

.destination-icon {
    font-size: 60px;
    margin-bottom: 15px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.destination-name {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.fraction-display {
    font-size: 20px;
    font-weight: bold;
    color: #5c6bc0;
    margin: 15px 0;
    padding: 10px;
    background: #e8eaf6;
    border-radius: 10px;
}

.student-group {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.student {
    font-size: 30px;
    animation: wave 2s ease-in-out infinite;
}

.student:nth-child(2) { animation-delay: 0.2s; }
.student:nth-child(3) { animation-delay: 0.4s; }
.student:nth-child(4) { animation-delay: 0.6s; }

@keyframes wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-10deg); }
    75% { transform: rotate(10deg); }
}

/* Solution Steps */
.solution-steps {
    background: #fff3e0;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
    border-left: 5px solid #ff9800;
}

.solution-steps h3 {
    color: #e65100;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.step {
    display: flex;
    gap: 15px;
    align-items: flex-start;
    margin-bottom: 20px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.step:last-child {
    margin-bottom: 0;
}

.step-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content strong {
    color: #333;
    display: block;
    margin-bottom: 8px;
}

.calculation {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 8px;
    font-size: 15px;
    color: #555;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
}

.highlight {
    background: #ffeb3b;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    color: #e65100;
}

/* Visual Representation */
.visual-representation {
    background: #e8f5e9;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
}

.visual-representation h3 {
    color: #2e7d32;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.fraction-bar {
    display: flex;
    width: 100%;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
}

.fraction-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 3px solid white;
    transition: all 0.3s ease;
    position: relative;
}

.fraction-segment:last-child {
    border-right: none;
}

.fraction-segment.museum {
    background: linear-gradient(135deg, #2196f3 0%, #1976d2 100%);
}

.fraction-segment.gallery {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
}

.fraction-segment.historical {
    background: linear-gradient(135deg, #4caf50 0%, #388e3c 100%);
}

.segment-label {
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-align: center;
    line-height: 1.4;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.bar-label {
    text-align: center;
    font-size: 14px;
    color: #555;
    font-style: italic;
}

/* Answer Section */
.answer-section {
    margin: 30px 0;
}

.answer-section h3 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
}

.choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 600px;
    margin: 0 auto;
}

.choice-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #5a67d8;
    border-radius: 15px;
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.choice-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.choice-letter {
    background: rgba(255, 255, 255, 0.3);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.choice-text {
    flex: 1;
    text-align: left;
    font-size: 28px;
}

.choice-btn.correct {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-color: #388e3c;
    animation: correct-pulse 0.5s ease;
}

.choice-btn.incorrect {
    animation: shake 0.5s ease;
}

.choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

@keyframes correct-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

/* Buttons */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0 20px 0;
}

button {
    background: #5c6bc0;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: #3949ab;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(92, 107, 192, 0.4);
}

button:active {
    transform: translateY(0);
}

.feedback {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    min-height: 30px;
    margin: 20px 0;
}

.feedback.success {
    color: #4caf50;
}

.feedback.error {
    color: #f44336;
}

.feedback.warning {
    color: #ff9800;
}

.info-box {
    background: #e3f2fd;
    border-left: 5px solid #2196f3;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.info-box h3 {
    color: #1565c0;
    margin-bottom: 10px;
    font-size: 18px;
}

.info-box p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 10px;
}

.info-box ol {
    margin: 10px 0;
    padding-left: 25px;
}

.info-box li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
}

.final-answer {
    background: #ffeb3b;
    padding: 3px 10px;
    border-radius: 5px;
    font-weight: bold;
    color: #e65100;
    font-size: 18px;
}

/* Clapping Animation */
.clapping-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.clapping-animation.active {
    display: block;
}

.clap-emoji {
    position: absolute;
    font-size: 70px;
    animation: clap 1.5s ease-out forwards;
    opacity: 0;
}

.clap-emoji:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.clap-emoji:nth-child(2) {
    left: 25%;
    top: 60%;
    animation-delay: 0.1s;
}

.clap-emoji:nth-child(3) {
    left: 40%;
    top: 30%;
    animation-delay: 0.2s;
}

.clap-emoji:nth-child(4) {
    left: 55%;
    top: 70%;
    animation-delay: 0.3s;
}

.clap-emoji:nth-child(5) {
    left: 70%;
    top: 25%;
    animation-delay: 0.4s;
}

.clap-emoji:nth-child(6) {
    left: 85%;
    top: 55%;
    animation-delay: 0.5s;
}

.clap-emoji:nth-child(7) {
    left: 20%;
    top: 45%;
    animation-delay: 0.6s;
}

.clap-emoji:nth-child(8) {
    left: 75%;
    top: 80%;
    animation-delay: 0.7s;
}

@keyframes clap {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1.3) rotate(15deg);
    }
    40% {
        transform: scale(1) rotate(-10deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    80% {
        transform: scale(0.9) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.7) rotate(0deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .field-trip-scene {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .choices {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .choice-btn {
        padding: 18px;
    }

    .choice-text {
        font-size: 24px;
    }

    .fraction-bar {
        height: 80px;
    }

    .segment-label {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .story-box {
        padding: 15px;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .destination-icon {
        font-size: 45px;
    }

    .student {
        font-size: 25px;
    }
}
