/* =========================================================
   Roya TV: brand chrome layer (art direction, Nov 2026)
   Loaded after app.css, before polish.css. Visual only: no layout logic lives here.
   Scope: header, mobile tab bar, buttons, chips, badges, toasts, modal frames,
   player control bar and overlays, title page.
   Rules: one accent per surface (Roya red), depth by lightness steps,
   micro-interactions 140-200 ms on transform/opacity, reduced motion respected.
   Icons are styled with currentColor only, so the ROYA icon set can swap in.
   ========================================================= */

:root {
  /* motion tokens */
  --dur-1: 140ms;
  --dur-2: 200ms;
  --dur-3: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* ease-out-expo: entrances, hover */
  --ease-io: cubic-bezier(0.65, 0, 0.35, 1);
  /* surfaces: elevation by lightness, not shadow */
  --surf-1: #0c0e14;
  --surf-2: #12141c;
  --surf-3: #191c26;
  --glass: rgba(255, 255, 255, 0.07);
  --glass-2: rgba(255, 255, 255, 0.12);
  --hair: rgba(255, 255, 255, 0.09);
  --hair-2: rgba(255, 255, 255, 0.16);
  --hi: inset 0 1px 0 rgba(255, 255, 255, 0.07);   /* top light edge */
  /* accent */
  --red-ui: #e11d2a;
  --red-deep: #c4101d;
  --red-ink: #ff5a64;                               /* red text/icons on dark: 5.6:1 on #0c0e14 */
  --halo: rgba(255, 45, 60, 0.55);
  --gold-1: #f6dc8a;
  --gold-2: #d9ae4c;
  --gold-3: #a87a22;
  --nav-h: 64px;
}
@media (max-width: 960px) { :root { --nav-h: 58px; } }

/* ---------- focus: one ring for keyboard and TV remote ---------- */
:focus-visible, .tv .focusable:focus {
  outline: 2px solid #fff;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px rgba(255, 45, 60, 0.38);
}
.tv .focusable:focus { outline-width: 3px; }
/* keep the control's own shape when focused (app.css squares everything to 10px) */
:is(.icon-btn, .avatar-btn, .lang-btn):focus-visible, .tv :is(.icon-btn, .avatar-btn):focus { border-radius: 50%; }
:is(.chip, .ai-trigger, .nav .btn-sm, .pal-chip, .tp-genres span):focus-visible { border-radius: 99px; }
.btn:focus-visible { border-radius: 12px; }

