/* Hasta el fin del mundo: estilos
   Pensado para personas mayores: letra grande, alto contraste, botones grandes. */

:root {
  --fondo: #ffffff;
  --fondo-suave: #f2f5fa;
  --texto: #111111;
  --texto-suave: #3a3a3a;
  --primario: #0b2f6b;      /* azul marino */
  --primario-claro: #dfe8f7;
  --hoy: #ffd23f;           /* amarillo intenso */
  --hoy-borde: #b38600;
  --alerta-fondo: #fff1e0;
  --alerta-borde: #c25400;
  --ok: #0f6b2f;
  --peligro: #b00020;
  --borde: #c7cfdb;
  --radio: 16px;
  --tam: 20px;
}

html[data-letra="1"] { --tam: 23px; }
html[data-letra="2"] { --tam: 26px; }

* { box-sizing: border-box; }

html { font-size: var(--tam); -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

a { color: var(--primario); }

/* Cabecera */
.cabecera {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  background: var(--primario); color: #fff;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  min-height: 64px;
}
.cabecera-titulo {
  flex: 1; margin: 0; font-size: 1.05rem; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.btn-volver, .btn-letra {
  background: #fff; color: var(--primario);
  border: 0; border-radius: 12px;
  font-size: 0.9rem; font-weight: 700;
  min-height: 48px; padding: 0 14px; cursor: pointer;
}
.btn-letra span { font-size: 1.3em; }

main { padding: 16px; max-width: 760px; margin: 0 auto; outline: none; }

h2 { font-size: 1.4rem; line-height: 1.25; margin: 8px 0 14px; color: var(--primario); }
h3 { font-size: 1.15rem; line-height: 1.3; margin: 22px 0 10px; }
p { margin: 0 0 12px; }
ul { padding-left: 1.2em; margin: 0 0 12px; }
li { margin-bottom: 8px; }

/* Barra inferior */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; background: #fff;
  border-top: 2px solid var(--primario);
  padding-bottom: env(safe-area-inset-bottom);
}
.barra a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 76px; text-decoration: none; color: var(--texto);
  font-size: 15px; font-weight: 700;
}
.barra a .ico { font-size: 28px; line-height: 1.1; }
.barra a.activa { background: var(--primario); color: #fff; }

/* Tarjetas */
.tarjeta {
  background: #fff; border: 2px solid var(--borde); border-radius: var(--radio);
  padding: 16px; margin-bottom: 16px;
}
.tarjeta.hoy { border: 4px solid var(--hoy-borde); background: #fffbea; }
.etiqueta-hoy {
  display: inline-block; background: var(--hoy); color: #000;
  font-weight: 800; padding: 4px 12px; border-radius: 999px; margin-bottom: 8px;
  border: 2px solid var(--hoy-borde);
}
.fecha-grande { font-size: 1.3rem; font-weight: 800; margin: 0 0 4px; }
.ciudad-dia { font-size: 1.05rem; color: var(--texto-suave); margin: 0 0 12px; font-weight: 600; }

/* Bloque destacado de inicio */
.portada {
  background: var(--primario); color: #fff; border-radius: var(--radio);
  padding: 20px; margin-bottom: 18px;
}
.portada h2 { color: #fff; margin-top: 0; }
.portada .grande { font-size: 1.6rem; font-weight: 800; margin: 0 0 6px; }
.portada p { margin-bottom: 8px; }

/* Botones */
.boton {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 60px; padding: 12px 18px;
  background: var(--primario); color: #fff;
  border: 0; border-radius: 14px;
  font-size: 1rem; font-weight: 700; text-decoration: none; text-align: center;
  cursor: pointer; margin: 8px 0;
}
.boton.secundario { background: #fff; color: var(--primario); border: 3px solid var(--primario); }
.boton.verde { background: var(--ok); }
.boton.rojo { background: var(--peligro); }
.boton:active { transform: scale(0.98); }

.menu-grande { display: grid; grid-template-columns: 1fr; gap: 12px; }
.menu-grande .boton { min-height: 84px; font-size: 1.15rem; justify-content: flex-start; padding-left: 22px; margin: 0; }
.menu-grande .boton .ico { font-size: 1.6rem; }
@media (min-width: 560px) { .menu-grande { grid-template-columns: 1fr 1fr; } }

/* Lista de días */
.dia-enlace {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--texto);
  border: 2px solid var(--borde); border-radius: var(--radio);
  padding: 14px; margin-bottom: 12px; min-height: 76px; background: #fff;
}
.dia-enlace .num {
  flex: 0 0 64px; height: 64px; border-radius: 12px;
  background: var(--primario-claro); color: var(--primario);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: 800; line-height: 1.05;
}
.dia-enlace .num b { font-size: 1.35rem; }
.dia-enlace .num small { font-size: 0.7rem; text-transform: uppercase; }
.dia-enlace .txt { flex: 1; }
.dia-enlace .txt strong { display: block; font-size: 1rem; }
.dia-enlace .txt span { color: var(--texto-suave); font-size: 0.9rem; }
.dia-enlace.hoy { border: 4px solid var(--hoy-borde); background: #fffbea; }
.dia-enlace.hoy .num { background: var(--hoy); color: #000; }
.dia-enlace.pasado { opacity: 0.6; }

/* Eventos del día */
.evento { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--borde); }
.evento:first-of-type { border-top: 0; }
.evento .hora { flex: 0 0 76px; font-weight: 800; font-size: 1.05rem; }
.evento .que { flex: 1; }
.evento .que strong { display: block; }

/* Avisos */
.alerta {
  background: var(--alerta-fondo); border-left: 8px solid var(--alerta-borde);
  border-radius: 10px; padding: 12px 14px; margin: 12px 0;
}
.alerta strong { color: #7a3200; }
.nota { background: var(--fondo-suave); border-radius: 10px; padding: 12px 14px; margin: 12px 0; }
.por-confirmar {
  display: inline-block; background: #eee; border: 1px dashed #777; color: #333;
  border-radius: 6px; padding: 0 6px; font-size: 0.85em; font-weight: 700;
}

/* Reservas */
.reserva .codigo {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 1.8rem; font-weight: 800; letter-spacing: 0.08em;
  background: var(--fondo-suave); border-radius: 10px; padding: 8px 12px;
  margin: 8px 0; word-break: break-all;
}
.reserva .detalle { color: var(--texto-suave); font-size: 0.92rem; }
.codigo-dia { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.codigo-dia .codigo { font-size: 1.3rem; margin: 0; }

/* Listas de ciudad */
.lugar { border-top: 1px solid var(--borde); padding: 12px 0; }
.lugar:first-child { border-top: 0; }
.lugar strong { display: block; font-size: 1.02rem; }
.lugar .meta { color: var(--texto-suave); font-size: 0.88rem; }

details.plegable {
  border: 2px solid var(--borde); border-radius: var(--radio); margin-bottom: 14px; background: #fff;
}
details.plegable > summary {
  list-style: none; cursor: pointer; padding: 16px; min-height: 64px;
  font-weight: 800; font-size: 1.08rem; display: flex; align-items: center; justify-content: space-between;
}
details.plegable > summary::-webkit-details-marker { display: none; }
details.plegable > summary::after { content: "＋"; font-size: 1.4rem; color: var(--primario); }
details.plegable[open] > summary::after { content: "－"; }
details.plegable > .cuerpo { padding: 0 16px 16px; }

.tabla-simple { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.tabla-simple td { padding: 8px 4px; border-bottom: 1px solid var(--borde); vertical-align: top; }
.tabla-simple td:first-child { font-weight: 700; width: 45%; }

/* Pantalla de contraseña */
.candado { text-align: center; padding-top: 20px; }
.candado .icono { font-size: 64px; }
.candado input {
  width: 100%; min-height: 64px; font-size: 1.3rem; text-align: center;
  border: 3px solid var(--primario); border-radius: 14px; padding: 8px; margin: 12px 0;
}
.error { color: var(--peligro); font-weight: 700; }

/* Aviso flotante (copiado, etc.) */
.aviso-flotante {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: #111; color: #fff; padding: 14px 22px; border-radius: 14px;
  font-weight: 700; font-size: 1.05rem; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 20; max-width: 90vw; text-align: center;
}
.aviso-flotante.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.cargando { text-align: center; padding: 40px 0; }
.pie { text-align: center; color: var(--texto-suave); font-size: 0.8rem; margin-top: 24px; }
.sin-conexion { background: #222; color: #fff; text-align: center; padding: 8px; font-weight: 700; font-size: 0.9rem; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
