:root {
  color-scheme: dark;
  --ink: #04060c;
  --ink-2: #0a0e18;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f3f6fb;
  --muted: rgba(232, 238, 248, 0.58);
  --gold: #d8bf7a;
  --accent: #7ec8c8;
  --accent-2: #9fd8d4;
  --glass: rgba(16, 22, 36, 0.55);
  --glass-2: rgba(12, 16, 28, 0.72);
  --glass-edge: rgba(255, 255, 255, 0.18);
  --blur: blur(24px) saturate(1.4);
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --nav: 84px;
  --chrome: 100px;
  --rail: 292px;
  --r: 22px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; background: var(--ink); color: var(--text);
  font-family: "IBM Plex Sans Arabic", Cairo, "Segoe UI", Tahoma, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor;
  stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round;
}

.tv-app {
  display: grid;
  direction: ltr;
  grid-template-columns: var(--nav) minmax(0, 1fr);
  height: 100dvh;
  background:
    radial-gradient(ellipse 50% 42% at 58% 28%, rgba(126, 200, 200, 0.12), transparent 58%),
    radial-gradient(ellipse 40% 34% at 12% 88%, rgba(216, 191, 122, 0.08), transparent 55%),
    radial-gradient(ellipse 30% 28% at 88% 78%, rgba(90, 120, 180, 0.08), transparent 50%),
    var(--ink);
}

