:root {
  --bg: #121014;
  --bg2: #1c1a20;
  --bg3: #26232b;
  --line: #34303a;
  --fg: #f4f1ea;
  --mut: #a39ead;
  --dim: #6f6a78;
  --now: #ff3b30;
  --acc: #ffdb40;
  --ppm: 2.2px;          /* píxeles por minuto en la parrilla */
  --colw: 132px;
  --axis: 50px;
  --tabs: 62px;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font: 15px/1.35 system-ui, -apple-system, "Roboto", sans-serif; overscroll-behavior: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, p { margin: 0; }

/* ---------- cabecera ---------- */
.top { position: fixed; inset: 0 0 auto 0; height: 58px; display: flex; align-items: center; justify-content: space-between;
  padding: 0 14px; background: var(--bg); border-bottom: 1px solid var(--line); z-index: 20; }
.brand { display: flex; gap: 10px; align-items: center; }
.logo { font-size: 28px; line-height: 1; }
h1 { font-size: 19px; letter-spacing: -.02em; font-weight: 800; }
h1::first-letter { color: var(--acc); }
.sub { font-size: 12.5px; color: var(--mut); }
.clock { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.clock span { font-size: 24px; font-weight: 800; color: var(--now); letter-spacing: -.02em; }
.shot #clockSim { display: none !important; }
.clock small { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--acc); margin-top: -3px; }

.gps { position: fixed; top: 58px; left: 0; right: 0; height: 30px; z-index: 19; font-size: 12.5px; padding: 0 14px; text-align: left;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--bg2); color: var(--mut); border-bottom: 1px solid var(--line); }
.gps b { color: var(--fg); font-weight: 600; }
.gps.warn { color: #1b1400; background: var(--acc); }
.gps.warn b { color: #1b1400; }

main { position: fixed; top: 88px; bottom: var(--tabs); left: 0; right: 0; }
.tab { position: absolute; inset: 0; overflow-y: auto; display: none; -webkit-overflow-scrolling: touch; }
.tab.active { display: block; }
#tab-map.active, #tab-grid.active { display: flex; flex-direction: column; }

/* ---------- barra inferior ---------- */
.tabs { position: fixed; bottom: 0; left: 0; right: 0; height: var(--tabs); display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--bg2); border-top: 1px solid var(--line); z-index: 20; }
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--mut); }
.tabs button span { line-height: 0; }
.tabs button.on { color: var(--fg); }
.tabs button.on span { color: var(--acc); }
.tabs button[data-tab="now"].on span { color: var(--now); animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .35; } }

/* ---------- comunes ---------- */
.num { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px;
  background: var(--c, #888); color: #111; font-weight: 800; font-size: 12.5px; flex: none; }
.live-pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; color: #fff; background: var(--now); border-radius: 4px; padding: 1px 6px; }
.live-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; animation: pulse 1.2s infinite; }
.walk { color: var(--mut); font-size: 12.5px; white-space: nowrap; }
.walk b { color: var(--fg); font-weight: 600; }
.tag { font-size: 11.5px; color: var(--mut); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; white-space: nowrap; }
.yt { color: #ff5a4f; }
.empty { padding: 40px 24px; text-align: center; color: var(--mut); }
.h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--mut); padding: 18px 14px 8px; font-weight: 700; }

