/* Dash — dark glass UI. CSP: no inline styles; only compositor-friendly animations. */

:root {
  --bg: #05070d;
  --text: #f4f7fc;
  --muted: #a7b1c4;
  --faint: #7d889c;
  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.1);
  --glass-3: rgba(255, 255, 255, 0.16);
  --stroke: rgba(255, 255, 255, 0.1);
  --stroke-2: rgba(255, 255, 255, 0.2);
  --solid: #111725;
  --solid-2: #182033;
  --accent: #7dd3fc;
  --accent-2: #a78bfa;
  --accent-ink: #0a0f1f;
  --danger: #ff6b6b;
  --live: #e11d48;
  --ok: #34d399;
  --warn: #fcd34d;
  --radius: 24px;
  --radius-sm: 16px;
  --gap: 16px;
  --touch: 56px;
  --blur: blur(14px) saturate(150%);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  color-scheme: dark;
}

/* Per-source accents: --c / --c2 gradient, --g glow, --t tint. */
.src-youtube { --c: #ff3b3b; --c2: #ff7a45; --g: rgba(255, 59, 59, 0.42); --t: rgba(255, 59, 59, 0.2); }
.src-twitch { --c: #9b5cff; --c2: #c78bff; --g: rgba(155, 92, 255, 0.45); --t: rgba(155, 92, 255, 0.22); }
.src-iptv { --c: #3b82f6; --c2: #60c3fa; --g: rgba(59, 130, 246, 0.45); --t: rgba(59, 130, 246, 0.22); }
.src-stremio { --c: #7c3aed; --c2: #22d3ee; --g: rgba(96, 120, 240, 0.45); --t: rgba(124, 58, 237, 0.22); }
.src-kodi { --c: #17b2e7; --c2: #4fd6c9; --g: rgba(23, 178, 231, 0.42); --t: rgba(23, 178, 231, 0.2); }
.src-link { --c: #10b981; --c2: #5eead4; --g: rgba(16, 185, 129, 0.42); --t: rgba(16, 185, 129, 0.2); }
.src-browser { --c: #f59e0b; --c2: #fcd34d; --g: rgba(245, 158, 11, 0.42); --t: rgba(245, 158, 11, 0.2); }
.src-capture { --c: #06b6d4; --c2: #67e8f9; --g: rgba(6, 182, 212, 0.42); --t: rgba(6, 182, 212, 0.2); }
.src-netflix { --c: #e50914; --c2: #ff5a4f; --g: rgba(229, 9, 20, 0.42); --t: rgba(229, 9, 20, 0.2); }
.src-hbo { --c: #7b2ff7; --c2: #b46bff; --g: rgba(123, 47, 247, 0.45); --t: rgba(123, 47, 247, 0.22); }
.src-oneplay { --c: #ff6a00; --c2: #ffa23c; --g: rgba(255, 106, 0, 0.42); --t: rgba(255, 106, 0, 0.2); }
.src-pornhub { --c: #ff9000; --c2: #ffc04d; --g: rgba(255, 144, 0, 0.42); --t: rgba(255, 144, 0, 0.2); }
.src-settings, .src-other { --c: #6b7280; --c2: #a3acbb; --g: rgba(148, 163, 184, 0.3); --t: rgba(148, 163, 184, 0.14); }

* { box-sizing: border-box; }

html {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  font: 20px/1.4 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] { display: none !important; }

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

::selection { background: rgba(125, 211, 252, 0.35); }

/* ---------- Aurora background (fixed layer, transform/opacity only) ---------- */

.aurora {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 50% 120%, rgba(30, 41, 80, 0.55), transparent 60%),
    linear-gradient(180deg, #070a14 0%, #05070d 100%);
}

.aurora i {
  position: absolute;
  width: 70vmax;
  height: 70vmax;
  border-radius: 50%;
  opacity: 0.5;
  will-change: transform;
  animation: drift-a 46s ease-in-out infinite alternate;
}

.aurora i:nth-child(1) {
  left: -25vmax;
  top: -35vmax;
  background: radial-gradient(closest-side, rgba(79, 70, 229, 0.75), rgba(79, 70, 229, 0) 100%);
}

.aurora i:nth-child(2) {
  right: -30vmax;
  top: -20vmax;
  background: radial-gradient(closest-side, rgba(14, 165, 233, 0.55), rgba(14, 165, 233, 0) 100%);
  animation-name: drift-b;
  animation-duration: 58s;
}

.aurora i:nth-child(3) {
  left: 10vmax;
  bottom: -45vmax;
  background: radial-gradient(closest-side, rgba(192, 38, 211, 0.45), rgba(192, 38, 211, 0) 100%);
  animation-name: drift-c;
  animation-duration: 64s;
}

@keyframes drift-a {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.45; }
  50% { transform: translate3d(18vmax, 10vmax, 0) scale(1.15); opacity: 0.6; }
  100% { transform: translate3d(6vmax, 22vmax, 0) scale(0.95); opacity: 0.4; }
}

@keyframes drift-b {
  0% { transform: translate3d(0, 0, 0) scale(1.05); opacity: 0.4; }
  50% { transform: translate3d(-16vmax, 14vmax, 0) scale(0.9); opacity: 0.55; }
  100% { transform: translate3d(-6vmax, -4vmax, 0) scale(1.1); opacity: 0.45; }
}

@keyframes drift-c {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.35; }
  50% { transform: translate3d(20vmax, -12vmax, 0) scale(1.12); opacity: 0.5; }
  100% { transform: translate3d(-10vmax, -6vmax, 0) scale(0.92); opacity: 0.38; }
}

body[data-view="play"] .aurora { display: none; }

/* ---------- Top bar ---------- */

.topbar, #view { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 10px max(24px, env(safe-area-inset-right)) 6px max(24px, env(safe-area-inset-left));
  flex: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: var(--touch);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: 0.01em;
  text-decoration: none;
  flex: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--accent-ink);
  display: grid;
  place-items: center;
  box-shadow: 0 6px 20px rgba(125, 160, 252, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.clockbox { display: flex; align-items: baseline; gap: 14px; min-width: 0; }

.clock {
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
  color: var(--muted);
}

.date { display: none; color: var(--muted); font-size: 20px; white-space: nowrap; }

/* Views carry their own heading; the title only keeps the bar's layout (and document.title). */
.topbar-title {
  visibility: hidden;
  flex: 1;
  min-width: 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px 0 14px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--stroke);
  font-size: 18px;
  color: var(--muted);
  white-space: nowrap;
  flex: none;
}

.conn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faint);
}

.conn.is-on .conn-dot { background: var(--ok); box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18), 0 0 12px rgba(52, 211, 153, 0.8); }
.conn.is-off { color: #ffd0d0; border-color: rgba(255, 107, 107, 0.4); background: rgba(255, 70, 70, 0.12); }
.conn.is-off .conn-dot { background: var(--danger); box-shadow: 0 0 12px rgba(255, 107, 107, 0.9); animation: pulse 1.6s ease-in-out infinite; }

.btn-resume { flex: none; max-width: 420px; padding: 0 22px 0 18px; }
.btn-resume svg { width: 22px; height: 22px; }
.resume-title {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  opacity: 0.75;
}
.resume-title:empty { display: none; }
.resume-title::before { content: "· "; }

/* Home: big car-style clock with date, brand reduced to its mark. */
body[data-view="home"] .topbar { min-height: 104px; padding-top: 16px; padding-bottom: 8px; }
body[data-view="home"] .brand { display: none; }
body[data-view="home"] .clockbox { flex: 1; align-items: center; gap: 18px; }
body[data-view="home"] .clock { font-size: 60px; line-height: 1; font-weight: 300; letter-spacing: -0.02em; color: var(--text); }
body[data-view="home"] .date { display: block; font-size: 22px; color: var(--muted); }
body[data-view="home"] .topbar-title { display: none; }

/* Sub views: clock moves to the right end, small. */
body:not([data-view="home"]) .clockbox { order: 10; }
body:not([data-view="home"]) .btn-resume { display: none; }
body[data-view="pair"] .conn { display: none; }
body[data-view="play"] .topbar { display: none; }

/* ---------- Glass surfaces ---------- */

.tile, .panel, .pin-box, .player-bar, .toast, .stall-offer, .player-back, .chip, .conn {
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tile, .panel, .pin-box, .toast, .stall-offer { background-color: var(--solid) !important; }
  .player-bar, .player-back, .chip { background-color: rgba(12, 16, 26, 0.92) !important; }
}

/* ---------- Buttons & inputs ---------- */

.btn, .icon-btn {
  min-height: var(--touch);
  min-width: var(--touch);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--glass-2);
  padding: 0 22px;
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.15s var(--ease), background-color 0.15s, box-shadow 0.2s, border-color 0.2s;
}

.icon-btn { padding: 0; border-radius: 50%; }

.btn:active, .icon-btn:active { transform: scale(0.96); background: var(--glass-3); }

@media (hover: hover) {
  .btn:hover, .icon-btn:hover { background: var(--glass-3); border-color: var(--stroke-2); }
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  color: var(--accent-ink);
  box-shadow: 0 8px 24px rgba(125, 160, 252, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(0.92); }

@media (hover: hover) {
  .btn-primary:hover { background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 10px 30px rgba(125, 160, 252, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45); }
}

.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-wide { min-width: 200px; }
.btn-danger { color: var(--danger); }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn svg, .icon-btn svg { width: 26px; height: 26px; flex: none; }

.field { display: flex; flex-direction: column; gap: 8px; }

.field label { font-size: 18px; color: var(--muted); font-weight: 500; }

.input {
  min-height: 64px;
  width: 100%;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.28);
  padding: 0 20px;
  font-size: 22px;
  transition: border-color 0.15s, box-shadow 0.2s;
}

.input::placeholder { color: var(--faint); }

.input:focus {
  outline: none;
  border-color: rgba(125, 211, 252, 0.7);
  box-shadow: 0 0 0 4px rgba(125, 211, 252, 0.18);
}

.input-code { font-size: 38px; letter-spacing: 0.45em; text-align: center; font-variant-numeric: tabular-nums; font-weight: 600; padding-left: 0.45em; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: stretch; }
.row > .grow { flex: 1 1 280px; }

.muted { color: var(--muted); }
.error { color: #ff8a8a; }
p.error:empty, p.muted:empty { display: none; }
.hint { font-size: 18px; color: var(--muted); }

/* ---------- Views ---------- */

#view { flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.page {
  width: 100%;
  max-width: 1760px;
  margin: 0 auto;
  padding: 16px max(24px, env(safe-area-inset-right)) 40px max(24px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: page-in 0.2s var(--ease) backwards;
}

@keyframes page-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }

.page-narrow { max-width: 820px; }

.page h1 { margin: 0; font-size: 32px; font-weight: 700; letter-spacing: -0.01em; }
.page h2 { margin: 6px 0 0; font-size: 24px; font-weight: 650; }

.section-title { font-size: 22px; font-weight: 650; color: var(--text); margin: 0; letter-spacing: 0.01em; }

.page-head, .panel-head { display: flex; align-items: center; gap: 16px; }
.panel-head p { margin: 6px 0 0; }

.panel {
  position: relative;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.035));
  border: 1px solid var(--stroke);
  border-radius: 28px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 20px 50px rgba(0, 0, 0, 0.35);
}

.panel-hero { align-items: stretch; text-align: center; }
.panel-hero > .hero-icon { align-self: center; }

.hero-icon {
  width: 60px;
  height: 60px;
  flex: none;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--c, var(--accent)), var(--c2, var(--accent-2)));
  box-shadow: 0 10px 28px var(--g, rgba(125, 160, 252, 0.35)), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.hero-icon svg { width: 32px; height: 32px; }
.hero-brand { color: var(--accent-ink); }

.placeholder { align-items: center; text-align: center; padding: 56px 28px; }
.placeholder .hero-icon { width: 88px; height: 88px; border-radius: 26px; }
.placeholder .hero-icon svg { width: 46px; height: 46px; }
.placeholder p { margin: 0; max-width: 460px; }

/* ---------- Home tiles ---------- */

.home { max-width: none; gap: 26px; padding-top: 8px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--gap);
}

.tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 150px;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.025));
  border: 1px solid var(--stroke);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px rgba(0, 0, 0, 0.28);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.16s var(--ease), box-shadow 0.2s, border-color 0.2s;
}