/* —— rail —— */
.tv-nav {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 16px 10px max(16px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(12, 16, 26, 0.82), rgba(8, 11, 18, 0.7));
  border-inline-end: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset -1px 0 0 rgba(255,255,255,0.04);
  z-index: 8;
}
.tv-mark { margin-bottom: 14px; }
.tv-mark img {
  width: 42px; height: 42px; border-radius: 15px; object-fit: cover; display: block;
  box-shadow: 0 0 0 1px var(--glass-edge), 0 10px 24px rgba(0,0,0,0.4);
}
.tv-nav button {
  width: 100%; min-height: 60px; border-radius: 18px;
  color: rgba(232, 238, 248, 0.5);
  display: grid; justify-items: center; gap: 6px; padding: 8px 4px 7px;
  transition: color .2s var(--ease), background .2s var(--ease), transform .16s var(--ease), box-shadow .2s var(--ease);
}
.tv-nav button span { font-size: 10px; font-weight: 700; letter-spacing: 0.01em; }
.tv-ico {
  width: 40px; height: 40px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(165deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: background .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease), color .2s var(--ease), transform .16s var(--ease);
}
.tv-nav button svg {
  width: 21px; height: 21px;
  stroke-width: 1.85;
  fill: currentColor;
  fill-opacity: 0.14;
}
.tv-nav button:hover { color: #fff; }
.tv-nav button:hover .tv-ico {
  background: linear-gradient(165deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04));
  border-color: rgba(255,255,255,0.18);
  color: #fff;
  transform: translateY(-1px);
}
.tv-nav button.is-on {
  color: #fff;
  background: linear-gradient(180deg, rgba(126,200,200,0.18), rgba(255,255,255,0.03));
  box-shadow: inset 0 0 0 1px rgba(126,200,200,0.32), 0 12px 26px rgba(0,0,0,0.25);
}
.tv-nav button.is-on .tv-ico {
  color: #0b1220;
  background: linear-gradient(165deg, #ffffff, #dfe8f4);
  border-color: transparent;
  box-shadow:
    0 0 0 1px rgba(126,200,200,0.35),
    0 8px 20px rgba(126,200,200,0.22),
    inset 0 1px 0 rgba(255,255,255,0.95);
}
.tv-nav button.is-on svg { fill-opacity: 0.2; stroke-width: 2; }
.tv-nav button:active { transform: scale(0.96); }

/* —— stage —— */
.tv-stage {
  position: relative; min-width: 0; height: 100dvh; overflow: hidden;
  direction: rtl;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(ellipse 58% 48% at 50% 42%, rgba(90, 120, 170, 0.16), transparent 62%),
    radial-gradient(ellipse 40% 30% at 50% 78%, rgba(126, 200, 200, 0.07), transparent 60%),
    #04060c;
}
.tv-panes {
  position: relative;
  min-height: 0;
  height: 100%;
  display: grid; place-items: center;
  grid-template-columns: 1fr; direction: ltr;
  padding: 4px 24px 8px;
  gap: 16px;
  box-sizing: border-box;
}
.tv-panes::before {
  content: "";
  position: absolute; left: 50%; top: 46%;
  width: min(72vw, 640px); height: min(58dvh, 520px);
  transform: translate(-50%, -50%);
  background: radial-gradient(ellipse at center, rgba(126,200,200,0.14), transparent 68%);
  pointer-events: none; z-index: 0;
  filter: blur(8px);
}
.tv-app.is-call .tv-panes {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-content: center;
  justify-items: center;
  width: 100%;
  padding: 8px 28px 12px;
  gap: 22px;
}
.tv-pane {
  --side: min(68dvh, min(46vw, 580px));
  position: relative;
  width: var(--side);
  display: grid;
  grid-template-rows: var(--side);
  max-width: 100%;
  min-width: 0;
  z-index: 1;
}
.tv-pane-peer { display: none; }
.tv-pane-peer .tv-glass { height: var(--side); }
.tv-app.is-call .tv-pane-peer { display: grid; }
.tv-app.is-call .tv-pane {
  --side: min(calc(100dvh - 188px), calc((100vw - var(--nav) - 72px) / 2), 520px);
  width: var(--side);
  height: auto;
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
  justify-self: center;
}
.tv-glass {
  position: relative; width: 100%; height: var(--side); overflow: hidden; border-radius: 32px;
  background: #000;
  border: 1px solid rgba(255,255,255,0.22);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.05),
    0 0 60px rgba(126,200,200,0.08),
    0 28px 56px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.12);
}
.tv-glass::before {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; border-radius: inherit;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.1),
    inset 0 18px 40px rgba(255,255,255,0.04);
}
.tv-glass::after { display: none; }
.tv-fill {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; background: #000;
  transform: translateZ(0);
  backface-visibility: hidden;
  opacity: 1;
  transition: opacity .28s ease;
}
/* Screen share: never crop — show the full desktop/window */
.tv-glass.is-sharing #tv-local,
.tv-glass.is-fit-contain #tv-local,
.tv-glass.is-fit-contain #tv-remote {
  object-fit: contain !important;
  object-position: center center;
}
.tv-glass.is-cam-solo #tv-local {
  object-fit: contain !important;
  object-position: center center;
}
.tv-fill.is-waiting { opacity: 0.2; }
.tv-vload {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-content: center; gap: 10px; justify-items: center;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(40, 70, 60, 0.45), transparent 62%),
    linear-gradient(160deg, rgba(12, 16, 28, 0.72), rgba(5, 8, 14, 0.88));
  color: rgba(236, 242, 248, 0.92);
  font-size: 12px; font-weight: 700;
  letter-spacing: 0.01em;
  pointer-events: none;
}
.tv-vload[hidden] { display: none !important; }
.tv-vload-spin {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2.5px solid rgba(125, 222, 160, 0.18);
  border-top-color: #8eecc0;
  border-right-color: rgba(142, 236, 192, 0.55);
  box-shadow: 0 0 22px rgba(125, 222, 160, 0.22);
  animation: tv-vspin .85s linear infinite;
}
.tv-vload span {
  padding: 5px 12px; border-radius: 999px;
  background: rgba(10, 14, 22, 0.55);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.tv-glass.is-connecting {
  outline: 1px solid rgba(125, 222, 160, 0.2);
}
.tv-glass.is-connecting::after {
  display: block;
  content: "";
  position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(110deg, transparent 28%, rgba(125, 222, 160, 0.12) 48%, transparent 68%);
  background-size: 220% 100%;
  animation: tv-search-sweep 1.6s ease-in-out infinite;
}
/* Never stack search chrome on top of a live call. */
.tv-app.is-call .tv-veil { display: none !important; }
.tv-app.is-call .tv-panes.is-searching .tv-pane-peer .tv-glass::after { display: none !important; }
.tv-panes.is-searching .tv-pane-me .tv-vload { display: none !important; }
@keyframes tv-vspin {
  to { transform: rotate(360deg); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  #tv-local.is-mirror { transform: scaleX(-1) translateZ(0); }
}
.tv-pip {
  position: absolute;
  z-index: 3;
  width: min(34%, 168px);
  aspect-ratio: 16 / 9;
  inset-inline-end: 10px;
  bottom: 10px;
  border-radius: 12px;
  object-fit: cover;
  background: #070a12;
  border: 2px solid rgba(255,255,255,0.82);
  box-shadow: 0 8px 22px rgba(0,0,0,0.45);
  pointer-events: none;
}
.tv-pip[hidden] { display: none !important; }
.tv-glass.is-pip-sm .tv-pip { width: min(24%, 120px); }
.tv-glass.is-pip-md .tv-pip { width: min(34%, 168px); }
.tv-glass.is-pip-lg .tv-pip { width: min(46%, 220px); }
.tv-pane-me .tv-glass.is-sharing #tv-local-pip:not([hidden]),
.tv-pane-peer .tv-glass.is-dual #tv-remote-pip:not([hidden]) { display: block; }
/* Camera-solo: hide screen pip */
.tv-glass.is-cam-solo #tv-local-pip { display: none !important; }
.tv-pane-zooms {
  position: absolute;
  z-index: 6;
  top: 10px;
  inset-inline-end: 10px;
  display: flex;
  flex-direction: row-reverse;
  gap: 8px;
  pointer-events: none;
}
.tv-pane-zoom {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.38);
  background: rgba(8, 12, 20, 0.78);
  color: #fff;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.38);
  cursor: pointer;
  pointer-events: auto;
}
.tv-pane-zoom-ico { display: grid; place-items: center; line-height: 0; }
.tv-pane-zoom-out { display: none; }
.tv-pane-zoom.is-on .tv-pane-zoom-in { display: none; }
.tv-pane-zoom.is-on .tv-pane-zoom-out { display: grid; }
.tv-pane-zoom svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tv-pane-zoom-cam svg {
  fill: currentColor;
  fill-opacity: 0.14;
}
.tv-pane-zoom[hidden] { display: none !important; }
.tv-pane-zoom.is-on,
.tv-pane-zoom:hover {
  background: rgba(216, 191, 122, 0.3);
  border-color: rgba(216, 191, 122, 0.75);
  color: var(--gold);
}
/* Peer zoom sits alone on the peer glass */
.tv-pane-peer > .tv-glass > .tv-pane-zoom {
  position: absolute;
  z-index: 6;
  top: 10px;
  inset-inline-end: 10px;
}
.tv-app.is-call .tv-panes.is-focus-screen .tv-pane-peer,
.tv-app.is-call .tv-panes.is-focus-cam .tv-pane-peer,
.tv-app.is-call .tv-panes.is-focus-peer .tv-pane-me { display: none !important; }
/* Enlarged screen: wide 16:9 so the full share is visible */
.tv-app.is-call .tv-panes.is-focus-screen .tv-pane-me {
  width: min(calc(100vw - var(--nav) - 40px), calc((100dvh - 170px) * 16 / 9), 1100px);
  max-width: 100%;
  --side: auto;
  grid-template-rows: auto;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 170px);
  justify-self: center;
}
.tv-app.is-call .tv-panes.is-focus-screen .tv-pane-me .tv-glass {
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 170px);
}
.tv-app.is-call .tv-panes.is-focus-cam .tv-pane-me,
.tv-app.is-call .tv-panes.is-focus-peer .tv-pane-peer {
  --side: min(calc(100dvh - 170px), calc(100vw - var(--nav) - 48px), 720px);
  width: var(--side);
  justify-self: center;
}
.tv-app.is-call .tv-panes.is-focus-cam .tv-pane-me .tv-glass,
.tv-app.is-call .tv-panes.is-focus-peer .tv-pane-peer .tv-glass {
  aspect-ratio: auto;
}
.tv-fab-share {
  min-width: 52px;
  padding: 0 12px;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.tv-fab-share .tv-fab-lab {
  display: none;
  line-height: 1;
  white-space: nowrap;
}
/* Filters on live <video> freeze many phones — keep disabled */
#tv-local.fx-soft,
#tv-local.fx-warm,
#tv-local.fx-cool,
#tv-remote.is-blur { filter: none !important; }
.tv-fxlayer { position: absolute; inset: 0; z-index: 4; pointer-events: none; overflow: hidden; }
.tv-chrome.is-live {
  min-height: 84px;
  background: linear-gradient(180deg, transparent, rgba(5,7,13,0.55) 30%, rgba(5,7,13,0.92));
  flex-wrap: nowrap;
  justify-content: center;
  gap: 8px;
  padding-bottom: 18px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tv-chrome.is-live .tv-fab-share {
  background: rgba(216, 191, 122, 0.16);
  border-color: rgba(216, 191, 122, 0.45);
  color: var(--gold);
  flex: 0 0 auto;
}
.tv-fab-share svg {
  width: 20px;
  height: 20px;
}
@media (min-width: 420px) {
  .tv-fab-share { min-width: 88px; }
  .tv-fab-share .tv-fab-lab { display: inline; }
}
.tv-corner {
  position: static; z-index: 7;
  bottom: auto; left: auto; right: auto;
  min-height: 52px; min-width: 124px; padding: 0 18px;
  border-radius: 999px; border: 1px solid var(--glass-edge);
  font-size: 14px; font-weight: 800;
  white-space: nowrap;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
  transition: transform .16s var(--ease), background .2s var(--ease);
}
.tv-corner:active { transform: scale(0.97); }
#tv-end { order: 1; }
#tv-devs-live { order: 2; }
#tv-share-live { order: 3; }
#tv-next { order: 4; }
.tv-sheet-friends {
  position: absolute;
  display: flex; flex-direction: column; padding-bottom: 0;
  overflow: hidden;
}
.tv-sheet-friends .tv-friends-home {
  flex: 1; min-height: 0; overflow: auto; padding-bottom: 20px;
}
.tv-chat {
  position: absolute; inset: 0; z-index: 2;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  background: rgba(10, 14, 22, 0.96);
}
.tv-chat[hidden] { display: none !important; }
.tv-chat-head {
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.tv-chat-back {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05);
  color: #fff; font-size: 22px; line-height: 1; transform: scaleX(-1);
}
.tv-chat-who { min-width: 0; flex: 1; }
.tv-chat-who strong { display: block; font-size: 16px; font-weight: 800; }
.tv-chat-who em {
  display: block; margin-top: 2px;
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted);
}
.tv-chat-log {
  overflow: auto; padding: 16px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.tv-bubble {
  max-width: min(78%, 320px); padding: 10px 14px;
  border-radius: 16px 16px 16px 6px;
  background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 14px; font-weight: 600; line-height: 1.45;
  align-self: flex-start; white-space: pre-wrap; word-break: break-word;
}
.tv-bubble.is-mine {
  align-self: flex-end;
  border-radius: 16px 16px 6px 16px;
  background: linear-gradient(180deg, #fff, #eef2f8); color: #111;
  border-color: transparent;
}
.tv-chat-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px;
  padding: 10px 12px max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--glass-edge);
  background: rgba(10, 14, 22, 0.88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.tv-chat-bar input {
  min-height: 46px; border-radius: 999px; border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06); padding: 0 16px; color: #fff; font-size: 14px; font-weight: 600;
}
.tv-chat-bar button {
  min-height: 46px; min-width: 84px; padding: 0 18px; border-radius: 999px; border: 0;
  background: #fff; color: #111; font-size: 14px; font-weight: 800;
}
.tv-corner[hidden] { display: none !important; }
.tv-corner-stop {
  left: max(18px, env(safe-area-inset-left));
  background: rgba(255,255,255,0.94); color: #111; border-color: transparent;
}
.tv-corner-next {
  background: rgba(18, 24, 36, 0.72);
  border-color: rgba(216,191,122,0.4);
  color: var(--gold);
}
.tv-fab-devs {
  position: static; z-index: 7; left: auto; bottom: auto;
  transform: none;
  width: 52px; height: 52px; padding: 0; border-radius: 999px;
  border: 1px solid var(--glass-edge);
  background: rgba(16, 22, 34, 0.7);
  color: #fff; display: grid; place-items: center;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.tv-fab-devs[hidden] { display: none !important; }
.tv-dock {
  width: min(680px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px;
}
.tv-dock-glass {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px 46px auto;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 7px 7px 8px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(22, 28, 42, 0.72), rgba(12, 16, 28, 0.68));
  border: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow:
    0 18px 44px rgba(0,0,0,0.35),
    inset 0 1px 0 rgba(255,255,255,0.12),
    0 0 0 1px rgba(0,0,0,0.2);
}
.tv-tool {
  width: 46px; height: 46px; border-radius: 999px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  transition: background .2s var(--ease), transform .16s var(--ease);
}
.tv-tool:hover { background: rgba(255,255,255,0.14); }
.tv-tool:active { transform: scale(0.96); }
.tv-tool svg { width: 19px; height: 19px; fill: currentColor; fill-opacity: 0.12; }
.tv-tool-share svg,
.tv-fab-share svg,
.tv-share-btn svg {
  fill: currentColor;
  fill-opacity: 0.1;
}
.tv-tool.is-on,
.tv-fab-share.is-on {
  background: rgba(216, 191, 122, 0.22);
  border-color: rgba(216, 191, 122, 0.55);
  color: var(--gold);
  box-shadow: 0 0 0 1px rgba(216, 191, 122, 0.18);
}
.tv-fab-devs svg { width: 18px; height: 18px; }
.tv-share-row,
.tv-dev-block-share {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}
.tv-share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  width: 100%;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: background .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.tv-share-btn svg { width: 18px; height: 18px; fill: currentColor; fill-opacity: 0.15; flex: 0 0 auto; }
.tv-share-btn.is-on {
  background: rgba(216, 191, 122, 0.18);
  border-color: rgba(216, 191, 122, 0.5);
  color: var(--gold);
}
.tv-share-hint {
  display: block;
  font-style: normal;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  line-height: 1.35;
  padding-inline: 2px;
}
.tv-pill {
  min-height: 46px; min-width: 0; padding: 4px 14px; border-radius: 999px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  border: 1px solid transparent;
  background: transparent;
  color: #fff; font-size: 12px; font-weight: 700;
  display: grid; justify-items: start; gap: 1px; text-align: start;
}
.tv-pill-k {
  display: block; font-size: 10px; font-weight: 700; color: var(--muted); line-height: 1.1;
}
.tv-pill b { font-weight: 800; font-size: 13px; line-height: 1.15; }
.tv-pill:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.08);
}
.tv-go {
  min-height: 48px; min-width: 132px; padding: 0 22px; border-radius: 999px; border: 0;
  background: linear-gradient(180deg, #ffffff, #e7eef8);
  color: #0b1220;
  font-size: 14px; font-weight: 800;
  white-space: nowrap;
  box-shadow:
    0 10px 28px rgba(0,0,0,0.35),
    0 0 24px rgba(126,200,200,0.18),
    inset 0 1px 0 rgba(255,255,255,0.95);
  transition: transform .16s var(--ease), box-shadow .2s var(--ease);
}
.tv-go:hover { box-shadow: 0 14px 32px rgba(0,0,0,0.4), 0 0 28px rgba(126,200,200,0.25); }
.tv-go:active { transform: scale(0.97); }
.tv-go[hidden] { display: none !important; }
.tv-dock-glass:has(.tv-go[hidden]) {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 46px 46px;
}
.tv-pop.is-arming { pointer-events: none; }
.tv-pop.is-arming .tv-pop-card { pointer-events: auto; }
.tv-pop-devs { place-items: end center; }
.tv-pop-card-devs {
  width: min(420px, 100%);
  max-height: min(86dvh, 680px);
  padding: 14px 14px 12px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}
.tv-pop-card-devs .tv-pop-h { margin-bottom: 0; }
.tv-pop-sub, .tv-sheet-sub {
  display: block; margin-top: 3px;
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted);
}
.tv-dev-preview {
  position: relative;
  height: 96px;
  border-radius: 16px;
  overflow: hidden;
  background: #070a12;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.35);
  flex: none;
}
.tv-dev-preview-v {
  width: 100%; height: 100%; object-fit: cover; display: block;
  background: #070a12;
}
.tv-dev-preview-v.is-mirror { transform: scaleX(-1); }
.tv-dev-preview-tag {
  position: absolute; inset-inline-start: 10px; bottom: 8px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(0,0,0,0.55); color: rgba(255,255,255,0.88);
  font-size: 11px; font-weight: 800; letter-spacing: 0.01em;
}
.tv-devs {
  width: 100%; min-height: 0;
  display: grid; gap: 12px; align-content: start;
  overflow: auto; overscroll-behavior: contain;
  padding-inline-end: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.22) transparent;
}
.tv-devs::-webkit-scrollbar { width: 6px; }
.tv-devs::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.22);
  border-radius: 999px;
}
.tv-devs::-webkit-scrollbar-track { background: transparent; }
.tv-dev-block {
  display: grid; gap: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  min-width: 0;
}
.tv-dev-block-share { gap: 6px; margin-top: 2px; }
.tv-dev-h {
  margin: 0; display: flex; align-items: center; gap: 8px;
  min-width: 0;
  font-size: 12px; font-weight: 800; color: rgba(255,255,255,0.72);
  text-transform: none;
}
.tv-dev-h span {
  color: rgba(255,255,255,0.92); font-size: 13px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-dev-h em {
  margin-inline-start: auto;
  flex: none;
  font-style: normal; font-size: 11px; font-weight: 700;
  color: rgba(232, 238, 248, 0.4);
  white-space: nowrap;
}
.tv-dev-h svg { width: 15px; height: 15px; opacity: 0.8; color: var(--accent-2); flex: none; }
/* Single scroll on .tv-devs — no nested scrollbars crowding the lists. */
.tv-dev-opts {
  display: grid; gap: 4px;
  max-height: none;
  overflow: visible;
  padding: 4px;
  border-radius: 14px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
}
.tv-dev-opt {
  width: 100%; min-height: 44px; padding: 8px 10px;
  display: flex; align-items: center; gap: 10px;
  border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: #fff; text-align: start;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.tv-dev-opt:hover { background: rgba(255,255,255,0.05); }
.tv-dev-meta {
  flex: 1; min-width: 0;
  display: grid; gap: 1px;
  direction: ltr; unicode-bidi: isolate; text-align: start;
}
.tv-dev-title {
  font-size: 12.5px; font-weight: 800; line-height: 1.25;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-dev-detail {
  font-size: 10.5px; font-weight: 600; line-height: 1.3;
  color: rgba(232, 238, 248, 0.48);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-dev-check {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 1.5px solid rgba(255,255,255,0.22);
  background: transparent;
}
.tv-dev-opt.is-on {
  border-color: rgba(125, 222, 160, 0.45);
  background: rgba(125, 222, 160, 0.1);
}
.tv-dev-opt.is-on .tv-dev-title { color: #e8fff0; }
.tv-dev-opt.is-on .tv-dev-check {
  border-color: #7ddea0;
  background: #7ddea0;
  box-shadow: inset 0 0 0 3px #0d1018;
}
.tv-dev-empty {
  min-height: 40px; display: grid; place-items: center;
  color: var(--muted); font-size: 12px; font-weight: 700;
}
.tv-devs-done {
  width: 100%; margin: 0;
  min-height: 46px; border-radius: 14px;
}
.tv-flag {
  display: inline-block; width: 18px; height: 12px; object-fit: cover;
  border-radius: 2px; vertical-align: -1px;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}
.tv-flag-wrap {
  position: relative; display: inline-block;
  width: 18px; height: 12px; vertical-align: -1px;
  border-radius: 2px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.18);
}
.tv-flag-wrap .tv-flag {
  width: 100%; height: 100%; vertical-align: top;
  border-radius: 0; box-shadow: none;
}
.tv-flag-wrap.is-il .tv-flag-x {
  position: absolute; inset-inline-start: 0; top: 0;
  width: 50%; height: 100%;
  background: rgba(190, 16, 28, 0.42);
  pointer-events: none;
}
.tv-flag-wrap.is-il .tv-flag-x::before,
.tv-flag-wrap.is-il .tv-flag-x::after {
  content: '';
  position: absolute; left: 50%; top: 50%;
  width: 72%; height: 2px;
  background: #ff2d3a;
  border-radius: 2px;
  box-shadow: 0 0 0 0.5px rgba(0,0,0,0.35);
}
.tv-flag-wrap.is-il .tv-flag-x::before { transform: translate(-50%, -50%) rotate(42deg); }
.tv-flag-wrap.is-il .tv-flag-x::after { transform: translate(-50%, -50%) rotate(-42deg); }
.tv-cpick-btn .tv-flag-wrap,
.tv-cpick-item .tv-flag-wrap { width: 22px; height: 15px; flex: none; }
.tv-cpick-item .tv-flag-wrap .tv-flag { width: 22px; height: 15px; }
.tv-row-sub .tv-flag-wrap { width: 16px; height: 11px; }
.tv-tag .tv-flag, .tv-peer .tv-flag,
.tv-tag .tv-flag-wrap, .tv-peer .tv-flag-wrap { margin-inline-end: 2px; }
.tv-seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px;
}
.tv-seg button {
  min-height: 42px; border-radius: 14px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04); color: rgba(255,255,255,0.8);
  font-size: 13px; font-weight: 800;
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .14s var(--ease), box-shadow .18s var(--ease);
}
.tv-seg button.is-on {
  background: linear-gradient(180deg, rgba(126,200,200,0.28), rgba(255,255,255,0.1));
  color: #fff; border-color: rgba(126,200,200,0.45);
}
.tv-seg button:active { transform: scale(0.97); }

/* Azar-like clarity: visual gender cards */
.tv-match-k {
  margin: 0 0 10px;
  font-size: 13px; font-weight: 800; color: rgba(255,255,255,0.88);
}
.tv-seg-cards {
  gap: 10px; margin-bottom: 16px;
}
.tv-seg-cards button {
  min-height: 132px;
  padding: 12px 8px 10px;
  border-radius: 18px;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 8px;
  background: rgba(255,255,255,0.045);
  border: 2px solid rgba(255,255,255,0.08);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tv-seg-cards button b {
  font-size: 14px; font-weight: 800; line-height: 1.1;
}
.tv-seg-cards button em {
  font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted);
}
.tv-seg-cards button.is-on {
  background: rgba(126,200,200,0.1);
  border-color: var(--accent);
  box-shadow:
    0 0 0 1px rgba(126,200,200,0.35),
    0 0 22px rgba(126,200,200,0.18),
    inset 0 1px 0 rgba(255,255,255,0.08);
}
.tv-seg-cards button.is-on em { color: var(--accent-2); }
.tv-gavatar {
  width: 64px; height: 64px; border-radius: 18px;
  display: grid; place-items: center;
  overflow: hidden;
  background: #ead7c2;
  box-shadow: 0 8px 18px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.35);
}
.tv-gavatar picture,
.tv-gavatar img {
  width: 100%; height: 100%;
  display: block;
}
.tv-gavatar img {
  object-fit: cover; object-position: center 42%;
}
.tv-filter-go {
  width: 100%; min-height: 52px; margin: 4px 0 10px; border: 0; border-radius: 999px;
  background: linear-gradient(180deg, #fff, #e8eef6);
  color: #0b1220; font-size: 16px; font-weight: 800;
  box-shadow: 0 12px 28px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.95);
}
.tv-filter-go:active { transform: scale(0.98); }
.tv-pop-filter .tv-charge {
  background: transparent;
  border-color: rgba(216,191,122,0.4);
  box-shadow: none;
}
.tv-pop-filter .tv-pop-tip {
  margin: 12px 0 14px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}
.tv-pop-filter .tv-chip { margin-bottom: 0; overflow: visible; }
.tv-pop-filter .tv-cpick-btn {
  min-height: 50px;
  border-radius: 16px;
  font-size: 14px;
  border-color: rgba(255,255,255,0.14);
}
.tv-pop-filter .tv-cpick.is-open:not(.is-up) .tv-cpick-btn { border-radius: 16px 16px 0 0; }
.tv-pop-filter .tv-cpick.is-open.is-up .tv-cpick-btn { border-radius: 0 0 16px 16px; }
.tv-pop-card.tv-pop-filter { overflow: visible; }

.tv-pop {
  position: fixed; inset: 0; z-index: 80;
  display: grid; place-items: end center;
  padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.55);
}
.tv-pop[hidden] { display: none !important; }
.tv-pop-card {
  width: min(420px, 100%);
  padding: 18px;
  border-radius: 26px;
  background: rgba(14, 18, 28, 0.88);
  border: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 28px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.1);
}
.tv-pop-h {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.tv-pop-h strong { display: block; font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.tv-pop-tip {
  margin: 0 0 12px; font-size: 13px; line-height: 1.55; color: var(--muted); font-weight: 600;
}

/* country picker — flips up when space below is tight (filter sheet) */
.tv-cpick { min-width: 0; position: relative; z-index: 5; }
.tv-cpick.is-open { z-index: 30; }
.tv-cpick-btn {
  appearance: none; width: 100%; min-height: 44px; padding: 0 28px 0 12px;
  border-radius: 14px; border: 1px solid var(--line); color: #fff; text-align: start;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.1), rgba(255,255,255,0.03)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffff99' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left 10px center / 10px;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
}
.tv-cpick.is-open .tv-cpick-btn {
  border-color: rgba(126,200,200,0.45);
  border-radius: 14px 14px 0 0;
}
.tv-cpick.is-open.is-up .tv-cpick-btn {
  border-radius: 0 0 14px 14px;
}
.tv-cpick-btn .tv-flag { flex: none; }
.tv-cpick-drop {
  position: absolute; top: calc(100% - 1px); bottom: auto; left: 0; right: 0;
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  max-height: min(42dvh, 260px);
  border: 1px solid rgba(126,200,200,0.35);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  background: rgba(12, 16, 26, 0.98);
  box-shadow: 0 18px 40px rgba(0,0,0,0.45);
  overflow: hidden;
  z-index: 40;
}
.tv-cpick.is-up .tv-cpick-drop {
  top: auto;
  bottom: calc(100% - 1px);
  border-top: 1px solid rgba(126,200,200,0.35);
  border-bottom: 0;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -18px 40px rgba(0,0,0,0.45);
}
.tv-cpick-drop[hidden] { display: none !important; }
.tv-cpick-q {
  min-height: 42px; margin: 8px 8px 0; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.05); padding: 0 14px; color: #fff; font-weight: 700;
}
.tv-cpick-list {
  overflow: auto; overscroll-behavior: contain; padding: 6px 8px 10px;
}
.tv-cpick-head {
  padding: 10px 10px 4px; font-size: 11px; font-weight: 800;
  color: rgba(232, 238, 248, 0.45); letter-spacing: 0.02em;
}
.tv-cpick-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  min-height: 40px; padding: 0 10px; border-radius: 12px; border: 0;
  background: transparent; color: #fff; font-size: 13px; font-weight: 700; text-align: start;
}
.tv-cpick-item:hover, .tv-cpick-item.is-on { background: rgba(255,255,255,0.08); }
.tv-cpick-item.is-on { color: var(--accent-2); }
.tv-cpick-item .tv-flag { width: 22px; height: 15px; }
.tv-dev {
  display: grid; gap: 3px; min-width: 0;
  font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.78);
}
.tv-dev select {
  appearance: none; -webkit-appearance: none;
  min-height: 40px; width: 100%; padding: 0 28px 0 12px;
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.18);
  background-color: rgba(18, 22, 34, 0.96);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ffffffcc' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 10px center;
  background-size: 10px;
  color: #fff;
  -webkit-text-fill-color: #fff;
  font-size: 12px; font-weight: 700;
  text-shadow: none;
  text-overflow: ellipsis; white-space: nowrap; overflow: hidden;
  transform: none;
  filter: none;
}

