:root {
  --bg: #0c0e12;
  --panel: #14171e;
  --panel-2: #1a1e27;
  --line: #262b36;
  --text: #e8eaee;
  --muted: #8a91a0;
  --accent: #e5a00d;   /* Plex amber */
  --accent-2: #5865f2; /* Discord blurple */
  --ok: #3ecf7a;
  --bad: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(1200px 600px at 70% -10%, #171b24 0%, var(--bg) 60%);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(20, 23, 30, 0.6);
  backdrop-filter: blur(8px);
  position: relative;
  z-index: 100; /* lift the header (and the health popover) above the library panel below */
}
.brand { font-size: 15px; font-weight: 700; letter-spacing: .2px; }
.logo { color: var(--accent); margin-right: 4px; }
#status { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.pill {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  font-size: 12px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#conn.ok { color: var(--ok); border-color: #1e4030; }
#conn.bad { color: var(--bad); border-color: #4a2626; }
#role.host { color: #14171e; background: var(--accent); border-color: var(--accent); font-weight: 700; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px var(--ok); }

/* Layout */
main {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  padding: 18px;
  flex: 1;
  min-height: 0;
}
#stage { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* Participants */
.participants { display: flex; flex-wrap: wrap; gap: 6px; }
.participants:empty { display: none; }
.person {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 11px 3px 3px; font-size: 12px; color: var(--text); max-width: 200px;
}
.person .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person .av {
  position: relative; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #fff; background: var(--accent-2); overflow: hidden;
}
.person .av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.person.host { border-color: var(--accent); }
.person.host .name::after { content: " 👑"; }
.person { position: relative; }
.sync-badge { font-size: 10px; margin-left: 3px; white-space: nowrap; }
/* Per-viewer stream-health popover (connection / buffer / lag / stalls) on participant hover */
.pnet { position: absolute; top: calc(100% + 7px); left: 0; z-index: 90; min-width: 200px; padding: 9px 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 11px; box-shadow: 0 14px 34px rgba(0, 0, 0, .55); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .15s ease, transform .15s ease, visibility .15s; pointer-events: none; }
.person:hover .pnet { opacity: 1; visibility: visible; transform: translateY(0); }
.pnet-row { display: flex; align-items: center; gap: 7px; padding: 3px 0; font-size: 12px; color: var(--muted); }
.pnet-row .pnet-val { margin-left: auto; color: var(--text); font-weight: 600; }
.pnet-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.pnet-dot.good { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.pnet-dot.tight { background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.pnet-dot.low { background: var(--bad); box-shadow: 0 0 7px var(--bad); }
.pnet-dot.unknown { background: var(--muted); opacity: .5; }
.pnet-foot { margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text); }

/* Custom control bar (overlay at the bottom of the video) */
.controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 22px 16px 12px;
  background: linear-gradient(180deg, transparent, rgba(6, 8, 11, 0.85));
  opacity: 0; transition: opacity .2s;
}
.controls.hidden { display: none; }
.video-wrap:hover .controls, .controls.show { opacity: 1; }
.c-btn {
  background: transparent; border: none; color: #fff;
  cursor: pointer; padding: 4px 6px; border-radius: 6px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.c-btn:hover { color: var(--accent); }
.c-btn svg { width: 21px; height: 21px; display: block; }

/* Inline SVG icon defaults (replaces the old per-platform emoji) */
button svg, .ico svg, .search-ico svg { display: block; }
.ico { display: inline-flex; align-items: center; color: var(--muted); }
.c-time { font-variant-numeric: tabular-nums; font-size: 12px; color: #cfd3db; min-width: 46px; }
#c-dur { text-align: right; }
.c-track { position: relative; flex: 1; height: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); cursor: pointer; }
.c-buffered { position: absolute; inset: 0 auto 0 0; width: 0; background: rgba(255, 255, 255, 0.3); border-radius: 999px; }
.c-fill { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--accent), #ffca4b); border-radius: 999px; }
.c-handle {
  position: absolute; top: 50%; left: 0; transform: translate(-50%, -50%);
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.6); opacity: 0; transition: opacity .12s;
}
.c-track:hover .c-handle, .c-track.dragging .c-handle { opacity: 1; }
.controls.guest .c-track { cursor: default; }
.controls.guest .c-play { opacity: .45; cursor: default; }

/* Scrubber hover preview (thumbnail + timestamp above the cursor) */
.c-preview {
  position: absolute; bottom: 58px; transform: translateX(-50%);
  background: #0b0d12; border: 1px solid var(--line); border-radius: 9px;
  padding: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .55);
  pointer-events: none; z-index: 8;
}
.c-preview.hidden { display: none; }
.c-preview img { display: block; width: 164px; height: 92px; object-fit: cover; border-radius: 6px; background: #000; }
.c-preview span { display: block; text-align: center; font-variant-numeric: tabular-nums; font-size: 11px; font-weight: 600; color: #cfd3db; margin-top: 3px; }
.c-vol {
  -webkit-appearance: none; appearance: none;
  width: 76px; height: 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.25); cursor: pointer; outline: none; flex-shrink: 0;
}
.c-vol::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; cursor: pointer; }
.c-vol::-moz-range-thumb { width: 12px; height: 12px; border: none; border-radius: 50%; background: #fff; cursor: pointer; }
@media (max-width: 560px) { .c-vol { display: none; } }

/* Chapter ticks on the scrubber (non-interactive overlay so seeking still works) */
.c-chapters { position: absolute; inset: 0; pointer-events: none; border-radius: 999px; overflow: hidden; }
.c-tick { position: absolute; top: 0; bottom: 0; width: 2px; transform: translateX(-1px); background: rgba(10, 12, 17, 0.9); }

/* Chapters button + jump-to popover */
.c-btn.hidden { display: none; }
.chapter-menu {
  position: absolute; right: 12px; bottom: 64px; z-index: 9;
  width: 288px; max-height: 48%; overflow-y: auto;
  background: #0b0d12; border: 1px solid var(--line); border-radius: 12px;
  padding: 6px; box-shadow: 0 12px 34px rgba(0, 0, 0, .6);
}
.chapter-menu.hidden { display: none; }
.chp-head { font-size: 12px; font-weight: 700; color: var(--muted); padding: 6px 8px 8px; letter-spacing: .3px; }
.chp-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: transparent; border: none; color: var(--text); cursor: pointer;
  padding: 7px 8px; border-radius: 8px; text-align: left; font-size: 13px;
}
.chp-item:hover { background: var(--panel-2); }
.chp-item.active { background: rgba(229, 160, 13, .14); }
.chp-item.active .chp-n { color: var(--accent); }
.chp-n { flex: 0 0 22px; text-align: center; font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); }
.chp-t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chp-time { flex: 0 0 auto; font-variant-numeric: tabular-nums; font-size: 11px; color: var(--muted); }

