/* =============================================
   APPLE TREE - Estilos del juego
   Usa variables globales de base.css (--brand-*, --bg-*, --text-*, --border-*, etc.)
   ============================================= */

/* Manzanas */
.at-apples {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-size: 2.5rem;
}

.at-apple {
    display: inline-block;
    position: relative;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.at-apple.lost {
    opacity: 0.2;
    transform: translateY(15px) rotate(20deg);
    filter: grayscale(1);
}

.at-apple.lost::after {
    content: '✕';
    position: absolute;
    font-size: 1.5rem;
    color: var(--brand-danger);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Palabra en español */
.at-spanish-word {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-transform: capitalize;
}

/* Casillas de letras */
.at-letter-boxes {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.at-letter-box {
    width: 44px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.at-letter-box.filled {
    border-color: var(--brand-success);
    background: var(--brand-success-light);
    color: white;
    animation: at-pop 0.3s ease;
}

.at-letter-box.revealed {
    border-color: var(--brand-danger);
    background: var(--brand-danger-light);
    color: white;
}

@keyframes at-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* Teclado virtual */
.at-keyboard {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.at-keyboard-row {
    display: flex;
    gap: 0.35rem;
}

.at-key {
    width: 38px;
    height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    user-select: none;
}

.at-key:hover:not(.used) {
    background: var(--brand-success);
    color: white;
    border-color: var(--brand-success);
    transform: translateY(-2px);
}

.at-key:active:not(.used) {
    transform: translateY(0);
}

.at-key.correct {
    background: var(--brand-success);
    color: white;
    border-color: var(--brand-success);
    cursor: default;
}

.at-key.incorrect {
    background: var(--brand-danger);
    color: white;
    border-color: var(--brand-danger);
    cursor: default;
    opacity: 0.7;
}

.at-key.used {
    pointer-events: none;
}

/* Feedback overlay */
.at-feedback {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-light);
    opacity: 0.95;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: var(--radius-sm);
    animation: at-fade-in 0.3s ease;
}

[data-theme="dark"] .at-feedback {
    background: #1a1a2ee6;
}

.at-feedback-content {
    text-align: center;
    padding: 2rem;
}

.at-feedback-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.at-feedback-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.at-feedback-title.win {
    color: var(--brand-success);
}

.at-feedback-title.lose {
    color: var(--brand-danger);
}

.at-feedback-word {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.at-feedback-word strong {
    color: var(--text-primary);
    font-size: 1.4rem;
    text-transform: capitalize;
}

.at-next-btn {
    min-width: 200px;
    font-weight: 600;
}

/* Card position relative for overlay */
#at-game-area {
    position: relative;
    min-height: 400px;
}

/* Resumen */
.at-summary .score {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Separador visual de espacio entre palabras */
.at-space-separator {
    width: 24px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.at-space-indicator {
    display: block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--text-muted);
    opacity: 0.35;
}

[data-theme="dark"] .at-space-indicator {
    opacity: 0.25;
}

/* Responsive: separador más pequeño en móvil */
@media (max-width: 640px) {
    .at-space-separator {
        width: 16px;
        height: 42px;
    }

    .at-space-indicator {
        width: 4px;
        height: 4px;
    }
}

/* Animación de manzana cayendo */
@keyframes at-apple-fall {
    0% { transform: translateY(0) rotate(0deg); opacity: 1; }
    50% { transform: translateY(20px) rotate(15deg); opacity: 0.5; }
    100% { transform: translateY(30px) rotate(25deg); opacity: 0.2; }
}

[data-theme="dark"] .at-apple.lost {
    opacity: 0.15;
}

.at-apple.falling {
    animation: at-apple-fall 0.5s ease forwards;
}

@keyframes at-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 640px) {
    .at-spanish-word {
        font-size: 1.5rem;
    }

    .at-letter-box {
        width: 34px;
        height: 42px;
        font-size: 1.2rem;
    }

    .at-keyboard {
        gap: 0.5rem;
    }

    .at-keyboard-row {
        gap: 0.4rem;
    }

    .at-key {
        width: 36px;
        height: 46px;
        font-size: 0.95rem;
        border-radius: 10px;
    }

    .at-apples {
        font-size: 2rem;
    }

    .at-feedback-icon {
        font-size: 3rem;
    }

    .at-feedback-title {
        font-size: 1.2rem;
    }
}