/* Riega el patio (18/10/2026). Se sirve tal cual, sin pasar por Tailwind: el
   juego es una pantalla cerrada con sus propios colores, los de un patio. */
.patio {
    --cal: #fbf8f1;
    --azul: #1f4fa3;
    --azulito: #d9e6f7;
    --almagra: #a8432c;
    --albero: #e2b13c;
    --verde: #3f7d3a;
    --tinta: #22303a;
    --rojo: #c8352b;
    --sombra: rgba(34, 48, 58, .22);
}

/*
  DENTRO DEL PORTAL, NO A PANTALLA COMPLETA, como el crucero: un alto cómodo
  con la cabecera y el pie alrededor. Es un juego de pie: la pared es alta.
*/
.patio.juego {
    height: min(calc(100vh - 175px), 860px);
    height: min(calc(100dvh - 175px), 860px);
    min-height: 460px;
    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 */
.patio .marcador { display: flex; align-items: center; gap: 6px; }

.patio .calor,
.patio .jurado,
.patio .bote {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--cal);
    border-radius: 999px;
    padding: 4px 12px;
    box-shadow: 0 2px 0 var(--sombra);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 0;
}

.patio .calor { flex: none; }
.patio .calor b { font-size: 16px; white-space: nowrap; }
.patio .jurado { flex: 1; justify-content: center; }
.patio .jurado b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* El termómetro: el mercurio sube con el calor y se pone rojo. */
.patio .termometro {
    position: relative;
    width: 9px;
    height: 22px;
    border-radius: 6px;
    background: #e6e1d6;
    overflow: hidden;
    box-shadow: inset 0 0 0 1.5px rgba(34, 48, 58, .35);
}

.patio .termometro i { position: absolute; left: 0; right: 0; bottom: 0; height: 30%; background: #e0892b; border-radius: 6px; }
.patio .calor.aprieta { background: #ffe6d6; color: var(--rojo); }
.patio .calor.aprieta .termometro i { background: var(--rojo); }

/* Los últimos diez segundos antes del jurado, latiendo: se ve sin leer. */
.patio .jurado.apurado { background: #fff1c2; animation: latido .5s ease-in-out infinite alternate; }

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

/* El bote: una lata que se vacía. */
.patio .bote { flex: none; padding: 4px 10px; }

.patio .lata {
    position: relative;
    width: 20px;
    height: 24px;
    border-radius: 3px 3px 5px 5px;
    background: linear-gradient(90deg, #9aa3a8, #d9dfe2 45%, #8d969b);
    overflow: hidden;
    box-shadow: inset 0 0 0 1.5px rgba(34, 48, 58, .4);
}

.patio .lata i { position: absolute; left: 2px; right: 2px; bottom: 2px; height: 80%; background: #3d8fd6; border-radius: 2px; transition: height .15s linear; }
.patio .bote.vacio { background: #ffe1d9; animation: latido .5s ease-in-out infinite alternate; }

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

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

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

.patio .avance #nivel { white-space: nowrap; opacity: .7; }
.patio .avance #barrio { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: var(--azul); }
.patio .avance .mustias { white-space: nowrap; }
.patio .avance #cola { margin-left: auto; white-space: nowrap; opacity: .75; }
.patio .avance #puntos { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ------------------------------------------------------------ Campo */
.patio .campo {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--cal);
    box-shadow: 0 5px 0 rgba(34, 48, 58, .18), 0 14px 30px rgba(34, 48, 58, .22);
    /* El dedo riega, no mueve la página. */
    touch-action: none;
}

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

/* ------------------------------------------------------------ Carteles */
.patio .cartel {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 11px;
    text-align: center;
    padding: 18px;
    background: rgba(24, 58, 120, .7);
    color: var(--cal);
    overflow-y: auto;
}

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

.patio .firma {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    background: rgba(251, 248, 241, .94);
    color: var(--tinta);
    border-radius: 999px;
    padding: 7px 15px;
    box-shadow: 0 3px 0 rgba(34, 48, 58, .25);
}

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

.patio .cartel h1 { margin: 0; color: var(--cal); font-size: clamp(28px, 8vw, 46px); line-height: 1.02; text-wrap: balance; }
.patio .cartel p { margin: 0; font-size: 15px; max-width: 36ch; font-weight: 600; line-height: 1.35; }

/* Las cuentas del jurado: una línea por cosa, alineadas. */
.patio .cuentas {
    margin: 0;
    padding: 10px 16px;
    list-style: none;
    display: grid;
    gap: 4px;
    background: rgba(251, 248, 241, .14);
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-align: left;
}

.patio .cuentas[hidden] { display: none; }
.patio .cuentas .premio { color: #ffd76a; font-size: 17px; }

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

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

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

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

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

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

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

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

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

@media (prefers-reduced-motion: reduce) {
    .patio .jurado.apurado,
    .patio .bote.vacio { animation: none; }
}

.patio .avance .mustias { letter-spacing: 0; opacity: .8; }
.patio .avance .mustias.mal { color: var(--rojo); opacity: 1; }
