/* Sahra TV — public streaming UI, ONE shared design system for every
   viewer page (Home / Search / My List / Movie / Series / Watch Room /
   the global Watch Together picker). One nav, one hero, one card shell,
   one rail, one modal language, one button system — no page invents its
   own competing look.
   Identity: near-black surfaces, a single crimson accent reserved for the
   one primary action per screen, chip-based metadata (never plain text
   glued under a poster), and a real elevated card SHELL — poster and its
   title/year/rating live inside the same padded, bordered box, so artwork
   and metadata never visually merge or collide. */

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font-ui);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "kern" 1;
  background: radial-gradient(1100px 520px at 50% -220px, rgba(225,29,46,0.07), transparent 70%), var(--bg);
}
a { color: inherit; }
img { max-width: 100%; }
::selection { background: var(--accent); color: var(--accent-ink); }

h1, h2, h3 { font-family: var(--font-ui); font-weight: 700; letter-spacing: -0.015em; margin: 0; }

.wrap { max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter) 96px; }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon.filled { fill: currentColor; stroke: none; }
.icon.flip { transform: scaleX(-1); }

/* ============================== NAV =====================================
   Transparent over the hero at rest, picks up a solid blurred backdrop
   once scrolled. The link group is one pill (segmented-control feel, not
   underline-tabs) so the active page reads as a solid accent chip. Watch
   Together sits OUTSIDE that group as its own outlined accent pill — a
   permanent, unmistakably distinct nav-level feature, never a plain link. */
.site-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  display: flex; align-items: center; gap: 10px;
  padding: 0 var(--gutter); height: 78px;
  background: linear-gradient(180deg, rgba(8,8,10,0.82) 0%, rgba(8,8,10,0) 100%);
  transition: background var(--motion-standard) var(--ease), backdrop-filter var(--motion-standard) var(--ease), border-color var(--motion-standard) var(--ease), height var(--motion-standard) var(--ease);
  border-bottom: 1px solid transparent;
}
.site-nav.scrolled {
  height: 68px;
  background: rgba(9,9,11,0.92); backdrop-filter: blur(20px) saturate(140%); -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom-color: var(--border-soft);
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.site-nav .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-inline-end: 20px; flex: none; }
.site-nav .brand .mark { width: 30px; height: 30px; border-radius: var(--radius-sm); flex: none; display: block; }
.site-nav .brand .word { font-weight: 800; font-size: 17px; color: var(--text); letter-spacing: -0.01em; }

.site-nav .links {
  display: flex; align-items: center; gap: 2px; height: 44px; padding: 4px; border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.05); flex: none;
}
.site-nav .links a {
  display: flex; align-items: center; height: 100%; position: relative;
  text-decoration: none; color: var(--text-dim); font-size: 13px; font-weight: 600;
  padding: 0 16px; border-radius: var(--radius-pill); white-space: nowrap;
  transition: color var(--motion-fast) var(--ease), background var(--motion-fast) var(--ease);
}
.site-nav .links a:hover { color: var(--text); background: rgba(255,255,255,0.07); }
.site-nav .links a.active { color: var(--accent-ink); background: var(--accent); font-weight: 700; }
.site-nav .nav-spacer { flex: 1; }

.nav-watch-together {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 9px 18px 9px 14px; border-radius: var(--radius-pill);
  background: var(--accent-soft); border: 1px solid rgba(225,29,46,0.4); color: var(--text);
  font-size: 13px; font-weight: 700;
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease-out), box-shadow var(--motion-fast) var(--ease);
}
.nav-watch-together .icon { width: 16px; height: 16px; color: var(--accent-strong); flex: none; }
.nav-watch-together:hover { background: rgba(225,29,46,0.2); border-color: rgba(225,29,46,0.65); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(225,29,46,0.25); }

