/* SPDX-License-Identifier: GPL-3.0-or-later · Trenalia — vista sencilla para el móvil (sprint 148, public/simple.js).
   Solo actúa con <html class="sm-ui">, que pone public/mapmode.js en pantallas estrechas y táctiles. */
.sm-home, .sm-mapbar, .sm-tip, .sm-tut, .sm-cardfull { display: none; }
.sm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

html.sm-ui .sm-home { display: flex; flex-direction: column; position: fixed; inset: 0; z-index: 1050; background: var(--bg); color: var(--text); overflow: hidden; }
html.sm-ui.sm-map .sm-home { display: none; }
/* Sprint 153: con el inicio delante, el mapa no se pinta (el navegador se salta su capa) */
html.sm-ui:not(.sm-map) #map { visibility: hidden; }
.sm-top { flex: none; height: 60px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px 0 16px; padding-top: env(safe-area-inset-top); background: var(--panel); border-bottom: 1px solid var(--line); }
.sm-brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 800; letter-spacing: -.02em; }
.sm-logo { width: 26px; height: 26px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sm-menu { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 600 15px var(--sans, system-ui, sans-serif); }
.sm-home svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sm-menu svg { width: 20px; height: 20px; }
.sm-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 0 110px; -webkit-overflow-scrolling: touch; }
.sm-h1 { margin: 0 16px; font-size: 25px; line-height: 1.2; font-weight: 800; letter-spacing: -.02em; }
.sm-sub { margin: 4px 16px 0; font-size: 15px; color: var(--muted); }
.sm-search { margin: 14px 16px 0; height: 54px; display: flex; align-items: center; gap: 8px; padding: 0 6px 0 14px; background: var(--panel); border: 2px solid var(--blue); border-radius: 14px; }
.sm-search > svg { width: 22px; height: 22px; color: var(--blue); flex: none; }
.sm-search input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; color: var(--text); font: 500 17px var(--sans, system-ui, sans-serif); }
.sm-go { flex: none; height: 40px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; font: 700 15px var(--sans, system-ui, sans-serif); }
.sm-cap { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.sm-band { margin-top: 18px; }
.sm-band > .sm-cap { margin: 0 16px 8px; }
.sm-row { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0 16px; scroll-padding: 0 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.sm-row::-webkit-scrollbar { display: none; }
.sm-card { flex: 0 0 72%; max-width: 300px; height: 200px; scroll-snap-align: start; position: relative; overflow: hidden; border-radius: 18px; border: 0; padding: 0; background: #142033; color: #fff; text-decoration: none; text-align: left; font: inherit; cursor: pointer; }
.sm-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sm-shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10, 18, 32, 0) 25%, rgba(10, 18, 32, .9) 100%); }
.sm-ct { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 5px; }
.sm-ci { width: 38px; height: 38px; border-radius: 11px; background: #1f6fd1; display: grid; place-items: center; }
.sm-ci svg { width: 22px; height: 22px; stroke: #fff; }
.sm-ct b { font-size: 18px; font-weight: 800; }
.sm-ct small { font-size: 13px; color: #e3e9f2; line-height: 1.3; }
.sm-card:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sm-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.sm-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--handle, #c3ccd9); transition: width .15s; }
.sm-dots i.on { width: 20px; border-radius: 4px; background: var(--blue); }
.sm-habit { display: block; margin: 18px 16px 0; padding: 12px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); color: var(--text); text-decoration: none; }
.sm-habit .sm-cap { display: block; margin-bottom: 4px; }
.sm-habit b { display: block; font-size: 16px; }
.sm-habit small { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.sm-inc { margin: 12px 16px 0; width: calc(100% - 32px); min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; background: #fff4e0; border: 1px solid #f0d49a; color: #6e4700; font: 600 15px var(--sans, system-ui, sans-serif); text-align: left; }
.sm-inc svg { width: 20px; height: 20px; flex: none; }
.sm-inc .sm-chev { margin-left: auto; width: 18px; height: 18px; }
.sm-inc[hidden] { display: none; }
.sm-full { margin: 12px 16px 0; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; padding: 0 4px; border: 0; background: none; color: var(--blue); font: 600 15px var(--sans, system-ui, sans-serif); }
.sm-full svg { width: 18px; height: 18px; }
:root[data-theme="dark"] .sm-inc { background: #3a2a08; border-color: #6e4f14; color: #f6d48a; }

/* Mapa sencillo: el mismo mapa con menos controles */
html.sm-ui.sm-map .sm-mapbar { display: flex; position: fixed; z-index: 640; left: 12px; right: 12px; top: calc(72px + env(safe-area-inset-top)); gap: 8px; flex-wrap: nowrap; pointer-events: none; }
/* Mientras se escribe en el buscador del mapa, los botones no lo tapan */
html.sm-ui.sm-map.sm-searching .sm-mapbar { display: none; }   /* sprint 153: clase puesta por simple.js (el selector «has» era caro con el mapa) */
.sm-chip { pointer-events: auto; flex: none; height: 40px; display: inline-flex; align-items: center; gap: 5px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: 700 13.5px var(--sans, system-ui, sans-serif); box-shadow: 0 4px 12px var(--shadow); white-space: nowrap; }
.sm-chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sm-chip-l { color: var(--blue); }
html.sm-ui.sm-map .chips, html.sm-ui.sm-map #cabBtn, html.sm-ui.sm-map #andBtn, html.sm-ui.sm-map #vtrBtn, html.sm-ui.sm-map #vjBtn,
html.sm-ui.sm-map #bellBtn, html.sm-ui.sm-map #themeBtn, html.sm-ui.sm-map #langBtn, html.sm-ui.sm-map #credBtn,
html.sm-ui.sm-map .legend, html.sm-ui.sm-map .kpis, html.sm-ui.sm-map .agis-legend, html.sm-ui.sm-map .layers-ctl, html.sm-ui.sm-map .recenter { display: none !important; }
html.sm-ui.sm-map:not(.sm-sheet) #sheet { display: none !important; }
html.sm-ui.sm-map .sm-cardfull { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--blue); font: 700 14px var(--sans, system-ui, sans-serif); }
.sm-cardfull svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* La ficha del tren no se esconde tras el panel inferior (que no se ve en el mapa sencillo) */
html.sm-ui.sm-map:not(.sm-sheet) .card { bottom: calc(16px + env(safe-area-inset-bottom)); }

/* Trenalito recuerda dónde está la vista completa */
html.sm-ui .sm-tip { display: block; position: fixed; z-index: 1150; left: 12px; right: 92px; bottom: calc(20px + env(safe-area-inset-bottom)); padding: 14px 14px 12px; border-radius: 16px; background: #142033; color: #fff; box-shadow: 0 10px 28px rgba(20, 32, 51, .3); font-size: 14px; line-height: 1.4; }
.sm-tip p { margin: 0; }
.sm-tip button { display: block; margin: 8px 0 0 auto; height: 36px; padding: 0 14px; border-radius: 10px; border: 0; background: #fff; color: #142033; font: 700 14px var(--sans, system-ui, sans-serif); }

/* Tutorial */
html.sm-ui .sm-tut { display: block; position: fixed; inset: 0; z-index: 2500; }
.sm-dim { position: absolute; inset: 0; background: rgba(10, 18, 32, .66); }
.sm-hole { position: absolute; box-shadow: 0 0 0 3px #fff, 0 0 0 3000px rgba(10, 18, 32, .66); pointer-events: none; }
.sm-coach { position: absolute; left: 16px; right: 16px; max-width: 440px; margin: 0 auto; padding: 18px; border-radius: 18px; background: var(--panel); color: var(--text); box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.sm-ava { display: grid; place-items: center; width: 76px; height: 76px; margin: 0 auto 6px; border-radius: 50%; border: 4px solid var(--blue); background: var(--panel-2); }
.sm-step { margin: 0; font-size: 13px; font-weight: 700; color: var(--blue); }
.sm-coach h2 { margin: 4px 0 0; font-size: 20px; line-height: 1.25; font-weight: 800; }
.sm-cd { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--muted); }
.sm-cb { display: flex; align-items: center; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sm-cb button { min-height: 44px; border-radius: 12px; font: 700 15px var(--sans, system-ui, sans-serif); padding: 0 16px; }
.sm-b1 { border: 0; background: var(--blue); color: #fff; margin-left: auto; }
.sm-b2 { border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.sm-b3 { border: 0; background: none; color: var(--muted); padding: 0 8px !important; font-weight: 600 !important; }
.sm-tdots { display: flex; justify-content: center; gap: 6px; margin-top: 12px; }
.sm-tdots i { width: 8px; height: 8px; border-radius: 50%; background: var(--handle, #c3ccd9); }
.sm-tdots i.on { width: 20px; border-radius: 4px; background: var(--blue); }
@media (prefers-reduced-motion: reduce) { .sm-dots i { transition: none; } }

/* Aviso legal corto de la primera vez (en la ventana de bienvenida de app.js) */
.sm-lk { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.sm-legal { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.sm-legal li { display: flex; gap: 10px; line-height: 1.45; }
.sm-legal svg { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--blue); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Sprint 164: cinta de «Nuevo» en la tarjeta de la sala de juegos */
.sm-ribbon { position: absolute; z-index: 2; top: 16px; right: -36px; transform: rotate(35deg); background: #ff3ea5; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 4px 44px; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); }
