* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Comic Sans MS', cursive, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.game-container {
    background: white;
    border-radius: 30px;
    padding: 30px;
    max-width: 900px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.header {
    text-align: center;
    margin-bottom: 20px;
}

.header h1 {
    color: #ff6b6b;
    font-size: 2.5em;
    text-shadow: 3px 3px 0px #ffd93d;
    margin-bottom: 15px;
}

.score {
    display: flex;
    justify-content: space-around;
    font-size: 1.5em;
    font-weight: bold;
    color: #4ecdc4;
}

.characters {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
}

.character {
    position: relative;
    text-align: center;
}

.character-img {
    width: 150px;
    height: 150px;
    object-fit: contain;
    animation: bounce 2s infinite;
    filter: drop-shadow(0 5px 15px rgba(0,0,0,0.3));
}

.captain-img {
    width: 180px;
    height: 180px;
}

.speech-bubble {
    position: absolute;
    background: white;
    border: 3px solid #333;
    border-radius: 20px;
    padding: 15px;
    min-width: 150px;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1.2em;
    font-weight: bold;
    display: none;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 20px solid #333;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.question-area {
    text-align: center;
    margin: 30px 0;
}

.question-area h2 {
    color: #2d3561;
    font-size: 2em;
    margin-bottom: 20px;
}

.number-display {
    font-size: 6em;
    font-weight: bold;
    color: #ff6b6b;
    text-shadow: 4px 4px 0px #ffd93d;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blocks-area {
    display: flex;
    justify-content: space-around;
    margin: 30px 0;
    gap: 20px;
}

.blocks-section {
    flex: 1;
    text-align: center;
}

.blocks-section h3 {
    color: #2d3561;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.blocks-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    min-height: 150px;
    background: #f0f0f0;
    border-radius: 15px;
    padding: 15px;
}

.block {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    animation: popIn 0.3s ease-out;
}

.block-ten {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.block-one {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

@keyframes popIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.answer-area {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin: 30px 0;
}

.draggable-blocks-pool {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 20px;
}

.pool-section {
    text-align: center;
}

.pool-section h4 {
    color: #2d3561;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.blocks-pool {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    min-height: 80px;
}

.draggable-block {
    font-size: 3em;
    cursor: grab;
    transition: transform 0.2s;
    user-select: none;
    animation: blockFloat 2s infinite;
}

.draggable-block:hover {
    transform: scale(1.2);
}

.draggable-block.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

@keyframes blockFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.answer-boxes {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.answer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.answer-box label {
    font-size: 1.8em;
    font-weight: bold;
    color: #2d3561;
}

.drop-answer-zone {
    width: 250px;
    min-height: 150px;
    background: white;
    border: 4px dashed #4ecdc4;
    border-radius: 20px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-content: flex-start;
    transition: all 0.3s;
}

.drop-answer-zone.drag-over {
    background: #e8f8f5;
    border-color: #11998e;
    transform: scale(1.05);
}

.answer-block {
    font-size: 2.5em;
    animation: blockPop 0.4s ease-out;
    cursor: pointer;
}

.answer-block:hover {
    transform: scale(1.1);
}

.answer-count {
    font-size: 2.5em;
    font-weight: bold;
    color: #4ecdc4;
}

.buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.btn {
    padding: 20px 40px;
    font-size: 1.5em;
    font-weight: bold;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: transform 0.2s;
    font-family: 'Comic Sans MS', cursive, sans-serif;
}

.btn:hover {
    transform: scale(1.1);
}

.btn:active {
    transform: scale(0.95);
}

.btn-check {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-play {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 100%);
    color: white;
}

.btn-learn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-decomp {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #2d3561;
}

.btn-music {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1000;
}

.confetti {
    position: absolute;
    font-size: 2em;
    animation: fall 3s linear;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .blocks-area {
        flex-direction: column;
    }
    
    .answer-area {
        flex-direction: column;
        gap: 20px;
    }
}

.visual-blocks {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 20px;
}

.visual-blocks h3 {
    text-align: center;
    color: #2d3561;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.visual-display {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.visual-section {
    flex: 1;
    max-width: 300px;
}

.visual-label {
    text-align: center;
    font-size: 1.3em;
    font-weight: bold;
    color: #2d3561;
    margin-bottom: 15px;
}

.visual-container {
    min-height: 100px;
    background: white;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

.visual-block {
    font-size: 3em;
    animation: blockPop 0.4s ease-out;
}

@keyframes blockPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}

.number-display-container {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.number-display {
    display: flex;
    gap: 20px;
    padding: 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.draggable-digit {
    width: 120px;
    height: 120px;
    font-size: 1.3em;
    font-weight: bold;
    color: white;
    background: linear-gradient(135deg, #ffd93d 0%, #ff6b6b 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    transition: transform 0.2s;
    user-select: none;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.draggable-digit:hover {
    transform: scale(1.1);
}

.draggable-digit:active {
    cursor: grabbing;
}

.answer-area {
    margin: 30px 0;
    padding: 20px;
    background: #e8f8f5;
    border-radius: 20px;
}

.answer-area h3 {
    text-align: center;
    color: #2d3561;
    font-size: 1.8em;
    margin-bottom: 20px;
}

.answer-grid {
    display: flex;
    justify-content: center;
    gap: 60px;
}

.answer-box {
    text-align: center;
}

.answer-box label {
    display: block;
    font-size: 1.5em;
    font-weight: bold;
    color: #2d3561;
    margin-bottom: 15px;
}

.digit-drop-zone {
    width: 140px;
    height: 140px;
    background: white;
    border: 5px dashed #11998e;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.digit-drop-zone.drag-over {
    background: #d4f1f4;
    border-color: #f093fb;
    transform: scale(1.05);
}

.digit-drop-zone .placeholder {
    font-size: 3em;
    color: #ccc;
    font-weight: bold;
}

.placed-digit {
    font-size: 3em;
    font-weight: bold;
    color: #2d3561;
    cursor: pointer;
    animation: digitPop 0.4s ease-out;
}

.placed-digit:hover {
    transform: scale(1.1);
}

@keyframes digitPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); opacity: 1; }
}