.site-nav .locale-select {
  appearance: none; border: 1px solid rgba(255,255,255,0.08); background: rgba(255,255,255,0.06);
  color: var(--text-dim); font: inherit; font-size: 12px; padding: 8px 12px; border-radius: var(--radius-pill);
  margin-inline-start: 6px; cursor: pointer; flex: none;
}
.site-nav .locale-select:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.site-nav .search-box { position: relative; width: 210px; flex: none; }
.site-nav .search-box .icon { position: absolute; inset-inline-start: 13px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; width: 15px; height: 15px; }
.site-nav input[type="search"] {
  width: 100%; font: inherit; font-size: 13px; appearance: none;
  background: rgba(255,255,255,0.055); border: 1px solid rgba(255,255,255,0.07); color: var(--text);
  padding: 9px 12px; padding-inline-start: 34px; border-radius: var(--radius-pill);
  transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
.site-nav input[type="search"]::-webkit-search-cancel-button { display: none; }
.site-nav input[type="search"]:focus { outline: none; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.1); }
.site-nav input[type="search"]::placeholder { color: var(--text-muted); }
.site-nav .mobile-search-link, .site-nav .menu-toggle {
  display: none; background: rgba(255,255,255,0.06); border: none; color: var(--text); border-radius: 50%;
  width: 38px; height: 38px; align-items: center; justify-content: center; font-size: 19px; padding: 0; flex: none;
}
.mobile-panel { display: none; }

@media (max-width: 900px) {
  .site-nav .links, .site-nav .search-box { display: none; }
  .site-nav .mobile-search-link, .site-nav .menu-toggle { display: flex; }
  .nav-watch-together { padding: 0; width: 38px; height: 38px; justify-content: center; border-radius: 50%; }
  .nav-watch-together .label { display: none; }
  .nav-watch-together .icon { width: 17px; height: 17px; }
  .mobile-panel {
    position: fixed; inset: 0 0 auto 0; top: 64px; z-index: 99;
    background: var(--bg-elevated); border-bottom: 1px solid var(--border-soft);
    padding: 10px; display: none; flex-direction: column; gap: 2px;
    box-shadow: var(--shadow-lg); max-height: calc(100vh - 64px); overflow-y: auto;
    transform: translateY(-8px); opacity: 0; transition: transform var(--motion-standard) var(--ease), opacity var(--motion-standard) var(--ease);
  }
  .mobile-panel.open { display: flex; transform: translateY(0); opacity: 1; }
  .mobile-panel a {
    text-decoration: none; color: var(--text-dim); font-weight: 600; font-size: 15px;
    padding: 14px; border-radius: var(--radius-md);
  }
  .mobile-panel a.active, .mobile-panel a:hover { color: var(--text); background: var(--surface-2); }
  .mobile-panel .nav-watch-together.mobile-entry {
    width: 100%; justify-content: flex-start; padding: 14px 16px; border-radius: var(--radius-md);
    background: var(--accent-soft); border: 1px solid rgba(225,29,46,0.32); margin-bottom: 8px; font-size: 15px;
  }
  .mobile-panel .nav-watch-together.mobile-entry .icon { width: 18px; height: 18px; }
}

/* ============================== BUTTONS =================================
   One solid gradient pill for the single primary action per screen, one
   outlined "secondary" pill, one plain ghost, one circular icon action. */
