/* Tapa gratis (18/10/2026). Se sirve tal cual, sin pasar por Tailwind: el
   juego es una pantalla cerrada con sus propios colores. Lo de los carteles y
   los botones es lo mismo que en el crucero y en la sombrilla. */
.tapa {
    --madera: #3f2818;
    --cerveza: #f2b43a;
    --tinta: #2b1a10;
    --hueso: #fffaf0;
    --rojo: #d9483b;
    --verde: #2e9e55;
    --sombra: rgba(43, 26, 16, .22);
}

/*
  DENTRO DEL PORTAL, NO A PANTALLA COMPLETA, como los demás: un alto cómodo
  con la cabecera y el pie alrededor. De pie cabe la barra entera.
*/
.tapa.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;
    -webkit-touch-callout: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
    box-sizing: border-box;
    max-width: 720px;
    margin: 0 auto;
}

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

.tapa .bar {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    background: var(--hueso);
    border-radius: 999px;
    padding: 4px 14px;
    box-shadow: 0 2px 0 var(--sombra);
    font-weight: 800;
}

.tapa .bar b { font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 0 1 auto; min-width: 0; }
.tapa .bar .hora { font-variant-numeric: tabular-nums; font-size: 14px; opacity: .7; flex: none; }

.tapa .barra {
    flex: 1;
    min-width: 24px;
    height: 9px;
    border-radius: 999px;
    background: rgba(43, 26, 16, .14);
    overflow: hidden;
    display: block;
}

.tapa .barra i { display: block; height: 100%; width: 0; background: var(--cerveza); border-radius: 999px; }

/* Los fallos: un plato por cada uno que se aguanta; roto, el que ya se ha gastado. */
.tapa .fallos { display: flex; gap: 3px; flex: none; }
.tapa .fallos span {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #fff;
    box-shadow: inset 0 0 0 2px #d8cfc0, inset 0 0 0 4px #fff, inset 0 0 0 5px #e9e2d4;
}
.tapa .fallos span.hecho {
    background: var(--rojo);
    box-shadow: none;
    position: relative;
}
.tapa .fallos span.hecho::after {
    content: '';
    position: absolute;
    inset: 6px 2px;
    background: #fff;
    transform: rotate(45deg);
    border-radius: 2px;
}

.tapa .avance {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 700;
    padding: 0 6px;
}

.tapa #rondas { opacity: .75; }
.tapa #puntos { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

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

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

/* ------------------------------------------------------------ Campo */
.tapa .campo {
    position: relative;
    flex: 1;
    min-height: 0;
    border-radius: 16px;
    overflow: hidden;
    background: var(--madera);
    box-shadow: 0 5px 0 rgba(43, 26, 16, .18), 0 14px 30px rgba(43, 26, 16, .22);
    /* El dedo tira la caña, no mueve la página. */
    touch-action: none;
}

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

/* ------------------------------------------------------------ Carteles */
.tapa .cartel {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    text-align: center;
    padding: 18px;
    background: rgba(52, 28, 14, .7);
    color: var(--hueso);
    overflow-y: auto;
}

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

.tapa .firma {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    background: rgba(255, 250, 240, .94);
    color: var(--tinta);
    border-radius: 999px;
    padding: 7px 15px;
    box-shadow: 0 3px 0 rgba(43, 26, 16, .25);
}

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

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

.tapa .cartel .marca {
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 250, 240, .18);
    font-size: 14px;
}

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

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

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

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

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

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

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

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