/* Ruta modernista (18/10/2026). Se sirve tal cual, sin pasar por Tailwind:
   el juego es una pantalla cerrada con sus propios colores, los del Ensanche:
   el ocre y el salmón de los muros, el crema de las molduras, el verde de la
   carpintería y la madera de la caja del restaurador. */
.modernista {
    --papel: #fbf6ee;
    --madera: #7a4a2b;
    --ocre: #c8803c;
    --verde: #4f8a5b;
    --tinta: #2a211c;
    --rojo: #c8352b;
    --sombra: rgba(42, 33, 28, .22);
}

/*
  DENTRO DEL PORTAL, NO A PANTALLA COMPLETA, como el cortador y el crucero:
  un alto cómodo con la cabecera y el pie alrededor. Es un juego de pie.
*/
.modernista.juego {
    height: min(calc(100vh - 175px), 900px);
    height: min(calc(100dvh - 175px), 900px);
    min-height: 480px;
    color: var(--tinta);
    font-family: 'Baloo 2', ui-rounded, system-ui, sans-serif;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    box-sizing: border-box;
    max-width: 720px;
    margin: 0 auto;
}

/* ------------------------------------------------------------ Marcador */
.modernista .marcador { display: flex; align-items: center; gap: 6px; }

.modernista .lugar,
.modernista .fallos {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--papel);
    border-radius: 999px;
    padding: 4px 12px;
    box-shadow: 0 2px 0 var(--sombra);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 0;
    height: 34px;
    box-sizing: border-box;
}

.modernista .lugar { flex: 1; }
.modernista .lugar b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modernista .fallos { flex: none; font-size: 14px; white-space: nowrap; }
.modernista .fallos.mal { color: var(--rojo); }

@keyframes latido { to { transform: scale(1.04); } }

.modernista .sonido {
    flex: none;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: var(--papel);
    color: var(--tinta);
    box-shadow: 0 2px 0 var(--sombra);
    cursor: pointer;
}

.modernista .sonido svg { width: 24px; height: 24px; }
.modernista .sonido .con { display: none; }
.modernista .sonido[aria-pressed="true"] .con { display: inline; }
.modernista .sonido[aria-pressed="true"] .sin { display: none; }
.modernista .sonido:focus-visible { outline: 3px solid var(--madera); outline-offset: 2px; }

/* Lo que falta, el reloj y los puntos. */
.modernista .avance {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    min-width: 0;
}

.modernista .avance .faltan { white-space: nowrap; color: var(--madera); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.modernista .avance .reloj { display: flex; align-items: center; gap: 5px; flex: none; }
.modernista .avance .reloj .barra { position: relative; display: block; width: 70px; height: 9px; border-radius: 6px; background: #eadfce; overflow: hidden; }
.modernista .avance .reloj .barra i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; background: var(--verde); border-radius: 6px; transition: width .2s linear; }
.modernista .avance .reloj b { font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 34px; }
.modernista .avance .reloj.prisa { color: var(--rojo); animation: latido .5s ease-in-out infinite alternate; }
.modernista .avance .reloj.prisa .barra i { background: var(--rojo); }
.modernista .avance #puntos { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------ Campo */
.modernista .campo {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #5d3a22;
    box-shadow: 0 5px 0 rgba(42, 33, 28, .2), 0 14px 30px rgba(42, 33, 28, .24);
    /* El dedo pone piezas, no mueve la página. */
    touch-action: none;
}

.modernista canvas { display: block; width: 100%; height: 100%; }

.modernista .boton {
    font: inherit;
    font-weight: 800;
    font-size: 19px;
    color: var(--tinta);
    background: #f2c14e;
    border: 0;
    border-radius: 999px;
    padding: 11px 30px;
    cursor: pointer;
    box-shadow: 0 4px 0 #a97f1d;
}

.modernista .boton:active { transform: translateY(3px); box-shadow: 0 1px 0 #a97f1d; }
.modernista .boton:focus-visible { outline: 3px solid var(--papel); outline-offset: 3px; }

/* ------------------------------------------------------------ Carteles */
.modernista .cartel {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 10px;
    text-align: center;
    padding: 18px;
    background: rgba(40, 30, 26, .72);
    color: var(--papel);
    overflow-y: auto;
}

.modernista .cartel[hidden] { display: none; }

.modernista .firma {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    background: rgba(251, 246, 238, .94);
    color: var(--tinta);
    border-radius: 999px;
    padding: 7px 15px;
    box-shadow: 0 3px 0 rgba(42, 33, 28, .25);
}

.modernista .firma[hidden] { display: none; }
.modernista .firma .de { font-weight: 600; opacity: .62; font-size: 13px; letter-spacing: .03em; }
.modernista .firma .logo { display: block; height: 24px; width: auto; }

.modernista .cartel h1 { margin: 0; color: var(--papel); font-size: clamp(26px, 7.5vw, 44px); line-height: 1.04; text-wrap: balance; }
.modernista .cartel p { margin: 0; font-size: 15px; max-width: 36ch; font-weight: 600; line-height: 1.35; }
.modernista .cartel .hoy { font-size: 13px; opacity: .85; font-style: italic; }
.modernista .cartel .hoy[hidden] { display: none; }

/* El dato del edificio: el autor y el año arriba, en grande; esto, debajo. */
.modernista .cartel .dato {
    font-size: 14px;
    font-weight: 600;
    background: rgba(251, 246, 238, .12);
    border-left: 4px solid #f2c14e;
    border-radius: 8px;
    padding: 8px 12px;
    text-align: left;
}

.modernista .cartel .dato[hidden] { display: none; }

.modernista .cuentas {
    margin: 0;
    padding: 10px 16px;
    list-style: none;
    display: grid;
    gap: 4px;
    background: rgba(251, 246, 238, .14);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
}

.modernista .cuentas[hidden] { display: none; }
.modernista .cuentas .mal { color: #ffb4a3; }
.modernista .cuentas .bien { color: #ffd76a; }

.modernista .cartel .marca {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(251, 246, 238, .18);
    font-size: 14px;
}

.modernista .cartel .marca[hidden] { display: none; }

.modernista .boton.otro {
    background: transparent;
    color: var(--papel);
    box-shadow: inset 0 0 0 2px var(--papel);
    font-size: 16px;
    padding: 8px 22px;
}

.modernista .boton.otro[hidden] { display: none; }

.modernista .pie { margin: 0; text-align: center; font-size: 12px; font-weight: 600; opacity: .7; }

/*
  TUMBADO, SIN EL PORTAL ALREDEDOR, igual que el cortador: la cabecera y la
  barra de abajo son fijas y en un móvil apaisado se comerían la fachada.
*/
@media (orientation: landscape) and (max-height: 560px) {
    body:has(.modernista.juego) #cabecera-del-portal,
    body:has(.modernista.juego) .barra-de-abajo,
    body:has(.modernista.juego) #aviso-de-especial { display: none; }
    body:has(.modernista.juego) #contenido { padding-block: 0; }
    body:has(.modernista.juego) { padding-bottom: 0; }

    .modernista.juego { height: 100vh; height: 100dvh; min-height: 280px; gap: 4px; padding: 4px 8px; }
    .modernista .pie { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .modernista .avance .reloj.prisa { animation: none; }
}