button, .btn {
  font: inherit; font-size: 13.5px; font-weight: 700; letter-spacing: 0.005em; cursor: pointer;
  padding: 11px 20px; border-radius: var(--radius-pill); border: 1px solid transparent;
  background: rgba(255,255,255,0.07); color: var(--text); text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; white-space: nowrap;
  transition: transform var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease), opacity var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease);
}
button:hover:not(:disabled), .btn:hover { background: rgba(255,255,255,0.13); }
.btn.primary, button.primary {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent)); color: var(--accent-ink); border-color: rgba(255,255,255,0.1);
  box-shadow: 0 10px 26px rgba(225,29,46,0.3);
}
.btn.primary:hover:not(:disabled), button.primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 14px 32px rgba(225,29,46,0.38); }
.btn.large, button.large { padding: 14px 26px; font-size: 14.5px; }
.btn.ghost, button.ghost { background: transparent; border-color: transparent; color: var(--text-dim); padding: 8px 10px; }
.btn.ghost:hover:not(:disabled), button.ghost:hover:not(:disabled) { color: var(--text); background: rgba(255,255,255,0.08); }
.btn.secondary, button.secondary { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.15); color: var(--text); box-shadow: none; }
.btn.secondary:hover:not(:disabled), button.secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.24); transform: none; }
button:disabled { opacity: .4; cursor: default; transform: none !important; box-shadow: none !important; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-circle-btn {
  padding: 0; width: 46px; height: 46px; border-radius: 50%; flex: none; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
}
.icon-circle-btn:hover:not(:disabled) { background: rgba(255,255,255,0.15); }
.icon-circle-btn.added { background: var(--text); color: var(--bg); border-color: var(--text); }
.icon-circle-btn.small { width: 36px; height: 36px; }

/* ============================== CHIPS & TYPE BADGE =======================
   Metadata (year, rating, IMDb, category) always renders as small pills —
   never plain dot-separated text — so it reads as data, not a caption. */
.chip {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-dim);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09); padding: 6px 12px; border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums; line-height: 1; text-decoration: none;
}
.chip .icon { width: 12px; height: 12px; }
.chip.rating { color: var(--text); border-color: rgba(232,163,61,0.35); background: rgba(232,163,61,0.1); }
.chip.rating .icon { color: var(--warning); }
.chip-link:hover { color: var(--text); border-color: rgba(255,255,255,0.24); background: rgba(255,255,255,0.1); }
.type-badge {
  position: absolute; top: 10px; inset-inline-start: 10px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em;
  text-transform: uppercase; padding: 4px 9px; border-radius: var(--radius-pill);
  background: rgba(8,8,10,0.72); color: #fff; border: 1px solid rgba(255,255,255,0.14); backdrop-filter: blur(4px);
}

/* ============================== STATES =================================== */
.state-panel { padding: 110px 20px; text-align: center; color: var(--text-dim); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.state-panel.compact { padding: 56px 20px; }
.state-panel .icon-badge {
  width: 56px; height: 56px; border-radius: 50%; background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--text-muted); font-size: 20px; border: 1px solid var(--border-soft);
}
.state-panel.error .icon-badge { background: rgba(239, 91, 91, 0.12); color: var(--danger); border-color: rgba(239,91,91,0.25); }
.state-panel h3 { font-weight: 800; font-size: 18px; color: var(--text); margin: 0; }
.state-panel p { margin: 0; max-width: 380px; font-size: 13.5px; }
.state-panel .actions { display: flex; gap: 10px; margin-top: 4px; flex-wrap: wrap; justify-content: center; }
.empty-note { color: var(--text-muted); font-size: 13px; }

/* ============================== HERO =====================================
   One component for both Home's banner and the Movie/Series header (which
   just adds a poster into it). An eyebrow label + chip meta row give it
   real editorial hierarchy instead of a plain image with text stuck on. */
