/* Custom Colors & Structure for Yoro overriding Tailwind where specific exact hexes were mandated in prompt */
:root {
    --bg-void: #050505;
    --yoro-body: #23272D;
    --yoro-torso: #20262A;
    --yoro-outline: #6E7278;
    --yoro-plate: #121315;
    --yoro-panel: #040506;
    --yoro-border: #454A50;
    --yoro-eye: #1BEAF5;
    --yoro-core: #1BEAF5;
    --text-dialogue: #E8EAED;
}

/* Alto de Yoro según la altura de la pantalla (el ancho sale de la proporción 1190x1900).
   Valores de partida, ajústalos a tu gusto */
:root {
    --yoro-height: min(44svh, 440px);
    --yoro-min-height: min(24svh, 200px);
}

@media (max-height: 640px) {
    :root {
        --yoro-height: 40svh;
    }
}

@media (max-height: 520px) {
    :root {
        --yoro-height: 36svh;
    }
}

body {
    background-color: var(--bg-void);
    color: var(--text-dialogue);
    margin: 0;
    overflow: hidden;
    /* Vast and empty */
}

/* Animations */
@keyframes fadeInText {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Yoro (SVG). Las coordenadas internas van en unidades del viewBox 1190x1900.
   El escenario se encoge (hasta --yoro-min-height) si el juego de turno necesita más espacio */
.yoro-stage {
    position: relative;
    flex: 0 1 var(--yoro-height);
    height: var(--yoro-height);
    min-height: var(--yoro-min-height);
    display: flex;
    justify-content: center;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.yoro-figure {
    position: relative;
    height: 100%;
    aspect-ratio: 1190 / 1900;
}

/* Halo cian suave detrás de Yoro. Es un pseudo-elemento: no necesita HTML.
   z-index negativo para quedar detrás del robot y pointer-events: none
   para que no bloquee ningún click. */
.yoro-figure::before {
    content: "";
    position: absolute;
    top: 52%;
    left: 50%;
    width: 170%;
    aspect-ratio: 1;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle closest-side,
            rgba(110, 231, 242, 0.16) 0%,
            rgba(110, 231, 242, 0.06) 45%,
            transparent 100%);
    z-index: -1;
    pointer-events: none;
}

.yoro-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    pointer-events: none;
}

.yoro-shadow {
    fill: rgba(110, 231, 242, 0.08);
}

.yoro-limb {
    fill: var(--yoro-body);
    stroke: var(--yoro-outline);
    stroke-width: 12;
}

.yoro-hips {
    fill: var(--yoro-panel);
    stroke: var(--yoro-outline);
    stroke-width: 7;
}

.yoro-torso-shell {
    fill: var(--yoro-torso);
    stroke: var(--yoro-outline);
    stroke-width: 12;
    stroke-linejoin: round;
}

.yoro-torso-panel {
    fill: var(--yoro-panel);
    stroke: var(--yoro-panel);
    stroke-width: 6;
    stroke-linejoin: round;
}

.yoro-core-shape,
.yoro-core-glow {
    fill: var(--yoro-core);
    stroke: var(--yoro-core);
    stroke-width: 22;
    stroke-linejoin: round;
}

.yoro-core-glow {
    opacity: 0.85;
}

