:root {
    --bg: #ECEFF8;
    --ink: #14213D;
    --card: #fff;
    --line: #C5CCE3;
    --sky: #3E6FE0;
    --berry: #D1345B;
    --sun: #F6B73C;
    --mint: #1A7F5E; /* antes #1E8A66: el texto blanco encima daba 4,3:1; ahora 4,95:1 */
    --lav: #B79CF0;
    --coral: #F28B6B;
    --aqua: #2DB9D3;
    --lime: #A8D13A;
    --pink: #E06CC0;
    --orange: #EE7B1E;
    --mut: #5B6683;
    --sh: #14213D;
    /* Borde de casillas vacías: 3,9:1 sobre la tarjeta y 3,4:1 sobre el fondo (mínimo 3:1 en componentes). --line queda para separadores */
    --edge: #7080A6;
    /* Color del texto sobre fondos sky/berry, y berry apto para texto pequeño (5,3:1 sobre el fondo) */
    --on-sky: #fff;
    --on-berry: #fff;
    --berry-tx: #B8284D;
    /* Escala de radios: xs=barras/celdas diminutas, sm=teclas/casillas, md=controles/tiles/tableros, lg=tarjetas */
    --r-xs: 4px;
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 18px;
    --r-pill: 999px;
    box-sizing: border-box;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px)
}

@media (prefers-color-scheme:dark) {
    :root:not([data-theme="light"]) {
        --bg: #0E1630;
        --ink: #E9EDFB;
        --card: #17224A;
        --line: #2C3B6C;
        --mut: #9AA6CC;
        --sh: #05091A;
        --edge: #6577B3;
        /* sky y berry más claros: antes daban 3,3:1 y 3,2:1 sobre la tarjeta oscura; ahora 6,6:1 y 5,9:1 */
        --sky: #86A8F7;
        --berry: #F27C97;
        --berry-tx: #F27C97;
        --on-sky: #14213D;
        --on-berry: #14213D
    }
}

:root[data-theme="dark"] {
    --bg: #0E1630;
    --ink: #E9EDFB;
    --card: #17224A;
    --line: #2C3B6C;
    --mut: #9AA6CC;
    --sh: #05091A;
    --edge: #6577B3;
    --sky: #86A8F7;
    --berry: #F27C97;
    --berry-tx: #F27C97;
    --on-sky: #14213D;
    --on-berry: #14213D
}

html {
    scroll-padding-top: env(safe-area-inset-top, 0px)
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 500 16px/1.4 'Bricolage Grotesque', system-ui, sans-serif
}

#app {
    max-width: 520px;
    margin: 50px auto;
    padding: 16px 16px 40px
}

/* Móvil: el hueco de arriba (50 px de margen) es espacio que se necesita para jugar */
@media (max-width:600px) {
    #app {
        margin: 12px auto
    }
}

/* Pantallas anchas pero bajas (portátil de 768 px, tablet en horizontal): menos margen y tableros que se adaptan a la altura,
   para ver el tablero y sus controles sin hacer scroll. --bw = ancho máximo de los tableros (ver los juegos). En móvil no se aplica. */
@media (min-width:700px) and (max-height:900px) {
    #app {
        margin-top: 12px;
        --bw: max(280px, min(372px, calc(100vh - 430px)));
        --tile: clamp(38px, calc((100vh - 400px) / 6 - 6px), 54px)
    }
}

/* Pantallas anchas y altas (tablet en vertical, PC grande): sobra sitio, así que tableros y casillas crecen */
@media (min-width:700px) and (min-height:901px) {
    #app {
        --bw: 460px;
        --tile: 62px
    }
}

/* ---------- Tablet y PC: el inicio aprovecha el ancho ----------
   Hay 10 juegos: solo 2 y 5 columnas los reparten sin dejar una fila coja (con 3 o 4 salía 3+3+3+1 o 4+4+2). */
@media (min-width:700px) {
    #app:has(.hl) {
        max-width: 860px
    }

    /* Tablet en vertical: 2 columnas, y cada tarjeta en horizontal (icono a la izquierda) para que 5 filas quepan sin scroll */
    .hr2 .gg {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .hr2 .gt {
        display: grid;
        grid-template-columns: 52px minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-content: center;
        align-items: center;
        column-gap: 14px;
        row-gap: 2px;
        padding: 14px
    }

    .hr2 .gt .gl {
        grid-row: 1 / span 2;
        margin: 0
    }

    .hr2 .gt strong {
        align-self: end
    }

    .hr2 .gt em {
        align-self: start
    }
}

/* Tablet en horizontal y PC: cabecera a todo el ancho, resumen y progreso en una fila, y los 10 juegos en 5 columnas x 2 filas */
@media (min-width:900px) {
    #app:has(.hl) {
        max-width: 1140px
    }

    .hl {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        grid-template-areas: "top top" "hola hola" "av av" "hb hp" "sg sg";
        column-gap: 20px;
        align-items: stretch
    }

    .hl>.top {
        grid-area: top
    }

    .hl>.hola {
        grid-area: hola
    }

    .hl>.av2 {
        grid-area: av
    }

    .hl>.hb {
        grid-area: hb;
        margin: 8px 0 20px
    }

    /* El progreso va en una caja igual que la del resumen (mismo borde, radio, fondo y alto) para que las dos se lean como una sola franja */
    .hl>.hp {
        grid-area: hp;
        margin: 8px 0 20px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        box-sizing: border-box;
        padding: 10px 14px;
        border: 2px solid var(--ink);
        border-radius: var(--r-lg);
        background: var(--card)
    }

    .hl>.hp .ht {
        margin-bottom: 8px
    }

    .hl>.sg {
        grid-area: sg
    }

    .hr2 .gg {
        grid-template-columns: repeat(5, minmax(0, 1fr))
    }

    /* Tarjetas otra vez en vertical: con 5 columnas son estrechas y alargadas */
    .hr2 .gt {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 12px
    }

    .hr2 .gt .gl {
        margin-bottom: 2px
    }

    .hr2 .gt strong,
    .hr2 .gt em {
        align-self: auto
    }

    .hr2 .foot {
        margin-top: 20px
    }
}

button {
    font: inherit;
    color: inherit;
    cursor: pointer
}

button:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px
}

.top {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px
}

h1 {
    font-size: clamp(30px, 9vw, 44px);
    line-height: 1;
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 0
}

h2 {
    font-size: 20px;
    margin: 0 0 6px
}

.chip {
    border: 2px solid var(--ink);
    border-radius: var(--r-pill);
    padding: 4px 12px;
    background: var(--sun);
    color: #14213D;
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap
}

.sub {
    color: var(--mut);
    margin: 4px 0 20px
}

.sub b {
    font-variant-numeric: tabular-nums;
    color: var(--ink)
}

.gc {
    display: flex;
    gap: 14px;
    align-items: center;
    width: 100%;
    text-align: left;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    padding: 14px;
    box-shadow: 4px 4px 0 var(--sh);
    margin-bottom: 16px
}

.gc:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--sh)
}

.gl {
    flex: none;
    width: 64px;
    height: 64px;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 26px;
    color: #14213D
}

.gc strong {
    font-size: 20px;
    display: block
}

.gc small {
    color: var(--mut);
    display: block;
    font-size: 14px
}

.gc em {
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    display: block;
    margin-top: 4px
}

.foot {
    color: var(--mut);
    font-size: 14px;
    margin-top: 28px
}

.lnk {
    background: none;
    border: 0;
    /* Zona táctil de 44 px de alto: el padding la amplía y el margen negativo evita que cambie el layout */
    display: inline-block;
    padding: 13px 8px;
    margin: -13px -8px;
    line-height: 18px;
    text-decoration: underline;
    font-size: 14px;
    color: var(--mut)
}

.bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px
}

.bar h1 {
    font-size: 28px;
    flex: 1
}

.bk {
    border: 2px solid var(--ink);
    background: var(--card);
    border-radius: var(--r-pill);
    padding: 4px 12px;
    font-weight: 700;
    /* Objetivo táctil mínimo de 44×44 px */
    box-sizing: border-box;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.btn {
    border: 2px solid var(--ink);
    background: var(--card);
    border-radius: var(--r-md);
    padding: 8px 14px;
    min-height: 44px;
    font-weight: 700;
    box-shadow: 2px 2px 0 var(--sh)
}

.btn.pri {
    background: var(--sun);
    color: #14213D
}

.btn[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg)
}

.row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 12px 0
}

/* Barra de controles de los juegos (controles() en core.js) */
.row.ctl {
    justify-content: center;
    margin: 10px 0
}

.row.ctl .btn {
    padding: 8px 12px;
    font-size: .9rem
}

.cc {
    text-align: center;
    margin: 0
}

/* Inicio: botón «Continuar / Siguiente reto» y aviso a invitados con racha */
.btn.sg {
    margin: 0 0 16px
}

.av2 {
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 2px dashed var(--edge);
    border-radius: var(--r-md);
    font-size: 14px;
    color: var(--mut)
}

.av2 .lnk {
    font-weight: 700;
    color: var(--ink)
}

.msg {
    min-height: 22px;
    margin: 8px 0;
    text-align: center;
    font-weight: 700
}

.r {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 6px
}

.t {
    position: relative;
    width: var(--tile, 54px);
    height: var(--tile, 54px);
    border: 2px solid var(--edge);
    border-radius: var(--r-sm);
    display: grid;
    place-items: center;
    font-size: 26px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--card)
}

.t i {
    position: absolute;
    right: 4px;
    bottom: 0;
    font-size: 14px;
    font-style: normal
}

.s0 {
    background: #5B6683;
    border-color: #5B6683;
    color: #fff
}

.s1 {
    background: var(--sun);
    border-color: var(--sun);
    color: #14213D
}

.s2 {
    background: var(--mint);
    border-color: var(--mint);
    color: #fff
}

.kb {
    margin-top: 14px
}

.kr {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-bottom: 6px
}

.k {
    flex: 1;
    max-width: 44px;
    height: 48px;
    border: 0;
    border-radius: var(--r-sm);
    background: var(--line);
    font-weight: 700;
    text-transform: uppercase;
    padding: 0
}

.k.w {
    max-width: 64px
}

.words {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 18px;
    justify-content: center;
    margin: 10px 0
}

.wd {
    display: flex;
    gap: 3px
}

.c {
    width: 30px;
    border: 2px solid var(--edge);
    border-radius: var(--r-sm);
    background: var(--card);
    padding: 2px 0;
    display: flex;
    flex-direction: column;
    align-items: center
}

.c small {
    font-size: 14px;
    color: var(--mut)
}

.c b {
    height: 24px;
    font-size: 20px;
    text-transform: uppercase
}

.c.sel {
    border-color: var(--sky);
    box-shadow: 0 0 0 2px var(--sky)
}

.c.lk {
    background: var(--line)
}

.c.cf {
    border-color: var(--berry)
}

