* {
    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: 1200px;
    width: 100%;
    position: relative;
}

h1 {
    color: #333;
    text-align: center;
    margin-bottom: 25px;
    font-size: 32px;
}

.instructions-box {
    background: #e1f5fe;
    border-left: 5px solid #0288d1;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.instructions-box .question {
    color: #01579b;
    font-weight: bold;
    font-size: 18px;
}

/* Game Area */
.game-area {
    margin: 30px 0;
}

.numbers-pool {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 15px;
    border: 3px dashed #ddd;
    margin-bottom: 40px;
}

.numbers-pool h3 {
    color: #333;
    text-align: center;
    margin-bottom: 15px;
    font-size: 18px;
}

.numbers-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    min-height: 70px;
}

.number-tile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 3px solid #5a67d8;
    border-radius: 12px;
    padding: 15px 25px;
    font-size: 24px;
    font-weight: bold;
    color: white;
    cursor: move;
    transition: all 0.3s ease;
    user-select: none;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.3);
}

.number-tile:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.number-tile.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.number-tile.placed {
    cursor: default;
}

.number-tile.correct {
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    border-color: #388e3c;
    cursor: default;
    animation: correct 0.5s ease;
}

.number-tile.incorrect {
    animation: shake 0.5s ease;
}

@keyframes correct {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Number Line */
.number-line-section {
    background: white;
    padding: 30px 20px;
    border-radius: 15px;
    border: 3px solid #e0e0e0;
}

.number-line-section h3 {
    color: #333;
    text-align: center;
    margin-bottom: 30px;
    font-size: 22px;
}

.number-line-container {
    position: relative;
    padding: 20px 0;
}

.line {
    position: absolute;
    top: 50%;
    left: 20px;
    right: 20px;
    height: 4px;
    background: #2196f3;
    transform: translateY(-50%);
    z-index: 1;
}

.number-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.position-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    flex: 1;
}

.drop-box {
    width: 70px;
    height: 70px;
    background: white;
    border: 3px dashed #ddd;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    transition: all 0.3s ease;
    position: relative;
}

.drop-box .placeholder {
    color: #999;
    font-size: 24px;
    font-weight: bold;
}

.drop-box.has-number .placeholder {
    display: none;
}

.drop-box.drag-over {
    background: #e3f2fd;
    border-color: #2196f3;
    border-style: solid;
    transform: scale(1.1);
}

.marker-tick {
    width: 3px;
    height: 20px;
    background: #2196f3;
    margin-bottom: 5px;
}

.marker-label {
    font-size: 14px;
    font-weight: bold;
    color: #666;
    white-space: nowrap;
}

.position-marker.start .marker-label,
.position-marker.end .marker-label {
    color: #2196f3;
    font-size: 16px;
}

/* In drop box number tile */
.drop-box .number-tile {
    padding: 10px 15px;
    font-size: 20px;
    margin: 0;
}

/* Buttons */
.button-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0 20px 0;
}

button {
    background: #2196f3;
    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: #1976d2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(33, 150, 243, 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: #fff3e0;
    border-left: 5px solid #ff9800;
    padding: 20px;
    border-radius: 10px;
    margin-top: 30px;
}

.info-box h3 {
    color: #e65100;
    margin-bottom: 10px;
    font-size: 18px;
}

.info-box p {
    color: #555;
    line-height: 1.8;
}

/* Clap Animation */
.clap-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    display: none;
}

.clap-animation.active {
    display: block;
}

.clap-emoji {
    position: absolute;
    font-size: 80px;
    animation: clap 1.5s ease-out forwards;
    opacity: 0;
}

.clap-emoji:nth-child(1) {
    left: 20%;
    top: 30%;
    animation-delay: 0s;
}

.clap-emoji:nth-child(2) {
    left: 50%;
    top: 20%;
    animation-delay: 0.2s;
}

.clap-emoji:nth-child(3) {
    left: 70%;
    top: 35%;
    animation-delay: 0.4s;
}

.clap-emoji:nth-child(4) {
    left: 35%;
    top: 50%;
    animation-delay: 0.6s;
}

.clap-emoji:nth-child(5) {
    left: 65%;
    top: 55%;
    animation-delay: 0.8s;
}

@keyframes clap {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(0);
    }
    20% {
        opacity: 1;
        transform: scale(1.2) translateY(-20px);
    }
    40% {
        transform: scale(1) translateY(-40px);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-100px);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .number-line {
        padding: 0 10px;
    }

    .drop-box {
        width: 60px;
        height: 60px;
    }

    .drop-box .number-tile {
        padding: 8px 12px;
        font-size: 18px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 26px;
    }

    .number-line-container {
        overflow-x: auto;
        padding-bottom: 20px;
    }

    .number-line {
        min-width: 900px;
    }

    .number-tile {
        padding: 12px 20px;
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .instructions-box {
        padding: 15px;
    }

    .numbers-pool {
        padding: 15px;
    }

    .number-tile {
        padding: 10px 15px;
        font-size: 18px;
    }
}