.yoro-head-shell {
    fill: url(#yoro-head-fill);
    stroke: var(--yoro-outline);
    stroke-width: 12;
}

.yoro-face-plate {
    fill: var(--yoro-plate);
    stroke: #1a1d21;
    stroke-width: 4;
}

.yoro-eye-shape,
.yoro-eye-glow {
    fill: var(--yoro-eye);
}

.yoro-eye-glow {
    opacity: 0.95;
}

/* Parpadeo: el ojo (y su brillo) se aplasta hacia su borde inferior */
.yoro-eye-shape,
.yoro-eye-glow {
    transform-box: fill-box;
    transform-origin: 50% 100%;
    transition: transform 0.06s linear, opacity 0.06s linear;
}

.yoro-blink .yoro-eye-shape,
.yoro-blink .yoro-eye-glow {
    transform: scaleY(0.07);
}

.yoro-blink .yoro-eye-glow {
    opacity: 0.5;
}

/* Boca "ω": mismo color tenue que tenía el diseño original */
.yoro-mouth-shape {
    fill: none;
    stroke: var(--yoro-border);
    stroke-width: 11;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#yoro-mouth {
    opacity: 0.6;
}

/* Expresiones: #yoro-avatar[data-expression] decide qué ojos, boca y adorno se ven */
.yoro-face,
.yoro-mouth-shape,
.yoro-extra {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.08s linear, visibility 0.08s linear;
}

[data-expression="neutral"] .yoro-face[data-face="base"],
[data-expression="sleep"] .yoro-face[data-face="base"],
[data-expression="happy"] .yoro-face[data-face="base"],
[data-expression="surprised"] .yoro-face[data-face="base"],
[data-expression="sad"] .yoro-face[data-face="sad"],
[data-expression="angry"] .yoro-face[data-face="angry"],
[data-expression="dizzy"] .yoro-face[data-face="dizzy"],
[data-expression="neutral"] [data-mouth="neutral"],
[data-expression="sleep"] [data-mouth="sleep"],
[data-expression="dizzy"] [data-mouth="sleep"],
[data-expression="happy"] [data-mouth="happy"],
[data-expression="surprised"] [data-mouth="surprised"],
[data-expression="sad"] [data-mouth="sad"],
[data-expression="angry"] [data-mouth="angry"],
[data-expression="sleep"] .yoro-extra[data-extra="sleep"],
[data-expression="angry"] .yoro-extra[data-extra="angry"] {
    opacity: 1;
    visibility: visible;
}

/* dormido: ojos cerrados todo el tiempo */
[data-expression="sleep"] .yoro-eye-shape,
[data-expression="sleep"] .yoro-eye-glow {
    transform: scaleY(0.07);
}

[data-expression="sleep"] .yoro-eye-glow {
    opacity: 0.5;
}

/* mareado: ojos en espiral que giran */
.yoro-face[data-face="dizzy"] .yoro-eye-glow,
.yoro-face[data-face="dizzy"] .yoro-eye-shape {
    fill: none;
    stroke: var(--yoro-eye);
    stroke-width: 13;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.yoro-face[data-face="dizzy"] use {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

[data-expression="dizzy"] .yoro-face[data-face="dizzy"] use {
    animation: yoroSpin 1.6s linear infinite;
}

.yoro-z,
.yoro-z-outline {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.yoro-z {
    stroke: var(--yoro-eye);
    stroke-width: 24;
}

.yoro-z-outline {
    stroke: #000;
    stroke-width: 34;
}

.yoro-vein {
    fill: none;
    stroke: #E3262B;
    stroke-width: 22;
    stroke-linecap: round;
}

.yoro-vein-glow {
    opacity: 0.6;
}

.yoro-extra {
    transform-box: fill-box;
    transform-origin: 50% 50%;
}

[data-expression="sleep"] .yoro-extra[data-extra="sleep"] {
    animation: yoroZ 2.2s ease-in-out infinite;
}

[data-expression="angry"] .yoro-extra[data-extra="angry"] {
    animation: yoroAngry 0.34s steps(2, end) infinite;
}

@keyframes yoroSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes yoroZ {

    0%,
    100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-14px) rotate(4deg);
    }
}

@keyframes yoroAngry {

    0%,
    100% {
        transform: translateX(0) rotate(-2deg);
    }

    50% {
        transform: translateX(4px) rotate(2deg);
    }
}

/* Poses de los brazos (0 abajo, 1 medio, 2 arriba). Medidas sobre el brazo derecho;
   el izquierdo es su reflejo. El origen del brazo es el centro de su hombro */
.yoro-arm-pose {
    transform-box: view-box;
    transform-origin: 0 0;
    transform: translate(878px, 1074px) rotate(-26deg);
    transition: transform 0.16s ease-out;
}

.yoro-arm-pose[data-pose="1"] {
    transform: translate(866px, 1022px) rotate(-90deg);
}

.yoro-arm-pose[data-pose="2"] {
    transform: translate(904px, 893px) rotate(-150.6deg);
}

/* Zonas táctiles invisibles sobre la cabeza y el núcleo */
.yoro-hit {
    position: absolute;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    border-radius: 30%;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.yoro-hit:focus-visible {
    outline: 2px solid var(--yoro-eye);
}

@media (prefers-reduced-motion: reduce) {
    .yoro-arm-pose,
    .yoro-eye-shape,
    .yoro-eye-glow,
    .yoro-face,
    .yoro-mouth-shape,
    .yoro-extra {
        transition: none;
    }

    .yoro-extra,
    .yoro-face[data-face="dizzy"] use {
        animation: none !important;
    }
}

/* Dialogue */
.dialogue-text {
    color: var(--text-dialogue);
    opacity: 0;
    transition: opacity 0.8s ease;
    text-align: center;
    margin-top: 64px;
    /* Generous spacing */
}

/* Murmullos de Yoro dormido */
.dialogue-murmur {
    font-style: italic;
    opacity: 0.55;
    letter-spacing: 0.04em;
}

/* Utilities */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Botones: estilo skeumorfico suave (gradiente cian + esquinas redondeadas) */
.btn-primary {
    background: linear-gradient(180deg, #8FF3FA, #5DD8E2 55%, #3FB9C4);
    color: #00363A;
    border: 1px solid #2E9AA3;
    border-radius: 16px;
    box-shadow: 0 2px 0 #1F6E75, 0 3px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Botones oscuros: cancelar, cerrar, ir a GitHub */
.btn-secondary {
    background: #1A1D20;
    color: #E0E3E6;
    border: 1px solid #454A50;
    border-radius: 16px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 #0B0F11, 0 3px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

/* Botones redondos de la esquina superior (se combinan con .btn-secondary) */
.btn-round {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    opacity: 0.6;
    transition: opacity 0.2s ease;
}

.btn-round:hover {
    opacity: 1;
}

.btn-round .material-symbols-outlined {
    font-size: 22px;
}

/* Capa a pantalla completa (panel de opciones): tapa todo, incluso los botones superiores */
.screen-overlay {
    background-color: var(--bg-void);
    z-index: 60;
}

/* Caja con contorno: usada en menus y paneles del Ahorcado */
.panel-box {
    border: 1px solid rgba(110, 231, 242, 0.35);
    box-shadow: 0 0 0 1px rgba(110, 231, 242, 0.08);
    border-radius: 20px;
    padding: 20px 28px;
}

/* Caja interior de las pantallas de detalle de estadisticas: contorno mas sutil que .panel-box */
.panel-box-soft {
    border: 1px solid rgba(110, 231, 242, 0.15);
    border-radius: 14px;
    padding: 14px 16px;
}

/* Ahorcado Experto: boton de pista */
@keyframes hintGlow {

    0%,
    100% {
        box-shadow: 0 0 4px 1px rgba(255, 215, 0, 0.5);
    }

    50% {
        box-shadow: 0 0 12px 4px rgba(255, 215, 0, 0.9);
    }
}

.hint-ready {
    background-color: #3a2f00;
    border-color: #FFD700 !important;
    color: #FFD700;
    opacity: 1 !important;
    cursor: pointer !important;
    animation: hintGlow 1.6s ease-in-out infinite;
}


/* Botón de música: apagado late suave para llamar la atención; encendido queda con contorno cian */
@keyframes musicPulse {

    0%,
    100% {
        border-color: #454A50;
        opacity: 0.6;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 #0B0F11, 0 3px 5px rgba(0, 0, 0, 0.5), 0 0 0 0 rgba(110, 231, 242, 0);
    }

    50% {
        border-color: #6EE7F2;
        opacity: 1;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 #0B0F11, 0 3px 5px rgba(0, 0, 0, 0.5), 0 0 12px 3px rgba(110, 231, 242, 0.5);
    }
}

.music-attention,
.skip-attention {
    animation: musicPulse 2.4s ease-in-out infinite;
}

.music-on {
    border-color: #6EE7F2;
    color: #6EE7F2;
    opacity: 1;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 2px 0 #0B0F11, 0 3px 5px rgba(0, 0, 0, 0.5), 0 0 6px rgba(110, 231, 242, 0.35);
}

/* quien prefiere menos movimiento: sin latido, solo el contorno resaltado */
@media (prefers-reduced-motion: reduce) {

    .music-attention,
    .skip-attention {
        animation: none;
        border-color: #6EE7F2;
        opacity: 1;
    }
}

/* Selector de idioma en panel de opciones */
#settings-language {
    position: relative;
}

#language-dropdown {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(110, 231, 242, 0.35);
    background-color: var(--bg-void); /* fondo sólido negro */
}

#language-dropdown button {
    white-space: nowrap;
    transition: background-color 0.15s ease;
}

#language-dropdown button:first-child {
    border-radius: 12px 12px 0 0;
}

#language-dropdown button:last-child {
    border-radius: 0 0 12px 12px;
}

#language-dropdown button:hover {
    background-color: rgba(110, 231, 242, 0.15);
}

/* Centrar texto del botón principal, icono a la derecha */
#language-button {
    justify-content: center;
}
#language-button .material-symbols-outlined {
    position: absolute;
    right: 12px;
}