/* Accent wash in the corner. */
.tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(130% 100% at 0% 0%, var(--t), transparent 62%);
}

.tile:active { transform: scale(0.97); }

@media (hover: hover) {
  .tile:hover {
    transform: translate3d(0, -3px, 0);
    border-color: var(--g);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 14px 36px var(--g);
  }
  .tile:active { transform: scale(0.97); }
}

.tile:focus-visible { outline: 2px solid var(--c); outline-offset: 3px; }

.tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--c), var(--c2));
  box-shadow: 0 8px 22px var(--g), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.tile-icon svg { width: 30px; height: 30px; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.25)); }

.tile-ext-mark { position: absolute; top: 16px; right: 16px; color: var(--faint); }
.tile-ext-mark svg { width: 20px; height: 20px; display: block; }

.tile-label { font-size: 20px; font-weight: 650; line-height: 1.2; }

.tile-text { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }

.tile-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 18px;
  line-height: 1;
  padding: 5px 10px 5px 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.32);
  color: var(--warn);
  white-space: nowrap;
}

.tile-badge svg { width: 18px; height: 18px; }

/* ---------- Recently played ---------- */

.recent { display: flex; flex-direction: column; gap: 14px; animation: page-in 0.25s var(--ease) backwards; }

/* Bleeds to the right screen edge so the next card peeks in. */
.recent-row {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scroll-padding-left: 2px;
  padding: 4px max(24px, env(safe-area-inset-right)) 12px 2px;
  margin: -4px calc(-1 * max(24px, env(safe-area-inset-right))) 0 -2px;
  scrollbar-width: none;
}

