/* Sonara — estilos. Los skins cambian solo variables. */
:root, [data-skin="tinta"] {
  --bg: #14131A; --bg-2: #1D1C25; --card: #23222C; --fg: #F4EDE4; --muted: #9C97A6; --line: #34323F;
  --accent: #FF6B57; --accent-2: #FFB199; --on-accent: #14131A; --radius: 18px; --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", system-ui, sans-serif; --shadow: 0 10px 40px rgba(0,0,0,.35);
}
[data-skin="arena"] {
  --bg: #F4EDE4; --bg-2: #EBE2D6; --card: #FFFFFF; --fg: #14131A; --muted: #786F69; --line: #E0D5C7;
  --accent: #E8503C; --accent-2: #FF9A82; --on-accent: #FFFFFF; --shadow: 0 10px 30px rgba(60,40,20,.12);
}
[data-skin="neon"] {
  --bg: #07060F; --bg-2: #0F0D1F; --card: #15122B; --fg: #F2F0FF; --muted: #8C86B0; --line: #2A2550;
  --accent: #3DF5D2; --accent-2: #FF4FD8; --on-accent: #07060F; --radius: 12px; --shadow: 0 0 30px rgba(61,245,210,.18);
}
[data-skin="vinilo"] {
  --bg: #2B1E16; --bg-2: #352619; --card: #3E2D1F; --fg: #F7E7C9; --muted: #C2A783; --line: #574030;
  --accent: #F2A23A; --accent-2: #D9583B; --on-accent: #2B1E16; --radius: 24px; --display: Georgia, "Times New Roman", serif;
  --shadow: 0 10px 30px rgba(0,0,0,.4);
}
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); color: var(--fg); font-family: var(--font); }
body { margin: 0; min-height: 100dvh; background: var(--bg); transition: background .3s, color .3s; overscroll-behavior-y: none; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; margin: .2em 0; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; margin-top: 1.2em; }
.muted { color: var(--muted); } .tiny { font-size: .78rem; } .center { text-align: center; justify-content: center; }
.view { max-width: 980px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 10px) 16px calc(150px + env(safe-area-inset-bottom)); }
body[data-view="sala"] .view { max-width: none; padding-bottom: 90px; }
body.guest .view { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 52px; }
.top h2 { flex: 1; text-align: center; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; margin: 0; }
.logo { width: 32px; height: 32px; flex: none; }
.logo-big .logo { width: 84px; height: 84px; }
.pill { font-size: .7rem; background: var(--accent); color: var(--on-accent); padding: 2px 8px; border-radius: 99px; vertical-align: middle; font-family: var(--font); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--card); padding: 11px 18px; border-radius: 99px; font-weight: 600; text-decoration: none; transition: transform .1s, background .2s; min-height: 44px; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: transparent; }
.btn.sm { padding: 6px 13px; min-height: 34px; font-size: .86rem; }
.btn.wide { width: 100%; margin-top: 8px; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .4; }
.icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; font-size: 1.3rem; flex: none; }
.icon-btn svg { width: 24px; height: 24px; fill: currentColor; }
.icon-btn.lg svg { width: 32px; height: 32px; } .icon-btn.lg { width: 56px; height: 56px; }
.icon-btn.xl { width: 76px; height: 76px; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); }
.icon-btn.xl svg { width: 34px; height: 34px; }
.icon-btn.on { color: var(--accent); } .icon-btn.ghost { color: var(--muted); }
.icon-btn.fav.on { color: var(--accent); }

.search, input:not([type]), input[type=search], textarea, #lickey { width: 100%; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: none; }
.search:focus, textarea:focus, input:focus { border-color: var(--accent); }
textarea { resize: vertical; line-height: 1.6; margin: 8px 0; }
.seg { display: flex; gap: 6px; margin: 12px 0; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 99px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.seg button.on { background: var(--fg); color: var(--bg); }
.list-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 10px 0; }

.rows { list-style: none; padding: 0; margin: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 8px 6px; border-radius: 12px; cursor: pointer; }
.row:hover { background: var(--bg-2); }
.row.on b { color: var(--accent); }
.row-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.row-txt b, .row-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-txt small, .dur { color: var(--muted); font-size: .82rem; }

