/* "TV" front page (#/tv, tvhome.js): the menu at the side, the channel at the top, one list of
   channels below — the same page as the app's on a TV (TvHomeWide.kt). */
.tw {
  --tw-bg: #05090D; --tw-side: #080E14; --tw-card: #101820; --tw-card2: #151E27; --tw-red: #FF1238;
  --tw-t2: #AAB4C0; --tw-t3: #74808D; --tw-line: #202B35;
  display: flex; min-height: 100vh; padding: var(--nav-h) 0 0; background: var(--tw-bg); color: #fff;
}
.tw-ic { display: inline-flex; width: 1em; height: 1em; flex: none; }
.tw-ic svg { width: 100%; height: 100%; }

/* ------------------------------------------------------------------ menu */
.tw-side { position: sticky; top: var(--nav-h); align-self: flex-start; width: 200px; flex: none; height: calc(100vh - var(--nav-h));
  background: var(--tw-side); border-right: 1px solid #0d151d; padding: 26px 0; display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
.tw-brand { display: flex; align-items: center; justify-content: flex-start; gap: 5px; padding: 0 0 20px 28px; font-size: 28px; font-weight: 900; letter-spacing: -.5px; }
.tw-brand .tw-ic { color: var(--tw-red); font-size: 20px; filter: drop-shadow(0 0 10px rgba(255,18,56,.45)); }
.tw-nav { position: relative; display: flex; align-items: center; justify-content: flex-start; gap: 14px; width: 100%; height: 46px; margin: 0; padding: 0 28px; border: 0; background: none;
  color: var(--tw-t2); font: inherit; font-size: 14px; font-weight: 500; text-align: left; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, color .15s; }
.tw-nav .tw-ic { font-size: 19px; }
.tw-nav:hover { color: #fff; background: rgba(255,255,255,.04); }
.tw-nav.on { color: #fff; background: linear-gradient(90deg, rgba(255,18,56,.17), rgba(255,18,56,.03)); }
.tw-nav.on .tw-ic { color: var(--tw-red); }
.tw-nav.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 2px 2px 0; background: var(--tw-red); box-shadow: 0 0 12px var(--tw-red); }
.tw-nav:focus-visible { outline: 2px solid var(--tw-red); outline-offset: -2px; }

.tw-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* "Grupės": the provider's groups, a column over the page beside the menu. */
.tw-groups { position: fixed; top: var(--nav-h); bottom: 0; left: 200px; z-index: 20; width: min(380px, 100vw); overflow-y: auto;
  padding: 26px 18px 24px; background: rgba(8,14,20,.97); border-right: 1px solid #0d151d; box-shadow: 24px 0 60px rgba(0,0,0,.55); }
.tw-grp-head { padding: 0 12px 14px; font-size: 14px; font-weight: 800; letter-spacing: 2px; }
.tw-grp { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; margin: 0 0 3px; padding: 0 14px; border: 1.5px solid transparent;
  border-radius: 8px; background: none; color: #DFE4EA; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.tw-grp span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-grp small { color: var(--tw-t2); font-size: 13px; }
.tw-grp:hover, .tw-grp:focus-visible { background: rgba(255,18,56,.16); border-color: var(--tw-red); color: #fff; outline: none; }
.tw-grp.on { background: var(--tw-card2); color: #fff; font-weight: 600; }
.tw-grp.on small { color: var(--tw-red); }

/* ------------------------------------------------------------------ the channel at the top */
.tw-hero { position: relative; height: clamp(270px, 35vh, 370px); flex: none; overflow: hidden;
  background: radial-gradient(45% 70% at 78% 35%, #3a0d14, transparent 70%), radial-gradient(40% 60% at 100% 0, rgba(47,111,214,.2), transparent 70%), var(--tw-bg); }
.tw-pic { position: absolute; inset: 0; opacity: 0; transition: opacity .7s ease; }
.tw-pic.on { opacity: 1; }
.tw-pic img { width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; }
.tw-shade { position: absolute; inset: 0;
  background: linear-gradient(90deg, var(--tw-bg) 0%, rgba(5,9,13,.95) 22%, rgba(5,9,13,.6) 45%, transparent 75%),
              linear-gradient(0deg, var(--tw-bg) 0%, transparent 40%); }
.tw-clock { position: absolute; right: 40px; top: 22px; font-size: 17px; font-weight: 500; letter-spacing: .5px; color: rgba(255,255,255,.85); }
.tw-info { position: absolute; left: 48px; bottom: 24px; width: min(720px, 62%); }
.tw-live { display: inline-flex; align-items: center; gap: 8px; height: 24px; padding: 0 11px; border-radius: 6px; background: var(--tw-red);
  font-size: 11px; font-weight: 700; letter-spacing: 1px; box-shadow: 0 0 22px rgba(255,18,56,.4); }
.tw-live b { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px #fff; animation: twPulse 1.6s infinite; }
@keyframes twPulse { 50% { opacity: .35; } }
.tw-chan { display: flex; align-items: center; gap: 9px; margin-top: 14px; font-size: 14px; font-weight: 600; color: rgba(255,255,255,.9); }
.tw-chanlogo { display: inline-flex; height: 24px; max-width: 72px; }
.tw-chanlogo img { height: 100%; max-width: 100%; object-fit: contain; }
.tw-chanlogo b { font-size: 13px; }
.tw-title { margin: 4px 0 6px; font-size: clamp(26px, 2.5vw, 40px); font-weight: 800; letter-spacing: -.6px; line-height: 1.1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-meta { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #e9edf1; }
.tw-sep { width: 1px; height: 14px; background: rgba(255,255,255,.25); }
.tw-cat { color: var(--tw-t2); }
.tw-btns { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.tw-btn { display: inline-flex; align-items: center; gap: 9px; height: 44px; padding: 0 20px; border-radius: 9px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(5,9,13,.5); backdrop-filter: blur(6px); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.tw-btn .tw-ic { font-size: 17px; }
.tw-btn.tw-primary { background: var(--tw-red); border-color: var(--tw-red); padding: 0 24px; box-shadow: 0 6px 22px rgba(255,18,56,.28); }
.tw-btn:hover, .tw-btn:focus-visible { transform: translateY(-1px); border-color: rgba(255,255,255,.7); outline: none; }
.tw-btn.tw-primary:hover, .tw-btn.tw-primary:focus-visible { box-shadow: 0 0 0 3px rgba(255,18,56,.5), 0 10px 34px rgba(255,18,56,.45); }

/* ------------------------------------------------------------------ categories */
.tw-bar { display: flex; align-items: center; gap: 10px; padding: 8px 40px 12px 44px; }
.tw-chips { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px; }
.tw-chips::-webkit-scrollbar { display: none; }
.tw-chip { flex: none; height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--tw-line); background: var(--tw-card2);
  color: #dfe4ea; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; transition: transform .15s, background .15s; }
.tw-chip:hover { background: #1c2733; }
.tw-chip.on { background: var(--tw-red); border-color: var(--tw-red); color: #fff; font-weight: 600; box-shadow: 0 4px 18px rgba(255,18,56,.3); }
.tw-chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; transform: scale(1.05); }
.tw-sort { flex: none; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--tw-line);
  background: var(--tw-card); color: #fff; font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.tw-sort .tw-ic { font-size: 16px; }
.tw-sort:hover, .tw-sort:focus-visible { border-color: var(--tw-red); outline: none; }
.tw-searchline { flex: 1; min-width: 240px; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--tw-red); background: var(--tw-card2); color: var(--tw-t2); font-size: 15px; }
.tw-search { flex: 1; min-width: 0; border: 0; background: none; color: #fff; font: inherit; font-size: 13px; outline: none; }

/* ------------------------------------------------------------------ the list */
.tw-list { display: flex; flex-direction: column; gap: 6px; padding: 2px 40px 60px 44px; }
.tw-hint { padding: 50px 0; text-align: center; color: var(--tw-t2); font-size: 14px; }
.tw-row { display: grid; align-items: center; column-gap: 16px; height: 64px; padding: 0 18px 0 10px; border-radius: 10px; cursor: pointer;
  grid-template-columns: 34px 96px minmax(160px, 1fr) minmax(80px, 170px) 96px 38px 118px 1px minmax(140px, 210px);
  background: var(--tw-card); border: 1px solid transparent; transition: background .15s, border-color .15s; }
.tw-row:hover { background: #131d27; }
.tw-row.sel { border-color: var(--tw-red); background: linear-gradient(90deg, rgba(255,18,56,.11), rgba(255,18,56,.03) 60%, var(--tw-card)); }
.tw-no { color: var(--tw-t3); font-size: 13px; font-variant-numeric: tabular-nums; text-align: center; }
.tw-logo { display: flex; align-items: center; justify-content: center; height: 38px; }
.tw-logo img { max-height: 100%; max-width: 100%; object-fit: contain; }
.tw-logo b { font-size: 12px; font-weight: 900; }
.tw-prog { min-width: 0; display: flex; flex-direction: column; }
.tw-prog > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-cn { font-size: 10.5px; color: var(--tw-t3); letter-spacing: .2px; }
.tw-prog b { font-size: 14px; font-weight: 600; line-height: 1.35; }
.tw-prog b.none { color: var(--tw-t3); font-weight: 500; }
.tw-time { font-size: 11.5px; color: var(--tw-t3); font-variant-numeric: tabular-nums; }
.tw-bar-track { height: 4px; border-radius: 2px; background: #2a3540; overflow: hidden; }
.tw-bar-track i { display: block; height: 100%; border-radius: 2px; background: var(--tw-red); }
.tw-left { font-size: 12px; color: var(--tw-t2); white-space: nowrap; }
.tw-play { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--tw-line); background: var(--tw-card2);
  color: #cfd6dd; font-size: 13px; transition: transform .15s, background .15s; }
.tw-play .tw-ic { margin-left: 2px; }
.tw-row.sel .tw-play { background: var(--tw-red); border-color: var(--tw-red); color: #fff; box-shadow: 0 0 16px rgba(255,18,56,.45); }
.tw-arch { display: flex; align-items: center; justify-content: center; gap: 7px; height: 36px; border-radius: 8px; border: 1px solid var(--tw-line);
  background: var(--tw-card2); color: #fff; font-size: 12.5px; font-weight: 600; text-decoration: none; transition: transform .15s, border-color .15s; }
.tw-arch .tw-ic { font-size: 15px; }
.tw-arch.off { opacity: .3; cursor: default; }
.tw-play:hover, .tw-play:focus-visible, a.tw-arch:hover, a.tw-arch:focus-visible { transform: scale(1.06); border-color: rgba(255,255,255,.8); outline: none; box-shadow: 0 0 0 2px rgba(255,18,56,.55); }
.tw-div { width: 1px; height: 34px; background: var(--tw-line); }
.tw-next { min-width: 0; display: flex; flex-direction: column; }
.tw-next > * { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-next small { font-size: 10px; color: var(--tw-t3); text-transform: uppercase; letter-spacing: .6px; }
.tw-next b { font-size: 13px; font-weight: 500; line-height: 1.35; }
.tw-next span { font-size: 11px; color: var(--tw-t2); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------ smaller screens */
@media (max-width: 1400px) {
  .tw-row { grid-template-columns: 30px 84px minmax(140px, 1fr) 90px 88px 38px 112px 1px minmax(120px, 170px); column-gap: 12px; }
  .tw-side { width: 180px; }
  .tw-groups { left: 180px; }
  .tw-nav { padding: 0 22px; }
  .tw-brand { padding-left: 22px; }
}
@media (max-width: 1100px) {
  .tw-row { grid-template-columns: 28px 76px minmax(120px, 1fr) 38px 112px; height: 60px; }
  .tw-bar-track, .tw-left, .tw-div, .tw-next { display: none; }
}
/* A phone: the menu becomes a strip under the header, the rows keep the channel, the programme and play. */
@media (max-width: 760px) {
  .tw { flex-direction: column; }
  .tw-side { position: static; width: auto; height: auto; flex-direction: row; overflow-x: auto; padding: 8px 10px; gap: 4px; border-right: 0; border-bottom: 1px solid #0d151d; }
  .tw-brand { display: none; }
  .tw-groups { left: 0; width: 100vw; }
  .tw-nav { height: 44px; padding: 0 14px; gap: 8px; font-size: 14px; border-radius: 10px; }
  .tw-nav .tw-ic { font-size: 18px; }
  .tw-nav.on::before { display: none; }
  .tw-hero { height: 300px; }
  .tw-info { left: 16px; right: 16px; width: auto; bottom: 16px; }
  .tw-clock { display: none; }
  .tw-title { font-size: 28px; }
  .tw-meta { font-size: 14px; gap: 10px; }
  .tw-chan { font-size: 15px; margin-top: 12px; }
  .tw-btns { gap: 8px; margin-top: 16px; }
  .tw-btn { height: 44px; padding: 0 14px; font-size: 14px; gap: 8px; }
  .tw-btn.tw-primary { padding: 0 18px; }
  .tw-btn .tw-ic { font-size: 18px; }
  .tw-bar { padding: 8px 16px 10px; gap: 8px; }
  .tw-chip, .tw-sort, .tw-searchline { height: 40px; font-size: 14px; padding: 0 14px; }
  .tw-sort span { display: none; }
  .tw-list { padding: 0 16px 40px; gap: 6px; }
  .tw-row { grid-template-columns: 64px minmax(0, 1fr) 44px; height: 68px; padding: 0 10px; column-gap: 10px; }
  .tw-no, .tw-arch { display: none; }
  .tw-logo { height: 38px; }
  .tw-prog b { font-size: 15px; }
  .tw-play { width: 44px; height: 44px; font-size: 16px; }
}

/* ------------------------------------------------------------------ the player's archive (tv.js) */
/* The whole picture, see-through: the channel keeps playing under it. */
.tv-side.tw-arc {
  --tw-bg: #05090D; --tw-side: #080E14; --tw-card: #101820; --tw-card2: #151E27; --tw-red: #FF1238;
  --tw-t2: #AAB4C0; --tw-t3: #74808D; --tw-line: #202B35;
  inset: 0; width: auto; padding: 0; display: flex; overflow: hidden; z-index: 6; backdrop-filter: none; color: #fff;
  background: linear-gradient(90deg, rgba(5,9,13,.80) 0%, rgba(5,9,13,.58) 50%, rgba(5,9,13,.40) 100%);
}
.tv-side.tw-arc[hidden] { display: none; }
.tw-arc .tw-side { position: static; height: auto; align-self: stretch; background: rgba(8,14,20,.8); }
.tw-arcmain { position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 34px 44px 0; }
.tw-arcmain .tw-clock { top: 30px; right: 44px; }
.tw-archead .tw-chan { margin-top: 0; }
.tw-tabs { display: flex; gap: 34px; margin-top: 20px; border-bottom: 1px solid rgba(255,255,255,.08); }
.tw-tab { position: relative; padding: 0 2px 11px; border: 0; background: none; color: #dfe4ea; font: inherit; font-size: 14px; cursor: pointer; }
.tw-tab.on { color: var(--tw-red); font-weight: 700; }
.tw-tab.on::after { content: ""; position: absolute; left: -4px; right: -4px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--tw-red); }
.tw-tab:hover, .tw-tab:focus-visible { color: #fff; outline: none; }
.tw-days { display: flex; gap: 10px; margin-top: 16px; }
.tw-day { flex: 1; max-width: 150px; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 9px; border: 1px solid var(--tw-line); background: rgba(21,30,39,.85); color: #fff; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  transition: transform .15s; }
.tw-day small { font-size: 11px; font-weight: 400; color: var(--tw-t2); }
.tw-day.on { background: var(--tw-red); border-color: var(--tw-red); box-shadow: 0 6px 24px rgba(255,18,56,.35); }
.tw-day.on small { color: #fff; }
.tw-day:hover, .tw-day:focus-visible { transform: translateY(-1px); outline: 1px solid rgba(255,255,255,.7); outline-offset: 2px; }
.tw-alist { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-top: 16px; padding: 2px 2px 40px; scrollbar-width: thin; }
.tw-arow { display: grid; grid-template-columns: 150px 40px minmax(0, 1fr) 220px; align-items: stretch; min-height: 56px; padding: 0; border-radius: 9px;
  border: 1px solid transparent; background: none; color: #fff; font: inherit; text-align: left; cursor: pointer; }
.tw-arow:disabled { cursor: default; }
.tw-arow > span { display: flex; align-items: center; }
.tw-atime { justify-content: center; border-radius: 9px 0 0 9px; background: rgba(16,24,32,.62); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }
.tw-adot { position: relative; justify-content: center; }
.tw-adot::before { content: ""; position: absolute; top: -10px; bottom: -10px; left: 50%; width: 2px; background: rgba(255,255,255,.15); }
.tw-adot b { position: relative; width: 12px; height: 12px; border-radius: 50%; background: #3a4652; border: 2px solid #0d141b; }
.tw-ainfo { flex-direction: column; align-items: flex-start !important; justify-content: center; gap: 3px; padding-left: 10px; min-width: 0; background: rgba(16,24,32,.45); }
.tw-ainfo b { max-width: 100%; font-size: 14.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tw-ainfo > span { font-size: 11.5px; color: var(--tw-t2); }
.tw-abar { display: block; width: 60%; height: 3px; border-radius: 3px; background: rgba(255,255,255,.15); overflow: hidden; }
.tw-abar i { display: block; height: 100%; background: var(--tw-red); }
.tw-aact { justify-content: flex-end; padding-right: 10px; border-radius: 0 9px 9px 0; background: rgba(16,24,32,.45); }
.tw-abtn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 7px; border: 1px solid var(--tw-line);
  background: rgba(21,30,39,.95); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tw-abtn .tw-ic { font-size: 11px; }
.tw-aplaying { color: #8fb7ff; font-size: 12px; font-weight: 700; }
.tw-arow.live .tw-adot b { background: var(--tw-red); box-shadow: 0 0 12px var(--tw-red); }
.tw-arow.gone { opacity: .45; }
.tw-arow.playing { border-color: rgba(47,111,214,.6); }
.tw-arow.sel, .tw-arow:focus-visible { border-color: var(--tw-red); background: rgba(255,18,56,.12); outline: none; }
.tw-arow.sel > span { background: rgba(60,8,20,.55); }
.tw-arow.sel > .tw-adot { background: none; }
.tw-arow.sel .tw-adot b { background: var(--tw-red); box-shadow: 0 0 12px var(--tw-red); }
.tw-arow.sel .tw-abtn { background: var(--tw-red); border-color: var(--tw-red); box-shadow: 0 6px 22px rgba(255,18,56,.35); }
@media (max-width: 1100px) {
  .tw-arc .tw-side { display: none; }
  .tw-arcmain { padding: 24px 20px 0; }
  .tw-arow { grid-template-columns: 130px 36px minmax(0, 1fr) auto; min-height: 64px; }
  .tw-atime { font-size: 16px; }
  .tw-ainfo b { font-size: 17px; }
  .tw-abtn { height: 44px; padding: 0 14px; font-size: 14px; }
  .tw-day { height: 64px; font-size: 15px; }
  .tw-day small { font-size: 12px; }
  .tw-days { gap: 8px; overflow-x: auto; }
  .tw-tab { font-size: 17px; }
  .tw-tabs { gap: 24px; }
}
@media (max-width: 640px) {
  .tw-abtn { font-size: 0; gap: 0; width: 44px; justify-content: center; padding: 0; }
  .tw-abtn .tw-ic { font-size: 16px; }
  .tw-arcmain .tw-clock { display: none; }
}
