/* Noiserun – index2: scéna ako hlavná vec
   Rozhranie je sklo nad scénou a preberá jej tému (svetlá / tmavá).
   Všetky ovládacie prvky v jednom riadku majú rovnakú výšku a stred, aby ležali v jednej rovine.
   v0.4: knižnica ako modálne okno, posuvníky skryté všade, Stlmiť nestmavuje ovládanie ani obrázky v páse. */
:root {
  --accent: #FF5C7A;
  --display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ease: cubic-bezier(.2, .75, .15, 1);
  --gut: clamp(14px, 3vw, 36px);
  --row: 44px;
  --brand: #FF5C7A;
}
body[data-theme="dark"] {
  --glass: rgba(12, 8, 24, .56);
  --glass-strong: rgba(14, 9, 28, .86);
  --text: #F7EFE6;
  --muted: rgba(247, 239, 230, .74);
  --line: rgba(247, 239, 230, .18);
  --hover: rgba(247, 239, 230, .12);
  --solid: #F7EFE6;
  --solid-text: #160C22;
  --shade: rgba(8, 5, 16, .78);
}
body[data-theme="light"] {
  --glass: rgba(255, 248, 242, .62);
  --glass-strong: rgba(255, 248, 242, .9);
  --text: #22122E;
  --muted: rgba(34, 18, 46, .72);
  --line: rgba(34, 18, 46, .16);
  --hover: rgba(34, 18, 46, .08);
  --solid: #22122E;
  --solid-text: #FFF8F2;
  --shade: rgba(255, 246, 238, .82);
}
* { box-sizing: border-box; scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: #000; color: var(--text); font: 400 16px/1.45 var(--ui); -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
canvas { display: block; image-rendering: pixelated; }

/* ---------- scéna ---------- */
.stage { position: fixed; inset: 0; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; }
.layer.on { opacity: 1; }
.dim { position: fixed; inset: 0; z-index: 1; background: #000; opacity: 0; pointer-events: none; transition: opacity 1.2s ease; }
body.dimmed .dim { opacity: .8; }
body.ended .dim { opacity: .95; transition-duration: 8s; }

/* ---------- skrývanie rozhrania ---------- */
.chrome { position: fixed; z-index: 5; transition: opacity .6s ease, transform .6s var(--ease); }
body.idle .chrome { opacity: 0; pointer-events: none; }
body.idle .topbar { transform: translateY(-10px); }
body.idle .deck { transform: translateY(14px); }
body.idle { cursor: none; }

/* ---------- stlmenie ----------
   Scéna stmavne (.dim) aj vo svetlej téme. Každý prvok rozhrania je stmavený,
   kým nad ním nie je myš alebo fokus z klávesnice; vtedy sa ukáže naplno. */
body.dimmed { --shade: rgba(3, 2, 8, .66); }
/* texty priamo nad scénou: pod nimi je teraz tma, preto svetlá farba aj vo svetlej téme */
body.dimmed .logo, body.dimmed .info, body.dimmed .group-head, body.dimmed .tile-name {
  --text: #F7EFE6; --muted: rgba(247, 239, 230, .74); color: var(--text);
}
/* ovládanie má plné sklo, aby nepreberalo stmavenú scénu pod sebou */
body.dimmed .controls { background: var(--glass-strong); }
.logo, .info, .controls, .group-head, .tile { transition: filter .35s ease; }
body.dimmed .logo, body.dimmed .info, body.dimmed .controls, body.dimmed .group-head, body.dimmed .tile { filter: brightness(.32); }
body.dimmed .logo:hover, body.dimmed .logo:focus-visible,
body.dimmed .info:hover,
body.dimmed .controls:hover, body.dimmed .controls:has(:focus-visible),
body.dimmed .group-head:hover,
body.dimmed .tile:hover, body.dimmed .tile:focus-visible { filter: none; }

/* ---------- horný riadok ---------- */
.topbar {
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 14px;
  padding: max(14px, env(safe-area-inset-top)) var(--gut) 24px;
  background: linear-gradient(var(--shade), transparent);
}
/* logo: slovo v písme nadpisov, bodka nad „i“ je pixel vo farbe aktuálneho packu
   (rovnaké štvorčeky ako pri názve packu a na kartách) */
.logo { display: inline-flex; align-items: center; height: var(--row); font: 600 21px/1 var(--display); letter-spacing: -.03em; color: var(--text); text-decoration: none; }
.logo-i { position: relative; }
.logo-i::before { content: ''; position: absolute; left: 50%; top: .18em; width: .18em; height: .18em; margin-left: -.09em; background: var(--accent); transition: background-color .6s ease; }
.pill { display: inline-flex; align-items: center; justify-content: center; height: var(--row); padding: 0 18px; border-radius: 999px; font-size: 15px; font-weight: 600; color: var(--text); background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); white-space: nowrap; }
.pill:hover { background: var(--glass-strong); }
.pill-quiet { font-weight: 500; }
.pill-solid { background: var(--solid); color: var(--solid-text); }
.pill-solid:hover { background: var(--solid); opacity: .9; }

/* ---------- spodná časť: informácie, ovládanie, pás ---------- */
.deck {
  left: 0; right: 0; bottom: 0;
  display: grid; gap: 14px;
  padding: 90px var(--gut) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--shade) 42%);
}
.info { max-width: 760px; }
.meta { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.dot { width: 10px; height: 10px; flex: none; background: var(--accent); }
.title { margin: 0; font: 600 clamp(28px, 4vw, 52px)/1.06 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.desc { margin: 8px 0 0; max-width: 62ch; font-size: 16px; color: var(--muted); }

.controls {
  display: flex; align-items: center; gap: 2px;
  width: max-content; max-width: 100%; height: 60px; padding: 0 8px;
  border-radius: 999px; background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.ctl { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--row); min-width: var(--row); padding: 0 10px; border-radius: 999px; font-size: 14px; font-weight: 500; line-height: 1; color: var(--text); white-space: nowrap; }
.ctl:hover { background: var(--hover); }
.ctl svg { width: 22px; height: 22px; flex: none; }
.ctl-main { width: 48px; min-width: 48px; height: 48px; padding: 0; margin-right: 4px; background: var(--solid); color: var(--solid-text); }
.ctl-main:hover { background: var(--solid); opacity: .9; }
.ctl-main svg { width: 24px; height: 24px; }
.ctl[aria-pressed="true"], .ctl.on { background: var(--hover); box-shadow: inset 0 -2px 0 var(--accent); }
.ctl-text { font-variant-numeric: tabular-nums; }
.ctl-vol { cursor: default; padding-right: 4px; }
.ctl-vol:hover { background: none; }
.sep { width: 1px; height: 24px; margin: 0 6px; background: var(--line); flex: none; }

input[type=range] { -webkit-appearance: none; appearance: none; width: 96px; height: var(--row); margin: 0; background: transparent; cursor: pointer; --p: 50%; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--text) 0 var(--p), var(--line) var(--p) 100%); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border: 0; border-radius: 50%; background: var(--text); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 4px; background: var(--line); }
input[type=range]::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--text); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--text); }