.recent-row::-webkit-scrollbar { display: none; }

.recent-card {
  position: relative;
  flex: 0 0 260px;
  scroll-snap-align: start;
  border-radius: 20px;
  background: rgba(17, 23, 37, 0.72);
  border: 1px solid var(--stroke);
  overflow: hidden;
  transition: transform 0.16s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.recent-card:active { transform: scale(0.97); }

@media (hover: hover) {
  .recent-card:hover { border-color: var(--g); box-shadow: 0 12px 30px var(--g); }
}

.recent-open {
  display: flex;
  flex-direction: column;
  width: 100%;
  padding: 0;
  margin: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}

.recent-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  background: #0b0f19;
  overflow: hidden;
}

.recent-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.recent-ph, .card-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.92);
  background:
    radial-gradient(90% 120% at 15% 0%, rgba(255, 255, 255, 0.18), transparent 55%),
    linear-gradient(135deg, var(--c), var(--c2));
}

.recent-ph svg, .card-ph svg { width: 44px; height: 44px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3)); }

.badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.badge-live { background: var(--live); }

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.75); }
}

.recent-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(255, 255, 255, 0.22); }
.recent-progress-fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--c), var(--c2)); }

.recent-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; min-width: 0; }

.recent-title {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-sub { display: flex; align-items: center; gap: 8px; font-size: 18px; color: var(--muted); }

.src-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); box-shadow: 0 0 8px var(--g); flex: none; }