.c.bd {
    background: var(--berry);
    color: var(--on-berry)
}

.c.bd small {
    color: var(--on-berry)
}

.pu {
    align-self: flex-end;
    font-weight: 800;
    padding-bottom: 4px
}

.bd2 {
    display: grid;
    gap: 0;
    margin: 12px auto;
    max-width: min(440px, var(--bw, 440px));
    border: 3px solid var(--ink);
    border-radius: var(--r-md);
    overflow: hidden
}

.z {
    position: relative;
    aspect-ratio: 1;
    border: 1px solid var(--ink);
    padding: 0;
    color: #14213D;
    font-size: clamp(16px, 5vw, 26px);
    font-weight: 800;
    display: grid;
    place-items: center;
    border-radius: 0
}

.z small {
    position: absolute;
    left: 3px;
    top: 1px;
    font-size: 12px
}

.z.cf {
    outline: 3px solid var(--berry);
    outline-offset: -3px
}

.res {
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    background: var(--card);
    padding: 14px;
    margin-top: 16px;
    box-shadow: 4px 4px 0 var(--sh)
}

pre {
    background: var(--bg);
    border-radius: var(--r-md);
    padding: 10px;
    margin: 8px 0;
    white-space: pre-wrap;
    font: inherit;
    line-height: 1.5
}

.tm {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: center;
    position: relative
}

/* Desglose del cronómetro cuando hay penalización por ayudas, y destello +N s al pulsar una */
.tm .tp {
    display: block;
    font-size: .875rem;
    font-weight: 600;
    color: var(--berry-tx)
}

.tm .tp:empty {
    display: none
}

.tm .tb {
    position: absolute;
    left: 50%;
    top: 0;
    margin-left: 42px;
    color: var(--berry-tx);
    font-weight: 800;
    pointer-events: none;
    animation: tmb 1.3s ease-out forwards
}

@keyframes tmb {
    from {
        opacity: 1;
        transform: translateY(0)
    }

    to {
        opacity: 0;
        transform: translateY(-14px)
    }
}

@media (prefers-reduced-motion:reduce) {
    .tm .tb {
        animation: none
    }
}

.av {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--sky);
    color: var(--on-sky);
    display: grid;
    place-items: center;
    font-weight: 800;
    border: 2px solid var(--ink);
    flex: none
}

.me {
    display: flex;
    gap: 10px;
    align-items: center
}

.me input {
    flex: 1;
    min-width: 0;
    font: inherit;
    font-weight: 700;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    padding: 8px 10px;
    background: var(--card);
    color: var(--ink)
}

.sm {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin: 14px 0
}

.sm div {
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    padding: 8px;
    text-align: center;
    font-size: 14px;
    background: var(--card)
}

.sm b {
    display: block;
    font-size: 26px
}

.br {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 3px 0
}

.br span {
    font-size: 14px
}

.br span.es {
    color: var(--sun);
    letter-spacing: 1px;
    white-space: nowrap
}

.br u {
    flex: 1;
    display: block
}

.br i {
    display: block;
    height: 16px;
    background: var(--sky);
    border-radius: var(--r-xs);
    min-width: 2px
}

.br b {
    font-size: 14px;
    width: 22px
}

/* Mapa de actividad: 4 semanas × 7 días. El número de cada casilla es la información (no depende del color) */
.hm {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin: 8px 0 6px
}

.hm button {
    height: 40px;
    padding: 0;
    border: 2px solid var(--edge);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    font-variant-numeric: tabular-nums
}

.hm button.p {
    background: var(--sky);
    border-color: var(--sky);
    color: var(--on-sky)
}

.hm button.f {
    background: var(--sun);
    border-color: var(--sun);
    color: #14213D
}

.hm button.hoy {
    border-color: var(--ink)
}

.hm button[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink)
}

.pb {
    margin-top: 14px
}

.pb p {
    margin: 6px 0
}

.st {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid var(--line)
}

.st small {
    display: block;
    color: var(--mut);
    font-size: 14px
}

.cb .s1 {
    background: #E69F00;
    border-color: #E69F00;
    color: #14213D
}

.cb .s2 {
    background: #0072B2;
    border-color: #0072B2;
    color: #fff
}

.bk.ic {
    position: relative;
    width: 44px;
    height: 44px;
    padding: 0;
    display: grid;
    place-items: center
}

.top h1 {
    min-width: 0
}

/* ---------- Perfil y ajustes ---------- */
.res h2+.st {
    border-top: 0
}

.st.v {
    flex-direction: column;
    align-items: stretch;
    gap: 10px
}

.seg {
    display: flex;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--card)
}

.seg .btn {
    flex: 1;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 8px 6px
}

.seg .btn+.btn {
    border-left: 2px solid var(--ink)
}

.seg .btn[aria-pressed="true"] {
    background: var(--ink);
    color: var(--bg)
}

.seg .btn:focus-visible {
    outline-offset: -4px
}

.sw {
    flex: none;
    position: relative;
    width: 50px;
    height: 30px;
    padding: 0;
    border: 2px solid var(--ink);
    border-radius: var(--r-pill);
    background: var(--card)
}

.sw::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--ink);
    transition: transform .15s
}

.sw[aria-checked="true"] {
    background: var(--mint)
}

.sw[aria-checked="true"]::after {
    transform: translateX(20px);
    background: #fff
}

@media (prefers-reduced-motion:reduce) {
    .sw::after {
        transition: none
    }
}

.btn.dg {
    background: var(--berry);
    color: var(--on-berry)
}

.av.lg {
    width: 64px;
    height: 64px;
    font-size: 28px
}

.hd .me input {
    font-size: 18px;
    padding: 10px 12px
}

.hs {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 2px solid var(--line)
}

.hs p {
    margin: 0;
    color: var(--mut);
    font-size: 14px
}

.hs .row {
    margin: 12px 0 0
}

.hs .btn.pri {
    width: 100%;
    padding: 10px 14px
}

.cap {
    color: var(--mut);
    font-size: 14px
}

.gh {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px
}

.gh h2 {
    margin: 0
}

.gi {
    flex: none;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    box-sizing: border-box;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    display: grid;
    place-items: center;
    font-weight: 800;
    font-size: 16px;
    line-height: 1;
    white-space: nowrap;
    color: #14213D
}

.gs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px
}

.gs div {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 2px solid var(--line);
    border-radius: var(--r-md)
}

.gs div:last-child:nth-child(odd) {
    grid-column: 1/-1
}

.gs b {
    flex: none;
    min-width: 1.2ch;
    font-size: 30px;
    line-height: 1;
    font-variant-numeric: tabular-nums
}

.gs span {
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25
}

.gs small {
    display: block;
    margin-top: 2px;
    color: var(--mut);
    font-size: 14px;
    font-weight: 500
}

.gx {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 2px solid var(--line)
}

.gx p {
    margin: 6px 0 0
}

/* ---------- Inicio: resumen del día ---------- */
.hb {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 14px 0 20px;
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    background: var(--card);
    overflow: hidden
}

.hb div {
    padding: 10px 8px;
    font-size: 14px;
    line-height: 1.25;
    color: var(--mut)
}

.hb div+div {
    border-left: 2px solid var(--ink)
}

.hb b {
    display: block;
    margin-bottom: 2px;
    font-size: 18px;
    line-height: 1.15;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: var(--ink)
}

.hb .sn {
    background: var(--sun);
    color: #14213D
}

.hb .sn b {
    color: #14213D
}

/* ---------- Perfil: tarjetas de juego plegables (abiertas si hay 3 juegos o menos) ---------- */
.gm summary {
    /* Icono | nombre y estado apilados | flecha. Con texto de 14 px el estado ya no cabe al lado del nombre en pantallas estrechas */
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    cursor: pointer;
    list-style: none
}

.gm summary .gi {
    grid-area: 1 / 1 / span 2 / 1
}

.gm summary::after {
    grid-area: 1 / 3 / span 2 / 3
}

.gm summary::-webkit-details-marker {
    display: none
}

.gm summary h2 {
    grid-column: 2;
    margin: 0;
    overflow-wrap: anywhere
}

.gm summary small {
    grid-column: 2;
    color: var(--mut);
    font-size: 14px;
    font-weight: 500
}

.gm summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin: 0 4px 3px 2px;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(45deg)
}

.gm[open] summary {
    margin-bottom: 12px
}

.gm[open] summary::after {
    margin-bottom: -3px;
    transform: rotate(-135deg)
}

.gm summary:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 4px;
    border-radius: var(--r-sm)
}

/* Entrar con Google */
.btn.gg {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 12px 0 0;
    padding: 11px 14px;
    background: #fff;
    color: #1f1f1f
}

.btn.gg .ggi {
    width: 20px;
    height: 20px;
    flex: none
}

.or {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0 10px;
    color: var(--mut);
    font-size: 14px;
    font-weight: 600
}

.or::before,
.or::after {
    content: "";
    flex: 1;
    height: 2px;
    background: var(--ink);
    opacity: .2
}

/* Compartir: botón de icono (tarjeta de resultado y progreso del día) */
.btn.ib {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: var(--r-md);
    box-shadow: 1px 1px 0 var(--sh)
}

.pw {
    position: relative;
    margin: 10px 0 0
}

.pw pre {
    margin: 0;
    padding: 10px 12px;
    line-height: 1.4
}

/* Tarjeta de resultado: botón copiar/compartir en la esquina superior derecha */
.res.rb {
    position: relative
}

.res.rb>.ib {
    position: absolute;
    top: 10px;
    right: 10px
}

.res .est {
    margin: 2px 0 6px;
    font-size: 1.4rem;
    letter-spacing: 2px;
    color: var(--sun)
}

.res.rb h2 {
    min-height: 40px;
    margin: -4px 0 4px;
    padding-right: 50px;
    display: flex;
    align-items: center
}

.ht {
    align-items: center
}

.ht .hr {
    display: flex;
    align-items: center;
    gap: 10px
}

#toast {
    position: fixed;
    left: 50%;
    bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 12px);
    padding: 8px 16px;
    border-radius: var(--r-pill);
    background: var(--ink);
    color: var(--bg);
    font-weight: 700;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s, transform .2s;
    z-index: 50
}

#toast.on {
    opacity: 1;
    transform: translate(-50%, 0)
}

@media (prefers-reduced-motion:reduce) {
    #toast {
        transition: none
    }
}

/* ---------- Sudoku mini ---------- */
.sd {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    max-width: var(--bw, 372px);
    margin: 12px auto;
    border: 3px solid var(--ink);
    border-radius: var(--r-md);
    overflow: hidden;
    background: var(--card)
}

.sx {
    aspect-ratio: 1;
    padding: 0;
    border: 0;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--card);
    color: var(--ink);
    font-size: clamp(20px, 7vw, 30px);
    font-weight: 700;
    display: grid;
    place-items: center
}

.sx.g {
    background: var(--line);
    font-weight: 800
}

.sx.vr {
    border-right: 3px solid var(--ink)
}