/* —— floating top —— */
.tv-top {
  position: relative; z-index: 6; top: auto; inset-inline: 0;
  direction: ltr;
  display: flex; align-items: center; gap: 8px;
  padding: max(12px, env(safe-area-inset-top)) 18px 10px;
  background: linear-gradient(180deg, rgba(5,7,13,0.88), rgba(5,7,13,0.35) 70%, transparent);
  pointer-events: none;
}
.tv-top > * { pointer-events: auto; }
.tv-word {
  font-weight: 800; font-size: 22px; letter-spacing: -0.03em;
  background: linear-gradient(115deg, #fff 10%, var(--accent-2) 55%, var(--gold) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.35));
}
.tv-gem, .tv-back {
  min-height: 40px; padding: 0 15px; border-radius: 999px;
  background: linear-gradient(180deg, rgba(24, 30, 44, 0.72), rgba(14, 18, 30, 0.62));
  color: #fff; text-decoration: none;
  border: 1px solid var(--glass-edge); display: inline-flex; align-items: center;
  font-size: 13px; font-weight: 700;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 8px 18px rgba(0,0,0,0.2);
}
.tv-gem { margin-inline-start: auto; }
.tv-gem::before { content: "◆"; margin-inline-end: 7px; color: var(--gold); font-size: 11px; }

/* —— floating chrome —— */
.tv-chrome {
  position: relative; z-index: 6; left: auto; right: auto; bottom: auto;
  direction: ltr;
  display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 12px;
  min-height: 84px;
  padding: 10px 20px 20px;
  background: linear-gradient(180deg, transparent, rgba(5,7,13,0.55) 35%, rgba(5,7,13,0.94));
  pointer-events: none;
}
.tv-chrome:not(.is-live) { flex-direction: column; }
.tv-chrome > * { pointer-events: auto; }
.tv-chrome #tv-docks { width: min(680px, 100%); }
.tv-bar {
  display: flex; align-items: center; gap: 8px;
  max-width: min(560px, 100%);
  padding: 10px;
  border-radius: 28px;
  background: rgba(14, 18, 30, 0.62);
  border: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.08);
}
.tv-bar[hidden], #tv-docks[hidden] { display: none !important; }
#tv-cost {
  grid-column: 1 / -1;
  justify-self: center;
  margin-top: 2px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