.hero { position: relative; overflow: hidden; background: var(--bg-elevated); }
.hero.has-image { width: 100%; aspect-ratio: 16 / 7.2; min-height: 440px; max-height: 760px; }
.hero.no-image { min-height: 320px; padding: 150px 0 var(--space-xxl); background: radial-gradient(90% 100% at 18% 0%, var(--surface) 0%, var(--bg) 65%); }
.hero .hero-img { width: 100%; height: 100%; object-fit: cover; display: block; animation: hero-enter var(--motion-slow) var(--ease-out) both; }
.hero .hero-content { animation: hero-content-enter var(--motion-slow) var(--ease-out) both; }
@keyframes hero-enter { from { opacity: 0; transform: scale(1.025); } to { opacity: 1; transform: scale(1); } }
@keyframes hero-content-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.hero.has-image::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(10,10,12,0.04) 0%, rgba(10,10,12,0.3) 55%, var(--bg) 100%),
    linear-gradient(100deg, rgba(10,10,12,0.92) 0%, rgba(10,10,12,0.5) 40%, rgba(10,10,12,0) 70%);
}
.hero-content { position: relative; z-index: 2; padding: 0 var(--gutter); max-width: 680px; }
.hero.has-image .hero-content { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 56px; }
.hero.no-image .hero-content { max-width: 720px; }
.hero-content.with-poster { display: grid; grid-template-columns: 180px minmax(0, 720px); align-items: end; gap: 28px; max-width: 1200px; }
.hero-poster {
  width: 180px; flex: none; aspect-ratio: 2/3; background: var(--surface); overflow: hidden; position: relative;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,0.1);
}
.hero-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-poster .fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.hero-poster .fallback .icon { width: 26px; height: 26px; opacity: 0.55; }
.hero-text { min-width: 0; flex: 1; }
.hero-eyebrow { margin-bottom: 12px; }
.hero-eyebrow span {
  display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 800;
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase; color: var(--accent-strong);
}
.hero-eyebrow span::before { content: ""; width: 16px; height: 2px; border-radius: var(--radius-pill); background: var(--accent-strong); }
.hero-content h1 {
  font-weight: 800; font-size: clamp(28px, 4.4vw, 56px); line-height: 1.03; letter-spacing: -0.025em;
  color: var(--text); margin: 0 0 10px;
}
.hero.has-image .hero-content h1 { text-shadow: 0 8px 28px rgba(0,0,0,0.55); }
.hero-content .arabic-title { font-family: var(--font-arabic); font-weight: 700; font-size: clamp(15px, 1.7vw, 20px); color: var(--text-dim); direction: rtl; margin: 0 0 14px; }
.hero-content .meta-row { margin-bottom: 16px; }
.hero-content p.desc { color: var(--text-dim); font-size: 14.5px; line-height: 1.65; margin: 0 0 22px; max-width: 560px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-content .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.hero-dots { position: absolute; inset-inline-end: var(--gutter); bottom: 26px; z-index: 3; display: flex; gap: 6px; }
.hero-dots button { padding: 0; width: 22px; height: 3px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.25); border: none; }
.hero-dots button.active { background: var(--accent-strong); }

.meta-row { font-size: 13px; color: var(--text-dim); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.genre-line { font-size: 13px; color: var(--text-muted); }

/* ============================== RAILS ====================================
   .rail-bleed derives from the SAME --gutter as .wrap/.rail-track, so a
   rail placed inside .wrap (Movie's "More Like This") always lines up
   with every full-bleed rail on Home — never a stray few px of drift. */
.rail { margin-bottom: 64px; }
.rail-header { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 16px; }
.rail-header h2 { display: flex; align-items: center; gap: 10px; font-size: 19px; color: var(--text); letter-spacing: -0.015em; }
.rail-header h2::before { content: ""; width: 4px; height: 20px; border-radius: var(--radius-pill); background: var(--accent); flex: none; }
.rail-viewport { position: relative; }
.rail-track {
  display: flex; gap: 16px; overflow-x: auto; padding: 6px var(--gutter) 18px; scroll-snap-type: x proximity;
  scrollbar-width: none; direction: ltr;
}
.rail-track .card { direction: ltr; }
html[dir="rtl"] .rail-track .card { direction: rtl; text-align: right; }
.rail-track::-webkit-scrollbar { display: none; }
.rail-arrow {
  position: absolute; top: 0; bottom: 20px; width: 56px; padding: 0; border-radius: 0; border: none;
  background: linear-gradient(90deg, var(--bg) 0%, rgba(10,10,12,0) 100%);
  color: var(--text); display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity var(--motion-fast) var(--ease); z-index: 5;
}
.rail-arrow.next { right: 0; left: auto; background: linear-gradient(270deg, var(--bg) 0%, rgba(10,10,12,0) 100%); }
.rail-arrow.prev { left: 0; }
@media (hover: hover) { .rail-viewport:hover .rail-arrow { opacity: 1; } }
@media (hover: none) { .rail-arrow { display: none; } }
.rail-bleed { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); }

