@font-face { font-family: "Inter"; src: url("/fonts/inter.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #06070a;
  --panel: rgba(17, 19, 26, 0.66);
  --panel-solid: #11131a;
  --line: rgba(255, 255, 255, 0.07);
  --line-2: rgba(255, 255, 255, 0.12);
  --text: #eef0f6;
  --muted: #8b91a3;
  --dim: #5d6273;
  --a1: #8b7bff;
  --a2: #2ad4f0;
  --accent: linear-gradient(135deg, var(--a1), var(--a2));
  --live: #ff4d6a;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --side: 540px;
  --radius: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body, #root { height: 100%; }
body {
  background: var(--bg); color: var(--text); overflow: hidden;
  font: 14px/1.4 Inter, system-ui, -apple-system, sans-serif; font-feature-settings: "cv11", "ss01", "tnum";
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select { font: inherit; color: inherit; }
kbd {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px;
  font: 600 11px/1 Inter, sans-serif; color: var(--muted); background: rgba(255,255,255,.06); border: 1px solid var(--line);
}
.muted { color: var(--muted); }
.dim { color: var(--dim) !important; }
.center { text-align: center; justify-content: center; }
.spin { animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
::selection { background: rgba(139, 123, 255, .4); }

/* ambient background */
.ambient { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.ambient i { position: absolute; width: 60vmax; height: 60vmax; border-radius: 50%; filter: blur(90px); opacity: .22; will-change: transform; }
.ambient i:nth-child(1) { background: #5b47ff; top: -25vmax; left: -15vmax; animation: drift1 26s ease-in-out infinite alternate; }
.ambient i:nth-child(2) { background: #0fb5d6; bottom: -30vmax; right: -20vmax; animation: drift2 32s ease-in-out infinite alternate; }
.ambient i:nth-child(3) { background: #b0399b; top: 30%; left: 40%; width: 40vmax; height: 40vmax; opacity: .1; animation: drift1 40s ease-in-out infinite alternate-reverse; }
@keyframes drift1 { to { transform: translate3d(12vmax, 8vmax, 0) scale(1.1); } }
@keyframes drift2 { to { transform: translate3d(-10vmax, -6vmax, 0) scale(.9); } }

.boot { height: 100%; display: grid; place-items: center; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; transform: scale(.96); } }

/* login */
.login { height: 100%; display: grid; place-items: center; position: relative; }
.login-card {
  position: relative; z-index: 1; width: min(380px, 90vw); padding: 44px 32px 28px; text-align: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 28px;
  backdrop-filter: blur(30px) saturate(1.4); -webkit-backdrop-filter: blur(30px) saturate(1.4);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.6); animation: rise .6s var(--ease) both;
}
.login-card h1 { font-size: 30px; font-weight: 750; letter-spacing: -.03em; margin-top: 16px; }
.login-card h1 span, .brand b, .welcome h1 span { background: var(--accent); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login-card p { color: var(--muted); margin: 4px 0 28px; }
.login-field { display: flex; gap: 8px; padding: 6px; border-radius: 16px; background: rgba(0,0,0,.35); border: 1px solid var(--line); transition: border-color .2s; }
.login-field:focus-within { border-color: rgba(139,123,255,.6); box-shadow: 0 0 0 4px rgba(139,123,255,.12); }
.login-field input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; padding: 0 10px; font-size: 15px; }
.login-field button { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent); color: #0b0c10; transition: transform .15s var(--ease), opacity .2s; }
.login-field button:disabled { opacity: .35; }
.login-field button:not(:disabled):active { transform: scale(.94); }
.login-err { min-height: 20px; margin-top: 12px; color: #ff8a9b; font-size: 13px; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* layout */
.app { height: 100%; display: flex; position: relative; isolation: isolate; }
.side {
  position: relative; z-index: 3; width: var(--side); flex: none; height: 100%; display: flex; flex-direction: column;
  background: var(--panel); border-right: 1px solid var(--line);
  backdrop-filter: blur(28px) saturate(1.5); -webkit-backdrop-filter: blur(28px) saturate(1.5);
  transition: transform .45s var(--ease), margin .45s var(--ease), opacity .3s;
}
.stage { position: relative; z-index: 1; flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; gap: 20px; padding: 28px 32px 24px; overflow-y: auto; transition: padding .45s var(--ease); }
.app.theater .side { margin-left: calc(-1 * var(--side)); transform: translateX(-20px); opacity: 0; }
.app.theater.peek .side { margin-left: calc(-1 * var(--side)); transform: translateX(var(--side)); opacity: 1; box-shadow: 30px 0 80px rgba(0,0,0,.5); }
.app.theater .stage { padding: 0; }
.edge { position: fixed; left: 0; top: 0; bottom: 0; width: 18px; z-index: 4; }

.side-head { display: flex; align-items: center; gap: 12px; padding: 18px 18px 14px; }
.brand { display: flex; align-items: center; gap: 9px; font-size: 18px; font-weight: 750; letter-spacing: -.03em; flex: none; }
.searchbox {
  flex: 1; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 12px; border-radius: 12px; color: var(--muted);
  background: rgba(0,0,0,.28); border: 1px solid var(--line); transition: border-color .2s, box-shadow .2s, background .2s;
}
.searchbox:focus-within { border-color: rgba(139,123,255,.55); box-shadow: 0 0 0 4px rgba(139,123,255,.12); background: rgba(0,0,0,.4); color: var(--text); }
.searchbox input { flex: 1; min-width: 0; height: 100%; background: none; border: 0; outline: 0; color: var(--text); }
.searchbox input::placeholder { color: var(--dim); }
.searchbox button { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 6px; color: var(--muted); }
.searchbox button:hover { background: rgba(255,255,255,.08); }

.icon-btn { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--muted); transition: background .15s, color .15s, transform .15s var(--ease); }
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.icon-btn:active { transform: scale(.92); }

.side-body { flex: 1; min-height: 0; display: flex; border-top: 1px solid var(--line); }
.groups { width: 188px; flex: none; overflow-y: auto; padding: 10px 8px 24px; border-right: 1px solid var(--line); scrollbar-width: none; }
.groups::-webkit-scrollbar { display: none; }
.grp {
  width: 100%; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px; border-radius: 10px; text-align: left;
  color: var(--muted); font-size: 13px; font-weight: 500; position: relative; transition: background .15s, color .15s;
}
.grp:hover { background: rgba(255,255,255,.05); color: var(--text); }
.grp.on { background: rgba(139,123,255,.14); color: var(--text); }
.grp.on::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 3px; background: var(--accent); }
.grp svg { flex: none; opacity: .8; }
.grp-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grp-count { font-size: 11px; color: var(--dim); font-weight: 600; }
.grp.on .grp-count { color: #b7adff; }
.grp-sep { height: 1px; background: var(--line); margin: 8px 6px; }

.chans { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.chans-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px 8px; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.chans-head span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* virtual list */
.list { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; outline: 0; contain: strict; padding: 0 8px; overscroll-behavior: contain; }
.list::-webkit-scrollbar, .stage::-webkit-scrollbar, .sheet-body::-webkit-scrollbar { width: 8px; }
.list::-webkit-scrollbar-thumb, .stage::-webkit-scrollbar-thumb, .sheet-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); border-radius: 8px; border: 2px solid transparent; background-clip: padding-box; }
.list-inner { position: relative; width: 100%; }
.row {
  position: absolute; left: 0; right: 0; top: 0; height: 64px; margin: 2px 0; display: flex; align-items: center; gap: 12px; padding: 0 10px 0 6px;
  border-radius: 14px; cursor: pointer; will-change: transform; contain: layout paint;
  transition: background .12s;
}
.row:hover, .row.sel { background: rgba(255,255,255,.055); }
.row.sel { box-shadow: inset 0 0 0 1px var(--line-2); }
.row.on { background: linear-gradient(90deg, rgba(139,123,255,.2), rgba(42,212,240,.07)); box-shadow: inset 0 0 0 1px rgba(139,123,255,.28); }
.q { display: inline-block; margin-left: 7px; padding: 1px 5px; border-radius: 5px; font-size: 9.5px; font-weight: 750; letter-spacing: .04em; vertical-align: 2px; color: var(--muted); border: 1px solid var(--line-2); }
.osd-ch .q { font-size: 10px; vertical-align: 0; color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.25); }
.row-num { width: 30px; flex: none; text-align: right; font-size: 11px; font-weight: 600; color: var(--dim); }
.row.on .q { display: inline-block; margin-left: 7px; padding: 1px 5px; border-radius: 5px; font-size: 9.5px; font-weight: 750; letter-spacing: .04em; vertical-align: 2px; color: var(--muted); border: 1px solid var(--line-2); }
.osd-ch .q { font-size: 10px; vertical-align: 0; color: rgba(255,255,255,.75); border-color: rgba(255,255,255,.25); }
.row-num { color: #b7adff; }
.row-text { flex: 1; min-width: 0; }
.row-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.row-prog { display: flex; align-items: center; gap: 8px; margin-top: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.row-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.row-bar { width: 38px; height: 3px; flex: none; border-radius: 3px; background: rgba(255,255,255,.1); overflow: hidden; }
.row-bar i, .osd-bar span, .prog-bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.row .star { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; color: var(--dim); opacity: 0; transition: opacity .15s, color .15s, transform .2s var(--ease); }
.row:hover .star, .row.sel .star, .star.is-fav { opacity: 1; }
.star:hover { color: var(--text); background: rgba(255,255,255,.07); }
.star.is-fav { color: #ffc65c; }
.star:active { transform: scale(.8); }
.eq { display: flex; align-items: flex-end; gap: 2px; height: 14px; flex: none; }
.eq i { width: 3px; border-radius: 2px; background: var(--a2); animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.35s; background: #6fb6ff; }
.eq i:nth-child(3) { animation-delay: -.7s; background: var(--a1); }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }
.list-skel { padding: 0 8px; position: relative; flex: 1; }
.row.skel { position: relative; margin: 4px 0; background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.list-empty { padding: 60px 20px; text-align: center; color: var(--muted); line-height: 1.8; }
.list-empty small { color: var(--dim); }

/* logos */
.logo { flex: none; display: grid; place-items: center; overflow: hidden; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.05); }
.logo img { width: 82%; height: 82%; object-fit: contain; filter: drop-shadow(0 0 .7px rgba(255,255,255,.6)) drop-shadow(0 0 .7px rgba(255,255,255,.4)); }
.logo.fallback { color: rgba(255,255,255,.92); font-weight: 750; letter-spacing: -.02em; border: 0; }

/* player */
.player { position: relative; width: 100%; max-width: 1280px; margin: 0 auto; flex: none; }
.app.theater .player { max-width: none; height: 100%; }
.glow { position: absolute; inset: 4% 2%; width: 96%; height: 92%; filter: blur(56px) saturate(1.7); opacity: .55; transform: scale(1.06); pointer-events: none; transition: opacity .6s; }
.app.theater .glow, .player.is-fs .glow { display: none; }
.screen {
  position: relative; aspect-ratio: 16 / 9; width: 100%; border-radius: var(--radius); overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px var(--line), 0 40px 90px -30px rgba(0,0,0,.8);
}
.app.theater .screen, .player.is-fs .screen { aspect-ratio: auto; height: 100%; border-radius: 0; box-shadow: none; }
.player.is-fs { background: #000; }
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player:not(.osd-on) { cursor: none; }

.splash { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: radial-gradient(circle at 50% 40%, #171a24, #050507 70%); animation: fade .25s; }
.splash.empty { color: var(--muted); }
.splash .logo { box-shadow: 0 20px 50px -10px rgba(0,0,0,.6); animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.04); } }
.splash-state { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.splash-state:not(.err) { flex-direction: row; }
.splash-state.err { color: #ffb0bc; }
.splash-state small { color: var(--dim); font-size: 11px; max-width: 320px; text-align: center; }
@keyframes fade { from { opacity: 0; } }

.osd { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; opacity: 0; transition: opacity .35s; }
.player.osd-on .osd { opacity: 1; }
.player.osd-on .osd > * { pointer-events: auto; }
.osd-top { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
.osd-top .icon-btn, .osd-ctrl .icon-btn { color: rgba(255,255,255,.85); }
.osd-top .icon-btn:hover, .osd-ctrl .icon-btn:hover { background: rgba(255,255,255,.14); }
.live-pill { display: flex; align-items: center; gap: 7px; padding: 5px 10px; border-radius: 999px; font-size: 11px; font-weight: 750; letter-spacing: .08em; background: rgba(0,0,0,.45); backdrop-filter: blur(10px); }
.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: ping 1.8s infinite; }
@keyframes ping { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.osd-bottom { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; padding: 60px 22px 20px; background: linear-gradient(transparent, rgba(0,0,0,.82)); }
.osd-info { display: flex; align-items: center; gap: 16px; min-width: 0; transform: translateY(8px); transition: transform .45s var(--ease); }
.player.osd-on .osd-info { transform: none; }
.osd-text { min-width: 0; }
.osd-ch { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-ch .num { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 7px; background: rgba(255,255,255,.14); }
.osd-prog { font-size: 14px; color: rgba(255,255,255,.85); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-prog.dim { color: rgba(255,255,255,.55) !important; }
.osd-bar { width: min(360px, 40vw); height: 3px; border-radius: 3px; background: rgba(255,255,255,.2); margin: 9px 0 6px; overflow: hidden; }
.osd-times { font-size: 12px; color: rgba(255,255,255,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.osd-times b { color: rgba(255,255,255,.85); font-weight: 600; }
.osd-ctrl { display: flex; align-items: center; gap: 4px; flex: none; }
.vol { -webkit-appearance: none; appearance: none; width: 84px; height: 4px; border-radius: 4px; margin: 0 6px; cursor: pointer; background: linear-gradient(90deg, #fff var(--v), rgba(255,255,255,.25) var(--v)); }
.vol::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.vol::-moz-range-thumb { width: 13px; height: 13px; border: 0; border-radius: 50%; background: #fff; }
.unmute { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; background: rgba(255,255,255,.92); color: #0b0c10; box-shadow: 0 10px 30px rgba(0,0,0,.4); animation: rise .4s var(--ease); z-index: 2; }

/* guide */
.guide { position: relative; width: 100%; max-width: 1280px; margin: 0 auto; flex: none; animation: rise .5s var(--ease) both; }
.app.theater .guide { display: none; }
.guide-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; }
.guide-head h3 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.guide-head span { color: var(--muted); font-size: 13px; }
.guide-empty { padding: 18px 20px; border-radius: 16px; background: rgba(255,255,255,.03); border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; }
.guide-rail { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.1) transparent; }
.prog {
  flex: none; width: 230px; min-height: 104px; padding: 14px 16px; border-radius: 16px; text-align: left; scroll-snap-align: start;
  background: rgba(255,255,255,.035); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px;
  transition: background .2s, border-color .2s, width .35s var(--ease), transform .15s var(--ease);
}
.prog:hover { background: rgba(255,255,255,.06); }
.prog:active { transform: scale(.985); }
.prog.past { opacity: .45; }
.prog.live { background: linear-gradient(145deg, rgba(139,123,255,.2), rgba(42,212,240,.07)); border-color: rgba(139,123,255,.35); }
.prog.open { width: 380px; }
.prog-time { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 650; color: var(--muted); }
.prog-time span { margin-left: auto; color: var(--dim); font-weight: 500; }
.prog.live .prog-time { color: #ffb3c0; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: ping 1.8s infinite; }
.prog-title { font-weight: 650; font-size: 14px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prog-desc { font-size: 12px; color: var(--muted); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prog.open .prog-desc { -webkit-line-clamp: 8; }
.prog-bar { height: 3px; border-radius: 3px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: auto; }
.prog.skel { background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.06), rgba(255,255,255,.03)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

/* welcome */
.welcome { margin: auto; max-width: 480px; text-align: center; animation: rise .6s var(--ease) both; }
.welcome-icon { width: 76px; height: 76px; margin: 0 auto 22px; border-radius: 24px; display: grid; place-items: center; background: var(--accent); color: #0b0c10; box-shadow: 0 20px 60px -10px rgba(139,123,255,.6); }
.welcome h1 { font-size: 30px; font-weight: 750; letter-spacing: -.03em; }
.welcome p { color: var(--muted); margin: 10px 0 26px; font-size: 15px; line-height: 1.55; }

/* buttons & forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 42px; padding: 0 18px; border-radius: 12px;
  font-weight: 650; background: var(--accent); color: #0b0c10; transition: transform .15s var(--ease), filter .2s, opacity .2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn.ghost { background: rgba(255,255,255,.07); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn.ghost:hover { background: rgba(255,255,255,.11); filter: none; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 10px; }
.btn.wide { width: 100%; }
.btn.danger { color: #ff8a9b; }
.row-btns { display: flex; gap: 10px; justify-content: flex-end; }
.row-btns.center { justify-content: center; }

.digits { position: fixed; top: 28px; right: 36px; z-index: 20; font-size: 46px; font-weight: 750; letter-spacing: -.02em; padding: 6px 20px; border-radius: 18px; background: rgba(0,0,0,.6); backdrop-filter: blur(16px); border: 1px solid var(--line); animation: rise .2s var(--ease); }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 20; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; background: rgba(20,22,30,.9); border: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.45); backdrop-filter: blur(4px); animation: fade .25s; display: flex; justify-content: flex-end; }
.sheet {
  width: min(460px, 100vw); height: 100%; display: flex; flex-direction: column; background: rgba(16,18,25,.92);
  border-left: 1px solid var(--line); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); animation: slide .4s var(--ease);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 20px 12px 24px; }
.sheet-head h2 { font-size: 20px; font-weight: 750; letter-spacing: -.02em; }
.sheet-body { flex: 1; overflow-y: auto; padding: 8px 20px 24px; display: flex; flex-direction: column; gap: 12px; }
.sheet-foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.keys { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); }
.keys b { color: var(--text); font-size: 12px; }
.keys kbd { margin: 0 1px; }
.src { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.035); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; transition: opacity .2s; }
.src.off { opacity: .55; }
.src-top { display: flex; align-items: center; gap: 10px; }
.src-kind { width: 30px; height: 30px; flex: none; border-radius: 9px; display: grid; place-items: center; background: rgba(139,123,255,.16); color: #b7adff; }
.src-name { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-edit { flex: 1; min-width: 0; height: 32px; padding: 0 10px; border-radius: 9px; background: rgba(0,0,0,.3); border: 1px solid var(--line-2); outline: 0; }
.src-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 7px; font-size: 11.5px; background: rgba(255,255,255,.06); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.ok { color: #7ee0b0; background: rgba(46,204,140,.1); }
.tag.bad { color: #ff9cab; background: rgba(255,77,106,.1); white-space: normal; }
.src-actions { display: flex; gap: 6px; }
.src-actions .danger { margin-left: auto; }
.src-editbox { display: flex; flex-direction: column; gap: 10px; }
.src-empty { color: var(--muted); text-align: center; padding: 20px; }
.switch { position: relative; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: rgba(255,255,255,.14); transition: background .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .25s var(--ease); }
.switch input:checked + span { background: var(--a1); }
.switch input:checked + span::after { transform: translateX(16px); }

.add { padding: 16px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 12px; animation: rise .35s var(--ease); }
.add label, .src-editbox label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.add label em { font-style: normal; color: var(--dim); font-weight: 500; }
.add input, .add select, .src-editbox input { height: 40px; padding: 0 12px; border-radius: 11px; background: rgba(0,0,0,.3); border: 1px solid var(--line); outline: 0; font-size: 14px; color: var(--text); transition: border-color .2s; }
.add input[type="file"] { padding: 8px 10px; height: auto; font-size: 13px; }
.add input:focus, .add select:focus, .src-editbox input:focus { border-color: rgba(139,123,255,.55); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border-radius: 13px; background: rgba(0,0,0,.3); gap: 4px; }
.seg button { height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.seg button.on { background: rgba(255,255,255,.1); color: var(--text); }
.form-err { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #ff9cab; background: rgba(255,77,106,.08); padding: 10px 12px; border-radius: 10px; }
.demo { display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1px dashed rgba(139,123,255,.4); background: rgba(139,123,255,.06); color: #c9c1ff; transition: background .2s; }
.demo:hover { background: rgba(139,123,255,.12); }
.demo div { display: flex; flex-direction: column; gap: 2px; }
.demo b { color: var(--text); font-weight: 650; }
.demo span { font-size: 12px; color: var(--muted); }

/* responsive */
@media (max-width: 1200px) { :root { --side: 460px; } .groups { width: 160px; } }
@media (max-width: 900px) {
  body { overflow: auto; }
  .app { flex-direction: column-reverse; justify-content: flex-end; height: 100dvh; }
  .app.theater .side { margin: 0; transform: none; opacity: 1; }
  .edge { display: none; }
  .stage { flex: none; height: auto; padding: 0; gap: 0; overflow: visible; }
  .app.theater .stage { padding: 0; }
  .screen, .app.theater .screen { aspect-ratio: 16 / 9; height: auto; border-radius: 0; }
  .glow, .guide, .osd-top .icon-btn { display: none; }
  .side { width: 100%; flex: 1; min-height: 0; border-right: 0; }
  .side-head { padding: 12px 12px 10px; }
  .brand span { display: none; }
  .side-body { flex-direction: column; }
  .groups { width: 100%; display: flex; gap: 6px; overflow-x: auto; overflow-y: hidden; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--line); flex: none; }
  .grp { width: auto; flex: none; height: 34px; border-radius: 999px; background: rgba(255,255,255,.05); }
  .grp.on::before, .grp-sep { display: none; }
  .grp.on { background: rgba(139,123,255,.25); }
  .grp-name { max-width: 160px; }
  .chans-head { padding: 10px 14px 6px; }
  .row .star { opacity: 1; }
  .osd-bottom { padding: 40px 12px 10px; }
  .osd-ch { font-size: 15px; }
  .osd-prog { font-size: 12px; }
  .osd-info .logo { display: none; }
  .osd-bar, .osd-times, .vol { display: none; }
  .welcome { padding: 40px 20px; }
  .digits { top: 12px; right: 12px; font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* Colonne d'icônes */
.navrail { position: relative; z-index: 5; width: 78px; flex: none; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 0 16px; background: rgba(8, 9, 13, .72); border-right: 1px solid var(--line); backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); }
.nav-logo { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 14px; border-radius: 12px; transition: transform .2s var(--ease); }
.nav-logo:hover { transform: scale(1.08); }
.nav-btn { position: relative; width: 62px; padding: 10px 0 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; border-radius: 14px; color: var(--dim); font-size: 10.5px; font-weight: 600; transition: background .18s, color .18s, transform .15s var(--ease); }
.nav-btn:hover { color: var(--text); background: rgba(255,255,255,.05); }
.nav-btn:active { transform: scale(.94); }
.nav-btn.on { color: var(--text); background: rgba(139,123,255,.16); }
.nav-btn.on::before { content: ""; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 3px; border-radius: 3px; background: var(--accent); }
.nav-btn.on svg { color: var(--a2); }
.nav-fill { flex: 1; }
.app.theater .navrail { display: none; }

/* Accueil */
.app.v-home .side { display: none; }
.home { position: relative; z-index: 1; flex: 1; min-width: 0; height: 100%; overflow-y: auto; padding: 0 40px 120px; scrollbar-gutter: stable; animation: fade .3s; }
.home-head { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 28px; padding: 22px 40px 18px; margin: 0 -40px 24px; background: rgba(6,7,10,.78); backdrop-filter: blur(22px) saturate(1.4); -webkit-backdrop-filter: blur(22px) saturate(1.4); border-bottom: 1px solid var(--line); }
.brand.lg { font-size: 24px; }
.searchbox.big { max-width: 560px; height: 46px; margin: 0 auto; border-radius: 999px; padding: 0 14px 0 18px; font-size: 15px; background: rgba(255,255,255,.05); }
.searchbox.big input { font-size: 15px; }
.pills { display: flex; gap: 8px; flex: none; }
.pill { height: 34px; padding: 0 14px; border-radius: 999px; font-size: 12.5px; font-weight: 650; color: var(--muted); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); transition: background .18s, color .18s, transform .15s var(--ease); }
.pill:hover { color: var(--text); background: rgba(255,255,255,.09); }
.pill:active { transform: scale(.94); }
.pill.on { color: #0b0c10; background: var(--accent); box-shadow: none; }

.sec { margin-top: 34px; }
.sec.lazy { content-visibility: auto; contain-intrinsic-size: auto 190px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sec-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.link { font-size: 13.5px; font-weight: 600; color: var(--a2); border-radius: 6px; padding: 2px 4px; }
.link:hover { text-decoration: underline; }
.home-empty { color: var(--muted); padding: 18px 2px; font-size: 13.5px; line-height: 1.6; }
.home-empty.box { padding: 22px; border-radius: var(--radius); border: 1px dashed var(--line-2); }
.home-empty svg { vertical-align: -2px; }
.home-empty small { color: var(--dim); }
.home-skel { display: flex; flex-direction: column; gap: 26px; margin-top: 8px; }
.skel.hero-skel { height: 330px; border-radius: 26px; }
.skel.row-skel { height: 130px; border-radius: var(--radius); }
.hero-skel, .row-skel { background: linear-gradient(90deg, rgba(255,255,255,.03), rgba(255,255,255,.07), rgba(255,255,255,.03)); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; }

.top { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(330px, 1fr); gap: 28px; margin-top: 6px; }
.hero { position: relative; min-height: 330px; border-radius: 26px; overflow: hidden; cursor: pointer; isolation: isolate; display: flex; align-items: flex-end;
  background: radial-gradient(120% 140% at 0% 0%, hsl(var(--h) 55% 24% / .9), transparent 60%), radial-gradient(120% 140% at 100% 100%, hsl(calc(var(--h) + 70) 60% 26% / .85), transparent 62%), #0d0f16;
  box-shadow: inset 0 0 0 1px var(--line-2), 0 30px 70px -30px rgba(0,0,0,.8); transition: transform .35s var(--ease), box-shadow .35s; }
.hero:hover { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2), 0 36px 80px -30px rgba(0,0,0,.9); }
.hero-art { position: absolute; right: 9%; top: 50%; transform: translateY(-58%); z-index: -1; opacity: .5; filter: saturate(1.1); }
.hero-art .logo { background: none; border: 0; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(6,7,10,.72), rgba(6,7,10,.1) 60%), linear-gradient(0deg, rgba(6,7,10,.7), transparent 55%); }
.hero > .live-tag { position: absolute; left: 28px; top: 26px; }
.hero-body { padding: 0 150px 34px 30px; min-width: 0; width: 100%; }
.hero-kicker { font-size: 11.5px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.hero-title { font-size: clamp(30px, 3.4vw, 50px); font-weight: 800; letter-spacing: -.035em; line-height: 1.05; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding-bottom: .08em; }
.hero-sub { margin-top: 10px; font-size: 15.5px; color: rgba(238,240,246,.78); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-bar { margin-top: 18px; max-width: 560px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.14); overflow: hidden; }
.hero-bar i, .card-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.hero-play { position: absolute; right: 30px; bottom: 30px; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: #0b0c10; padding-left: 4px; box-shadow: 0 12px 30px rgba(0,0,0,.45); transition: transform .3s var(--ease); }
.hero:hover .hero-play { transform: scale(1.1); }

.live-tag { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 10px; font-weight: 800; letter-spacing: .08em; color: #ff8a9b; background: rgba(255,77,106,.14); }
.live-tag i { width: 6px; height: 6px; border-radius: 50%; background: var(--live); }

.favs { min-width: 0; display: flex; flex-direction: column; }
.fav-grid { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 12px; }
.fav { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px 12px 14px; min-height: 132px; border-radius: var(--radius); background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease), background .2s, box-shadow .2s; }
.fav:hover, .card:hover, .tile:hover { transform: translateY(-3px); background: rgba(255,255,255,.07); box-shadow: inset 0 0 0 1px var(--line-2), 0 18px 36px -20px rgba(0,0,0,.8); }
.fav:active, .card:active, .tile:active { transform: scale(.98); }
.fav-name { max-width: 100%; font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fav .card-bar { width: 62%; }

.card { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px 16px 14px; min-width: 0; border-radius: var(--radius); cursor: pointer; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease), background .2s, box-shadow .2s; outline: 0; }
.card:focus-visible, .tile:focus-visible, .hero:focus-visible, .fav:focus-visible { box-shadow: inset 0 0 0 2px var(--a1); outline: 0; }
.card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-id { flex: 1; min-width: 0; }
.card-name { font-weight: 650; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-title { font-size: 15px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; height: 2.6em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title.dim { color: var(--dim); font-weight: 500; }
.card-bar { display: block; height: 3px; border-radius: 3px; background: rgba(255,255,255,.09); overflow: hidden; }
.card .star { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); opacity: 0; background: rgba(12,13,18,.9); transition: opacity .15s, color .15s, transform .2s var(--ease); }
.card:hover .star { opacity: 1; }
.card .star.is-fav { opacity: 1; background: none; }
.card:hover .star.is-fav { background: rgba(12,13,18,.9); }
.card:has(.star.is-fav) .live-tag { margin-right: 26px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.rail-wrap { position: relative; margin: 0 -40px; }
.rail-row { display: grid; grid-auto-flow: column; grid-auto-columns: 286px; gap: 14px; overflow-x: auto; padding: 4px 40px 22px; scroll-padding: 0 40px; scroll-snap-type: x proximity; scrollbar-width: none; overscroll-behavior-x: contain; }
.rail-row::-webkit-scrollbar { display: none; }
.rail-row > * { scroll-snap-align: start; }
.rail-arrow { position: absolute; top: calc(50% - 30px); z-index: 3; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--text); background: rgba(20,22,30,.92); box-shadow: inset 0 0 0 1px var(--line-2), 0 10px 24px rgba(0,0,0,.5); opacity: 0; transition: opacity .2s, transform .2s var(--ease); }
.rail-arrow.l { left: 16px; } .rail-arrow.r { right: 16px; }
.rail-wrap:hover .rail-arrow { opacity: 1; }
.rail-arrow:hover { transform: scale(1.1); }
.sec .rail-wrap { margin-bottom: -22px; }

.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px; min-width: 0; border-radius: var(--radius); cursor: pointer; background: rgba(255,255,255,.035); box-shadow: inset 0 0 0 1px var(--line); transition: transform .25s var(--ease), background .2s, box-shadow .2s; outline: 0; }
.mosaic { flex: none; width: 76px; height: 58px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.mosaic .logo { width: 36px !important; height: 27px !important; }
.tile-text { flex: 1; min-width: 0; padding-right: 22px; }
.tile-name { font-weight: 650; font-size: 14.5px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile-count { margin-top: 2px; font-size: 12.5px; color: var(--muted); }
.pin { position: absolute; right: 8px; top: 8px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 8px; color: var(--muted); opacity: 0; transition: opacity .15s, color .15s, background .15s; }
.tile:hover .pin, .pin:focus-visible { opacity: 1; }
.pin:hover { color: var(--text); background: rgba(255,255,255,.1); }
.pin.on { color: var(--a2); }

/* Mini-lecteur sur l'accueil */
.app.v-home .stage { display: none; }
.app.v-home.has-play .stage { display: block; position: fixed; right: 26px; bottom: 26px; width: 380px; height: auto; padding: 0; overflow: hidden; z-index: 20; border-radius: 16px; box-shadow: 0 24px 60px rgba(0,0,0,.7), 0 0 0 1px var(--line-2); animation: rise .35s var(--ease) both; }
.app.v-home .guide, .app.v-home .osd, .app.v-home .glow, .app.v-home .unmute { display: none; }
.app.v-home .screen { border-radius: 0; box-shadow: none; }
.app.v-home .splash .logo { transform: scale(.6); }
.mini-over { position: absolute; inset: 0; z-index: 5; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding: 10px 8px 8px 14px; cursor: pointer; background: linear-gradient(0deg, rgba(0,0,0,.75), transparent 45%); opacity: 0; transition: opacity .2s; }
.app.v-home .stage:hover .mini-over { opacity: 1; }
.mini-name { font-weight: 650; font-size: 13.5px; padding-bottom: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-over .icon-btn { width: 32px; height: 32px; background: rgba(0,0,0,.5); color: var(--text); }

@media (max-width: 1100px) { .top { grid-template-columns: 1fr; } .home-head .brand { display: none; } }
