/* Pantalla de entrada: salas, equipo, archivos propios y opción de manos.
   Usa los colores de la página (--accent, --line, ...), así la marca los cambia sola. */

.cs16-titulo {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.cs16-nota {
    margin: 0;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.45;
}
.cs16-nota b { color: var(--text); font-weight: 600; }
.cs16-nota[hidden], .cs16-salas[hidden], .cs16-archivos[hidden] { display: none; }
/* las casillas ocultas (pantalla completa, mano en el celular): «label.check» del estilo
   original les ponía display:flex y seguían a la vista */
#lobby label[hidden] { display: none; }

/* salas */
.cs16-salas { margin-bottom: 14px; }
.cs16-sala {
    all: unset;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 10px 1fr;
    column-gap: 10px;
    width: 100%;
    padding: 9px 12px;
    margin-bottom: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}
.cs16-sala:hover { border-color: var(--accent); }
.cs16-sala[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cs16-sala[data-apagada] { opacity: .6; }
.cs16-sala .cs16-punto { grid-row: span 2; align-self: center; }
.cs16-sala-nombre { font-weight: 600; color: var(--text); }
.cs16-sala-datos { color: var(--muted); font-size: 12.5px; }
.cs16-punto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--err);
}
.cs16-punto.on { background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* equipo */
.cs16-equipo { display: grid; gap: 6px; }
.cs16-equipo-titulo { color: var(--muted); font-size: 13px; }
.cs16-equipo-opciones {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}
.cs16-equipo label { display: block; margin: 0; cursor: pointer; }
.cs16-equipo input { position: absolute; opacity: 0; pointer-events: none; }
.cs16-equipo label span {
    display: block;
    padding: 9px 4px;
    text-align: center;
    font-size: 13.5px;
    color: var(--muted);
    border-left: 1px solid var(--line);
}
.cs16-equipo label:first-of-type span { border-left: 0; }
.cs16-equipo input:checked + span { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.cs16-equipo input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }

/* manos */
.cs16-manos small { color: var(--muted); font-size: 12px; }
.cs16-manos-ayuda { margin: -4px 0 2px 24px; }

/* archivos propios */
.cs16-archivos {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px 14px;
}
.cs16-archivos-fila {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}
.cs16-archivos-estado { font-size: 13.5px; font-weight: 600; }
.cs16-archivos-estado[data-error] { color: var(--err); font-weight: 500; }
.cs16-boton {
    display: inline-block;
    padding: 8px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff0d;
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}
.cs16-boton:hover { border-color: var(--accent); }
.cs16-donde { margin-top: 10px; color: var(--muted); font-size: 12.5px; }
.cs16-donde summary { cursor: pointer; }
.cs16-donde ul { padding-left: 18px; margin: 6px 0; }
.cs16-donde li { margin: 3px 0; word-break: break-word; }

/* con archivos propios no se baja el paquete grande: el aviso de descarga no aplica */
body.cs16-propios #download-hint { display: none; }

/* dos columnas en pantallas anchas (entrada.js arma .cs16-col-izq y .cs16-col-der):
   todo entra sin scrollear; en pantallas angostas queda una columna como siempre */
@media (min-width: 860px) {
    #lobby.cs16-ancho:not([hidden]) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
        width: min(1000px, calc(100vw - 48px));
        padding: 34px 40px 24px;
    }
    #lobby.cs16-ancho > .cs16-col-izq { padding-right: 40px; }
    #lobby.cs16-ancho > .cs16-col-der {
        padding-left: 40px;
        border-left: 1px solid var(--line);
    }
    #lobby.cs16-ancho > .marca-pie { grid-column: 1 / -1; }
    #lobby.cs16-ancho .server { margin-bottom: 0; }
    #lobby.cs16-ancho .help { margin-top: 22px; }
    #lobby.cs16-ancho .help ul { line-height: 1.7; }
}
/* una columna (celular): el mismo orden de siempre, con los controles al final */
@media (max-width: 859px) {
    #lobby.cs16-ancho:not([hidden]) { display: flex; flex-direction: column; }
    #lobby.cs16-ancho > .cs16-col { display: contents; }
    #lobby.cs16-ancho .help { order: 1; }
    #lobby.cs16-ancho > .marca-pie { order: 2; }
}

/* ------------------------------------------------------------- celular */
/* «100vh» en el celular incluye la parte que tapa la barra del navegador: el juego quedaba
   más alto que la pantalla y se cortaba abajo, justo donde aparecen los números de los
   menús (compra, equipo). Con «dvh» ocupa exactamente lo que se ve. */
canvas { width: 100vw; height: 100vh; width: 100dvw; height: 100dvh; }

/* botones de tactil.js: segunda fila arriba al centro, donde el juego no tiene botones
   (el engranaje y los menús de bots/comandos se sacan) */
.cs16-tactil {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 15dvh);
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    display: none;
    gap: 6px;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