.recent-remove {
  position: absolute;
  top: 0;
  right: 0;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  background: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
}

.recent-remove svg {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  stroke-width: 2.4;
  transition: transform 0.15s var(--ease), background-color 0.15s;
}

.recent-remove:active svg { transform: scale(0.9); background: rgba(255, 70, 70, 0.85); }

/* ---------- YouTube cards / lists ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--stroke);
  background: rgba(17, 23, 37, 0.72);
  border-radius: 22px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.16s var(--ease), border-color 0.2s, box-shadow 0.2s;
}

.card:active { transform: scale(0.97); }

@media (hover: hover) {
  .card:hover { border-color: var(--g); box-shadow: 0 14px 34px var(--g); }
  .card:hover .card-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.card-media { position: relative; display: block; aspect-ratio: 16 / 9; background: #0b0f19; overflow: hidden; }

.card-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }

.card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.2s, transform 0.2s var(--ease);
}

.card-play svg { width: 28px; height: 28px; margin-left: 3px; }

.card-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }

.card-title {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-sub { font-size: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.channels { display: flex; flex-direction: column; gap: 12px; }

.channel {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(17, 23, 37, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 22px;
  padding: 10px 10px 10px 12px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.channel.is-live { border-color: rgba(255, 59, 78, 0.35); box-shadow: 0 10px 30px rgba(255, 59, 78, 0.12); }

.avatar {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--c, #9b5cff), var(--c2, #c78bff));
}

.channel:not(.is-live) .avatar { filter: saturate(0.35) brightness(0.8); }

.channel-name { flex: 1; min-width: 0; font-size: 22px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--glass-2);
  color: var(--muted);
}

.pill-live { background: var(--live); color: #fff; font-weight: 700; box-shadow: 0 0 18px rgba(255, 59, 78, 0.45); }

/* ---------- Player (full-bleed) ---------- */

body[data-view="play"] #view { overflow: hidden; }

.play-page { position: relative; flex: 1; min-height: 0; background: #000; }

.player {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #000;
  user-select: none;
}

.player-stage { position: absolute; inset: 0; }

.player canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }

.player-top, .player-bar {
  transition: opacity 0.25s ease, transform 0.25s var(--ease);
}

.player.idle { cursor: none; }
.player.idle .player-top, .player.idle .player-bar { opacity: 0; pointer-events: none; }
.player.idle .player-top { transform: translate3d(0, -10px, 0); }
.player.idle .player-bar { transform: translate3d(0, 10px, 0); }

/* Top: back, source chip and title over a soft scrim. */
.player-top {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: max(16px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) 40px max(20px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0));
}

.player-back { background: rgba(20, 24, 34, 0.5); border-color: rgba(255, 255, 255, 0.14); }

.player-heading { display: flex; align-items: center; gap: 12px; min-width: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  background: rgba(20, 24, 34, 0.5);
  border: 1px solid var(--g, var(--stroke));
}