#tv-cost[hidden] { display: none !important; }
.tv-chip {
  display: grid; gap: 4px; min-width: 0; margin-bottom: 12px;
  font-size: 11px; font-weight: 700; color: var(--muted);
}
.tv-charge {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 999px;
  border: 1px solid rgba(216,191,122,0.45); color: var(--gold); font-weight: 800; font-size: 14px;
  background: linear-gradient(180deg, rgba(216,191,122,0.18), rgba(216,191,122,0.08));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
#tv-cost.is-paid { color: #ffb4b4; }

.tv-note {
  position: absolute; z-index: 6; left: 20px; right: 20px; bottom: 88px;
  margin: 0; text-align: center; font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.86); text-shadow: 0 1px 8px rgba(0,0,0,0.5);
  pointer-events: none;
}
.tv-note:empty { display: none; }

.tv-veil, .tv-gap {
  position: absolute; z-index: 5; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; align-items: center; gap: 12px;
  padding: 10px 10px 10px 14px; border-radius: 999px;
  background: rgba(14, 18, 30, 0.78); border: 1px solid var(--glass-edge);
  font-size: 14px; font-weight: 700;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 18px 40px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.1);
}
.tv-veil {
  min-width: min(320px, calc(100% - 28px));
  max-width: calc(100% - 28px);
  gap: 14px;
  padding: 12px 12px 12px 14px;
  animation: tv-veil-in .38s var(--ease);
}
.tv-veil-radar {
  position: relative;
  width: 46px; height: 46px; flex: none;
  border-radius: 50%;
}
.tv-veil-radar i,
.tv-veil-radar em {
  position: absolute; inset: 0; border-radius: 50%;
  border: 1.5px solid rgba(125, 222, 160, 0.55);
}
.tv-veil-radar i {
  animation: tv-radar 1.8s var(--ease) infinite;
  opacity: 0;
}
.tv-veil-radar i:nth-child(2) { animation-delay: .45s; }
.tv-veil-radar i:nth-child(3) { animation-delay: .9s; }
.tv-veil-radar em {
  inset: 14px;
  background: radial-gradient(circle at 40% 35%, #d8ffe6, #7ddea0 55%, #3f9f6a);
  border: 0;
  box-shadow: 0 0 18px rgba(125, 222, 160, 0.55);
  animation: tv-radar-core 1.2s ease-in-out infinite;
}
.tv-veil-copy {
  display: grid; gap: 2px; min-width: 0; flex: 1;
  text-align: start;
}
.tv-veil-copy strong {
  font-size: 14px; font-weight: 800; letter-spacing: 0.01em;
}
.tv-veil-copy #tv-veil-sub {
  font-size: 11px; font-weight: 600; color: rgba(232, 238, 248, 0.62);
  line-height: 1.35;
  min-height: 1.35em;
  transition: opacity .25s ease;
}
.tv-veil-copy #tv-veil-sub.is-swap { opacity: 0; }
.tv-veil-time {
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  font-size: 12px; font-weight: 800;
  color: #9be6b5;
  letter-spacing: 0.04em;
}
.tv-veil button, .tv-gap button {
  min-height: 34px; padding: 0 12px; border-radius: 999px;
  background: #fff; color: #111; font-size: 13px; font-weight: 700;
}
.tv-veil button { width: 34px; padding: 0; font-size: 18px; flex: none; }
.tv-panes.is-searching .tv-pane-peer .tv-glass {
  outline: 1px solid rgba(125, 222, 160, 0.22);
  box-shadow:
    0 0 0 1px rgba(125, 222, 160, 0.08),
    0 0 40px rgba(125, 222, 160, 0.12),
    0 28px 56px rgba(0,0,0,0.48);
}
.tv-panes.is-searching .tv-pane-peer .tv-glass::after {
  display: block;
  content: "";
  position: absolute; inset: 0; z-index: 1; pointer-events: none; border-radius: inherit;
  background:
    linear-gradient(110deg, transparent 30%, rgba(125, 222, 160, 0.14) 48%, transparent 66%);
  background-size: 220% 100%;
  animation: tv-search-sweep 1.8s ease-in-out infinite;
}
@keyframes tv-veil-in {
  from { opacity: 0; transform: translate(-50%, -46%) scale(0.94); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes tv-radar {
  0% { transform: scale(0.45); opacity: 0.7; }
  70% { opacity: 0.15; }
  100% { transform: scale(1.15); opacity: 0; }
}
@keyframes tv-radar-core {
  0%, 100% { transform: scale(0.92); filter: brightness(1); }
  50% { transform: scale(1); filter: brightness(1.15); }
}
@keyframes tv-search-sweep {
  0% { background-position: 120% 0; opacity: 0.2; }
  45% { opacity: 0.85; }
  100% { background-position: -40% 0; opacity: 0.2; }
}
.tv-gap {
  width: 128px; min-height: 128px; border-radius: 32px;
  flex-direction: column; justify-content: center; padding: 16px; gap: 6px;
}
.tv-gap strong { font-size: 48px; font-weight: 700; line-height: 1; }
.tv-gap strong.is-tick { animation: tv-tick .35s var(--ease); }
.tv-gap button { background: transparent; color: var(--muted); box-shadow: none; }

.tv-veil[hidden], .tv-peer[hidden], #tv-remote[hidden], .tv-sheet[hidden],
#tv-gap[hidden], #tv-me-tag[hidden], #tv-docks[hidden], .tv-sheet-mask[hidden] {
  display: none !important;
}

.tv-tag, .tv-peer {
  position: absolute; z-index: 3; left: 14px; right: auto; top: auto; bottom: 14px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(10, 14, 22, 0.55); border: 1px solid rgba(255,255,255,0.14);
  font-size: 12px; font-weight: 700;
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
  max-width: calc(100% - 32px);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-pane-peer .tv-peer { left: 16px; right: auto; }
.tv-country {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 0 0; padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.92);
}
.tv-country[hidden] { display: none !important; }
.tv-country-flag { display: grid; place-items: center; }
.tv-country strong { display: block; font-size: 15px; font-weight: 800; }
.tv-country-lock {
  display: block; margin-top: 3px;
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted);
}