body.playing.cs16-tactil-on .cs16-tactil { display: flex; }
.cs16-tactil button, .cs16-teclado button {
    all: unset;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #000000a6;
    border: 1px solid #ffffff3d;
    color: #fff;
    font: 600 13px/1 "Geist", system-ui, sans-serif;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cs16-tactil button { min-height: 36px; padding: 0 12px; }
.cs16-tactil button:active, .cs16-teclado button:active { background: var(--accent, #0d8750); }

/* teclado de números para los menús del juego (compra, equipo) */
.cs16-teclado {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -38%);
    z-index: 5;
    width: min(420px, calc(100vw - 24px));
    padding: 10px 12px 12px;
    border-radius: 14px;
    background: #000000b8;
    border: 1px solid #ffffff2e;
    -webkit-user-select: none;
    user-select: none;
    touch-action: manipulation;
}
.cs16-teclado[hidden], body:not(.playing) .cs16-teclado { display: none; }
.cs16-teclado-titulo {
    margin: 0 28px 8px 2px;
    color: #fff;
    font: 500 12.5px/1.35 "Geist", system-ui, sans-serif;
}
.cs16-teclado-numeros { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.cs16-teclado-numeros button { height: 46px; border-radius: 10px; font-size: 20px; }
.cs16-teclado .cs16-teclado-cerrar {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 30px;
    height: 30px;
    font-size: 14px;
}

.cs16-tactil-aviso {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 15dvh + 46px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 4;
    width: min(520px, calc(100vw - 32px));
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: #000000c4;
    border: 1px solid #ffffff2e;
    color: #fff;
    font: 500 14px/1.4 "Geist", system-ui, sans-serif;
    text-align: center;
    pointer-events: none;
}
.cs16-tactil-aviso[hidden], body:not(.playing) .cs16-tactil-aviso { display: none; }

/* celular vertical: pedir que lo giren */
.cs16-girar { display: none; }
@media (orientation: portrait) {
    body.playing.cs16-tactil-on .cs16-girar {
        position: fixed;
        inset: 0;
        z-index: 6;
        display: grid;
        place-items: center;
        background: #0e0f0cf2;
        color: #fff;
        font: 600 18px/1.4 "Geist", system-ui, sans-serif;
        text-align: center;
        padding: 24px;
    }
}

/* radio.js: menús de radio (Z, X, C), a la izquierda como los menús del juego */
.cs16-radio {
    position: fixed;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    min-width: 230px;
    padding: 12px 16px 10px;
    border-radius: 10px;
    background: #000000a8;
    border: 1px solid #ffffff24;
    color: #fff;
    font: 500 15px/1.5 "Geist", system-ui, sans-serif;
    pointer-events: none;
    -webkit-user-select: none;
    user-select: none;
}
.cs16-radio[hidden], body:not(.playing) .cs16-radio { display: none; }
.cs16-radio-titulo { margin: 0 0 6px; color: #ffb428; font-weight: 700; }
.cs16-radio-titulo kbd { margin-left: 4px; font: 600 11px/1 "Geist Mono", ui-monospace, monospace; opacity: .7; }
.cs16-radio ol { margin: 0; padding: 0; list-style: none; }
.cs16-radio b { display: inline-block; width: 1.4em; color: #ffb428; }
.cs16-radio-salir { margin: 6px 0 0; color: #ffffffb3; }

/* sesion.js: se cortó la conexión con la sala */
.cs16-corte {
    position: fixed;
    inset: 0;
    z-index: 7;
    display: grid;
    place-items: center;
    padding: 16px;
    background: #000000c7;
}
.cs16-corte[hidden] { display: none; }
.cs16-corte-caja {
    width: min(420px, 100%);
    padding: 22px;
    border-radius: 14px;
    background: var(--panel, #1f1f1f);
    border: 1px solid var(--line, #ffffff1f);
    color: var(--text, #f5f5f5);
    font-family: "Geist", system-ui, sans-serif;
    text-align: center;
}
.cs16-corte-caja h2 { margin: 0 0 8px; font-size: 18px; }
.cs16-corte-caja p { margin: 0 0 16px; color: var(--muted, #a4a4a4); font-size: 14px; line-height: 1.45; }
.cs16-corte-caja button { width: 100%; margin: 0; }

/* cerrado.js: «Cerrado por ahora» (./cerrar.sh en el servidor) */
.cs16-cerrado {
    position: fixed;
    inset: 0;
    z-index: 8;
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--bg, #0e0f0c);
}
.cs16-cerrado-caja {
    width: min(460px, 100%);
    padding: 32px 26px 26px;
    border-radius: 16px;
    background: var(--panel, #1f1f1f);
    border: 1px solid var(--line, #ffffff1f);
    color: var(--text, #f5f5f5);
    font-family: "Geist", system-ui, sans-serif;
    text-align: center;
}
.cs16-cerrado-caja img { width: 150px; height: auto; margin-bottom: 18px; }
.cs16-cerrado-caja h1 { margin: 0 0 14px; font-size: 22px; line-height: 1.35; white-space: pre-line; text-wrap: balance; }
.cs16-cerrado-caja small { color: var(--muted, #a4a4a4); font-size: 12.5px; }
body.cs16-esta-cerrado #lobby { visibility: hidden; }
