/* ZAIDE para iPhone — mismo estilo que la app de Android (morado y dorado) */
@font-face { font-family: "Sora"; src: url("/assets/fonts/sora.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0a0613; --surface: #140c22; --surface2: #1e1431; --line: rgba(255,255,255,.1);
  --purple: #8b5cf6; --purple-l: #b79cff; --purple-d: #4c1d95; --gold: #f5c451; --gold-d: #d99a1e;
  --text: #f5f1ff; --muted: #a79cc2; --pink: #ff6b9a;
  --gold-grad: linear-gradient(135deg, #ffe39a, #f5c451 45%, #d99a1e);
  --purple-grad: linear-gradient(135deg, #9f7afa, #6d28d9);
  --top: env(safe-area-inset-top, 0px); --bottom: env(safe-area-inset-bottom, 0px);
  --tabs-h: calc(62px + var(--bottom)); --mini-h: 0px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.4 -apple-system, "SF Pro Text", system-ui, sans-serif; }
/* Que se sienta app y no página: la ventana no rebota, no se selecciona texto ni salen menús al mantener pulsado */
body { position: fixed; inset: 0; overscroll-behavior: none; -webkit-text-size-adjust: 100%; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; touch-action: manipulation; }
input, textarea, .field { -webkit-user-select: text; user-select: text; }
body.has-mini { --mini-h: 72px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
img { display: block; }
h1, h2, h3, .display { font-family: "Sora", system-ui, sans-serif; letter-spacing: -.02em; margin: 0; }
.muted { color: var(--muted); }
.gold { color: var(--gold); }

#view, #page { position: fixed; inset: 0; overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: contain; scrollbar-width: none; padding: calc(var(--top) + 14px) 0 calc(var(--tabs-h) + var(--mini-h) + 24px); }
#view::-webkit-scrollbar, #page::-webkit-scrollbar { display: none; }
#page { background: var(--bg); z-index: 20; box-shadow: -12px 0 30px -12px rgba(0,0,0,.7); }
#page:empty { display: none; }
#page.enter { animation: push .34s cubic-bezier(.2,.8,.2,1); }
@keyframes push { from { transform: translateX(100%); } }
/* Barra de estado: franja con desenfoque para que el contenido no se mezcle con la hora y la batería */
body::before { content: ""; position: fixed; left: 0; right: 0; top: 0; height: var(--top); z-index: 35; background: rgba(10,6,19,.6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); pointer-events: none; }

/* Respuesta al tocar, como en las apps nativas */
/* Solo en botones de acción: lo que está en filas que se deslizan no se mueve al apoyar el dedo */
.btn, .pill, .controls button, .mini .ctl, .remote .rc button { transition: transform .12s ease, opacity .12s ease; }
.btn:active, .pill:active, .controls button:active, .mini .ctl:active, .remote .rc button:active { transform: scale(.94); }
#tabs button:active, .back:active, .fhead button:active, .more:active { opacity: .5; }
.mini .swipe { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.hero { padding: 6px 20px 8px; background: linear-gradient(180deg, #2a1250, var(--bg)); margin-top: calc(-1 * (var(--top) + 14px)); padding-top: calc(var(--top) + 24px); }
.hero .row { display: flex; align-items: center; gap: 8px; }
.hero h1 { font-size: 30px; font-weight: 800; flex: 1; }
.section { padding: 22px 16px 10px; display: flex; align-items: center; gap: 8px; }
.section h2 { font-size: 21px; font-weight: 700; flex: 1; }

/* Filas horizontales de tarjetas */
.shelf { display: flex; gap: 10px; overflow-x: auto; padding: 0 16px 4px; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.shelf::-webkit-scrollbar { display: none; }
.card { flex: 0 0 140px; width: 140px; min-width: 0; overflow: hidden; text-align: left; }
.card.small { flex-basis: 112px; width: 112px; }
.card .art { width: 100%; aspect-ratio: 1; border-radius: 12px; }
.card.round .art { border-radius: 50%; }
.card b { display: block; margin-top: 8px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.art { background: var(--purple-grad) center / cover no-repeat; flex: none; position: relative; overflow: hidden; }
.art.ph::after { content: "♪"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.85); font-size: 26px; }

/* Listas de canciones */
.track { display: flex; align-items: center; gap: 12px; padding: 7px 16px; width: 100%; text-align: left; }
.track .art { width: 52px; height: 52px; border-radius: 10px; }
.track .meta { flex: 1; min-width: 0; }
.track .t { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track.on .t { color: var(--gold); }
.track .s { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.track .more { width: 36px; height: 36px; display: grid; place-items: center; color: var(--muted); font-size: 20px; flex: none; }
.tag { font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: rgba(245,196,81,.16); color: var(--gold); flex: none; }
.tag.hi { background: var(--gold-grad); color: #1c1300; }

/* Accesos rápidos y géneros */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 6px 16px; }
.quick button { display: flex; align-items: center; gap: 10px; height: 56px; background: var(--surface2); border-radius: 8px; overflow: hidden; text-align: left; }
.quick .art { width: 56px; height: 56px; }
.quick b { font-size: 13px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-right: 8px; }
.genres { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.genres button { height: 92px; border-radius: 12px; padding: 14px; text-align: left; font: 800 18px "Sora", sans-serif; color: #fff; align-items: flex-start; display: flex; }

.zcard { margin: 10px 16px; padding: 16px; border-radius: 18px; background: var(--purple-grad); display: flex; align-items: center; gap: 12px; }
.zcard div { flex: 1; }
.zcard b { display: block; font-size: 16px; }
.zcard span { font-size: 13px; opacity: .85; }
.btn { background: var(--gold-grad); color: #1c1300; font-weight: 700; border-radius: 14px; padding: 12px 18px; display: inline-flex; align-items: center; gap: 8px; }
.btn.ghost { background: var(--surface2); color: var(--text); border: 1px solid var(--line); }
.btn.discord { background: #5865f2; color: #fff; width: 100%; justify-content: center; }
.pill { white-space: nowrap; border: 1px solid var(--line); background: var(--surface2); color: var(--muted); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: 13px; }
.pill.on { border-color: var(--gold); color: var(--text); background: rgba(245,196,81,.18); }

.install { margin: 8px 16px; padding: 12px 14px; border-radius: 14px; background: var(--surface2); border: 1px solid var(--line); font-size: 13px; display: flex; gap: 10px; align-items: center; }
.install b { color: var(--gold); }
.install button { color: var(--muted); font-size: 18px; }

/* Buscador */
.search { margin: 10px 16px; display: flex; align-items: center; gap: 10px; background: var(--surface); border: 2px solid var(--line); border-radius: 16px; padding: 0 14px; }
.search:focus-within { border-color: var(--purple); }
.search input { flex: 1; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; padding: 14px 0; }
.recent { display: flex; align-items: center; gap: 12px; padding: 6px 4px 6px 16px; width: 100%; text-align: left; }
.recent .art, .recent .ico { width: 52px; height: 52px; border-radius: 10px; }
.recent .ico { display: grid; place-items: center; background: var(--surface2); border-radius: 50%; color: var(--muted); }
.empty { padding: 40px 32px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 17px; margin-bottom: 6px; }
.spin { width: 30px; height: 30px; border: 3px solid rgba(245,196,81,.25); border-top-color: var(--gold); border-radius: 50%; animation: spin .8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Página de colección (mix, álbum, género) */
.coll-head { text-align: center; padding: 8px 24px 6px; margin-top: calc(-1 * (var(--top) + 14px)); padding-top: calc(var(--top) + 8px); }
.coll-head .art { width: 210px; height: 210px; margin: 8px auto 16px; border-radius: 16px; box-shadow: 0 20px 60px -20px rgba(0,0,0,.8); }
.coll-head h1 { font-size: 24px; }
.back { display: block; text-align: left; font-size: 26px; padding: 6px 4px; }
.actions { display: flex; gap: 10px; padding: 12px 16px; align-items: center; }

/* Mini reproductor y pestañas */
#mini { position: fixed; left: 8px; right: 8px; bottom: calc(var(--tabs-h) + 4px); z-index: 30; }
#mini:empty { display: none; }
.mini { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 16px; background: linear-gradient(90deg, #2a1452, #1b1030); box-shadow: 0 10px 30px -10px #000; position: relative; overflow: hidden; }
.mini .art { width: 46px; height: 46px; border-radius: 10px; }
.mini .meta { flex: 1; min-width: 0; }
.mini .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .s { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini .ctl { width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px; }
.mini .bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--gold); width: 0; }
#tabs { position: fixed; left: 0; right: 0; bottom: 0; height: var(--tabs-h); padding-bottom: var(--bottom); background: rgba(20,12,34,.96); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: flex; z-index: 31; border-top: 1px solid var(--line); }
#tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); font-size: 11px; font-weight: 600; }
#tabs button.on { color: var(--gold); }
#tabs svg { width: 24px; height: 24px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; display: inline-block; }

/* Reproductor completo */
#full { position: fixed; inset: 0; z-index: 40; background: var(--bg); transform: translateY(100%); transition: transform .32s cubic-bezier(.2,.8,.2,1); overflow: hidden; }
#full.open { transform: none; }
#full .bgart { position: absolute; inset: -40px; background: center / cover no-repeat; filter: blur(50px) saturate(1.3); opacity: .45; }
#full .shade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(10,6,19,.3), rgba(10,6,19,.85) 60%, var(--bg)); }
#full .inner { position: relative; height: 100%; display: flex; flex-direction: column; padding: calc(var(--top) + 6px) 22px calc(var(--bottom) + 12px); }
.fhead { display: flex; align-items: center; }
.fhead button { width: 44px; height: 44px; font-size: 24px; }
.fhead .lbl { flex: 1; text-align: center; font-size: 11px; letter-spacing: 2px; font-weight: 600; color: var(--muted); }
.stage { flex: 1; display: flex; align-items: center; justify-content: center; min-height: 0; position: relative; }
.stage .big { width: min(100%, 52vh); aspect-ratio: 1; border-radius: 22px; box-shadow: 0 30px 80px -25px #000; }
.stage .vid { width: 100%; aspect-ratio: 16 / 9; border-radius: 16px; }
.ftitle { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ftitle div { flex: 1; min-width: 0; }
.ftitle h2 { font-size: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ftitle p { margin: 2px 0 0; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav { font-size: 26px; color: var(--muted); width: 44px; height: 44px; }
.fav.on { color: var(--pink); }
.quality { display: flex; gap: 6px; margin-top: 6px; min-height: 18px; }
.seek { margin-top: 10px; }
.seek input { width: 100%; accent-color: var(--gold); }
.times { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.controls { display: flex; align-items: center; justify-content: space-between; margin: 6px 0; }
.controls button { width: 52px; height: 52px; font-size: 30px; display: grid; place-items: center; }
.controls .side { font-size: 20px; color: var(--muted); }
.controls .side.on { color: var(--gold); }
.controls .play { width: 74px; height: 74px; border-radius: 50%; background: var(--gold-grad); color: #1c1300; font-size: 32px; }
.fbottom { display: flex; align-items: center; justify-content: space-between; }
.fbottom button.icon { width: 44px; height: 44px; font-size: 20px; color: var(--muted); }
.fbottom button.icon.on { color: var(--gold); }
.ytnote { font-size: 11px; color: var(--muted); text-align: center; margin-top: 6px; }

/* Vídeo de YouTube (se coloca encima del hueco reservado, nunca se mueve en el DOM) */
#ytbox { position: fixed; z-index: 41; overflow: hidden; border-radius: 14px; background: #000; left: -2000px; top: 0; width: 160px; height: 90px; }
#ytbox iframe { width: 100%; height: 100%; border: 0; }

/* Letras en movimiento (estilo Apple Music) */
.lyrics { position: absolute; inset: 0; overflow-y: auto; scrollbar-width: none; padding: 30% 4px 70%;
  -webkit-mask-image: linear-gradient(180deg, transparent, #000 12%, #000 80%, transparent);
  mask-image: linear-gradient(180deg, transparent, #000 12%, #000 80%, transparent); }
.lyrics::-webkit-scrollbar { display: none; }
.lyrics p { margin: 0; padding: 10px 2px; font: 800 28px/1.22 "Sora", sans-serif; color: rgba(255,255,255,.58); text-shadow: 0 1px 14px rgba(0,0,0,.28); transform-origin: left center; transform: scale(.94); transition: transform .45s cubic-bezier(.2,.8,.2,1), color .35s, filter .35s; }
.lyrics p.past { color: rgba(255,255,255,.46); }
.lyrics p.far { filter: blur(.5px); }
.lyrics p.on { transform: none; color: transparent; -webkit-background-clip: text; background-clip: text; filter: none; text-shadow: none; }
.lyrics .dots { display: flex; gap: 10px; padding: 14px 4px; }
.lyrics .dots i { width: 14px; height: 14px; border-radius: 50%; background: #fff; animation: breathe 1.4s ease-in-out infinite; }
.lyrics .dots i:nth-child(2) { animation-delay: .18s; } .lyrics .dots i:nth-child(3) { animation-delay: .36s; }
@keyframes breathe { 0%, 100% { transform: scale(.55); opacity: .5; } 50% { transform: scale(1); opacity: 1; } }
.lyrics .none { color: var(--muted); font: 16px system-ui; text-align: center; padding-top: 40%; }
.sync { position: absolute; right: 0; bottom: 4px; display: flex; align-items: center; background: rgba(0,0,0,.4); border-radius: 99px; font-size: 12px; z-index: 2; }
.sync button { padding: 4px 14px; font-size: 20px; font-weight: 700; }
.lyrhead { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.lyrhead .art { width: 52px; height: 52px; border-radius: 10px; }
.lyrhead > div:not(.art) { flex: 1; min-width: 0; }
.lyrhead b, .lyrhead span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lyrhead span { color: var(--muted); font-size: 13px; }

/* Hojas (menús) */
#sheet:empty { display: none; }
.scrim { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; background: var(--surface); border-radius: 22px 22px 0 0; padding: 10px 0 calc(var(--bottom) + 14px); max-height: 80vh; overflow-y: auto; animation: up .25s ease-out; }
@keyframes up { from { transform: translateY(100%); } }
.sheet .grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 10px; }
.sheet .item { display: flex; gap: 16px; align-items: center; width: 100%; padding: 14px 22px; text-align: left; font-size: 15px; }
.sheet .item i { font-style: normal; width: 24px; text-align: center; color: var(--purple-l); }
.sheet .head { display: flex; gap: 12px; align-items: center; padding: 4px 20px 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.sheet .head .art { width: 52px; height: 52px; border-radius: 10px; }

#toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--mini-h) + 16px); transform: translateX(-50%) translateY(20px); background: #2b2140; color: var(--text); padding: 10px 16px; border-radius: 12px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 88vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); }

/* ZAIDE remoto */
.remote { margin: 12px 16px; padding: 18px; border-radius: 22px; background: linear-gradient(180deg, #2b1456, var(--surface)); }
.remote .now { display: flex; gap: 14px; align-items: center; margin: 12px 0; }
.remote .now .art { width: 88px; height: 88px; border-radius: 14px; }
.remote .rc { display: flex; justify-content: space-around; align-items: center; margin-top: 6px; }
.remote .rc button { width: 48px; height: 48px; font-size: 24px; }
.remote .rc .play { width: 62px; height: 62px; border-radius: 50%; background: var(--gold-grad); color: #1c1300; }
.target { display: flex; gap: 8px; align-items: center; padding: 8px 16px; font-size: 13px; color: var(--muted); }
.login { margin: 16px; padding: 24px; border-radius: 22px; background: linear-gradient(180deg, #2a1250, var(--bg)); text-align: center; }
.login .logo { width: 84px; height: 84px; margin: 0 auto 14px; border-radius: 24px; background: var(--purple-grad); display: grid; place-items: center; font: 900 44px "Sora", sans-serif; color: var(--gold); }

/* Portada encima del reproductor */
#ytbox .cover { position: absolute; inset: 0; background: var(--purple-grad) center / cover no-repeat; pointer-events: none; }
#ytbox.live .cover { pointer-events: auto; }

/* Cuenta */
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--purple-grad); color: var(--gold); font: 800 17px "Sora", sans-serif; display: grid; place-items: center; overflow: hidden; flex: none; border: 2px solid rgba(245,196,81,.5); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.form { padding: 6px 22px 10px; }
.form h2 { font-size: 22px; margin-bottom: 6px; }
.form p { margin: 4px 0 14px; }
.center { text-align: center; }
.field { display: block; width: 100%; margin-top: 10px; background: var(--bg); border: 2px solid var(--line); border-radius: 12px; padding: 13px 14px; color: var(--text); font: inherit; font-size: 16px; outline: 0; }
.field:focus { border-color: var(--purple); }
.btn.wide { width: 100%; justify-content: center; margin-top: 12px; }
.btn.danger { background: #e5484d; color: #fff; }
.btn.google { background: #fff; color: #1f1f1f; }
.btn.google .g { font: 900 19px Arial, sans-serif; background: conic-gradient(from -45deg, #ea4335 0 25%, #4285f4 0 50%, #34a853 0 75%, #fbbc05 0); -webkit-background-clip: text; background-clip: text; color: transparent; }
.btn:disabled { opacity: .6; }
.err { color: #ff8a8f; font-size: 13px; min-height: 18px; margin-top: 8px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 16px 0 4px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.acc-logo { width: 64px; height: 64px; margin: 4px auto 14px; border-radius: 20px; background: var(--purple-grad); display: grid; place-items: center; font: 900 32px "Sora", sans-serif; color: var(--gold); }

/* Modo TV */
.tv { position: relative; height: 100%; display: flex; flex-direction: column; padding: calc(var(--top) + 10px) calc(env(safe-area-inset-right, 0px) + 20px) calc(var(--bottom) + 10px) calc(env(safe-area-inset-left, 0px) + 20px); }
.tvhead { display: flex; align-items: center; justify-content: space-between; flex: none; }
.tvhead button { width: 44px; height: 44px; font-size: 18px; color: var(--muted); }
.tvlogo { display: flex; align-items: center; gap: 10px; font: 800 20px "Sora", sans-serif; letter-spacing: 2px; color: var(--gold); }
.tvlogo img { width: 34px; height: 34px; }
.tvbody { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.tvleft { flex: none; display: flex; flex-direction: column; align-items: center; text-align: center; min-width: 0; }
.tvart { width: min(60vw, 32vh); aspect-ratio: 1; border-radius: 14px; }
.tvleft h2 { font-size: 20px; margin: 10px 0 0; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvleft p { margin: 2px 0 0; color: var(--muted); max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tvctl { display: flex; align-items: center; gap: 12px; margin-top: 6px; }
.tvctl button { width: 44px; height: 44px; display: grid; place-items: center; }
.tvctl .play { border-radius: 50%; background: var(--gold-grad); color: #1c1300; }
.tvlyr { flex: 1; min-height: 0; min-width: 0; position: relative; }
.tvlyr .sync { display: none; }
@media (orientation: landscape) {
  .tvbody { flex-direction: row; gap: 32px; align-items: stretch; }
  .tvleft { width: 34%; justify-content: center; }
  .tvart { width: min(100%, 46vh); }
  .tvlyr .lyrics { padding-top: 12%; }
  .tvlyr .lyrics .none { padding-top: 16%; }
}
