/* In-site player: independent styling; does not alter existing ReactionSeeker theme. */
.rs-player-dialog {
  width: min(980px, calc(100vw - 24px));
  max-width: 980px;
  max-height: min(96vh, 1050px);
  padding: 0;
  margin: auto;
  overflow-y: auto;
  color: #f9f2ff;
  border: 1px solid #a662fa;
  border-radius: 18px;
  background: #15132b;
  box-shadow: 0 20px 90px #000d, 0 0 46px #8e4bfd44;
}
.rs-player-dialog::backdrop { background: rgba(4, 4, 16, .88); backdrop-filter: blur(7px); }
.rs-player-shell { padding: clamp(12px, 2.5vw, 24px); }
.rs-player-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.rs-player-head h2 { margin: 4px 0 0; font-size: clamp(20px, 2.7vw, 30px); line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.rs-player-kicker { font-size: 10px; font-weight: 900; letter-spacing: .18em; color: #fcaaed; }
.rs-player-close { min-width: 42px; min-height: 42px; border: 1px solid #b48bdf; border-radius: 50%; background: #2b2447; color: #fff; font-size: 18px; cursor: pointer; }
.rs-player-close:hover, .rs-player-close:focus-visible { background: #5c3687; }
.rs-player-frame { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #04030d; border: 1px solid #564375; border-radius: 11px; overflow: hidden; }
.rs-player-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.rs-player-hint { margin: 12px 0 22px; color: #d8cbe4; font-size: 13px; line-height: 1.5; }
.rs-player-hint a { color: #fcb0ea; font-weight: 800; }
.rs-player-moments { border-top: 1px solid #564475; padding-top: 16px; }
.rs-player-moment-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.rs-player-moment-heading h3 { margin: 0; font-size: 18px; color: #fff; }
.rs-player-moment-heading span { font-size: 11px; color: #c6b7d8; }
.rs-player-moments > p { margin: 10px 0; font-size: 13px; color: #d4c9e6; }
#rsPlayerSave { display: grid; grid-template-columns: minmax(140px, 1fr) minmax(180px, 2fr) auto; gap: 10px; align-items: end; }
#rsPlayerSave label { display: grid; gap: 6px; font-size: 12px; color: #e4d7f1; }
#rsPlayerSave input, #rsPlayerShareLink { width: 100%; min-width: 0; box-sizing: border-box; min-height: 40px; padding: 9px 11px; border: 1px solid #766395; border-radius: 9px; background: #25203d; color: #fff; font: inherit; }
#rsPlayerSave button, #rsPlayerShare { min-height: 40px; border: 0; border-radius: 9px; padding: 8px 14px; background: #f1aaff; color: #281637; font-weight: 900; cursor: pointer; }
#rsPlayerSave button:hover, #rsPlayerShare:hover { background: #ffccfc; }
#rsPlayerStatus { min-height: 18px; color: #f7c2fc; }
.rs-player-moment-list { display: grid; gap: 6px; margin: 10px 0; padding: 0; list-style: none; }
.rs-player-moment-list li:not(.rs-player-empty) { display: flex; gap: 10px; align-items: center; justify-content: space-between; border: 1px solid #413654; background: #201b34; padding: 7px 10px; border-radius: 8px; }
.rs-player-seek { min-width: 0; text-align: left; color: #eac9ff; background: transparent; border: 0; cursor: pointer; overflow-wrap: anywhere; }
.rs-player-remove { color: #ffd1df; background: transparent; border: 1px solid #946b90; border-radius: 7px; padding: 5px 10px; cursor: pointer; }
.rs-player-empty { color: #bcaed1; font-size: 12px; }
.rs-player-share { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; margin-top: 12px; }
#rsPlayerShareLink { flex: 1 1 280px; }
.rs-player-dialog button:focus-visible, .rs-player-dialog a:focus-visible, .rs-player-dialog input:focus-visible { outline: 2px solid #f9c7ff; outline-offset: 2px; }
@media (max-width: 640px) {
  #rsPlayerSave { grid-template-columns: 1fr; }
  .rs-player-dialog { max-height: 97vh; width: calc(100vw - 12px); }
  .rs-player-shell { padding: 12px; }
  .rs-player-head h2 { font-size: 19px; }
}

/* Public Peak Moments remain visually distinct from private bookmarks. */
#rsPlayerPublish {min-height:40px;border:1px solid #f1aaff;border-radius:9px;padding:9px 14px;background:#30234c;color:#f6ddff;font:inherit;font-size:13px;font-weight:800;cursor:pointer;}
#rsPlayerPublish:disabled {opacity:.55;cursor:wait;}
#rsPlayerPublish:hover:not(:disabled) {background:#51326e;}
.rs-community-explain {color:#d8cde6;font-size:12px;line-height:1.5;}
.rs-player-community {border-top:1px solid #564475;margin-top:20px;padding-top:16px;}
#rsPlayerCommunityStatus {font-size:13px;color:#d8cce7;}
.rs-community-feed {padding-block:40px 55px;}
.rs-community-grid {display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,245px),1fr));gap:14px;margin-top:18px;}
.rs-community-card {border:1px solid #654a87;border-radius:14px;background:#201a36;padding:18px;min-width:0;}
.rs-community-card h3 {margin:0 0 10px;font-size:15px;color:#fff;overflow-wrap:anywhere;}
.rs-community-card p {margin:0 0 16px;color:#ebdcee;font-size:13px;line-height:1.6;overflow-wrap:anywhere;}
.rs-community-card a {color:#ffc9fb;font-size:13px;font-weight:800;text-decoration:underline;}
#rsPlayerPublish:focus-visible,.rs-community-card a:focus-visible {outline:2px solid #f9c7ff;outline-offset:2px;}

/* Peak Moments 2.0: lightweight vote controls and challengers. */
.rs-player-vote {flex:0 0 auto;min-height:33px;padding:6px 14px;border:1px solid #b888f6;border-radius:8px;background:#40295d;color:#fff;font-weight:800;cursor:pointer;}
.rs-player-vote:hover,.rs-player-vote:focus-visible{background:#643c8c;}
.rs-player-candidates{margin-top:16px;padding:10px 12px;border:1px solid #564475;border-radius:10px;color:#e0cdec;}
.rs-player-candidates summary{font-size:13px;cursor:pointer;font-weight:800;}
.rs-player-candidates p{font-size:12px;color:#d0bfdc;margin:7px 0 12px;}
.rs-player-candidates[hidden]{display:none;}


/* Three viewing choices: standard window, native YouTube fullscreen, and
   split theater (the original YouTube player plus independently scrollable notes).
   The theater toggle uses CSS only and never interrupts playback. */
.rs-player-head-actions {display:flex;gap:10px;align-items:center;flex:0 0 auto;}
.rs-player-layout-toggle {min-height:42px;white-space:nowrap;border:1px solid #b48bdf;border-radius:10px;padding:9px 13px;background:#302449;color:#fff;font:inherit;font-size:12px;font-weight:850;cursor:pointer;}
.rs-player-layout-toggle:hover,.rs-player-layout-toggle:focus-visible {background:#573578;}
.rs-player-layout,.rs-player-video-column,.rs-player-side-panel {min-width:0;}
.rs-player-dialog.rs-player-theater {width:calc(100vw - 16px);max-width:2500px;height:calc(100dvh - 16px);max-height:calc(100dvh - 16px);overflow:hidden;}
.rs-player-theater .rs-player-shell {box-sizing:border-box;height:100%;display:flex;flex-direction:column;min-height:0;}
.rs-player-theater .rs-player-head {flex:0 0 auto;}
.rs-player-theater .rs-player-layout {display:grid;grid-template-columns:minmax(0,2fr) minmax(340px,1fr);gap:clamp(14px,2vw,28px);flex:1 1 auto;min-height:0;overflow:hidden;}
.rs-player-theater .rs-player-video-column {display:flex;flex-direction:column;justify-content:center;min-height:0;}
.rs-player-theater .rs-player-frame {flex:0 0 auto;}
.rs-player-theater .rs-player-hint {margin-bottom:8px;}
.rs-player-theater .rs-player-side-panel {min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 8px 8px 0;scrollbar-color:#755598 #20172e;}
.rs-player-theater .rs-player-moments {border-top:0;padding-top:0;}
.rs-player-theater #rsPlayerSave {grid-template-columns:repeat(2,minmax(0,1fr));}
.rs-player-theater #rsPlayerSave button {grid-column:1/-1;}
.rs-player-dialog .rs-player-layout-toggle:focus-visible {outline:2px solid #f9c7ff;outline-offset:2px;}
@media (max-width: 1100px) {
  .rs-player-theater .rs-player-layout {display:flex;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;}
  .rs-player-theater .rs-player-video-column {flex:0 0 auto;justify-content:start;}
  .rs-player-theater .rs-player-side-panel {flex:0 0 auto;overflow:visible;padding:0 0 12px;}
  .rs-player-theater .rs-player-moments {border-top:1px solid #564475;padding-top:16px;}
}
@media (max-width:640px) {
  .rs-player-head-actions {gap:7px;}
  .rs-player-layout-toggle {font-size:11px;min-height:40px;padding:6px 9px;}
  .rs-player-theater #rsPlayerSave {grid-template-columns:1fr;}
}


/* Creator-written chapter labels are independent of community nominations.
   Labels originate from the channel's public video description, not a guess. */
.rs-player-creator {border-top:1px solid #564475;padding:14px 0;margin-bottom:14px;}
.rs-player-creator[hidden] {display:none;}
.rs-player-creator .rs-player-moment-list {max-height:220px;overflow-y:auto;padding-right:5px;}
.rs-player-creator .rs-player-moment-list li {justify-content:flex-start;}
.rs-player-creator .rs-player-seek {width:100%;}
.rs-player-theater .rs-player-creator {border-top:0;padding-top:0;}

/* Creator-written chapter popover: independent of YouTube's cross-origin controls.
   The still image is a generic video thumbnail, never a timestamp frame preview. */
.rs-chapter-rail { margin: 9px 0 0; padding: 9px 11px; border: 1px solid #564375; border-radius: 10px; background: #211a36; color: #f2e4ff; }
.rs-chapter-rail[hidden], .rs-chapter-float[hidden] { display: none !important; }
.rs-chapter-rail-head { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.rs-chapter-rail-head strong { font-size: 12px; letter-spacing: .025em; }
.rs-chapter-rail-head span { font-size: 11px; color: #cebfde; }
.rs-chapter-scroll { display: flex; align-items: center; gap: 7px; overflow-x: auto; padding: 3px 0 7px; scrollbar-color: #755598 #20172e; overscroll-behavior-x: contain; }
.rs-chapter-marker { flex: 0 0 auto; min-width: 54px; min-height: 36px; padding: 6px 10px; border: 1px solid #745f99; border-radius: 8px; background: #34264c; color: #f7dcff; font: inherit; font-weight: 750; font-size: 12px; cursor: pointer; }
.rs-chapter-marker:hover, .rs-chapter-marker:focus-visible { background: #693e8b; border-color: #ecb7ff; }
.rs-chapter-marker:focus-visible { outline: 2px solid #f9c7ff; outline-offset: 2px; }
.rs-chapter-float { position: fixed; z-index: 100000; box-sizing: border-box; width: 232px; max-width: calc(100vw - 24px); padding: 7px; border: 1px solid #d5aaff; border-radius: 12px; box-shadow: 0 14px 45px rgba(0,0,0,.68); background: #191327; color: #fff; pointer-events: none; }
.rs-chapter-float img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 7px; background: #121021; }
.rs-chapter-float-details { padding: 8px 5px 5px; display: grid; gap: 4px; }
.rs-chapter-float-details strong { font-size: 13px; color: #ffe0ff; font-variant-numeric: tabular-nums; }
.rs-chapter-float-details span { font-size: 12px; line-height: 1.35; max-height: 2.7em; overflow: hidden; overflow-wrap: anywhere; color: #f3e8ff; }
@media (max-width: 640px) { .rs-chapter-rail-head span { font-size: 10px; } .rs-chapter-marker { min-height: 44px; } }