.chip svg {
  width: 26px;
  height: 26px;
  padding: 4px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c), var(--c2));
}

.player-title {
  font-size: 24px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

/* Bottom: glass control bar. */
.player-bar {
  position: absolute;
  left: max(16px, env(safe-area-inset-left));
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px;
  border-radius: 24px;
  background: rgba(16, 20, 30, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.player-bar .btn, .player-bar .icon-btn, .player-bar .select { background: rgba(255, 255, 255, 0.08); border-color: transparent; }
.player-bar .icon-btn { border-radius: var(--radius-sm); }

.player-bar .spacer { flex: 1; }

.btn-seek { padding: 0 16px 0 12px; gap: 6px; font-variant-numeric: tabular-nums; }

.player-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 84px;
  padding: 0 8px;
}

.player-time.is-live { color: #fff; padding: 6px 12px; border-radius: 999px; background: var(--live); min-width: 0; margin-left: 4px; }

.volume { display: flex; align-items: center; gap: 10px; min-height: var(--touch); padding: 0 6px; }
.volume svg { width: 26px; height: 26px; flex: none; }

.volume input[type="range"] { width: 160px; height: var(--touch); accent-color: var(--accent); background: transparent; }

.select {
  min-height: var(--touch);
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: var(--glass-2);
  padding: 0 14px;
  font-size: 20px;
  font-weight: 600;
}

.select option { background: var(--solid); }

/* Centre: spinner / state / error, fading in and out. */
.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  background: radial-gradient(60% 60% at 50% 50%, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.3));
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.player-overlay.show { opacity: 1; pointer-events: auto; }
.player-overlay p { margin: 0; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.player-overlay .error { font-size: 22px; max-width: 760px; color: #ffb3b3; }

.spinner {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  border-right-color: var(--accent-2);
  animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.play-big {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: transform 0.15s var(--ease), background-color 0.15s;
}

.play-big svg { width: 46px; height: 46px; margin-left: 6px; }
.play-big:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.24); }

.overlay-icon { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 107, 107, 0.16); color: var(--danger); }
.overlay-icon svg { width: 40px; height: 40px; }

.stall-offer {
  position: absolute;
  left: 50%;
  top: 92px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  white-space: nowrap;
  background: rgba(16, 20, 30, 0.6);
  border: 1px solid rgba(252, 211, 77, 0.35);
  border-radius: 999px;
  padding: 6px 6px 6px 22px;
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
}

.stall-offer .btn { border-radius: 999px; }

.player.fs { position: fixed; inset: 0; z-index: 50; }

/* ---------- PIN dialog ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(3, 5, 10, 0.62);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fade-in 0.18s ease both;
}

@keyframes fade-in { from { opacity: 0; } }

.pin-box {
  width: min(420px, 100%);
  background: linear-gradient(160deg, rgba(40, 48, 70, 0.75), rgba(18, 23, 36, 0.8));
  border: 1px solid var(--stroke-2);
  border-radius: 32px;
  padding: 26px 26px 18px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  animation: pop-in 0.2s var(--ease) both;
}

@keyframes pop-in { from { opacity: 0; transform: scale(0.96) translate3d(0, 10px, 0); } }

.pin-box > .hero-icon { align-self: center; width: 56px; height: 56px; }
.pin-box h2 { margin: 0; font-size: 26px; }

.pin-dots { display: flex; justify-content: center; gap: 16px; min-height: 22px; }

.pin-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); transition: transform 0.15s var(--ease), background-color 0.15s; }
.pin-dot.on { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 12px rgba(125, 211, 252, 0.7); transform: scale(1.1); }

.pin-msg { min-height: 26px; font-size: 18px; margin: 0; }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.key {
  min-height: 72px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  font-size: 32px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  display: grid;
  place-items: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: transform 0.12s var(--ease), background-color 0.12s;
}

.key:active { transform: scale(0.94); background: rgba(255, 255, 255, 0.2); }
@media (hover: hover) { .key:hover { background: rgba(255, 255, 255, 0.14); } }
.key svg { width: 32px; height: 32px; }
.key-ok { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: var(--accent-ink); font-size: 24px; font-weight: 700; }
.key-ok:active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); filter: brightness(0.9); }

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  max-width: calc(100% - 32px);
  background: rgba(30, 37, 54, 0.78);
  border: 1px solid var(--stroke-2);
  border-radius: 999px;
  padding: 14px 26px;
  z-index: 200;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transform: translate3d(-50%, 16px, 0);
  transition: opacity 0.2s ease, transform 0.2s var(--ease);
}

.toast.show { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* ---------- Large screens (1920×1200) ---------- */

@media (min-width: 1600px) and (min-height: 1000px) {
  body[data-view="home"] .topbar { min-height: 132px; padding-top: 26px; }
  body[data-view="home"] .clock { font-size: 84px; }
  body[data-view="home"] .date { font-size: 26px; }
  .conn { min-height: 52px; font-size: 20px; padding: 0 20px 0 16px; }
  .home { gap: 40px; padding-top: 22px; }
  .tiles { gap: 22px; }
  .tile { min-height: 236px; padding: 26px; border-radius: 30px; }
  .tile-icon { width: 76px; height: 76px; border-radius: 22px; }
  .tile-icon svg { width: 40px; height: 40px; }
  .tile-label { font-size: 26px; }
  .recent-card { flex-basis: 380px; border-radius: 24px; }
  .recent-title { font-size: 21px; }
  .section-title { font-size: 26px; }
}

/* ---------- Medium widths ---------- */

@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-height: 820px) and (min-width: 900px) {
  .page { padding-top: 12px; }
}

/* ---------- Phones ---------- */

@media (max-width: 700px) {
  :root { --gap: 12px; }
  .topbar { padding-left: 16px; padding-right: 16px; gap: 10px; min-height: 64px; }
  body[data-view="home"] .topbar { min-height: 88px; padding-top: 14px; }
  body[data-view="home"] .clockbox { flex-direction: column; align-items: flex-start; gap: 4px; }
  body[data-view="home"] .clock { font-size: 44px; }
  body[data-view="home"] .date { font-size: 18px; }
  body:not([data-view="home"]) .clockbox { display: none; }
  .brand-name { display: none; }
  .conn { padding: 0 14px; min-height: 44px; }
  .conn-text { display: none; }
  .resume-label, .resume-title { display: none; }
  .btn-resume { padding: 0; width: var(--touch); border-radius: 50%; }
  .page { padding-left: 16px; padding-right: 16px; }
  .page h1 { font-size: 28px; }
  /* Compact horizontal tiles, two per row. */
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile { min-height: 76px; padding: 12px; border-radius: 20px; flex-direction: row; align-items: center; justify-content: flex-start; gap: 12px; }
  .tile-icon { width: 46px; height: 46px; border-radius: 14px; flex: none; }
  .tile-icon svg { width: 26px; height: 26px; }
  .tile-label { font-size: 18px; }
  .tile-text { gap: 4px; min-width: 0; }
  .tile-ext-mark { display: none; }
  .tile-badge { font-size: 0; gap: 0; padding: 3px; }
  .tile-badge svg { width: 18px; height: 18px; }
  .home { gap: 22px; }
  .recent-card { flex-basis: 230px; }
  .recent-row { padding-right: 16px; margin-right: -16px; }
  .panel { padding: 22px; border-radius: 24px; }
  .channel .btn-text { display: none; }
  .channel .btn { padding: 0; width: var(--touch); }
  .player-bar { gap: 6px; padding: 8px; border-radius: 20px; }
  .player-bar .spacer { flex-basis: 100%; height: 0; }
  .player-bar .btn-seek { padding: 0 12px 0 8px; }
  .player-time { min-width: 0; }
  .volume input[type="range"] { width: 96px; }
  .player-title { font-size: 20px; }
  .stall-offer { white-space: normal; top: 80px; width: calc(100% - 32px); border-radius: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .aurora i, .live-dot, .conn-dot, .page, .recent, .modal, .pin-box { animation: none !important; }
  .spinner { animation-duration: 2.4s; }
  * { transition-duration: 0.01ms !important; }
}

/* ---------- IPTV ---------- */

.gchips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.gchips::-webkit-scrollbar { display: none; }

.gchip {
  flex: none;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  background: rgba(20, 24, 34, 0.5);
  border: 1px solid var(--stroke);
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
}
.gchip.is-on { background: linear-gradient(135deg, var(--c), var(--c2)); border-color: transparent; color: #fff; box-shadow: 0 6px 20px var(--g); }

.iptv-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.iptv-item { position: relative; display: flex; flex-direction: column; }
.iptv-item > .card { flex: 1; width: 100%; }
.iptv-media { background: rgba(255, 255, 255, 0.06); }
.iptv-logo { object-fit: contain; padding: 14px; box-sizing: border-box; }

.iptv-star {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 48px;
  height: 48px;
  background: rgba(10, 14, 24, 0.7);
  border-color: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.iptv-star.is-on { color: #ffd54a; }
.iptv-star.is-on svg { fill: currentColor; }

.iptv-manage { display: flex; flex-direction: column; gap: 14px; }
.iptv-manage h3 { font-size: 19px; margin: 6px 0 0; }

/* ---------- Stremio / Kodi posters ---------- */

.prows { display: flex; flex-direction: column; gap: 26px; }
.prow { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.prow-sub { color: var(--muted); font-weight: 500; font-size: 18px; }
.prow-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding: 4px 2px 14px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.prow-scroll::-webkit-scrollbar { display: none; }
.prow-scroll > .poster { flex: 0 0 180px; scroll-snap-align: start; }

.poster .card-body { padding: 10px 12px 14px; gap: 4px; }
.poster .card-title { font-size: 18px; }
.poster .card-sub { font-size: 16px; }
.poster-media { aspect-ratio: 2 / 3; background: linear-gradient(160deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)); }
.poster-media .badge { top: 10px; bottom: auto; }
.poster.is-disabled .card-thumb, .poster.is-disabled .card-ph { filter: grayscale(0.8) brightness(0.6); }
.poster-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }

.sdetail { flex-direction: row; align-items: flex-start; gap: 28px; }
.sdetail-poster { flex: 0 0 220px; border-radius: 18px; }
.sdetail-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.sdetail-year { margin: 0; font-size: 20px; }
.sdetail-desc { margin: 0; font-size: 19px; line-height: 1.5; color: var(--text); max-width: 900px; }

.streams, .sdetail-wrap { display: flex; flex-direction: column; gap: 12px; }
.sdetail-wrap { gap: 20px; }

.stream, .episode {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  min-height: 64px;
  padding: 12px 18px 12px 12px;
  font: inherit;
  color: var(--text);
  text-align: left;
  background: rgba(17, 23, 37, 0.72);
  border: 1px solid var(--stroke);
  border-radius: 20px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.16s var(--ease), border-color 0.2s;
}
.stream:active, .episode:active { transform: scale(0.985); }
@media (hover: hover) { .stream:hover, .episode:hover { border-color: var(--g); } }
.episode svg { width: 26px; height: 26px; flex: none; color: var(--c2); }
.episode.is-disabled { opacity: 0.6; }

.stream-play {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--c), var(--c2));
  box-shadow: 0 6px 18px var(--g);
}
.stream-play svg { width: 22px; height: 22px; margin-left: 2px; }
.stream-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stream-title { font-size: 19px; font-weight: 600; white-space: pre-line; line-height: 1.35; overflow-wrap: anywhere; }
.stream-addon { font-size: 16px; color: var(--muted); }

.kodi-setup { gap: 18px; }
.kodi-setup > .btn { align-self: flex-start; }
.kodi-setup .panel-head h2 { margin: 0; }
.steps { margin: 0; padding-left: 28px; display: flex; flex-direction: column; gap: 10px; font-size: 20px; line-height: 1.45; }
.steps code { font-size: 18px; background: var(--glass-2); padding: 2px 8px; border-radius: 8px; }
.kodi-form { display: flex; flex-direction: column; gap: 12px; }

@media (max-width: 640px) {
  .sdetail { flex-direction: column; align-items: center; text-align: center; }
  .sdetail-poster { flex-basis: auto; width: 180px; }
  .prow-scroll > .poster { flex-basis: 140px; }
  .poster-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* ---------- Obrazovka PC / Prohlížeč ---------- */

.remote-page { max-width: 1500px; }
.remote-panel { gap: 18px; }
.remote-panel .panel-head h1 { margin: 0; }
.feature-off .btn { margin-top: 6px; }

.capture-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); gap: 22px; align-items: start; }
.capture-preview, .capture-settings { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.capture-preview > .btn { align-self: flex-start; }

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--stroke);
}
.preview-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.preview-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; }
.preview-msg[hidden] { display: none; }