/* ============================== CARDS =====================================
   The card is a real contained SHELL — a padded, bordered, elevated box
   holding the poster on top and the title/year/rating block underneath,
   inside the SAME box. Nothing floats on transparent page background, so
   a card never visually merges with the page, its neighbor, or the hero. */
.card { flex: none; width: 198px; scroll-snap-align: start; text-decoration: none; color: inherit; display: block; }
.card .card-shell {
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-lg);
  padding: 10px 10px 14px; height: 100%;
  transition: transform var(--motion-standard) var(--ease-out), box-shadow var(--motion-standard) var(--ease-out), border-color var(--motion-standard) var(--ease-out), background var(--motion-standard) var(--ease-out);
}
.card:hover .card-shell, .card:focus-visible .card-shell { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: rgba(225,29,46,0.35); background: var(--surface-2); }
.card .poster-wrap { position: relative; aspect-ratio: 2/3; background: var(--surface-2); overflow: hidden; border-radius: var(--radius-md); }
.card .poster-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform var(--motion-slow) var(--ease-out); }
.card:hover .poster-wrap img { transform: scale(1.05); }
.card .poster-wrap .fallback {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px;
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--text-muted);
}
.card .poster-wrap .fallback .icon { width: 24px; height: 24px; opacity: 0.5; }
.card .poster-wrap .play-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, transparent 45%, rgba(8,8,10,0.6)); opacity: 0; transition: opacity var(--motion-standard) var(--ease);
}
.card:hover .poster-wrap .play-overlay, .card:focus-visible .poster-wrap .play-overlay { opacity: 1; }
.card .poster-wrap .play-overlay .icon {
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.18); backdrop-filter: blur(4px);
  color: #fff; padding: 10px; box-sizing: border-box; transform: scale(0.8); transition: transform var(--motion-standard) var(--ease-out);
}
.card:hover .poster-wrap .play-overlay .icon { transform: scale(1); }
.card .card-info { padding: 12px 3px 0; }
.card .card-title { font-size: 13.5px; font-weight: 700; color: var(--text); line-height: 1.32;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-arabic { font-family: var(--font-arabic); font-size: 12px; color: var(--text-dim); direction: rtl; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.card .card-meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.card .card-meta .chip { padding: 3px 8px; font-size: 11px; }
@media (hover: none) { .card .poster-wrap .play-overlay { display: none; } }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 28px 16px; }
.grid .card { width: 100%; min-width: 0; }

/* ============================== SKELETONS ================================= */
@keyframes skel-sweep { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.skel {
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 200% 100%; animation: skel-sweep 1.5s ease-in-out infinite; border-radius: var(--radius-md);
}
.skel-hero { aspect-ratio: 16/7.2; min-height: 440px; max-height: 760px; border-radius: 0; }
.skel-card .poster-wrap { aspect-ratio: 2/3; }
.skel-line { height: 11px; margin-top: 8px; width: 70%; border-radius: var(--radius-sm); }
.skel-rail-header { height: 19px; width: 150px; margin: 0 var(--gutter) 16px; }

/* ============================== MODALS ====================================
   One modal shell (.room-modal-backdrop/.room-modal) used by BOTH the
   per-title Watch Together modal (movie/app.js) and the global nav picker
   (shared/watch-together.js) — same visual language everywhere it opens.
   The Create/Join choice step uses two large tappable cards (icon, title,
   short description) per spec — never two plain generic buttons. */
html.sahra-modal-lock, html.sahra-modal-lock body { overflow: hidden; }
.room-modal-backdrop { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 18px; background: rgba(5,5,7,0.8); backdrop-filter: blur(10px); overscroll-behavior: contain; }
.room-modal { width: min(100%, 460px); max-height: calc(100vh - 36px); overflow: auto; background: var(--bg-elevated); border: 1px solid var(--border-soft); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); padding: 26px; }
.room-modal-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.room-modal-header h2 { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; }
.room-modal-close { width: 36px; height: 36px; padding: 0; flex: none; color: var(--text-dim); background: rgba(255,255,255,0.06); border-radius: 50%; }
.room-modal-close .icon { width: 17px; height: 17px; }
.room-modal-body { margin-top: 18px; }
.room-modal-message { margin: 0 0 20px; color: var(--text-dim); font-size: 13.5px; line-height: 1.6; }
.room-modal-actions { display: grid; gap: 12px; }
.room-modal-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px; margin-bottom: 16px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--border-soft); }
.room-modal-code strong { min-width: 0; overflow-wrap: anywhere; font: 800 26px/1 var(--font-mono); letter-spacing: 0.16em; color: var(--text); }
.room-modal-code button { flex: none; padding: 9px 14px; font-size: 12px; }
.room-modal-form { display: grid; gap: 12px; }
.room-code-input { width: 100%; min-width: 0; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); color: var(--text); font: 700 22px/1 var(--font-mono); letter-spacing: 0.22em; text-align: center; text-transform: uppercase; }
.room-code-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.room-modal-form button { width: 100%; }
.room-modal-error { margin: 10px 0 0; color: var(--danger); font-size: 12.5px; }