.sx.hr {
    border-bottom: 3px solid var(--ink)
}

.sx:nth-child(6n) {
    border-right: 0
}

.sx:nth-child(n+31) {
    border-bottom: 0
}

.sx.eq {
    background: rgba(62, 111, 224, .22)
}

.sx.cf {
    box-shadow: inset 0 0 0 3px var(--berry)
}

.sx.bd {
    background: var(--berry);
    color: var(--on-berry)
}

.sx.sel {
    box-shadow: inset 0 0 0 4px var(--sky)
}

.sx:focus-visible {
    outline-offset: -4px
}

.sx:disabled {
    cursor: default
}

.np .k {
    max-width: 56px;
    height: 52px;
    font-size: 20px
}

.np .k.w {
    max-width: 72px
}

/* ---------- Escalera ---------- */
button.t {
    padding: 0
}

.t.sel {
    border-color: var(--sky);
    box-shadow: 0 0 0 2px var(--sky)
}

/* ---------- Operaciones ---------- */
.obj {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    margin: 8px 0 14px
}

.obj small {
    color: var(--mut);
    font-size: 14px
}

.obj b {
    font-size: 56px;
    line-height: 1;
    font-weight: 800;
    font-variant-numeric: tabular-nums
}

.nm {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px
}

.nb {
    aspect-ratio: 2/1;
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: 3px 3px 0 var(--sh);
    font-size: 26px;
    font-weight: 800;
    font-variant-numeric: tabular-nums
}

.nb.rs {
    background: var(--sun);
    color: #14213D
}

.nb.sel {
    background: var(--ink);
    color: var(--bg)
}

.nb:disabled {
    opacity: .6;
    cursor: default
}

.op {
    display: flex;
    gap: 8px;
    margin: 14px 0
}

.op .btn {
    flex: 1;
    padding: 6px;
    font-size: 24px
}

.lg {
    display: grid;
    gap: 4px;
    margin: 12px 0 0;
    padding: 0;
    list-style: none;
    font-variant-numeric: tabular-nums
}

.lg li {
    padding: 6px 10px;
    border: 2px solid var(--line);
    border-radius: var(--r-md);
    background: var(--card)
}

/* ---------- Cuenta ---------- */
.id {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0
}

.id>b {
    font-size: 22px;
    line-height: 1.1;
    overflow-wrap: anywhere
}

.tag {
    display: inline-block;
    border: 2px solid var(--ink);
    border-radius: var(--r-pill);
    padding: 1px 10px;
    font-size: 14px;
    font-weight: 700;
    background: var(--card)
}

.tag.ad {
    background: var(--sun);
    color: #14213D
}

.st small {
    overflow-wrap: anywhere
}

.st .lnk {
    flex: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--ink)
}

a.btn {
    display: inline-block;
    text-decoration: none;
    color: inherit
}

.btn.out {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 12px 14px
}

.id>small {
    color: var(--mut);
    font-size: 14px;
    font-weight: 600;
    margin-top: -4px
}

.at {
    flex: none;
    font-size: 18px;
    font-weight: 800;
    color: var(--mut)
}

.st.v .row {
    margin: 0
}

/* ---------- Perfil: cabecera ---------- */
.who {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.who input {
    flex: none;
    width: 100%;
    box-sizing: border-box
}

.meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--mut);
    font-size: 14px;
    font-weight: 600
}

.meta .tag {
    color: var(--ink)
}

.hs>.btn {
    width: 100%;
    padding: 10px 14px
}

/* ---------- Cómo se juega ---------- */
.how {
    margin: 0 0 12px;
    border: 2px solid var(--line);
    border-radius: var(--r-lg);
    background: var(--card);
    padding: 0 14px
}

.how summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    cursor: pointer;
    list-style: none;
    font-weight: 700
}

.how summary::-webkit-details-marker {
    display: none
}

.how summary::after {
    content: "";
    flex: none;
    width: 8px;
    height: 8px;
    margin: 0 4px 3px 2px;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    transform: rotate(45deg)
}

.how[open] summary::after {
    margin-bottom: -3px;
    transform: rotate(-135deg)
}

.how summary:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px;
    border-radius: var(--r-sm)
}

.how ol {
    list-style: none;
    counter-reset: n;
    margin: 0 0 12px;
    padding: 0;
    display: grid;
    gap: 8px
}

.how ol li {
    counter-increment: n;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    line-height: 1.4
}

.how ol li::before {
    content: counter(n);
    flex: none;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--sky);
    color: var(--on-sky);
    border: 2px solid var(--ink);
    font-size: 12px;
    font-weight: 800
}

.dm {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 12px;
    border-radius: var(--r-md);
    background: var(--bg)
}

.dm .cap {
    margin: 0;
    text-align: center
}

.dm .cap b {
    color: var(--ink)
}

.dm .r {
    margin: 0;
    gap: 5px
}

.dm .t {
    width: 40px;
    height: 40px;
    font-size: 20px;
    border-radius: var(--r-sm)
}

.dm .t i {
    right: 3px;
    font-size: 12px
}

.dm .dot {
    display: inline-grid;
    place-items: center;
    width: 20px;
    height: 20px;
    margin-right: 2px;
    border: 2px solid transparent;
    border-radius: var(--r-sm);
    font-size: 12px;
    vertical-align: middle
}

.dm .bd2 {
    width: 150px;
    margin: 0
}

.dm .z {
    font-size: 20px
}

.dm .sd {
    width: 216px;
    margin: 0
}

.dm .sx {
    font-size: 16px
}

/* Ejemplos con varias imágenes en fila, cada una con su pie (Jarras, Atasco, Eco). --c = columnas, --mw = ancho máximo */
.dm .dmg {
    display: grid;
    grid-template-columns: repeat(var(--c, 2), minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    max-width: var(--mw, 340px);
    margin: 0
}

.dm .dmg figure {
    margin: 0;
    text-align: center
}

.dm .dmg svg {
    display: block;
    width: 100%;
    height: auto
}

.dm .dmg figcaption {
    margin-top: 4px;
    font-size: .78rem;
    line-height: 1.3;
    color: var(--mut)
}

.dm .dmg figcaption b {
    color: var(--ink)
}

.eq1 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px
}

.chp {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 8px;
    box-sizing: border-box;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    background: var(--card);
    font-weight: 800;
    font-variant-numeric: tabular-nums
}

.chp.rs {
    background: var(--sun);
    color: #14213D
}

/* ---------- Perfil: cifras de cada juego ---------- */
.kp {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 8px;
    margin-top: 10px
}

.gx .br+.kp {
    margin-top: 12px
}

.kp div {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    padding: 10px 6px;
    border-radius: var(--r-md);
    background: var(--bg);
    text-align: center
}

.kp b {
    font-size: 22px;
    line-height: 1.1;
    font-variant-numeric: tabular-nums
}

.kp i {
    font-style: normal;
    font-size: 14px;
    letter-spacing: 1px;
    line-height: 1.2
}

.kp span {
    font-size: 14px;
    font-weight: 600;
    color: var(--mut);
    line-height: 1.2
}

/* Amigos: insignia de solicitudes pendientes sobre el icono de inicio */
.nbd {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 20px;
    height: 20px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: var(--r-pill);
    background: var(--berry);
    color: var(--on-berry);
    font-size: 12px;
    font-weight: 800;
    display: grid;
    place-items: center;
    border: 2px solid var(--bg)
}

.st .row .btn,
.st .acts .btn {
    padding: 6px 12px
}

/* Filas de personas (Amigos): si las acciones no caben junto al nombre, bajan a una segunda línea en vez de aplastarlo */
.st.fa {
    flex-wrap: wrap
}

.st.fa>.fn {
    flex: 1 1 9rem;
    min-width: 0
}

.acts {
    flex: none;
    margin: 0 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0 22px /* con los 8 px de zona táctil de cada lado, deja 6 px entre zonas vecinas */
}

/* Ranking entre amigos */
.pos {
    flex: none;
    width: 26px;
    text-align: center;
    font-weight: 800;
    font-size: 18px;
    font-variant-numeric: tabular-nums;
    color: var(--mut)
}

.st.yo {
    background: var(--bg);
    margin: 0 -10px;
    padding: 8px 10px;
    border-radius: var(--r-md);
    border-top-color: transparent
}

.pt {
    flex: none;
    text-align: right;
    font-weight: 800;
    font-size: 22px;
    line-height: 1.05;
    font-variant-numeric: tabular-nums
}

.pt small {
    font-size: 14px;
    font-weight: 600
}

.rn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0
}

.bk[disabled] {
    opacity: .35
}

/* Perfil: lápiz para editar el nombre */
.ed {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin: -10px 0 0 0;
    vertical-align: middle;
    border-radius: 50%;
    color: var(--mut);
    text-decoration: none
}

.ed svg {
    width: 16px;
    height: 16px
}

.ed:hover,
.ed:focus-visible {
    background: var(--bg);
    color: var(--ink)
}

/* ---------- Luces ---------- */
.lzb {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    max-width: 340px;
    margin: 12px auto
}

.lz {
    aspect-ratio: 1;
    padding: 0;
    border: 3px solid var(--ink);
    border-radius: var(--r-md);
    background: var(--card);
    cursor: pointer
}

.lz.on {
    background: var(--sun);
    box-shadow: inset 0 -5px 0 rgba(20, 33, 61, .2)
}

.lz.pista {
    box-shadow: 0 0 0 4px var(--sky)
}

.lz.on.pista {
    box-shadow: inset 0 -5px 0 rgba(20, 33, 61, .2), 0 0 0 4px var(--sky)
}

.lz:disabled {
    cursor: default
}

.lz:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 2px
}

/* ---------- Sopa de letras ---------- */
.spw {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    max-width: 400px;
    margin: 0 auto 8px;
    padding: 0
}

.spw li {
    padding: 4px 10px;
    border: 2px solid var(--line);
    border-radius: var(--r-pill);
    background: var(--card);
    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .04em
}

.spw li.ok {
    color: var(--mut);
    text-decoration: line-through
}

/* Iconos de juego: SVG de trazos (hereda el color del texto de la insignia) */
.gi svg,
.gl svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round
}

.gi svg {
    width: 22px;
    height: 22px
}

.gl svg {
    width: 36px;
    height: 36px
}

/* ---------- Inicio: progreso del día y cuadrícula de juegos ---------- */
.hp {
    margin: 0 0 16px
}

.ht {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 800
}

.ht span {
    color: var(--mut);
    font-size: 14px;
    font-weight: 700
}

/* Barra de progreso del día: una sola barra que se rellena, sirve para cualquier número de juegos */
.slots {
    box-sizing: border-box;
    height: 20px;
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
    background: var(--card);
    overflow: hidden
}

.slots i {
    display: block;
    height: 100%;
    background: var(--mint);
    border-right: 2px solid var(--ink)
}

.slots.full i {
    border-right: 0
}

.gg {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 8px
}