/* pás stôp */
.rail {
  display: flex; gap: 28px; overflow-x: auto;
  margin: 0 calc(-1 * var(--gut)); padding: 4px var(--gut) 6px;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--gut); scrollbar-width: none;
}
.rail::-webkit-scrollbar { display: none; }
.group { flex: none; }
.group-head { margin: 0 0 8px; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.group-name { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; color: var(--text); }
.group-name::before { content: ''; width: 8px; height: 8px; background: var(--accent); }
.tiles { list-style: none; margin: 0; padding: 0; display: flex; gap: 10px; }
.tile { display: grid; gap: 6px; width: 168px; text-align: left; scroll-snap-align: start; border-radius: 8px; }
.tile:focus-visible { outline: none; }
.tile-art { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: rgba(0, 0, 0, .3); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .15s; }
.tile-art canvas { width: 100%; height: 100%; }
.tile:hover .tile-art, .tile:focus-visible .tile-art { box-shadow: 0 0 0 2px var(--text); }
.tile[data-state="playing"] .tile-art { box-shadow: 0 0 0 2px var(--accent); }
.tile-name { font-size: 13px; font-weight: 500; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile[data-state="playing"] .tile-name, .tile[data-state="shown"] .tile-name, .tile:hover .tile-name { color: var(--text); }
.tile-flag:empty { display: none; }
.tile-flag { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; min-width: 24px; height: 24px; padding: 0 5px; border-radius: 999px; background: rgba(10, 6, 19, .72); color: #fff; font-size: 11px; font-weight: 600; }
.tile-flag svg { width: 14px; height: 14px; }
.tile-soon .tile-art { background: repeating-conic-gradient(rgba(127, 127, 160, .28) 0 25%, rgba(40, 30, 60, .4) 0 50%) 0 0 / 4px 4px; }
.tile-soon .tile-flag { top: auto; bottom: 6px; right: 6px; }
.tile-soon { cursor: default; opacity: .8; }
.bars { display: flex; align-items: flex-end; gap: 2px; height: 12px; }
.bars i { width: 3px; background: currentColor; animation: eq 1s ease-in-out infinite; }
.bars i:nth-child(2) { animation-delay: -.3s; }
.bars i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 12px; } }

/* ---------- panely ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(5, 3, 12, .5); }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; margin: 0 auto;
  width: min(560px, 100%); max-height: 92vh; overflow: auto;
  border-radius: 22px 22px 0 0; background: var(--glass-strong); color: var(--text);
  -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, .3);
  animation: sheet-up .35s var(--ease);
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-art { width: 100%; aspect-ratio: 16 / 7; }
.sheet-body { padding: 24px 24px max(24px, env(safe-area-inset-bottom)); }
.sheet h2 { margin: 0; font: 600 24px/1.2 var(--display); letter-spacing: -0.01em; }
.sheet-lead { margin: 10px 0 0; color: var(--muted); }
.offers { display: grid; gap: 10px; margin-top: 20px; }
.offer { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 16px 18px; border-radius: 14px; text-align: left; border: 1px solid var(--line); background: var(--hover); }
.offer:hover { border-color: var(--text); }
.offer-name { font-weight: 600; }
.offer-price { grid-row: span 2; align-self: center; font-weight: 600; white-space: nowrap; }
.offer-note { font-size: 14px; color: var(--muted); }
.offer-premium { border-color: var(--accent); }
.sheet-note { margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.sheet-close { height: var(--row); margin-top: 18px; padding: 0 18px; border-radius: 999px; font-weight: 600; background: var(--hover); }
.form { display: grid; gap: 8px; margin-top: 20px; }
.form label { margin-top: 8px; font-size: 15px; font-weight: 500; }
.form input { height: 50px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--hover); color: var(--text); font-size: 16px; }
.form .pill { justify-self: start; margin-top: 14px; }

/* ---------- tlačidlá v hornej lište ---------- */
.pill svg { width: 20px; height: 20px; flex: none; }
.count:empty { display: none; }
.ctl .count { margin-left: -2px; }
.count { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 700; line-height: 20px; text-align: center; }

/* ---------- knižnica (modálne okno) ---------- */
.lib {
  position: fixed; z-index: 21; inset: 0; margin: auto;
  width: min(1180px, calc(100% - 2 * var(--gut))); height: min(860px, calc(100% - 48px));
  display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr);
  border-radius: 22px; overflow: hidden; background: var(--glass-strong); color: var(--text);
  -webkit-backdrop-filter: blur(28px) saturate(1.2); backdrop-filter: blur(28px) saturate(1.2);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45); animation: lib-in .35s var(--ease);
}
@keyframes lib-in { from { transform: translateY(16px) scale(.985); opacity: 0; } }
.lib-head { display: flex; align-items: center; gap: 18px; padding: 16px 16px 14px 28px; border-bottom: 1px solid var(--line); }
.lib-head h2 { margin: 0; font: 600 22px/1 var(--display); letter-spacing: -.01em; }
.lib-tabs { display: flex; gap: 2px; min-width: 0; padding: 4px; border-radius: 999px; background: var(--hover); overflow-x: auto; }
.lib-tabs [role=tab] { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 16px; border-radius: 999px; font-size: 14.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.lib-tabs [role=tab]:hover { color: var(--text); }
.lib-tabs [role=tab][aria-selected="true"] { background: var(--solid); color: var(--solid-text); }
.lib-tabs [role=tab] svg { width: 18px; height: 18px; }
.lib-tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.lib-tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 44px), transparent); }
.lib-tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); mask-image: linear-gradient(to right, transparent, #000 44px, #000 calc(100% - 44px), transparent); }
.lib-tools { margin-left: auto; display: flex; align-items: center; gap: 4px; flex: none; }
.lib-x { flex: none; display: grid; place-items: center; width: var(--row); height: var(--row); border-radius: 999px; }
.lib-x:hover { background: var(--hover); }
.lib-cart { position: relative; }
.lib-cart[aria-pressed="true"] { background: var(--solid); color: var(--solid-text); }
.lib-cart .count { position: absolute; top: 0; right: -2px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; line-height: 18px; }
.lib-x svg { width: 22px; height: 22px; }
.lib-body { overflow-y: auto; overscroll-behavior: contain; padding: 22px 28px 36px; }
.pane:focus { outline: none; }
.pane-lead { margin: 0 0 16px; max-width: 72ch; color: var(--muted); }
.pane-sub { margin: 32px 0 12px; font-size: 15px; font-weight: 600; color: var(--muted); }
.empty { margin: 0 0 14px; color: var(--muted); }
.chips { display: flex; gap: 8px; margin: 0 0 18px; overflow-x: auto; }
.chip { display: inline-flex; align-items: center; gap: 6px; flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--solid); color: var(--solid-text); border-color: transparent; }
.chip svg { width: 16px; height: 16px; }