.warn-hint { display: flex; gap: 10px; align-items: flex-start; margin: 0; color: var(--warn); }
.warn-hint svg { flex: none; width: 24px; height: 24px; margin-top: 2px; }

.btn-big { min-height: 72px; font-size: 22px; font-weight: 700; background: linear-gradient(135deg, var(--c), var(--c2)); color: var(--accent-ink); border-color: transparent; }
.btn-big:active { background: linear-gradient(135deg, var(--c), var(--c2)); filter: brightness(0.92); }
@media (hover: hover) { .btn-big:hover { background: linear-gradient(135deg, var(--c), var(--c2)); box-shadow: 0 10px 30px var(--g); } }

.control-toggle { min-height: 64px; justify-content: flex-start; font-weight: 650; }
.control-toggle[disabled] { opacity: 0.5; }
.control-toggle.is-on {
  background: #b91c1c;
  border-color: #fca5a5;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.35), 0 10px 30px rgba(239, 68, 68, 0.45);
  animation: pulse 1.6s ease-in-out infinite;
}
@media (hover: hover) { .control-toggle.is-on:hover { background: #dc2626; } }

.browser-bar { flex-direction: row; align-items: center; gap: 10px; padding: 10px; flex-wrap: wrap; }
.browser-bar .icon-btn { border-radius: var(--radius-sm); }
.addr-form { flex: 1 1 320px; min-width: 0; }
.addr { width: 100%; }
.kb-panel { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; }
.kb-panel[hidden] { display: none; }
.kb-panel .grow { flex: 1 1 260px; }
.kb-panel .input { width: 100%; }

.remote-player[hidden] { display: none; }
.player.interactive { position: relative; inset: auto; display: flex; flex-direction: column; gap: 10px; background: transparent; border-radius: var(--radius); }
.player.interactive .player-top { display: none; }
.player.interactive .player-stage {
  position: relative;
  inset: auto;
  /* 16:9 and small enough that toolbar + picture + control bar fit on one screen */
  width: min(100%, calc((100vh - 320px) * 16 / 9));
  min-width: min(100%, 480px);
  align-self: center;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.player.interactive .player-bar { position: static; }
.player.interactive.idle .player-bar { opacity: 1; pointer-events: auto; transform: none; }
.touch-layer { position: absolute; inset: 0; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

@media (max-width: 900px) {
  .capture-grid { grid-template-columns: 1fr; }
}

/* ---------- Nastavení ---------- */

.manager { display: flex; flex-direction: column; gap: 16px; }
.settings-page { max-width: 1100px; }
.set-nav { margin: -6px 0 -8px; }
.set-section { scroll-margin-top: 16px; }
.set-section > .manager + .manager, .set-section > .manager + .set-form, .set-section > .set-form + .manager {
  border-top: 1px solid var(--stroke);
  padding-top: 20px;
}
.set-section .hero-icon.set-icon { width: 48px; height: 48px; border-radius: 15px; }
.set-section .hero-icon.set-icon svg { width: 26px; height: 26px; }
.set-section h2 { margin: 0; }
.set-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.set-form { display: flex; flex-direction: column; gap: 14px; }
.set-form .row > .grow { flex-basis: 200px; }
.set-label { font-size: 18px; color: var(--muted); font-weight: 500; }
.set-row { align-items: center; }
.set-row > .grow { flex: 1 1 auto; }
.set-dev { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-sub { font-size: 17px; }

.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--touch);
  width: 100%;
  padding: 8px 8px 8px 20px;
  border: 1px solid var(--stroke);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.2);
  font-size: 21px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
}
.switch:disabled { opacity: 0.6; }
.switch-track {
  position: relative;
  flex: none;
  width: 76px;
  height: 44px;
  border-radius: 999px;
  background: var(--glass-3);
  transition: background-color 0.2s;
}
.switch-knob {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s var(--ease);
}
.switch.is-on .switch-track { background: linear-gradient(135deg, var(--c, var(--accent)), var(--c2, var(--accent-2))); }
.switch.is-on .switch-knob { transform: translate3d(32px, 0, 0); }

.audit { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 18px; }
.audit li { display: flex; gap: 16px; padding: 8px 4px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
.audit-when { flex: none; width: 170px; color: var(--muted); font-variant-numeric: tabular-nums; }
.audit-what { min-width: 0; overflow-wrap: anywhere; }

.btn-ok { color: var(--ok); }

@media (max-width: 640px) {
  .audit li { flex-direction: column; gap: 2px; }
}

/* ---------- Úsporný režim (body.lite): no blur, no moving background, no glow ---------- */

body.lite .tile, body.lite .panel, body.lite .pin-box, body.lite .player-bar, body.lite .toast,
body.lite .stall-offer, body.lite .player-back, body.lite .chip, body.lite .conn {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body.lite .tile, body.lite .panel, body.lite .pin-box, body.lite .toast, body.lite .stall-offer { background: var(--solid); }
body.lite .player-bar, body.lite .player-back, body.lite .chip { background-color: rgba(12, 16, 26, 0.92); }
body.lite .aurora i { animation: none; will-change: auto; }
body.lite .page, body.lite .recent, body.lite .modal, body.lite .pin-box { animation: none; }
body.lite .tile, body.lite .panel, body.lite .card, body.lite .recent-card, body.lite .hero-icon, body.lite .tile-icon,
body.lite .btn-primary, body.lite .btn-big, body.lite .gchip.is-on, body.lite .src-dot, body.lite .pill-live,
body.lite .channel.is-live, body.lite .pin-dot.on, body.lite .conn-dot, body.lite .brand-mark {
  box-shadow: none !important;
}