.gt {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    text-align: left;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    padding: 12px;
    box-shadow: 4px 4px 0 var(--sh)
}

.gt:active {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 var(--sh)
}

.gt .gl {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: var(--r-md);
    margin-bottom: 2px
}

.gt .gl>svg {
    width: 30px;
    height: 30px
}

.gt strong {
    font-size: 17px;
    line-height: 1.15
}

.gt em {
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.25;
    color: var(--mut)
}

.gt.en em {
    color: var(--ink)
}

.gt.en em::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 6px;
    border: 1.5px solid var(--ink);
    border-radius: 50%;
    background: var(--sun);
    vertical-align: baseline
}

.gt.ok {
    background: color-mix(in srgb, var(--mint) 14%, var(--card));
    box-shadow: 2px 2px 0 var(--sh)
}

.gt.ok .gl {
    filter: saturate(.7)
}

.gt .ck {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border: 2px solid var(--ink);
    border-radius: 50%;
    background: var(--mint)
}

.gt .ck svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #fff;
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round
}

/* ---------- Teclado de Palabra: estado de cada letra ----------
   (la regla .k anterior pisaba los colores de .s0/.s1/.s2; aquí se fuerzan con más especificidad) */
.k.s0 {
    background: #5B6683;
    color: #fff;
    text-decoration: line-through;
    text-decoration-thickness: 2px
}

.k.s1 {
    background: var(--sun);
    color: #14213D
}

.k.s2 {
    background: var(--mint);
    color: #fff
}

.cb .k.s1 {
    background: #E69F00;
    color: #14213D
}

.cb .k.s2 {
    background: #0072B2;
    color: #fff
}

/* ---------- Perfil: juegos agrupados en una sola tarjeta ---------- */
.gml {
    margin-top: 16px;
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: 4px 4px 0 var(--sh);
    overflow: hidden
}

.gml .gm {
    margin: 0;
    border: 0;
    border-top: 2px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    background: transparent
}

.gml .gm:first-child {
    border-top: 0
}

/* ---------- Ajustes: encabezados de sección discretos ---------- */
.aj h2 {
    margin: 0 0 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--mut)
}

/* ---------- Entrar / Crear cuenta ---------- */
.btn.full {
    display: block;
    width: 100%;
    margin-top: 12px;
    padding: 12px 14px
}

.alt {
    margin: 14px 0 0;
    text-align: center;
    color: var(--mut);
    font-size: 14px
}

.alt .lnk {
    font-size: 14px;
    font-weight: 700;
    color: var(--ink)
}

/* Autocompletado del navegador: respeta el tema */
:root[data-theme="dark"] {
    color-scheme: dark
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        color-scheme: dark
    }
}

.me input:-webkit-autofill,
.me input:-webkit-autofill:hover,
.me input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--ink);
    caret-color: var(--ink);
    box-shadow: 0 0 0 40px var(--card) inset;
    transition: background-color 9999s
}

.me input:autofill {
    background: var(--card);
    color: var(--ink)
}

/* Botón de Google en oscuro */
:root[data-theme="dark"] .btn.gg {
    background: #131314;
    color: #E3E3E3;
    border-color: #8E918F
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .btn.gg {
        background: #131314;
        color: #E3E3E3;
        border-color: #8E918F
    }
}

.res>p:first-child {
    margin-top: 0
}

/* ---------- Duelos entre amigos ---------- */
.duh {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 10px;
    padding: 8px 12px;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    background: var(--card);
    box-shadow: 2px 2px 0 var(--sh)
}

.dus {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    font-weight: 700
}

.dus span {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0
}

.dus b {
    max-width: 96px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px
}

.dus i {
    font-style: normal;
    font-weight: 800;
    font-size: 22px;
    font-variant-numeric: tabular-nums
}

.dus em {
    font-style: normal;
    color: var(--mut)
}

.dui {
    flex: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--mut);
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.duc,
.duf {
    text-align: center
}

.duc .dus,
.duf .dus {
    justify-content: center;
    margin-bottom: 6px
}

.duj {
    margin: 4px 0 0;
    font-size: 24px;
    font-weight: 800
}

.duq {
    margin: 10px 0;
    font-size: 72px;
    font-weight: 800;
    line-height: 1;
    font-variant-numeric: tabular-nums
}

.duf.w {
    border-color: var(--mint)
}

.duf.l {
    border-color: var(--berry)
}

.duf.e {
    border-color: var(--sun)
}

#dub {
    position: fixed;
    left: 0;
    right: 0;
    top: calc(8px + env(safe-area-inset-top, 0px));
    z-index: 50;
    display: none;
    padding: 0 12px;
    pointer-events: none
}

#dub.on {
    display: block
}

.dub {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 520px;
    margin: 0 auto;
    padding: 10px 12px;
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    background: var(--card);
    box-shadow: 4px 4px 0 var(--sh)
}

.dubi {
    flex: none;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    background: var(--sun);
    color: #14213D
}

.dubt {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    font-weight: 700
}

.dubt small {
    font-weight: 500;
    color: var(--mut);
    font-variant-numeric: tabular-nums
}

@media (max-width:440px) {
    .dub {
        flex-wrap: wrap
    }

    .dub .row {
        width: 100%
    }

    .dub .row .btn {
        flex: 1
    }

    .dubt {
        flex-basis: calc(100% - 52px)
    }

    .dub>.btn {
        width: 100%
    }
}

/* ---------- Animaciones ligeras ----------
   Todo va dentro de prefers-reduced-motion:no-preference: quien pide menos movimiento no ve nada de esto.
   - Entradas (#app.in): solo al cambiar de pantalla. TODAS usan la misma duración (--da-d) y el mismo paso de cascada,
     y la cascada tiene tope, así que ninguna pantalla tarda más que otra en asentarse.
   - Efectos de un solo uso (.fl .pp .sk .fin): solo en el draw() siguiente al evento (ver Anim en core.js),
     para que no se repitan al repintar. */
@media (prefers-reduced-motion:no-preference) {
    #app {
        --da-d: .28s;
        --da-s: .03s
    }

    /* --da-d: duración única de toda entrada de pantalla. --da-s: paso entre bloques de la cascada. */

    @keyframes da-up {
        from {
            opacity: 0;
            transform: translateY(10px)
        }
    }

    @keyframes da-in {
        from {
            opacity: 0
        }
    }

    @keyframes da-fade {
        from {
            opacity: 0;
            transform: scale(.6)
        }
    }

    @keyframes da-grow {
        from {
            transform: scaleX(0)
        }
    }

    @keyframes da-check {
        from {
            transform: scale(0)
        }
    }

    @keyframes da-pop {
        from {
            opacity: 0;
            transform: scale(.94) translateY(8px)
        }

        60% {
            transform: scale(1.02)
        }
    }

    @keyframes da-type {
        50% {
            transform: scale(1.12)
        }
    }

    @keyframes da-flip {
        from {
            transform: perspective(320px) rotateX(-90deg)
        }
    }

    @keyframes da-shake {

        20%,
        60% {
            transform: translateX(-6px)
        }

        40%,
        80% {
            transform: translateX(6px)
        }
    }

    /* ----- Entrada de pantalla: los bloques suben y aparecen en cascada ----- */
    #app.in>*:not(.gg):not(.hl):not(.hr2),
    #app.in .hl>*,
    #app.in .hr2>*:not(.gg) {
        animation: da-up var(--da-d) ease-out backwards;
        animation-delay: calc(var(--n, 0) * var(--da-s))
    }

    #app.in .hl>*:nth-child(2),
    #app.in .hr2>*:nth-child(2) {
        --n: 1
    }

    #app.in .hl>*:nth-child(3) {
        --n: 2
    }

    #app.in .hl>*:nth-child(4) {
        --n: 3
    }

    #app.in .hl>*:nth-child(n+5) {
        --n: 4
    }

    #app.in>*:nth-child(2) {
        --n: 1
    }

    #app.in>*:nth-child(3) {
        --n: 2
    }

    #app.in>*:nth-child(4) {
        --n: 3
    }

    #app.in>*:nth-child(5) {
        --n: 4
    }

    #app.in>*:nth-child(n+6) {
        --n: 5
    }

    /* Inicio: las tarjetas entran por filas (de dos en dos) con la misma duración que el resto */
    #app.in .gg>.gt {
        animation: da-up var(--da-d) ease-out backwards;
        animation-delay: calc(.09s + var(--n, 0) * .04s)
    }

    #app.in .gg>.gt:nth-child(3),
    #app.in .gg>.gt:nth-child(4) {
        --n: 1
    }

    #app.in .gg>.gt:nth-child(5),
    #app.in .gg>.gt:nth-child(6) {
        --n: 2
    }

    #app.in .gg>.gt:nth-child(7),
    #app.in .gg>.gt:nth-child(8) {
        --n: 3
    }

    #app.in .gg>.gt:nth-child(n+9) {
        --n: 4
    }

    /* Inicio: la barra de progreso se rellena y los ✓ de los juegos completados aparecen con un pequeño rebote */
    #app.in .slots i {
        transform-origin: left;
        animation: da-grow var(--da-d) ease-out .15s backwards
    }

    #app.in .gt .ck {
        animation: da-check .3s cubic-bezier(.3, 1.6, .5, 1) .3s backwards
    }

    #app.in .nbd {
        animation: da-check .3s cubic-bezier(.3, 1.6, .5, 1) .25s backwards
    }

    /* Perfil: el mapa de 28 días se enciende por semanas y las barras de puntuación crecen */
    #app.in .hm span {
        animation: da-fade var(--da-d) ease-out .1s backwards
    }

    #app.in .hm span:nth-child(n+8) {
        animation-delay: .13s
    }

    #app.in .hm span:nth-child(n+15) {
        animation-delay: .16s
    }

    #app.in .hm span:nth-child(n+22) {
        animation-delay: .19s
    }

    #app.in .br i {
        transform-origin: left;
        animation: da-grow var(--da-d) ease-out .1s backwards
    }

    /* ----- Efectos de un solo uso ----- */
    /* Pulso al tocar una casilla o tecla (Anim.pulse en app.js) y al escribir una letra en Palabra */
    .pp {
        animation: da-type .14s ease-out
    }

    /* Palabra: la fila enviada se voltea ficha a ficha y la inválida se sacude */
    .t.fl {
        animation: da-flip .4s ease-out backwards;
        animation-delay: calc(var(--j, 0) * .12s)
    }

    .r.sk {
        animation: da-shake .36s ease-in-out
    }

    /* Resultado: la tarjeta entra con un pequeño rebote al terminar la partida (tras el volteo en Palabra) */
    #app.fin .res.rb {
        animation: da-pop .4s cubic-bezier(.2, 1.2, .4, 1) backwards
    }

    #app.fin .res.rb .est {
        animation: da-up .4s .2s ease-out backwards
    }

    #app.rv.fin .res.rb {
        animation-delay: .75s
    }

    #app.rv.fin .res.rb .est {
        animation-delay: .95s
    }

    /* Duelo: el resultado final entra con el mismo rebote que el de un reto diario */
    #app.in .res.duf {
        animation: da-pop .4s cubic-bezier(.2, 1.2, .4, 1) .1s backwards
    }

    /* Cambios dentro de una misma pantalla (pestañas del ranking, entrar/crear cuenta, datos que terminan de cargar):
       los bloques bajo la cabecera aparecen con un fundido corto; la cabecera no se mueve. */
    #app.sub>*:not(.bar):not(.top) {
        animation: da-in .2s ease-out backwards
    }

    /* Confirmaciones en línea (Quitar amigo, Bloquear, Borrar mis resultados) */
    #app.conf .cf {
        animation: da-up .2s ease-out backwards
    }

    /* Aviso de invitación a duelo: entra y sale deslizándose desde arriba (sin esto solo conmuta display) */
    #dub {
        display: block;
        visibility: hidden;
        opacity: 0;
        transform: translateY(-12px);
        transition: opacity .2s, transform .2s, visibility 0s .2s
    }

    #dub.on {
        visibility: visible;
        opacity: 1;
        transform: none;
        transition: opacity .2s, transform .2s, visibility 0s
    }

    /* ----- Respuesta táctil: tarjetas del inicio, botones, botones de la cabecera y teclas hacen lo mismo ----- */
    .gt,
    .btn,
    .bk,
    .k {
        transition: transform .12s ease, box-shadow .12s ease, background-color .15s ease
    }

    .btn:active,
    .bk:active {
        transform: translate(1px, 1px);
        box-shadow: 1px 1px 0 var(--sh)
    }

    .k:active {
        transform: scale(.92)
    }

    .sw {
        transition: background-color .15s
    }

    @media (hover:hover) {

        .btn:hover:not(:active):not(:disabled),
        .bk:hover:not(:active):not(:disabled) {
            transform: translate(-1px, -1px);
            box-shadow: 3px 3px 0 var(--sh)
        }

        .gt:hover:not(:active) {
            transform: translate(-1px, -1px);
            box-shadow: 5px 5px 0 var(--sh)
        }

        .gt:hover:active {
            transform: translate(2px, 2px);
            box-shadow: 2px 2px 0 var(--sh)
        }
    }
}

