/* ¡Que llega el crucero! Se sirve tal cual, sin pasar por Tailwind: el juego
   es una pantalla cerrada con sus propios colores. */
.crucero {
    --cielo: #bfe6f2;
    --mar: #1f7fa6;
    --crema: #f6ecd6;
    --albero: #e9b949;
    --tinta: #23303b;
    --hueso: #fffaf0;
    --rojo: #d9483b;
    --sombra: rgba(35, 48, 59, .22);
}

/*
  DENTRO DEL PORTAL, NO A PANTALLA COMPLETA, como el vóley: un alto cómodo con
  la cabecera y el pie alrededor. Es un juego de pie: la calle es larga.
*/
.crucero.juego {
    /* Lo que queda de pantalla entre la cabecera del portal y su barra de abajo: el jugador va
       abajo del todo y no puede quedar debajo del pliegue. */
    height: min(calc(100vh - 175px), 860px);
    height: min(calc(100dvh - 175px), 860px);
    min-height: 440px;
    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 */
.crucero .marcador { display: flex; align-items: center; gap: 8px; }

.crucero .cuenta {
    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;
    font-variant-numeric: tabular-nums;
}

.crucero .cuenta b { font-size: 17px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crucero .cuenta .barco { font-size: 20px; }
.crucero .cuenta .barcos { margin-left: auto; letter-spacing: -3px; font-size: 15px; white-space: nowrap; }

/* Los últimos diez segundos, en rojo y latiendo: se ve sin leer. */
.crucero .cuenta.apurado { background: #ffe1d9; color: var(--rojo); animation: latido .5s ease-in-out infinite alternate; }

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

.crucero .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;
}

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

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

.crucero .avance #nivel { white-space: nowrap; opacity: .7; }
.crucero .avance #destino { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52%; }
.crucero .avance #puntos { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }

.crucero .barra {
    flex: 1;
    min-width: 40px;
    height: 9px;
    border-radius: 999px;
    background: rgba(35, 48, 59, .14);
    overflow: hidden;
}

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

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

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

/* ------------------------------------------------------------ Carteles */
.crucero .cartel {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    justify-items: center;
    gap: 12px;
    text-align: center;
    padding: 18px;
    background: rgba(31, 85, 120, .66);
    color: var(--hueso);
    overflow-y: auto;
}

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

.crucero .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(35, 48, 59, .25);
}

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

.crucero .cartel h1 { margin: 0; color: var(--hueso); font-size: clamp(27px, 7.5vw, 44px); line-height: 1.02; text-wrap: balance; }
.crucero .cartel p { margin: 0; font-size: 15px; max-width: 34ch; font-weight: 600; line-height: 1.35; }

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

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

.crucero .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 #b88a22;
}

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

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

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

.crucero .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 calle.
*/
@media (orientation: landscape) and (max-height: 560px) {
    body:has(.crucero) #cabecera-del-portal,
    body:has(.crucero) .barra-de-abajo,
    body:has(.crucero) #aviso-de-especial { display: none; }
    body:has(.crucero) #contenido { padding-block: 0; }
    body:has(.crucero) { padding-bottom: 0; }

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

@media (prefers-reduced-motion: reduce) {
    .crucero .cuenta.apurado { animation: none; }
}