.cover { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: calc(var(--radius) * .7); background: var(--bg-2); display: block; }
.cover.ph { display: grid; place-items: center; font-family: var(--display); font-size: 2rem; color: var(--accent); background: linear-gradient(135deg, var(--card), var(--bg-2)); }
.cover.xs { width: 46px; height: 46px; border-radius: 10px; font-size: 1.1rem; flex: none; }
.cover.sm { width: 48px; height: 48px; border-radius: 10px; font-size: 1.1rem; flex: none; }
.cover.round { border-radius: 50%; }
.cover.lg { width: 160px; height: 160px; flex: none; }
.cover.xl { width: min(78vw, 400px); margin: 0 auto; box-shadow: var(--shadow); border-radius: var(--radius); font-size: 5rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.tile { border: 0; background: transparent; text-align: left; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.tile b, .tile small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .tile small { color: var(--muted); font-size: .82rem; }
.tile b { margin-top: 6px; }
.detail-head { display: flex; gap: 18px; align-items: flex-end; margin-bottom: 14px; flex-wrap: wrap; }

.empty { min-height: 70dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; max-width: 460px; margin: 0 auto; }
.empty input { max-width: 340px; }
.hero-emoji { font-size: 3rem; }

/* mini reproductor */
.mini { position: fixed; left: 10px; right: 10px; bottom: calc(68px + env(safe-area-inset-bottom)); max-width: 960px; margin: 0 auto; display: flex; align-items: center; gap: 4px; padding: 7px 8px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; z-index: 5; border: 1px solid var(--line); }
.mini-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 0; }
.mini-txt { min-width: 0; display: flex; flex-direction: column; }
.mini-txt b, .mini-txt small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .mini-txt small { color: var(--muted); font-size: .8rem; }
.mini-bar { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--accent); }
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 6; }
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .7rem; color: var(--muted); padding: 4px; }
.tabbar svg { width: 24px; height: 24px; fill: currentColor; }
.tabbar button.on { color: var(--accent); }