/* ================= header ================= */
.nav {
  isolation: isolate;
  gap: clamp(12px, 2vw, 32px);
  background: linear-gradient(180deg, rgba(5, 6, 9, 0.78) 0%, rgba(5, 6, 9, 0.38) 60%, rgba(5, 6, 9, 0) 100%);
  transition: none;
}
/* the solid state is its own layer so the change is an opacity fade */
.nav::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: rgba(9, 10, 15, 0.74);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: inset 0 -1px 0 var(--hair), 0 10px 30px -18px rgba(0, 0, 0, 0.9);
  opacity: 0; transition: opacity var(--dur-3) var(--ease-out);
}
.nav.solid { background: linear-gradient(180deg, rgba(5, 6, 9, 0.78), rgba(5, 6, 9, 0)); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.nav.solid::before { opacity: 1; }

/* logo lockup: the original leaf + text wordmark are kept exactly as designed (owner's rule). */

/* primary links: quiet text, a thin red line that glows on the current page */
.nav-links { gap: 2px; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 13px;
  font-size: 14.5px; font-weight: 500; line-height: 1.6; color: rgba(236, 238, 243, 0.68);
  border-radius: 10px; transition: color var(--dur-1) var(--ease-out);
}
.nav-link:hover { color: #fff; background: none; }
.nav-link::after {
  content: ""; position: absolute; inset-inline: 13px; bottom: calc((44px - var(--nav-h)) / 2 + 1px); height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, #ff5a4f, var(--red-ui) 50%, #ff5a4f);
  box-shadow: 0 0 10px 1px var(--halo), 0 -3px 14px rgba(255, 45, 60, 0.25);
  opacity: 0; transform: scaleX(0.3); transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
}
.nav-link:hover::after { opacity: 0.4; transform: scaleX(0.55); box-shadow: none; }
.nav-link[aria-current="page"] { color: #fff; font-weight: 600; background: none; box-shadow: none; }
.nav-link[aria-current="page"]::after { opacity: 1; transform: none; inset-inline: 13px; }

.nav-actions { gap: 6px; }
.nav .clock { font-size: 13px; color: rgba(236, 238, 243, 0.5); letter-spacing: 0.02em; }

/* search / AI pill */
.ai-trigger {
  height: 42px; padding: 0 7px 0 14px; gap: 10px; min-width: 250px;
  background: var(--glass); border: 1px solid var(--hair); box-shadow: var(--hi);
  color: rgba(236, 238, 243, 0.62); font-size: 13.5px;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out), color var(--dur-1);
}
:root[dir="rtl"] .ai-trigger { padding: 0 14px 0 7px; }
.ai-trigger:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 90, 100, 0.32); color: #fff; }
.ai-trigger .spark {
  width: 28px; height: 28px; flex: none; order: -1;
  background: radial-gradient(120% 120% at 30% 20%, #ff6a5a 0%, var(--red-ui) 48%, #8f0b16 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset, 0 0 14px -2px var(--halo);
  transition: transform var(--dur-2) var(--ease-out);
}
.ai-trigger .spark svg { width: 15px; height: 15px; }
.ai-trigger:hover .spark { transform: rotate(-12deg) scale(1.06); }
.ai-trigger kbd { min-width: 22px; height: 22px; display: inline-grid; place-items: center; padding: 0 5px; border-radius: 6px; border: 0; background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--hair); color: rgba(236, 238, 243, 0.55); font-size: 11px; }

/* premium: dark metal with a gold edge, not a yellow slab */
.nav .premium-cta {
  position: relative; overflow: hidden; height: 40px; min-height: 40px; padding: 0 15px; gap: 7px; border-radius: 99px;
  color: var(--gold-1); font-weight: 600;
  background: linear-gradient(180deg, #1f1a10, #14110a) padding-box,
              linear-gradient(120deg, var(--gold-1), var(--gold-3) 45%, var(--gold-2) 70%, var(--gold-1)) border-box;
  border: 1px solid transparent; box-shadow: 0 6px 20px -10px rgba(217, 174, 76, 0.55);
  filter: none;
}
.nav .premium-cta svg { width: 16px; height: 16px; color: var(--gold-2); }
.nav .premium-cta::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(246, 220, 138, 0.28) 50%, transparent 65%);
  transform: translateX(-120%); opacity: 0;
}
.nav .premium-cta:hover { filter: none; transform: translateY(-1px); }
@media (prefers-reduced-motion: no-preference) {
  .nav .premium-cta:hover::after { opacity: 1; transform: translateX(120%); transition: transform 700ms var(--ease-io), opacity var(--dur-1); }
}

