* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 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: 900px;
    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: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.instruction {
    color: #333;
    line-height: 1.8;
    font-size: 18px;
    font-weight: 500;
}

/* Calculator Visual */
.calculator-visual {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
}

.calculator {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    max-width: 350px;
    width: 100%;
}

.calc-screen {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.calc-display {
    color: #00ff00;
    font-family: 'Courier New', monospace;
}

.expression {
    font-size: 20px;
    margin-bottom: 10px;
    text-shadow: 0 0 10px #00ff00;
    word-wrap: break-word;
}

.result {
    font-size: 28px;
    font-weight: bold;
    text-align: right;
    text-shadow: 0 0 15px #00ff00;
    animation: blink 2s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.calc-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.calc-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    color: white;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    cursor: default;
    user-select: none;
}

.calc-btn.operator {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

/* Problem Card */
.problem-card {
    background: linear-gradient(135deg, #fff9e6 0%, #ffe6b3 100%);
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    border: 3px solid #ff9800;
    box-shadow: 0 5px 15px rgba(255, 152, 0, 0.3);
}

.problem-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.icon {
    font-size: 35px;
}

.title {
    font-size: 22px;
    font-weight: bold;
    color: #e65100;
}

.problem-expression {
    font-size: 32px;
    font-weight: bold;
    color: #d84315;
    text-align: center;
    font-family: 'Courier New', monospace;
    margin: 20px 0;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.problem-hint {
    text-align: center;
    color: #555;
    font-style: italic;
    font-size: 14px;
}

/* Answer Section */
.answer-section {
    margin: 40px 0;
}

.answer-section h3 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
}

.input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    max-width: 500px;
    margin: 0 auto;
}

label {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.answer-input {
    flex: 1;
    padding: 15px 20px;
    font-size: 24px;
    border: 3px solid #bdbdbd;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
    background: white;
}

.answer-input:focus {
    outline: none;
    border-color: #2196f3;
    box-shadow: 0 0 10px rgba(33, 150, 243, 0.3);
}

.answer-input.correct {
    border-color: #4caf50;
    background: #e8f5e9;
}

.answer-input.incorrect {
    border-color: #f44336;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.validation-icon {
    font-size: 35px;
    min-width: 40px;
    text-align: center;
}

/* Buttons */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0 20px 0;
}

button {
    background: #4caf50;
    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: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 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 ul {
    margin: 10px 0;
    padding-left: 25px;
}

.info-box li {
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
}

/* 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;
    }

    .calculator {
        transform: scale(0.9);
    }

    .problem-expression {
        font-size: 24px;
    }

    .input-container {
        flex-direction: column;
        gap: 10px;
    }

    .answer-input {
        width: 100%;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .story-box {
        padding: 15px;
    }

    .instruction {
        font-size: 16px;
    }

    .calculator {
        transform: scale(0.75);
    }

    .problem-expression {
        font-size: 20px;
    }

    .answer-input {
        font-size: 18px;
        padding: 12px 15px;
    }
}