/* Skip intro / skip credits ("Next") button — bottom-right, above the controls */
.skip-btn {
  position: absolute; right: 16px; bottom: 72px; z-index: 7;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px; cursor: pointer; overflow: hidden;
  background: rgba(11, 13, 18, 0.82); color: #fff; font-weight: 600; font-size: 14px;
  border: 1px solid rgba(255, 255, 255, 0.45); backdrop-filter: blur(4px);
  /* resting (pre-entrance / exited) state: faded and nudged down, click-through */
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s ease, transform .3s cubic-bezier(.22, .61, .36, 1), background .15s, border-color .15s, color .15s;
}
.skip-btn.skip-in { opacity: 1; transform: translateY(0); pointer-events: auto; }
.skip-btn.skip-out { opacity: 0; transform: translateY(12px); pointer-events: none; }
.skip-btn.skip-in:hover { background: var(--accent); color: #10141b; border-color: var(--accent); transform: translateY(-2px); }
.skip-btn.hidden { display: none; }
/* Countdown "fuel gauge": a subtle lighter fill spanning the button that drains over
   the auto-hide window (--skip-dur, set from JS), so the background gets progressively
   darker as the time-left runs out — then the button dismisses. */
.skip-btn .skip-label, .skip-btn .skip-ico { position: relative; z-index: 1; }
.skip-btn::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: rgba(255, 255, 255, 0.16);
  transform-origin: left center; transform: scaleX(1);
}
.skip-btn.skip-in::before { animation: skip-timeleft var(--skip-dur, 5000ms) linear forwards; }
@keyframes skip-timeleft { from { transform: scaleX(1); } to { transform: scaleX(0); } }
@media (prefers-reduced-motion: reduce) { .skip-btn.skip-in::before { animation: none; } }
.skip-btn .skip-ico svg { width: 16px; height: 16px; display: block; }
body.maximized .skip-btn { bottom: 92px; }
body.maximized .chapter-menu { bottom: 84px; }

.video-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
}
video { width: 100%; height: 100%; display: block; background: #000; }

/* Maximized ("fullscreen") — CSS-based so it works inside the Discord iframe */
body.maximized { overflow: hidden; }
body.maximized .video-wrap {
  position: fixed; inset: 0; z-index: 1000;
  width: 100vw; height: 100vh; aspect-ratio: auto;
  border: none; border-radius: 0; background: #000;
}
body.maximized video { object-fit: contain; }

/* Loading / buffering spinner */
.spinner {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(6, 8, 11, 0.5);
  transition: opacity .2s;
}
.spinner.hidden { opacity: 0; pointer-events: none; }
.spinner .ring {
  width: 46px; height: 46px; border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.14);
  border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
#spinner-label { font-size: 13px; color: var(--muted); letter-spacing: .3px; text-align: center; max-width: 82vw; }
/* Head-segment warm-up progress bar (shown under the spinner while the encoder builds its lead). */
.warm-bar { width: min(240px, 62vw); height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.14); overflow: hidden; }
.warm-bar.hidden { display: none; }
.warm-fill { height: 100%; width: 0%; background: var(--accent); border-radius: 999px; transition: width .35s ease; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Subtitles: custom overlay rendered from cues (per-user, local). Pinned at a FIXED offset above the
   controls bar so the vertical position never jumps (the old native <track> rendering bounced). */
.subs-overlay {
  position: absolute; left: 0; right: 0; bottom: max(56px, 8%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 0 6%; text-align: center; pointer-events: none; z-index: 6;
}
.subs-overlay.hidden { display: none; }
.subs-overlay .sub-line {
  background: rgba(0, 0, 0, 0.55); color: #fff;
  font-size: clamp(15px, 2.9vw, 30px); line-height: 1.32; font-weight: 500;
  padding: 1px 10px; border-radius: 5px; white-space: pre-wrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
}

/* Idle overlay */
.idle {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  background: linear-gradient(180deg, #10131a, #0a0c10);
  color: var(--muted);
  transition: opacity .3s;
}
.idle.hidden { opacity: 0; pointer-events: none; }
.idle-inner { text-align: center; }
.idle-icon { font-size: 44px; margin-bottom: 8px; opacity: .8; }

/* Now-playing bar */
.nowbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 12px;
}
.nowbar.hidden { display: none; }
#np-poster {
  width: 46px; height: 68px;
  object-fit: cover; border-radius: 6px;
  background: #000; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.np-meta { flex: 1; min-width: 0; }
.np-title { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-sub { color: var(--muted); font-size: 12px; margin-top: 1px; }
.np-progress { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.np-time { font-variant-numeric: tabular-nums; font-size: 12px; color: var(--muted); min-width: 42px; }
.np-time:last-child { text-align: right; }
.track {
  flex: 1; height: 6px; border-radius: 999px;
  background: #2a2f3a; overflow: hidden;
}
.fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), #ffca4b); border-radius: 999px; transition: width .25s linear; }

/* Track / quality controls */
.track-controls {
  display: flex; flex-wrap: wrap; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-radius: 12px;
}
.track-controls.hidden { display: none; }
.track-controls label {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--muted); flex: 1; min-width: 150px;
}
.track-controls .ico svg { width: 16px; height: 16px; }
.track-controls select {
  flex: 1; min-width: 0; height: 34px; padding: 0 28px 0 10px;
  background-color: #0d0f13; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 13px; cursor: pointer;
}
.track-controls select:hover { border-color: var(--accent); }

.host-btn {
  background: var(--panel); color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.host-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Library */
#library {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex; flex-direction: column; min-height: 0;
  overflow: hidden;
}
.lib-head { padding: 12px; border-bottom: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }

/* Search row: input grows, the dice + reload buttons sit inline on the right. */
.search-wrap { position: relative; display: flex; align-items: center; gap: 8px; }
.search-ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); display: inline-flex; color: var(--muted); pointer-events: none; z-index: 1; }
.search-ico svg { width: 16px; height: 16px; }
#search {
  flex: 1; min-width: 0; height: 38px; box-sizing: border-box;
  padding: 0 12px 0 34px;
  background: #0d0f13; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; font: inherit;
  outline: none;
}
#search:focus { border-color: var(--accent); }

/* Two equal columns per row so both select rows line up exactly. */
.lib-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.lib-count-row { display: block; }

/* Unified control look. Selects get a custom chevron so every dropdown matches
   across platforms (no OS-default arrow). */
select {
  width: 100%; height: 38px; box-sizing: border-box;
  padding: 0 30px 0 11px;
  background-color: #0d0f13; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; font: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238a91a0' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  text-overflow: ellipsis;
}
select:hover, select:focus { border-color: var(--accent); outline: none; }
#surprise, #reload {
  flex: 0 0 auto; width: 38px; height: 38px; box-sizing: border-box;
  display: inline-flex; align-items: center; justify-content: center;
  background: #0d0f13; color: var(--text);
  border: 1px solid var(--line); border-radius: 9px; cursor: pointer;
}
#reload:hover, #surprise:hover { border-color: var(--accent); color: var(--accent); }
#surprise svg, #reload svg { width: 17px; height: 17px; }