.wt-choice-grid { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.wt-choice-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px; text-align: start;
  padding: 20px 18px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border-soft);
  min-height: 152px; width: 100%; font: inherit; box-shadow: none;
}
.wt-choice-card:hover { transform: translateY(-3px); border-color: rgba(225,29,46,0.4); background: var(--surface-2); }
.wt-choice-card.primary, .wt-choice-card.wt-create { background: linear-gradient(165deg, rgba(225,29,46,0.18), rgba(225,29,46,0.05)); border-color: rgba(225,29,46,0.35); }
.wt-choice-card.primary:hover, .wt-choice-card.wt-create:hover { background: linear-gradient(165deg, rgba(225,29,46,0.24), rgba(225,29,46,0.08)); }
.wt-choice-icon { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.08); color: var(--text); flex: none; }
.wt-choice-card.primary .wt-choice-icon, .wt-choice-card.wt-create .wt-choice-icon { background: rgba(225,29,46,0.22); color: var(--accent-strong); }
.wt-choice-icon .icon { width: 20px; height: 20px; }
.wt-choice-text { display: flex; flex-direction: column; gap: 4px; }
.wt-choice-title { font-size: 15px; font-weight: 800; color: var(--text); }
.wt-choice-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; font-weight: 500; }

.wt-back-btn { background: transparent; padding: 0; color: var(--text-dim); font-size: 13px; font-weight: 600; gap: 6px; margin-bottom: 16px; }
.wt-back-btn:hover { color: var(--text); background: transparent; }
.wt-back-btn .icon { width: 15px; height: 15px; }

