/* ==========================================================================
   RedMoviSim 2.0 · ui.css — sistema de diseño
   Se carga DESPUÉS de styles.css: redefine la paleta y las piezas comunes
   (botones, campos, selectores segmentados, chips de hora y tarifa), así todo
   el juego toma el estilo nuevo. Identidad propia de RedMoviSim (rojo de la
   marca + grafito); el color de la línea (--line) solo marca lo que es de esa
   línea o recorrido.
   ========================================================================== */

:root {
  /* Superficies (de atrás hacia adelante) */
  --bg: #090c11;
  --surface: #11151c;
  --raise: #1a2029;
  --raise-2: #222a35;
  --panel: #0e1218eb;
  --panel-border: #ffffff1c;
  --hair: #ffffff12;
  /* Texto */
  --text: #f1f4f8;
  --muted: #9ba5b3;
  --dim: #626c7a;
  /* Marca RedMoviSim */
  --brand: #e8343f;
  --brand-hi: #ff5560;
  --brand-soft: #e8343f24;
  --on-brand: #fff;
  /* Acentos de cada modo de juego */
  --c-drive: #ff5560;
  --c-ride: #2fc6a2;
  --c-control: #6c9bff;
  /* Estados */
  --ok: #3ad37f;
  --warn: #ffc247;
  --emergency: #ff4d4d;
  --focus: #8ccaff;
  /* Forma */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px #00000073;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

[hidden] { display: none !important; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}
.eyebrow { color: var(--brand-hi); }

/* ---------- Botones ---------- */
.go-button, .ghost-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 10px;
  font: 600 15px/1 var(--f-body); letter-spacing: .1px; cursor: pointer;
  transition: background .15s, border-color .15s, transform .15s var(--ease), filter .15s;
}
.go-button { border: 0; background: var(--brand); color: var(--on-brand); box-shadow: 0 6px 18px #e8343f40; }
.go-button:hover { background: var(--brand-hi); filter: none; }
.go-button:active { transform: translateY(1px); }
.go-button:disabled { opacity: .55; cursor: default; box-shadow: none; }
.ghost-button { border: 1px solid var(--panel-border); background: transparent; color: var(--text); }
.ghost-button:hover { background: var(--raise); }
.go-button .ico, .ghost-button .ico { width: 18px; height: 18px; }

/* ---------- Campos ---------- */
.field { display: grid; gap: 8px; min-width: 0; }
.field select, .field input, .net-join input {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--panel-border); background: var(--surface); color: var(--text); font-size: 15px;
  text-overflow: ellipsis;
}
.field select { appearance: none; padding-right: 40px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ba5b3' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; }
.field select:hover, .field input:hover { border-color: #ffffff33; }

/* ---------- Selector segmentado (Ida/Vuelta, clima, tipo de día) ---------- */
.seg { display: flex; min-width: 0; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--panel-border); }
.seg button {
  flex: 1; min-width: 0; min-height: 44px; padding: 6px 12px; display: grid; gap: 2px; align-content: center; text-align: left;
  border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; transition: background .15s, color .15s;
}
.seg button + button { border-left: 0; }
.seg button:hover { background: #ffffff0a; color: var(--text); }
.seg button b { font: 600 14px/1.2 var(--f-body); color: inherit; }
.seg button span { font-size: 12px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--raise-2); color: var(--text); box-shadow: inset 0 0 0 1px #ffffff1f; }
.weather-seg button { justify-items: center; text-align: center; padding: 6px 2px; }
.weather-seg button b { font-size: 18px; line-height: 1; }
.weather-seg button span { font-size: 11.5px; max-width: 100%; }

/* ---------- Hora y tramo tarifario (portada y panel de tarifas) ---------- */
.clock-time { font: 700 30px/1 var(--f-data); font-variant-numeric: tabular-nums; }
.clock-band {
  --c: var(--muted); display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px 5px 9px;
  border: 1px solid color-mix(in srgb, var(--c) 50%, transparent); border-radius: 999px;
  background: color-mix(in srgb, var(--c) 12%, transparent); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.clock-band i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--c); }
.clock-band b { font-family: var(--f-data); font-size: 12px; color: var(--muted); }
.clock-band.punta { --c: #ff5a4f; }
.clock-band.valle { --c: var(--warn); }
.clock-band.baja { --c: var(--ok); }
.clock-band.closed { --c: var(--dim); }
.clock-band.changed { animation: clockPulse .9s ease-out; }
@keyframes clockPulse { 0% { transform: scale(1.12); } 100% { transform: none; } }
.clock-note { font-size: 12px; color: var(--muted); line-height: 1.35; }

/* ---------- Multijugador (unirse a una sala) ---------- */
.net-join { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 10px 12px; align-items: end; margin-top: 10px; }
#netCode { font-family: var(--f-data); letter-spacing: 4px; text-transform: uppercase; }
.net-msg { grid-column: 1 / -1; font-size: 13px; color: #ffd9a0; }
.net-msg:empty { display: none; }
.net-join small { grid-column: 1 / -1; color: var(--muted); font-size: 12.5px; line-height: 1.45; }
@media (max-width: 560px) { .net-join { grid-template-columns: minmax(0, 1fr) 100px; } .net-join .go-button { grid-column: 1 / -1; } }
.net-badge {
  position: absolute; left: calc(18px + env(safe-area-inset-left)); top: calc(118px + env(safe-area-inset-top)); z-index: 6;
  padding: 4px 10px; border-radius: 999px; background: #0b1a12cc; border: 1px solid #3ad37f66; color: #bff0d3;
  font: 600 12px/1.3 var(--f-data); pointer-events: none; white-space: nowrap;
}
.touch-mode .net-badge { left: 50%; top: calc(12px + env(safe-area-inset-top)); transform: translateX(-50%); }
.net-badge.off { background: #2a1a0ccc; border-color: #ffb02066; color: #ffd9a0; }

/* Licencia que falta para conducir una línea */
.mode-lock { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; font-size: 13.5px; line-height: 1.4;
  color: #ffe1b0; background: #ffc2470f; border: 1px solid #ffc24740; }
.mode-lock .ico { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.chip-lock { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; opacity: .8; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 2.11 · Tu cuenta (inicio con código al correo, partida en la nube) ---------- */
.account-panel { position: fixed; z-index: 80; }
.account-card { width: min(94vw, 420px); }
.account-body { display: grid; gap: 14px; }
.account-panel[data-view="conflict"] .ticket-close { visibility: hidden; }
.account-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-hi); }
.account-avatar .ico { width: 22px; height: 22px; }
.account-lead { margin: 0; font-size: 14.5px; line-height: 1.5; color: #c9d2dc; }
.account-lead b { color: var(--text); overflow-wrap: break-word; }
.account-fine { margin: 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.account-form { display: grid; gap: 12px; }
.account-form input { width: 100%; }
.account-code { text-align: center; font: 700 30px/1 var(--f-data) !important; letter-spacing: 12px; padding-left: 24px !important; }
.account-main { min-height: 48px; font-size: 16px; }
.account-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.link-button { padding: 4px 0; border: 0; background: none; color: var(--muted); font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-button:hover { color: var(--text); }
.link-button.danger { justify-self: start; color: #ff8a8a; }
.go-button.danger { background: #c62828; box-shadow: none; }
.account-who { display: grid; gap: 4px; padding: 12px 14px; border-radius: 12px; background: var(--raise); }
.account-who b { font-size: 16px; overflow-wrap: break-word; }
.account-sync { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #c9d2dc; }
.account-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 4px #3ad37f26; }
.account-sync.warn .account-dot { background: var(--warn); box-shadow: 0 0 0 4px #ffc24726; }
.account-choice { display: grid; width: 100%; gap: 6px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--panel-border); background: #ffffff08; color: var(--text); text-align: left; cursor: pointer; }
.account-choice:hover { background: var(--raise); border-color: var(--brand); }
.account-choice b { font: 600 15px/1.35 var(--f-data); }
.account-panel.busy .account-main, .account-panel.busy .account-choice { opacity: .55; pointer-events: none; }
/* 2.32 · casilla del boletín de novedades */
.account-opt { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: #c9d2dc; cursor: pointer; }
.account-opt input { flex: none; width: 18px !important; height: 18px; margin: 1px 0 0; accent-color: var(--brand); cursor: pointer; }
.account-opt.loading { opacity: .55; }
.account-opt input:disabled { cursor: default; }
.account-launch.signed { border-color: #3ad37f66; }
.account-launch.signed .ico { color: var(--ok); }
@media (max-height: 480px) {
  .account-body { gap: 9px; }
  .account-card .account-fine { display: none; }
  .account-who { padding: 8px 12px; }
  .account-card .account-main, .account-card .ticket-actions button { min-height: 40px; }
}

/* ---------- 2.13 · Sugerencias y comentarios («RedMoviSim te escucha») ---------- */
.feedback-panel { position: fixed; z-index: 80; }
.feedback-card { width: min(94vw, 520px); max-height: min(92vh, 860px); overflow-y: auto; overscroll-behavior: contain; }
.feedback-body, .feedback-form { display: grid; gap: 14px; }
.feedback-field { display: grid; gap: 8px; min-width: 0; }
.feedback-field i, .feedback-form .small-label i { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--dim); }
.feedback-tipos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.feedback-tipos button { padding: 6px 8px; }
.feedback-form textarea {
  width: 100%; min-height: 120px; padding: 12px 14px; border-radius: 10px; resize: vertical;
  border: 1px solid var(--panel-border); background: var(--surface); color: var(--text); font: 15px/1.45 var(--f-body);
}
.feedback-form textarea:hover { border-color: #ffffff33; }
.feedback-form textarea:focus, .feedback-form input:focus, .feedback-form select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.feedback-count { justify-self: end; margin-top: -2px; font: 500 12px/1 var(--f-data); color: var(--muted); }
.feedback-count.short { color: var(--dim); }
.feedback-stars { display: flex; align-items: center; gap: 4px; }
.feedback-stars button { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: #ffffff33; cursor: pointer; }
.feedback-stars button:hover { background: #ffffff0a; color: #ffd36a99; }
.feedback-stars button .ico { width: 26px; height: 26px; }
.feedback-stars button.on { color: #ffc247; }
.feedback-stars button.on .ico { fill: currentColor; }
.feedback-stars-label { margin-left: 8px; font-size: 13.5px; color: var(--muted); }
.feedback-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.feedback-done { display: grid; justify-items: center; gap: 10px; padding: 8px 0 4px; text-align: center; }
.feedback-done b { font-size: 18px; }
.feedback-done-ico { display: grid; place-items: center; width: 60px; height: 60px; border-radius: 50%; background: #3ad37f22; color: var(--ok); }
.feedback-done-ico .ico { width: 32px; height: 32px; }
.feedback-panel.busy .account-main { opacity: .55; pointer-events: none; }
/* 2.60 · Notificaciones: la campana de la portada (js/notificaciones.js) */
.notif-launch { position: relative; }
.notif-launch.has-unread .ico { color: var(--warn); }
.notif-dot {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  display: grid; place-items: center; background: var(--brand); color: #fff; font: 700 11px/1 var(--f-data);
  box-shadow: 0 0 0 2px var(--bg);
}
@media (prefers-reduced-motion: no-preference) {
  .notif-launch.has-unread .ico { animation: notifRing 2.6s var(--ease) 1s 2; transform-origin: 50% 10%; }
}
@keyframes notifRing { 0%, 40%, 100% { transform: none; } 8% { transform: rotate(14deg); } 16% { transform: rotate(-12deg); } 24% { transform: rotate(8deg); } 32% { transform: rotate(-4deg); } }
.notif-panel { position: fixed; z-index: 80; }
.notif-card { width: min(94vw, 520px); max-height: min(92vh, 860px); overflow-y: auto; overscroll-behavior: contain; }
.notif-body, .notif-body section { display: grid; gap: 10px; }
.notif-body { gap: 16px; }
.notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.notif-item { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px; border-radius: 12px; border: 1px solid var(--panel-border); background: #ffffff06; }
.notif-item.unread { border-color: #e8343f66; background: #e8343f12; }
.notif-item b { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; font-size: 15.5px; }
.notif-item small { display: block; margin-top: 2px; font: 500 12px/1.2 var(--f-data); color: var(--muted); }
.notif-item p, .notif-item ul { margin: 6px 0 0; font-size: 14px; line-height: 1.45; color: var(--muted); }
.notif-item ul { padding-left: 18px; display: grid; gap: 3px; }
.notif-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #ffffff0d; color: var(--brand-hi); }
.notif-ico.news { color: var(--warn); }
.notif-ico .ico { width: 20px; height: 20px; }
.notif-new { font: 700 10.5px/1 var(--f-data); font-style: normal; letter-spacing: .06em; text-transform: uppercase; padding: 3px 6px; border-radius: 6px; background: var(--brand); color: #fff; }
.notif-link { display: inline-block; margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--brand-hi); }
.notif-push { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; border: 1px dashed #ffffff26; background: #ffffff06; }
.notif-push.on { border-style: solid; border-color: #3ad37f55; background: #3ad37f0f; }
.notif-push.on .notif-ico { color: var(--ok); }
.notif-push b { font-size: 15px; }
.notif-push p { margin: 3px 0 0; font-size: 13.5px; line-height: 1.4; color: var(--muted); }
.notif-push button { min-height: 40px; padding: 0 16px; white-space: nowrap; }
@media (max-width: 420px) { .notif-push { grid-template-columns: 36px minmax(0, 1fr); } .notif-push button { grid-column: 1 / -1; } }
.notif-old summary { cursor: pointer; list-style: revert; padding: 2px 0 8px; color: var(--muted); }
@media (max-height: 520px) and (orientation: landscape) {
  .notif-card { max-height: 94vh; padding: 14px 18px; }
  .notif-body { gap: 10px; }
  .notif-item { padding: 9px 10px; }
}
.home-feedback { margin-bottom: 4px; font-size: 13px; font-weight: 500; flex-wrap: wrap; column-gap: 6px; }
.home-feedback b { color: var(--brand-hi); font-weight: 600; }
@media (max-width: 560px) {
  .feedback-tipos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-height: 480px) {
  .feedback-body, .feedback-form { gap: 9px; }
  .feedback-card .account-fine, .feedback-body > .account-lead { display: none; }
  .feedback-form textarea { min-height: 72px; }
  .feedback-tipos button span { display: none; }
  .feedback-stars button { width: 34px; height: 34px; }
}

/* ==========================================================================
   2.33 · Mando (js/gamepad.js)
   ========================================================================== */
/* El botón «Mando» solo aparece con un mando conectado */
body:not(.pad-mode) .pad-launch, body:not(.pad-mode) .only-pad { display: none !important; }
/* Foco visible al moverse por los menús con la cruceta (también en pantallas táctiles) */
body .pad-focus:focus { outline: 3px solid var(--power) !important; outline-offset: 2px; box-shadow: 0 0 0 6px #5cc8ff33; }
/* Mientras se juega con el mando, se esconden los botones táctiles (vuelven al tocar la pantalla) */
body.pad-active .touch-ui, body.pad-active .bus-touch { display: none !important; }

.pad-toast {
  position: fixed; left: 50%; top: max(14px, env(safe-area-inset-top)); z-index: 10050;
  transform: translate(-50%, -140%); opacity: 0; pointer-events: none;
  max-width: min(560px, calc(100% - 32px)); padding: 9px 16px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--panel-border); color: var(--text);
  font-size: 14px; font-weight: 600; text-align: center; box-shadow: 0 8px 28px #0009;
  transition: transform .25s ease, opacity .25s ease;
}
.pad-toast.show { transform: translate(-50%, 0); opacity: 1; }

.pad-overlay {
  position: fixed; inset: 0; z-index: 10040; display: grid; place-items: center; padding: 16px;
  background: #02050acc; backdrop-filter: blur(4px);
}
.pad-card {
  width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--panel-border); border-radius: 14px; box-shadow: 0 20px 60px #000a;
}
.pad-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; border-bottom: 1px solid var(--hair); }
.pad-head strong { display: block; font: 700 22px/1.1 var(--f-display); }
.pad-close { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--panel-border); background: var(--raise); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.pad-close .ico { width: 18px; height: 18px; }
.pad-body { padding: 14px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.pad-status { font-weight: 600; }
.pad-hint, .pad-step-sub, .pad-step-n { color: var(--muted); font-size: 14px; }
.pad-test { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pad-test [data-b] {
  min-width: 40px; padding: 5px 8px; border-radius: 8px; text-align: center;
  font: 700 13px/1.2 var(--f-data); background: var(--raise); border: 1px solid var(--panel-border); color: var(--muted);
  transition: background .08s, color .08s;
}
.pad-test [data-b].on { background: var(--power); border-color: var(--power); color: #04121c; }
.pad-stick { position: relative; width: 44px; height: 44px; border-radius: 50%; background: var(--raise); border: 1px solid var(--panel-border); display: grid; place-items: center; }
.pad-stick i { width: 16px; height: 16px; border-radius: 50%; background: var(--power); }
.pad-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.pad-actions > * { flex: 1 1 200px; }
.pad-step { font: 700 26px/1.15 var(--f-display); }
.pad-help summary { cursor: pointer; font-weight: 600; padding: 4px 0; }
.pad-help h4 { margin: 10px 0 4px; font: 700 15px/1.2 var(--f-display); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.pad-help dl { display: grid; grid-template-columns: minmax(110px, auto) 1fr; gap: 3px 12px; font-size: 14px; }
.pad-help dt { font: 700 13px/1.5 var(--f-data); color: var(--power); }
@media (max-height: 460px) {
  .pad-body { gap: 8px; padding-block: 10px; }
  .pad-step { font-size: 22px; }
}

/* 2.69 · Mis estadísticas (js/stats.js) */
.stats-panel { position: fixed; z-index: 80; }
.stats-card { width: min(94vw, 560px); max-height: min(92vh, 860px); overflow-y: auto; overscroll-behavior: contain; }
.stats-since { display: block; margin-top: 2px; font: 500 12.5px/1.3 var(--f-data); color: var(--muted); }
.stats-body { display: grid; gap: 14px; }
.stats-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats-tile { display: grid; gap: 4px; padding: 12px; border-radius: 12px; border: 1px solid var(--panel-border); background: #ffffff06; min-width: 0; }
.stats-tile small { font: 600 11px/1.2 var(--f-data); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.stats-tile b { font: 700 22px/1.15 var(--f-data); overflow-wrap: anywhere; }
.stats-mode { display: grid; gap: 8px; padding: 12px; border-radius: 12px; border: 1px solid var(--panel-border); background: #ffffff04; }
.stats-mode h3 { margin: 0; font-size: 15.5px; }
.stats-rows { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin: 0; }
.stats-rows div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 4px 0; border-bottom: 1px solid #ffffff10; min-width: 0; }
.stats-rows dt { font-size: 13.5px; color: var(--muted); }
.stats-rows dd { margin: 0; font: 600 14px/1.2 var(--f-data); white-space: nowrap; }
.stats-grades { display: flex; flex-wrap: wrap; gap: 6px; }
.stats-grade { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 8px; background: #ffffff0b; font: 600 13px/1 var(--f-data); }
.stats-grade b { font-weight: 800; }
.stats-grade.zero { opacity: .4; }
.stats-grade.g-S b { color: #ffd23f; }
.stats-grade.g-A b { color: #34d17c; }
.stats-grade.g-B b { color: #5cc8ff; }
.stats-grade.g-C b { color: #ffb547; }
.stats-grade.g-D b { color: #ff6b6b; }
.stats-note { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
@media (min-width: 520px) { .stats-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } .stats-tile b { font-size: 17px; } }
@media (max-width: 420px) { .stats-rows { grid-template-columns: minmax(0, 1fr); } }
@media (max-height: 520px) { .stats-card { max-height: 94vh; padding: 14px 18px; } }

/* 2.70 · Wrapped: tu año en RedMoviSim (js/wrapped.js)
   Con el lenguaje del juego: el panel del informe de turno (franja de color arriba), el letrero
   de estación, la boleta y el timbre de la nota. El avance es una línea de Metro con un tren
   que va de estación en estación; cada diapositiva tiene su animación. */
.home-icon-btn.wrapped-launch { border-color: transparent; background: linear-gradient(120deg, #e8343f, #9b26b6 55%, #1d3f95); color: #fff; }
.home-icon-btn.wrapped-launch:hover { filter: brightness(1.12); background: linear-gradient(120deg, #e8343f, #9b26b6 55%, #1d3f95); }
.home-icon-btn.wrapped-launch .ico { fill: #ffd23f; stroke: #ffd23f; }
.wrapped-launch.fresh { position: relative; animation: wr-pulse 2.4s ease-in-out infinite; }
.wrapped-launch.fresh::after { content: ""; position: absolute; top: 2px; right: 2px; width: 10px; height: 10px; border-radius: 50%; background: #ffd23f; box-shadow: 0 0 0 2px var(--bg); }
@keyframes wr-pulse { 0%, 100% { box-shadow: 0 0 0 0 #e8343f00; } 50% { box-shadow: 0 0 0 6px #e8343f55; } }

.wrapped { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden;
  background: var(--bg); color: var(--text); --wa: #e8343f; --wa-on: #fff; user-select: none; -webkit-user-select: none; }
.wrapped.hidden { display: none; }
.wrapped .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Túnel: resplandor del color de la diapositiva y luces que pasan */
.wr-tunnel { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 60% at 50% 0%, color-mix(in srgb, var(--wa) 30%, transparent), transparent 70%),
              radial-gradient(90% 50% at 50% 110%, color-mix(in srgb, var(--wa) 18%, transparent), transparent 70%); transition: background .6s; }
.wr-tunnel i { position: absolute; left: 0; right: 0; height: 3px; opacity: .3; filter: blur(.5px);
  background: repeating-linear-gradient(90deg, transparent 0 160px, #fff 160px 240px); animation: wr-lights .55s linear infinite; }
.wr-tunnel i:first-child { top: 16%; }
.wr-tunnel i:last-child { bottom: 12%; animation-duration: .4s; opacity: .18; }
@keyframes wr-lights { to { background-position: -240px 0; } }

/* Arriba: marca, cerrar y el recorrido */
.wr-top { position: relative; z-index: 2; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px 12px;
  padding: max(10px, env(safe-area-inset-top)) 16px 0; }
.wr-brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.wr-brand img { width: 30px; height: 20px; }
.wr-brand b { font: 700 20px/1 var(--f-display); white-space: nowrap; }
.wr-brand b span { color: var(--brand-hi); }
.wr-year { font: 500 11px/1 var(--f-data); color: var(--muted); border: 1px solid var(--panel-border); border-radius: 6px; padding: 4px 6px; white-space: nowrap; text-transform: uppercase; }
.wr-close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--panel-border); background: var(--surface); color: var(--text); cursor: pointer; }
.wr-close:hover { background: var(--raise); }
.wr-route { grid-column: 1 / -1; position: relative; height: 34px; margin: 0 12px; }
.wr-rail, .wr-rail-done, .wr-seg { position: absolute; top: 24px; height: 6px; border-radius: 3px; transform: translateY(-50%); }
.wr-rail { left: 0; right: 0; background: #ffffff1a; }
.wr-rail-done { left: 0; background: var(--wa); transition: width .9s var(--ease), background .6s; }
.wr-seg { overflow: hidden; }
.wr-seg-fill { display: block; width: 0; height: 100%; background: color-mix(in srgb, var(--wa) 55%, #ffffff); animation: wr-fill var(--wr-ms, 7500ms) linear forwards; }
.wrapped.paused .wr-seg-fill { animation-play-state: paused; }
@keyframes wr-fill { to { width: 100%; } }
.wr-stop { position: absolute; top: 24px; width: 12px; height: 12px; border-radius: 50%; transform: translate(-50%, -50%); background: var(--bg); border: 3px solid #ffffff40; transition: border-color .4s, background .4s, transform .4s; }
.wr-stop.done { border-color: var(--wa); background: var(--wa); }
.wr-stop.on { border-color: #fff; background: var(--wa); transform: translate(-50%, -50%) scale(1.35); }
.wr-train { position: absolute; top: 0; display: grid; place-items: center; width: 28px; height: 18px; border-radius: 6px 6px 3px 3px; transform: translateX(-50%);
  background: var(--wa); color: var(--wa-on); box-shadow: 0 4px 12px #0008; transition: left .9s var(--ease), background .6s; }
.wr-train .ico { width: 14px; height: 14px; }
.wr-train.moving { animation: wr-bob .15s ease-in-out 6 alternate; }
@keyframes wr-bob { to { transform: translateX(-50%) translateY(-2px); } }

/* La diapositiva: panel del juego con letrero de estación */
.wr-stage { position: relative; z-index: 1; display: grid; place-items: center; min-height: 0; padding: 12px 16px; cursor: pointer; touch-action: manipulation; }
.wr-card { position: relative; width: min(100%, 520px); max-height: 100%; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  border: 1px solid var(--panel-border); border-top: 4px solid var(--wa); border-radius: 14px; background: var(--surface); box-shadow: 0 30px 80px #000c;
  animation: wr-cardIn .55s cubic-bezier(.2, .9, .3, 1.1) both; }
@keyframes wr-cardIn { from { opacity: 0; transform: translateX(48px) scale(.96); } }
.wr-sign { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: #1d2228; border-bottom: 6px solid var(--wa); }
.wr-sign-n { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 8px; background: var(--wa); color: var(--wa-on); font: 700 22px/1 var(--f-display); animation: wr-pop .45s cubic-bezier(.3, 1.7, .5, 1) .15s both; }
.wr-sign div { display: grid; gap: 3px; min-width: 0; }
.wr-sign small { font: 600 11px/1.2 var(--f-data); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.wr-sign b { font: 700 26px/1.05 var(--f-display); color: #fff; overflow-wrap: anywhere; }
.wr-body { display: grid; gap: 12px; padding: 18px 18px 20px; }
.wr-body > * { margin: 0; min-width: 0; }
.rise { opacity: 0; animation: wr-rise .6s var(--ease) var(--d, 0s) forwards; }
@keyframes wr-rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes wr-pop { from { opacity: 0; transform: scale(.3); } to { opacity: var(--o, 1); transform: none; } }

.wr-huge { font: 700 clamp(54px, 15vw, 92px)/.92 var(--f-display); text-transform: uppercase; letter-spacing: -.01em; }
.wr-big { font: 700 clamp(34px, 9vw, 52px)/1 var(--f-display); overflow-wrap: anywhere; }
.wr-num { font: 700 clamp(46px, 13vw, 72px)/1 var(--f-data); font-variant-numeric: tabular-nums; letter-spacing: -.03em; word-spacing: -.3em; }
.wr-lead { font: 600 18px/1.35 var(--f-body); }
.wr-lead .wr-count { font: 700 1.1em/1 var(--f-data); color: #fff; }
.wr-foot { font-size: 15px; line-height: 1.45; color: #c4cdd7; }
.wr-hint { display: inline-flex; align-items: center; gap: 6px; font: 600 12px/1 var(--f-data); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.wr-hint .ico { width: 14px; height: 14px; animation: wr-nudge 1s ease-in-out infinite; }
@keyframes wr-nudge { 50% { transform: translateX(4px); } }
.wr-chime { justify-self: start; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--panel-border); background: var(--raise);
  font: 600 12px/1 var(--f-data); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.wr-chime .ico { animation: notifRing 1.6s ease-in-out 1.3s 2; transform-origin: 50% 10%; }

/* 1 · Las puertas del tren se abren */
.wr-doors { position: absolute; inset: 0; z-index: 5; display: flex; pointer-events: none; border-radius: inherit; overflow: hidden; }
.wr-doors i { position: relative; flex: 1; background: linear-gradient(180deg, #313b46, #1b232c); animation: wr-doorL .95s cubic-bezier(.6, 0, .25, 1) .55s forwards; }
.wr-doors i:first-child { border-right: 2px solid #070b10; }
.wr-doors i:last-child { border-left: 2px solid #070b10; animation-name: wr-doorR; }
.wr-doors i::before { content: ""; position: absolute; top: 12%; height: 40%; left: 16%; right: 16%; border-radius: 12px; border: 4px solid #46525e; background: linear-gradient(160deg, #9fb7c944, #0b111888 60%); }
.wr-doors i::after { content: ""; position: absolute; left: 0; right: 0; bottom: 24%; height: 12px; background: var(--wa); }
@keyframes wr-doorL { to { transform: translateX(-104%); } }
@keyframes wr-doorR { to { transform: translateX(104%); } }

/* 2 · Tiempo: reloj que gira y trenes que aparecen */
.wr-timebox { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wr-clock { width: 64px; height: 64px; flex: none; fill: none; stroke: #fff; stroke-width: 4; stroke-linecap: round; }
.wr-clock circle { stroke: #ffffff40; }
.wr-clock path { stroke: #ffffff70; stroke-width: 3; }
.wr-clock .h, .wr-clock .m { transform-origin: 50px 50px; }
.wr-clock .h { stroke: var(--wa); stroke-width: 6; animation: wr-spinH 1.6s cubic-bezier(.2, .7, .2, 1) .4s both; }
.wr-clock .m { stroke: #fff; stroke-width: 4; animation: wr-spinM 1.6s cubic-bezier(.2, .7, .2, 1) .4s both; }
.wr-clock .dot { fill: var(--wa); stroke: none; }
@keyframes wr-spinM { from { transform: rotate(0); } to { transform: rotate(1530deg); } }
@keyframes wr-spinH { from { transform: rotate(0); } to { transform: rotate(420deg); } }
.wr-trains { display: flex; flex-wrap: wrap; gap: 6px; }
.wr-trains span, .wr-trains em { display: grid; place-items: center; min-width: 32px; height: 28px; padding: 0 6px; border-radius: 7px 7px 4px 4px; background: color-mix(in srgb, var(--wa) 25%, transparent); border: 1px solid var(--wa);
  opacity: 0; animation: wr-pop .4s cubic-bezier(.3, 1.7, .5, 1) var(--d) forwards; font: 700 13px/1 var(--f-data); font-style: normal; }

/* 3 · Kilómetros: odómetro y el viaje desde Santiago */
.wr-kmrow { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.wr-odo { display: inline-flex; padding: 6px 8px; border-radius: 10px; background: #05080c; border: 1px solid #ffffff1c; box-shadow: inset 0 3px 12px #000;
  font: 700 clamp(46px, 13vw, 72px)/1 var(--f-data); }
.wr-odo-col { display: inline-block; height: 1em; overflow: hidden; padding: 0 .04em; border-right: 1px solid #ffffff12; }
.wr-odo-col:last-child { border-right: 0; }
.wr-odo-col > span { display: block; animation: wr-odo 1.8s cubic-bezier(.2, .7, .1, 1) calc(.4s + var(--i) * .15s) both; }
.wr-odo-col i { display: block; height: 1em; font-style: normal; text-align: center; }
.wr-odo-sep { align-self: flex-end; padding: 0 .02em; color: var(--muted); }
@keyframes wr-odo { from { transform: translateY(0); } to { transform: translateY(calc(var(--v) * -1em)); } }
.wr-unit { font: 700 32px/1.2 var(--f-display); color: var(--muted); }
.wr-track { position: relative; height: 70px; margin: 4px 14px 0; }
.wr-track::before { content: ""; position: absolute; left: 0; right: 0; top: 30px; height: 4px; border-radius: 2px; background: #ffffff1a; }
.wr-track-fill { position: absolute; left: 0; top: 30px; height: 4px; width: 0; border-radius: 2px; background: var(--wa); animation: wr-grow 2.2s var(--ease) 1.2s forwards; }
@keyframes wr-grow { to { width: var(--pct); } }
.wr-track-train { position: absolute; left: 0; top: 6px; display: grid; place-items: center; width: 30px; height: 20px; border-radius: 6px 6px 3px 3px; transform: translateX(-50%);
  background: var(--wa); color: var(--wa-on); box-shadow: 0 4px 12px #0008; animation: wr-move 2.2s var(--ease) 1.2s forwards; }
.wr-track-train .ico { width: 14px; height: 14px; }
@keyframes wr-move { to { left: var(--pct); } }
.wr-mile, .wr-track-end { position: absolute; top: 25px; display: grid; justify-items: center; gap: 8px; transform: translateX(-50%); }
.wr-mile i, .wr-track-end i { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 3px solid #ffffff40; }
.wr-mile i { animation: wr-lit .3s var(--d) forwards; }
@keyframes wr-lit { to { border-color: var(--wa); background: #fff; transform: scale(1.2); } }
.wr-mile small, .wr-track-end small { font: 600 10.5px/1 var(--f-data); color: var(--muted); white-space: nowrap; }
.wr-track-end.start { left: 0; }
.wr-track-end.start i { background: #fff; border-color: var(--wa); }
.wr-track-end.goal { left: 100%; }
.wr-track-end.goal i { border-style: dashed; }

/* 4 · Modo favorito: el vehículo entra a toda velocidad y cae el timbre */
.wr-vehicle { position: relative; height: 110px; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #0a0f15; border: 1px solid var(--panel-border); }
.wr-vehicle::after { content: ""; position: absolute; left: 0; right: 0; bottom: 16px; height: 4px; background: repeating-linear-gradient(90deg, #ffffff55 0 26px, transparent 26px 52px); animation: wr-road .35s linear infinite; }
@keyframes wr-road { to { background-position: -52px 0; } }
.wr-vehicle .ico { position: relative; z-index: 1; width: 76px; height: 76px; color: var(--wa); stroke-width: 1.7; filter: drop-shadow(0 0 14px color-mix(in srgb, var(--wa) 60%, transparent));
  animation: wr-drive .9s cubic-bezier(.2, .9, .3, 1.15) .2s both, wr-hover .5s ease-in-out 1.1s infinite alternate; }
@keyframes wr-drive { from { transform: translateX(-240%) skewX(-12deg); } }
@keyframes wr-hover { to { transform: translateY(-3px); } }
.wr-vehicle i { position: absolute; left: 30%; height: 3px; width: 46px; border-radius: 2px; background: #ffffff60; animation: wr-speed .45s linear infinite; }
.wr-vehicle i:nth-child(1) { top: 34%; }
.wr-vehicle i:nth-child(2) { top: 52%; left: 24%; animation-delay: .15s; }
.wr-vehicle i:nth-child(3) { top: 68%; left: 34%; animation-delay: .3s; }
@keyframes wr-speed { from { transform: translateX(0); opacity: .8; } to { transform: translateX(-110px); opacity: 0; } }
.wr-stamp { justify-self: start; padding: 8px 16px; border: 4px solid var(--c, #ffd23f); border-radius: 10px; color: var(--c, #ffd23f);
  font: 700 clamp(24px, 7vw, 34px)/1 var(--f-display); letter-spacing: .04em; text-transform: uppercase; opacity: 0;
  animation: wr-stamp .45s cubic-bezier(.3, 1.6, .5, 1) var(--d) forwards; }
@keyframes wr-stamp { from { opacity: 0; transform: rotate(-30deg) scale(2.6); } to { opacity: 1; transform: rotate(-6deg) scale(1); } }

/* 5 · Línea favorita: la franja se dibuja y la placa cae */
.wr-strip { position: relative; height: 120px; display: grid; place-items: center; }
.wr-strip b { position: absolute; left: 0; top: 50%; width: 0; height: 14px; border-radius: 7px; transform: translateY(-50%); background: var(--c); animation: wr-wide .9s var(--ease) .15s forwards; }
@keyframes wr-wide { to { width: 100%; } }
.wr-strip i { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid #1d2228; transform: translate(-50%, -50%) scale(0); animation: wr-dot .35s cubic-bezier(.3, 1.7, .5, 1) var(--d) forwards; }
@keyframes wr-dot { to { transform: translate(-50%, -50%) scale(1); } }
.wr-badge { position: relative; z-index: 1; display: grid; place-items: center; min-width: 96px; height: 96px; padding: 0 16px; border-radius: 16px; background: var(--c);
  font: 700 56px/1 var(--f-display); box-shadow: 0 0 0 6px var(--surface), 0 14px 34px #000a; }
.wr-badge.drop { animation: wr-drop .75s cubic-bezier(.3, 1.5, .5, 1) .75s both; }
@keyframes wr-drop { from { opacity: 0; transform: translateY(-170px) rotate(-25deg); } 60% { opacity: 1; } }

/* 6 · Estación: letrero de paletas */
.wr-board { display: grid; gap: 10px; padding: 12px; border-radius: 12px; background: #05080c; border: 1px solid #ffffff1c; box-shadow: inset 0 3px 14px #000; }
.wr-board small { display: inline-flex; align-items: center; gap: 6px; font: 700 11px/1 var(--f-data); letter-spacing: .14em; color: var(--brake); }
.wr-board small .ico { width: 14px; height: 14px; }
.wr-flap { display: flex; flex-wrap: wrap; gap: 8px 14px; font: 700 30px/1 var(--f-data); color: #ffd23f; }
.wr-word { display: flex; gap: 3px; }
.wr-flap i { position: relative; display: grid; place-items: center; width: 1.08em; height: 1.4em; border-radius: 4px; font-style: normal; background: linear-gradient(#1d252d 50%, #161c22 50%); box-shadow: 0 1px 0 #000; }
.wr-flap i::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000b; }
.wr-flap i.set { animation: wr-flip .2s ease-out; text-shadow: 0 0 10px #ffd23f88; }
@keyframes wr-flip { from { transform: rotateX(80deg); } }

/* 7 · Turnos: notas que caen como timbres y la boleta que se imprime */
.wr-shifts { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.wr-grades { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-gchip { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: #ffffff0b; border: 1px solid #ffffff14;
  font: 600 16px/1 var(--f-data); opacity: 0; animation: wr-chip .45s cubic-bezier(.3, 1.6, .5, 1) var(--d) forwards; }
.wr-gchip b { font-weight: 800; font-size: 18px; color: var(--g); }
.wr-gchip.zero { --o: .35; }
@keyframes wr-chip { from { opacity: 0; transform: scale(2.2) rotate(-12deg); } to { opacity: var(--o, 1); transform: none; } }
.wrapped .wr-star { width: 22px; height: 22px; vertical-align: -4px; color: #ffd23f; fill: #ffd23f; animation: wr-twirl 1s ease-out 1.9s both; }
@keyframes wr-twirl { from { transform: rotate(-180deg) scale(0); } }
.wr-receipt { position: relative; display: grid; gap: 7px; padding: 14px 16px 16px; border-radius: 12px; background: #f3efe6; color: #1b1b1b; box-shadow: 0 10px 30px #0006; }
.wr-receipt.rise { animation-name: wr-print; animation-duration: .9s; }
@keyframes wr-print { from { opacity: 1; clip-path: inset(0 0 100% 0); transform: translateY(-10px); } to { opacity: 1; clip-path: inset(0 0 0 0); transform: none; } }
.wr-receipt header { display: flex; justify-content: space-between; gap: 10px; padding-bottom: 8px; border-bottom: 2px dashed #c9c2b0;
  font: 700 11px/1.2 var(--f-data); letter-spacing: .14em; text-transform: uppercase; color: #6b6658; }
.wr-rrow { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 15px; opacity: 0; animation: wr-rise .35s var(--ease) var(--d) forwards; }
.wr-rrow span { min-width: 0; }
.wr-rrow b { font: 700 15px/1.2 var(--f-data); text-align: right; overflow-wrap: anywhere; }
.wr-rtotal { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-top: 4px; padding-top: 8px; border-top: 2px solid #1b1b1b;
  font-weight: 700; opacity: 0; animation: wr-rise .35s var(--ease) var(--d) forwards; }
.wr-rtotal b { font: 700 26px/1 var(--f-data); color: #0f8a43; }
.wr-receipt.big .wr-rrow { font-size: 16px; padding: 3px 0; border-bottom: 1px dashed #d8d1bf; }
.wr-receipt.big .wr-rrow:last-of-type { border-bottom: 0; }
.wr-receipt.big .wr-rrow b { font-size: 16px; }
.wr-stamp.final { justify-self: end; margin-top: 4px; --c: #e8343f; font-size: 24px; }
.wr-chart { display: grid; gap: 10px; }

/* 8 · Tu hora: el sol o la luna salen y las barras de cada hora crecen */
.wr-sky { position: relative; height: 70px; overflow: hidden; border-radius: 12px; border: 1px solid var(--panel-border); }
.wr-sky.day { background: linear-gradient(#f4b40055, #0b111800); }
.wr-sky.night { background: radial-gradient(1.5px 1.5px at 12% 30%, #fff, transparent), radial-gradient(1.5px 1.5px at 30% 65%, #fffa, transparent), radial-gradient(1px 1px at 52% 22%, #fff, transparent),
  radial-gradient(1.5px 1.5px at 72% 48%, #fffc, transparent), radial-gradient(1px 1px at 88% 25%, #fff, transparent), linear-gradient(#2a1f5a, #0b1118); }
.wr-sky i { position: absolute; left: calc(50% - 22px); top: 14px; width: 44px; height: 44px; border-radius: 50%; animation: wr-sunrise 1.3s var(--ease) .2s both; }
.wr-sky.day i { background: #ffd23f; box-shadow: 0 0 30px #ffd23fcc; }
.wr-sky.night i { box-shadow: inset -12px 6px 0 0 #eef1f6; filter: drop-shadow(0 0 10px #fff8); }
@keyframes wr-sunrise { from { transform: translateY(70px); } }
.wr-hours { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); gap: 2px; align-items: end; height: 84px; }
.wr-hours i { display: block; height: var(--h); border-radius: 3px 3px 0 0; background: #ffffff2e; transform: scaleY(0); transform-origin: bottom; animation: wr-bar .6s var(--ease) var(--d) forwards; }
.wr-hours i.top { background: var(--wa); box-shadow: 0 0 14px var(--wa); }
@keyframes wr-bar { to { transform: scaleY(1); } }
.wr-hours-axis { display: flex; justify-content: space-between; margin-top: -6px; font: 600 10.5px/1 var(--f-data); color: var(--muted); }

/* Sin datos: el tren pasa sin detenerse */
.wr-pass { position: relative; height: 70px; overflow: hidden; border-radius: 12px; background: #0a0f15; border: 1px solid var(--panel-border); }
.wr-pass::after { content: ""; position: absolute; left: 0; right: 0; bottom: 18px; height: 4px; background: #ffffff22; }
.wr-pass span { position: absolute; bottom: 22px; left: -70px; display: grid; place-items: center; width: 60px; height: 30px; border-radius: 8px 8px 4px 4px; background: var(--wa); color: var(--wa-on); animation: wr-passby 2.4s linear infinite; }
.wr-pass .ico { width: 20px; height: 20px; }
@keyframes wr-passby { to { left: 110%; } }

/* Final */
.wr-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.wr-actions > * { flex: 1 1 150px; }
.wr-note { font-size: 13px; line-height: 1.4; color: var(--muted); }
.wr-msg { font-size: 13.5px; color: var(--muted); }
.wr-msg:empty { display: none; }
.wr-confetti { position: fixed; inset: 0; z-index: 10; width: 100%; height: 100%; pointer-events: none; }

.wr-nav { position: relative; z-index: 2; display: flex; justify-content: center; align-items: center; gap: 14px; padding: 4px 16px max(14px, env(safe-area-inset-bottom)); }
.wr-arrow { width: 52px; padding: 0; }
.wr-arrow:disabled { opacity: .3; cursor: default; }
.wr-pos { min-width: 52px; text-align: center; font: 600 12px/1 var(--f-data); color: var(--muted); }

@media (max-height: 520px) {
  .wr-top { padding-top: max(6px, env(safe-area-inset-top)); gap: 2px 12px; }
  .wr-close { width: 34px; height: 34px; }
  .wr-route { height: 30px; }
  .wr-rail, .wr-rail-done, .wr-seg, .wr-stop { top: 22px; }
  .wr-stage { padding: 6px 16px; }
  .wr-card { width: min(100%, 720px); }
  .wr-sign { padding: 8px 14px; border-bottom-width: 4px; }
  .wr-sign b { font-size: 21px; }
  .wr-sign-n { width: 32px; height: 32px; font-size: 19px; }
  .wr-body { gap: 8px; padding: 12px 16px 14px; }
  .wr-huge { font-size: 54px; }
  .wr-num, .wr-odo { font-size: 48px; }
  .wr-big { font-size: 34px; }
  .wr-vehicle, .wr-strip { height: 80px; }
  .wr-badge { min-width: 70px; height: 70px; font-size: 40px; }
  .wr-sky { display: none; }
  .wr-hours { height: 56px; }
  .wr-nav { position: absolute; inset: 50% 0 auto; padding: 0 6px; justify-content: space-between; pointer-events: none; transform: translateY(-50%); }
  .wr-nav > * { pointer-events: auto; }
  .wr-pos { display: none; }
  .wr-arrow { width: 44px; min-height: 44px; }
  .wr-body:has(.side) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; align-items: center; }
  .wr-body:has(.side) > :not(.side) { grid-column: 1; }
  .wr-body > .side { grid-column: 2; grid-row: 1 / span 6; }
  .wr-receipt.big { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; gap: 4px 24px; padding: 10px 14px 12px; }
  .wr-receipt.big header, .wr-receipt.big .wr-stamp { grid-column: 1 / -1; }
  .wr-receipt.big .wr-rrow, .wr-receipt.big .wr-rrow:last-of-type { font-size: 14px; border-bottom: 1px dashed #d8d1bf; }
  .wr-receipt.big .wr-rrow b { font-size: 14px; }
  .wr-receipt.big header span:last-child { visibility: hidden; }
  .wr-stamp.final { position: absolute; top: 4px; right: 10px; font-size: 16px; margin: 0; padding: 4px 10px; }
  .wr-note { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) {
  .wrapped *, .wrapped *::before, .wrapped *::after { animation-duration: .01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition: none !important; }
  .wrapped .wr-seg-fill { animation-duration: var(--wr-ms, 7500ms) !important; }
  .wr-doors { display: none; }
  .wrapped-launch.fresh { animation: none; }
}
