/* Estilos específicos para a página do jogo */
.game-container {
    width: 100%;
    min-height: 100vh;
    background: #fff;
    display: flex;
    flex-direction: column;
}

/* Header do jogo */
.game-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.8);
    padding: 15px 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
}

.timer, .score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    font-size: 1rem;
}

.timer-icon, .score-icon {
    font-size: 1.1rem;
}

.timer-text, .score-text {
    color: #2c3e50;
}

/* Lista de palavras no header */
.word-list-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

.word-list-header h3 {
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.8rem;
    margin: 0;
    text-align: left;
}

.word-list-header ul {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}

.word-list-header .word-item {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 3px 6px;
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.6rem;
    transition: all 0.3s ease;
    cursor: default;
}

.word-list-header .word-item.found {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    text-decoration: line-through;
    opacity: 0.8;
}

.back-btn {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    /* Melhorar experiência touch */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    min-height: 44px; /* Área mínima recomendada para touch */
    min-width: 80px;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

/* Melhorar experiência touch para o botão de voltar */
@media (hover: none) and (pointer: coarse) {
    .back-btn:hover {
        transform: none;
        box-shadow: none;
    }
    
    .back-btn:active {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
        background: linear-gradient(45deg, #c0392b, #a93226);
    }
}

/* Área principal do jogo */
.game-main {
    flex: 1;
    display: flex;
    padding: 120px 20px 20px 20px;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Wrapper que engloba logo e grid */
.game-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
    margin-top: -70px;
}

/* Container do logo */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.iel-logo {
    height: 250px;
    width: auto;
}

/* Container do tabuleiro */
.game-board-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-board {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(15px);
    display: grid;
    gap: 3px;
    user-select: none;
    position: relative;
}

/* Células do tabuleiro */
.cell {
    width: 50px;
    height: 50px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: white;
    border-radius: 5px;
    position: relative;
    /* Melhorar experiência touch */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cell:hover {
    background: #f8f9fa;
    transform: scale(1.05);
}

.cell.selected {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(103, 126, 234, 0.4);
    z-index: 1;
    position: relative;
}

.cell.found {
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    animation: foundPulse 0.8s ease;
    box-shadow: 0 3px 10px rgba(39, 174, 96, 0.3);
}

@keyframes foundPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* Melhorar experiência touch em dispositivos móveis */
@media (hover: none) and (pointer: coarse) {
    .cell:hover {
        transform: none;
        background: white;
    }
    
    .cell:active {
        background: #f8f9fa;
        transform: scale(1.05);
    }
    
    .cell.selected:active {
        background: linear-gradient(45deg, #667eea, #764ba2);
        transform: scale(1.05);
    }
}

/* Modais */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    animation: modalSlideIn 0.3s ease;
}

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

.victory-icon, .game-over-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: iconBounce 1s ease;
}

@keyframes iconBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.modal-content h2 {
    color: #2c3e50;
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.8rem;
}

.modal-content p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.final-time, .words-found {
    background: rgba(103, 126, 234, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin: 20px 0;
    font-weight: 600;
    color: #2c3e50;
}

.points-found, .victory-points {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    padding: 20px;
    border-radius: 15px;
    margin: 25px 0;
    font-weight: 700;
    color: white;
    font-size: 1.2rem;
    text-align: center;
    box-shadow: 0 5px 15px rgba(243, 156, 18, 0.3);
    border: 2px solid #d68910;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.finish-btn {
    /* Div estilizado como botão - SAFARI iOS FRIENDLY */
    display: inline-block;
    text-decoration: none;
    padding: 12px 25px;
    border: none;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    background: linear-gradient(45deg, #27ae60, #2ecc71);
    color: white;
    text-align: center;
    /* Específico para Safari iOS */
    -webkit-appearance: none;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    outline: none;
    touch-action: manipulation;
    z-index: 99999;
    position: relative;
    pointer-events: auto;
}

.finish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.3);
}

/* Media Query para Tablets Pequenos - iPad 575x767, iPad Mini, etc. */
@media screen and (min-width: 570px) and (max-width: 800px) {
    /* Ajustes gerais para tablets pequenos */
    .game-main {
        padding: 120px 10px 20px 10px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .game-content-wrapper {
        width: 90% !important;
        max-width: 90% !important;
        margin: 0 auto !important;
        margin-top: 70px !important;
    }
    
    /* Logo IEL para tablets pequenos */
    .iel-logo {
        height: 150px !important;
        width: auto !important;
    }
    
    /* Game board para tablets pequenos - AJUSTADO PARA 90% DA LARGURA */
    .game-board-container {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-top: -50px !important;
    }
    
    .game-board {
        width: 90% !important;
        max-width: 90% !important;
        margin: 0 auto !important;
        padding: 10px !important;
        gap: 1px !important;
    }
    
    /* Células do tabuleiro para tablets pequenos - EXTREMAMENTE REDUZIDAS */
    .cell {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.7rem !important;
    }
    
    /* Header para tablets pequenos */
    .game-header {
        padding: 10px 15px !important;
        flex-wrap: wrap !important;
        gap: 12px !important;
    }
    
    .word-list-header .word-item {
        font-size: 0.6rem !important;
        padding: 3px 6px !important;
    }
    
    .timer, .score {
        font-size: 0.8rem !important;
    }
    
    .back-btn {
        font-size: 0.7rem !important;
        padding: 5px 10px !important;
    }
    
    /* Modais para tablets pequenos */
    .modal-content {
        max-width: 400px !important;
        width: 80% !important;
        padding: 30px 20px !important;
    }
    
    .modal-content h2 {
        font-size: 1.4rem !important;
    }
    
    .modal-content p {
        font-size: 0.9rem !important;
    }
}

/* Media Query para Tablets Grandes - iPad Air 5, iPad Pro, Samsung Galaxy Tab, etc. */
@media screen and (min-width: 801px) and (max-width: 1200px) {
    /* Ajustes gerais para tablets grandes */
    .game-main {
        padding: 120px 15px 20px 15px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .game-content-wrapper {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        margin-top: 50px !important;
    }
    
    /* Logo IEL para tablets grandes */
    .iel-logo {
        height: 180px !important;
        width: auto !important;
    }
    
    /* Game board para tablets grandes - AJUSTADO PARA 95% DA LARGURA */
    .game-board-container {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-top: -45px !important;
    }
    
    .game-board {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        padding: 20px !important;
        gap: 2px !important;
    }
    
    /* Células do tabuleiro para tablets grandes - AJUSTADAS PROPORCIONALMENTE */
    .cell {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.1rem !important;
    }
    
    /* Header para tablets grandes */
    .game-header {
        padding: 12px 20px !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
    }
    
    .word-list-header .word-item {
        font-size: 0.7rem !important;
        padding: 4px 8px !important;
    }
    
    .timer, .score {
        font-size: 0.9rem !important;
    }
    
    .back-btn {
        font-size: 0.8rem !important;
        padding: 6px 12px !important;
    }
    
    /* Modais para tablets grandes */
    .modal-content {
        max-width: 500px !important;
        width: 85% !important;
        padding: 35px 25px !important;
    }
    
    .modal-content h2 {
        font-size: 1.6rem !important;
    }
    
    .modal-content p {
        font-size: 1rem !important;
    }
}

/* Responsividade */
@media (max-width: 1024px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }
    
    .game-info {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .word-list-header ul {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 10px 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    .game-info {
        gap: 15px;
        flex-direction: column;
        align-items: center;
    }
    
    .word-list-header ul {
        justify-content: center;
        gap: 5px;
    }
    
    .word-list-header .word-item {
        font-size: 0.6rem;
        padding: 3px 6px;
    }
    
    .game-main {
        padding: 15px;
    }
    
    .cell {
        width: 45px;
        height: 45px;
        font-size: 1.3rem;
    }
    
    .modal-content {
        padding: 30px 20px;
    }
    
    .modal-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

/* Media Query específica para Celulares - Touch Screen Otimizado */
@media screen and (max-width: 569px) {
    /* Ajustes gerais para celulares */
    .game-main {
        padding: 100px 5px 15px 5px !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .game-content-wrapper {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        margin-top: 40px !important;
    }
    
    /* Logo IEL para celulares */
    .iel-logo {
        height: 80px !important;
        width: auto !important;
    }
    
    /* Game board para celulares - MUITO REDUZIDO */
    .game-board-container {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin-top: -20px !important;
    }
    
    .game-board {
        width: 95% !important;
        max-width: 95% !important;
        margin: 0 auto !important;
        padding: 8px !important;
        gap: 1px !important;
    }
    
    /* Células do tabuleiro para celulares - MUITO REDUZIDAS */
    .cell {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.6rem !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        user-select: none !important;
        -webkit-user-select: none !important;
        -moz-user-select: none !important;
        -ms-user-select: none !important;
    }
    
    /* Header para celulares */
    .game-header {
        padding: 8px 10px !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
    
    .word-list-header {
        text-align: center !important;
    }
    
    .word-list-header h3 {
        font-size: 0.7rem !important;
    }
    
    .word-list-header .word-item {
        font-size: 0.5rem !important;
        padding: 2px 4px !important;
    }
    
    .timer, .score {
        font-size: 0.7rem !important;
    }
    
    .back-btn {
        font-size: 0.6rem !important;
        padding: 4px 8px !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
        min-height: 40px !important;
    }
    
    /* Modais para celulares */
    .modal-content {
        max-width: 300px !important;
        width: 90% !important;
        padding: 20px 15px !important;
    }
    
    .modal-content h2 {
        font-size: 1.3rem !important;
    }
    
    .modal-content p {
        font-size: 0.85rem !important;
    }
    
    .finish-btn {
        padding: 15px 25px !important;
        font-size: 0.9rem !important;
        min-height: 50px !important;
        width: 100% !important;
        touch-action: manipulation !important;
        -webkit-tap-highlight-color: transparent !important;
    }
}

@media (max-width: 480px) {
    .cell {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
    }
    
    .game-board {
        padding: 15px;
    }
    
    .game-sidebar {
        padding: 15px;
    }
} 