.tv-burst {
  position: absolute; left: var(--side, 50%); top: 58%;
  width: 14px; height: 14px; margin-left: -7px; border-radius: 50%;
  animation: tv-rise 1.05s var(--ease) var(--delay, 0s) forwards;
}
.tv-burst.is-heart { background: #e7b7c8; box-shadow: 0 0 18px rgba(231,183,200,0.7); }
.tv-burst.is-clap { background: #e4c36a; box-shadow: 0 0 18px rgba(228,195,106,0.65); }
.tv-burst.is-spark { background: #fff; box-shadow: 0 0 16px rgba(255,255,255,0.7); }
.tv-burst.is-smile { background: #c9d4e4; box-shadow: 0 0 16px rgba(201,212,228,0.7); }
@keyframes tv-rise {
  0% { transform: translate3d(0, 12px, 0) scale(0.4); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translate3d(var(--x, 0px), -38vh, 0) scale(1); opacity: 0; }
}
@keyframes tv-tick { from { transform: scale(0.86); opacity: 0.4; } to { transform: none; opacity: 1; } }

/* —— sheets —— */
.tv-sheet-mask {
  position: absolute; z-index: 8; inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.tv-sheet-mask[hidden] { display: none !important; }
.tv-sheet {
  position: absolute; z-index: 9; top: 0; bottom: 0; inset-inline-end: 0;
  width: min(420px, 100%); padding: 18px 18px 28px; overflow: auto;
  background: rgba(10, 14, 22, 0.86); border-inline-start: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  animation: tv-sheet-in .28s var(--ease);
  box-shadow: -20px 0 48px rgba(0,0,0,0.45);
}
@keyframes tv-sheet-in {
  from { transform: translateX(12px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}
.tv-sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin: 0 0 18px; padding-top: max(8px, env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 2;
  background: linear-gradient(180deg, rgba(10,14,22,0.96) 70%, transparent);
}
.tv-sheet-head h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.tv-sheet-x {
  width: 36px; height: 36px; border-radius: 50%; flex: none;
  border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.06);
  font-size: 20px; line-height: 1; color: #fff; font-weight: 700;
}
.tv-sheet h2 { margin: 0 0 16px; font-size: 20px; font-weight: 700; }
.tv-shop-head { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.tv-shop-head-solo { grid-template-columns: 1fr; }
.tv-sheet-shop .tv-sheet-head { margin-bottom: 14px; }
.tv-shop-tabs {
  display: inline-flex; gap: 8px; margin: 0 0 14px; padding: 4px;
  border-radius: 999px; background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
}
.tv-shop-tab {
  min-height: 36px; padding: 0 16px; border-radius: 999px;
  border: 1px solid transparent; color: rgba(255,255,255,0.7);
  font-size: 13px; font-weight: 800; background: transparent;
}
.tv-shop-tab.is-on {
  color: #0b1220;
  background: linear-gradient(180deg, #b8f0c8, #7ddea0);
  border-color: rgba(125, 222, 160, 0.55);
  box-shadow: 0 6px 16px rgba(125, 222, 160, 0.22);
}
.tv-shop-balance {
  display: grid; grid-template-columns: 1fr; gap: 12px;
  margin: 0 0 12px; padding: 16px 18px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.tv-shop-balance:has(#tv-shop-pass:not([hidden])) {
  grid-template-columns: 1fr 1fr;
}
.tv-shop-balance em {
  font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted);
}
.tv-shop-balance strong {
  display: block; margin-top: 4px;
  font-size: 30px; font-weight: 900; letter-spacing: -0.03em; line-height: 1;
  color: #fff;
}
.tv-shop-pass span {
  display: block; margin-top: 4px;
  font-size: 11px; font-weight: 700; color: var(--accent-2);
}
.tv-shop-banner {
  display: grid; gap: 8px; justify-items: start;
  margin: 0 0 16px; padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(126, 200, 200, 0.28);
  background: rgba(126, 200, 200, 0.08);
  font-size: 12px; font-weight: 700; line-height: 1.55; color: rgba(220, 240, 238, 0.92);
}
.tv-shop-banner-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(125, 222, 160, 0.18);
  color: #9aefb6; font-size: 11px; font-weight: 800;
}
.tv-shop-subtip {
  margin: -4px 0 12px; font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.5;
}
.tv-shop-foot {
  margin: 14px 2px 0; font-size: 11px; font-weight: 600;
  color: rgba(232, 238, 248, 0.45); line-height: 1.5;
}

/* auth + gender gates */
html.tv-auth-needed,
html.tv-auth-needed body,
html.tv-gender-needed,
html.tv-gender-needed body { overflow: hidden; }
.tv-auth-card { text-align: start; }
.tv-auth-modes {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
  margin: 0 0 12px; padding: 4px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.08);
}
.tv-auth-mode {
  min-height: 38px; border-radius: 11px; border: 0;
  background: transparent; color: rgba(255,255,255,0.72);
  font-size: 13px; font-weight: 800;
}
.tv-auth-mode.is-on {
  background: linear-gradient(180deg, #fff, #e8eef6);
  color: #0b1220;
  box-shadow: 0 6px 16px rgba(0,0,0,0.22);
}
.tv-auth-lead {
  margin: 0 0 12px; font-size: 12px; font-weight: 600; line-height: 1.55; color: var(--muted);
}
.tv-auth-fields { display: grid; gap: 0; }
.tv-auth-fields[hidden],
#tv-auth-step1[hidden],
#tv-auth-step2[hidden],
.tv-auth-card [hidden] { display: none !important; }
.tv-auth-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  min-width: 0;
}
.tv-auth-card .tv-field { margin-bottom: 10px; min-width: 0; }
.tv-auth-card .tv-field small { font-weight: 600; opacity: 0.7; }
.tv-auth-card .tv-field input {
  width: 100%; max-width: 100%; box-sizing: border-box;
}
.tv-auth-card .tv-filter-go { margin-top: 4px; }
.tv-auth-card .tv-charge { margin-top: 8px; }
.tv-auth-guest {
  width: 100%; min-height: 46px; margin-top: 10px;
  border-radius: 14px; border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04); color: #e8eef6;
  font-size: 14px; font-weight: 800;
}
.tv-auth-guest:hover { background: rgba(255,255,255,0.08); }
.tv-auth-guest-tip {
  margin: 8px 2px 0; font-size: 11px; font-weight: 600; line-height: 1.55;
  color: rgba(232, 238, 248, 0.48); text-align: center;
}
.tv-guest-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 0 10px 10px; padding: 10px 12px; border-radius: 14px;
  background: rgba(125, 222, 160, 0.08); border: 1px solid rgba(125, 222, 160, 0.22);
  font-size: 12px; font-weight: 700; color: rgba(232, 238, 248, 0.88); line-height: 1.45;
}
.tv-guest-banner[hidden] { display: none !important; }
.tv-guest-banner button {
  flex: none; min-height: 34px; padding: 0 12px; border-radius: 999px; border: 0;
  background: #fff; color: #0b1220; font-size: 12px; font-weight: 800;
}
.tv-auth-home {
  display: block; margin-top: 12px; text-align: center;
  font-size: 13px; font-weight: 700; color: var(--muted); text-decoration: underline;
}
@media (max-width: 420px) {
  .tv-auth-row { grid-template-columns: 1fr; }
  .tv-auth-modes { grid-template-columns: 1fr; }
}
.tv-gate {
  position: fixed; inset: 0; z-index: 90;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.tv-gate[hidden] { display: none !important; }
.tv-gate-card {
  width: min(420px, 100%);
  max-width: 100%;
  padding: 22px 18px 18px;
  border-radius: 28px;
  background: rgba(14, 18, 28, 0.94);
  border: 1px solid var(--glass-edge);
  box-shadow: 0 28px 70px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.1);
  text-align: center;
  overflow-x: hidden;
  box-sizing: border-box;
}
.tv-gate-card-wide { width: min(460px, 100%); text-align: start; }
.tv-gate-kicker {
  margin: 0 0 6px; font-size: 12px; font-weight: 800; color: var(--accent-2);
}
.tv-gate-card h2 {
  margin: 0 0 18px; font-size: 24px; font-weight: 800; letter-spacing: -0.02em;
}
.tv-gate-tip {
  margin: 0 0 18px; font-size: 13px; line-height: 1.6; color: var(--muted); font-weight: 600;
}
.tv-gate-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.tv-gate-pick {
  min-height: 148px; padding: 14px 10px;
  border-radius: 22px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
  display: grid; justify-items: center; gap: 10px; color: #fff;
  transition: transform .16s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.tv-gate-pick:hover {
  border-color: rgba(126,200,200,0.4);
  background: rgba(126,200,200,0.1);
}
.tv-gate-pick:active { transform: scale(0.97); }
.tv-gate-pick b { font-size: 16px; font-weight: 800; }
.tv-gate-pick .tv-gavatar { width: 72px; height: 72px; border-radius: 20px; }
.tv-gender-to { grid-template-columns: 1fr 1fr; }
.tv-gender-lock {
  display: grid; gap: 4px; padding: 14px;
  border-radius: 16px; border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.04);
}
.tv-gender-lock strong { font-size: 16px; font-weight: 800; color: #fff; }
.tv-gender-lock em {
  font-style: normal; font-size: 12px; font-weight: 600; color: var(--muted);
}
.tv-gender-change {
  margin-top: 10px; width: 100%; min-height: 46px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06); color: #fff; font-weight: 800; font-size: 14px;
}
.tv-word-box {
  display: grid; gap: 6px; justify-items: center; text-align: center;
  margin: 4px 0 14px; padding: 14px;
  border-radius: 18px; border: 1px solid rgba(126,200,200,0.28);
  background: rgba(126,200,200,0.08);
}
.tv-word-box em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); }
.tv-word-box strong {
  font-size: 34px; font-weight: 800; letter-spacing: 0.04em; color: #fff;
}
.tv-rec { display: grid; gap: 10px; margin-bottom: 12px; }
.tv-rec-video {
  width: 100%; aspect-ratio: 3 / 4; max-height: 320px; object-fit: cover;
  border-radius: 18px; background: #000; border: 1px solid rgba(255,255,255,0.12);
  transform: scaleX(-1);
}
.tv-rec-bar { display: grid; grid-template-columns: 1fr; gap: 8px; }
.tv-rec-timer {
  margin: 0; text-align: center; font-size: 13px; font-weight: 800; color: var(--gold);
}
.tv-stat {
  display: grid; gap: 2px; padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
}
.tv-stat em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 700; }
.tv-stat strong { font-size: 22px; font-weight: 800; }
.tv-shop-tip {
  margin: 0 0 14px; font-size: 13px; line-height: 1.65; color: var(--muted); font-weight: 600;
}
.tv-sheet-shop .tv-shop-h {
  margin: 4px 0 12px; font-size: 15px; font-weight: 800; color: #fff;
}
.tv-wallet-link {
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; border-radius: 999px; border: 0;
  background: linear-gradient(180deg, #fff, #eef2f8); color: #111; text-decoration: none; font-weight: 800; font-size: 14px;
  width: 100%; cursor: pointer;
  box-shadow: 0 10px 24px rgba(0,0,0,0.28), inset 0 1px 0 rgba(255,255,255,0.9);
}
.tv-shop-h { margin: 18px 0 10px; font-size: 14px; font-weight: 800; color: rgba(255,255,255,0.78); }
.tv-topups { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tv-topup {
  display: grid; gap: 2px; justify-items: start; text-align: start;
  min-height: 64px; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.05); color: #fff; font-weight: 700; cursor: pointer;
}
.tv-topup strong { font-size: 15px; }
.tv-topup em { font-style: normal; color: var(--gold); font-size: 12px; }
.tv-topup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 8px; }
.tv-topup-row input {
  min-height: 48px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); padding: 0 14px; font-size: 15px; font-weight: 700;
}
.tv-topup-row .tv-wallet-link { width: auto; min-width: 110px; margin: 0; padding: 0 16px; }