.wt-search-wrap { position: relative; margin-bottom: 16px; }
.wt-search-wrap .icon { position: absolute; inset-inline-start: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); pointer-events: none; }
.wt-search-input { width: 100%; box-sizing: border-box; padding: 13px 14px 13px 40px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-size: 14px; }
html[dir="rtl"] .wt-search-input { padding: 13px 40px 13px 14px; }
.wt-search-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.wt-results { display: flex; flex-direction: column; gap: 4px; max-height: 320px; overflow-y: auto; }
.wt-result-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-md); text-decoration: none; color: inherit; transition: background var(--motion-fast) var(--ease); }
.wt-result-row:hover, .wt-result-row:focus-visible { background: var(--surface); }
.wt-result-poster { flex: none; width: 40px; aspect-ratio: 2/3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); position: relative; }
.wt-result-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wt-result-poster .fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.wt-result-poster .fallback .icon { width: 14px; height: 14px; }
.wt-result-info { min-width: 0; flex: 1; }
.wt-result-title { font-size: 13.5px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-result-arabic { font-family: var(--font-arabic); font-size: 12px; color: var(--text-dim); direction: rtl; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wt-result-arrow { flex: none; width: 14px; height: 14px; color: var(--text-muted); }

/* ============================== PLAYER =====================================
   Custom chrome over a bare <video> — no native <video controls> anywhere
   (see shared/player.js for why: its fullscreen button would never carry
   the watermark, a DOM sibling, along with it). */
.player-frame.sahra-player {
  position: relative; background: #000; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg); aspect-ratio: 16/9; outline: none;
}
.sahra-video { width: 100%; height: 100%; background: #000; display: block; object-fit: contain; }
.player-frame.sahra-fullscreen {
  position: fixed; inset: 0; z-index: 9999; border-radius: 0; width: 100vw; height: 100vh; aspect-ratio: auto;
}
html.sahra-fs-lock, html.sahra-fs-lock body { overflow: hidden; }

.player-watermark {
  position: absolute; top: 20px; inset-inline-end: 20px; width: 7%; min-width: 26px; max-width: 56px;
  pointer-events: none; user-select: none; z-index: 6; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}
@media (max-width: 700px) { .player-watermark { top: 10px; inset-inline-end: 10px; min-width: 22px; max-width: 36px; } }

.player-big-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); z-index: 5;
  width: 76px; height: 76px; border-radius: 50%; padding: 0; background: rgba(10,10,12,0.5);
  backdrop-filter: blur(4px); color: #fff; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.14);
  transition: background var(--motion-fast) var(--ease), transform var(--motion-fast) var(--ease-out);
}
.player-big-play .icon { width: 30px; height: 30px; margin-left: 3px; }
.player-big-play:hover { background: rgba(225,29,46,0.55); transform: translate(-50%, -50%) scale(1.06); }

.player-overlay {
  position: absolute; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  background: rgba(8,8,9,0.92); color: var(--text-dim); text-align: center; padding: 24px;
}
.player-overlay .spinner {
  width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.player-overlay h3 { margin: 0; font-weight: 700; font-size: 16px; color: var(--text); }
.player-overlay p { margin: 0; font-size: 13px; max-width: 320px; }
.player-overlay .icon { width: 28px; height: 28px; color: var(--danger); }

/* -------- custom control bar -------- */
.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; padding: 30px 14px 10px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
  opacity: 0; transform: translateY(6px); pointer-events: none;
  transition: opacity var(--motion-standard) var(--ease), transform var(--motion-standard) var(--ease);
}
.sahra-player.controls-visible .player-controls,
.sahra-player:not(.controls-visible) .pc-menu[style*="flex"] { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sahra-player:not(.controls-visible) { cursor: none; }
.sahra-player:not(.controls-visible) .player-big-play { cursor: pointer; }

.pc-progress-row { padding: 0 2px 8px; }
.pc-progress-wrap { position: relative; height: 14px; display: flex; align-items: center; }
.pc-buffered { position: absolute; left: 0; height: 3px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.28); width: 0; pointer-events: none; }
.pc-progress {
  -webkit-appearance: none; appearance: none; width: 100%; height: 3px; background: transparent; margin: 0; position: relative; z-index: 1;
}
.pc-progress::-webkit-slider-runnable-track { height: 3px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.18); }
.pc-progress::-moz-range-track { height: 3px; border-radius: var(--radius-pill); background: rgba(255,255,255,0.18); }
.pc-progress::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--accent-strong); margin-top: -5px;
  box-shadow: 0 0 0 4px rgba(225,29,46,0.2); transition: transform var(--motion-fast) var(--ease);
}
.pc-progress::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--accent-strong); border: none; }
.pc-progress:hover::-webkit-slider-thumb, .pc-progress:focus-visible::-webkit-slider-thumb { transform: scale(1.25); }
.pc-progress { background: transparent; }

.pc-row { display: flex; align-items: center; gap: 4px; }
.pc-btn {
  background: transparent; border: none; color: #fff; width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center; flex: none; transition: background var(--motion-fast) var(--ease);
}
.pc-btn:hover { background: rgba(255,255,255,0.14); }
.pc-btn .icon { width: 18px; height: 18px; }
.pc-btn.pc-skip .icon { width: 20px; height: 20px; }
.pc-btn.pc-text { width: auto; padding: 0 9px; font-size: 12.5px; font-weight: 700; }
.pc-time { color: rgba(255,255,255,0.85); font-size: 12px; font-variant-numeric: tabular-nums; margin-left: 4px; white-space: nowrap; }
.pc-spacer { flex: 1; }
.pc-vol { display: flex; align-items: center; gap: 2px; }
.pc-vol-slider { -webkit-appearance: none; appearance: none; width: 0; height: 3px; background: rgba(255,255,255,0.25); border-radius: var(--radius-pill); margin: 0; transition: width var(--motion-standard) var(--ease); overflow: hidden; }
.pc-vol:hover .pc-vol-slider, .pc-vol-slider:focus-visible { width: 64px; }
.pc-vol-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.pc-vol-slider::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: #fff; border: none; }

