/* ==========================================================================
   WorldTune · stylesheet
   ========================================================================== */
@import url("../assets/fonts.css");

@font-face {
  font-family: "Twemoji Country Flags";
  src: url("../assets/TwemojiCountryFlags.woff2") format("woff2");
  unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F;
  font-display: swap;
}

:root {
  --bg: #0a0d13;
  --bg-2: #0f141d;
  --panel: #131a25;
  --panel-2: #1a2230;
  --line: #222c3c;
  --line-2: #2c3850;
  --text: #e9eef6;
  --muted: #8a96aa;
  --dim: #5d6a80;
  --live: #ff4d3d;
  --accent: #ffb547;
  --accent-ink: #1b1204;
  --radio: #4fd1c5;
  --cam: #8ab4ff;
  --type: var(--accent);
  --r: 12px;
  --row: 60px;
  --top: 60px;
  --font: "WT Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Nirmala UI", sans-serif;
  --flag: "Twemoji Country Flags", "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  color-scheme: dark;
  --row-line: #141b27;
  --top-grad: #0d121b;
  --stage-glow: #142034;
  --glass: #0a0d13d9;
}
:root[data-theme="light"] {
  --bg: #f4f6fa; --bg-2: #ffffff; --panel: #ffffff; --panel-2: #eef2f8;
  --line: #dfe5ee; --line-2: #cdd5e2; --text: #101828; --muted: #556074; --dim: #8691a5;
  --live: #e5372a; --accent: #c77700; --accent-ink: #ffffff; --radio: #0b8f86; --cam: #2f62d6;
  --row-line: #edf0f5; --top-grad: #ffffff; --stage-glow: #dfe9fb; --glass: #ffffffe6;
  color-scheme: light;
}
body[data-type="radio"] { --type: var(--radio); }
body[data-type="webcams"] { --type: var(--cam); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--type); }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.flag { font-family: var(--flag); font-style: normal; }
:focus-visible { outline: 2px solid var(--type); outline-offset: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel-2);
  font-weight: 600; white-space: nowrap; transition: background .15s, border-color .15s, transform .1s;
}
.btn:hover { border-color: var(--type); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--panel-2); border-color: var(--line-2); }
.btn.icon { width: 36px; padding: 0; justify-content: center; font-size: 16px; }
.btn.primary { background: var(--type); color: var(--accent-ink); border-color: transparent; }
.link { background: none; border: 0; padding: 0; color: var(--type); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- top bar ---------- */
.topbar {
  height: var(--top); display: flex; align-items: center; gap: 18px; padding: 0 16px;
  border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--top-grad), var(--bg));
  position: relative; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.brand svg { width: 28px; height: 28px; color: var(--type); transition: color .3s; }
.type-tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; border: 1px solid var(--line); }
.type-tabs button {
  display: flex; align-items: center; gap: 7px; border: 0; background: none; padding: 6px 14px;
  border-radius: 9px; color: var(--muted); font-weight: 600;
}
.type-tabs button em { font-style: normal; font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
.type-tabs button[aria-selected="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--type); }
.type-tabs button[aria-selected="true"] em { color: var(--type); }
.search {
  flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px;
  border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--type); }
.search svg { width: 17px; height: 17px; color: var(--dim); flex: none; }
.search input { border: 0; outline: 0; background: none; width: 100%; }
.top-actions { margin-left: auto; display: flex; gap: 4px; }

/* ---------- layout ---------- */
.layout {
  display: grid; height: calc(100dvh - var(--top));
  grid-template-columns: 250px 340px minmax(0, 1fr);
}
.facets, .list { border-right: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; }
.facets { background: var(--bg-2); }

/* ---------- facets ---------- */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; margin: 12px 12px 8px; padding: 3px; background: var(--bg); border-radius: 10px; border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 6px 4px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg button[aria-selected="true"] { background: var(--panel-2); color: var(--text); }
.facet-filter { margin: 0 12px 8px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); outline: 0; }
.facet-filter:focus { border-color: var(--type); }
.facet-list { flex: 1; overflow-y: auto; padding: 0 6px 8px; scrollbar-width: thin; }
.facet-row {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border: 0; background: none;
  border-radius: 8px; text-align: left; color: var(--text);
}
.facet-row:hover { background: var(--panel); }
.facet-row[aria-selected="true"] { background: color-mix(in srgb, var(--type) 16%, transparent); color: var(--type); }
.facet-row .f-ico { width: 22px; text-align: center; font-size: 17px; flex: none; }
.facet-row .f-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facet-row .f-count { font-size: 11.5px; color: var(--dim); font-variant-numeric: tabular-nums; }
.facet-row[aria-disabled="true"] { opacity: .38; }
.facet-sep { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); padding: 10px 10px 4px; }
.quick { border-top: 1px solid var(--line); padding: 8px; display: grid; gap: 2px; }
.quick-btn { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 8px 10px; border-radius: 8px; color: var(--muted); font-weight: 600; text-align: left; }
.quick-btn span { width: 22px; text-align: center; }
.quick-btn b { font-weight: 600; }
.quick-btn em { margin-left: auto; font-style: normal; font-size: 11.5px; color: var(--dim); }
.quick-btn:hover { background: var(--panel); color: var(--text); }
.quick-btn[aria-pressed="true"] { color: var(--type); background: color-mix(in srgb, var(--type) 12%, transparent); }

