.number-game-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 12px 25px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.3);
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-group label {
    font-weight: bold;
    color: white;
    font-size: 14px;
}

.control-group input,
.control-group select {
    padding: 6px 10px;
    font-size: 13px;
    border: 2px solid white;
    border-radius: 5px;
    cursor: pointer;
    background: white;
    font-weight: bold;
    color: #667eea;
}

.start-game-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: bold;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
}

.start-game-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.4);
}

.score-display,
.timer-display,
.matches-display {
    font-size: 16px;
    font-weight: bold;
    color: white;
}

.score-display span,
.timer-display span,
.matches-display span {
    color: #ffd700;
}

.game-layout {
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.left-panel {
    width: 250px;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.panel-header {
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.panel-header h2 {
    font-size: 20px;
    margin: 0 0 8px 0;
    color: white;
}

.panel-header p {
    font-size: 12px;
    margin: 0;
    opacity: 0.95;
}

.left-panel h3 {
    color: #667eea;
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.instructions-list {
    list-style: none;
    padding: 0;
}

.instructions-list li {
    padding: 8px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 5px;
    font-size: 12px;
    color: #555;
    border-left: 3px solid #667eea;
}

.middle-panel {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.questions-section,
.answers-section {
    flex: 1;
}

.questions-section h3,
.answers-section h3 {
    color: #667eea;
    font-size: 18px;
    margin-bottom: 12px;
    text-align: center;
    padding: 10px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    border-radius: 8px;
    border: 2px solid #667eea;
}

.number-sequence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    max-height: 320px;
    overflow-y: auto;
    padding-right: 5px;
}

/* Custom scrollbar */
.number-sequence-grid::-webkit-scrollbar {
    width: 8px;
}

.number-sequence-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.number-sequence-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.question-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px solid #667eea;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    min-height: 60px;
}

.number-box {
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 3px solid #667eea;
    border-radius: 8px;
    font-size: 26px;
    font-weight: bold;
    color: #667eea;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.number-box.empty {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 3px dashed white;
    position: relative;
}

.number-box.empty::before {
    content: '?';
    font-size: 36px;
}

.arrow {
    font-size: 24px;
    color: #667eea;
}

.question-item:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.question-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
}

.question-item.selected .number-box {
    border-color: white;
    color: white;
}

.question-item.selected .arrow {
    color: white;
}

.question-item.matched {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-color: #28a745;
    cursor: default;
    opacity: 0.9;
}

.question-item.matched .number-box {
    border-color: #28a745;
    color: #28a745;
}

.question-item.matched .number-box.empty {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

.question-item.matched .number-box.empty::before {
    content: '✓';
}

.question-item.wrong {
    animation: shake 0.5s;
}

.question-item.hint {
    animation: pulse 1s;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.answers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 10px;
    max-height: 280px;
    overflow-y: auto;
    padding-right: 5px;
}

.answers-grid::-webkit-scrollbar {
    width: 8px;
}

.answers-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.answers-grid::-webkit-scrollbar-thumb {
    background: #667eea;
    border-radius: 10px;
}

.answer-item {
    padding: 15px 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px solid #667eea;
    border-radius: 8px;
    font-size: 28px;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
    user-select: none;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.answer-item:hover {
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
    transform: scale(1.08);
    box-shadow: 0 5px 12px rgba(102, 126, 234, 0.3);
}

.answer-item.selected {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: scale(1.1);
}

.answer-item.matched {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #28a745;
    border-color: #28a745;
    cursor: default;
    opacity: 0.8;
}

.answer-item.wrong {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-color: #dc3545;
    animation: shake 0.5s;
}

.answer-item.hint {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    color: #856404;
    border-color: #ffc107;
    animation: pulse 1s;
}

.ads-panel {
    width: 250px;
    padding: 15px;
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

.ads-panel h3 {
    color: #667eea;
    font-size: 16px;
    margin-bottom: 12px;
    text-align: center;
}

.ad-box {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.ad-placeholder {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    font-size: 16px;
    font-weight: bold;
}

.game-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 15px;
}

.hint-btn,
.reset-btn {
    flex: 1;
    max-width: 180px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.hint-btn {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #333;
}

.hint-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4);
}

.celebration-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.celebration-content {
    background: white;
    padding: 50px;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.celebration-content h2 {
    color: #667eea;
    font-size: 42px;
    margin-bottom: 20px;
}

.celebration-content p {
    font-size: 24px;
    color: #555;
    margin-bottom: 20px;
}

.play-again-btn {
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
}

.play-again-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@media (max-width: 1200px) {
    .game-layout {
        flex-wrap: wrap;
    }

    .ads-panel {
        width: 100%;
    }

    .number-sequence-grid,
    .answers-grid {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .game-info {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 15px;
    }

    .control-group {
        width: 100%;
        justify-content: space-between;
    }

    .start-game-btn {
        width: 100%;
    }

    .game-layout {
        flex-direction: column;
        gap: 16px;
    }

    .left-panel {
        width: 100%;
    }

    .number-box {
        min-width: 50px;
        height: 50px;
        font-size: 20px;
    }

    .answers-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .answer-item {
        font-size: 24px;
        padding: 12px 8px;
    }

    .number-sequence-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .number-game-container {
        padding: 10px;
    }

    .middle-panel {
        padding: 16px;
        width: 100%;
        max-width: 100%;
    }

    .number-sequence-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .answers-grid {
        grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
        gap: 8px;
    }

    .number-box {
        min-width: 44px;
        height: 44px;
        font-size: 18px;
    }

    .answer-item {
        font-size: 20px;
        padding: 10px 6px;
    }
}