.pc-menu {
  position: absolute; bottom: 54px; inset-inline-end: 14px; z-index: 8; background: rgba(20,20,23,0.97); backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft); border-radius: var(--radius-md); padding: 6px; flex-direction: column; gap: 1px; min-width: 108px; box-shadow: var(--shadow-md);
}
.pc-menu button { background: transparent; padding: 8px 12px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); border-radius: var(--radius-sm); justify-content: flex-start; }
.pc-menu button:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.pc-menu button.active { color: var(--text); background: rgba(225,29,46,0.18); }

/* ============================== FOOTER ===================================== */
.site-footer { padding: var(--space-xl) var(--gutter) var(--space-xxl); color: var(--text-muted); font-size: 12px; text-align: center; margin-top: var(--space-xl); }

/* ============================== RESPONSIVE ================================
   ONE responsive token (--gutter) drives every full-bleed shell's edge, so
   nav/hero/rails/wrap can never drift out of alignment from each other at
   any breakpoint the way three separately-hardcoded values could. */
@media (max-width: 1024px) {
  :root { --gutter: 28px; }
}
@media (max-width: 700px) {
  :root { --gutter: 18px; }
  .site-nav { height: 62px; }
  .site-nav.scrolled { height: 58px; }
  .hero.has-image { aspect-ratio: auto; min-height: 0; max-height: none; height: 78vh; }
  .hero.has-image { min-height: 500px; }
  .hero.has-image .hero-img { position: absolute; inset: 0; }
  .hero.has-image::after { background: linear-gradient(180deg, rgba(10,10,12,0.12) 0%, rgba(10,10,12,0.55) 50%, var(--bg) 97%); }
  .hero.no-image { padding: 96px 0 var(--space-xl); }
  .hero.has-image .hero-content { padding-bottom: 26px; }
  .hero-content.with-poster { grid-template-columns: 96px minmax(0, 1fr); align-items: end; gap: 14px; text-align: start; }
  .hero-poster { width: 96px; border-radius: var(--radius-md); }
  .hero-content h1 { font-size: clamp(26px, 8vw, 40px); }
  .hero-content .actions { justify-content: flex-start; }
  .hero-dots { bottom: 14px; }
  .rail-header h2 { font-size: 17px; }
  .card { width: 144px; }
  .card .card-shell { padding: 8px 8px 12px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
  .wt-choice-grid { grid-template-columns: 1fr; }
  .room-modal { padding: 20px; }
  .player-controls { padding: 22px 8px 8px; }
  .pc-btn { width: 40px; height: 40px; }
  .pc-time { font-size: 11px; }
  .pc-vol { display: none; } /* touch devices control volume via hardware buttons */
  .player-big-play { width: 62px; height: 62px; }
  .pc-row { min-width: 0; flex-wrap: wrap; }
  .pc-spacer { min-width: 8px; }
  .pc-btn.pc-text { padding-left: 5px; padding-right: 5px; font-size: 11px; }
  .pc-time { max-width: 76px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 420px) {
  .hero.has-image { min-height: 460px; }
  .hero-content.with-poster { grid-template-columns: 80px minmax(0, 1fr); gap: 12px; }
  .hero-poster { width: 80px; }
  .hero-content h1 { font-size: 26px; }
  .hero-content p.desc { display: none; }
  .card { width: 134px; }
  .room-modal-code strong { font-size: 21px; }
}
@media (hover: none) {
  .pc-btn { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 1ms !important; transition-duration: 1ms !important; }
}