/* ---------- channel list ---------- */
.list { background: var(--bg); position: relative; }
.list-head { padding: 12px 14px 8px; border-bottom: 1px solid var(--line); }
.list-title { font-weight: 700; font-size: 15px; display: flex; align-items: baseline; gap: 8px; }
.list-title small { color: var(--muted); font-weight: 500; font-size: 12px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 6px 0 10px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); font-size: 12px; font-weight: 600; }
.chip button { border: 0; background: var(--panel-2); width: 18px; height: 18px; border-radius: 50%; font-size: 11px; line-height: 1; color: var(--muted); padding: 0; }
.chip button:hover { color: var(--text); background: var(--live); }
.vlist { flex: 1; overflow-y: auto; position: relative; outline: 0; scrollbar-width: thin; contain: strict; }
.vlist-spacer { width: 100%; position: relative; }
.list-loading { padding: 40px 20px; text-align: center; color: var(--muted); }
.row {
  position: absolute; left: 0; right: 0; height: var(--row); display: flex; align-items: center; gap: 12px;
  padding: 0 10px 0 14px; cursor: pointer; border-bottom: 1px solid var(--row-line);
}
.row:hover { background: var(--bg-2); }
.row.active { background: color-mix(in srgb, var(--type) 13%, transparent); box-shadow: inset 3px 0 0 var(--type); }
.logo {
  width: 42px; height: 42px; border-radius: 10px; flex: none; display: grid; place-items: center; overflow: hidden;
  background: var(--panel-2); font-weight: 800; font-size: 13px; color: var(--muted); letter-spacing: -.02em; position: relative;
}
.logo img { width: 100%; height: 100%; object-fit: contain; padding: 5px; background: #e9eef6; position: absolute; inset: 0; }
.row-body { flex: 1; min-width: 0; }
.row-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; gap: 6px; align-items: center; }
.row-meta .yt { color: #ff6b6b; font-weight: 700; font-size: 10.5px; border: 1px solid #ff6b6b55; padding: 0 4px; border-radius: 4px; }
.row-fav { border: 0; background: none; width: 32px; height: 32px; border-radius: 8px; font-size: 17px; color: var(--dim); flex: none; }
.row-fav:hover { background: var(--panel-2); color: var(--accent); }
.row-fav.on { color: var(--accent); }
.empty { position: absolute; inset: 120px 20px auto; text-align: center; color: var(--muted); }
.empty-ico { font-size: 40px; margin-bottom: 4px; }

/* ---------- stage ---------- */
.stage { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 16px; gap: 12px; overflow-y: auto; background: radial-gradient(1200px 600px at 70% -10%, var(--stage-glow) 0%, transparent 60%), var(--bg); }
.screen { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: calc(100dvh - var(--top) - 130px); border-radius: var(--r); overflow: hidden; background: #000; border: 1px solid var(--line); flex: none; margin: 0 auto; }
body[data-stage="globe"] .screen { background: transparent; border-color: transparent; aspect-ratio: auto; flex: 1; max-height: none; }
.globe-wrap, .player { position: absolute; inset: 0; }
body[data-stage="globe"] #player { visibility: hidden; }
body[data-stage="player"] .globe-wrap { display: none; }
#globe { position: absolute; inset: 0; cursor: grab; }
#globe:active { cursor: grabbing; }
.globe-hint { position: absolute; left: 24px; bottom: 24px; max-width: 440px; pointer-events: none; text-shadow: 0 2px 18px var(--bg), 0 0 4px var(--bg); }
.globe-hint h1 { margin: 0 0 6px; font-size: clamp(26px, 3.4vw, 44px); letter-spacing: -.035em; line-height: 1.05; }
.globe-hint p { margin: 4px 0; }
.globe-hint .link { pointer-events: auto; }
#heroStats { color: var(--type); font-weight: 700; font-variant-numeric: tabular-nums; }
.globe-tip { position: absolute; top: 16px; right: 16px; background: var(--glass); border: 1px solid var(--line-2); padding: 8px 12px; border-radius: 10px; font-size: 13px; backdrop-filter: blur(6px); pointer-events: none; }
.globe-label { background: var(--glass); border: 1px solid var(--line-2); padding: 6px 10px; border-radius: 8px; font: 12.5px/1.4 var(--font); color: var(--text); }
.globe-label b { display: block; font-size: 13.5px; }

.p-video, .p-yt, .p-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.player[data-mode="hls"] .p-yt, .player[data-mode="hls"] .radio-card,
.player[data-mode="yt"] .p-video, .player[data-mode="yt"] .radio-card,
.player[data-mode="audio"] .p-video, .player[data-mode="audio"] .p-yt { display: none; }
.player:not([data-mode]) > :not(.p-overlay):not(.mini-bar) { display: none; }
.tile-player .p-audio { display: none; }

.radio-card { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 22px; background: radial-gradient(600px 400px at 50% 30%, color-mix(in srgb, var(--radio) 22%, transparent), transparent 70%), var(--bg-2); }
.radio-art { width: min(34vw, 180px); aspect-ratio: 1; border-radius: 28px; background: var(--panel-2); display: grid; place-items: center; font-size: 56px; font-weight: 800; color: var(--radio); overflow: hidden; box-shadow: 0 20px 60px #0008; position: relative; }
.radio-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #e9eef6; padding: 14px; }
.radio-card audio { width: min(90%, 420px); }
.eq { display: flex; gap: 5px; height: 34px; align-items: flex-end; }
.eq i { width: 6px; background: var(--radio); border-radius: 3px; height: 20%; opacity: .5; }
.player.playing .eq i { animation: eq 1s ease-in-out infinite; opacity: 1; }
.eq i:nth-child(2) { animation-delay: -.3s !important; } .eq i:nth-child(3) { animation-delay: -.6s !important; }
.eq i:nth-child(4) { animation-delay: -.15s !important; } .eq i:nth-child(5) { animation-delay: -.45s !important; }
.eq i:nth-child(6) { animation-delay: -.75s !important; } .eq i:nth-child(7) { animation-delay: -.2s !important; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }

.p-overlay { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; text-align: center; padding: 24px; background: #000c; z-index: 2; }
.p-msg { max-width: 440px; color: #e9eef6; font-weight: 600; }
.p-msg small { display: block; color: #a9b4c6; font-weight: 400; margin-top: 4px; }
.p-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.p-spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid #ffffff22; border-top-color: var(--type); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.nowbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); }
.now-main { display: flex; gap: 12px; align-items: center; flex: 1; min-width: 220px; }
.now-logo .logo { width: 48px; height: 48px; }
.now-name { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.player.playing ~ * .live-dot, body.is-playing .live-dot { background: var(--live); box-shadow: 0 0 0 0 var(--live); animation: pulse 1.6s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px #ff4d3d00; } 100% { box-shadow: 0 0 0 0 #ff4d3d00; } }
.now-meta { color: var(--muted); font-size: 12.5px; display: flex; flex-wrap: wrap; gap: 4px 12px; }
.now-meta b { color: var(--text); font-weight: 600; }
.now-actions { display: flex; align-items: center; gap: 2px; }
.fav[aria-pressed="true"] { color: var(--accent); }
.src-select { height: 36px; margin-left: 6px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line-2); padding: 0 8px; font-size: 12.5px; max-width: 150px; }
.geo-note { margin: 0; font-size: 12.5px; color: var(--muted); }

/* ---------- dialog / toast ---------- */
dialog { border: 1px solid var(--line-2); border-radius: 16px; background: var(--panel); color: var(--text); padding: 0; max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: #000a; backdrop-filter: blur(3px); }
.dlg { padding: 22px 24px; }
.dlg h2 { margin: 0 0 10px; } .dlg h3 { margin: 18px 0 6px; font-size: 14px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.dlg p { margin: 6px 0; color: #c8d1de; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; color: #c8d1de; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; margin-right: 4px; border-radius: 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--bg-2); font: 600 12px var(--font); text-align: center; }
.contact { font-weight: 600; color: var(--type); user-select: all; }
.dlg-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--text); color: var(--bg); padding: 9px 16px; border-radius: 10px; font-weight: 600; transition: .25s; z-index: 50; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- mobile nav ---------- */
.mnav { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .layout { grid-template-columns: 230px 300px minmax(0, 1fr); }
  .top-actions .lbl { display: none; }
  .type-tabs button em { display: none; }
}
@media (max-width: 900px) {
  :root { --top: 100px; }
  body { overflow: hidden; }
  .topbar { flex-wrap: wrap; height: var(--top); padding: 6px 12px; gap: 8px; align-content: center; }
  .brand-name { display: none; }
  .type-tabs { order: 1; }
  .type-tabs button { padding: 6px 10px; font-size: 13px; }
  .top-actions { order: 2; gap: 0; }
  .top-actions .btn { padding: 0 6px; min-width: 32px; justify-content: center; }
  .top-actions .btn.icon { width: 32px; }
  .search { height: 36px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .layout { display: block; height: calc(100dvh - var(--top) - 58px); position: relative; }
  .facets, .list, .stage { position: absolute; inset: 0; border: 0; }
  body:not([data-panel="facets"]) .facets, body:not([data-panel="list"]) .list { display: none; }
  /* the player stays mounted (so audio keeps playing) – just moved off-screen */
  body:not([data-panel="stage"]) .stage { visibility: hidden; pointer-events: none; }
  .stage { padding: 10px; }
  .screen { max-height: none; }
  body[data-stage="globe"] .screen { min-height: 60vh; }
  .globe-hint { left: 14px; bottom: 14px; right: 14px; }
  .mnav { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; height: 58px; border-top: 1px solid var(--line); background: var(--bg-2); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
  .mnav button { border: 0; background: none; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 1px; font-size: 18px; }
  .mnav button span { font-size: 11px; font-weight: 600; }
  .mnav button[aria-current="true"] { color: var(--type); }
  .now-actions { width: 100%; justify-content: space-between; }
  .src-select { max-width: none; flex: 1; }
  .keys { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .type-tabs button { padding: 6px 9px; }
  .type-tabs .ico { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition: none !important; }
}

/* ---------- start-up help (shown only if the app can't boot) ---------- */
.boot-error { position: fixed; inset: 0; z-index: 100; background: var(--bg); padding: 48px 24px; overflow: auto; font-family: var(--font); }
.boot-error > * { max-width: 620px; margin-left: auto; margin-right: auto; }
.boot-error h2 { margin-top: 0; }
.boot-error li { margin: 6px 0; }
.boot-error code { background: var(--panel-2); padding: 1px 6px; border-radius: 5px; }

/* ==========================================================================
   v2 features
   ========================================================================== */
/* ---- theme + language pickers ---- */
.th-light { display: none; }
:root[data-theme="light"] .th-light { display: inline; }
:root[data-theme="light"] .th-dark { display: none; }
.lang-pick { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding: 0 4px 0 8px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; }
.lang-pick:hover { background: var(--panel-2); border-color: var(--line-2); }
.lang-pick select { appearance: none; -webkit-appearance: none; border: 0; background: none; font-weight: 600; padding: 0 4px; cursor: pointer; outline: 0; }
.lang-pick select option { background: var(--panel); color: var(--text); }

/* ---- list filter bar ---- */
.filterbar { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.mini-select { height: 28px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel); padding: 0 6px; font-size: 12px; max-width: 150px; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); cursor: pointer; user-select: none; }
.check input { accent-color: var(--type); margin: 0; }
body:not([data-type="tv"]) #srcFilter { display: none; }

/* ---- globe controls ---- */
.globe-ctrl { position: absolute; top: 14px; left: 14px; display: flex; gap: 2px; padding: 3px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line-2); backdrop-filter: blur(6px); z-index: 2; }
.globe-ctrl button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.globe-ctrl button[aria-pressed="true"] { background: var(--panel-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--type); }
.globe-status { position: absolute; top: 14px; right: 14px; background: var(--glass); border: 1px solid var(--line-2); padding: 6px 12px; border-radius: 10px; font-size: 12.5px; backdrop-filter: blur(6px); z-index: 2; }
.globe-status::before { content: "● "; color: var(--radio); }
.globe-credit { position: absolute; right: 12px; bottom: 8px; font-size: 10.5px; color: var(--dim); pointer-events: none; }
.globe-label .dn { display: inline-block; margin-top: 2px; }

/* ---- mini player ---- */
.mini-bar { display: none; }
body[data-mini="1"] #player {
  position: fixed; inset: auto 16px 16px auto; width: min(340px, calc(100vw - 32px)); height: auto; aspect-ratio: 16 / 9;
  z-index: 40; visibility: visible !important; pointer-events: auto; border-radius: 12px; overflow: hidden;
  box-shadow: 0 18px 50px #0009; border: 1px solid var(--line-2); background: #000; display: block !important;
}
body[data-mini="1"] #player .mini-bar {
  display: flex; align-items: center; gap: 4px; position: absolute; left: 0; right: 0; top: 0; padding: 6px 6px 14px 10px; z-index: 3;
  background: linear-gradient(#000c, transparent); color: #fff; opacity: 0; transition: opacity .2s;
}
body[data-mini="1"] #player:hover .mini-bar, body[data-mini="1"] #player:focus-within .mini-bar { opacity: 1; }
.mini-name { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-btn { width: 28px; height: 28px; border-radius: 7px; border: 0; background: #ffffff22; color: #fff; font-size: 14px; }
.mini-btn:hover { background: #ffffff44; }
body[data-mini="1"] .radio-card { gap: 6px; }
body[data-mini="1"] .radio-art { width: 64px; border-radius: 14px; font-size: 22px; }
body[data-mini="1"] .radio-card audio { height: 32px; }
body[data-mini="1"] .eq { height: 16px; }

/* ---- multi-view ---- */
.mv { position: absolute; inset: 0; display: grid; gap: 4px; background: #000; padding: 4px; }
.mv[data-n="2"] { grid-template-columns: 1fr 1fr; align-content: center; }
.mv[data-n="2"] .tile { aspect-ratio: 16 / 9; }
.mv[data-n="4"] { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
body[data-mv="1"] #player { display: none; }
body[data-mv="1"] .globe-wrap { display: none; }
.tile { position: relative; border-radius: 6px; overflow: hidden; background: #0b0f16; outline: 2px solid transparent; outline-offset: -2px; cursor: pointer; min-height: 0; }
.tile.active { outline-color: var(--type); }
.tile .player { position: absolute; inset: 0; }
.tile-empty { position: absolute; inset: 0; display: grid; place-items: center; color: #8a96aa; font-size: 13px; text-align: center; padding: 10px; }
.tile.filled .tile-empty { display: none; }
.tile-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 6px; padding: 14px 6px 5px 8px; background: linear-gradient(transparent, #000b); color: #fff; font-size: 12px; font-weight: 600; z-index: 3; pointer-events: none; }
.tile:not(.filled) .tile-bar { display: none; }
.tile-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-close { pointer-events: auto; border: 0; background: #ffffff26; color: #fff; width: 22px; height: 22px; border-radius: 6px; font-size: 11px; }
.tile .p-msg { font-size: 12.5px; } .tile .p-spinner { width: 28px; height: 28px; } .tile .p-actions .btn { height: 30px; font-size: 12px; }
.mv-size { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; border: 1px solid var(--line-2); margin-left: 2px; }
.mv-size button { border: 0; background: none; width: 28px; height: 28px; border-radius: 7px; font-weight: 700; color: var(--muted); }
.mv-size button[aria-pressed="true"] { background: var(--type); color: var(--accent-ink); }
#mvBtn[aria-pressed="true"] { color: var(--type); background: var(--panel-2); }

/* ---- share dialog ---- */
.share-name { font-weight: 700; color: var(--text) !important; }
.share-link { display: flex; gap: 6px; margin: 10px 0; }
.share-link input { flex: 1; min-width: 0; height: 36px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--bg-2); padding: 0 10px; font-size: 12.5px; }
.share-targets { display: flex; flex-wrap: wrap; gap: 6px; }
.share-targets a.btn { text-decoration: none; color: var(--text); }
.share-qr { display: flex; align-items: center; gap: 14px; margin-top: 14px; color: var(--muted); font-size: 13px; }
#shareQr { background: #fff; padding: 8px; border-radius: 10px; line-height: 0; }
#shareQr svg, #shareQr img { width: 132px; height: 132px; display: block; }

@media (max-width: 900px) {
  body[data-mini="1"] #player { inset: auto 10px 70px auto; width: min(260px, calc(100vw - 20px)); }
  body[data-mini="1"] #player .mini-bar { opacity: 1; }
  .lang-pick { padding: 0 2px 0 4px; height: 32px; }
  .lang-pick > span { display: none; }
  .globe-ctrl { top: 10px; left: 10px; }
  .globe-status { top: 52px; left: 10px; right: auto; }
  .filterbar .mini-select { max-width: 120px; }
}

@media (min-width: 901px) {
  /* keep the floating mini player clear of the now-playing bar */
  body[data-mini="1"]:has(.nowbar:not([hidden])) #player { bottom: 104px; }
}

@media (max-width: 900px) {
  /* the bottom "Player" tab already shows the globe, so the header drops its Globe button */
  #globeBtn { display: none; }
  .type-tabs button { padding: 6px 8px; }
  .lang-pick select { padding: 0 2px; }
}
@media (max-width: 370px) {
  .brand { display: none; }
}

/* ---- v3: failure reasons, unmute pill, health badge ---- */
.p-why { list-style: none; margin: 10px auto 2px; padding: 0; text-align: left; font-size: 12px; font-weight: 400; color: #c3ccda; max-width: 520px; max-height: 120px; overflow: auto; }
.p-why li { padding: 3px 0; border-top: 1px solid #ffffff14; }
.p-why b { color: #fff; font-weight: 600; } .p-why span { color: #8a96aa; }
.p-hint { display: block; margin-top: 8px; color: #ffcf7a !important; font-weight: 600; }
.p-unmute { position: absolute; left: 12px; top: 12px; z-index: 4; border: 0; border-radius: 99px; padding: 8px 14px; background: #000c; color: #fff; font-weight: 700; font-size: 13px; box-shadow: 0 4px 16px #0008; }
.p-unmute:hover { background: #000; }
.row-meta .bad { color: #e5a400; }
.relay-status { color: var(--muted); }

/* ---- v4: official-app cards ---- */
.p-overlay.official { background: radial-gradient(500px 300px at 50% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), #0b0f16; }
.oc { display: grid; justify-items: center; gap: 10px; max-width: 520px; }
.oc .logo { width: 64px; height: 64px; border-radius: 16px; font-size: 18px; }
.oc-title { font-size: 19px; font-weight: 800; color: #fff; }
.oc-body { color: #c3ccda; font-weight: 400; font-size: 13.5px; }
.oc-links { display: grid; gap: 8px; width: 100%; margin-top: 4px; }
.oc-btn { display: grid; gap: 1px; text-align: left; padding: 10px 14px; border-radius: 12px; background: #ffffff14; border: 1px solid #ffffff22; color: #fff; text-decoration: none; }
.oc-btn:hover { background: #ffffff22; border-color: var(--accent); }
.oc-btn small { color: #a9b4c6; font-weight: 400; }
.row-meta .app { color: var(--accent); font-weight: 700; font-size: 10.5px; border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); padding: 0 4px; border-radius: 4px; }
.now-meta a { color: var(--type); }
.tile .oc .logo { display: none; } .tile .oc-title { font-size: 14px; } .tile .oc-body { display: none; } .tile .oc-btn { padding: 6px 10px; }

/* ---- v4: advertisement ticker (under the video) ---- */
.ad-strip { --ad-bg: var(--panel-2); --ad-fg: var(--text); --ad-accent: var(--accent); flex: none; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.ad-strip:empty { display: none; }
.ad-link { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 8px 0 0; background: var(--ad-bg); color: var(--ad-fg); text-decoration: none; }
.ad-label { align-self: stretch; display: grid; place-items: center; padding: 0 10px; background: var(--ad-accent); color: #111; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ad-img { width: 30px; height: 30px; object-fit: contain; border-radius: 6px; background: #fff; flex: none; }
.ad-view { flex: 1; min-width: 0; overflow: hidden; position: relative; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 24px, #000 calc(100% - 24px), transparent); }
.ad-track { display: inline-block; font-weight: 600; font-size: 14px; will-change: transform; }
.ad-track.static { animation: none !important; }
.ad-link:hover .ad-track { animation-play-state: paused; }
.ad-cta { flex: none; padding: 5px 12px; border-radius: 99px; background: var(--ad-accent); color: #111; font-weight: 700; font-size: 12.5px; }
@keyframes ad-scroll { from { transform: translateX(var(--ad-from)); } to { transform: translateX(var(--ad-to)); } }
.ad-strip[hidden] { display: none !important; }
@media (max-width: 900px) { .ad-link { height: 38px; } .ad-cta { padding: 4px 9px; font-size: 11.5px; } .ad-img { display: none; } }

/* ---- v4.1: chips, keyboard focus, channel info, YouTube click-to-play ---- */
.chip-all { padding: 0 10px; border: 1px dashed var(--line-2); background: none; color: var(--muted); cursor: pointer; font: inherit; }
.chip-all:hover { color: var(--text); border-color: var(--accent); }
.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.dlg.info .info-name { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 17px; }
.dlg.info .info-name .logo { width: 40px; height: 40px; flex: none; }
.info-tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.info-tbl th { text-align: left; vertical-align: top; color: var(--muted); font-weight: 600; padding: 7px 12px 7px 0; width: 34%; }
.info-tbl td { padding: 7px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.info-tbl th { border-top: 1px solid var(--line); }
.info-tbl small { color: var(--muted); }
.info-src { margin: 0; padding-left: 18px; }
.info-src li.on { color: var(--accent); }
.src-note { margin: 0; font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.src-note .yt-mark { display: inline-grid; place-items: center; width: 18px; height: 13px; border-radius: 3px; background: #e62117; color: #fff; font-size: 8px; }
.src-note .src-hint { color: var(--text); }

/* ---- v4.1.1: admin-only ad diagnostics panel (site opened with ?addebug while logged in to /admin/) ---- */
.wt-diag-panel { position: fixed; right: 12px; bottom: 12px; z-index: 90; width: 330px; max-height: 70vh; overflow: auto; background: var(--panel); color: var(--text); border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; font-size: 12px; box-shadow: 0 10px 30px #0006; }
.wt-diag-panel table { width: 100%; border-collapse: collapse; margin: 6px 0; }
.wt-diag-panel th { text-align: left; font-weight: 600; color: var(--muted); padding: 2px 8px 2px 0; }
.wt-diag-panel td { padding: 2px 0; }
.wt-diag-panel p { margin: 4px 0; } .wt-diag-panel .why { color: #e5484d; font-weight: 600; } .wt-diag-panel .ok { color: #2fb36d; } .wt-diag-panel .no { color: var(--muted); }
.globe-off { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* ---- ad-blocker notice (below the player, dismissible, never over the video) ---- */
.wt-support-note { flex: none; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent) 9%, var(--panel)); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.wt-support-note .wsn-main { display: flex; align-items: center; gap: 10px; }
.wt-support-note .wsn-ico { font-size: 20px; flex: none; }
.wt-support-note .wsn-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.wt-support-note .wsn-text span { color: var(--muted); }
.wt-support-note .wsn-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.wt-support-note .wsn-btn { border: 1px solid var(--line-2); background: var(--panel); color: var(--text); border-radius: 99px; padding: 5px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.wt-support-note .wsn-btn.primary { background: var(--accent); border-color: var(--accent); color: #111; }
.wt-support-note .wsn-x { border: 0; background: none; color: var(--muted); font-size: 15px; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; }
.wt-support-note .wsn-x:hover { background: var(--panel-2); color: var(--text); }
.wt-support-note .wsn-steps { margin: 8px 0 0 34px; padding-left: 18px; color: var(--text); line-height: 1.55; }
@media (max-width: 900px) { .wt-support-note .wsn-main { flex-wrap: wrap; } .wt-support-note .wsn-actions { width: 100%; justify-content: flex-end; } }
