* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 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;
}

/* Instructions Box */
.instructions-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 5px solid #1976d2;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.instructions-box h3 {
    color: #0d47a1;
    margin-bottom: 12px;
    font-size: 20px;
}

.instructions-box p {
    color: #333;
    line-height: 1.8;
    font-size: 16px;
    margin-bottom: 8px;
}

.instructions-box p:last-child {
    margin-bottom: 0;
}

/* Values Section */
.values-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.value-card {
    background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
    border: 3px solid #ff9800;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.variable {
    font-size: 36px;
    font-weight: bold;
    color: #e65100;
    font-family: 'Courier New', monospace;
}

.equals {
    font-size: 32px;
    color: #666;
}

.value {
    font-size: 36px;
    font-weight: bold;
    color: #d84315;
    font-family: 'Courier New', monospace;
}

/* Expression Section */
.expression-section {
    background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
    border: 3px solid #9c27b0;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.expression-section h3 {
    color: #6a1b9a;
    text-align: center;
    margin-bottom: 20px;
    font-size: 22px;
}

.expression-display {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.fraction-group {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 28px;
}

.fraction {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 20px;
    background: white;
    border-radius: 10px;
    border: 2px solid #9c27b0;
}

.numerator {
    padding-bottom: 8px;
    border-bottom: 3px solid #333;
    min-width: 120px;
    text-align: center;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 24px;
}

.denominator {
    padding-top: 8px;
    min-width: 120px;
    text-align: center;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 24px;
}

.operator {
    font-size: 40px;
    font-weight: bold;
    color: #9c27b0;
}

/* Calculation Steps */
.calculation-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.step-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4caf50;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.step-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.step-text {
    font-size: 14px;
    color: #2e7d32;
    font-weight: bold;
}

/* Answer Section */
.answer-section {
    background: linear-gradient(135deg, #fce4ec 0%, #f8bbd0 100%);
    border: 3px solid #e91e63;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.answer-section h3 {
    color: #c2185b;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

/* Drop Zone */
.drop-zone {
    min-width: 250px;
    min-height: 120px;
    border: 4px dashed #e91e63;
    border-radius: 20px;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    transition: all 0.3s ease;
    margin: 0 auto;
    max-width: 300px;
}

.drop-zone .placeholder {
    color: #999;
    font-size: 18px;
    text-align: center;
}

.drop-zone.drag-over {
    background: #fce4ec;
    border-color: #c2185b;
    transform: scale(1.05);
}

.drop-zone.filled .placeholder {
    display: none;
}

.drop-zone.filled {
    font-size: 48px;
    font-weight: bold;
    color: #c2185b;
    font-family: 'Courier New', monospace;
}

.drop-zone.blink-green {
    animation: blink-green 0.6s ease;
}

.drop-zone.blink-red {
    animation: blink-red 0.6s ease;
}

@keyframes blink-green {
    0%, 100% { background: white; border-color: #e91e63; }
    50% { background: #4caf50; border-color: #2e7d32; }
}

@keyframes blink-red {
    0%, 100% { background: white; border-color: #e91e63; }
    50% { background: #f44336; border-color: #c62828; }
}

/* Options Section */
.options-section {
    background: linear-gradient(135deg, #e0f2f1 0%, #b2dfdb 100%);
    border: 3px solid #00796b;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.options-section h3 {
    color: #004d40;
    text-align: center;
    margin-bottom: 20px;
    font-size: 20px;
}

.options-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.option-card {
    background: white;
    border: 3px solid #00796b;
    border-radius: 15px;
    padding: 25px;
    cursor: move;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 121, 107, 0.3);
    border-color: #004d40;
}

.option-card.dragging {
    opacity: 0.5;
}

.option-card.hidden {
    display: none;
}

.option-value {
    font-size: 36px;
    font-weight: bold;
    color: #00796b;
    font-family: 'Courier New', monospace;
}

.mixed-fraction {
    font-size: 32px;
    font-weight: bold;
    color: #00796b;
    font-family: 'Courier New', monospace;
}

.mixed-fraction sup {
    font-size: 20px;
    vertical-align: super;
}

.mixed-fraction sub {
    font-size: 20px;
    vertical-align: sub;
}

/* Feedback */
.feedback {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    min-height: 30px;
    margin: 20px 0;
}

.feedback.success {
    color: #4caf50;
}

.feedback.error {
    color: #f44336;
}

/* 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);
}

/* Clapping Animation */
.clapping-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.clapping-animation.active {
    display: block;
}

.clap-emoji {
    position: absolute;
    font-size: 70px;
    animation: clapping 2s ease-out forwards;
    opacity: 0;
}

.clap-emoji:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.clap-emoji:nth-child(2) {
    left: 25%;
    top: 35%;
    animation-delay: 0.15s;
}

.clap-emoji:nth-child(3) {
    left: 45%;
    top: 15%;
    animation-delay: 0.3s;
}

.clap-emoji:nth-child(4) {
    left: 60%;
    top: 40%;
    animation-delay: 0.45s;
}

.clap-emoji:nth-child(5) {
    left: 80%;
    top: 25%;
    animation-delay: 0.6s;
}

.clap-emoji:nth-child(6) {
    left: 20%;
    top: 60%;
    animation-delay: 0.75s;
}

.clap-emoji:nth-child(7) {
    left: 40%;
    top: 70%;
    animation-delay: 0.9s;
}

.clap-emoji:nth-child(8) {
    left: 65%;
    top: 65%;
    animation-delay: 1.05s;
}

.clap-emoji:nth-child(9) {
    left: 85%;
    top: 55%;
    animation-delay: 1.2s;
}

.clap-emoji:nth-child(10) {
    left: 50%;
    top: 50%;
    animation-delay: 1.35s;
}

@keyframes clapping {
    0% {
        opacity: 0;
        transform: scale(0.3) rotate(0deg);
    }
    15% {
        opacity: 1;
        transform: scale(1.2) rotate(15deg);
    }
    30% {
        transform: scale(0.9) rotate(-10deg);
    }
    45% {
        transform: scale(1.1) rotate(10deg);
    }
    60% {
        transform: scale(1) rotate(-5deg);
    }
    100% {
        opacity: 0;
        transform: scale(0.5) rotate(20deg);
    }
}

/* Responsive */
@media (max-width: 968px) {
    .options-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .calculation-steps {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .values-section {
        grid-template-columns: 1fr;
    }

    .fraction-group {
        flex-direction: column;
        gap: 10px;
    }

    .options-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 22px;
    }

    .variable,
    .value {
        font-size: 28px;
    }

    .numerator,
    .denominator {
        font-size: 20px;
        min-width: 100px;
    }

    .option-value {
        font-size: 28px;
    }
}
