/* Caça-palavras - Estilos Específicos */

.wordsearch-game {
    display: flex;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Grade do Caça-palavras */
.wordsearch-grid-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#wordsearch-grid {
    display: grid;
    gap: 2px;
    background-color: #333;
    padding: 2px;
    border-radius: 8px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    max-width: 600px;
    margin: 0 auto;
}

.ws-cell {
    background-color: #fff;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.ws-cell:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}

/* Estados de seleção */
.ws-cell.ws-selecting {
    background-color: #ffd54f;
    color: #000;
    transform: scale(1.1);
    z-index: 10;
}

.ws-cell.ws-found {
    background-color: #66bb6a;
    color: white;
    animation: foundPulse 0.5s ease;
}

.ws-cell.ws-hint {
    animation: hintBlink 1s ease 2;
}

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

@keyframes hintBlink {
    0%, 100% { background-color: #fff; }
    50% { background-color: #ff9800; }
}

/* Sidebar */
.wordsearch-sidebar {
    width: 300px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.words-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.words-panel h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.2rem;
}

.word-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    font-weight: 600;
}

.word-counter span {
    font-size: 1.3rem;
}

#words-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
}

.word-item-ws {
    padding: 0.75rem 1rem;
    background: #f5f5f5;
    border-radius: 6px;
    color: #666;
    font-weight: 600;
    transition: all 0.3s ease;
}

.word-item-ws.word-found {
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
    text-decoration: line-through;
    transform: scale(0.98);
}

/* Painel de controles */
.controls-panel {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.timer-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 8px;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.ws-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ws-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

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

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

.ws-btn-reset:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.4);
}

/* Botões de compartilhamento */
.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.btn-share {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-facebook {
    background: #1877f2;
}

.btn-twitter {
    background: #1da1f2;
}

.btn-whatsapp {
    background: #25d366;
}

.btn-link {
    background: #666;
}

.btn-share span:first-child {
    font-size: 1.2rem;
}

/* Notificação de cópia */
.copy-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0);
}

/* Responsivo */
@media (max-width: 900px) {
    .wordsearch-game {
        flex-direction: column;
    }

    .wordsearch-sidebar {
        width: 100%;
        max-width: 600px;
        margin: 0 auto;
    }

    #wordsearch-grid {
        max-width: 100%;
    }

    .ws-cell {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    /* MOBILE FIRST - Otimização para toque */

    #wordsearch-grid {
        touch-action: none; /* IMPORTANTE: Desabilitar comportamento padrão de touch */
        -webkit-user-select: none;
        user-select: none;
    }

    .ws-cell {
        /* Células maiores para facilitar toque */
        min-width: 35px;
        min-height: 35px;
        font-size: 1.1rem;
    }

    .ws-cell:hover {
        /* Desabilitar hover em mobile */
        background-color: #fff;
        transform: none;
    }

    .ws-cell.ws-selecting {
        /* Feedback visual forte durante seleção */
        background-color: #ffd54f;
        transform: scale(1.05);
        z-index: 10;
    }

    /* Layout mobile otimizado */
    .game-content {
        display: flex;
        flex-direction: column;
        gap: 15px;
    }

    .game-info-ws {
        position: sticky;
        top: 60px;
        background: white;
        z-index: 99;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }

    .words-panel {
        position: sticky;
        bottom: 0;
        background: white;
        z-index: 100;
        max-height: 250px;
        overflow-y: auto;
        box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
        border-radius: 12px 12px 0 0;
        overscroll-behavior: contain;
    }

    .game-controls .btn {
        font-size: 16px; /* Prevenir zoom no iOS */
    }
}

@media (max-width: 600px) {
    .wordsearch-game {
        padding: 1rem 0.5rem;
        gap: 1rem;
    }

    .ws-cell {
        font-size: 0.9rem;
        min-width: 32px;
        min-height: 32px;
    }

    .words-panel,
    .controls-panel {
        padding: 1rem;
    }

    .share-buttons {
        flex-direction: column;
    }

    .btn-share {
        min-width: 100%;
        font-size: 16px; /* Prevenir zoom no iOS */
    }
}
