/* ==========================================================================
   RedMoviSim 2.0 · home.css — portada
   Paso 1 (data-step="1"): ¿Qué quieres hacer? → Conducir, Viajar, Centro de Control.
   Paso 2 (data-step="2"): prepararlo y Jugar. main.js pone en #startScreen
   data-home-mode (driver | passenger | control) y data-home-vehicle (metro | nos | efe | bus | taxi) y data-home-road="1" para los que van por la calle (bus y taxi);
   lo que no corresponde se oculta aquí con .only-* / .train-only / .bus-only.
   ========================================================================== */

.home {
  position: relative; overflow-y: auto; overflow-x: hidden;
  display: grid; grid-template-rows: auto 1fr auto;
  grid-template-columns: minmax(0, 1fr);   /* 2.16.3 · si no, la barra de arriba ensanchaba la columna y en vertical se cortaba */
  background:
    radial-gradient(60% 50% at 0% 0%, #e8343f1f 0, transparent 70%),
    radial-gradient(50% 45% at 100% 100%, #6c9bff14 0, transparent 70%),
    var(--bg);
  padding: 0 max(16px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}

/* ---------- Barra superior ---------- */
.home-bar {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: min(100%, 1180px); margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 0 12px;
  background: linear-gradient(var(--bg) 70%, transparent);
}
.home-brand { display: flex; align-items: center; gap: 10px; flex: none; }   /* 2.72.1 · la marca no se aprieta (se cortaba el sello de versión) */
.home-logo { width: 42px; height: auto; filter: drop-shadow(0 4px 14px #e8343f55); }
.home-brand h1 { font: 700 26px/1 var(--f-display); letter-spacing: .2px; white-space: nowrap; }
.home-brand h1 span { color: var(--brand-hi); }
.start-ver { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; font: 500 11px/1 var(--f-data); color: var(--muted); border: 1px solid var(--panel-border); border-radius: 6px; padding: 4px 6px; }
.home-bar-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 0; }
.home-clock, .home-wallet, .home-icon-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--panel-border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .15s, border-color .15s; white-space: nowrap;
}
.home-clock:hover, .home-wallet:hover, .home-icon-btn:hover { background: var(--raise); border-color: #ffffff33; }
.home-clock { padding: 0 6px 0 14px; }
.home-clock .clock-time { font-size: 17px; }
.home-clock .clock-band { padding: 4px 10px 4px 8px; font-size: 12.5px; }
.home-wallet .ico { width: 18px; height: 18px; color: var(--warn); }
.home-wallet-label { font-weight: 600; font-size: 14px; }
.shop-balance-mini { font: 700 15px/1 var(--f-data); color: var(--ok); }
.home-icon-btn .ico { width: 18px; height: 18px; }
.home-icon-btn span { font-size: 14px; font-weight: 600; }
.verif { width: 16px; height: 16px; flex: none; }
.home-icon-btn .verif { margin-left: -2px; }
.home-insta .verif { width: 15px; height: 15px; margin-left: -4px; }
.creator-launch { border-color: #3ad37f66; color: #bff0d3; }

/* 2.72.1 · Accesos secundarios: una sola cápsula con botones de icono (el nombre va en title) */
.home-quick {
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 0 3px; flex: none;
  border-radius: 999px; border: 1px solid var(--panel-border); background: var(--surface);
}
.home-quick .home-icon-btn {
  position: relative; justify-content: center; gap: 0; width: 38px; height: 38px; padding: 0;
  border: 0; background: transparent; color: #c9d2dc;
}
.home-quick .home-icon-btn:hover, .home-quick .home-icon-btn:focus-visible { background: var(--raise); color: #fff; }
.home-quick .home-icon-btn[hidden] { display: none; }
.home-quick .home-icon-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.home-quick .home-icon-btn .ico { width: 19px; height: 19px; }
.home-quick .home-icon-btn .verif { position: absolute; right: 4px; bottom: 5px; width: 12px; height: 12px; margin: 0; }
.home-quick .notif-dot { top: -3px; right: -3px; box-shadow: 0 0 0 2px var(--surface); }
.home-quick .creator-launch { color: #3ad37f; }

/* ---------- Pasos ---------- */
.home-main { width: min(100%, 1180px); margin: 0 auto; padding: 8px 0 24px; display: grid; align-content: center; }
.home[data-step="1"] .home-setup, .home[data-step="2"] .home-pick { display: none; }
.home-step { animation: homeIn .35s var(--ease); }
@keyframes homeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Paso 1 */
.home-pick { display: grid; gap: 22px; }
.home-hero { display: grid; gap: 10px; max-width: 760px; }
.home-hero h2 { font: 700 clamp(36px, 5.2vw, 60px)/1 var(--f-display); letter-spacing: -.4px; text-wrap: balance; }
.tagline { color: var(--muted); font-size: 17px; line-height: 1.45; max-width: 620px; }

.home-resume {
  justify-self: start; display: inline-flex; align-items: center; gap: 14px; min-height: 60px; padding: 8px 18px 8px 8px;
  border-radius: 16px; border: 1px solid #e8343f55; background: linear-gradient(90deg, #e8343f22, #e8343f08);
  color: var(--text); text-align: left; cursor: pointer; transition: background .15s, transform .15s var(--ease); max-width: 100%;
}
.home-resume:hover { background: linear-gradient(90deg, #e8343f38, #e8343f12); transform: translateY(-1px); }
.home-resume-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand); flex: none; }
.home-resume-ico .ico { width: 20px; height: 20px; fill: currentColor; }
.home-resume-text { display: grid; gap: 3px; min-width: 0; }
.home-resume-text small { font-size: 12px; color: #ffb3b8; font-weight: 600; letter-spacing: .3px; }
.home-resume-text b { font-size: 16px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.home-resume > .ico { width: 20px; height: 20px; flex: none; color: var(--muted); }

.home-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.mode-card {
  --c: var(--c-drive);
  position: relative; display: flex; flex-direction: column; gap: 10px; min-height: 250px; padding: 24px;
  border-radius: var(--radius-lg); border: 1px solid var(--panel-border); cursor: pointer; overflow: hidden;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--surface)) 0, var(--surface) 55%);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.mode-card[data-card="passenger"] { --c: var(--c-ride); }
.mode-card[data-card="control"] { --c: var(--c-control); }
.mode-card::after {
  content: ""; position: absolute; right: 22px; top: 26px; width: 22px; height: 22px; opacity: .45; transition: opacity .2s, transform .2s var(--ease);
  background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c) 60%, transparent); box-shadow: var(--shadow); }
.mode-card:hover::after, .mode-card:focus-visible::after { opacity: 1; transform: translateX(3px); color: var(--c); }
.mode-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; margin-bottom: 8px;
  background: color-mix(in srgb, var(--c) 22%, transparent); color: var(--c); }
.mode-icon .ico { width: 28px; height: 28px; }
.mode-card strong { font: 700 30px/1 var(--f-display); letter-spacing: .1px; }
.mode-card small { font-size: 15px; line-height: 1.45; color: #b3bcc8; }
.mode-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 8px; }
.mode-tags i { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: 999px; font: 600 12px/1 var(--f-body); font-style: normal;
  color: #d5dbe3; background: #ffffff0d; border: 1px solid #ffffff14; }
.mode-tags .ico { width: 14px; height: 14px; }

/* Paso 2 */
.home-setup { display: grid; gap: 20px; }
.setup-head { display: flex; align-items: center; gap: 14px; }
.setup-head h2 { font: 700 clamp(30px, 4vw, 44px)/1 var(--f-display); }
.home-back { display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 50%;
  border: 1px solid var(--panel-border); background: var(--surface); color: var(--text); cursor: pointer; }
.home-back:hover { background: var(--raise); }
.home-back .ico { width: 22px; height: 22px; }
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 24px; align-items: start; }
.setup-main { display: grid; gap: 22px; min-width: 0; }
.setup-block { display: grid; gap: 10px; min-width: 0; }
.setup-side { position: sticky; top: 84px; display: grid; gap: 14px; padding: 18px; border-radius: var(--radius-lg);
  background: var(--surface); border: 1px solid var(--panel-border); }

/* Qué se ve en cada modo / vehículo */
.home:not([data-home-mode="driver"]) .only-driver,
.home:not([data-home-mode="passenger"]) .only-passenger,
.home:not([data-home-mode="control"]) .only-control,
.home[data-home-mode="driver"][data-home-road="1"] .train-only,
.home:not([data-home-mode="driver"]) .bus-only,
.home[data-home-mode="driver"]:not([data-home-road="1"]) .bus-only { display: none !important; }
/* 2.41 · Teleférico: sin líneas, sentido ni tutorial; su propia ficha */
.home[data-home-mode="driver"][data-home-cable="1"] .train-only,
.home[data-home-mode="driver"][data-home-cable="1"] #lineCard,
.home[data-home-mode="driver"][data-home-cable="1"] #driverLock,
.home:not([data-home-mode="driver"]) .cable-only,
.home[data-home-mode="driver"]:not([data-home-cable="1"]) .cable-only { display: none !important; }
.home[data-home-mode="control"] .line-picker,
.home[data-home-mode="driver"]:not([data-home-vehicle="metro"]) .line-picker,
.home[data-home-mode="control"] #lineCard,
.home[data-home-mode="driver"][data-home-road="1"] #lineCard { display: none; }
.home[data-home-mode="driver"] .line-chip[data-line="NOS"], .home[data-home-mode="driver"] .line-chip[data-line="RAN"],
.line-chip[data-line="MER"] { display: none; }   /* 2.18 · el Metro Valparaíso (bonus) se elige con su botón de vehículo, no como línea */
.home:not([data-home-mode="driver"]) #busDriverNote,
.home:not([data-home-mode="driver"]) #driverLock, .home[data-home-mode="driver"][data-home-road="1"] #driverLock { display: none !important; }

/* Vehículo */
.vehicle-tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.vehicle-tiles button {
  display: grid; justify-items: start; gap: 4px; min-height: 104px; padding: 14px; border-radius: 14px; text-align: left;
  border: 1px solid var(--panel-border); background: var(--surface); color: var(--text); cursor: pointer;
  transition: border-color .15s, background .15s;
}
.vehicle-tiles button:hover { border-color: #ffffff33; background: var(--raise); }
.vehicle-tiles .ico { width: 26px; height: 26px; margin-bottom: 4px; color: var(--muted); }
.vehicle-tiles b { font: 700 19px/1.05 var(--f-display); letter-spacing: .2px; }
.vehicle-tiles span { font-size: 12.5px; color: var(--muted); line-height: 1.3; }
.vehicle-tiles button[aria-checked="true"] { border-color: var(--brand); background: linear-gradient(160deg, #e8343f26, var(--surface) 70%); box-shadow: inset 0 0 0 1px var(--brand); }
.vehicle-tiles button[aria-checked="true"] .ico { color: var(--brand-hi); }

/* Líneas */
.line-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 8px; }
.line-chip {
  position: relative; height: 50px; border-radius: 12px; border: 1px solid var(--panel-border); background: var(--surface);
  color: var(--text); font: 700 19px/1 var(--f-display); cursor: pointer; transition: background .15s, box-shadow .15s, transform .15s var(--ease);
}
.line-chip::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 7px; height: 3px; border-radius: 2px; background: var(--c); }
.line-chip:hover { background: var(--raise); transform: translateY(-1px); }
.line-chip[aria-checked="true"] { background: var(--c); color: var(--on-c); border-color: transparent; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--c); }
.line-chip[aria-checked="true"]::after { display: none; }
.bus-chips { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
.bus-chip { font-size: 17px; }
.bus-chips.taxi-chips { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.taxi-chips .bus-chip { display: grid; place-content: center; gap: 2px; height: auto; min-height: 50px; padding: 6px 10px 14px; font-size: 15px; line-height: 1.1; }
.taxi-chips .bus-chip small { font: 600 11.5px/1.1 var(--f-body, inherit); opacity: .75; }
/* 2.38 · Buscador de recorridos (bus) y calles (taxi) */
.bus-search { margin-bottom: 12px; }
.bus-search input { scroll-margin-top: 84px; }
.bus-search input {
  width: 100%; box-sizing: border-box; height: 48px; padding: 0 14px 0 42px; border-radius: 12px; border: 1px solid var(--panel-border);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 14px 50% / 18px;
  color: var(--text); font: 600 16px var(--f-body, inherit); outline: none; transition: border-color .15s, box-shadow .15s;
}
.bus-search input::placeholder { color: var(--muted); font-weight: 500; }
.bus-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px #e8343f33; }
.bus-results {
  max-height: min(300px, 55vh); overflow-y: auto; overscroll-behavior: contain; margin: 6px 0 0; padding: 6px;
  list-style: none; border-radius: 12px; border: 1px solid var(--panel-border); background: var(--surface);
}
.bus-hit { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 9px; cursor: pointer; }
.bus-hit:hover, .bus-hit.active { background: var(--raise); }
.bus-hit[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--c); }
.bus-hit-tag { flex: none; min-width: 48px; padding: 6px 7px; border-radius: 8px; background: var(--c); color: var(--on-c); font: 700 15px/1 var(--f-display); text-align: center; }
.bus-hit-tag.taxi { font-size: 12px; }
.bus-hit span { display: grid; gap: 2px; min-width: 0; }
.bus-hit strong { color: var(--text); font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bus-hit small { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bus-hit em { font-style: normal; color: var(--text); }
.bus-hit-note { padding: 8px 10px; color: var(--muted); font-size: 12.5px; }
.bus-recent-label { display: block; margin-bottom: 6px; opacity: .8; }

/* Clima (plegable) */
.setup-more { border-radius: 12px; border: 1px solid var(--panel-border); background: #ffffff05; }
.setup-more summary { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 14px; cursor: pointer; list-style: none; }
.setup-more summary::-webkit-details-marker { display: none; }
.setup-more summary::after { content: "Cambiar"; margin-left: auto; font-size: 13px; font-weight: 600; color: var(--focus); }
.setup-more[open] summary::after { content: "Listo"; }
.setup-more .weather-now { font-size: 13px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.setup-more .seg { margin: 0 12px 12px; }

/* Centro de Control */
.control-intro { padding: 18px; border-radius: 14px; background: linear-gradient(160deg, #6c9bff1c, transparent 70%); border: 1px solid #6c9bff33; }
.control-intro p { font-size: 15px; line-height: 1.5; color: #c9d1dc; }
.control-intro ul { display: grid; gap: 8px; margin-top: 6px; list-style: none; }
.control-intro li { position: relative; padding-left: 24px; font-size: 14.5px; }
.control-intro li::before { content: ""; position: absolute; left: 2px; top: 5px; width: 12px; height: 7px; border-left: 2px solid var(--c-control); border-bottom: 2px solid var(--c-control); transform: rotate(-45deg); }

/* Enlaces de texto (tutorial, multijugador) */
.home-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 2px; border: 0; background: none;
  color: var(--muted); font-size: 14px; font-weight: 600; cursor: pointer; text-align: left; justify-self: start; }
.home-link:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.home-link .ico { width: 18px; height: 18px; flex: none; }

/* Ficha de la línea (columna derecha) */
.line-card { display: grid; gap: 10px; }
.line-card-badge { justify-self: start; padding: 5px 10px; border-radius: 8px; background: var(--line); color: var(--on-line); font: 700 14px/1 var(--f-display); letter-spacing: .4px; }
.line-card-route { font: 600 20px/1.15 var(--f-display); letter-spacing: .3px; text-wrap: balance; }
.line-card-map { position: relative; height: 16px; margin: 4px 6px 0; }
.line-card-bar { position: absolute; left: -6px; right: -6px; top: 6px; height: 4px; border-radius: 2px; background: var(--line); }
.line-card-map i { position: absolute; top: 4px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--bg); border: 2px solid #fff; }
.line-card-map i.combo { top: 2px; width: 12px; height: 12px; margin-left: -6px; border-width: 3px; }
.line-card-ends { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.line-card-facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: space-between; gap: 8px; padding: 12px 0; border-block: 1px solid var(--hair); }
.line-card-facts div { display: grid; gap: 5px; }
.line-card-facts dd { font: 700 18px/1 var(--f-data); }
.line-card-text { font-size: 13px; line-height: 1.5; color: var(--muted); }
.line-card-text:empty { display: none; }
.home-bus-note { font-size: 14px; line-height: 1.55; color: #c9d1dc; }
.home-bus-note kbd { margin: 0 1px; }
body.touch-mode .keys-only { display: none; }

.setup-go { display: grid; gap: 6px; }
.go-big { width: 100%; min-height: 56px; font-size: 18px; border-radius: 14px; }
.setup-go .home-link { justify-self: center; }
/* 2.44 · Al azar: elige línea, recorrido o calle (no parte el turno) */
.random-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 44px; padding: 0 14px;
  border-radius: 12px; border: 1px dashed var(--panel-border); background: none; color: var(--text); font: 600 15px var(--f-body, inherit); white-space: nowrap; cursor: pointer;
  transition: border-color .15s, background .15s; }
.random-button:hover { border-color: var(--brand); background: var(--raise); }
.random-button .ico { width: 20px; height: 20px; flex: none; }
.random-button.rolling .ico { animation: dice-roll .45s var(--ease, ease-out); }
@keyframes dice-roll { from { transform: rotate(-200deg) scale(.7); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .random-button.rolling .ico { animation: none; } }

/* ---------- Pie ---------- */
.home-foot { width: min(100%, 1180px); margin: 0 auto; }
a.home-icon-btn { text-decoration: none; }
.home-insta { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.home-insta b { color: #fff; font-weight: 600; }
.home-author { display: flex; align-items: center; gap: 8px; width: fit-content; margin-bottom: 8px; color: var(--muted); font-size: 13px; text-decoration: none; }
.home-author b { color: #fff; font-weight: 600; }
.home-author:hover b, .home-author:focus-visible b { text-decoration: underline; }
.home-about { display: block; margin-bottom: 8px; color: var(--muted); font-size: 13px; }
.home-about:hover, .home-about:focus-visible { color: #fff; }
.home-seo a { color: inherit; }
.home-seo a:hover, .home-seo a:focus-visible { color: #fff; }
.home-insta:hover b, .home-insta:focus-visible b { text-decoration: underline; }
.start-note.disclaimer { font-size: 11.5px; line-height: 1.5; color: var(--dim); }

/* ---------- Pantallas medianas y celular ---------- */
@media (max-width: 1020px) {
  .vehicle-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vehicle-tiles button { min-height: 0; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
  .vehicle-tiles .ico { grid-row: span 2; margin: 0; }
}
@media (max-width: 860px) {
  .home-modes { grid-template-columns: minmax(0, 1fr); }
  .mode-card { min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr); column-gap: 16px; row-gap: 4px; padding: 18px 46px 18px 18px; }
  .mode-card::after { top: 50%; margin-top: -11px; right: 16px; }
  .mode-icon { grid-row: span 3; width: 52px; height: 52px; margin: 0; }
  .mode-card strong { font-size: 24px; }
  .mode-card small { font-size: 14px; }
  .mode-tags { padding-top: 4px; }
  .setup-grid { grid-template-columns: minmax(0, 1fr); }
  .setup-side { position: static; }
  .home-wallet-label, .home-icon-btn span, .start-ver { display: none; }
}
@media (max-width: 560px) {
  .home-brand h1 { font-size: 22px; }
  .home-logo { width: 34px; }
  .home-clock .clock-band b, .home-clock .clock-band span { display: none; }
  .home-clock .clock-band { padding: 6px; }
  .home-clock, .home-wallet { padding: 0 10px; gap: 8px; }
  .home-bar { flex-wrap: wrap; }
  .home-bar-tools { flex-wrap: wrap; justify-content: flex-end; }
  .home-hero h2 { font-size: 34px; }
  .tagline { font-size: 15px; }
  .mode-tags { display: none; }
  /* El botón de jugar queda siempre a mano, abajo */
  .setup-side { padding: 14px; }
  .setup-go { position: sticky; bottom: 0; margin: 0 -14px -14px; padding: 12px 14px max(12px, env(safe-area-inset-bottom)); border-radius: 0 0 var(--radius-lg) var(--radius-lg); background: var(--surface); }
}
/* Celular en horizontal: todo más bajo y los modos lado a lado */
@media (max-height: 520px) and (orientation: landscape) {
  /* 2.44 · «Al azar» al lado del botón de partir, para que este no quede cortado */
  .setup-go { grid-template-columns: auto 1fr; }
  .setup-go > * { grid-column: 1 / -1; }
  .setup-go > .random-button { grid-column: 1; width: auto; min-height: 0; }
  .setup-go > .random-button ~ .go-big { grid-column: 2; }
  .home-bar { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: 8px; }
  .home-main { align-content: start; padding-top: 0; }
  .home-pick { gap: 12px; }
  .home-hero .eyebrow, .tagline { display: none; }
  .home-hero h2 { font-size: 30px; }
  .home-resume { min-height: 48px; padding-block: 4px; }
  .home-resume-ico { width: 38px; height: 38px; }
  .home-modes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .mode-card { display: flex; min-height: 0; padding: 14px; gap: 6px; }
  .mode-card::after { top: 18px; right: 14px; margin: 0; }
  .mode-icon { width: 40px; height: 40px; border-radius: 12px; margin-bottom: 2px; }
  .mode-icon .ico { width: 22px; height: 22px; }
  .mode-card strong { font-size: 22px; }
  .mode-card small { font-size: 12.5px; line-height: 1.35; }
  .mode-tags { display: none; }
  .home-setup { gap: 12px; }
  .setup-head h2 { font-size: 26px; }
  .setup-head .eyebrow { display: none; }
  .home-back { width: 42px; height: 42px; }
  .setup-grid { grid-template-columns: minmax(0, 1fr) minmax(240px, 300px); gap: 14px; }
  .setup-side { position: sticky; top: 64px; padding: 14px; }
  .setup-main { gap: 14px; }
  .line-card-text { display: none; }
  .vehicle-tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
  .vehicle-tiles button { display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 3px; padding: 9px 8px; min-height: 0; }
  .vehicle-tiles .ico { grid-row: auto; width: 20px; height: 20px; margin: 0 0 2px; flex: none; }
  .vehicle-tiles b { font-size: 14.5px; }
  .vehicle-tiles span { font-size: 10.5px; line-height: 1.25; }
  .line-chip { height: 42px; }
  .go-big { min-height: 48px; }
  .home-wallet-label, .home-icon-btn span, .start-ver { display: none; }
}

/* ---------- Ajustes finos ---------- */
.home:not([data-home-mode="driver"]) .chip-lock { display: none; }
.home-main { align-content: start; padding-top: clamp(8px, 6vh, 64px); }
.setup-more { display: block; }
.home-bus-note { padding: 0; border: 0; background: none; text-align: left; }
@media (max-width: 560px) {
  #directionSeg button span { white-space: normal; }
  .setup-more summary { flex-wrap: wrap; row-gap: 2px; padding-block: 8px; }
  .setup-more .weather-now { white-space: normal; flex: 1 1 100%; order: 3; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .home-main { padding-top: 0; }
  .line-card-map, .line-card-ends { display: none; }
  .line-card { gap: 6px; }
  .line-card-route { font-size: 16px; }
  .line-card-facts { padding: 6px 0; }
  .line-card-facts dd { font-size: 15px; }
  .setup-side { gap: 8px; }
  .setup-go .home-link { min-height: 32px; }
  #directionSeg button span { white-space: normal; }
}
.home-bus-note .keys-only { display: block; margin-top: 6px; color: var(--muted); }

/* ---------- 2.30 · Portada en vivo (js/homeLive.js) ---------- */
.home-live { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0; transition: opacity 1.2s var(--ease); }
.home.live .home-live { opacity: 1; }
.home-live-canvas { display: block; width: 100%; height: 100%; }
/* Velo para que el texto se lea: más oscuro abajo (tarjetas) y a la izquierda (título) */
.home-live::after {
  content: ""; position: absolute; inset: 0;
  background:
    linear-gradient(90deg, #070b10b3 0, #070b1040 55%, transparent 100%),
    linear-gradient(180deg, #070b1080 0, #070b1022 28%, #070b1066 55%, #070b10e6 100%);
  transition: background .3s;
}
.home[data-step="2"] .home-live::after { background: linear-gradient(180deg, #070b10b3 0, #070b10cc 40%, #070b10f0 100%); }
.home.live .home-main, .home.live .home-foot { position: relative; z-index: 1; }
.home.live .home-bar { background: linear-gradient(#070b10cc 55%, transparent); }
.home.live .home-hero h2, .home.live .tagline { text-shadow: 0 2px 18px #000a; }
.home.live .tagline { color: #c7d0db; }
.home.live .mode-card { background: linear-gradient(160deg, color-mix(in srgb, var(--c) 18%, #0d141ce6) 0, #0d141ceb 55%); backdrop-filter: blur(6px); }

/* ---------- 2.30 · «N jugando ahora» (js/online.js) ---------- */
.home-online {
  justify-self: start; display: inline-grid; grid-template-columns: auto auto 1fr; align-items: center; column-gap: 7px; row-gap: 2px; max-width: 100%;
  padding: 7px 14px 7px 12px; border-radius: 999px; border: 1px solid #3ad37f40; background: #0b1a14cc; backdrop-filter: blur(6px);
  font-size: 14px; color: #d9f5e6; animation: homeIn .4s var(--ease);
}
.home-online[hidden] { display: none; }
.home-online b { font: 700 16px/1 var(--f-data); color: #6ff0a8; }
.home-online small { grid-column: 2 / -1; font-size: 12px; color: #9fc7b2; }
.home-online small:empty { display: none; }
.home-online-dot { width: 10px; height: 10px; border-radius: 50%; background: #3ad37f; box-shadow: 0 0 0 0 #3ad37f99; animation: onlinePulse 2s infinite; flex: none; }
@keyframes onlinePulse { 0% { box-shadow: 0 0 0 0 #3ad37f99; } 70% { box-shadow: 0 0 0 8px #3ad37f00; } 100% { box-shadow: 0 0 0 0 #3ad37f00; } }
@media (prefers-reduced-motion: reduce) { .home-online-dot { animation: none; } .home-live { transition: none; } }

/* ---------- 2.46 · Reto de un amigo (js/compartir.js) ---------- */
.home-challenge {
  --g: #ffd23f;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: 10px; max-width: 560px;
  padding: 8px 8px 8px 10px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--g) 45%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--g) 16%, #0d141c) 0, #0d141ce6 70%); backdrop-filter: blur(6px);
  animation: homeIn .4s var(--ease);
}
.home-challenge[hidden] { display: none; }
.home-challenge[data-grade="A"] { --g: #34d17c; }
.home-challenge[data-grade="B"] { --g: #5cc8ff; }
.home-challenge[data-grade="C"] { --g: #ffb547; }
.home-challenge[data-grade="D"] { --g: #ff6b6b; }
.home-challenge-grade { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--g); color: var(--g);
  font: 700 24px/1 var(--f-display, "Barlow Condensed", sans-serif); transform: rotate(-6deg); }
.home-challenge-text { display: grid; gap: 1px; min-width: 0; }
.home-challenge-text small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--g); }
.home-challenge-text b { font-size: 15px; color: #fff; overflow-wrap: anywhere; }
.home-challenge .go-button { padding: 8px 14px; min-height: 0; }
.home-challenge-close { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: #9fb0c2; cursor: pointer; }
.home-challenge-close:hover { background: #ffffff14; color: #fff; }
.home-challenge-close .ico { width: 18px; height: 18px; }

/* 2.41 · Teleférico en la portada */
#cableCard { --line: #2f9e5b; --on-line: #fff; }
.cable-badge { display: inline-grid; place-items: center; padding: 4px 9px; }
.cable-badge .ico { width: 20px; height: 20px; }
#cableCard .line-card-map i { background: #fff; border-color: #2f9e5b; }
.cable-ride-box { display: grid; grid-template-columns: auto 1fr; gap: 10px 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius-lg, 14px);
  background: linear-gradient(160deg, #2f9e5b22, var(--surface) 70%); border: 1px solid #2f9e5b66; }
.cable-ride-ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #2f9e5b; color: #fff; }
.cable-ride-ico .ico { width: 26px; height: 26px; }
.cable-ride-text { display: grid; gap: 3px; min-width: 0; }
.cable-ride-text b { font: 700 17px/1.15 var(--f-display); }
.cable-ride-text small { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.cable-ride-box select { grid-column: 1 / -1; }
.cable-ride-box .go-button { grid-column: 1 / -1; justify-content: center; background: #2f9e5b; border-color: #2f9e5b; }
/* ---------- 2.62 · Easter egg: créditos ocultos (js/creditos.js) ---------- */
.secret-credits {
  position: fixed; inset: 0; z-index: 9999; overflow: hidden; cursor: pointer;
  background: radial-gradient(ellipse at 50% 120%, #1a0d10 0%, #05070a 65%);
  color: var(--text); text-align: center; animation: secretIn .5s ease-out;
}
.secret-credits.leaving { animation: secretOut .4s ease-in forwards; }
.secret-credits::before {            /* estrellas */
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: radial-gradient(1px 1px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 78% 34%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 70%, #fff, transparent), radial-gradient(1px 1px at 88% 82%, #fff, transparent),
    radial-gradient(1px 1px at 25% 88%, #fff, transparent), radial-gradient(1.5px 1.5px at 62% 12%, #fff, transparent);
}
.secret-roll {
  position: absolute; left: 50%; top: 100%; width: min(560px, calc(100% - 32px)); transform: translateX(-50%);
  animation: secretRoll 42s linear forwards;
}
.secret-logo { width: 96px; height: 96px; margin-bottom: 18px; }
.secret-h { font: 800 44px/1.1 var(--f-body); margin: 0 0 6px; color: var(--brand-hi); letter-spacing: .5px; }
.secret-h2 { font: 800 32px/1.2 var(--f-body); margin: 0; color: #ffd23f; }
.secret-k { font: 600 13px/1.4 var(--f-data); text-transform: uppercase; letter-spacing: 2.5px; color: var(--muted); margin: 0 0 8px; }
.secret-n { font: 700 24px/1.3 var(--f-body); margin: 0 0 4px; }
.secret-p { font: 400 16px/1.5 var(--f-body); margin: 0; color: #d6dbe2; }
.secret-s { font: italic 400 15px/1.6 var(--f-body); margin: 0; color: var(--dim); }
.secret-gap { height: 56px; }
.secret-lines { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.secret-lines span { font: 800 14px/1 var(--f-data); color: #fff; padding: 7px 10px; border-radius: 999px; min-width: 34px; }
.secret-hint { position: absolute; left: 0; right: 0; bottom: 0; padding: 28px 0 14px; background: linear-gradient(#05070a00, #05070a 55%); font: 500 12px/1 var(--f-data); color: var(--dim); }
@keyframes secretRoll { from { transform: translate(-50%, 0); } to { transform: translate(-50%, calc(-100% - 100vh)); } }
@keyframes secretIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes secretOut { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .secret-roll { animation-duration: 90s; } }
