/* ==========================================
   JOGO QUANTIDADE DA SOMA V2 - CSS
   Layout 2026 | Janeiro 2026
   ========================================== */

/* Container Principal do Jogo */
.game-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    margin: 30px 0;
}

/* Botão Tela Cheia */
.btn-fullscreen {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 100;
}

.btn-fullscreen:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.btn-fullscreen svg {
    display: block;
    stroke: white;
}

/* Tela Cheia Ativa */
.game-container:fullscreen {
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========================================
   TELA DE SELEÇÃO DE NÍVEL
   ======================================== */

.level-selection {
    text-align: center;
    padding: 20px;
}

.level-title {
    color: white;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.level-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 18px;
    margin-bottom: 40px;
}

.level-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    max-width: 900px;
    margin: 0 auto;
}

.level-card {
    background: white;
    border-radius: 20px;
    padding: 30px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.level-card:hover {
    transform: translateY(-10px) scale(1.05);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.level-icon {
    font-size: 60px;
    margin-bottom: 15px;
}

.level-card h3 {
    color: #5e4fa2;
    font-size: 24px;
    font-weight: 700;
    margin: 10px 0;
}

.level-card p {
    color: #666;
    font-size: 16px;
    margin: 5px 0;
}

.level-info {
    color: #333;
    font-weight: 600;
    margin: 15px 0 5px;
    font-size: 18px;
}

.level-time {
    color: #888;
    font-size: 14px;
}

/* ========================================
   ÁREA DO JOGO
   ======================================== */

.game-play {
    background: white;
    border-radius: 20px;
    padding: 25px;
}

.game-play-header {
    margin-bottom: 25px;
}

.game-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-item {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: white;
}

.stat-label {
    display: block;
    font-size: 12px;
    opacity: 0.9;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

/* ========================================
   ÁREA PRINCIPAL - GRUPOS E SOMA
   ======================================== */

.sum-game-area {
    max-width: 1000px;
    margin: 0 auto;
}

.instruction-text {
    color: #5e4fa2;
    font-size: 20px;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
}

.groups-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

/* Caixas de Grupos */
.group-box {
    background: #f8f9fa;
    border: 3px solid #5e4fa2;
    border-radius: 15px;
    padding: 20px;
    min-width: 220px;
    max-width: 280px;
    flex: 1;
}

.objects-grid {
    min-height: 180px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
}

.object {
    font-size: 36px;
    animation: popIn 0.3s ease;
}

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

.input-area {
    text-align: center;
}

.input-area label {
    display: block;
    color: #5e4fa2;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.count-input {
    width: 100%;
    max-width: 120px;
    padding: 12px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    border: 3px solid #5e4fa2;
    border-radius: 10px;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.count-input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
    transform: scale(1.05);
}

.count-input.correct {
    border-color: #28a745;
    background: #d4edda;
    animation: successPulse 0.5s ease;
}

.count-input.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    animation: shake 0.5s ease;
}

/* Símbolos Matemáticos */
.plus-symbol,
.equals-symbol {
    font-size: 48px;
    color: #5e4fa2;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
}

/* Caixa de Resultado Total */
.result-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 20px;
    min-width: 180px;
    text-align: center;
    color: white;
}

.result-label {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-input {
    width: 100%;
    max-width: 120px;
    padding: 15px;
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    border: 3px solid white;
    border-radius: 10px;
    background: white;
    color: #5e4fa2;
    transition: all 0.3s ease;
}

.total-input:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.5);
    transform: scale(1.05);
}

.total-input.correct {
    border-color: #28a745;
    background: #d4edda;
    color: #155724;
    animation: successPulse 0.5s ease;
}

.total-input.incorrect {
    border-color: #dc3545;
    background: #f8d7da;
    color: #721c24;
    animation: shake 0.5s ease;
}

/* Feedback */
.feedback {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.feedback.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #28a745;
    animation: slideDown 0.5s ease;
}

.feedback.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #dc3545;
    animation: slideDown 0.5s ease;
}

.feedback.hint {
    background: #fff3cd;
    color: #856404;
    border: 2px solid #ffc107;
    animation: slideDown 0.5s ease;
}

/* Animações */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* ========================================
   BOTÕES DE AÇÃO
   ======================================== */

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 25px;
}

.btn-action {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.btn-action:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn-check {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
}

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

.btn-restart {
    background: linear-gradient(135deg, #17a2b8, #138496);
    color: white;
}

.btn-quit {
    background: linear-gradient(135deg, #6c757d, #545b62);
    color: white;
}

/* ========================================
   TELA DE RESULTADO
   ======================================== */

.result-screen {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    text-align: center;
}

.result-content {
    max-width: 600px;
    margin: 0 auto;
}

.result-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

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

.result-title {
    color: #5e4fa2;
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 15px;
}

.result-message {
    color: #666;
    font-size: 18px;
    margin-bottom: 30px;
    line-height: 1.6;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin: 30px 0;
}

.result-stat {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px 10px;
    border: 2px solid #e9ecef;
}

.result-stat-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.result-stat-label {
    color: #666;
    font-size: 13px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.result-stat-value {
    color: #5e4fa2;
    font-size: 28px;
    font-weight: 700;
}

.result-medal {
    font-size: 100px;
    margin: 30px 0;
    animation: rotateIn 0.8s ease;
}

@keyframes rotateIn {
    from {
        transform: rotate(-180deg) scale(0);
        opacity: 0;
    }
    to {
        transform: rotate(0) scale(1);
        opacity: 1;
    }
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 30px;
}

.btn-result {
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    color: white;
}

.btn-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn-result.btn-restart {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.btn-result.btn-levels {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

/* ========================================
   RESPONSIVIDADE MOBILE
   ======================================== */

@media (max-width: 768px) {
    .game-container {
        padding: 20px 15px;
    }

    .level-title {
        font-size: 24px;
    }

    .level-subtitle {
        font-size: 16px;
    }

    .level-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .level-icon {
        font-size: 50px;
    }

    .game-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-value {
        font-size: 20px;
    }

    .instruction-text {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .groups-container {
        flex-direction: column;
        gap: 15px;
    }

    .group-box {
        min-width: 100%;
        max-width: 100%;
    }

    .objects-grid {
        min-height: 150px;
    }

    .object {
        font-size: 28px;
    }

    .plus-symbol,
    .equals-symbol {
        font-size: 36px;
        min-width: 100%;
        margin: 10px 0;
    }

    .result-box {
        min-width: 100%;
    }

    .count-input,
    .total-input {
        font-size: 24px;
    }

    .action-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .btn-action {
        width: 100%;
        padding: 12px 20px;
    }

    .result-title {
        font-size: 28px;
    }

    .result-message {
        font-size: 16px;
    }

    .result-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .result-medal {
        font-size: 80px;
    }
}

@media (max-width: 480px) {
    .game-container {
        border-radius: 15px;
        padding: 15px 10px;
    }

    .level-title {
        font-size: 20px;
    }

    .level-icon {
        font-size: 40px;
    }

    .level-card {
        padding: 20px 15px;
    }

    .stat-label {
        font-size: 10px;
    }

    .stat-value {
        font-size: 18px;
    }

    .object {
        font-size: 24px;
    }

    .result-icon {
        font-size: 60px;
    }

    .result-title {
        font-size: 24px;
    }
}