#items { list-style: none; margin: 0; padding: 6px; overflow-y: auto; flex: 1; }
#items li {
  display: flex; gap: 11px; align-items: center;
  padding: 7px; border-radius: 9px; cursor: pointer;
  transition: background .12s;
}
#items li:hover { background: var(--panel-2); }
#items li.active { background: rgba(229,160,13,.14); outline: 1px solid rgba(229,160,13,.4); }
#items li.active .t::after {
  content: "▶ playing"; margin-left: 8px; font-size: 10px; font-weight: 700;
  color: var(--accent); letter-spacing: .4px; vertical-align: middle;
}
.lib-count { font-size: 11px; color: var(--muted); padding-left: 2px; }

/* TV browse: shows → seasons → episodes */
.tv-nav { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.tv-nav.hidden { display: none; }
.tv-back { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font: inherit; font-size: 12px; cursor: pointer; flex-shrink: 0; }
.tv-back:hover { border-color: var(--accent); color: var(--accent); }
.tv-crumb { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#items li.tv-container .tv-chevron { margin-left: auto; color: var(--muted); font-size: 20px; padding: 0 6px; }
/* In a TV library, hide the movie-only controls */
body.tv-mode #filter, body.tv-mode #genre, body.tv-mode #sort, body.tv-mode #surprise { display: none; }
body.tv-mode #sections { grid-column: 1 / -1; }
#items img { width: 42px; height: 63px; object-fit: cover; border-radius: 5px; background: #000; flex-shrink: 0; }
#items .meta { min-width: 0; }
#items .t { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#items .y { color: var(--muted); font-size: 12px; }
#items .rating { display: flex; gap: 6px; margin-top: 3px; min-height: 13px; }
.rt { font-size: 10px; font-weight: 700; padding: 1px 5px; border-radius: 4px; line-height: 1.4; white-space: nowrap; }
.rt.kp { background: rgba(255, 106, 0, 0.18); color: #ff8c3a; }
.rt.imdb { background: rgba(245, 197, 24, 0.16); color: #f5c518; }
#items li { position: relative; }
#items .seen { color: var(--ok); font-size: 11px; }
.li-progress { height: 3px; border-radius: 999px; background: #2a2f3a; margin-top: 4px; overflow: hidden; max-width: 160px; }
.li-progress > div { height: 100%; background: var(--accent); }
.info-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  opacity: 0; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); color: var(--text);
  cursor: pointer; transition: opacity .12s, border-color .12s, color .12s;
  display: inline-flex; align-items: center; justify-content: center;
}
.info-btn svg { width: 15px; height: 15px; }
#items li:hover .info-btn { opacity: 1; }
.info-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Details modal */
.details-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); padding: 20px; }
.details-modal.hidden { display: none; }
.details-card { display: flex; gap: 22px; max-width: 760px; width: 100%; max-height: 84vh; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 22px; position: relative; overflow: auto; box-shadow: 0 24px 70px rgba(0,0,0,.55); }
.details-close { position: absolute; right: 14px; top: 14px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 15px; cursor: pointer; z-index: 1; }
.details-close:hover { color: var(--text); border-color: var(--accent); }
.details-poster { width: 210px; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 12px; background: #000; flex-shrink: 0; box-shadow: 0 8px 26px rgba(0,0,0,.5); }
.details-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.details-body h2 { margin: 0 0 12px; font-size: 22px; line-height: 1.2; padding-right: 34px; }
.details-meta { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.d-rt { display: flex; gap: 8px; }
.rt.lg { font-size: 13px; padding: 4px 11px; border-radius: 8px; }
.d-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.d-chip { font-size: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-radius: 999px; padding: 3px 11px; color: #c3c9d4; }
.details-genres { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.genre { font-size: 11px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; color: var(--muted); }
.details-desc { font-size: 14px; line-height: 1.6; color: #d3d7de; margin: 0 0 18px; }
.details-actions { margin-top: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.details-play { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #14171e; border: none; border-radius: 11px; padding: 11px 22px; font: inherit; font-weight: 700; cursor: pointer; }
.details-play:hover { filter: brightness(1.08); }
.details-play svg { width: 16px; height: 16px; }
.details-shuffle { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 11px; padding: 11px 16px; font: inherit; font-weight: 600; cursor: pointer; }
.details-shuffle:hover { border-color: var(--accent); color: var(--accent); }
.details-shuffle.hidden { display: none; }
.details-shuffle svg { width: 16px; height: 16px; }
.details-like { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 11px; padding: 11px 15px; font: inherit; font-weight: 600; cursor: pointer; }
.details-like:hover { border-color: #ff6b6b; color: #ff6b6b; }
.details-like svg { width: 17px; height: 17px; }
.details-like.liked { background: rgba(255, 107, 107, .14); border-color: #ff6b6b; color: #ff6b6b; }
.details-likers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.details-likers:empty { display: none; }
.details-likers img, .details-likers .lk-init { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); }
.details-likers .lk-init { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 700; }

/* Like count badge on library rows */
.li-like { display: inline-flex; align-items: center; gap: 3px; margin-top: 4px; font-size: 11px; font-weight: 700; color: #ff6b6b; }
.li-like svg { width: 12px; height: 12px; }

.details-queue { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 11px; padding: 11px 15px; font: inherit; font-weight: 600; cursor: pointer; }
.details-queue:hover { border-color: var(--accent); color: var(--accent); }
.details-queue svg { width: 16px; height: 16px; }

/* Watch-later ("посмотреть позже") button in the details card */
.details-later { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 11px; padding: 11px 15px; font: inherit; font-weight: 600; cursor: pointer; }
.details-later:hover { border-color: var(--accent); color: var(--accent); }
.details-later svg { width: 16px; height: 16px; }
.details-later.saved { background: rgba(229, 160, 13, .14); border-color: var(--accent); color: var(--accent); }

/* Add-to-queue button on library rows (left of the info button) */
.queue-btn { position: absolute; right: 38px; top: 50%; transform: translateY(-50%); opacity: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: opacity .12s, border-color .12s, color .12s; }
.queue-btn svg { width: 15px; height: 15px; }
#items li:hover .queue-btn { opacity: 1; }
.queue-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Watch-later button on library rows (left of the queue button) */
.later-btn { position: absolute; right: 68px; top: 50%; transform: translateY(-50%); opacity: 0; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, 0.5); border: 1px solid var(--line); color: var(--text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: opacity .12s, border-color .12s, color .12s; }
.later-btn svg { width: 14px; height: 14px; }
#items li:hover .later-btn { opacity: 1; }
.later-btn:hover { border-color: var(--accent); color: var(--accent); }
#items li.saved .later-btn { color: var(--accent); }
/* Saved rows get a subtle accent bar on the left (visible without hovering) */
#items li.saved { box-shadow: inset 3px 0 0 var(--accent); }

/* Queue ("up next") panel */
.queue-panel { border-bottom: 1px solid var(--line); padding: 10px 12px; background: rgba(229, 160, 13, 0.05); }
.queue-panel.hidden { display: none; }
.queue-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.queue-title { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; font-size: 12px; font-weight: 700; letter-spacing: .3px; }
.queue-title .ico { color: var(--accent); }
.queue-title .ico svg { width: 15px; height: 15px; }
#queue-count { color: var(--muted); font-weight: 600; }
.queue-vote { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; background: transparent; border: 1px solid var(--line); border-radius: 7px; color: var(--text); cursor: pointer; }
.queue-vote.hidden { display: none; }
.queue-vote svg { width: 14px; height: 14px; }
.queue-vote:hover { border-color: var(--accent); color: var(--accent); }
.queue-next { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 24px; background: transparent; border: 1px solid var(--line); border-radius: 7px; color: var(--text); cursor: pointer; }
.queue-next.hidden { display: none; }
.queue-next svg { width: 13px; height: 13px; }
.queue-next:hover { border-color: var(--accent); color: var(--accent); }
.queue-clear { background: transparent; border: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 2px 4px; }
.queue-clear:hover { color: var(--bad); }
#queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; max-height: 190px; overflow-y: auto; }
#queue-list li { display: flex; align-items: center; gap: 9px; padding: 4px; border-radius: 8px; }
#queue-list li:hover { background: var(--panel-2); }
#queue-list img { width: 30px; height: 45px; object-fit: cover; border-radius: 4px; background: #000; flex-shrink: 0; }
.q-meta { min-width: 0; flex: 1; }
.q-t { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-y { color: var(--muted); font-weight: 400; }
.q-by { font-size: 11px; color: var(--muted); }
.q-del { background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; opacity: 0; }
#queue-list li:hover .q-del { opacity: 1; }
.q-del:hover { color: var(--bad); }

/* Trailer button in the details card */
.details-trailer { display: inline-flex; align-items: center; gap: 7px; background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 11px; padding: 11px 15px; font: inherit; font-weight: 600; cursor: pointer; }
.details-trailer.hidden { display: none; }
.details-trailer:hover { border-color: var(--accent); color: var(--accent); }
.details-trailer svg { width: 16px; height: 16px; }

/* Voting modal */
.vote-modal { position: fixed; inset: 0; z-index: 2500; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.72); backdrop-filter: blur(4px); padding: 20px; }
.vote-modal.hidden { display: none; }
.vote-card { width: 100%; max-width: 640px; max-height: 84vh; overflow: auto; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.vote-head { display: flex; align-items: center; margin-bottom: 16px; }
.vote-title { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 700; }
.vote-title .ico { color: var(--accent); }
.vote-title .ico svg { width: 20px; height: 20px; }
.vote-x { margin-left: auto; background: rgba(0, 0, 0, .35); border: 1px solid var(--line); border-radius: 50%; width: 30px; height: 30px; color: var(--muted); cursor: pointer; font-size: 14px; }
.vote-x.hidden { display: none; }
.vote-x:hover { color: var(--text); border-color: var(--accent); }
.vote-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.vote-cand { display: flex; gap: 10px; align-items: center; text-align: left; padding: 8px; background: #0d0f13; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; color: var(--text); transition: border-color .12s, background .12s; }
.vote-cand:hover { border-color: var(--accent); }
.vote-cand.mine { border-color: var(--accent); background: rgba(229, 160, 13, .12); }
.vote-cand img { width: 40px; height: 60px; object-fit: cover; border-radius: 6px; background: #000; flex-shrink: 0; }
.vc-body { flex: 1; min-width: 0; }
.vc-t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vc-y { color: var(--muted); font-weight: 400; }
.vc-bar { height: 5px; border-radius: 999px; background: #2a2f3a; margin-top: 6px; overflow: hidden; }
.vc-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), #ffca4b); transition: width .3s; }
.vc-n { font-size: 16px; font-weight: 800; color: var(--accent); min-width: 20px; text-align: center; }
.vote-foot { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.vote-info { color: var(--muted); font-size: 13px; }
.vote-end { margin-left: auto; background: var(--accent); color: #14171e; border: none; border-radius: 10px; padding: 9px 18px; font: inherit; font-weight: 700; cursor: pointer; }
.vote-end.hidden { display: none; }
.vote-end:hover { filter: brightness(1.08); }

/* Trailer modal */
.trailer-modal { position: fixed; inset: 0; z-index: 2600; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.85); padding: 20px; }
.trailer-modal.hidden { display: none; }
.trailer-card { width: 100%; max-width: 900px; position: relative; }
.trailer-close { position: absolute; right: -4px; top: -38px; background: rgba(0, 0, 0, .5); border: 1px solid var(--line); border-radius: 50%; width: 32px; height: 32px; color: #fff; cursor: pointer; font-size: 15px; }
.trailer-close:hover { border-color: var(--accent); color: var(--accent); }
.trailer-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.trailer-frame iframe, .trailer-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; object-fit: contain; }
.trailer-ext { display: inline-block; margin-top: 10px; color: var(--muted); font-size: 13px; text-decoration: none; }
.trailer-ext:hover { color: var(--accent); }

/* Keyboard shortcuts help */
.sc-btn { width: 26px; height: 26px; border-radius: 50%; background: var(--panel); color: var(--muted); border: 1px solid var(--line); font-weight: 700; cursor: pointer; flex-shrink: 0; }
.sc-btn:hover { border-color: var(--accent); color: var(--accent); }
.sc-modal { position: fixed; inset: 0; z-index: 2700; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); padding: 20px; }
.sc-modal.hidden { display: none; }
.sc-card { position: relative; width: 100%; max-width: 400px; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.sc-card h3 { margin: 0 0 14px; font-size: 17px; }
.sc-close { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer; }
.sc-close:hover { color: var(--text); border-color: var(--accent); }
.sc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.sc-list li { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #d3d7de; }
.sc-keys { flex: 0 0 92px; display: flex; gap: 5px; }
.sc-list em { color: var(--muted); font-style: normal; font-size: 11px; }
kbd { display: inline-block; min-width: 16px; text-align: center; padding: 2px 6px; background: #0d0f13; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; font: 600 11px/1.4 ui-monospace, "SF Mono", monospace; color: var(--text); }
.sc-hint { margin: 14px 0 0; font-size: 12px; color: var(--muted); }

/* Party stats */
.stats-btn { width: 26px; height: 26px; border-radius: 50%; background: var(--panel); color: var(--muted); border: 1px solid var(--line); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stats-btn:hover { border-color: var(--accent); color: var(--accent); }
.stats-btn:hover .ico { color: var(--accent); }
.stats-btn .ico svg { width: 15px; height: 15px; }
.stats-modal { position: fixed; inset: 0; z-index: 2700; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); padding: 20px; }
.stats-modal.hidden { display: none; }
.stats-card { position: relative; width: 100%; max-width: 460px; max-height: 84vh; overflow: auto; background: linear-gradient(180deg, var(--panel-2), var(--panel)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.stats-card h3 { margin: 0 0 16px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.stats-card h3 .ico { color: var(--accent); }
.stats-card h3 .ico svg { width: 18px; height: 18px; }
.stats-close { position: absolute; right: 12px; top: 12px; width: 28px; height: 28px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 50%; color: var(--muted); cursor: pointer; }
.stats-close:hover { color: var(--text); border-color: var(--accent); }
.stats-body { display: flex; flex-direction: column; gap: 18px; }
.stats-loading { color: var(--muted); font-size: 13px; text-align: center; padding: 12px; }
.stat-totals { display: flex; gap: 10px; }
.stat-tile { flex: 1; background: #0d0f13; border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-lbl { font-size: 11px; color: var(--muted); margin-top: 5px; }
.stat-sec h4 { margin: 0 0 9px; font-size: 13px; color: #c3c9d4; font-weight: 700; }
.stat-liked { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: rank; }
.stat-liked li { display: flex; align-items: center; gap: 9px; counter-increment: rank; }
.stat-liked li::before { content: counter(rank); flex: 0 0 16px; text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.stat-liked img { width: 26px; height: 39px; object-fit: cover; border-radius: 4px; background: #000; flex-shrink: 0; }
.sl-t { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sl-n { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #ff6b6b; }
.sl-n svg { width: 12px; height: 12px; }
.stat-likers { display: flex; flex-direction: column; gap: 7px; }
.stat-liker { display: flex; align-items: center; gap: 9px; }
.stat-liker img, .stat-liker .sl-init { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; border: 1px solid var(--line); flex-shrink: 0; }
.stat-liker .sl-init { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-2); color: #fff; font-size: 11px; font-weight: 700; }
.skr-n { flex: 1; min-width: 0; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skr-c { font-size: 13px; font-weight: 800; color: var(--accent); }
.stat-genres { display: flex; flex-direction: column; gap: 7px; }
.stat-genre { display: flex; align-items: center; gap: 9px; }
.sg-n { flex: 0 0 96px; font-size: 12px; color: #c3c9d4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sg-bar { flex: 1; height: 7px; border-radius: 999px; background: #2a2f3a; overflow: hidden; }
.sg-bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ffca4b); }
.sg-c { font-size: 12px; font-weight: 700; color: var(--muted); min-width: 16px; text-align: right; }

/* Text chat */
.chat-btn { width: 26px; height: 26px; border-radius: 50%; background: var(--panel); color: var(--muted); border: 1px solid var(--line); cursor: pointer; position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-btn:hover { border-color: var(--accent); color: var(--accent); }
.chat-btn .ico svg { width: 15px; height: 15px; }

/* --- Header system-health dot + hover popover --- */
.health-wrap { position: relative; display: inline-flex; align-items: center; }
.health-btn { width: 26px; height: 26px; border-radius: 50%; background: var(--panel); color: var(--muted); border: 1px solid var(--line); cursor: default; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; transition: color .25s, border-color .25s; }
.health-btn .ico svg { width: 15px; height: 15px; }
.health-btn.ok   { color: var(--ok); }
.health-btn.warn { color: var(--accent); }
.health-btn.down { color: var(--bad); border-color: var(--bad); animation: healthPulse 1.5s ease-in-out infinite; }
@keyframes healthPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .5); } 70% { box-shadow: 0 0 0 6px rgba(255, 107, 107, 0); } }

.health-pop { position: absolute; top: 34px; left: 0; z-index: 60; min-width: 232px; padding: 10px 10px 8px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 14px 36px rgba(0, 0, 0, .5); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity .16s ease, transform .16s ease, visibility .16s; pointer-events: none; }
.health-wrap:hover .health-pop, .health-btn:focus-visible + .health-pop { opacity: 1; visibility: visible; transform: translateY(0); }
.hp-title { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 0 2px 8px; }
.hp-row { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; line-height: 1.2; }
.hp-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--muted); }
.hp-dot.ok { background: var(--ok); box-shadow: 0 0 7px var(--ok); }
.hp-dot.warn { background: var(--accent); box-shadow: 0 0 7px var(--accent); }
.hp-dot.down { background: var(--bad); box-shadow: 0 0 7px var(--bad); }
.hp-dot.off { background: var(--muted); opacity: .45; }
.hp-label { color: var(--text); }
.hp-detail { color: var(--muted); margin-left: auto; font-size: 11.5px; text-align: right; }
.hp-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); display: flex; justify-content: space-between; gap: 10px; }
.chat-unread { position: absolute; top: -5px; right: -5px; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 999px; background: var(--bad); color: #fff; font-size: 9px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; line-height: 1; }
.chat-unread.hidden { display: none; }
.chat-panel { position: fixed; right: 16px; bottom: 16px; width: 320px; max-width: calc(100vw - 32px); height: min(58vh, 460px); z-index: 2400; display: flex; flex-direction: column; background: rgba(16, 19, 26, 0.97); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); backdrop-filter: blur(8px); overflow: hidden; }
.chat-panel.hidden { display: none; }
.chat-head { display: flex; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.chat-title { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; }
.chat-title .ico { color: var(--accent); }
.chat-title .ico svg { width: 15px; height: 15px; }
.chat-close { margin-left: auto; background: transparent; border: none; color: var(--muted); cursor: pointer; font-size: 13px; }
.chat-close:hover { color: var(--text); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 7px; }
.chat-msgs:empty::before { content: "Сообщений пока нет — напишите первым"; color: var(--muted); font-size: 12px; margin: auto; text-align: center; }
.chat-msg { max-width: 88%; align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 9px; font-size: 13px; line-height: 1.35; word-break: break-word; }
.chat-msg.mine { align-self: flex-end; background: rgba(229, 160, 13, .14); border-color: rgba(229, 160, 13, .4); }
.cm-name { display: block; font-size: 10px; font-weight: 700; color: var(--accent); margin-bottom: 1px; }
.chat-msg.mine .cm-name { color: #ffca4b; }
.cm-text { color: var(--text); }
.chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid var(--line); }
.chat-form input { flex: 1; min-width: 0; padding: 8px 11px; background: #0d0f13; color: var(--text); border: 1px solid var(--line); border-radius: 9px; font: inherit; font-size: 13px; outline: none; }
.chat-form input:focus { border-color: var(--accent); }
.chat-send { display: inline-flex; align-items: center; justify-content: center; width: 36px; background: var(--accent); border: none; border-radius: 9px; color: #14171e; cursor: pointer; flex-shrink: 0; }
.chat-send:hover { filter: brightness(1.08); }
.chat-send svg { width: 16px; height: 16px; }
@media (max-width: 560px) { .chat-panel { width: calc(100vw - 24px); right: 12px; bottom: 12px; } }
@media (max-width: 560px) { .details-card { flex-direction: column; } .details-poster { width: 150px; margin: 0 auto; } }

.lib-empty { padding: 24px; text-align: center; color: var(--muted); }
.lib-empty.hidden { display: none; }

/* Reactions */
.react-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 5; }
.react-float { position: absolute; bottom: 58px; display: flex; flex-direction: column; align-items: center; gap: 3px; will-change: transform, opacity; animation: floatUp 2.4s ease-out forwards; }
.react-emoji { font-size: 34px; }
.react-emoji-img { width: 42px; height: 42px; object-fit: contain; display: block; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .5)); }
.react-who { display: inline-flex; align-items: center; gap: 4px; background: rgba(6, 8, 11, 0.7); border-radius: 999px; padding: 1px 8px 1px 2px; font-size: 11px; color: #fff; white-space: nowrap; }
.react-who img { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; }
@keyframes floatUp {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  14% { opacity: 1; transform: translateY(-12px) scale(1.15); }
  100% { opacity: 0; transform: translateY(-230px) scale(1); }
}
.reactions { position: absolute; right: 12px; bottom: 62px; z-index: 6; display: flex; align-items: center; gap: 6px; }
.reactions.hidden { display: none; }
.react-trigger {
  width: 34px; height: 34px; border-radius: 50%; padding: 0;
  background: rgba(6, 8, 11, 0.6); border: 1px solid var(--line);
  font-size: 17px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .2s, transform .1s;
}
.video-wrap:hover .react-trigger { opacity: .7; }
.reactions:hover .react-trigger { opacity: 1; }
.react-trigger:hover { transform: scale(1.1); }
.react-row {
  display: flex; gap: 3px; padding: 5px 7px; order: -1;
  background: rgba(6, 8, 11, 0.72); border: 1px solid var(--line); border-radius: 999px;
  opacity: 0; transform: translateX(10px) scale(.96); pointer-events: none;
  transition: opacity .18s, transform .18s;
}
/* The emoji list opens only when the 😊 trigger is hovered (JS toggles .open),
   and stays open while the pointer is anywhere in the reactions cluster. */
.reactions.open .react-row { opacity: 1; transform: none; pointer-events: auto; }
.react-row > button { background: transparent; border: none; font-size: 19px; cursor: pointer; padding: 2px 4px; border-radius: 8px; line-height: 1; transition: transform .1s; }
.react-row > button:hover { transform: scale(1.3); }

/* Custom (hand-drawn) emoji inside the reaction row */
.custom-emoji-row { display: inline-flex; align-items: center; gap: 3px; }
.custom-emoji-row:empty { display: none; }
.ce-btn { position: relative; background: transparent; border: none; padding: 1px; cursor: pointer; border-radius: 8px; line-height: 0; transition: transform .1s; }
.ce-btn img { width: 24px; height: 24px; object-fit: contain; display: block; }
.ce-btn:hover { transform: scale(1.25); }
.ce-del { position: absolute; top: -6px; right: -6px; width: 17px; height: 17px; border-radius: 50%; border: 1px solid #12161d; background: #555c68; color: #fff; font-size: 11px; line-height: 15px; padding: 0; cursor: pointer; display: none; }
.ce-btn:hover .ce-del, .ce-btn.armed .ce-del { display: block; }
.ce-btn.armed .ce-del { background: #e23b3b; font-size: 0; }             /* armed: red, shows ✓ instead of × */
.ce-btn.armed .ce-del::before { content: "✓"; font-size: 12px; }
.ce-btn.armed img { outline: 2px solid #e23b3b; outline-offset: 1px; border-radius: 5px; }
.draw-emoji-btn { background: transparent; border: none; font-size: 15px; cursor: pointer; padding: 2px 4px; border-radius: 8px; line-height: 1; opacity: .75; transition: transform .1s, opacity .1s; }
.draw-emoji-btn:hover { transform: scale(1.2); opacity: 1; }

/* Draw-your-own-emoji modal */
.draw-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: rgba(4, 6, 9, 0.72); backdrop-filter: blur(3px); }
.draw-modal.hidden { display: none; }
.draw-card { width: 300px; max-width: 92vw; background: #12161d; border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.draw-head { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 10px; }
.draw-close { background: transparent; border: none; color: #9aa5b1; font-size: 16px; cursor: pointer; }
.draw-stage { display: flex; justify-content: center; }
#draw-canvas { width: 256px; height: 256px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line); touch-action: none; cursor: crosshair;
  background: repeating-conic-gradient(#2a2f37 0% 25%, #232830 0% 50%) 50% / 22px 22px; } /* checkerboard = transparent area */
.draw-tools { display: flex; align-items: center; gap: 8px; margin: 10px 0; flex-wrap: wrap; }
.draw-swatches { display: inline-flex; gap: 4px; }
.draw-sw { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.draw-sw.active { border-color: #fff; }
#draw-color { width: 28px; height: 26px; border: none; background: none; padding: 0; cursor: pointer; }
#draw-size { flex: 1; min-width: 60px; }
.draw-tool { background: rgba(255, 255, 255, .06); border: 1px solid var(--line); color: #e6e9ee; border-radius: 8px; padding: 3px 8px; cursor: pointer; font-size: 14px; }
.draw-tool.active { background: var(--accent); color: #10141b; border-color: var(--accent); }
.draw-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.draw-btn { padding: 7px 14px; border-radius: 9px; border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: #e6e9ee; cursor: pointer; font-weight: 600; }
.draw-btn.primary { background: var(--accent); color: #10141b; border-color: var(--accent); }

/* Number-key badge — bottom-left, so it never collides with the top-right delete × */
.reactions.open .react-row [data-key] { position: relative; }
.reactions.open .react-row [data-key]::after {
  content: attr(data-key); position: absolute; bottom: -6px; left: -5px;
  min-width: 14px; height: 14px; padding: 0 2px; box-sizing: border-box;
  background: #0b0d12; color: #fff; border: 1px solid var(--line); border-radius: 7px;
  font-size: 9px; font-weight: 700; line-height: 12px; text-align: center; pointer-events: none;
}
.react-row .key-hit { animation: keyHit .25s ease; }
@keyframes keyHit { 0% { transform: scale(1); } 45% { transform: scale(1.5); } 100% { transform: scale(1); } }

.muted { color: var(--muted); }

/* Toast (resume notice, etc.) */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(12px);
  background: rgba(11, 13, 18, .95); border: 1px solid var(--line); color: var(--text);
  padding: 9px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .5); z-index: 3000;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Scrollbar */
#items::-webkit-scrollbar { width: 9px; }
#items::-webkit-scrollbar-thumb { background: #2a2f3a; border-radius: 9px; }
#items::-webkit-scrollbar-thumb:hover { background: #363c49; }

@media (max-width: 760px) {
  main { grid-template-columns: 1fr; }
  #library { max-height: 42vh; }
}

/* Sound settings popover — personal per-viewer audio (boost / night mode / voice clarity). */
.c-btn.active { color: var(--accent); }
.sound-menu { position: absolute; right: 10px; bottom: 62px; z-index: 40; width: 230px; padding: 12px 14px; background: rgba(18,20,26,.97); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 38px rgba(0,0,0,.55); font-size: 13px; color: #e8e8ea; backdrop-filter: blur(6px); }
.sound-menu.hidden { display: none; }
.sound-menu .ico { display: inline-flex; }
.sound-menu .ico svg { width: 100%; height: 100%; display: block; }
.sound-menu .sm-title { display: flex; align-items: center; gap: 6px; font-weight: 700; margin-bottom: 10px; }
.sound-menu .sm-title .ico { width: 16px; height: 16px; color: var(--accent); }
.sound-menu .sm-hint { margin-left: auto; font-weight: 400; opacity: .45; font-size: 11px; }
.sound-menu .sm-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 11px 0; }
.sound-menu .sm-label { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.sound-menu .sm-label .ico { width: 15px; height: 15px; opacity: .8; }
label.sm-tog { cursor: pointer; }
.sound-menu .sm-boost-row { margin: 11px 0 13px; }
.sound-menu .sm-boost-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.sound-menu .sm-boost-val { font-weight: 700; color: var(--accent); font-size: 12px; }
.sound-menu .sm-range { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 0; background: transparent; outline: none; cursor: pointer; --fill: 0%; }
/* WebKit: explicit 5px track + thumb margin-top (5-15)/2 = -5px → thumb centred on the track */
.sound-menu .sm-range::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--fill), rgba(255,255,255,.18) var(--fill)); }
.sound-menu .sm-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; margin-top: -5px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: pointer; }
/* Firefox: native track + progress fill */
.sound-menu .sm-range::-moz-range-track { height: 5px; border-radius: 999px; background: rgba(255,255,255,.18); }
.sound-menu .sm-range::-moz-range-progress { height: 5px; border-radius: 999px; background: var(--accent); }
.sound-menu .sm-range::-moz-range-thumb { width: 15px; height: 15px; border: 0; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.5); cursor: pointer; }

/* Danmaku — chat comments fly across the video (personal toggle). */
.chat-head .danmaku-btn { margin-left: auto; display: inline-flex; align-items: center; }
.chat-head .danmaku-btn .ico svg { width: 16px; height: 16px; }
.chat-head .danmaku-btn.active { color: var(--accent); }
.chat-head #chat-close { margin-left: 8px; }
.danmaku-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 6; }
.danmaku-item { position: absolute; left: 100%; white-space: nowrap; font-weight: 600; font-size: 15px; line-height: 1; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.95), 0 0 3px rgba(0,0,0,.9); will-change: transform; }
.danmaku-item .dm-name { color: var(--accent); margin-right: 5px; }

/* Post-movie LIKE prompt — reuses the skip-credits pill (.skip-btn) for identical look/motion. */
.like-btn:not(.liked) .skip-ico { color: #ff5c72; }                 /* red heart while un-liked */
.like-btn.liked, .like-btn.liked:hover { background: var(--accent); color: #10141b; border-color: var(--accent); }

/* "Because you liked X" reason line on recommended library rows. */
.li-reason { font-size: 11px; color: var(--accent); opacity: .92; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Franchise section headers in the Collections view. */
#items li.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 5px; margin: 0; background: transparent; border: 0; cursor: default; }
#items li.col-head:hover { background: transparent; }
.col-head .col-name { font-weight: 700; font-size: 12px; letter-spacing: .02em; text-transform: uppercase; color: var(--accent); }
.col-head .col-n { font-weight: 600; font-size: 11px; color: var(--muted); background: rgba(255,255,255,.08); border-radius: 999px; padding: 1px 8px; }
/* iOS-style toggle switch */
.sm-sw { position: relative; display: inline-block; width: 36px; height: 21px; flex-shrink: 0; }
.sm-sw input { position: absolute; opacity: 0; width: 0; height: 0; }
.sm-sw i { position: absolute; inset: 0; background: rgba(255,255,255,.18); border-radius: 999px; transition: background .15s; }
.sm-sw i::before { content: ""; position: absolute; width: 17px; height: 17px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.4); }
.sm-sw input:checked + i { background: var(--accent); }
.sm-sw input:checked + i::before { transform: translateX(15px); }

/* "Who's this actor?" — cast strip revealed while paused */
.cast-panel {
  position: absolute; left: 0; right: 0; bottom: 58px; z-index: 7;
  padding: 12px 16px 14px;
  background: linear-gradient(to top, rgba(9, 11, 16, .92), rgba(9, 11, 16, .55) 62%, transparent);
  opacity: 0; transform: translateY(14px); pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
}
.cast-panel.show { opacity: 1; transform: none; pointer-events: auto; }
.cast-head { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 2px 9px; }
.cast-row { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.cast-row::-webkit-scrollbar { height: 6px; }
.cast-row::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .18); border-radius: 3px; }
.cast-card { flex: 0 0 auto; width: 82px; scroll-snap-align: start; text-align: center; }
.cast-card img,
.cast-card.noimg::before {
  width: 82px; height: 82px; border-radius: 11px; display: block;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}
.cast-card img { object-fit: cover; background: #1b2333; }
.cast-card.noimg::before {
  content: attr(data-i); display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a3346, #1a2130); color: #8ea3c2; font-size: 30px; font-weight: 700;
}
.cast-name { margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cast-role { font-size: 11px; color: var(--muted); line-height: 1.2; margin-top: 1px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cast-skel { flex: 0 0 auto; width: 82px; height: 82px; border-radius: 11px;
  background: linear-gradient(90deg, #1b2333, #263149, #1b2333); background-size: 200% 100%;
  animation: castShimmer 1.1s linear infinite; }
@keyframes castShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* "Who's on screen now" — face boxes + actor chips over the paused frame */
.face-layer { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.face-box {
  position: absolute; border: 2px solid rgba(120, 200, 255, .92); border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .35), 0 0 18px rgba(80, 170, 255, .35);
  animation: faceIn .3s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes faceIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
.face-chip {
  position: absolute; left: -2px; top: calc(100% + 8px); display: flex; align-items: center; gap: 8px;
  max-width: 240px; padding: 5px 12px 5px 5px; border-radius: 999px;
  background: rgba(12, 15, 22, .84); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 6px 20px rgba(0, 0, 0, .45);
  white-space: nowrap; animation: chipIn .32s .04s cubic-bezier(.2, .8, .2, 1) both;
}
.face-chip.above { top: auto; bottom: calc(100% + 8px); }
@keyframes chipIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.fc-av { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; overflow: hidden; background: #223; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }
.fc-av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fc-tx { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.fc-tx b { font-size: 13px; font-weight: 700; color: #eaf2ff; overflow: hidden; text-overflow: ellipsis; }
.fc-tx i { font-size: 11px; font-style: normal; color: #9fb3cc; overflow: hidden; text-overflow: ellipsis; }
/* in-frame highlight on the "В ролях" strip */
.cast-card.in-frame img, .cast-card.in-frame.noimg::before { box-shadow: 0 0 0 2px var(--accent), 0 3px 12px rgba(0, 0, 0, .5); }
.cast-live { display: block; margin-top: 3px; font-size: 10px; font-weight: 700; letter-spacing: .03em; color: #7fd1ff; }

/* Full cast inside the movie card (details modal) */
.details-cast { margin-top: 15px; }
.dc-head { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin: 0 0 10px; }
.dc-row { display: flex; gap: 14px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; -ms-overflow-style: none;
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 95%, transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 95%, transparent 100%); }
.dc-row::-webkit-scrollbar { display: none; }
.dc-card { flex: 0 0 auto; width: 88px; text-align: center; }
.dc-pic { width: 88px; height: 88px; border-radius: 14px; box-shadow: 0 5px 14px rgba(0, 0, 0, .5); }
.dc-pic > img { object-position: center 22%; }
.dc-pic.noimg { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #2a3346, #1a2130); }
.dc-pic.noimg::before { content: attr(data-i); color: #8ea3c2; font-size: 30px; font-weight: 700; position: relative; z-index: 1; }
.dc-name { margin-top: 9px; font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.25; min-height: 2.5em;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.dc-role { font-size: 11px; color: var(--muted); line-height: 1.25; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dc-skel { flex: 0 0 auto; width: 88px; height: 88px; border-radius: 14px;
  background: linear-gradient(90deg, #1b2333, #263149, #1b2333); background-size: 200% 100%; animation: castShimmer 1.1s linear infinite; }

/* "Заказать фильм" — request button + modal */
.request-btn { width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); cursor: pointer; font-weight: 600; font-size: 13px; }
.request-btn:hover { background: var(--accent); color: #10141b; border-color: var(--accent); }
.request-card { max-width: 560px; width: 92%; display: block; }
.req-title { margin: 0 0 4px; }
.req-sub { color: var(--muted); font-size: 13px; margin: 0 0 12px; line-height: 1.4; }
.req-searchbar input { width: 100%; box-sizing: border-box; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .05); color: var(--text); font-size: 15px; }
.req-searchbar input:focus { outline: none; border-color: var(--accent); }
.req-suggest { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; }
.req-s-item { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04); color: var(--text); cursor: pointer; font-size: 14px; }
.req-s-item:hover:not(:disabled) { background: rgba(255, 255, 255, .09); }
.req-s-item:disabled { opacity: .5; cursor: default; }
.req-s-item img { width: 34px; height: 50px; object-fit: cover; border-radius: 5px; background: #1b2333; flex-shrink: 0; }
.req-s-noimg, .req-i-noimg { display: inline-flex; align-items: center; justify-content: center; background: #1b2333; border-radius: 5px; flex-shrink: 0; }
.req-s-noimg { width: 34px; height: 50px; font-size: 18px; }
.req-s-tx { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.req-s-y, .req-i-y { color: var(--muted); font-weight: 400; }
.req-s-have { font-size: 11px; color: #7fd1ff; white-space: nowrap; }
.req-s-free { justify-content: center; color: var(--accent); font-weight: 600; }
.req-s-load, .req-l-load, .req-empty { color: var(--muted); font-size: 13px; padding: 8px 4px; }
.req-listhead { margin: 16px 0 8px; font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.req-list { display: flex; flex-direction: column; gap: 8px; max-height: 300px; overflow-y: auto; }
.req-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.req-item.done { opacity: .58; }
.req-i-poster img { width: 38px; height: 56px; border-radius: 6px; object-fit: cover; background: #1b2333; display: block; flex-shrink: 0; }
.req-i-noimg { width: 38px; height: 56px; font-size: 18px; }
.req-i-tx { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.req-i-tx b { font-weight: 600; }
.req-i-by { font-size: 12px; color: var(--muted); }
.req-i-actions { display: flex; align-items: center; gap: 6px; }
.req-i-add, .req-i-del { border: 1px solid var(--line); background: rgba(255, 255, 255, .06); color: var(--text); border-radius: 8px; padding: 5px 9px; cursor: pointer; font-size: 13px; }
.req-i-add:hover { background: rgba(90, 200, 120, .25); }
.req-i-del:hover { background: rgba(230, 80, 80, .25); }
.req-i-badge { font-size: 12px; color: #6ad07a; font-weight: 600; white-space: nowrap; }

/* ===== visual polish: swapped-in icons + shared animations ===== */
.details-close { display: inline-flex; align-items: center; justify-content: center; }
.details-close svg, .queue-clear svg { width: 16px; height: 16px; }
.request-btn { display: flex; grid-column: 1 / -1; align-items: center; justify-content: center; gap: 7px; }
.request-btn .ico svg { width: 16px; height: 16px; }
.req-title { display: flex; align-items: center; gap: 8px; }
.req-title .ico svg { width: 20px; height: 20px; color: var(--accent); }
.req-s-noimg svg { width: 18px; height: 18px; opacity: .55; }
.req-i-noimg svg { width: 20px; height: 20px; opacity: .5; }
.req-i-del { display: inline-flex; align-items: center; justify-content: center; }
.req-i-del svg { width: 15px; height: 15px; }

/* modal enter */
.details-modal:not(.hidden) { animation: dpwFade .18s ease both; }
.details-modal:not(.hidden) > .details-card { animation: dpwPop .3s cubic-bezier(.2, .85, .25, 1) both; }
@keyframes dpwFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes dpwPop { from { opacity: 0; transform: translateY(16px) scale(.975); } to { opacity: 1; transform: none; } }

/* list items rise in */
.dc-card, .req-item, .req-s-item { animation: dpwRise .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes dpwRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* button micro-interactions */
.request-btn, .req-s-item, .req-i-del, .details-play, .details-queue, .details-later, .details-trailer,
.details-like, .details-shuffle, .c-btn, .details-close, .queue-clear, #surprise, #reload {
  transition: transform .12s ease, background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.request-btn:active, .req-s-item:active, .details-play:active, .c-btn:active, .req-i-del:active,
.details-close:active, .queue-clear:active, #surprise:active, #reload:active { transform: scale(.96); }
.details-close:hover, .queue-clear:hover { color: var(--text); background: rgba(255, 255, 255, .09); }
.request-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.c-btn:hover, #surprise:hover, #reload:hover { transform: translateY(-1px); }
.req-s-item:hover:not(:disabled) { transform: translateX(2px); }
.idle-icon svg { width: 58px; height: 58px; opacity: .5; }
.idle-icon { animation: dpwFloat 4s ease-in-out infinite; }
@keyframes dpwFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* poster loading: shimmer skeleton until the image paints, then a soft reveal */
/* poster skeleton: shimmer + spinner "loading" fallback; image fades in only once fully painted */
.poster-skel { position: relative; overflow: hidden;
  background-image: linear-gradient(100deg, #161c29 25%, #232f4a 50%, #161c29 75%); background-size: 200% 100%;
  animation: posterShimmer 1.4s ease-in-out infinite; }
.poster-skel::after { content: ''; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px;
  border-radius: 50%; border: 2.4px solid rgba(255, 255, 255, .13); border-top-color: rgba(255, 255, 255, .6);
  animation: posterSpin .75s linear infinite; }
.poster-skel > img { position: relative; z-index: 1; width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0; transition: opacity .4s ease; }
.poster-skel > img.img-loaded { opacity: 1; }
.poster-skel.loaded, .poster-skel.failed, .poster-skel.noimg { animation: none; }
.poster-skel.loaded::after, .poster-skel.failed::after, .poster-skel.noimg::after { display: none; }
@keyframes posterShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
@keyframes posterSpin { to { transform: rotate(360deg); } }
/* poster slots */
.details-poster-wrap { width: 210px; flex-shrink: 0; align-self: flex-start; aspect-ratio: 2 / 3; border-radius: 12px; box-shadow: 0 8px 26px rgba(0, 0, 0, .5); }
.details-poster { border-radius: 12px; }
.li-poster { width: 42px; height: 63px; border-radius: 5px; flex-shrink: 0; }
.li-poster::after { width: 12px; height: 12px; margin: -6px; border-width: 2px; }
.req-i-poster img, .req-s-item img { background: #12161f; }