/* ---------- AHORA ---------- */
.hero { margin: 14px 14px 4px; padding: 16px; border-radius: 14px; background: linear-gradient(135deg, #2a1f2e, #1d2430); }
.hero b { font-size: 20px; display: block; margin-bottom: 4px; }
.hero p { color: var(--mut); font-size: 14px; }
.hero p strong { color: var(--fg); }
.hero .cd { font-size: 34px; font-weight: 800; color: var(--acc); font-variant-numeric: tabular-nums; margin: 4px 0; }
.vcard { margin: 10px 14px; background: var(--bg2); border-radius: 14px; overflow: hidden; border-left: 6px solid var(--c); }
.vcard.done { opacity: .5; }
.vhead { display: flex; align-items: center; gap: 8px; padding: 10px 12px 0; }
.vhead .vn { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vhead .vn i { font-style: normal; color: var(--mut); font-weight: 400; }
.playing { padding: 8px 12px 12px; display: block; width: 100%; text-align: left; }
.playing .an { font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; margin: 4px 0 2px; }
.playing .meta { color: var(--mut); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.prog { height: 4px; background: var(--bg3); border-radius: 2px; margin-top: 9px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--now); }
.nexts { border-top: 1px solid var(--line); }
.nx { display: flex; align-items: center; gap: 10px; padding: 9px 12px; width: 100%; text-align: left; }
.nx + .nx { border-top: 1px solid var(--line); }
.nx .t { font-variant-numeric: tabular-nums; font-weight: 700; width: 44px; flex: none; }
.nx .n { flex: 1; min-width: 0; font-weight: 600; }
.nx .n small { display: block; color: var(--mut); font-weight: 400; font-size: 12px; }
.nx .in { font-size: 12px; color: var(--acc); white-space: nowrap; }
.idle { padding: 8px 12px 12px; color: var(--mut); font-size: 13.5px; }

/* ---------- PARRILLA ---------- */
.days { display: flex; gap: 8px; padding: 10px 12px; flex: none; border-bottom: 1px solid var(--line); }
.days button { flex: 1; padding: 7px 4px; border-radius: 10px; background: var(--bg2); font-weight: 700; font-size: 14px; }
.days button small { display: block; font-weight: 400; color: var(--mut); font-size: 11px; }
.days button[aria-selected="true"] { background: var(--fg); color: var(--bg); }
.days button[aria-selected="true"] small { color: var(--bg3); }
.days button.today::after { content: " ●"; color: var(--now); }
#morning:empty { display: none; }
#morning { flex: none; padding: 8px 12px; border-bottom: 1px solid var(--line); max-height: 34%; overflow-y: auto; }
#morning .mt { font-size: 12px; color: var(--mut); margin-bottom: 4px; }
.mrow { display: flex; gap: 8px; align-items: center; padding: 5px 0; width: 100%; text-align: left; }
.mrow .t { font-weight: 700; font-variant-numeric: tabular-nums; }
.mrow.live .t { color: var(--now); }
.mrow.past { opacity: .45; }

.gbox { flex: 1; overflow: auto; position: relative; }
.gin { position: relative; width: calc(var(--axis) + var(--n) * var(--colw)); }
.ghead { position: sticky; top: 0; z-index: 5; display: flex; background: var(--bg); border-bottom: 1px solid var(--line); }
.ghead .corner { position: sticky; left: 0; width: var(--axis); flex: none; background: var(--bg); z-index: 2; }
.vh { width: var(--colw); flex: none; padding: 8px 6px 7px; border-top: 4px solid var(--c); font-size: 12px; line-height: 1.2; }
.vh > b { display: block; font-size: 13px; }
.vh i { display: block; color: var(--mut); font-style: normal; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vh .walk { font-size: 11px; display: block; margin-top: 3px; white-space: normal; }
.gbody { position: relative; }
.axis { position: sticky; left: 0; width: var(--axis); height: 100%; background: var(--bg); z-index: 3; float: left; }
.axis span { position: absolute; right: 7px; transform: translateY(-50%); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--mut); }
.axis span.hh { color: var(--fg); font-weight: 700; font-size: 12px; }
.hl { position: absolute; left: var(--axis); right: 0; border-top: 1px solid var(--line); }
.hl.half { border-top-style: dashed; opacity: .55; }
.ev { position: absolute; width: calc(var(--colw) - 6px); border-radius: 8px; background: color-mix(in srgb, var(--c) 22%, var(--bg2));
  border-left: 4px solid var(--c); padding: 4px 6px; overflow: hidden; text-align: left; display: block; }
.ev .t { font-size: 11px; color: var(--mut); font-variant-numeric: tabular-nums; }
.ev .n { font-weight: 700; font-size: 13px; line-height: 1.15; }
.ev .tg { font-size: 10.5px; color: var(--mut); display: block; margin-top: 1px; }
.ev.open { -webkit-mask-image: linear-gradient(#000 60%, transparent); mask-image: linear-gradient(#000 60%, transparent); }
.ev.past { opacity: .4; }
.ev.live { background: color-mix(in srgb, var(--c) 45%, var(--bg2)); box-shadow: 0 0 0 2px var(--now); }
.nowline { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--now); z-index: 4; pointer-events: none; }
.nowline span { position: sticky; left: 0; display: inline-block; transform: translateY(-50%); background: var(--now); color: #fff;
  font-size: 11.5px; font-weight: 800; padding: 1px 5px; border-radius: 4px; font-variant-numeric: tabular-nums; }

/* ---------- MAPA ---------- */
#map { flex: 1; background: #20232a; }
.leaflet-container { font: inherit; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--bg2); color: var(--fg); }
.leaflet-popup-content { margin: 12px 14px; min-width: 210px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--mut); }
.leaflet-control-attribution { background: rgba(18,16,20,.75) !important; color: var(--mut); }
.leaflet-control-attribution a { color: var(--mut); }
.pin { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--c); color: #111;
  font-weight: 800; font-size: 12px; border: 2px solid #111; box-shadow: 0 2px 6px rgba(0,0,0,.6); }
.pin.multi { border-radius: 14px; }
.pin.live { box-shadow: 0 0 0 3px var(--now), 0 2px 6px rgba(0,0,0,.6); }
.me { width: 100%; height: 100%; border-radius: 50%; background: #2f8cff; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(47,140,255,.3); }
.pop h3 { font-size: 15px; display: flex; gap: 6px; align-items: center; margin-top: 8px; }
.pop h3:first-child { margin-top: 0; }
.pop .st { color: var(--mut); font-size: 12px; }
.pop .row { font-size: 13px; margin-top: 4px; }
.pop .row b { cursor: pointer; }
.pop .btns { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; background: var(--bg3); font-weight: 600; font-size: 13.5px; }
.btn.pri { background: var(--fg); color: var(--bg); }
.btn.red { background: #ff0033; color: #fff; }
.fab { position: absolute; right: 14px; bottom: 18px; width: 48px; height: 48px; border-radius: 50%; background: var(--fg); color: var(--bg);
  display: grid; place-items: center; z-index: 500; box-shadow: 0 3px 10px rgba(0,0,0,.5); }

/* ---------- ARTISTAS ---------- */
.search { position: sticky; top: 0; padding: 10px 12px; background: var(--bg); z-index: 2; }
.search input { width: 100%; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2);
  color: var(--fg); font: inherit; outline: none; }
.search input:focus { border-color: var(--mut); }
.arow { display: flex; gap: 10px; align-items: center; padding: 10px 14px; width: 100%; text-align: left; border-bottom: 1px solid var(--line); }
.arow .thumb { width: 64px; height: 36px; border-radius: 6px; background: var(--bg3) center/cover; flex: none; position: relative; }
.arow .thumb::after { content: "▶"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 13px; text-shadow: 0 0 4px #000; }
.arow .n { flex: 1; min-width: 0; }
.arow .n b { display: block; font-size: 15px; }
.arow .n small { color: var(--mut); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.arow.past { opacity: .5; }

/* ---------- FICHA ---------- */
.sheet { position: fixed; inset: 0; z-index: 1000; }
.sheet-bg { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.sheet-card { position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; overflow-y: auto; background: var(--bg2);
  border-radius: 18px 18px 0 0; padding: 18px 16px 24px; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet-x { position: absolute; right: 10px; top: 10px; width: 36px; height: 36px; border-radius: 50%; background: var(--bg3); z-index: 2; }
.ah { padding-right: 40px; }
.ah h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; line-height: 1.1; }
.ah .lu { color: var(--mut); font-size: 13px; margin-top: 4px; }
.when { display: flex; gap: 10px; align-items: center; margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--bg3); border-left: 5px solid var(--c); }
.when .w { flex: 1; font-size: 13.5px; }
.when .w b { font-size: 15px; }
.player { position: relative; width: 100%; aspect-ratio: 16/9; background: #000; border-radius: 12px; overflow: hidden; margin-top: 6px; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player .poster { position: absolute; inset: 0; background: #000 center/cover; display: grid; place-items: center; width: 100%; }
.player .poster span { width: 68px; height: 48px; border-radius: 12px; background: #ff0033; color: #fff; font-size: 22px; display: grid; place-items: center; }
.vlist { margin-top: 10px; }
.vi { display: flex; gap: 10px; align-items: center; padding: 6px 0; width: 100%; text-align: left; }
.vi img { width: 96px; height: 54px; object-fit: cover; border-radius: 6px; flex: none; background: var(--bg3); }
.vi .tt { font-size: 13px; line-height: 1.25; flex: 1; min-width: 0; }
.vi .tt small { display: block; color: var(--mut); font-size: 11.5px; margin-top: 2px; }
.vi.on .tt { color: var(--acc); }
.sheet .btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.sim label { display: block; font-size: 13px; color: var(--mut); margin: 12px 0 4px; }
.sim select, .sim input { width: 100%; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg3); color: var(--fg); font: inherit; }
