* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 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: #e8f5e9;
    border-left: 5px solid #4caf50;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.instruction {
    color: #555;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.main-equation {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.equation-display {
    font-size: 32px;
    font-weight: bold;
    color: #1565c0;
    text-align: center;
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #2196f3;
}

/* Calculator Scene */
.calculator-scene {
    display: flex;
    gap: 40px;
    justify-content: center;
    align-items: center;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 15px;
    flex-wrap: wrap;
}

.calculator-visual {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 350px;
}

.calculator-screen {
    background: #c7ecee;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 15px;
    min-height: 120px;
    font-family: 'Courier New', monospace;
    box-shadow: inset 0 3px 8px rgba(0, 0, 0, 0.2);
}

.calculation-steps {
    color: #1565c0;
    font-size: 14px;
    line-height: 1.6;
}

.step-line {
    margin-bottom: 5px;
}

.calculator-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    color: #2c3e50;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calc-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.3);
}

.calc-btn:active {
    transform: translateY(0);
}

.thinking-emoji {
    text-align: center;
}

.thinking-emoji .emoji {
    font-size: 100px;
    animation: think 2s ease-in-out infinite;
}

@keyframes think {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

.thought-bubble {
    background: white;
    border-radius: 20px;
    padding: 15px 25px;
    margin-top: 15px;
    font-size: 16px;
    font-weight: bold;
    color: #555;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    position: relative;
}

.thought-bubble::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-bottom: 15px solid white;
}

/* 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;
    border: 3px solid #4caf50;
}

.step-number {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 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: 16px;
    color: #555;
    margin-top: 5px;
    font-family: 'Courier New', monospace;
}

.highlight-step {
    background: #ffeb3b;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
    color: #f57c00;
}

.highlight {
    background: #ffeb3b;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    color: #e65100;
    font-size: 18px;
}

.highlight-final {
    background: #4caf50;
    padding: 3px 8px;
    border-radius: 5px;
    font-weight: bold;
    color: white;
    font-size: 18px;
}

/* Operation Visual */
.operation-visual {
    background: #e3f2fd;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
}

.operation-visual h3 {
    color: #1565c0;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.flow-box {
    background: white;
    border: 3px solid #2196f3;
    border-radius: 10px;
    padding: 12px 18px;
    font-size: 18px;
    font-weight: bold;
    color: #1565c0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.flow-box.answer-box {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-color: #388e3c;
    color: white;
    font-size: 22px;
    padding: 15px 25px;
}

.flow-arrow {
    font-size: 24px;
    color: #2196f3;
    font-weight: bold;
}

/* 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, #4facfe 0%, #00f2fe 100%);
    border: 3px solid #2196f3;
    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(79, 172, 254, 0.3);
}

.choice-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 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: #2196f3;
    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: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 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: #e8f5e9;
    border-left: 5px solid #4caf50;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.info-box h3 {
    color: #2e7d32;
    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;
}

.bodmas {
    font-weight: bold;
    color: #f44336;
}

.final-answer-display {
    background: #c8e6c9;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    margin-top: 15px;
}

.final-answer {
    background: #4caf50;
    padding: 5px 15px;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    font-size: 24px;
}

/* Thumbs Up Animation */
.thumbs-up-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.thumbs-up-animation.active {
    display: block;
}

.thumb-emoji {
    position: absolute;
    font-size: 80px;
    animation: thumbsUp 1.5s ease-out forwards;
    opacity: 0;
}

.thumb-emoji:nth-child(1) {
    left: 15%;
    top: 25%;
    animation-delay: 0s;
}

.thumb-emoji:nth-child(2) {
    left: 45%;
    top: 15%;
    animation-delay: 0.2s;
}

.thumb-emoji:nth-child(3) {
    left: 75%;
    top: 30%;
    animation-delay: 0.4s;
}

.thumb-emoji:nth-child(4) {
    left: 30%;
    top: 55%;
    animation-delay: 0.6s;
}

.thumb-emoji:nth-child(5) {
    left: 65%;
    top: 60%;
    animation-delay: 0.8s;
}

.thumb-emoji:nth-child(6) {
    left: 85%;
    top: 45%;
    animation-delay: 1s;
}

.thumb-emoji:nth-child(7) {
    left: 20%;
    top: 75%;
    animation-delay: 1.2s;
}

.thumb-emoji:nth-child(8) {
    left: 55%;
    top: 80%;
    animation-delay: 1.4s;
}

@keyframes thumbsUp {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(0) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: scale(1.3) translateY(-30px) rotate(10deg);
    }
    40% {
        transform: scale(1) translateY(-50px) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-120px) rotate(15deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .equation-display {
        font-size: 24px;
        padding: 15px;
    }

    .calculator-scene {
        flex-direction: column;
        padding: 20px;
    }

    .calculator-visual {
        max-width: 100%;
    }

    .thinking-emoji .emoji {
        font-size: 70px;
    }

    .choices {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .choice-btn {
        padding: 18px;
    }

    .choice-text {
        font-size: 24px;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }
}

@media (max-width: 480px) {
    .main-equation {
        padding: 15px;
    }

    .equation-display {
        font-size: 20px;
    }

    .step {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .calculator-buttons {
        gap: 8px;
    }

    .calc-btn {
        padding: 12px;
        font-size: 16px;
    }
}
