/* Estilos generales y del título */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f9fafb;
}
.dark body {
    background-color: #111827;
}
.dark .title-gradient {
    color: #fff;
}
.title-gradient { 
    background: linear-gradient(to right, #854d0e, #F97316); 
    -webkit-background-clip: text; 
    background-clip: text; 
    color: transparent; 
    padding-bottom: 0.25em;
}

/* ======================================= */
/* --- ESTILOS PARA EL CONTENEDOR DEL TABLERO --- */
/* ======================================= */
#game-board {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    border: 1px solid #e5e7eb; /* Borde sutil */
}
.dark #game-board {
    background-color: #1f2937; /* gray-800 */
    border-color: #374151; /* gray-700 */
}


/* Estilos del Tablero */
.tile {
    width: 100%;
    display: inline-block;
    position: relative;
    vertical-align: top;
}
.tile::before {
    content: '';
    display: block;
    padding-top: 100%;
}
.tile-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    border-radius: 0.25rem;
}
.tile-content {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    border-radius: 0.25rem;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    border: 2px solid #E5E7EB;
}
.tile-content.front {
    background-color: transparent;
}
.dark .tile-content {
    border-color: #4B5563;
    color: white;
}
.tile-content.back {
    transform: rotateX(180deg);
}

/* Estilos de la Animación de Volteo */
.tile.flip .tile-inner {
    transform: rotateX(180deg);
}

/* Colores de las Celdas (se aplican al reverso) */
.back.correct { background-color: #22c55e; border-color: #22c55e; color: white; }
.back.present { background-color: #eab308; border-color: #eab308; color: white; }
.back.absent { background-color: #6b7280; border-color: #6b7280; color: white; }

/* Animación de fila incorrecta */
@keyframes shake-row {
  10%, 90% { transform: translateX(-1%); }
  20%, 80% { transform: translateX(2%); }
  30%, 50%, 70% { transform: translateX(-4%); }
  40%, 60% { transform: translateX(4%); }
}
.shake-row {
    animation: shake-row 0.6s ease-in-out;
}

/* Estilos del Teclado */
.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 0.375rem; /* 6px */
}
.key {
    height: 3.5rem;
    padding: 0 0.5rem;
    border: none;
    border-radius: 0.5rem;
    background-color: #D1D5DB; /* gray-300 */
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    flex-grow: 1;
}
.dark .key {
    background-color: #4B5563; /* gray-600 */
    color: white;
}
.key.large {
    flex-grow: 1.5;
    font-size: 0.875rem;
}

/* Colores de las Teclas */
.key.correct { background-color: #22c55e !important; color: white !important; }
.key.present { background-color: #eab308 !important; color: white !important; }
.key.absent { background-color: #6b7280 !important; color: white !important; }

/* ======================================= */
/* --- ESTILOS DEL MODAL DE TUTORIAL --- */
/* ======================================= */
#tutorial-modal .prose {
    color: #374151; /* gray-700 */
}

/* --- CORRECCIÓN PARA LAS LETRAS DE EJEMPLO --- */
.example-letter-box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 2.5rem;
    height: 2.5rem;
    font-weight: bold;
    border-radius: 0.25rem;
    /* Estilos por defecto para modo claro */
    border: 2px solid #D1D5DB; /* gray-300 */
    color: #111827; /* Texto oscuro */
    background-color: #ffffff;
}

.example-letter-box.correct {
    background-color: #22c55e;
    border-color: #22c55e;
    color: white;
}
.example-letter-box.present {
    background-color: #eab308;
    border-color: #eab308;
    color: white;
}
.example-letter-box.absent {
    background-color: #6b7280;
    border-color: #6b7280;
    color: white;
}

/* Estilos para los mensajes emergentes (toast) */
.toast {
    visibility: hidden; min-width: 250px; background-color: #333; color: #fff; text-align: center;
    border-radius: 8px; padding: 16px; position: fixed; z-index: 100; left: 50%;
    transform: translateX(-50%); bottom: 30px; font-size: 17px; opacity: 0;
    transition: opacity 0.3s, visibility 0.3s, bottom 0.3s;
}
.toast.show {
    visibility: visible; opacity: 1; bottom: 50px;
}

/* ======================================= */
/* --- ESTILOS PARA LA TARJETA DE PISTA --- */
/* ======================================= */
.hint-card {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.75rem;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.75rem;
}
.dark .hint-card {
    background-color: #1f2937;
}
.dark .hint-card p {
    color: #e5e7eb !important;
}

/* ======================================= */
/* --- AJUSTES PARA PANTALLA DE MÓVIL --- */
/* ======================================= */
@media (max-height: 850px) {
    body {
        min-height: 100vh;
        min-height: -webkit-fill-available;
        display: flex;
        flex-direction: column;
    }

    html {
        height: -webkit-fill-available;
    }

    main.main-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        padding-top: 1rem;
        padding-bottom: 0;
    }

    main.main-content > .max-w-2xl {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-around;
    }

    main.main-content h1 {
        margin-bottom: 0.5rem;
    }
    main.main-content .mb-4 {
        margin-bottom: 0.5rem;
    }

    #game-board {
        width: 100%;
        max-width: min(38vh, 280px); 
        margin-left: auto;
        margin-right: auto;
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }

    #keyboard {
        flex-shrink: 0;
        padding-bottom: 0.5rem;
    }
}

/* ======================================= */
/* --- COLORES PERSONALIZADOS PARA BOTONES --- */
/* ======================================= */
.bg-custom-blue {
    background-color: #193E58;
}
.hover\\:bg-custom-blue-dark:hover {
    background-color: #112a3f;
}