/* tlačidlá v knižnici */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--text); }
.btn:hover { background: var(--hover); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:disabled { cursor: default; opacity: .7; }
.btn-solid { background: var(--solid); color: var(--solid-text); border-color: transparent; }
.btn-solid:hover { background: var(--solid); opacity: .9; }
.btn-cart { background: var(--accent); color: #160C22; border-color: transparent; }
.btn-cart:hover { background: var(--accent); opacity: .9; }
.btn-cart.is-in { background: transparent; color: var(--text); border-color: var(--accent); }
.btn-try[aria-pressed="true"] { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); font-variant-numeric: tabular-nums; }
.link { padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; color: var(--text); }

/* single: karta s obrázkom, ukážkou a cenou */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.card { display: grid; grid-template-rows: auto 1fr auto; overflow: hidden; border-radius: 16px; border: 1px solid var(--line); background: var(--hover); transition: border-color .2s, box-shadow .2s; }
.card.trying { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.card-art { position: relative; aspect-ratio: 16 / 9; cursor: pointer; background: rgba(0, 0, 0, .25); }
.card-art canvas { width: 100%; height: 100%; }
.card-badge { position: absolute; top: 10px; left: 10px; height: 24px; padding: 0 9px; border-radius: 999px; background: rgba(10, 6, 19, .72); color: #fff; font-size: 12px; font-weight: 600; line-height: 24px; }
.card-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, .2); opacity: 0; transition: opacity .3s; }
.card-prog i { display: block; height: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 1s linear; }
.card.trying .card-prog { opacity: 1; }
.card-body { padding: 14px 16px 4px; }
.card-top { display: flex; align-items: baseline; gap: 10px; }
.card-name { flex: 1; min-width: 0; margin: 0; font: 600 17px/1.25 var(--display); letter-spacing: -.01em; }
.card-meta { margin: 5px 0 0; font-size: 13px; color: var(--muted); }
.card-pack { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.card-pack::before { content: ''; width: 7px; height: 7px; background: var(--accent); }
.card-desc { margin: 8px 0 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { display: flex; align-items: center; gap: 8px; padding: 12px 14px 14px; }
.card-actions .btn { flex: 1 1 0; min-width: 0; padding: 0 10px; }
.card-actions .btn span { overflow: hidden; text-overflow: ellipsis; }
.card-price { flex: none; font-size: 16px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-price-own, .card-price-soon { font-size: 13px; font-weight: 600; color: var(--muted); }
.card-soon .card-art { cursor: default; background: repeating-conic-gradient(rgba(127, 127, 160, .28) 0 25%, rgba(40, 30, 60, .4) 0 50%) 0 0 / 6px 6px; }
.cards-soon .card { opacity: .8; }

/* packy: štvorcové karty, obrázok cez celú plochu */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 18px; }
.pack { position: relative; isolation: isolate; aspect-ratio: 1; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: #1A1026; color: #F7EFE6; }
.pack::before { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(10, 6, 20, 0) 22%, rgba(10, 6, 20, .55) 48%, rgba(10, 6, 20, .93) 100%); }
.pack-art { position: absolute; inset: 0; z-index: -2; }
.pack-art canvas { width: 100%; height: 100%; object-fit: cover; }
.pack-season { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.pack-soon .pack-art { background: radial-gradient(circle at 70% 28%, color-mix(in srgb, var(--accent) 45%, transparent), transparent 62%), repeating-conic-gradient(rgba(127, 127, 160, .25) 0 25%, rgba(40, 30, 60, .5) 0 50%) 0 0 / 8px 8px; }
.pack-badge { position: absolute; top: 12px; left: 12px; height: 26px; padding: 0 10px; border-radius: 999px; background: rgba(10, 6, 19, .72); color: #fff; font-size: 12.5px; font-weight: 600; line-height: 26px; }
.pack-badge.is-now { background: var(--accent); color: #160C22; }
.pack-body { padding: 16px 16px 14px; }
.pack-name { margin: 0; font: 600 22px/1.15 var(--display); letter-spacing: -.01em; }
.pack-desc { margin: 6px 0 0; font-size: 14px; color: rgba(247, 239, 230, .84); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pack-meta { margin: 6px 0 0; font-size: 13px; color: rgba(247, 239, 230, .66); }
.pack-actions { display: flex; align-items: center; gap: 8px; margin-top: 12px; }
.pack-price { margin-right: auto; font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pack .btn { color: #F7EFE6; border-color: rgba(247, 239, 230, .3); }
.pack .btn:hover { background: rgba(247, 239, 230, .12); }
.pack .btn-cart { color: #160C22; border-color: transparent; }
.pack .btn-cart:hover { background: var(--accent); }
.pack .btn-cart.is-in { color: #F7EFE6; border-color: var(--accent); background: transparent; }
.style-use { margin: 0 auto 0 0; min-width: 0; }
.style-card .pack-art { background-color: #1A1026; background-position: center; }
.art-gradient { overflow: hidden; background: #140B2A; }
.art-gradient i { position: absolute; width: 90%; aspect-ratio: 1; border-radius: 50%; filter: blur(30px); opacity: .85; animation: blob 18s ease-in-out infinite alternate; }
.art-gradient i:nth-child(1) { left: -20%; top: -15%; background: #7A5CFF; }
.art-gradient i:nth-child(2) { right: -25%; top: 10%; background: #FF5C7A; animation-duration: 23s; animation-delay: -6s; }
.art-gradient i:nth-child(3) { left: 10%; bottom: -35%; background: #2EC5FF; animation-duration: 27s; animation-delay: -12s; }
body[data-theme="light"] .art-gradient { background: #FFE9DC; }
body[data-theme="light"] .art-gradient i { opacity: .7; }
@keyframes blob { from { transform: translate(-6%, -4%) scale(1); } to { transform: translate(8%, 6%) scale(1.15); } }

/* premium */
.prem { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }
.prem-hero { padding: 26px; border-radius: 18px; border: 1px solid var(--line); background: linear-gradient(135deg, color-mix(in srgb, #FF5C7A 24%, transparent), color-mix(in srgb, #7A5CFF 20%, transparent)); }
.prem-kicker { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.prem-hero h3 { margin: 12px 0 0; font: 600 26px/1.15 var(--display); letter-spacing: -.01em; }
.prem-list { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.prem-list li { display: flex; align-items: center; gap: 10px; }
.prem-list svg { width: 18px; height: 18px; flex: none; color: var(--brand); }
.prem-act { margin-top: 22px; }
.prem-note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.cmp { width: 100%; border-collapse: collapse; font-size: 15px; }
.cmp caption { margin-bottom: 8px; text-align: left; font-weight: 600; color: var(--muted); }
.cmp th, .cmp td { padding: 12px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.cmp thead th { font-size: 13px; font-weight: 600; color: var(--muted); }
.cmp tbody th { font-weight: 700; }
.cmp td:nth-child(2) { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* košík */
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.cart-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto var(--row); align-items: center; gap: 14px; padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--hover); }
.cart-art { aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: rgba(0, 0, 0, .25); box-shadow: 0 0 0 1px var(--accent); }
.cart-art canvas { width: 100%; height: 100%; }
.cart-name { margin: 0; font-weight: 600; }
.cart-kind { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.cart-price { font-weight: 700; font-variant-numeric: tabular-nums; }
.cart-x { display: grid; place-items: center; width: var(--row); height: var(--row); border-radius: 999px; color: var(--muted); }
.cart-x:hover { background: var(--hover); color: var(--text); }
.cart-x svg { width: 20px; height: 20px; }
.cart-foot { display: grid; justify-items: start; gap: 10px; max-width: 760px; margin-top: 20px; }
.cart-sum { margin: 0; font-size: 17px; color: var(--muted); }
.cart-sum strong { margin-left: 6px; font: 600 24px/1 var(--display); color: var(--text); }
.cart-up { margin: 0; color: var(--muted); }
.btn-pay { height: 48px; padding: 0 22px; font-size: 15px; }

/* ---------- toast ---------- */
.toast {
  position: fixed; z-index: 30; left: 0; right: 0; top: max(70px, calc(env(safe-area-inset-top) + 60px)); margin: 0 auto;
  width: max-content; max-width: calc(100% - 32px); padding: 11px 18px; border-radius: 999px;
  background: var(--solid); color: var(--solid-text); font-size: 15px; font-weight: 500; text-align: center;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s, transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: none; }
body.sheet-open .toast { top: auto; bottom: max(28px, env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  .layer, .chrome, .dim, .toast, .tile-art, .card-prog i, .card-prog, .logo, .logo-i::before, .info, .controls, .group-head, .tile { transition: none !important; }
  .sheet, .lib, .art-gradient i { animation: none; }
  .bars i { animation: none; height: 8px; }
}

/* ---------- mobil ---------- */
@media (max-width: 760px) {
  :root { --row: 40px; }
  .topbar { flex-wrap: wrap; row-gap: 10px; }
  .logo { font-size: 19px; }
  .pill { padding: 0 14px; font-size: 14px; }
  .deck { gap: 12px; padding-top: 70px; }
  .title { font-size: 28px; }
  .desc { font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .controls { width: 100%; height: auto; flex-wrap: wrap; justify-content: center; padding: 6px; border-radius: 22px; }
  .ctl-text span:not(.count) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ctl-text.on span, .ctl-lib span { position: static !important; width: auto !important; height: auto !important; clip: auto !important; }
  .ctl-text { padding: 0 10px; }
  .sep { display: none; }
  input[type=range] { width: 84px; }
  .tile { width: 132px; }
  .lib { width: 100%; height: 100%; border-radius: 0; }
  .lib-head { flex-wrap: wrap; gap: 10px; padding: max(12px, env(safe-area-inset-top)) 10px 10px 18px; }
  .lib-tabs { order: 3; width: 100%; }
  .lib-tabs [role=tab] { flex: 1 0 auto; justify-content: center; padding: 0 12px; }
  .lib-body { padding: 16px 16px max(28px, env(safe-area-inset-bottom)); }
  .prem { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 72px minmax(0, 1fr) auto 36px; gap: 10px; }
  .cmp th, .cmp td { padding: 10px 6px; }
}

/* ---------- prenos na TV: panel v telefóne ---------- */
.ctl#castBtn.on { color: var(--text); }
.cast-row { display: flex; gap: 10px; }
.cast-row input { flex: 1 1 0; width: 0; min-width: 0; font: 600 22px/1 var(--ui); letter-spacing: .18em; font-variant-numeric: tabular-nums; }
.cast-row .pill { margin-top: 0; height: 50px; }
.cast-err { margin: 6px 0 0; font-size: 14px; color: #FF8A9E; }
body[data-theme="light"] .cast-err { color: #B4233F; }
.cast-screens { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.cast-screens h3 { margin: 0 0 10px; font: 600 17px/1.3 var(--display); }
.cast-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cast-item { display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 14px; border-radius: 14px; background: var(--hover); }
.cast-item svg { width: 22px; height: 22px; flex: none; }
.cast-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cast-st { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cast-st::before { content: ''; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: #5BD68A; vertical-align: 1px; }
.cast-st.off::before { background: var(--muted); }
.cast-x { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; }
.cast-x:hover { background: var(--hover); }
.cast-x svg { width: 18px; height: 18px; }
.cast-opt { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: 15px; cursor: pointer; }
.cast-opt input { width: 20px; height: 20px; accent-color: var(--accent); }
.cast-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.cast-actions .sheet-close { margin-right: auto; }

/* ---------- prenos na TV: obrazovka /tv ---------- */
body.tv { cursor: none; }
body.tv.pairing { cursor: auto; }
body.tv.pairing .dim { opacity: .55; }
.tv-pair {
  position: fixed; inset: 0; z-index: 5;
  display: flex; align-items: center; justify-content: center; gap: clamp(28px, 6vw, 96px);
  padding: 5vh 6vw;
}
.tv-card { max-width: 560px; }
.tv-card .logo { margin: 0 0 3vh; font-size: clamp(22px, 2.2vw, 34px); }
.tv-card h1 { margin: 0; font: 600 clamp(26px, 3.2vw, 52px)/1.1 var(--display); letter-spacing: -0.02em; text-wrap: balance; }
.tv-steps { margin: 3vh 0 0; padding-left: 1.3em; font-size: clamp(17px, 1.6vw, 26px); color: var(--muted); }
.tv-steps li { margin: .35em 0; }
.tv-steps strong { color: var(--text); }
.tv-code { margin: 4vh 0 0; font: 600 clamp(48px, 7vw, 112px)/1 var(--display); letter-spacing: .06em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tv-exp { margin: 1.5vh 0 0; font-size: clamp(14px, 1.1vw, 18px); color: var(--muted); }
.tv-fs { margin-top: 3vh; }
.tv-qr { margin: 0; display: grid; justify-items: center; gap: 14px; }
.tv-qr canvas { width: clamp(180px, 22vw, 320px); height: auto; aspect-ratio: 1; border-radius: 18px; image-rendering: pixelated; box-shadow: 0 10px 40px rgba(0, 0, 0, .35); }
.tv-qr figcaption { font-size: clamp(14px, 1.2vw, 20px); color: var(--muted); }
.tv-now {
  position: fixed; z-index: 5; left: 0; right: 0; bottom: 0;
  padding: 120px 5vw 6vh; background: linear-gradient(transparent, var(--shade) 60%);
  opacity: 0; transform: translateY(14px); transition: opacity 1.2s ease, transform 1.2s var(--ease); pointer-events: none;
}
.tv-now.show { opacity: 1; transform: none; }
.tv-now .title { font-size: clamp(32px, 4.4vw, 72px); }
.tv-now .meta { font-size: clamp(15px, 1.3vw, 22px); }
.tv-sound {
  position: fixed; z-index: 10; left: 50%; top: 8vh; transform: translateX(-50%);
  padding: 18px 30px; border-radius: 999px; font-size: clamp(18px, 1.8vw, 28px); font-weight: 600;
  background: var(--solid); color: var(--solid-text); box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}
.tv-sound:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
body.tv .toast { top: auto; bottom: 6vh; font-size: clamp(16px, 1.4vw, 22px); padding: 14px 24px; }
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .tv-pair { flex-direction: column; text-align: center; overflow: auto; }
  .tv-steps { display: inline-block; text-align: left; }
}
@media (prefers-reduced-motion: reduce) { .tv-now { transition: none; } }
