/* App fonts: served by the Worker (the same two files as the landing
   pages). Generic family names on purpose — the real font names never
   appear in this repo. Body text uses SiteBody, headings use
   SiteHeadings. */
@font-face {
  font-family: 'SiteBody';
  src: url('https://shabakehaye.mahvareh.workers.dev/fonts/body-vf.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: 'SiteHeadings';
  src: url('https://shabakehaye.mahvareh.workers.dev/fonts/headings-vf.woff2') format('woff2-variations');
  font-weight: 100 1000;
  font-display: swap;
}
:root {
  --bg: #140a0a;
  --surface: #220f0f;
  --surface2: #2d1414;
  --text: #fff5f5;
  --muted: #c9a0a0;
  --accent: #ff0000;
  --accent2: #cc0000;
  --border: #402020;
}
* { box-sizing: border-box; }
/* `hidden` must win over the display:flex rules below (.idle-overlay,
   .now-playing): author display rules override the UA [hidden] rule,
   so without this the play overlay never disappears on play. */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'SiteBody', Vazirmatn, system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.app { max-width: 640px; margin: 0 auto; padding: 12px 12px 32px; }
.topbar { display: flex; align-items: center; gap: 10px; padding: 4px 2px 12px; }
.brand { display: flex; flex-direction: column; }
.brand-title { font-family: 'SiteHeadings', 'SiteBody', Vazirmatn, sans-serif; font-size: 22px; font-weight: 800; line-height: 1.2; }
.brand-sub { font-size: 12px; color: var(--muted); }
.lang-select { margin-inline-start: auto; flex: 0 0 auto; max-width: 118px; padding: 6px 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer; outline: none; }
.player { position: sticky; top: 0; z-index: 5; background: var(--bg); padding-bottom: 8px; }
.video-wrap { position: relative; }
video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 14px; display: block; }
/* Custom fullscreen button: the native fullscreen button is dead inside
   Telegram's Android WebView (no fullscreen API), so this one drives
   real fullscreen where it exists and a CSS pseudo-fullscreen fallback. */
.fs-btn { position: absolute; top: 8px; inset-inline-end: 8px; z-index: 3; width: 36px; height: 36px; border-radius: 10px; border: 1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.55); color: #fff; font-size: 19px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.video-wrap.fs-fallback { position: fixed; inset: 0; z-index: 9999; background: #000; }
.video-wrap.fs-fallback video { width: 100%; height: 100%; aspect-ratio: auto; object-fit: contain; border-radius: 0; }
.video-wrap.fs-fallback .fs-btn { top: 12px; inset-inline-end: 12px; }
.idle-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: #000; border-radius: 14px; pointer-events: none; }
.big-play { width: 72px; height: 72px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: flex; align-items: center; justify-content: center; }
.big-play svg { width: 32px; height: 32px; fill: #fff; margin-inline-start: 5px; }
.idle-text { font-size: 14px; color: var(--muted); }
.now-playing { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.np-name { font-family: 'SiteHeadings', 'SiteBody', Vazirmatn, sans-serif; font-weight: 800; font-size: 16px; }
.np-group { font-size: 12px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; padding: 2px 8px; }
.icon-btn { margin-inline-start: auto; background: var(--surface2); color: var(--accent); border: 1px solid var(--border); border-radius: 999px; width: 36px; height: 36px; font-size: 20px; cursor: pointer; }
.icon-btn.fav { color: var(--accent); }
.report-btn { background: none; border: none; color: var(--muted); font-family: inherit; font-size: 12px; cursor: pointer; text-decoration: underline; }
.fail-actions { margin: 8px 2px 0; }
.fail-btn { width: 100%; background: var(--surface); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 13px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.status { margin: 6px 2px 0; font-size: 13px; color: var(--muted); min-height: 18px; }
.status.error { color: #ff9a9a; }
.controls { margin-top: 4px; }
#search { width: 100%; padding: 10px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-size: 15px; outline: none; }
#search:focus { border-color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-size: 14px; cursor: pointer; }
.chip.active { background: linear-gradient(135deg, var(--accent), var(--accent2)); border-color: transparent; font-weight: 700; }
.count { font-size: 12px; color: var(--muted); margin: 10px 2px 6px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: start; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 8px 10px; color: var(--text); font-family: inherit; cursor: pointer; }
.item.playing { border-color: var(--accent); }
.item-logo { width: 44px; height: 44px; border-radius: 8px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.item-play { width: 44px; height: 44px; border-radius: 8px; background: linear-gradient(135deg, var(--accent), var(--accent2)); flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
.item-play svg { width: 20px; height: 20px; fill: #fff; margin-inline-start: 2px; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-family: 'SiteHeadings', 'SiteBody', Vazirmatn, sans-serif; font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-group { font-size: 12px; color: var(--muted); }
.item-star { font-size: 20px; color: var(--accent); background: none; border: none; cursor: pointer; padding: 4px; }
.item-star.off { color: #6b4a4a; }
.empty { text-align: center; color: var(--muted); padding: 24px 0; }
.note { font-size: 12px; color: var(--muted); line-height: 1.8; margin: 18px 2px 0; }
/* PWA install guide modal (shown when the user arrives via
   ?install=ios or ?install=android from the landing page). */
.install-modal { position: fixed; inset: 0; z-index: 10000; background: rgba(0,0,0,.7); display: flex; align-items: center; justify-content: center; padding: 20px; }
.install-modal-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; max-width: 420px; width: 100%; }
.install-modal-title { font-family: 'SiteHeadings', 'SiteBody', Vazirmatn, sans-serif; font-weight: 800; font-size: 18px; margin: 0 0 10px; }
.install-modal-steps { margin: 0 0 14px; padding-inline-start: 22px; line-height: 2; font-size: 14px; }
.install-modal-note { margin: 0 0 14px; line-height: 1.8; font-size: 14px; }
.install-modal-close { background: var(--accent); color: #fff; border: none; border-radius: 999px; padding: 10px 24px; font-family: inherit; font-weight: 700; font-size: 14px; cursor: pointer; }