/* reproduciendo */
.now { display: flex; flex-direction: column; gap: 12px; max-width: 520px; margin: 0 auto; }
.stage { position: relative; display: grid; place-items: center; margin-top: 4px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .4s; pointer-events: none; }
.stage.viz-on .cover { opacity: .12; filter: blur(8px); transition: .4s; }
.stage.viz-on canvas { opacity: 1; }
.now-meta { display: flex; align-items: center; gap: 10px; }
.now-meta > div { flex: 1; min-width: 0; }
.now-meta h1 { font-size: 1.45rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.now-meta p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; background: transparent; height: 28px; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); margin-top: -7px; border: 0; }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 0; }
.times { display: flex; justify-content: space-between; color: var(--muted); margin-top: -4px; }
.controls { display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.now-tools { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.now-tools button { border: 1px solid var(--line); background: transparent; border-radius: 99px; padding: 7px 14px; font-size: .85rem; color: var(--muted); }
.lyrics-panel { background: var(--bg-2); border-radius: var(--radius); padding: 14px; max-height: 50vh; overflow-y: auto; }
.lyr-tools { display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; position: sticky; top: -14px; background: var(--bg-2); padding: 4px 0 8px; }
.lyr { list-style: none; padding: 0; margin: 0; font-family: var(--display); font-size: 1.25rem; line-height: 1.5; }
.lyr li { padding: 6px 4px; border-radius: 8px; cursor: pointer; color: var(--muted); transition: color .3s, transform .3s; }
.lyr.synced li.on { color: var(--fg); transform: scale(1.03); transform-origin: left; font-weight: 700; }
.lyr:not(.synced) li { color: var(--fg); cursor: default; }

/* ecualizador */
.eq-curve { height: 110px; background: var(--bg-2); border-radius: var(--radius); margin: 8px 0 14px; }
.eq-curve canvas { width: 100%; height: 100%; display: block; }
.bands { display: grid; gap: 4px; align-items: end; }
.bands.b12 { grid-template-columns: repeat(12, 1fr); } .bands.b5 { grid-template-columns: repeat(5, 1fr); }
.band { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .72rem; color: var(--muted); }
.band output { font-variant-numeric: tabular-nums; color: var(--fg); }
.band .vert { writing-mode: vertical-lr; direction: rtl; width: 28px; height: 180px; }
.band .vert::-webkit-slider-runnable-track { width: 4px; height: 100%; }
.band .vert::-webkit-slider-thumb { margin-top: 0; margin-left: -7px; }
.preamp { display: flex; align-items: center; gap: 10px; margin: 14px 0; font-size: .9rem; }
.preamp input { flex: 1; } .preamp output { min-width: 48px; text-align: right; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--card); border-radius: 99px; padding: 8px 14px; font-weight: 600; font-size: .86rem; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: transparent; }

/* skins */
.skins { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.skin-card { border: 2px solid var(--line); border-radius: var(--radius); background: var(--card); padding: 12px; text-align: left; display: flex; flex-direction: column; gap: 4px; }
.skin-card.on { border-color: var(--accent); }
.skin-card small { color: var(--muted); }
.sk-prev { display: flex; gap: 6px; height: 64px; border-radius: 12px; padding: 10px; margin-bottom: 6px; }
.sk-prev i { flex: 1; border-radius: 6px; }
[data-skin-preview="arena"] .sk-prev { background: #F4EDE4; } [data-skin-preview="arena"] i:nth-child(1) { background: #E8503C; } [data-skin-preview="arena"] i:nth-child(2) { background: #14131A; } [data-skin-preview="arena"] i:nth-child(3) { background: #FFFFFF; }
[data-skin-preview="tinta"] .sk-prev { background: #14131A; } [data-skin-preview="tinta"] i:nth-child(1) { background: #FF6B57; } [data-skin-preview="tinta"] i:nth-child(2) { background: #F4EDE4; } [data-skin-preview="tinta"] i:nth-child(3) { background: #23222C; }
[data-skin-preview="neon"] .sk-prev { background: #07060F; } [data-skin-preview="neon"] i:nth-child(1) { background: #3DF5D2; } [data-skin-preview="neon"] i:nth-child(2) { background: #FF4FD8; } [data-skin-preview="neon"] i:nth-child(3) { background: #15122B; }
[data-skin-preview="vinilo"] .sk-prev { background: #2B1E16; } [data-skin-preview="vinilo"] i:nth-child(1) { background: #F2A23A; } [data-skin-preview="vinilo"] i:nth-child(2) { background: #D9583B; } [data-skin-preview="vinilo"] i:nth-child(3) { background: #F7E7C9; }

/* ajustes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 8px 0 14px; }
.inline { display: flex; gap: 8px; margin-top: 8px; } .inline input { flex: 1; text-transform: uppercase; }
.menu { list-style: none; padding: 0; margin: 0; background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.menu li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); cursor: pointer; flex-wrap: wrap; }
.menu li:last-child { border-bottom: 0; }
.menu li > small { color: var(--muted); }
.menu li input[type=range] { width: 100%; }
.menu.info li { cursor: default; } .menu.info small { word-break: break-all; text-align: right; max-width: 65%; }
.menu .danger { color: #E5484D; }
.switch { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; }
.switch input { width: 46px; height: 28px; appearance: none; -webkit-appearance: none; background: var(--line); border-radius: 99px; position: relative; flex: none; transition: .2s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: .2s; }
.switch input:checked { background: var(--accent); } .switch input:checked::after { left: 21px; }
.perks { padding-left: 1.1em; line-height: 1.8; }

/* karaoke */
.kara { display: flex; flex-direction: column; gap: 14px; }
.kara-head { display: flex; gap: 12px; align-items: center; } .kara-head div { display: flex; flex-direction: column; }
.kara-lines { min-height: 240px; display: flex; flex-direction: column; justify-content: center; text-align: center; gap: 10px; background: var(--bg-2); border-radius: var(--radius); padding: 20px; }
.kara-lines p { margin: 0; font-family: var(--display); }
.k-prev, .k-next { color: var(--muted); font-size: 1.05rem; min-height: 1.3em; }
.k-cur { font-size: clamp(1.5rem, 6vw, 2.4rem); font-weight: 800; line-height: 1.25; min-height: 1.3em; }
.kara-lines.big .k-cur { font-size: clamp(2rem, 5vw, 4.4rem); } .kara-lines.big .k-prev, .kara-lines.big .k-next { font-size: clamp(1.1rem, 2.4vw, 2rem); }
.fill { background: linear-gradient(90deg, var(--accent) var(--f), var(--fg) var(--f)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.count { color: var(--accent); font-size: 1.4em; }
.kara-score { display: flex; align-items: baseline; justify-content: center; gap: 8px; position: relative; padding-bottom: 10px; }
.kara-score b { font-size: 2.4rem; font-family: var(--display); color: var(--accent); font-variant-numeric: tabular-nums; }
.kara-score #k-note { min-width: 3em; color: var(--muted); }
#k-level { position: absolute; bottom: 0; left: 20%; right: 20%; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent) calc(var(--l, 0) * 100%), var(--line) 0); }
.tap { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.t-done, .t-next { color: var(--muted); min-height: 1.3em; margin: 0; }
.t-cur { font-size: 1.6rem; font-weight: 800; font-family: var(--display); margin: 0; min-height: 2.6em; }
.tap-btn { width: 180px; height: 180px; border-radius: 50%; border: 0; background: var(--accent); color: var(--on-accent); font-size: 1.4rem; font-weight: 800; box-shadow: var(--shadow); margin: 12px 0; }
.tap-btn:active { transform: scale(.94); }

/* sala (anfitrión) */
.host { display: grid; grid-template-columns: minmax(280px, 340px) 1fr; gap: 18px; min-height: calc(100dvh - 120px); }
.host-side { background: var(--bg-2); border-radius: var(--radius); padding: 16px; overflow-y: auto; max-height: calc(100dvh - 110px); }
.join { display: flex; gap: 12px; align-items: center; background: #fff; color: #14131A; border-radius: 14px; padding: 10px; }
.join img { width: 120px; height: 120px; } .join div { display: flex; flex-direction: column; min-width: 0; }
.join .code { font-size: 2.2rem; letter-spacing: .12em; font-family: var(--display); color: #E8503C; }
.queue, .rank { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.queue li, .rank li { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 8px 10px; }
.queue li span:first-child { display: flex; flex-direction: column; min-width: 0; } .queue small { color: var(--muted); }
.queue li.mine { outline: 2px solid var(--accent); }
.q-act { display: flex; gap: 4px; }
.rank.big li { font-size: 1.15rem; padding: 14px; }
.host-stage { position: relative; display: flex; flex-direction: column; justify-content: center; gap: 18px; text-align: center; overflow: hidden; border-radius: var(--radius); background: radial-gradient(circle at 50% 120%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%), var(--bg-2); padding: 24px; }
.host-stage .kara-lines { background: transparent; }
.singer { display: flex; flex-direction: column; align-items: center; } .singer b { font-size: clamp(1.6rem, 3vw, 2.6rem); color: var(--accent); font-family: var(--display); }
.intro { font-style: italic; max-width: 680px; }
.idle h1 { font-size: clamp(2rem, 5vw, 4rem); } .idle p { font-size: 1.2rem; }
.live-pts { font-size: 1.2rem; } .live-pts b { font-size: 2.4rem; color: var(--accent); font-family: var(--display); }
.reacts { position: absolute; inset: 0; pointer-events: none; }
.react { position: absolute; bottom: -10px; font-size: 3rem; display: flex; flex-direction: column; align-items: center; animation: up 3.2s ease-out forwards; }
.react small { font-size: .8rem; background: var(--card); padding: 1px 8px; border-radius: 99px; }
@keyframes up { to { transform: translateY(-80vh) scale(1.2); opacity: 0; } }

/* invitado */
.guest-join input { text-align: center; font-size: 1.2rem; }
.react-bar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; padding: 10px 8px calc(10px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
.react-bar button { font-size: 1.8rem; border: 0; background: none; transition: transform .15s; }
.react-bar button.pop { transform: scale(1.5); }
.gbody .singer { margin: 12px 0; }

/* hojas, avisos y progreso */
.sheet { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 20; }
.sheet.open { opacity: 1; pointer-events: auto; }
.sheet-card { width: 100%; max-width: 520px; background: var(--bg); border-radius: 24px 24px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); transform: translateY(30px); transition: transform .25s; max-height: 85vh; overflow-y: auto; }
.sheet.open .sheet-card { transform: none; }
.toast { position: fixed; left: 50%; bottom: calc(140px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 99px; font-weight: 600; opacity: 0; transition: .25s; z-index: 30; max-width: 90vw; text-align: center; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.progress { position: fixed; left: 16px; right: 16px; top: calc(12px + env(safe-area-inset-top)); max-width: 520px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; z-index: 25; overflow: hidden; box-shadow: var(--shadow); }
.progress small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.progress i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width .2s; }

@media (min-width: 900px) {
  body:not(.guest) .now { max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 40px; align-items: center; }
  .now .top, .now .lyrics-panel { grid-column: 1 / -1; }
  .now .stage { grid-row: 2 / span 4; }
  .cover.xl { width: 100%; }
}
@media (max-width: 760px) {
  .host { grid-template-columns: 1fr; } .host-side { max-height: none; order: 2; } .host-stage { min-height: 60vh; }
  .bands.b12 .vert { height: 150px; width: 22px; } .band { font-size: .62rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