/* ---------- Teclado ---------- */
.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0
}

h1[tabindex="-1"]:focus {
    outline: none
}

[data-b]:focus-visible {
    outline: 3px solid var(--sky);
    outline-offset: 3px
}

/* Ranking: mientras llegan los datos del día elegido se ve la lista anterior; solo se atenúa si tarda (así no parpadea) */
@keyframes rk-ld {
    to {
        opacity: .55
    }
}

.res.ld {
    animation: rk-ld .2s .3s forwards
}

/* Solo para lectores de pantalla (anuncios como el del resultado) */
.vh {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0
}

/* Carga: esqueleto de tarjetas */
.gt.esq {
    box-sizing: border-box;
    pointer-events: none;
    min-height: 130px;
    border-color: var(--edge);
    box-shadow: none
}

.gt.esq .gl {
    width: 40px;
    height: 40px;
    border-radius: var(--r-md);
    background: var(--line)
}

.gt.esq strong {
    width: 70%;
    height: 14px;
    border-radius: var(--r-pill);
    background: var(--line)
}

/* Tablet en vertical: las tarjetas reales van en horizontal y son más bajas */
@media (min-width:700px) and (max-width:899px) {
    .gt.esq {
        min-height: 88px
    }
}

/* Una línea de texto más en el esqueleto, como las tarjetas reales */
.gt.esq em {
    display: block;
    width: 50%;
    height: 12px;
    border-radius: var(--r-pill);
    background: var(--line)
}

/* Línea de texto del esqueleto del resumen y del progreso (misma pieza que en las tarjetas) */
.esl {
    display: block;
    height: 12px;
    border-radius: var(--r-pill);
    background: var(--line)
}

/* Brillo que recorre las piezas, escalonado de tarjeta en tarjeta */
@media (prefers-reduced-motion:no-preference) {
    .esl,
    .gt.esq .gl,
    .gt.esq strong,
    .gt.esq em {
        background-image: linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--card) 70%, transparent) 50%, transparent 70%);
        background-size: 250% 100%;
        background-repeat: no-repeat;
        animation: esq 1.4s ease-in-out infinite;
        animation-delay: calc(var(--k, 0) * .09s)
    }

    @keyframes esq {
        from { background-position: 120% 0 }
        to { background-position: -120% 0 }
    }
}

/* Error de carga: detalle técnico plegado */
.dt {
    margin: 16px 0;
    color: var(--mut);
    font-size: 14px
}

.dt summary {
    cursor: pointer;
    min-height: 44px;
    display: flex;
    align-items: center
}

.dt p {
    margin: 0;
    word-break: break-word
}

/* Aviso de reto nuevo (cambio de día con la web abierta) */
#nd {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: var(--card);
    color: var(--ink);
    border: 2px solid var(--ink);
    border-radius: var(--r-lg);
    box-shadow: 4px 4px 0 var(--sh);
    font-size: 14px;
    font-weight: 600;
    z-index: 60
}

#nd span {
    flex: 1 1 200px
}

/* Perfil: mejor y más flojo */
.mj {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 14px
}

.mj>div {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    min-width: 0
}

.mj .gi {
    flex: none
}

.mj span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0
}

.mj small {
    color: var(--mut);
    font-size: 14px
}

.mj b {
    overflow-wrap: anywhere
}

@media (max-width:360px) {
    .mj {
        grid-template-columns: 1fr
    }
}

/* Conflictos: además del color, una marca «!» (no dependen solo del tono) */
.c.cf,
.c.bd {
    position: relative
}

.c.cf::after,
.c.bd::after,
.z.cf::after {
    content: "!";
    position: absolute;
    right: 3px;
    top: 1px;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 50%;
    background: var(--ink);
    color: var(--bg);
    font-size: 11px;
    font-weight: 800;
    text-align: center;
    pointer-events: none
}

/* Tras terminar un juego: siguiente reto o cierre del día */
.sg2 {
    margin-top: 14px
}

.sg3 {
    text-align: center;
    margin: 8px 0 0
}

.cierre {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 14px;
    padding: 14px;
    text-align: center;
    background: var(--sun);
    color: #14213D;
    border: 2px solid var(--ink);
    border-radius: var(--r-md)
}

.cierre span {
    font-size: 14px
}

.cierre #cd {
    font-variant-numeric: tabular-nums
}

.cierre .btn {
    background: var(--card);
    color: var(--ink)
}

/* Inicio: lema de los juegos sin empezar (más suave que el estado) */
.gt em.tg {
    font-weight: 600
}

/* Inicio: progreso de hoy en un segmento por juego (con el color del juego cuando está hecho) */
.segs {
    display: grid;
    gap: 4px;
    height: 20px
}

.segs i {
    display: block;
    box-sizing: border-box;
    border: 2px solid var(--ink);
    border-radius: 6px;
    background: var(--card)
}

.segs i.on {
    background: var(--c, var(--mint))
}

@media (prefers-reduced-motion:no-preference) {
    #app.in .segs i {
        animation: da-check .22s ease-out backwards;
        animation-delay: calc(.12s + var(--k, 0) * .03s)
    }
}

/* Inicio: juegos completados, agrupados debajo y más discretos */
.gh {
    margin: 22px 0 10px;
    font-size: 14px;
    font-weight: 800;
    color: var(--mut);
    letter-spacing: .02em;
    text-transform: uppercase
}

/* Inicio: bienvenida de una sola vez */
.hola {
    margin: 0 0 16px;
    background: color-mix(in srgb, var(--sun) 16%, var(--card))
}

.hola ul {
    margin: 8px 0 14px;
    padding-left: 20px
}

.hola li {
    margin: 4px 0
}

/* Confeti (ver confeti() en app.js) */
.cft {
    position: fixed;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 70
}

.cft i {
    position: absolute;
    display: block;
    will-change: transform, opacity
}

/* Racha: pulso del número cuando sube */
@media (prefers-reduced-motion:no-preference) {
    @keyframes da-racha {
        0% { transform: scale(1) }
        35% { transform: scale(1.7) rotate(-6deg) }
        65% { transform: scale(.92) }
        100% { transform: scale(1) }
    }

    .sn.up b {
        transform-origin: left center;
        animation: da-racha .9s cubic-bezier(.3, .7, .3, 1) .45s backwards
    }
}

/* Inicio: las estrellas de cada tarjeta, en su propia línea (así todas las tarjetas tienen la misma altura de texto) */
.gt em .es2 {
    display: block;
    margin-top: 2px;
    letter-spacing: .06em;
    white-space: nowrap
}

.gt em .es2 b {
    font-weight: inherit;
    color: var(--ink)
}

.gt em .es2 i {
    font-style: normal;
    opacity: .45
}

/* ---------- Sospechosos ---------- */
.sph {
    margin: 16px 0 6px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mut)
}

.spcl {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 6px
}

.spc {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 9px 12px;
    text-align: left;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    cursor: pointer
}

/* Pista tachada: además de atenuarse lleva una raya, así no depende solo del tono */
.spc.x {
    opacity: .6;
    text-decoration: line-through;
    text-decoration-thickness: 2px;
    border-style: dashed
}

.spb {
    display: grid;
    gap: 6px
}

.spr {
    display: grid;
    grid-template-columns: minmax(64px, .8fr) 1fr 1fr;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    font: inherit;
    color: var(--ink);
    text-align: left;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    cursor: pointer
}

.spr.sel {
    background: var(--lav);
    color: #14213D;
    box-shadow: 0 3px 0 var(--sh)
}

.spr:disabled {
    cursor: default
}

.spv {
    padding: 5px 8px;
    text-align: center;
    font-weight: 700;
    border: 2px solid var(--edge);
    border-radius: var(--r-sm);
    background: var(--card);
    color: var(--ink)
}

.spv.e {
    border-style: dashed;
    color: var(--mut);
    font-weight: 600
}

.spv.fx {
    background: color-mix(in srgb, var(--mint) 18%, var(--card));
    border-color: var(--mint)
}

/* Dato que la comprobación vio mal: borde rojo y marca «!» (no depende solo del color) */
.spv.bd {
    border-color: var(--berry);
    color: var(--berry-tx)
}

.spv.bd::after {
    content: " !";
    font-weight: 800
}

.spr.sel .spv {
    background: #fff;
    color: #14213D
}

.spr.sel .spv.bd {
    color: #B8284D
}

.spr.sel .spv.e {
    color: #3A4666
}

.spg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

.spch {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 76px;
    min-height: 44px;
    padding: 6px 12px;
    font: inherit;
    font-weight: 700;
    color: var(--ink);
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    cursor: pointer
}

.spch small {
    font-size: .7rem;
    font-weight: 600;
    color: var(--mut)
}

