* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 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: 950px;
    width: 100%;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
}

.story-box {
    background: #fff8e1;
    border-left: 5px solid #fbc02d;
    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 p:last-child {
    margin-bottom: 0;
}

.story-box .question {
    color: #f57c00;
    font-weight: bold;
    font-size: 18px;
    margin-top: 15px;
}

.visual-container {
    display: flex;
    gap: 40px;
    justify-content: space-around;
    align-items: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

/* Tree Styles */
.tree-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 450px;
}

.tree {
    position: relative;
    width: 250px;
    height: 400px;
}

.tree-crown {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, #66bb6a 0%, #4caf50 100%);
    border-radius: 50%;
    box-shadow: 0 5px 20px rgba(76, 175, 80, 0.4);
}

.tree-crown::before,
.tree-crown::after {
    content: '';
    position: absolute;
    background: radial-gradient(circle, #66bb6a 0%, #4caf50 100%);
    border-radius: 50%;
}

.tree-crown::before {
    width: 140px;
    height: 140px;
    top: -30px;
    left: -40px;
}

.tree-crown::after {
    width: 140px;
    height: 140px;
    top: -30px;
    right: -40px;
}

.tree-trunk {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 100%;
    background: linear-gradient(to right, #6d4c41 0%, #8d6e63 50%, #6d4c41 100%);
    border-radius: 10px;
    z-index: 1;
}

.ground-line {
    position: absolute;
    bottom: 0;
    left: -50px;
    right: -50px;
    height: 5px;
    background: #795548;
    border-radius: 5px;
}

.ground-line::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: #8d6e63;
    border-radius: 0 0 10px 10px;
}

.height-marker {
    position: absolute;
    left: -80px;
    display: flex;
    align-items: center;
    z-index: 2;
}

.marker-line {
    width: 70px;
    height: 2px;
    background: #999;
    border-left: 3px solid #666;
}

.marker-label {
    font-size: 12px;
    color: #666;
    font-weight: bold;
    white-space: nowrap;
    margin-left: -65px;
}

.branch {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 8px;
    background: linear-gradient(to right, #6d4c41 0%, #8d6e63 50%, #6d4c41 100%);
    border-radius: 10px;
    z-index: 2;
}

.monkey {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 50px;
    z-index: 10;
    transition: all 1s ease;
}

.monkey.initial {
    bottom: 70px;
}

.monkey.final {
    bottom: 40px;
    opacity: 0;
}

.monkey.show {
    opacity: 1;
}

.position-label {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    color: #4caf50;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid #4caf50;
}

.jump-arrow {
    position: absolute;
    left: 70%;
    bottom: 55px;
    z-index: 5;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.jump-arrow.show {
    opacity: 1;
}

.arrow-body {
    font-size: 40px;
    color: #ff9800;
    line-height: 1;
}

.arrow-label {
    background: #ff9800;
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
}

/* Horizontal Number Line */
.number-line-visual {
    flex: 1;
    min-width: 100%;
}

.number-line-visual h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.horizontal-number-line {
    background: #f5f5f5;
    padding: 25px 15px;
    border-radius: 15px;
    border: 3px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow-x: auto;
}

.horizontal-number-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 4px;
    background: #ddd;
    transform: translateY(-50%);
    z-index: 1;
}

.hline-point {
    background: white;
    border: 2px solid #ddd;
    border-radius: 10px;
    padding: 12px 8px;
    font-size: 13px;
    font-weight: bold;
    color: #666;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 65px;
    position: relative;
    z-index: 2;
    line-height: 1.3;
}

.hline-point small {
    font-size: 10px;
    display: block;
    margin-top: 3px;
}

.hline-point.highlight {
    border-color: #4caf50;
    background: #e8f5e9;
    color: #2e7d32;
    border-width: 3px;
}

.hline-point.start {
    border-color: #ff9800;
    background: #fff3e0;
    color: #e65100;
    border-width: 3px;
}

.hline-point.end {
    border-color: #2196f3;
    background: #e3f2fd;
    color: #0d47a1;
    font-size: 15px;
    border-width: 3px;
}

.hline-point.ground {
    border-color: #795548;
    background: #efebe9;
    color: #4e342e;
}

.calculation-hint {
    margin-top: 15px;
    background: #e3f2fd;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    font-size: 16px;
    color: #1565c0;
    border: 2px solid #2196f3;
}

/* Choices */
.choices-container {
    margin: 30px 0;
}

.choices-container h3 {
    color: #333;
    margin-bottom: 20px;
    text-align: center;
    font-size: 20px;
}

.choices {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.choice-btn {
    background: white;
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 18px;
}

.choice-btn:hover:not(:disabled) {
    border-color: #66bb6a;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(102, 187, 106, 0.3);
}

.choice-letter {
    background: #f0f0f0;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 20px;
    color: #666;
}

.choice-text {
    font-weight: bold;
    color: #333;
}

.choice-btn.correct {
    background: #4caf50;
    border-color: #45a049;
    color: white;
    animation: correct 0.5s ease;
}

.choice-btn.correct .choice-letter {
    background: white;
    color: #4caf50;
}

.choice-btn.correct .choice-text {
    color: white;
}

.choice-btn.incorrect {
    background: #f44336;
    border-color: #da190b;
    animation: shake 0.5s ease;
}

.choice-btn.revealed {
    background: #ff9800;
    border-color: #f57c00;
    color: white;
}

.choice-btn.revealed .choice-letter {
    background: white;
    color: #ff9800;
}

.choice-btn.revealed .choice-text {
    color: white;
}

.choice-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

@keyframes correct {
    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); }
}

.button-container {
    display: flex;
    justify-content: center;
    margin: 30px 0 20px 0;
}

.reset-btn {
    background: #66bb6a;
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #57a35b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 187, 106, 0.4);
}

.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;
}

/* Balloons */
.balloons-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: hidden;
}

.balloon {
    position: absolute;
    bottom: -150px;
    font-size: 60px;
    animation: rise 4s ease-in forwards;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.3));
}

@keyframes rise {
    0% {
        bottom: -150px;
        opacity: 1;
        transform: translateX(0) rotate(0deg);
    }
    100% {
        bottom: 110vh;
        opacity: 0;
        transform: translateX(var(--drift, 0px)) rotate(var(--rotate, 0deg));
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .visual-container {
        flex-direction: column;
        gap: 30px;
    }

    .choices {
        grid-template-columns: 1fr;
    }

    .tree {
        width: 200px;
        height: 350px;
    }

    .tree-crown {
        width: 150px;
        height: 150px;
    }

    .monkey {
        font-size: 40px;
    }
}

@media (max-width: 480px) {
    .story-box {
        padding: 15px;
    }

    .choice-btn {
        padding: 15px;
        font-size: 16px;
    }

    .choice-letter {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}
