/* ================================
   Complete os Números V2 - CSS
   Layout 2026 Responsivo
   ================================ */

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

/* 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.5);
    border-radius: 10px;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    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 {
    color: white;
}

/* Tela Cheia */
.game-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    z-index: 9999;
    overflow-y: auto;
}

/* ================================
   SELEÇÃO DE NÍVEIS
   ================================ */
.level-selection {
    text-align: center;
    padding: 20px 0;
}

.level-title {
    color: white;
    font-size: 32px;
    font-weight: bold;
    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: 30px;
}

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

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

.level-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.level-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

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

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

.level-info {
    background: #f0f0f0;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    margin-top: 10px;
}

.level-time {
    color: #888;
    font-size: 13px;
    margin-top: 8px;
}

/* ================================
   ÁREA DE JOGO
   ================================ */
.game-play {
    color: white;
}

.game-play-header {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 25px;
    backdrop-filter: blur(10px);
}

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

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    padding: 12px;
    border-radius: 10px;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    display: block;
    font-size: 24px;
    font-weight: bold;
    color: white;
}

/* Barra de Tempo */
.time-bar-container {
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    height: 30px;
    overflow: hidden;
}

.time-bar {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    border-radius: 10px;
    transition: width 1s linear;
    width: 100%;
}

.time-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ================================
   GRADE DE NÚMEROS
   ================================ */
.numbers-grid {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    backdrop-filter: blur(10px);
}

.number-box {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Número Preenchido */
.number-box.filled {
    background: #FEE90B;
    color: #333;
    cursor: default;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

/* Campo Vazio */
.number-box.empty {
    background: #D6F07E;
    cursor: pointer;
}

.number-box.empty:hover {
    background: #c5df6d;
    transform: scale(1.05);
}

/* Input de Número */
.number-input {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    border-radius: 10px;
    outline: none;
    font-family: inherit;
}

.number-input:focus {
    background: rgba(255, 255, 255, 0.3);
}

/* Estados de Input */
.number-box.correct {
    background: #4CAF50;
    color: white;
    animation: correctAnim 0.5s ease;
}

.number-box.wrong {
    background: #f44336;
    color: white;
    animation: shake 0.5s ease;
}

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

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

/* ================================
   FEEDBACK
   ================================ */
.feedback {
    text-align: center;
    min-height: 30px;
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0;
    animation: fadeIn 0.3s ease;
}

.feedback.success {
    color: #4CAF50;
}

.feedback.error {
    color: #f44336;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================================
   BOTÕES DE AÇÃO
   ================================ */
.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-action {
    padding: 12px 25px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-hint {
    background: linear-gradient(135deg, #FFC107, #FF9800);
    color: white;
}

.btn-hint:hover {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.btn-restart {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.btn-restart:hover {
    background: linear-gradient(135deg, #1976D2, #1565C0);
    transform: translateY(-2px);
}

.btn-quit {
    background: linear-gradient(135deg, #757575, #616161);
    color: white;
}

.btn-quit:hover {
    background: linear-gradient(135deg, #616161, #424242);
    transform: translateY(-2px);
}

/* ================================
   TELA DE RESULTADO
   ================================ */
.result-screen {
    text-align: center;
    padding: 20px;
    color: white;
}

.result-content {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 20px;
    padding: 40px 30px;
    backdrop-filter: blur(10px);
}

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

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

.result-title {
    font-size: 36px;
    margin-bottom: 10px;
    font-weight: bold;
}

.result-message {
    font-size: 18px;
    margin-bottom: 30px;
    color: rgba(255, 255, 255, 0.9);
}

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

.result-stat {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 20px 15px;
}

.result-stat-icon {
    font-size: 36px;
    margin-bottom: 10px;
}

.result-stat-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.result-stat-value {
    font-size: 28px;
    font-weight: bold;
    color: white;
}

.result-medal {
    font-size: 60px;
    margin: 20px 0;
    animation: rotate 2s ease-in-out infinite;
}

@keyframes rotate {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

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

.btn-result {
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.btn-result.btn-restart {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.btn-result.btn-levels {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

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

/* ================================
   RESPONSIVIDADE MOBILE
   ================================ */
@media (max-width: 768px) {
    .game-container {
        padding: 20px 15px;
    }

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

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

    .level-cards {
        grid-template-columns: 1fr;
        max-width: 300px;
    }

    .level-card {
        padding: 20px;
    }

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

    .level-card h3 {
        font-size: 20px;
    }

    .numbers-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 8px;
        padding: 15px;
    }

    .number-box,
    .number-input {
        font-size: 18px;
    }

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

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

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

    .btn-action {
        width: 100%;
        justify-content: center;
    }

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

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

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

    .result-stat-value {
        font-size: 24px;
    }

    .btn-fullscreen {
        width: 40px;
        height: 40px;
    }
}

@media (max-width: 480px) {
    .numbers-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 5px;
        padding: 10px;
    }

    .number-box,
    .number-input {
        font-size: 16px;
    }

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

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

    .time-text {
        font-size: 14px;
    }

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

/* ================================
   ACESSIBILIDADE
   ================================ */
.btn-action:focus,
.btn-result:focus,
.level-card:focus {
    outline: 3px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

.number-input:focus {
    outline: 3px solid #5e4fa2;
}

/* Remove setas do input number */
.number-input::-webkit-outer-spin-button,
.number-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.number-input[type=number] {
    -moz-appearance: textfield;
}
