/* Paleta de Colores Juanchapin.com */
:root {
    --azul-guate: #0094D3;
    --azul-oscuro: #007bb1;
    --verde-ok: #28a745;
    --fondo-gris: #f4f7f6;
    --blanco: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--fondo-gris);
    display: flex;
    justify-content: center;
    align-items: center;
    /* En PC esto evita que el juego se pegue al techo */
    min-height: 100vh;
    padding: 10px;
}

/* CONTENEDOR PRINCIPAL: Controla el tamaño en PC */
.container {
    background-color: var(--blanco);
    width: 100%;
    /* No permite que el juego crezca más de 360px en PC */
    max-width: 360px; 
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
    border-top: 5px solid var(--azul-guate);
}

header h1 {
    font-size: 1.2rem;
    color: var(--azul-guate);
    margin-bottom: 2px;
}

header h1 span {
    color: #333;
    font-weight: 300;
}

#info-categoria {
    font-size: 0.7rem;
    font-weight: bold;
    color: #999;
    text-transform: uppercase;
    display: block;
    margin-bottom: 10px;
}

/* ÁREA DEL DIBUJO: Muy compacta */
#dibujo-ahorcado {
    background: #fafafa;
    height: 130px; /* Reducido para ahorrar espacio vertical */
    margin: 5px 0;
    display: flex;
    justify-content: center;
}

#svg-ahorcado {
    height: 100%;
    max-width: 100%;
}

/* PALABRA Y PISTA */
#palabra-secreta {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 4px;
    margin: 10px 0;
    color: #222;
}

#pista-texto {
    font-size: 0.8rem;
    color: #666;
    font-style: italic;
    margin-bottom: 10px;
}

/* TECLADO: Compacto para PC y Móvil */
#teclado {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
    gap: 4px;
    margin-bottom: 15px;
}

.btn-letra {
    padding: 6px 0;
    font-size: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-weight: bold;
}

.btn-letra:hover:not(:disabled) {
    background-color: var(--azul-guate);
    color: white;
}

.btn-letra:disabled {
    background: #f0f0f0;
    color: #ccc;
    cursor: not-allowed;
}

/* BOTONES DE CONTROL */
#controles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#btn-reiniciar {
    background-color: var(--verde-ok);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-regresar {
    font-size: 0.75rem;
    color: #999;
    text-decoration: none;
}

.btn-regresar:hover {
    color: var(--azul-guate);
    text-decoration: underline;
}

/* Ajuste final para pantallas muy grandes (Monitores) */
@media (min-width: 1000px) {
    .container {
        /* Si aún se ve grande, bajamos el tamaño del texto */
        font-size: