@import url("/css/fonts.css");

/* ---------- Tokens (dossier UI/UX v2) ---------- */
:root {
  --bg: #090A0C;          /* Bunker Black */
  --panel: #141619;       /* Deep Charcoal */
  --card: #202328;        /* Graphite */
  --steel: #363A40;       /* Steel Gray */
  --gold: #FFCB24;        /* Bunker Gold */
  --amber: #F4A900;       /* Amber Signal */
  --text: #F3F0E9;        /* Off White */
  --muted: #A2A5AC;       /* Muted Silver */
  --danger: #E5484D;
  --ok: #3DD68C;
  --line: rgba(243, 240, 233, .08);
  --font-title: "Sora", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px;
  --tabbar-h: 62px;
  --mini-h: 60px;
  --col: 480px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color-scheme: dark; -webkit-text-size-adjust: 100%; height: 100%; overflow: hidden; overscroll-behavior: none; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.45 var(--font-body);
  -webkit-font-smoothing: antialiased;
  /* Como una app: la pantalla no se mueve, no se selecciona texto, no hay zoom ni menú al mantener presionado */
  position: fixed; inset: 0; width: 100%; height: 100%; overflow: hidden; overscroll-behavior: none;
  touch-action: manipulation; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; pointer-events: none; }
a, button { -webkit-user-drag: none; }
*::-webkit-scrollbar { display: none; }
* { scrollbar-width: none; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-title); margin: 0; line-height: 1.2; }
img { display: block; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

#app {
  position: absolute; top: 0; left: 0; right: 0; margin: 0 auto; width: min(100%, var(--col));
  height: var(--app-h, 100dvh); display: flex; flex-direction: column; overflow: hidden; background: var(--bg);
}
.icon { display: inline-flex; width: 1em; height: 1em; flex: none; }
.icon svg { width: 100%; height: 100%; display: block; }

/* ---------- Barra superior y navegación ---------- */
.topbar {
  position: relative; flex: none; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) 18px 10px; background: var(--bg);
}
.brand { display: flex; flex-direction: column; line-height: 1; font-family: var(--font-title); }
.brand b { font-size: 15px; letter-spacing: .04em; font-weight: 700; }
.brand span { font-size: 9px; letter-spacing: .42em; color: var(--gold); font-weight: 700; margin-top: 3px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--gold); color: var(--gold);
  display: grid; place-items: center; font: 700 15px var(--font-title); position: relative; text-transform: uppercase;
}
.avatar .badge {
  position: absolute; top: -4px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--gold); color: var(--bg); font: 700 11px/18px var(--font-body); text-align: center;
}
.tabbar {
  position: relative; flex: none; width: 100%; z-index: 30;
  display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(14, 15, 18, .96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; min-height: 44px; }
.tab .icon { font-size: 23px; }
.tab[aria-current="page"] { color: var(--gold); font-weight: 600; }
#stage { position: relative; flex: 1; min-height: 0; overflow: hidden; touch-action: pan-y; }
.page {
  position: absolute; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain;
  touch-action: pan-y; background: var(--bg); padding: 4px 18px 28px; will-change: transform;
}
.page.off { visibility: hidden; pointer-events: none; }
.page.shadow { box-shadow: -14px 0 34px rgba(0, 0, 0, .55); }
body.has-mini .page { padding-bottom: calc(var(--mini-h) + 30px); }
body.kbd .tabbar, body.kbd .mini { display: none; }

/* ---------- Tipografía y botones ---------- */
.h1 { font-size: 26px; font-weight: 700; letter-spacing: -.01em; margin: 6px 0 14px; }
.h2 { font-size: 18px; font-weight: 600; }
.eyebrow { font: 700 11px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.section { margin-top: 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head a, .link { color: var(--gold); font-size: 13px; font-weight: 600; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px;
  font-weight: 600; font-size: 15px; transition: transform .12s, background .15s, opacity .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: #ffd54d; }
.btn-secondary { background: var(--card); color: var(--text); border: 1px solid var(--line); }
.btn-ghost { color: var(--gold); }
.btn-danger { background: rgba(229, 72, 77, .14); color: #ff8b8f; border: 1px solid rgba(229, 72, 77, .3); }
.btn-block { width: 100%; }
.btn-sm { min-height: 36px; padding: 0 16px; font-size: 13px; }
.btn .icon { font-size: 19px; }
.icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; color: var(--text); flex: none; }
.icon-btn:active { background: var(--card); }
.icon-btn.ring { border: 1px solid var(--steel); }
.icon-btn.on { color: var(--gold); }

/* ---------- Carátulas y tarjetas ---------- */
.cover { position: relative; overflow: hidden; background: var(--card); border-radius: var(--r-md); aspect-ratio: 1; flex: none; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .55); font-size: 34%; }
.cover .ph svg { width: 34%; height: 34%; }
.cover.round { border-radius: 50%; }
.hscroll { display: flex; gap: 14px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 6px; scroll-snap-type: x proximity; scroll-padding-inline: 18px; scrollbar-width: none; touch-action: pan-x pan-y; overscroll-behavior-x: contain; }
.hscroll::-webkit-scrollbar { display: none; }
.card { width: 132px; flex: none; scroll-snap-align: start; text-align: left; display: block; }
.card .cover { width: 132px; }
.card .t { margin-top: 8px; font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 14px; }
.grid .card, .grid .card .cover { width: 100%; }

.hero {
  position: relative; display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch; min-height: 168px;
  border-radius: var(--r-lg); overflow: hidden; background: var(--card); border: 1px solid var(--line);
}
.hero .txt { padding: 16px 4px 16px 16px; display: flex; flex-direction: column; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.hero h2 { font-size: 20px; font-weight: 700; margin-top: 6px; overflow-wrap: anywhere; }
.hero .art { position: relative; }
.hero .art .cover { position: absolute; inset: 0; border-radius: 0; aspect-ratio: auto; }
.hero .art::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--card), rgba(32, 35, 40, 0) 45%); }
.hero .btn { align-self: flex-start; min-height: 38px; padding: 0 16px; font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile {
  position: relative; overflow: hidden; border-radius: var(--r-md); min-height: 92px; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end;
  background: var(--tile, #4a2a3a); text-align: left; border: 1px solid var(--line);
}
.tile b { font: 600 17px var(--font-title); position: relative; z-index: 1; }
.tile span { font-size: 12px; color: rgba(255, 255, 255, .72); position: relative; z-index: 1; }
.pillrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }

/* Filas de canciones */
.tracklist { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 6px 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; }
.row .cover { width: 46px; border-radius: 8px; }
.row .num { width: 26px; text-align: center; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; flex: none; }
.row .main { flex: 1; min-width: 0; text-align: left; display: block; }
.row button.main { align-self: stretch; display: flex; flex-direction: column; justify-content: center; cursor: pointer; }
.row .t { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .dur { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.row.current .t { color: var(--gold); }
.row.unready { opacity: .45; }
.row .icon-btn { width: 40px; height: 40px; font-size: 20px; color: var(--muted); margin-right: -8px; }
.row.tap { cursor: pointer; }
.eq { display: inline-flex; gap: 2px; align-items: flex-end; height: 14px; width: 16px; justify-content: center; }
.eq i { width: 3px; background: var(--gold); border-radius: 1px; height: 30%; }
.playing .eq i { animation: eq 0.9s ease-in-out infinite; }
.playing .eq i:nth-child(2) { animation-delay: -.3s; } .playing .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 25%; } 50% { height: 100%; } }

/* Cabecera de álbum / artista / lista */
.backbar { display: flex; align-items: center; gap: 4px; margin: 0 -10px 4px; }
.detail-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; margin-bottom: 18px; }
.detail-head .cover { width: min(64%, 260px); border-radius: var(--r-lg); box-shadow: 0 18px 40px rgba(0, 0, 0, .55); margin-bottom: 14px; }
.detail-head h1 { font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; overflow-wrap: anywhere; }
.detail-head .meta { color: var(--muted); font-size: 13px; }
.detail-head .meta a { color: var(--text); text-decoration: underline; text-decoration-color: var(--steel); text-underline-offset: 3px; }
.actions { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 12px 0 4px; width: 100%; }
.actions .btn-primary { flex: 1; max-width: 240px; }
.artist-head .cover { width: 150px; }

/* Biblioteca */
.libcard { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: var(--r-md); background: var(--panel); border: 1px solid var(--line); margin-bottom: 10px; width: 100%; text-align: left; }
.libcard .ico { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; font-size: 24px; background: var(--c, var(--steel)); flex: none; }
.libcard .main { flex: 1; min-width: 0; }
.libcard .t { font-weight: 600; }
.libcard .chev { color: var(--gold); font-size: 20px; }
.mosaic { width: 56px; height: 56px; border-radius: 12px; overflow: hidden; display: grid; grid-template-columns: 1fr 1fr; background: var(--card); flex: none; }
.mosaic .cover { border-radius: 0; width: 100%; }
.mosaic.one { grid-template-columns: 1fr; }
.mosaic .ph-all { grid-column: 1 / -1; display: grid; place-items: center; color: var(--muted); font-size: 24px; }

/* Buscar */
.searchbox { position: relative; margin-bottom: 14px; }
.searchbox .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 19px; pointer-events: none; }
.searchbox input {
  width: 100%; height: 48px; padding: 0 44px 0 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); outline: none; font-size: 16px;
}
.searchbox input:focus { border-color: var(--gold); }
.searchbox .clear { position: absolute; right: 4px; top: 2px; color: var(--muted); }
.searchlink { display: flex; align-items: center; height: 48px; padding: 0 14px 0 44px; position: relative; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--muted); width: 100%; margin-bottom: 18px; }
.searchlink .icon { position: absolute; left: 14px; font-size: 19px; }

/* Estados */
.state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 48px 24px; color: var(--muted); }
.state .big { font-size: 44px; color: var(--steel); }
.state h3 { color: var(--text); font-size: 17px; }
.skel { background: linear-gradient(90deg, var(--panel), var(--card), var(--panel)); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--r-md); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Mini reproductor ---------- */
.mini {
  position: absolute; left: 8px; right: 8px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 8px); z-index: 29;
  height: var(--mini-h); border-radius: 16px; background: var(--card); border: 1px solid var(--steel); display: flex; align-items: center; gap: 10px; padding: 0 6px 0 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .5); overflow: hidden; cursor: pointer;
}
.mini .cover { width: 44px; border-radius: 9px; }
.mini .main { flex: 1; min-width: 0; text-align: left; }
.mini .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .s { color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .icon-btn { width: 42px; height: 42px; }
.mini .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gold); width: calc(var(--p, 0) * 100%); }

/* ---------- Reproductor expandido ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } }
.player {
  position: fixed; inset: 0; z-index: 50; display: flex; justify-content: center; background: var(--bg); animation: slideUp .28s cubic-bezier(.2, .8, .2, 1);
}
@keyframes slideUp { from { transform: translateY(100%); } }
.player.closing { animation: slideDown .22s ease-in forwards; }
@keyframes slideDown { to { transform: translateY(100%); } }
.player .inner {
  width: min(100%, var(--col)); height: 100%; display: flex; flex-direction: column; padding: calc(var(--safe-t) + 10px) 24px calc(var(--safe-b) + 18px); position: relative; overflow: hidden;
}
.player .glow { position: absolute; inset: -20% -20% auto -20%; height: 70%; background: radial-gradient(closest-side, var(--glow, rgba(244, 169, 0, .25)), rgba(0, 0, 0, 0)); pointer-events: none; }
.player .top { display: flex; align-items: center; justify-content: space-between; position: relative; }
.player .top .eyebrow { text-align: center; }
.player .art { flex: 1; min-height: 0; display: grid; place-items: center; padding: 14px 0; position: relative; }
.player .art .cover { width: min(100%, 52vh, 380px); border-radius: var(--r-lg); box-shadow: 0 24px 60px rgba(0, 0, 0, .6); }
.player .info { display: flex; align-items: center; gap: 12px; position: relative; }
.player .info .txt { flex: 1; min-width: 0; }
.player .info h2 { font-size: 22px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .info .artist { color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seek { margin-top: 14px; position: relative; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; background: transparent; margin: 0; cursor: pointer; --p: 0; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--gold) calc(var(--p) * 100%), var(--steel) calc(var(--p) * 100%)); }
.range::-moz-range-track { height: 4px; border-radius: 2px; background: var(--steel); }
.range::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--gold); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--gold); margin-top: -6px; box-shadow: 0 0 0 4px rgba(255, 203, 36, .18); }
.range::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--gold); }
.times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: -2px; }
.controls { display: flex; align-items: center; justify-content: space-between; margin: 10px 0 6px; position: relative; }
.controls .icon-btn { width: 52px; height: 52px; font-size: 26px; }
.controls .play { width: 72px; height: 72px; border-radius: 50%; background: var(--gold); color: var(--bg); font-size: 34px; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(255, 203, 36, .28); }
.controls .play:active { transform: scale(.95); }
.controls .sm { font-size: 22px; color: var(--muted); }
.controls .sm.on { color: var(--gold); }
.player .bottom { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 10px; position: relative; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 999px; background: var(--card); color: var(--text); font-size: 13px; font-weight: 600; }
.chip .icon { font-size: 18px; }
.player .bottom .chip { padding: 0 12px; gap: 6px; }
@media (max-height: 700px) { .player .art .cover { width: min(100%, 40vh); } .player .art { padding: 6px 0; } }

/* ---------- Hojas inferiores y ventanas ---------- */
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(100%, var(--col)); max-height: 86vh; z-index: 61; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 22px 22px 0 0; border: 1px solid var(--line); border-bottom: 0; padding: 8px 18px calc(var(--safe-b) + 18px); animation: sheetUp .24s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--steel); margin: 0 auto 12px; flex: none; }
.sheet h3 { font-size: 17px; margin: 0 0 12px; }
.sheet .body { overflow-y: auto; margin: 0 -18px; padding: 0 18px; }
.menu-head { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; margin-bottom: 4px; border-bottom: 1px solid var(--line); }
.menu-head .cover { width: 50px; border-radius: 9px; }
.menu-item { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; font-size: 15.5px; text-align: left; }
.menu-item .icon { font-size: 22px; color: var(--gold); }
.menu-item.danger, .menu-item.danger .icon { color: #ff8b8f; }
.modal { position: fixed; z-index: 62; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(calc(100% - 36px), 380px); background: var(--panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; animation: pop .18s ease-out; }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }
.modal h3 { font-size: 18px; margin-bottom: 14px; }
.modal .btns { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.field { width: 100%; height: 50px; border-radius: 12px; border: 1px solid var(--steel); background: var(--bg); padding: 0 14px; outline: none; font-size: 16px; }
.field:focus { border-color: var(--gold); }
.lightbox img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: 14px; }
.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--mini-h, 0px) + 22px); transform: translateX(-50%); z-index: 70; max-width: min(92vw, 420px);
  background: var(--steel); color: var(--text); padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 500; box-shadow: 0 8px 28px rgba(0, 0, 0, .5); animation: toast 2.6s ease forwards; text-align: center;
}
body.has-mini .toast { --mini-h: 68px; }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, 10px); } 8%, 88% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

/* ---------- Entrada (bienvenida / acceso) ---------- */
.gate { height: 100%; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; padding: calc(var(--safe-t) + 24px) 24px calc(var(--safe-b) + 24px); position: relative; overflow: hidden; }
.gate::before { content: ""; position: absolute; inset: -10% -30% auto -30%; height: 60%; background: radial-gradient(closest-side, rgba(244, 169, 0, .18), transparent); pointer-events: none; }
.gate .logo { width: min(86%, 340px); height: auto; margin: 0 auto 10px; mix-blend-mode: screen; }
.gate .tagline { text-align: center; color: var(--muted); font-size: 16px; margin-bottom: 28px; }
.gate .stack { display: flex; flex-direction: column; gap: 12px; position: relative; }
.gate h1 { font-size: 24px; margin-bottom: 4px; }
.gate .err { color: #ff8b8f; font-size: 14px; min-height: 20px; }
.gate .hint { color: var(--muted); font-size: 13px; text-align: center; }
.code-input { text-align: center; font: 700 30px var(--font-title); letter-spacing: .5em; padding-left: .5em; height: 64px; }
.google-btn { background: var(--text); color: #1f1f1f; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.pending-ico { width: 84px; height: 84px; border-radius: 50%; border: 2px solid var(--gold); display: grid; place-items: center; margin: 0 auto 8px; font-size: 38px; color: var(--gold); }

/* ---------- Administración ---------- */
.stat { display: flex; gap: 10px; margin-bottom: 8px; }
.stat > div { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.stat b { display: block; font: 700 22px var(--font-title); }
.stat span { color: var(--muted); font-size: 12px; }
.stat .hot b { color: var(--gold); }
.user { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.user .ava { width: 40px; height: 40px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font: 700 15px var(--font-title); text-transform: uppercase; flex: none; }
.user .main { flex: 1; min-width: 0; }
.user .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user .s { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user .btns { display: flex; gap: 8px; flex-wrap: wrap; flex-basis: 100%; padding-left: 52px; }
.user .btns:empty { display: none; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 2px 8px; border-radius: 999px; background: rgba(255, 203, 36, .14); color: var(--gold); margin-left: 6px; vertical-align: middle; }
.progress { height: 8px; border-radius: 4px; background: var(--steel); overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: var(--gold); width: calc(var(--p, 0) * 100%); transition: width .4s; }
.install-banner { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-md); background: var(--panel); border: 1px solid rgba(255, 203, 36, .3); margin-bottom: 16px; font-size: 13.5px; }
.install-banner .icon { font-size: 24px; color: var(--gold); margin-top: 2px; }
.install-banner p { margin: 2px 0 0; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
/* En pantallas grandes la app se ve como una columna de celular centrada. */
@media (min-width: 560px) {
  #app { box-shadow: 0 0 0 1px var(--line); }
}

/* ---------- extras ---------- */
.mixlabel { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; border-radius: 6px; background: rgba(9, 10, 12, .72); color: var(--gold); font: 700 10px var(--font-body); letter-spacing: .14em; }
.pl-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pl-row .main { flex: 1; min-width: 0; text-align: left; }
.pl-row .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-row .s { color: var(--muted); font-size: 12.5px; }
.recent-list { margin-top: 4px; }
.recent-list .row { min-height: 50px; }
.recent-list .row .main { display: flex; align-items: center; gap: 10px; }
.sub-title { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 10px; }
.sub-title .h1 { margin: 0; }

/* ---------- Pantalla de carga ---------- */
#splash { position: absolute; inset: 0; z-index: 200; background: var(--bg); display: grid; place-items: center; transition: opacity .5s ease; }
#splash.hide { opacity: 0; pointer-events: none; }
#splash img { width: min(72vw, 330px); height: auto; mix-blend-mode: screen; animation: splashIn .7s cubic-bezier(.2, .8, .2, 1) both; }
#splash::before {
  content: ""; position: absolute; width: 120vw; height: 120vw; max-width: 700px; max-height: 700px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(244, 169, 0, .16), transparent); animation: glow 2.4s ease-in-out infinite;
}
@keyframes splashIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
@keyframes glow { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1.04); } }

/* ---------- Sensación táctil ---------- */
.card, .row, .libcard, .tile, .pl-row a, .btn, .icon-btn, .tab, .chip, .menu-item { transition: transform .12s ease, background-color .15s ease, opacity .15s ease; }
.card:active, .libcard:active, .tile:active { transform: scale(.97); }
.row:active { background: rgba(255, 255, 255, .04); }
.tab:active { opacity: .6; }

/* Descargando la canción: el botón de play late suavemente */
.loading { animation: loadingPulse 1s ease-in-out infinite; }
@keyframes loadingPulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
.diag { font: 12px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; word-break: break-all; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; color: var(--muted); -webkit-user-select: text; user-select: text; }

#rot { position: fixed; inset: 0; } /* envuelve todo (app, hojas, avisos, pantalla de carga) */

/* ---------- Gestos: zonas donde el dedo arrastra (el navegador no debe interferir) ---------- */
.mini { touch-action: none; }
.player .top, .player .art, .player .info { touch-action: none; }
.sheet .grab, .sheet h3, .sheet .menu-head { touch-action: none; }
.sheet .grab { position: relative; }
.sheet .grab::before { content: ""; position: absolute; inset: -16px -70px; }

/* =====================================================================================================
   TELÉFONO DE LADO (horizontal): la app se reordena y funciona igual.
   - La barra de abajo pasa a ser una columna a la izquierda.
   - Las listas muestran más columnas, el álbum pone la carátula a un lado y el reproductor se parte en dos.
   ===================================================================================================== */
@media (orientation: landscape) and (max-height: 520px) {
  :root { --col: 100%; --rail: calc(86px + env(safe-area-inset-left, 0px)); --mini-h: 54px; --safe-t: 0px; --safe-b: 0px; }
  #app {
    display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "rail top" "rail stage"; padding-right: env(safe-area-inset-right, 0px); height: var(--app-h, 100%);
  }
  .topbar { grid-area: top; padding: 8px 16px 6px; }
  .brand { flex-direction: row; align-items: baseline; gap: 8px; }
  .brand span { margin-top: 0; }
  .avatar { width: 32px; height: 32px; font-size: 13px; }
  #stage { grid-area: stage; }
  .tabbar {
    grid-area: rail; display: flex; flex-direction: column; justify-content: center; gap: 4px; width: auto; height: auto;
    padding: 8px 0 8px env(safe-area-inset-left, 0px); border-top: 0; border-right: 1px solid var(--line);
  }
  .tab { flex: none; min-height: 52px; padding: 6px 0; }
  .tab .icon { font-size: 22px; }
  .page { padding: 2px 16px 20px; }
  .mini { left: calc(var(--rail) + 10px); right: calc(10px + env(safe-area-inset-right, 0px)); bottom: 10px; max-width: 560px; }
  body.has-mini .page { padding-bottom: calc(var(--mini-h) + 24px); }
  .toast { bottom: calc(var(--mini-h) + 24px); }

  .h1 { font-size: 22px; margin: 2px 0 10px; }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .hero { min-height: 128px; }
  .section { margin-top: 18px; }

  /* Álbum / artista / lista: carátula a la izquierda, datos y botones a la derecha */
  .detail-head { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 18px; align-items: center; text-align: left; justify-items: start; }
  .detail-head .cover, .artist-head .cover { grid-row: 1 / span 4; width: 150px; margin: 0; }
  .detail-head > :not(.cover) { grid-column: 2; }
  .detail-head h1 { font-size: 20px; }
  .actions { justify-content: flex-start; margin: 8px 0 0; }

  /* Reproductor expandido en dos columnas: carátula | datos y controles */
  .player .inner {
    display: grid; grid-template-columns: minmax(0, 40%) minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; column-gap: 26px;
    padding: 8px max(24px, env(safe-area-inset-right, 0px)) 8px max(24px, env(safe-area-inset-left, 0px)); align-content: center;
  }
  .player .top { grid-column: 2; grid-row: 1; }
  .player .art { grid-column: 1; grid-row: 1 / span 5; padding: 8px 0; }
  .player .art .cover { width: min(100%, calc(100vh - 28px)); }
  .player .info { grid-column: 2; grid-row: 2; }
  .player .seek { grid-column: 2; grid-row: 3; margin-top: 6px; }
  .player .controls { grid-column: 2; grid-row: 4; margin: 2px 0; }
  .player .bottom { grid-column: 2; grid-row: 5; align-self: start; }
  .controls .play { width: 62px; height: 62px; font-size: 30px; }
  .controls .icon-btn { width: 46px; height: 46px; }
  .player .info h2 { font-size: 19px; }

  /* Hojas y ventanas: más compactas */
  .sheet { max-height: 92vh; width: min(100%, 520px); }

  /* Entrada: se puede desplazar si no cabe */
  .gate { overflow-y: auto; justify-content: flex-start; padding: 16px max(24px, env(safe-area-inset-left, 0px)) 16px max(24px, env(safe-area-inset-right, 0px)); }
  .gate > * { width: min(100%, 440px); margin-left: auto; margin-right: auto; }
  .gate .logo { width: min(40vh, 220px); margin-bottom: 4px; }
  .gate .tagline { margin-bottom: 12px; }
  .gate .pending-ico { width: 56px; height: 56px; font-size: 26px; }
}

/* ---------- Onkyo ---------- */
.onk-status { font-size: 14px; color: var(--muted); margin-bottom: 12px; }
.onk-status.bad { color: #ff8b8f; }
.onk-now { min-height: 0; margin-bottom: 4px; }
.onk-now .t { font: 700 16px var(--font-title); }
.onk-now .s { color: var(--muted); font-size: 13px; margin-top: 2px; }
.onk-ctl { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0; }
.onk-ctl:empty { display: none; }
.onk-ctl .play { width: 56px; height: 56px; border-radius: 50%; background: var(--gold); color: var(--bg); font-size: 26px; display: grid; place-items: center; }
.onk-vol { display: flex; align-items: center; gap: 10px; margin: 8px 0 14px; color: var(--muted); }
.onk-vol .icon { font-size: 22px; flex: none; }
.onk-vol .range { flex: 1; }
.onk-vol-n { width: 28px; text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.onk-actions { display: flex; flex-direction: column; gap: 10px; }
.onk-hint { color: var(--muted); font-size: 12.5px; text-align: center; margin: 12px 0 0; }