.nav .lang-btn { width: 44px; height: 44px; font-size: 12.5px; letter-spacing: 0.04em; color: rgba(236, 238, 243, 0.72); }
.nav .icon-btn { color: rgba(236, 238, 243, 0.72); }
.nav .icon-btn:hover { color: #fff; background: var(--glass); }
.nav .icon-btn svg { width: 20px; height: 20px; }
.nav [data-signin] { height: 40px; min-height: 40px; padding: 0 16px; border-radius: 99px; }
.avatar-btn { width: 38px; height: 38px; box-shadow: 0 0 0 2px rgba(9, 10, 15, 0.9), 0 0 0 3px rgba(255, 90, 100, 0.45), 0 6px 18px -6px var(--halo); }

@media (pointer: coarse) {
  .ai-trigger, .nav [data-signin], .nav .premium-cta { height: 44px; min-height: 44px; }
  .avatar-btn { width: 44px; height: 44px; }
}
/* width ladder: the bar never overflows (8 links + actions) */
@media (max-width: 1599px) {
  .nav { gap: clamp(12px, 1.4vw, 24px); }
  .nav .clock { display: none; }
  .nav-link { padding-inline: 11px; } .nav-link::after, .nav-link[aria-current="page"]::after { inset-inline: 11px; }
  .nav .ai-trigger { min-width: 0; width: 200px; }
}
@media (max-width: 1320px) {
  .nav .ai-trigger { width: 44px; height: 44px; padding: 0; justify-content: center; }
  .nav .ai-trigger .label, .nav .ai-trigger kbd, .nav .premium-cta span { display: none; }
  .nav .premium-cta { width: 44px; padding: 0; justify-content: center; }
}
@media (max-width: 1240px) {
  .nav-link { padding-inline: 9px; font-size: 14px; } .nav-link::after, .nav-link[aria-current="page"]::after { inset-inline: 9px; }
}
@media (max-width: 960px) {
  .nav { gap: 8px; }
  .nav-actions { gap: 0; }
  .nav .ai-trigger { width: 44px; height: 44px; min-width: 0; background: none; border: 0; box-shadow: none; justify-content: center; }
  .nav .ai-trigger .spark { width: 32px; height: 32px; }
  .nav .premium-cta { width: 40px; height: 40px; min-height: 40px; margin-inline: 2px; }
  .nav [data-signin] { padding: 0 14px; margin-inline: 2px; }
}

/* ================= mobile tab bar ================= */
@media (max-width: 960px) {
  .tabbar {
    padding-top: 7px;
    background: linear-gradient(180deg, rgba(10, 11, 16, 0.72), rgba(7, 8, 12, 0.92));
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    border-top: 0; box-shadow: inset 0 1px 0 var(--hair), 0 -16px 36px -16px rgba(0, 0, 0, 0.85);
  }
  .tabbar a { min-height: 54px; gap: 4px; color: rgba(236, 238, 243, 0.52); transition: color var(--dur-1) var(--ease-out); }
  /* soft red halo behind the current tab (replaces the old top bar) */
  .tabbar a::before, .tabbar a[aria-current="page"]::before {
    content: ""; position: absolute; inset-inline: auto; top: -6px; left: 50%; width: 64px; height: 44px; margin-left: -32px;
    border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 45, 60, 0.34), rgba(255, 45, 60, 0));
    opacity: 0; transform: scale(0.6); pointer-events: none; box-shadow: none;
    transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out);
  }
  .tabbar a[aria-current="page"]::before { opacity: 1; transform: none; }
  .tabbar .tb-ic { width: 52px; height: 30px; transition: transform var(--dur-1) var(--ease-out); }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar .tb-label { font-size: 10.5px; font-weight: 500; letter-spacing: 0; }
  .tabbar a:active .tb-ic { transform: scale(0.9); }
  .tabbar a[aria-current="page"] { color: #fff; }
  .tabbar a[aria-current="page"] .tb-label { font-weight: 600; }
  .tabbar a[aria-current="page"] .tb-ic { background: rgba(225, 29, 42, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 90, 100, 0.28); }
  /* filled active icon: the ROYA set (.ri) fills itself via icons.css; Lucide fallbacks get a tinted fill */
  .tabbar a[aria-current="page"] svg { color: var(--red-ink); }
  .tabbar a[aria-current="page"] svg.lucide { fill: currentColor; fill-opacity: 0.22; filter: drop-shadow(0 0 6px rgba(255, 45, 60, 0.45)); }
  main { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
}
@media (max-width: 960px) and (prefers-reduced-motion: no-preference) {
  .tabbar a[aria-current="page"] .tb-ic { animation: tbPop var(--dur-3) var(--ease-out) both; }
}
@keyframes tbPop { from { transform: scale(0.82); opacity: 0.6; } to { transform: none; opacity: 1; } }

/* ================= buttons ================= */
.btn {
  position: relative; isolation: isolate; min-height: 48px; padding: 0 1.4em; gap: 0.55em; border-radius: 12px;
  font-weight: 600; letter-spacing: 0;
  transition: transform var(--dur-2) var(--ease-out), opacity var(--dur-1), background-color var(--dur-1), color var(--dur-1);
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; background: #fff; opacity: 0; transition: opacity var(--dur-1) var(--ease-out); pointer-events: none; }
.btn:hover::before { opacity: 0.08; }
.btn:active { transform: scale(0.97); }
.btn svg { width: 1.15em; height: 1.15em; }
/* primary = confident Roya red (white text 4.6:1 at the lightest stop) */
.btn-primary, .btn-red {
  color: #fff;
  background: linear-gradient(180deg, var(--red-ui) 0%, var(--red-deep) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 28px -12px rgba(225, 29, 42, 0.75);
}
.btn-primary:hover, .btn-red:hover { background: linear-gradient(180deg, var(--red-ui) 0%, var(--red-deep) 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 14px 34px -12px rgba(225, 29, 42, 0.9); transform: translateY(-1px); }
.btn-primary:active, .btn-red:active { transform: scale(0.97); }
/* a filled play triangle reads better on a solid button; other glyphs stay stroked */
:is(.btn-primary, .btn-red) svg.lucide-play { fill: currentColor; }
/* secondary = glass */
.btn-glass {
  color: #fff; background: rgba(255, 255, 255, 0.1); border: 1px solid var(--hair-2); box-shadow: var(--hi);
  -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.btn-glass:hover { background: rgba(255, 255, 255, 0.1); transform: translateY(-1px); }
.btn-ghost:hover { background: none; }
.btn-sm { min-height: 40px; padding: 0 1em; font-size: 13.5px; border-radius: 10px; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }

.icon-btn { transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1), transform var(--dur-2) var(--ease-out); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn.round-line {
  border: 1px solid rgba(255, 255, 255, 0.34); background: rgba(10, 11, 16, 0.42); color: #fff;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: var(--hi);
}
.icon-btn.round-line:hover { border-color: rgba(255, 255, 255, 0.7); background: rgba(255, 255, 255, 0.14); }

/* ================= chips ================= */
.chip {
  height: 40px; padding: 0 16px; gap: 7px; border-radius: 99px;
  border: 1px solid var(--hair); background: rgba(255, 255, 255, 0.035); color: rgba(236, 238, 243, 0.74);
  font-size: 13.5px; font-weight: 500;
  transition: background-color var(--dur-1) var(--ease-out), border-color var(--dur-1), color var(--dur-1), transform var(--dur-2) var(--ease-out);
}
.chip:hover { color: #fff; background: rgba(255, 255, 255, 0.07); border-color: var(--hair-2); }
.chip:active { transform: scale(0.97); }
.chip[aria-pressed="true"], .chip[aria-selected="true"] { background: #f4f5f8; color: #0a0b10; border-color: #f4f5f8; font-weight: 600; box-shadow: 0 6px 18px -10px rgba(255, 255, 255, 0.5); }
.chip svg { width: 16px; height: 16px; }
@media (pointer: coarse) { .chip { min-height: 44px; } }

/* ================= badges: one family ================= */
.badge, .badge-live {
  display: inline-flex; align-items: center; gap: 5px; min-height: 22px; height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11px; font-weight: 700; line-height: 1; letter-spacing: 0.05em; white-space: nowrap;
}
:root[dir="rtl"] .badge, :root[dir="rtl"] .badge-live { letter-spacing: 0; font-size: 11.5px; }
.badge { color: #fff; background: rgba(12, 13, 19, 0.58); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.badge svg { width: 12px; height: 12px; }
/* LIVE */
.badge-live {
  color: #fff; background: linear-gradient(180deg, #ef2633, #cf1320);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 4px 14px -5px rgba(225, 29, 42, 0.8);
}
.badge-live::before { width: 6px; height: 6px; background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, 0.9); }
/* quality (HD, 1080p, 4K) and outline */
.badge.q, .badge-outline { background: rgba(12, 13, 19, 0.5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28); color: rgba(255, 255, 255, 0.92); font-variant-numeric: tabular-nums; letter-spacing: 0.04em; }
.ccard .q { background: rgba(12, 13, 19, 0.5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.86); }
.badge-outline { background: transparent; border: 0; }
/* PREMIUM / gold */
.badge-gold, .badge-premium {
  color: #2a1b00; background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), 0 4px 14px -6px rgba(217, 174, 76, 0.7);
}
.badge-rating { min-height: 20px; height: 20px; padding: 0 6px; font-size: 10.5px; background: rgba(12, 13, 19, 0.6); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24); }
.badge-rating.r18 { color: #ff8a8a; background: rgba(225, 29, 42, 0.18); box-shadow: inset 0 0 0 1px rgba(255, 70, 80, 0.6); }
.badge-demo { background: rgba(242, 181, 68, 0.14); color: var(--gold-1); box-shadow: inset 0 0 0 1px rgba(242, 181, 68, 0.4); border: 0; }

/* ================= toasts ================= */
.toasts { bottom: calc(28px + env(safe-area-inset-bottom)); gap: 10px; }
@media (max-width: 960px) { .toasts { bottom: calc(88px + env(safe-area-inset-bottom)); width: calc(100% - 32px); justify-items: center; } }
.toast {
  min-height: 48px; max-width: min(520px, 100%); padding: 8px 18px 8px 10px; gap: 12px; border-radius: 16px;
  background: rgba(22, 24, 33, 0.84); border: 1px solid var(--hair-2);
  -webkit-backdrop-filter: blur(22px) saturate(170%); backdrop-filter: blur(22px) saturate(170%);
  box-shadow: var(--hi), 0 22px 50px -16px rgba(0, 0, 0, 0.9);
  font-size: 14px; font-weight: 500; line-height: 1.5; color: #fff;
}
:root[dir="rtl"] .toast { padding: 8px 10px 8px 18px; }
.toast > svg {
  box-sizing: content-box; width: 16px; height: 16px; padding: 8px; flex: none; border-radius: 50%;
  color: var(--red-ink); background: rgba(225, 29, 42, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 90, 100, 0.25);
}

/* ================= modal and sheet frames ================= */
.overlay { background: rgba(4, 5, 8, 0.72); -webkit-backdrop-filter: blur(12px) saturate(120%); backdrop-filter: blur(12px) saturate(120%); }
.dialog:not(.tp) { background: var(--surf-1); box-shadow: inset 0 0 0 1px var(--hair), var(--hi), 0 50px 140px -30px #000; }
.dialog .d-close, .tp .d-close, .trailer-card header .icon-btn {
  width: 44px; height: 44px; color: #fff; background: rgba(10, 11, 16, 0.5); box-shadow: inset 0 0 0 1px var(--hair-2), var(--hi);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.dialog .d-close:hover, .tp .d-close:hover, .trailer-card header .icon-btn:hover { background: rgba(255, 255, 255, 0.14); }
.trailer-modal { background: rgba(4, 5, 8, 0.8); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.trailer-card { border-radius: 20px; background: var(--surf-1); box-shadow: inset 0 0 0 1px var(--hair), 0 50px 120px -30px #000, 0 0 90px -40px rgba(225, 29, 42, 0.4); }
.trailer-card header { padding: 10px 12px 10px 18px; }
:root[dir="rtl"] .trailer-card header { padding: 10px 18px 10px 12px; }
.trailer-card header b { font-weight: 600; font-size: 15px; line-height: 1.6; }
.trailer-card footer { padding: 14px 18px; background: var(--surf-2); box-shadow: inset 0 1px 0 var(--hair); }
.palette { background: rgba(4, 5, 8, 0.7); -webkit-backdrop-filter: blur(14px) saturate(130%); backdrop-filter: blur(14px) saturate(130%); }
.pal { background: rgba(14, 16, 22, 0.94); box-shadow: inset 0 0 0 1px var(--hair-2), var(--hi), 0 50px 140px -30px #000, 0 0 90px -40px var(--halo); }
@media (prefers-reduced-motion: no-preference) {
  .trailer-card, .pal { animation: frameIn var(--dur-3) var(--ease-out) both; }
}
@keyframes frameIn { from { opacity: 0; transform: translateY(10px) scale(0.985); } to { opacity: 1; transform: none; } }

/* ================= player chrome ================= */
.p-top {
  padding: 20px var(--gutter) 80px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.42) 40%, rgba(0, 0, 0, 0.12) 75%, rgba(0, 0, 0, 0) 100%);
}
.p-top > .icon-btn {
  width: 48px; height: 48px; background: rgba(12, 13, 19, 0.42); box-shadow: inset 0 0 0 1px var(--hair-2), var(--hi);
  -webkit-backdrop-filter: blur(14px) saturate(160%); backdrop-filter: blur(14px) saturate(160%);
}
.p-top > .icon-btn:hover { background: rgba(255, 255, 255, 0.16); }
.p-top .p-titles h1 { font-weight: 700; line-height: 1.45; text-shadow: 0 2px 18px rgba(0, 0, 0, 0.6); }
.p-top .p-titles p { color: rgba(236, 238, 243, 0.7); }
.p-bottom {
  padding: 120px var(--gutter) calc(22px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.28) 30%, rgba(0, 0, 0, 0.7) 68%, rgba(0, 0, 0, 0.9) 100%);
}
/* seek: 6px rail that rests at 4px; grows with a transform, not a height change */
.p-seek { height: 26px; }
.p-seek .rail-bg, .p-seek .buf, .p-seek .fill { height: 6px; border-radius: 6px; transform: scaleY(0.667); transition: transform var(--dur-1) var(--ease-out); }
.p-seek:hover .rail-bg, .p-seek:hover .buf, .p-seek:hover .fill, .p-seek:focus-visible .rail-bg, .p-seek:focus-visible .buf, .p-seek:focus-visible .fill { height: 6px; transform: none; }
.p-seek .rail-bg { background: rgba(255, 255, 255, 0.2); }
.p-seek .buf { background: rgba(255, 255, 255, 0.32); }
.p-seek .fill { background: linear-gradient(90deg, var(--red-deep), #ff3b47); box-shadow: 0 0 12px rgba(255, 45, 60, 0.55); }
.p-seek .knob { width: 16px; height: 16px; background: #fff; box-shadow: 0 0 0 4px rgba(225, 29, 42, 0.45), 0 2px 10px rgba(0, 0, 0, 0.5); transition: transform var(--dur-1) var(--ease-out); }
.p-seek:focus-visible { outline: none; box-shadow: none; }
.p-seek:focus-visible .knob { transform: translateX(-50%) scale(1); }
.p-seek .tip { bottom: 28px; padding: 4px 9px; border-radius: 8px; background: rgba(12, 13, 19, 0.86); box-shadow: inset 0 0 0 1px var(--hair-2); font-size: 12.5px; font-weight: 600; transition: opacity var(--dur-1); }
.p-controls { gap: 4px; margin-top: 8px; }
.p-controls .icon-btn { width: 52px; height: 52px; color: #fff; }
.p-controls .icon-btn svg { width: 26px; height: 26px; }
.p-controls .icon-btn:hover { background: rgba(255, 255, 255, 0.12); transform: scale(1.06); }
.p-controls .icon-btn:active { transform: scale(0.94); }
.p-controls [data-a="play"] { width: 60px; height: 60px; }
.p-controls [data-a="play"] svg { width: 32px; height: 32px; }
.p-controls [data-a="play"] svg.lucide { fill: currentColor; }
.p-controls .btn-glass { min-height: 40px; border-radius: 99px; }
.p-time { font-size: 13.5px; font-weight: 500; color: rgba(255, 255, 255, 0.82); letter-spacing: 0.02em; }
.p-vol input { accent-color: var(--red-ui); }
.p-flash { width: 96px; height: 96px; background: rgba(12, 13, 19, 0.5); box-shadow: inset 0 0 0 1px var(--hair-2); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.p-spinner { width: 56px; height: 56px; border-width: 3px; border-color: rgba(255, 255, 255, 0.12); border-top-color: var(--red-ui); filter: drop-shadow(0 0 10px rgba(255, 45, 60, 0.45)); }
.p-menu {
  min-width: 220px; padding: 8px; border-radius: 16px; background: rgba(16, 18, 25, 0.88);
  border: 0; box-shadow: inset 0 0 0 1px var(--hair-2), var(--hi), 0 30px 70px -20px #000;
  -webkit-backdrop-filter: blur(24px) saturate(170%); backdrop-filter: blur(24px) saturate(170%);
}
.p-menu button { min-height: 44px; align-items: center; padding: 0 12px; border-radius: 10px; transition: background-color var(--dur-1); }
.p-menu button[aria-checked="true"] { background: rgba(225, 29, 42, 0.12); }
.p-menu button[aria-checked="true"]::after { color: var(--red-ink); font-weight: 700; }
.osd .osd-card, .osd .osd-num { background: rgba(12, 13, 19, 0.7); box-shadow: inset 0 0 0 1px var(--hair), var(--hi); border: 0; -webkit-backdrop-filter: blur(20px) saturate(160%); backdrop-filter: blur(20px) saturate(160%); }
.zap { background: rgba(9, 10, 15, 0.9); -webkit-backdrop-filter: blur(24px) saturate(160%); backdrop-filter: blur(24px) saturate(160%); border-inline-start: 0; box-shadow: inset 1px 0 0 var(--hair), -30px 0 60px -30px #000; }
.zrow { min-height: 64px; }
.zrow.on { background: rgba(225, 29, 42, 0.12); box-shadow: inset 0 0 0 1px rgba(255, 90, 100, 0.25); }
@media (max-width: 720px) {
  .p-top { padding: 12px 12px 64px; }
  .p-top > .icon-btn { width: 44px; height: 44px; }
  .p-bottom { padding: 90px 12px calc(12px + env(safe-area-inset-bottom)); }
  .p-controls { gap: 0; }
  .p-controls .icon-btn { width: 44px; height: 44px; }
  .p-controls .icon-btn svg { width: 22px; height: 22px; }
  .p-controls [data-a="play"] { width: 52px; height: 52px; }
  .p-controls [data-a="play"] svg { width: 28px; height: 28px; }
  .p-time { font-size: 12px; margin-inline: 4px; }
}

/* ================= title page ================= */
.tp .d-close { top: max(16px, env(safe-area-inset-top)); inset-inline-start: 16px; }
.tp-info { gap: 16px; }
.tp-type {
  display: inline-flex; align-items: center; height: 26px; padding: 0 11px; border-radius: 99px;
  background: rgba(225, 29, 42, 0.14); box-shadow: inset 0 0 0 1px rgba(255, 90, 100, 0.3);
  color: #ff9a92; font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
}
.tp-info h2 { letter-spacing: -0.01em; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.55); }
:root[dir="rtl"] .tp-info h2 { letter-spacing: 0; line-height: 1.4; }
.tp-orig { color: rgba(236, 238, 243, 0.62); font-weight: 400; letter-spacing: 0.01em; }
.tp-meta { gap: 12px; font-size: 14.5px; color: rgba(236, 238, 243, 0.78); }
.tp-meta > span:not(:empty):not(.tp-hd):not(:first-child)::before { content: "·"; margin-inline-end: 12px; color: rgba(236, 238, 243, 0.35); }
.tp-age, .tp-hd {
  display: inline-flex; align-items: center; height: 22px; padding: 0 7px; border: 0; border-radius: 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}
.tp-genres { gap: 8px; }
.tp-genres span { display: inline-flex; align-items: center; height: 30px; padding: 0 13px; border-radius: 99px; background: rgba(255, 255, 255, 0.05); box-shadow: inset 0 0 0 1px var(--hair); color: rgba(236, 238, 243, 0.8); font-size: 12.5px; }
.tp-actions { gap: 10px; margin-top: 6px; }
.tp-play { min-height: 54px; padding-inline: 34px; font-size: 1.02rem; border-radius: 14px; }
.tp-act {
  min-width: 72px; min-height: 58px; padding: 8px 10px; gap: 5px; align-content: center; border-radius: 14px;
  background: rgba(255, 255, 255, 0.06); border: 0; box-shadow: inset 0 0 0 1px var(--hair), var(--hi);
  color: rgba(236, 238, 243, 0.78); font-size: 11.5px; font-weight: 500; line-height: 1.3;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background-color var(--dur-1) var(--ease-out), color var(--dur-1), transform var(--dur-2) var(--ease-out);
}
.tp-act:hover, .tp-act:focus-visible { background: rgba(255, 255, 255, 0.11); color: #fff; border-color: transparent; transform: translateY(-1px); }
.tp-act:active { transform: scale(0.96); }
.tp-act svg { width: 21px; height: 21px; }
.tp-act.on { color: #7cf0b0; box-shadow: inset 0 0 0 1px rgba(47, 210, 134, 0.38); background: rgba(47, 210, 134, 0.08); }
.tp-prog { height: 4px; }
.tp-desc { color: rgba(236, 238, 243, 0.8); }
.tp-sec h3 { font-size: 1.25rem; font-weight: 700; margin-bottom: 16px; }
.tp-person span { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12), 0 10px 24px -12px #000; }
.tp-facts div { background: rgba(255, 255, 255, 0.03); border: 0; box-shadow: inset 0 0 0 1px var(--hair); border-radius: 14px; }
.tp-facts dt { color: rgba(236, 238, 243, 0.5); font-size: 11.5px; }
.tp-facts dd { color: #fff; margin-top: 6px; }
@media (max-width: 720px) {
  .tp-info { gap: 14px; }
  .tp-actions { display: flex; flex-wrap: wrap; width: 100%; gap: 8px; }
  .tp-actions > :not(.tp-act) { flex: 1 1 100%; }
  .tp-act { flex: 1 1 0; min-width: 0; }
}
@media (prefers-reduced-motion: no-preference) {
  .tp-main .tp-info > * { animation: tpRise 520ms var(--ease-out) both; }
  .tp-main .tp-info > :nth-child(2) { animation-delay: 40ms; }
  .tp-main .tp-info > :nth-child(3) { animation-delay: 80ms; }
  .tp-main .tp-info > :nth-child(n + 4) { animation-delay: 120ms; }
}
@keyframes tpRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
  .nav::before, .nav-link::after, .tabbar a::before, .btn, .btn::before, .chip, .icon-btn, .tp-act, .p-seek .rail-bg, .p-seek .buf, .p-seek .fill, .p-seek .knob { transition-duration: 1ms !important; }
  .btn:hover, .btn-primary:hover, .btn-red:hover, .btn-glass:hover, .tp-act:hover, .p-controls .icon-btn:hover, .nav .premium-cta:hover { transform: none; }
}
@media (min-width: 961px) and (max-width: 1100px) { .nav-link { padding-inline: 7px; font-size: 13px; } .nav-link::after, .nav-link[aria-current="page"]::after { inset-inline: 7px; } }