.tv-pay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: end center;
  background: rgba(0,0,0,0.55); padding: 12px;
}
.tv-pay[hidden] { display: none !important; }
.tv-pay-card {
  width: min(440px, 100%); max-height: min(88dvh, 720px); overflow: auto;
  border-radius: 24px 24px 18px 18px; padding: 16px 16px 20px;
  background: rgba(14, 18, 28, 0.92); border: 1px solid var(--glass-edge);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  box-shadow: 0 24px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}
.tv-pay-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tv-pay-kicker { margin: 0; font-size: 11px; font-weight: 700; color: var(--muted); }
.tv-pay-head h3 { margin: 2px 0 0; font-size: 18px; font-weight: 800; }
.tv-pay-x {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,0.06); color: #fff; font-size: 22px; line-height: 1;
}
.tv-pay-summary { margin: 10px 0 14px; font-size: 14px; font-weight: 700; color: var(--gold); }
.tv-pay-or {
  display: grid; place-items: center; margin: 12px 0; color: var(--muted); font-size: 12px; font-weight: 700;
}
.tv-pay-or span {
  padding: 0 10px; background: rgba(12,14,22,0.96);
}
.tv-pay-or::before {
  content: ""; display: block; width: 100%; height: 1px; grid-row: 1; background: var(--line);
  position: absolute; /* fallback ignore */
}
#tv-pay-mount, #tv-pay-wallets { min-height: 0; }
#tv-pay-confirm { margin-top: 12px; }
.tv-pay-cliq-link {
  display: block; width: 100%; margin-top: 10px; min-height: 40px;
  background: transparent; border: 0; color: var(--muted); font-weight: 700; font-size: 13px; text-decoration: underline;
}
@media (min-width: 820px) {
  .tv-pay { place-items: center; }
  .tv-pay-card { border-radius: 22px; }
  .tv-dev select { min-height: 42px; font-size: 13px; }
}
.tv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.tv-row, .tv-card, .tv-pack {
  display: flex; align-items: center; gap: 12px;
  min-height: 72px; padding: 12px 12px 12px 14px; border-radius: 18px;
  background: rgba(20, 26, 38, 0.72); border: 1px solid rgba(255,255,255,0.08);
  width: 100%; text-align: start;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
}
.tv-av {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(126,200,200,0.28), rgba(24,30,44,0.95));
  border: 1px solid rgba(255,255,255,0.14);
  color: #fff; font-size: 16px; font-weight: 800;
}
.tv-av.has-photo {
  background: #0c1220;
  padding: 0;
  border-color: rgba(228, 195, 106, 0.4);
}
.tv-av.has-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.tv-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Profile sheet — shared game avatar */
.tv-profile-avatar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px 14px;
  align-items: center;
  margin: 0 0 16px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(228, 195, 106, 0.22);
  background: linear-gradient(135deg, rgba(228, 195, 106, 0.08), rgba(20, 26, 38, 0.55));
}
.tv-avatar-edit {
  position: relative;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
}
.tv-avatar-ring {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: 50%;
  border: 2px solid rgba(228, 195, 106, 0.45);
  box-shadow: 0 0 0 4px rgba(228, 195, 106, 0.08);
  pointer-events: none;
}
.tv-avatar-img,
.tv-avatar-ph {
  grid-area: 1 / 1;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: #121826;
}
.tv-avatar-img {
  position: relative;
  z-index: 2;
  display: block;
}
.tv-avatar-ph {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  color: rgba(200, 210, 230, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
/* class display:grid must not beat the hidden attribute */
.tv-avatar-img[hidden],
.tv-avatar-ph[hidden] {
  display: none !important;
}
.tv-avatar-ph svg { width: 34px; height: 34px; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tv-avatar-cam {
  position: absolute;
  inset-inline-end: 2px;
  bottom: 2px;
  z-index: 3;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ffe29a, #e4c36a);
  color: #1a1204;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  border: 2px solid #0c1220;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}
.tv-avatar-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.tv-avatar-copy strong {
  font-size: 15px;
  font-weight: 800;
  color: #fff;
}
.tv-avatar-copy span {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--muted, rgba(180, 190, 210, 0.75));
}
.tv-avatar-clear {
  justify-self: start;
  margin-top: 4px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 100, 120, 0.35);
  background: transparent;
  color: #ffb4c0;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.tv-avatar-clear:hover {
  background: rgba(255, 84, 112, 0.12);
}
.tv-row-meta { min-width: 0; flex: 1; display: grid; gap: 3px; }
.tv-row-name {
  font-size: 15px; font-weight: 800; color: #fff;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tv-row-sub {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.tv-row-sub .tv-flag { width: 16px; height: 11px; }
.tv-row-btn {
  flex: none; min-height: 36px; min-width: 72px; padding: 0 14px;
  border-radius: 999px; border: 0; font-size: 13px; font-weight: 800;
}
.tv-row-btn.is-add { background: #fff; color: #111; }
.tv-row-btn.is-done {
  background: rgba(228,195,106,0.14); color: var(--gold);
  border: 1px solid rgba(228,195,106,0.35);
}
.tv-row-btn.is-ghost {
  background: transparent; color: rgba(255,255,255,0.72);
  border: 1px solid rgba(255,255,255,0.14);
}
.tv-row-btn.is-wait {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.1); cursor: default;
}
.tv-list-h {
  list-style: none; margin: 4px 2px 0; padding: 0 4px;
  font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.02em;
}
.tv-empty {
  display: grid; justify-items: center; gap: 8px; text-align: center;
  min-height: 180px; padding: 36px 20px; border-radius: 20px;
  background: rgba(255,255,255,0.03); border: 1px dashed rgba(255,255,255,0.1);
}
.tv-empty strong { font-size: 16px; font-weight: 800; color: #fff; }
.tv-empty span { max-width: 260px; font-size: 13px; line-height: 1.6; font-weight: 600; color: var(--muted); }
.tv-card {
  font-size: 14px; font-weight: 700; background: #141821;
  border-radius: 16px; min-height: 56px; padding: 0 14px; border: 1px solid rgba(255,255,255,0.07);
  justify-content: flex-start;
}
.tv-packs, .tv-cards { display: grid; gap: 8px; }
.tv-sheet-shop .tv-packs { gap: 10px; }
.tv-pack {
  display: grid; justify-items: start; gap: 4px; cursor: pointer; padding: 16px;
}
.tv-sheet-shop .tv-pack {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  min-height: 108px;
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(16, 20, 32, 0.96);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform .16s var(--ease), border-color .18s var(--ease), background .18s var(--ease);
}
.tv-sheet-shop .tv-pack.is-sub { min-height: 132px; }
.tv-sheet-shop .tv-pack:hover {
  border-color: rgba(126,200,200,0.4);
  background: rgba(22, 28, 42, 0.98);
}
.tv-sheet-shop .tv-pack:active { transform: scale(0.985); }
.tv-pack-ico {
  display: grid; place-items: center;
  background: #0c1018;
  overflow: hidden;
}
.tv-pack-ico-img img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.tv-pack-fallback {
  width: 100%; height: 100%; min-height: 108px;
  background: linear-gradient(160deg, #ffe7a3, #f0c15a 55%, #d4a12e);
}
.tv-pack-main {
  min-width: 0; display: grid; gap: 5px; align-content: center;
  padding: 12px 14px; text-align: start;
}
.tv-pack-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
}
.tv-pack-title strong {
  font-size: 16px; font-weight: 900; color: #fff; letter-spacing: -0.01em;
}
.tv-pack-badge {
  font-style: normal; font-size: 11px; font-weight: 800;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(125, 222, 160, 0.16); color: #9aefb6;
  border: 1px solid rgba(125, 222, 160, 0.35);
}
.tv-pack-save {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800;
}
.tv-pack-save s {
  color: rgba(255,255,255,0.38); font-weight: 700;
}
.tv-pack-save b {
  color: #9aefb6; font-weight: 900;
}
.tv-pack-perks {
  list-style: none; margin: 2px 0 0; padding: 0;
  display: grid; gap: 2px;
}
.tv-pack-perks li {
  font-size: 11px; font-weight: 700; color: rgba(220, 236, 255, 0.72);
}
.tv-pack-perks li::before {
  content: '✓ '; color: #9aefb6;
}
.tv-pack-note {
  font-size: 12px; font-weight: 600; color: var(--muted); line-height: 1.4;
}
.tv-pack-buy {
  justify-self: start; margin-top: 4px;
  min-height: 36px; padding: 0 16px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--gold); font-size: 15px; font-weight: 900;
  font-style: normal; font-variant-numeric: tabular-nums;
}
.tv-pack-buy small {
  font-size: 11px; font-weight: 800; opacity: 0.8;
}
.tv-sheet-shop .tv-pack:hover .tv-pack-buy {
  background: rgba(216, 191, 122, 0.16);
  border-color: rgba(216, 191, 122, 0.4);
}
.tv-pack em { font-style: normal; color: var(--gold); font-size: 12px; font-weight: 700; }
.tv-field { display: grid; gap: 6px; margin: 0 0 14px; font-size: 12px; color: var(--muted); font-weight: 600; }
.tv-field input, .tv-field select {
  min-height: 46px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); padding: 0 14px; font-size: 15px; font-weight: 600;
}
.tv-msg { min-height: 1.2em; font-size: 13px; color: var(--muted); }

.tv-rail { display: none; }
@media (min-width: 1100px) {
  .tv-app { grid-template-columns: var(--nav) minmax(0, 1fr) var(--rail); }
  .tv-rail {
    display: flex; flex-direction: column; direction: rtl; min-width: 0; min-height: 0;
    height: auto; align-self: stretch;
    margin: 14px 14px 14px 0; padding: 18px 16px;
    max-height: calc(100dvh - 28px); overflow: hidden;
    background: linear-gradient(180deg, rgba(18, 24, 38, 0.78), rgba(10, 14, 24, 0.7));
    border: 1px solid var(--glass-edge);
    border-radius: 26px;
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 18px 40px rgba(0,0,0,0.28);
  }
  .tv-rail h2 { margin: 0 0 12px; font-size: 15px; font-weight: 800; text-align: right; color: #fff; }
  .tv-rail .tv-cards { overflow: auto; min-height: 0; align-content: start; }
  .tv-rail .tv-card {
    width: 100%; min-height: 56px; border-radius: 14px; justify-content: flex-start;
    direction: ltr; gap: 10px;
    background: transparent; font-size: 14px; font-weight: 800;
  }
  .tv-rail .tv-cards p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 700; }
  .tv-app.is-call,
  .tv-app.is-sheet { grid-template-columns: var(--nav) minmax(0, 1fr); }
  .tv-app.is-call .tv-rail,
  .tv-app.is-sheet .tv-rail { display: none; }
}

@media (min-width: 820px) and (max-width: 1099px) {
  .tv-pane { --side: min(56dvh, 480px); }
  .tv-app.is-call .tv-pane {
    --side: min(calc(100dvh - 200px), calc((100vw - var(--nav) - 56px) / 2), 420px);
  }
  .tv-dock { width: min(600px, 100%); }
  .tv-go { min-width: 110px; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-start, .tv-burst, .tv-gap strong.is-tick, .tv-sheet,
  .tv-veil, .tv-veil-radar i, .tv-veil-radar em,
  .tv-vload-spin,
  .tv-panes.is-searching .tv-pane-peer .tv-glass::after,
  .tv-glass.is-connecting::after { animation: none; }
  .tv-nav button, .tv-ctl, .tv-veil-copy #tv-veil-sub, .tv-fill { transition: none; }
  .tv-veil-radar i { opacity: 0.35; }
  .tv-vload-spin { border-top-color: #8eecc0; opacity: 0.85; }
  .tv-panes.is-searching .tv-pane-peer .tv-glass::after,
  .tv-glass.is-connecting::after { opacity: 0.35; background-position: 50% 0; }
}

/* —— phone —— */
@media (max-width: 819px) {
  :root { --nav: 64px; --chrome: 96px; }
  .tv-app {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) var(--nav);
  }
  .tv-stage { grid-row: 1; height: 100%; }
  .tv-nav {
    grid-row: 2;
    flex-direction: row; justify-content: space-around; align-items: stretch;
    gap: 0; border: 0; border-top: 1px solid var(--glass-edge);
    padding: 4px 4px max(6px, env(safe-area-inset-bottom));
    background: rgba(8, 11, 18, 0.9);
    backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  }
  .tv-mark { display: none; }
  .tv-nav button {
    width: auto; flex: 1; min-height: 56px; border-radius: 16px; gap: 3px; padding: 5px 2px 4px;
  }
  .tv-ico { width: 32px; height: 32px; border-radius: 11px; }
  .tv-nav button svg { width: 18px; height: 18px; }
  .tv-nav button.is-on {
    color: #fff;
    background: rgba(126,200,200,0.12);
    box-shadow: inset 0 2px 0 var(--accent);
  }
  .tv-nav button.is-on .tv-ico {
    color: #0b1220;
    background: linear-gradient(165deg, #fff, #dfe8f4);
  }
  .tv-nav button span { font-size: 9px; letter-spacing: 0; }

  .tv-panes { padding: 4px 12px 8px; }
  .tv-app.is-call .tv-panes {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-content: center;
    justify-items: center;
    gap: 8px;
    padding: 4px 12px;
    overflow: hidden;
  }
  .tv-pane-peer { order: 1; }
  .tv-pane-me { order: 2; }
  .tv-app.is-call .tv-pane {
    --side: min(92vw, calc((100dvh - 214px) / 2));
    width: var(--side);
  }
  .tv-glass { border-radius: 22px; }
  .tv-tag, .tv-peer {
    left: 50%; right: auto; bottom: 10px;
    transform: translateX(-50%);
  }
  .tv-dock { width: 100%; gap: 6px; }
  .tv-dock-glass {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 40px 40px auto;
    border-radius: 24px;
    padding: 6px;
  }
  .tv-pill { min-height: 42px; padding: 3px 10px; }
  .tv-pill-k { font-size: 9px; }
  .tv-pill b { font-size: 12px; }
  .tv-go { min-width: 92px; min-height: 42px; padding: 0 18px; font-size: 15px; }
  .tv-tool { width: 42px; height: 42px; }
  .tv-panes::before { width: min(92vw, 420px); height: min(48dvh, 360px); }
  .tv-dev select { min-height: 36px; font-size: 11px; }
  .tv-pane { --side: min(86vw, calc(100dvh - 248px)); }
  .tv-note { bottom: 8px; }
  .tv-chrome { gap: 8px; padding: 4px 12px 10px; }
  .tv-chrome.is-live {
    justify-content: center;
    width: 100%;
    padding-inline: 8px;
    gap: 6px;
  }
  .tv-corner {
    min-height: 46px; min-width: 72px; padding: 0 10px; font-size: 12px;
  }
  .tv-fab-devs, .tv-tool { width: 46px; height: 46px; flex: 0 0 auto; }
  .tv-fab-share { min-width: 46px; padding: 0 8px; }
  .tv-fab-share .tv-fab-lab { display: none; }
  .tv-top { padding-inline: 14px; }
  .tv-word { font-size: 18px; }
  .tv-gem, .tv-back { min-height: 34px; padding: 0 12px; font-size: 12px; }
  .tv-seg button { min-height: 38px; font-size: 12px; }
  .tv-seg-cards button { min-height: 124px; padding: 10px 6px 8px; border-radius: 16px; }
  .tv-gavatar { width: 56px; height: 56px; border-radius: 16px; }
  .tv-seg-cards button b { font-size: 13px; }
  .tv-filter-go { min-height: 48px; font-size: 15px; }
  .tv-cpick-btn { min-height: 42px; font-size: 12px; }
  .tv-sheet-mask { background: rgba(0,0,0,0.55); }
  .tv-sheet {
    top: auto; bottom: 0; left: 0; right: 0; inset-inline: 0;
    width: 100%; max-height: min(82dvh, 720px);
    border: 0; border-top: 1px solid var(--glass-edge);
    border-radius: 26px 26px 0 0;
    padding: 10px 16px max(20px, env(safe-area-inset-bottom));
    animation: tv-sheet-up .3s var(--ease);
    box-shadow: 0 -18px 40px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.1);
  }
  @keyframes tv-sheet-up {
    from { transform: translateY(24px); opacity: 0.5; }
    to { transform: none; opacity: 1; }
  }
  .tv-sheet-head {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px 12px;
    padding-top: 0; margin-bottom: 12px;
  }
  .tv-sheet-head::before {
    content: ""; grid-column: 1 / -1; justify-self: center;
    width: 42px; height: 4px; border-radius: 999px;
    background: rgba(255,255,255,0.22);
  }
  .tv-sheet-head h2 { font-size: 18px; }
}

@media (max-width: 380px) {
  .tv-word { display: none; }
  .tv-nav button span { font-size: 8px; }
  .tv-ctl { min-width: 64px; padding: 0 10px; font-size: 12px; }
  .tv-chip select { font-size: 10px; }
  .tv-start, .tv-charge { font-size: 13px; }
}