.spch.on {
    background: var(--lav);
    color: #14213D
}

.spch.on small {
    color: #3A4666
}

.spch.used {
    border-style: dashed
}

.spch:disabled {
    opacity: .5;
    cursor: default
}

/* ---------- Balanza ---------- */
.bz {
    /* Hueco arriba y abajo para que la viga inclinada (hasta ±7°) no pise el texto de alrededor */
    margin: 38px 4px 40px
}

.bzb {
    transform: rotate(var(--a, 0deg));
    transform-origin: 50% 100%;
    transition: transform .5s cubic-bezier(.3, .7, .3, 1)
}

.bzr,
.bzd {
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr))
}

.bzr {
    align-items: end
}

.bzs {
    box-sizing: border-box;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 62px;
    padding: 0 1px;
    border: 0;
    background: transparent;
    border-radius: var(--r-xs)
}

/* Hueco vacío: una marca discreta; con una pesa elegida se resalta como destino */
.bzs:not(.fx):empty::before {
    content: "";
    width: 70%;
    height: 8px;
    border-radius: var(--r-xs);
    border: 2px dashed var(--edge);
    box-sizing: border-box
}

.bzs.tg {
    background: color-mix(in srgb, var(--aqua) 22%, transparent);
    outline: 2px dashed var(--aqua);
    outline-offset: -2px
}

.bzk {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 100%;
    height: calc(18px + var(--h) * .1px);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: #14213D;
    background: var(--aqua);
    border: 2px solid var(--ink);
    border-radius: var(--r-xs) var(--r-xs) 0 0
}

.bzk.fix {
    background: var(--line);
    color: var(--ink);
    border-style: dashed
}

.bzk.lk {
    background: var(--mint);
    color: #fff
}

.bzbar {
    height: 10px;
    background: var(--ink);
    border-radius: var(--r-pill)
}

.bzc {
    position: relative
}

.bzd {
    margin-top: 4px;
    text-align: center;
    font-size: .8rem;
    font-weight: 700;
    color: var(--mut);
    font-variant-numeric: tabular-nums
}

/* Apoyo triangular bajo el centro de la viga */
.bzp {
    width: 0;
    margin: -2px auto 0;
    border-left: 16px solid transparent;
    border-right: 16px solid transparent;
    border-bottom: 22px solid var(--ink);
    transform: translateY(-34px);
    margin-bottom: -22px;
    pointer-events: none
}

.bz.ok .bzbar {
    background: var(--mint)
}

.bzt2 {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-end;
    gap: 8px;
    min-height: 64px;
    margin: 16px 0 8px
}

.bzy {
    min-width: 52px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: var(--r-md);
    background: transparent
}

.bzy .bzk {
    border-radius: var(--r-xs)
}

.bzy.sel {
    border-color: var(--ink);
    background: var(--card);
    box-shadow: 0 3px 0 var(--sh)
}

/* Ejemplo de «Cómo se juega» */
.bz.mini .bzs {
    height: 48px
}

@media (prefers-reduced-motion:reduce) {
    .bzb {
        transition: none
    }
}

/* ---------- Intruso ---------- */
.inr {
    margin: 10px 0 0;
    text-align: center
}

.inb {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 12px auto;
    max-width: 340px
}

.inc {
    position: relative;
    display: block;
    min-width: 0;
    aspect-ratio: 1;
    padding: 6px;
    box-sizing: border-box;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    cursor: pointer
}

/* El dibujo no aporta tamaño propio (Safari le daba el de su viewBox y las tarjetas se salían): se ajusta al hueco de la tarjeta */
.inc svg {
    position: absolute;
    inset: 6px;
    display: block;
    width: calc(100% - 12px);
    height: calc(100% - 12px)
}

.inc svg path {
    stroke: var(--ink);
    stroke-width: 2;
    stroke-linejoin: round
}

/* Patrón descartado: atenuado y con una cruz (no depende solo del tono) */
.inc.x {
    opacity: .4;
    border-style: dashed;
    cursor: default
}

.inc.x::after {
    content: "✕";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    color: var(--ink)
}

/* Ejemplo de «Cómo se juega» */
.inb.mini {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    width: 240px;
    max-width: 100%
}

.inb.mini .inc {
    cursor: default
}

/* ---------- Mezcla ---------- */
.mzs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 14px 0 8px
}

.mzs figure {
    flex: 1;
    max-width: 170px;
    margin: 0;
    text-align: center
}

.mzs figcaption {
    margin-top: 4px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--mut)
}

.mzc {
    height: 110px;
    box-sizing: border-box;
    border: 3px solid var(--ink);
    border-radius: var(--r-md)
}

/* Mezcla vacía: sin color todavía */
.mzc.e {
    background: var(--card);
    border-style: dashed
}

.mzp {
    display: grid;
    gap: 6px;
    margin: 10px 0
}

.mzr {
    display: grid;
    grid-template-columns: 28px 1fr 44px 36px 44px;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md)
}

.mzd {
    width: 24px;
    height: 24px;
    box-sizing: border-box;
    border: 2px solid var(--ink);
    border-radius: 50%
}

.mzb {
    min-height: 44px;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--ink);
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    cursor: pointer
}

.mzb:disabled {
    opacity: .4;
    cursor: default
}

.mzn {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums
}

/* Ejemplo de «Cómo se juega» */
.mzs.mini {
    align-items: center;
    gap: 10px
}

.mzs.mini .mzc {
    width: 64px;
    height: 64px
}

.mzs.mini span {
    font-size: 1.4rem;
    font-weight: 800
}

/* ---------- Siluetas ---------- */
.sit2 {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin: 12px 0 8px
}

.sit2 figure {
    margin: 0;
    text-align: center
}

.sit2 figcaption {
    margin-top: 4px;
    font-size: .85rem;
    font-weight: 700;
    color: var(--mut)
}

.sit2 figcaption small {
    font-weight: 600
}

.sis {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2px;
    width: 120px;
    padding: 3px;
    box-sizing: border-box;
    border: 3px solid var(--ink);
    border-radius: var(--r-md);
    background: var(--card)
}

.sis span {
    aspect-ratio: 1;
    border-radius: 2px;
    background: color-mix(in srgb, var(--edge) 22%, var(--card))
}

.sis span.on {
    background: var(--ink)
}

.sip {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 14px;
    margin: 12px 0
}

.sit {
    margin: 0 0 4px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--mut)
}

.sit.bd {
    color: var(--berry-tx)
}

.sig {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px
}

.sic {
    aspect-ratio: 1;
    padding: 0;
    box-sizing: border-box;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: var(--r-sm);
    cursor: pointer
}

.sic.on {
    background: var(--sky);
    border-color: var(--ink);
    box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .18)
}

/* Cubo fijado por una pista: otro color y una marca (no depende solo del tono) */
.sic.fx {
    background: var(--mint);
    border-style: dashed
}

.sic:disabled {
    cursor: default
}

/* Siluetas: ejemplo visual de «Cómo se juega» (una capa y las sombras que proyecta) */
.sid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 14px;
    margin: 8px 0
}

.sid figure {
    margin: 0;
    text-align: center
}

.sid figcaption {
    margin-top: 4px;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--mut)
}

.sid figcaption small {
    font-weight: 600
}

.sid .sig {
    width: 100px
}

.sid .sic {
    cursor: default
}

.sid .sis {
    width: 84px
}

.sid2 {
    display: flex;
    gap: 12px
}

.sia {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--mut)
}

/* En pantallas estrechas la flecha apunta hacia abajo: capa arriba, sombras debajo */
@media (max-width:420px) {
    .sia {
        flex-basis: 100%;
        text-align: center;
        transform: rotate(90deg);
        height: 1.6rem;
        line-height: 1.6rem
    }
}

/* ---------- Rayo ---------- */
.ryb {
    position: relative;
    width: min(100%, var(--bw, 372px));
    aspect-ratio: 1;
    margin: 6px auto
}

/* El tablero ocupa el centro; el margen de una casilla alrededor es para el emisor y la salida */
.ryg {
    position: absolute;
    inset: 12.5%;
    display: grid;
    grid-template-columns: repeat(var(--n), minmax(0, 1fr));
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
    overflow: hidden;
    background: var(--card)
}

.ryc {
    position: relative;
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid color-mix(in srgb, var(--edge) 45%, transparent);
    border-radius: 0;
    cursor: pointer
}

.ryc:disabled,
span.ryc {
    cursor: default
}

.ryc.fx {
    background: color-mix(in srgb, var(--mint) 22%, transparent)
}

.ryc svg {
    position: absolute;
    inset: 12%;
    width: 76%;
    height: 76%
}

.rym path {
    fill: none;
    stroke: var(--ink);
    stroke-width: 1.6;
    stroke-linecap: round
}

.ryk path {
    fill: var(--card);
    stroke: var(--ink);
    stroke-width: .8;
    stroke-linejoin: round
}

.ryk .ryb2 {
    fill: none;
    stroke-dasharray: 1 1
}

/* Gema encendida: se rellena y se agranda el detalle (no depende solo del color) */
.ryc.lit .ryk path {
    fill: var(--sun)
}

.ryc.lit .ryk .ryb2 {
    fill: var(--ink);
    stroke-dasharray: none
}

.ryw {
    position: absolute;
    inset: 14%;
    border-radius: var(--r-xs);
    background: var(--ink)
}

/* Capa del rayo, el emisor y la salida, encima del tablero (no recibe toques) */
.ryo {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.ryl {
    fill: none;
    stroke: var(--berry);
    stroke-width: .13;
    stroke-linecap: round;
    stroke-linejoin: round
}

.rye {
    fill: var(--ink)
}

.ryx {
    fill: var(--card);
    stroke: var(--ink);
    stroke-width: .1
}

.ryx2 {
    fill: var(--ink)
}

/* Salida alcanzada por el rayo */
.ryx.ok {
    fill: var(--mint)
}

/* Ejemplo de «Cómo se juega» */
.ryd .ryb {
    width: 220px;
    max-width: 100%
}

@media (prefers-reduced-motion:no-preference) {
    .ryl {
        stroke-dasharray: 60;
        animation: ryl .35s ease-out
    }

    @keyframes ryl {
        from { stroke-dashoffset: 60 }
        to { stroke-dashoffset: 0 }
    }
}

/* ---------- Carátula ---------- */
.car {
    display: block;
    width: min(100%, 300px);
    aspect-ratio: 2 / 3;
    margin: 10px auto;
    box-sizing: border-box;
    border: 3px solid var(--ink);
    border-radius: var(--r-md);
    background: var(--card)
}

.cart {
    margin: 0;
    text-align: center;
    font-size: 1.15rem;
    font-weight: 800
}

.cart small {
    font-weight: 600;
    color: var(--mut)
}

.carh,
.carg {
    margin: 8px 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px
}

.carh li {
    padding: 5px 10px;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-pill)
}

