* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 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: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-left: 5px solid #ff6f00;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.character-intro {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.avatar {
    font-size: 50px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.intro-text strong {
    color: #e65100;
    font-size: 20px;
    display: block;
}

.intro-text p {
    color: #666;
    font-size: 14px;
    margin-top: 3px;
}

.story-text {
    color: #333;
    line-height: 1.8;
    font-size: 16px;
}

.story-text strong {
    color: #ff6f00;
    font-size: 18px;
}

/* Weighing Scale */
.scale-section {
    display: flex;
    justify-content: center;
    margin: 40px 0;
    padding: 30px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: 15px;
}

.weighing-machine {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.scale-platform {
    background: linear-gradient(135deg, #90a4ae 0%, #607d8b 100%);
    width: 280px;
    height: 35px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    position: relative;
}

.juice-glass {
    position: absolute;
    top: -180px;
    animation: gentle-bounce 2s ease-in-out infinite;
}

@keyframes gentle-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.glass-container {
    width: 120px;
    height: 160px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border: 4px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px 8px 15px 15px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.juice-liquid {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 85%;
    background: linear-gradient(180deg, #ffb347 0%, #ff8c00 100%);
    border-radius: 0 0 12px 12px;
    animation: juice-wave 3s ease-in-out infinite;
}

@keyframes juice-wave {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.98); }
}

.glass-shine {
    position: absolute;
    top: 20px;
    left: 15px;
    width: 25px;
    height: 50px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 50%;
    transform: rotate(-15deg);
}

.glass-label {
    text-align: center;
    font-size: 30px;
    margin-top: 8px;
}

.scale-display {
    background: linear-gradient(135deg, #263238 0%, #37474f 100%);
    width: 280px;
    height: 100px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.display-screen {
    background: #1b5e20;
    width: 240px;
    height: 70px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
}

.display-text {
    color: #00e676;
    font-size: 36px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    text-shadow: 0 0 10px #00e676;
    animation: digital-flicker 2s ease-in-out infinite;
}

@keyframes digital-flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.95; }
}

.display-unit {
    color: #69f0ae;
    font-size: 12px;
    margin-top: 3px;
    letter-spacing: 2px;
}

.scale-base {
    background: linear-gradient(135deg, #455a64 0%, #263238 100%);
    width: 300px;
    height: 40px;
    border-radius: 0 0 15px 15px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.scale-button {
    width: 30px;
    height: 20px;
    background: #546e7a;
    border-radius: 5px;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* Task Section */
.task-section {
    margin: 40px 0;
}

.task-section h3 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 20px;
}

.rounding-table {
    background: #f5f5f5;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.table-header {
    background: linear-gradient(135deg, #ff6f00 0%, #ff8f00 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 18px;
    gap: 20px;
}

.header-cell {
    color: white;
    font-weight: bold;
    font-size: 18px;
    text-align: center;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 20px;
    gap: 20px;
    border-bottom: 2px solid #e0e0e0;
    background: white;
    transition: background 0.3s ease;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:hover {
    background: #fafafa;
}

.label-cell {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.decimal-label {
    color: #333;
    font-weight: bold;
    font-size: 16px;
}

.input-cell {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.answer-input {
    flex: 1;
    padding: 12px 15px;
    font-size: 18px;
    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: #ff6f00;
    box-shadow: 0 0 10px rgba(255, 111, 0, 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: 28px;
    min-width: 35px;
    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: #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 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;
    }

    .weighing-machine {
        transform: scale(0.85);
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .label-cell {
        text-align: center;
    }

    .header-cell:first-child {
        border-bottom: 2px solid rgba(255, 255, 255, 0.5);
        padding-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .story-box {
        padding: 15px;
    }

    .story-text {
        font-size: 14px;
    }

    .weighing-machine {
        transform: scale(0.7);
    }

    .answer-input {
        font-size: 16px;
        padding: 10px;
    }
}
