* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #fa8bff 0%, #2bd2ff 50%, #2bff88 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: #e3f2fd;
    border-left: 5px solid #2196f3;
    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, #fff9c4 0%, #fff59d 100%);
    padding: 20px;
    border-radius: 10px;
    border: 3px solid #fbc02d;
}

/* Calculation Scene */
.calculation-scene {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    border-radius: 15px;
}

.math-tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.tool-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.tool-item:hover {
    transform: translateY(-5px) rotate(2deg);
}

.tool-icon {
    font-size: 50px;
    margin-bottom: 10px;
    animation: tool-float 3s ease-in-out infinite;
}

.tool-item:nth-child(2) .tool-icon { animation-delay: 0.5s; }
.tool-item:nth-child(3) .tool-icon { animation-delay: 1s; }
.tool-item:nth-child(4) .tool-icon { animation-delay: 1.5s; }

@keyframes tool-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tool-name {
    font-size: 14px;
    font-weight: bold;
    color: #555;
}

.working-area {
    display: flex;
    justify-content: center;
    align-items: center;
}

.notebook {
    background: white;
    border-radius: 10px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.notebook-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a6f 100%);
    padding: 15px;
    display: flex;
    justify-content: space-around;
}

.spiral {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: white;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.3);
}

.notebook-content {
    padding: 25px;
    background: linear-gradient(to right, #f8f9fa 0%, #f8f9fa 40px, white 40px);
    min-height: 250px;
}

.working-title {
    font-size: 20px;
    font-weight: bold;
    color: #2196f3;
    margin-bottom: 20px;
    text-align: center;
}

.working-line {
    font-size: 15px;
    color: #555;
    margin-bottom: 12px;
    padding-left: 20px;
    font-family: 'Courier New', monospace;
}

.working-answer {
    font-size: 18px;
    font-weight: bold;
    color: #4caf50;
    margin-top: 20px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 10px;
    text-align: center;
    border: 2px dashed #4caf50;
}

/* Solution Breakdown */
.solution-breakdown {
    background: #fff3e0;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
    border-left: 5px solid #ff9800;
}

.solution-breakdown h3 {
    color: #e65100;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.solution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.solution-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
    border: 3px solid #2196f3;
}

.solution-card:hover {
    transform: translateY(-5px);
}

.solution-card.highlight-card {
    border-color: #4caf50;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
}

.card-number {
    background: linear-gradient(135deg, #fa8bff 0%, #2bd2ff 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
}

.card-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 12px;
}

.card-content {
    font-size: 15px;
    color: #555;
    line-height: 1.8;
    font-family: 'Courier New', monospace;
}

.final-result {
    background: #ffeb3b;
    padding: 3px 10px;
    border-radius: 5px;
    font-weight: bold;
    color: #e65100;
    font-size: 18px;
}

/* Operation Flow */
.operation-flow {
    background: #e8f5e9;
    padding: 25px;
    border-radius: 15px;
    margin: 30px 0;
}

.operation-flow h3 {
    color: #2e7d32;
    margin-bottom: 20px;
    font-size: 20px;
    text-align: center;
}

.flow-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flow-step {
    width: 100%;
    max-width: 500px;
}

.flow-box {
    background: white;
    border: 3px solid #4caf50;
    border-radius: 12px;
    padding: 15px 20px;
    font-size: 18px;
    font-weight: bold;
    color: #2e7d32;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.flow-box.answer-flow {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    font-size: 24px;
    border-color: #388e3c;
}

.flow-arrow {
    font-size: 30px;
    color: #4caf50;
    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, #fa8bff 0%, #2bd2ff 100%);
    border: 3px solid #c471ed;
    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(250, 139, 255, 0.3);
}

.choice-btn:hover:not(:disabled) {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(250, 139, 255, 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;
    }

    .calculation-scene {
        grid-template-columns: 1fr;
        padding: 20px;
    }

    .math-tools {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .solution-grid {
        grid-template-columns: 1fr;
    }

    .choices {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .choice-btn {
        padding: 18px;
    }

    .choice-text {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .main-equation {
        padding: 15px;
    }

    .equation-display {
        font-size: 20px;
    }

    .math-tools {
        grid-template-columns: 1fr;
    }

    .tool-icon {
        font-size: 40px;
    }

    .notebook-content {
        padding: 20px;
    }

    .working-line {
        font-size: 13px;
    }
}