/* Intento fallido: tachado y con borde discontinuo (no depende solo del color) */
.carg li {
    padding: 4px 10px;
    font-size: .9rem;
    color: var(--mut);
    text-decoration: line-through;
    border: 2px dashed var(--edge);
    border-radius: var(--r-pill)
}

.carf {
    position: relative;
    margin: 10px 0 4px
}

.carin {
    display: block;
    width: 100%;
    box-sizing: border-box;
    min-height: 48px;
    padding: 10px 14px;
    font: inherit;
    font-size: 1rem;
    color: var(--ink);
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md)
}

.carsug {
    display: grid;
    gap: 4px;
    margin-top: 4px
}

.carsug:empty {
    display: none
}

.carsg {
    min-height: 44px;
    padding: 8px 14px;
    font: inherit;
    font-weight: 600;
    text-align: left;
    color: var(--ink);
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: var(--r-md);
    cursor: pointer
}

.carsg small {
    color: var(--mut);
    font-weight: 600
}

.carat {
    margin-top: 14px;
    text-align: center;
    font-size: .75rem
}

/* Ejemplo de «Cómo se juega»: una escena inventada en 3×3 zonas */
.card-demo {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 8px 0
}

.cd {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    width: 84px;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid var(--ink);
    border-radius: var(--r-sm);
    background: rgba(255, 255, 255, .7)
}

.cz {
    display: grid;
    grid-template-columns: repeat(var(--n), 1fr)
}

.cz i {
    display: block
}

/* ---------- Cronología ---------- */
.crl {
    display: grid;
    gap: 6px;
    margin: 10px 0;
    padding: 0;
    list-style: none
}

.crl li {
    padding: 8px 12px;
    font-size: .95rem;
    line-height: 1.3;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md)
}

.crl li b {
    display: inline-block;
    min-width: 4.2em;
    margin-right: 6px;
    font-weight: 800
}

/* Los ya colocados de la ronda: línea de tiempo con borde de acento */
.crl li.ok {
    border-left-width: 8px;
    border-left-color: var(--mint)
}

.crp:empty {
    display: none
}

.crb {
    display: grid;
    gap: 8px;
    margin: 12px 0
}

.crc {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    font: inherit;
    font-weight: 700;
    line-height: 1.3;
    text-align: left;
    color: inherit;
    background: var(--card);
    border: 2px solid var(--ink);
    border-radius: var(--r-md);
    cursor: pointer
}

/* Descartado en este paso: atenuado y con borde discontinuo (no depende solo del tono) */
.crc.x {
    opacity: .5;
    border-style: dashed;
    cursor: default
}

.crc small {
    font-weight: 400
}

/* Soluciones de las 5 rondas al terminar */
.crs {
    display: grid;
    gap: 16px;
    margin: 12px 0
}

.crg {
    padding: 12px;
    background: var(--card);
    border: 2px solid var(--edge);
    border-radius: var(--r-md)
}

.crh {
    margin: 0 0 8px;
    font-size: .8rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--mut)
}

.crs .crl {
    margin: 0
}

/* Ejemplo de «Cómo se juega» */
.crm {
    max-width: 320px;
    margin-inline: auto
}

/* ---------- País ---------- */
.pas {
    display: grid;
    place-items: center;
    width: min(100%, 300px);
    height: 260px;
    margin: 10px auto;
    box-sizing: border-box;
    padding: 14px;
    background: var(--card);
    border: 3px solid var(--ink);
    border-radius: var(--r-md)
}

.pas svg {
    display: block;
    max-width: 100%;
    max-height: 100%
}

.pas svg path {
    fill: var(--ink);
    stroke: var(--ink);
    stroke-width: .6;
    stroke-linejoin: round
}

/* Ejemplo de «Cómo se juega» */
.pas.mini {
    width: 150px;
    height: 120px;
    padding: 8px
}

/* ---------- Pokémon ---------- */
.pks {
    display: grid;
    place-items: center;
    width: min(100%, 300px);
    aspect-ratio: 1;
    margin: 10px auto;
    box-sizing: border-box;
    padding: 14px;
    background: #f4f1e8;                       /* fondo claro fijo (también en modo oscuro) para que la silueta negra se vea */
    border: 3px solid var(--ink);
    border-radius: var(--r-md)
}

.pks img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    filter: brightness(0);
    transition: filter .6s
}

/* Al terminar se enseña el dibujo con sus colores */
.pks.on img {
    filter: none
}

/* Ejemplo de «Cómo se juega» */
.pks.mini {
    width: 120px
}

.pks.mini svg {
    display: block;
    width: 100%;
    height: 100%
}

.pks.mini svg path {
    fill: #14213d
}

/* ---------- Más o menos ---------- */
.mm-q { font-size: 1.15rem; text-align: center; margin: 14px 0 10px }
.mm-par { display: grid; gap: 10px; grid-template-columns: 1fr 1fr }
.mm-op { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 6px; min-height: 120px; padding: 12px 8px; font: inherit; font-weight: 700; text-align: center; color: var(--ink); background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-lg); cursor: pointer }
.mm-op:not(:disabled):hover { background: var(--bg) }
.mm-op:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px }
.mm-op:disabled { cursor: default; opacity: 1 }
.mm-op.ok { border-color: var(--mint); box-shadow: inset 0 0 0 2px var(--mint) }
.mm-op.no { border-color: var(--berry); box-shadow: inset 0 0 0 2px var(--berry) }
.mm-n { font-size: 1.1rem }
.mm-v { font-size: .9rem; font-weight: 600; color: var(--mut) }
@media (max-width:380px) { .mm-par { grid-template-columns: 1fr } }

/* ---------- Dominó de ríos ---------- */
.rdb { position: relative; width: min(100%, 372px); aspect-ratio: 1; margin: 10px auto; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-md); overflow: hidden }
.rdo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none }
.rdl { fill: none; stroke: var(--aqua); stroke-width: .5; stroke-linecap: round; stroke-linejoin: round }
.rdl.sol { stroke: var(--sun); stroke-width: .62; opacity: .55 }
.rdg { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); grid-template-rows: repeat(var(--n), minmax(0, 1fr)) }
.rdc { position: relative; display: grid; place-items: center; min-width: 0; padding: 0; box-sizing: border-box; background: transparent; border: 1px solid color-mix(in srgb, var(--edge) 45%, transparent); border-radius: 0; cursor: pointer; color: var(--ink) }
.rdc:disabled { cursor: default; opacity: 1 }
.rdc:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px }
.rdc.roca { background: var(--line); cursor: not-allowed }
.rdc.cab::after { content: ""; position: absolute; inset: 22%; border-radius: var(--r-pill); border: 3px solid var(--ink); pointer-events: none }
.rdk { width: 68%; height: 68%; fill: var(--card); stroke: var(--ink); stroke-width: .7; stroke-linecap: round; stroke-linejoin: round; position: relative }
.rdk path { fill: none }
.rdc.on .rdk circle { fill: var(--aqua) }
.rdc.lit .rdk circle { fill: var(--sun) }
.rdr { width: 70%; height: 70%; fill: var(--mut); stroke: var(--mut); stroke-width: .6; stroke-linejoin: round }
.rdd { --bw: 220px; width: 220px; max-width: 100%; margin: 0 auto }

/* ---------- Eco ---------- */
.ecw { display: flex; gap: 14px; justify-content: center; margin: 10px auto; max-width: 440px }
.ecf { flex: 1 1 0; min-width: 0; margin: 0; text-align: center }
.ecf svg { display: block; width: 100%; height: auto; background: var(--card); border: 2px solid var(--ink); border-radius: var(--r-md) }
.ecf figcaption { font-weight: 700; margin-top: 4px }
.ecq { fill: none; stroke: color-mix(in srgb, var(--edge) 45%, transparent); stroke-width: .03 }
.ecb { fill: color-mix(in srgb, var(--ink) 30%, var(--card)) }
.ece { fill: none; stroke: var(--ink); stroke-width: .1 }
.ece.u1 { stroke: var(--sky); fill: color-mix(in srgb, var(--sky) 20%, transparent) }
.ece.u2 { stroke: var(--berry); fill: color-mix(in srgb, var(--berry) 20%, transparent) }
.ece.ok { fill: var(--mint); stroke: var(--mint) }
.ect.u1 { fill: var(--sky) }
.ect.u2 { fill: var(--berry) }
.ect { stroke: var(--card); stroke-width: .07 }
.ecv { fill: none; stroke: var(--card); stroke-width: .09; stroke-linecap: round; stroke-linejoin: round }
.ecp { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 52px); gap: 6px; justify-content: center; margin: 10px auto }
.ecp .ecd { padding: 0; font-size: 1.4rem; line-height: 1 }
.ecp .ecd:nth-child(2) { grid-column: 2; grid-row: 1 }
.ecp .ecd:nth-child(4) { grid-column: 1; grid-row: 2 }
.ecp .ecd:nth-child(5) { grid-column: 2; grid-row: 2 }
.ecp .ecd:nth-child(6) { grid-column: 3; grid-row: 2 }

/* ---------- Faros ---------- */
.frb { display: grid; max-width: var(--bw, 372px); margin: 12px auto; border: 3px solid var(--ink); border-radius: var(--r-md); overflow: hidden; background: var(--card) }
.fc, .fw { aspect-ratio: 1; padding: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; display: grid; place-items: center; position: relative }
.fc { background: var(--card); color: var(--ink); cursor: pointer }
.fc.lit { background: color-mix(in srgb, var(--sun) 38%, var(--card)) }
.fc.lamp { background: color-mix(in srgb, var(--sun) 80%, var(--card)) }
.fc svg { width: 72%; height: 72%; fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round }
.fc.lamp svg circle { fill: var(--sun) }
.fc.mk::after { content: ''; width: 22%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--ink) 45%, transparent) }
.fc.cf { box-shadow: inset 0 0 0 3px var(--berry) }
.fc:disabled { cursor: default }
.fc:focus-visible { outline: 3px solid var(--sky); outline-offset: -3px }
.fw { background: var(--ink); color: var(--card); font-size: clamp(18px, 6vw, 28px); font-weight: 800 }
.fw.ok { box-shadow: inset 0 0 0 3px var(--mint) }
.fw.bd { box-shadow: inset 0 0 0 3px var(--berry); background-image: repeating-linear-gradient(135deg, transparent 0 5px, color-mix(in srgb, var(--berry) 55%, transparent) 5px 8px) }

