* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 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: 1000px;
    width: 100%;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
}

/* Story Box */
.story-box {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border-left: 5px solid #6a1b9a;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.story-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.icon {
    font-size: 50px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.header-text strong {
    color: #4a148c;
    font-size: 20px;
    display: block;
}

.header-text p {
    color: #666;
    font-size: 14px;
    margin-top: 3px;
}

.story-text {
    color: #333;
    line-height: 1.8;
    font-size: 18px;
    text-align: center;
}

/* Tablecloth Section */
.tablecloth-section {
    margin: 40px 0;
    display: flex;
    justify-content: center;
}

.tablecloth-wrapper {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    border: 3px solid #c2185b;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.tablecloth-img {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    border-radius: 10px;
    filter: hue-rotate(280deg) saturate(1.2);
}

/* Info Section */
.info-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.info-box {
    background: linear-gradient(135deg, #e8eaf6 0%, #c5cae9 100%);
    border: 3px solid #3f51b5;
    border-radius: 15px;
    padding: 20px;
}

.info-label {
    font-size: 18px;
    font-weight: bold;
    color: #283593;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid #3f51b5;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    font-size: 16px;
    color: #333;
}

.value {
    color: #d84315;
    font-weight: bold;
    font-size: 18px;
}

.formula-text {
    font-family: 'Courier New', monospace;
    font-size: 16px;
    color: #1565c0;
    font-weight: bold;
}

/* Question Section */
.question-section {
    margin: 30px 0;
}

.question-label {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border-radius: 10px;
    border-left: 5px solid #ff6f00;
}

.question-text {
    font-size: 18px;
    color: #555;
    text-align: center;
    margin-bottom: 25px;
}

/* Input Container */
.input-container {
    display: flex;
    gap: 15px;
    margin: 25px 0;
    justify-content: center;
    align-items: stretch;
}

#answerInput {
    flex: 1;
    max-width: 400px;
    padding: 20px;
    font-size: 20px;
    border: 3px solid #9c27b0;
    border-radius: 12px;
    outline: none;
    transition: all 0.3s ease;
    text-align: center;
}

#answerInput:focus {
    border-color: #7b1fa2;
    box-shadow: 0 0 15px rgba(156, 39, 176, 0.3);
}

#answerInput.correct {
    border-color: #4caf50;
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

#answerInput.incorrect {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.submit-btn {
    background: #9c27b0;
    color: white;
    border: none;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit-btn:hover {
    background: #7b1fa2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(156, 39, 176, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Feedback */
.feedback {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    min-height: 30px;
    margin-top: 20px;
    padding: 15px;
    border-radius: 10px;
}

.feedback.success {
    color: #4caf50;
    background: linear-gradient(135deg, #c8e6c9 0%, #a5d6a7 100%);
}

.feedback.error {
    color: #f44336;
    background: linear-gradient(135deg, #ffcdd2 0%, #ef9a9a 100%);
}

/* Reset Button */
.reset-btn {
    display: block;
    margin: 20px auto;
    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;
}

.reset-btn:hover {
    background: #388e3c;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.reset-btn:active {
    transform: translateY(0);
}

/* Thumbs Up Animation */
.thumbs-up-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.thumbs-up-container.active {
    display: block;
}

.thumbs-up {
    position: absolute;
    font-size: 60px;
    bottom: -100px;
    animation: rise 2s ease-out forwards;
    opacity: 0;
}

.thumbs-up:nth-child(1) { left: 10%; animation-delay: 0s; }
.thumbs-up:nth-child(2) { left: 20%; animation-delay: 0.1s; }
.thumbs-up:nth-child(3) { left: 30%; animation-delay: 0.2s; }
.thumbs-up:nth-child(4) { left: 40%; animation-delay: 0.3s; }
.thumbs-up:nth-child(5) { left: 50%; animation-delay: 0.4s; }
.thumbs-up:nth-child(6) { left: 60%; animation-delay: 0.5s; }
.thumbs-up:nth-child(7) { left: 70%; animation-delay: 0.6s; }
.thumbs-up:nth-child(8) { left: 80%; animation-delay: 0.7s; }
.thumbs-up:nth-child(9) { left: 90%; animation-delay: 0.8s; }
.thumbs-up:nth-child(10) { left: 15%; animation-delay: 0.9s; }

@keyframes rise {
    0% {
        bottom: -100px;
        opacity: 0;
        transform: scale(0.5) rotate(0deg);
    }
    50% {
        opacity: 1;
        transform: scale(1) rotate(10deg);
    }
    100% {
        bottom: 100%;
        opacity: 0;
        transform: scale(0.8) rotate(-10deg);
    }
}

/* Responsive */
@media (max-width: 968px) {
    .info-section {
        grid-template-columns: 1fr;
    }

    .input-container {
        flex-direction: column;
        align-items: stretch;
    }

    #answerInput {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .tablecloth-img {
        max-width: 450px;
    }

    .question-label {
        font-size: 18px;
    }

    #answerInput {
        font-size: 18px;
        padding: 15px;
    }

    .submit-btn {
        font-size: 16px;
        padding: 15px 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 22px;
    }

    .story-text {
        font-size: 16px;
    }

    .tablecloth-img {
        max-width: 350px;
    }

    .question-label {
        font-size: 16px;
    }

    #answerInput {
        font-size: 16px;
        padding: 12px;
    }

    .submit-btn {
        font-size: 14px;
        padding: 12px 25px;
    }

    .feedback {
        font-size: 18px;
    }
}