/* ---------- Dado rodante ---------- */
.ddb { max-width: var(--bw, 372px); margin: 12px auto; border: 3px solid var(--ink); border-radius: var(--r-md); overflow: hidden; background: var(--card) }
.ddq { fill: none; stroke: color-mix(in srgb, var(--edge) 45%, transparent); stroke-width: .03 }
.ddr { fill: var(--line) }
.ddi { fill: var(--edge) }
.ddn { fill: color-mix(in srgb, var(--sky) 22%, var(--card)); stroke: var(--ink); stroke-width: .05 }
.ddn.ok { fill: color-mix(in srgb, var(--mint) 35%, var(--card)) }
.ddt { fill: var(--ink); font: 800 .42px 'Bricolage Grotesque', system-ui, sans-serif; text-anchor: middle; dominant-baseline: central }
.ddv { fill: none; stroke: var(--mint); stroke-width: .06; stroke-linecap: round; stroke-linejoin: round }
.ddm { fill: none; stroke: var(--ink); stroke-width: .05; stroke-dasharray: .12 .1 }
.ddm.ok { fill: color-mix(in srgb, var(--mint) 35%, var(--card)); stroke-dasharray: none }
.ddf { fill: var(--berry); stroke: var(--ink); stroke-width: .04; stroke-linejoin: round; stroke-linecap: round }
.ddd { fill: var(--sky); stroke: var(--ink); stroke-width: .06 }
.dd1 { fill: var(--on-sky); font: 800 .44px 'Bricolage Grotesque', system-ui, sans-serif; text-anchor: middle; dominant-baseline: central }
.dd2 { fill: var(--on-sky); font: 700 .17px 'Bricolage Grotesque', system-ui, sans-serif; text-anchor: middle; dominant-baseline: central; opacity: .85 }
.ddp { display: grid; grid-template-columns: repeat(3, 56px); grid-template-rows: repeat(2, 52px); gap: 6px; justify-content: center; margin: 10px auto }
.ddp .ddd2 { padding: 0; font-size: 1.4rem; line-height: 1 }
.ddp .ddd2:nth-child(2) { grid-column: 2; grid-row: 1 }
.ddp .ddd2:nth-child(4) { grid-column: 1; grid-row: 2 }
.ddp .ddd2:nth-child(5) { grid-column: 2; grid-row: 2 }
.ddp .ddd2:nth-child(6) { grid-column: 3; grid-row: 2 }
.ddd2.pista { box-shadow: 0 0 0 4px var(--sky) }

/* ---------- Jarras ----------
   .jrg = banda del objetivo · .jrs = jarras en columnas (--n) · .jrc = una columna (etiqueta, jarra, botones) · .jrk = etiqueta de capacidad
   .jrj = dibujo de la jarra · .jrb = botón de acción · .jsw = muestra del color de la jarra de destino */
.jrg { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 12px 2px; text-align: center; font-weight: 700; line-height: 1.2 }
.jrg svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }
.jrg svg path { fill: color-mix(in srgb, var(--sky) 45%, var(--card)) }
.jrg b { font-size: 1.45em; letter-spacing: -.01em }
.jrs { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); gap: 8px; padding: 12px 8px 10px }
.jrc { display: flex; flex-direction: column; gap: 5px; min-width: 0 }
.jrk { align-self: center; display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 7px; border: 2px solid var(--ink); border-radius: 999px; background: var(--card); font-weight: 800; font-size: .85rem; line-height: 1.3 }
.jrk i, .jsw { flex: none; width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: color-mix(in srgb, var(--jc) 62%, var(--card)) }
.jsw { border-radius: 4px }
.jrj { display: block; width: 100%; max-width: var(--jw, 128px); height: auto; margin: 0 auto 4px }
.jrb { display: flex; align-items: center; justify-content: center; gap: 5px; width: 100%; min-width: 0; min-height: 40px; padding: 4px; font-size: .84rem; line-height: 1.1 }
.jrb svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round }
.jrb:disabled { opacity: .38; box-shadow: none; cursor: default }
.jrb.pista { box-shadow: 0 0 0 4px var(--sky) }

/* ---------- Hielo ----------
   svg.hit = tablero (touch-action: none para poder deslizar el dedo sin que se mueva la página) */
.ddb svg.hit { touch-action: none; -webkit-user-select: none; user-select: none }
.ddd2:disabled { opacity: .38; box-shadow: none; cursor: default }

/* ---------- Atasco ----------
   .atk = tarjeta ·  .atw = marco del tablero (el SVG de #atb ocupa todo su ancho: el arrastre mide sobre él) */
.atw { padding: 10px 10px 8px }

/* ---------- Horizonte ---------- */
.hzb { position: relative; display: grid; grid-template-columns: repeat(6, 1fr); max-width: var(--bw, 372px); margin: 0 auto }
.hzb::after { content: ''; position: absolute; left: calc(100% / 6); top: calc(100% / 6); width: calc(100% * 4 / 6); height: calc(100% * 4 / 6); border: 3px solid var(--ink); border-radius: var(--r-md); pointer-events: none }
.hzc { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; gap: 2px; font-weight: 800; font-size: clamp(16px, 5.5vw, 24px); color: var(--ink) }
.hzc i { font-style: normal; font-size: .7em; opacity: .75 }
.hzc.ok { background: color-mix(in srgb, var(--mint) 38%, transparent); border-radius: 10px }
.hzc.bd { background: color-mix(in srgb, var(--berry) 22%, transparent); border-radius: 10px; color: var(--berry); text-decoration: line-through }
.hzx { position: relative; isolation: isolate; aspect-ratio: 1; padding: 0; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; background: var(--card); color: var(--ink); font-size: clamp(22px, 8vw, 34px); font-weight: 800; display: grid; place-items: start center; padding-top: 5%; overflow: hidden }
.hzx::after { content: ''; position: absolute; z-index: -1; left: 16%; right: 16%; bottom: 0; height: calc(var(--h, 0) * 19%); background: color-mix(in srgb, var(--mint) 42%, var(--card)); border: 2px solid color-mix(in srgb, var(--ink) 55%, transparent); border-bottom: 0; border-radius: 4px 4px 0 0; pointer-events: none; transition: height .2s ease }
.hzx.g { background: var(--line) }
.hzx.eq { background: rgba(62, 111, 224, .22) }
.hzx.cf { box-shadow: inset 0 0 0 3px var(--berry) }
.hzx.sel { box-shadow: inset 0 0 0 4px var(--sky) }
.hzx:focus-visible { outline-offset: -4px }
.hzx:disabled { cursor: default }

/* ---------- Eco ----------
   .eck = tarjeta ·  .ecs = estado del último movimiento bajo cada tablero (.ecs-x choca, .ecs-ok en la salida) */
.eck { overflow: hidden }
.eck .ecw { margin: 0; padding: 10px 10px 8px; max-width: none }
.ecs { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, var(--card)); font-size: 13px; font-weight: 800 }
.ecs-x { color: var(--berry) }
.ecs-ok { background: color-mix(in srgb, var(--mint) 35%, var(--card)) }
.ecp .ecd:disabled { opacity: .38; box-shadow: none; cursor: default }

/* ---------- Faros ----------
   .fak = tarjeta ·  .fal = leyenda · .fa-w = aviso de faros que se ven */
.fak { overflow: hidden }
.fak .frb { border: 0; border-radius: 0; margin: 0; max-width: none }
.fak .fc:not(.lit):not(.lamp) { background: color-mix(in srgb, var(--ink) 7%, var(--card)) }
.fak .fc.cf { animation: fa-cf .9s ease-in-out infinite }
.fal { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; padding: 8px 10px; border-top: 3px solid var(--ink); font-size: 13px; color: var(--mut) }
.fal span { display: inline-flex; align-items: center; gap: 6px }
.fal i { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; font-style: normal; font-weight: 800; font-size: 12px }
.fal-w { background: var(--ink); color: var(--card) }
.fal-l { background: color-mix(in srgb, var(--sun) 80%, var(--card)); border: 1px solid var(--line) }
.fal-l svg { width: 16px; height: 16px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round }
.fal-l svg circle { fill: var(--sun) }
.fal-m::after { content: ''; width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--ink) 45%, transparent) }
.fal-m { border: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 7%, var(--card)) }
.fa-w { text-align: center; margin: 8px 0 0; font-weight: 700; color: var(--berry) }
@keyframes fa-cf { 50% { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--berry) 45%, transparent) } }
@media (prefers-reduced-motion: reduce) { .fak .fc.cf { animation: none } }

/* ---------- Coronas ----------
   .cok = tarjeta ·  .cok-k corona / .cok-x marca ✕ (SVG en la casilla) */
.cok { overflow: hidden }
.cok .bd2 { border: 0; border-radius: 0; margin: 0; max-width: none }
.cok .z { border: 0; min-width: 0; width: 100%; display: flex; align-items: center; justify-content: center; overflow: hidden }
.z .cok-k { width: 62%; height: 62%; fill: #14213D; stroke: #14213D; stroke-width: 1.2; stroke-linejoin: round; stroke-linecap: round; filter: drop-shadow(0 1px 0 rgba(255,255,255,.55)) }
.z .cok-x { width: 44%; height: 44%; fill: none; stroke: #14213D; stroke-opacity: .55; stroke-width: 2.6; stroke-linecap: round }
.z small { opacity: .7 }

/* ---------- Siluetas (rediseño) ----------
   .sik = tarjeta ·  .sis-w/.sis-n = sombra con el número de capa de cada fila
   .siw = capa con franjas objetivo (.sif columnas arriba, .sil filas a la derecha; .on = tiene que haber cubo) · .sic.nx = casilla que nunca lleva cubo (rayada) */
.sik { overflow: hidden; padding-bottom: 8px }
.sik .sit2 { padding: 0 10px }
.sik .sip { padding: 0 12px; margin-bottom: 4px }
.sis-w { display: flex; align-items: stretch; gap: 4px }
.sis-n { display: grid; grid-template-rows: repeat(4, 1fr); padding: 6px 0; font-style: normal; font-size: 12px; font-weight: 800; color: var(--mut); text-align: right; align-items: center }
.sis-n i { font-style: normal }
.siw { display: grid; grid-template-columns: 1fr 10px; grid-template-rows: 10px auto; gap: 3px }
.sif, .sil { display: grid; gap: 3px }
.sif { grid-column: 1; grid-row: 1; grid-template-columns: repeat(4, 1fr) }
.sil { grid-column: 2; grid-row: 2; grid-template-rows: repeat(4, 1fr) }
.siw .sig { grid-column: 1; grid-row: 2 }
.sif i, .sil i { border-radius: 3px; background: color-mix(in srgb, var(--edge) 22%, var(--card)) }
.sif i.on, .sil i.on { background: var(--ink) }
.sic.nx:not(.on) { background-image: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--edge) 28%, transparent) 4px 6px) }

/* ---------- Horizonte (rediseño) ----------
   .hzk = tarjeta ·  .hzw = marco del tablero · .hzp = teclado de alturas pegado al tablero (.k[data-done] = esa altura ya está en las 4 filas) */
.hzk { overflow: hidden }
.hzw { padding: 10px 10px 6px }
.hzp { padding: 4px 10px 12px }
.hzp .kb { margin: 0 }
.hzp .k[data-done] { opacity: .4 }
@media (prefers-reduced-motion: reduce) { .hzx::after { transition: none } }
.hzx.em::after { display: none }
