/*
 * Player chrome. Loaded by both the app layout (/watch) and the embed iframe
 * layout, which has no Tailwind - so this is plain CSS on purpose and must
 * stay free of @apply. One file, one player, whichever surface renders it.
 *
 * --player-accent is set per tenant on .nx-stage.
 */

.nx-stage {
  position: relative;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}

.nx-stage * { box-sizing: border-box; }

/* Share gates use the same lightweight stylesheet as the player iframe. */
.ss-share-state, .ss-share-state * { box-sizing: border-box; }
.ss-share-state {
  height: 100%; overflow: auto; display: flex; align-items: safe center; justify-content: center;
  padding: 1.5rem; color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Helvetica, Arial, sans-serif;
}
.ss-share-panel { width: min(100%, 26rem); padding: 1.5rem; border: 1px solid rgba(255,255,255,.14); border-radius: 1rem; background: #141414; }
.ss-share-panel h1 { margin: 0; font-size: 1.25rem; line-height: 1.35; }
.ss-share-panel p { margin: .5rem 0 0; color: #c4c4c7; font-size: .875rem; line-height: 1.6; }
.ss-share-panel label { display: block; margin-top: 1.25rem; font-size: .875rem; font-weight: 600; }
.ss-share-panel input { display: block; width: 100%; min-height: 2.75rem; margin-top: .4rem; padding: .55rem .7rem; border: 1px solid rgba(255,255,255,.2); border-radius: .5rem; background: #0a0a0a; color: #fff; font: inherit; }
.ss-share-panel input:focus { outline: 2px solid #30cf5d; outline-offset: 2px; }
.ss-share-panel input[type="submit"] { margin-top: 1rem; border: 0; background: #fff; color: #0a0a0a; font-weight: 700; cursor: pointer; }
.ss-share-panel input[type="submit"]:hover { background: #d8f8df; }
.ss-share-panel .ss-share-error { color: #fda4af; }

.nx-video,
.nx-canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

/* Never stretch. A 4:3 or vertical upload in a 16:9 frame gets letterboxed,
   not distorted. */
.nx-video { object-fit: contain; }

/* Pre-play thumbnail. Above the <video>, under the tap surface and chrome,
   so a decoded HLS frame cannot replace it the way native poster= does. */
.nx-poster {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
  pointer-events: none;
  border: 0;
}

.nx-stage[data-nx-poster="off"] .nx-poster {
  opacity: 0;
  visibility: hidden;
}

.nx-canvas { display: none; touch-action: none; }

/* player_fallback.js: old in-app WebViews get native controls, not dead chrome. */
.nx-stage[data-nx-fallback] .nx-poster,
.nx-stage[data-nx-fallback] .nx-surface,
.nx-stage[data-nx-fallback] .nx-center,
.nx-stage[data-nx-fallback] .nx-chrome { display: none; }

/* Watch pages show only the player; embed iframes remain edge to edge. */
.ss-watch-page { margin: 0; min-height: 100dvh; color: #f4f4f5; }
@layer base { body.ss-watch-page { background: #111315 !important; } }
.ss-watch-main { min-height: 100dvh; display: grid; place-items: center; padding: clamp(12px, 3vw, 32px); }
.ss-watch-content { width: min(100%, 72rem); min-width: 0; }
.ss-watch-stage { width: min(100%, calc((100dvh - 190px) * 16 / 9)); aspect-ratio: 16 / 9; margin-inline: auto; border-radius: 10px; }
.ss-watch-stage-portrait { width: min(100%, calc((100dvh - 190px) * 9 / 16), 30rem); aspect-ratio: 9 / 16; margin-inline: auto; }
/* Below the player: details card, plus the viewer community card when the
   owner turned it on (two columns on desktop, stacked on phones). */
.ss-watch-below { width: min(100%, calc((100dvh - 190px) * 16 / 9)); margin: 16px auto 0; display: grid; gap: 16px; align-items: start; }
.ss-watch-below-split { width: 100%; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.ss-watch-stage-portrait + .ss-watch-below:not(.ss-watch-below-split) { width: min(100%, 30rem); }
.ss-watch-card { min-width: 0; padding: clamp(16px, 2.2vw, 24px); border-radius: 16px; background: #1b1d20; }
.ss-watch-info { margin: 0; }
.ss-watch-community { align-self: stretch; }
.ss-watch-title { margin: 0; color: #fff; font-size: clamp(1.25rem, 2.6vw, 1.875rem); font-weight: 700; line-height: 1.3; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.ss-watch-ago { margin: 6px 0 0; color: #a1a1aa; font-size: .875rem; }
.ss-watch-meta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
.ss-watch-avatar, .ss-comment-avatar { flex: none; display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 999px; background: #30cf5d; color: #0a0a0a; font-weight: 700; font-size: .875rem; }
.ss-watch-uploaded { margin: 8px 0 0; color: #a1a1aa; font-size: .8125rem; }
.ss-watch-back { margin: 0 0 12px; font-size: .875rem; }
.ss-watch-back a { color: #d4d4d8; }
.ss-watch-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; color: #a1a1aa; font-size: .875rem; line-height: 1.5; }
.ss-watch-channel { color: #e4e4e7; font-weight: 600; }
.ss-watch-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.ss-watch-action svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.ss-watch-action { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.08); color: #fafafa; font: 600 .8125rem/1 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Helvetica, Arial, sans-serif; cursor: pointer; transition: background-color 160ms ease; }
.ss-watch-action:hover { background: rgba(255,255,255,.16); }
.ss-watch-action:focus-visible, .ss-watch-description summary:focus-visible, .ss-watch-powered a:focus-visible { outline: 2px solid #30cf5d; outline-offset: 2px; }
.ss-watch-description { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: rgba(255,255,255,.06); color: #d4d4d8; font-size: .875rem; line-height: 1.65; }
.ss-watch-description summary { cursor: pointer; color: #fafafa; font-weight: 600; }
.ss-watch-description p { margin: .6rem 0 0; overflow-wrap: anywhere; }
.ss-watch-powered { margin: 18px 0 0; font-size: .75rem; }
.ss-watch-powered a { display: inline-flex; align-items: center; gap: 6px; color: #71717a; text-decoration: none; }
.ss-watch-powered a:hover { color: #d4d4d8; }
.ss-watch-message { min-height: min(56.25vw, 32rem); display: grid; place-items: center; padding: 2rem; border-radius: 10px; background: #080909; text-align: center; }
.ss-watch-message-title { margin: 0; color: #fff; font-size: 1.125rem; font-weight: 600; }
.ss-watch-message p { margin: .75rem 0 0; color: #b7b8ba; font-size: .875rem; line-height: 1.6; }
/* Viewer community (video_community/show). */
.ss-community { display: block; color: #e4e4e7; font-size: .875rem; }
.ss-community-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ss-community-title { margin: 0; color: #fff; font-size: 1.125rem; font-weight: 700; }
.ss-community-count { color: #a1a1aa; font-weight: 600; }
.ss-community-like { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid rgba(255,255,255,.12); border-radius: 12px; background: rgba(255,255,255,.06); color: #fafafa; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.ss-community-like svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.ss-community-like-on svg { fill: #30cf5d; stroke: #30cf5d; }
.ss-community-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.ss-community-sort { display: flex; gap: 4px; }
.ss-community-sort-link { display: inline-flex; align-items: center; min-height: 36px; padding: 0 12px; border-radius: 999px; color: #a1a1aa; text-decoration: none; }
.ss-community-sort-active { background: rgba(255,255,255,.1); color: #fff; }
.ss-community-who { margin: 0; color: #a1a1aa; font-size: .8125rem; }
.ss-community-who a { color: #d4d4d8; }
.ss-community-textbutton { display: inline-flex; align-items: center; min-height: 32px; padding: 0 4px; border: 0; background: none; color: #a1a1aa; font: inherit; font-size: .8125rem; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.ss-community-textbutton:hover { color: #fff; }
.ss-community-notice { margin: 10px 0 0; color: #86efac; font-size: .8125rem; }
.ss-community-error { margin: 0 0 8px; color: #fca5a5; font-size: .8125rem; }
.ss-community-list, .ss-comment-replies { list-style: none; margin: 0; padding: 0; }
.ss-community-list { max-height: 28rem; overflow-y: auto; }
.ss-community-empty { padding: 28px 0; color: #a1a1aa; text-align: center; }
.ss-comment { padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.ss-comment-replies { margin-top: 8px; padding-left: 20px; border-left: 2px solid rgba(255,255,255,.08); }
.ss-comment-replies .ss-comment { border-bottom: 0; padding: 8px 0; }
.ss-comment-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.ss-comment-avatar { width: 28px; height: 28px; font-size: .75rem; background: #3f3f46; color: #fafafa; }
.ss-comment-avatar-lg { width: 56px; height: 56px; font-size: 1.25rem; background: #0a0a0a; color: #fff; }
.ss-comment-author { color: #fafafa; font-weight: 600; }
.ss-comment-badge { padding: 1px 8px; border-radius: 999px; background: #30cf5d; color: #0a0a0a; font-size: .6875rem; font-weight: 700; }
.ss-comment-time { color: #71717a; font-size: .75rem; }
.ss-comment-body { margin-top: 4px; color: #e4e4e7; line-height: 1.6; overflow-wrap: anywhere; }
.ss-comment-body p { margin: 0 0 .4em; }
.ss-comment-actions { display: flex; gap: 8px; }
.ss-comment-reported { color: #71717a; font-size: .8125rem; }
.ss-comment-reply-form summary { display: inline-flex; align-items: center; min-height: 32px; color: #a1a1aa; font-size: .8125rem; cursor: pointer; }
.ss-community-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.ss-community-compose { margin-top: 12px; }
.ss-community-input { flex: 1; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 12px; background: #111315; color: #fafafa; font: inherit; resize: vertical; }
.ss-community-input:focus-visible, .ss-community-send:focus-visible, .ss-community-like:focus-visible, .ss-community-signin:focus-visible, .ss-community-sort-link:focus-visible, .ss-community-textbutton:focus-visible { outline: 2px solid #30cf5d; outline-offset: 2px; }
.ss-community-send { min-height: 44px; padding: 0 16px; border: 0; border-radius: 12px; background: #fafafa; color: #0a0a0a; font: inherit; font-weight: 700; cursor: pointer; }
.ss-community-signin { display: flex; align-items: center; justify-content: center; min-height: 48px; margin-top: 12px; border-radius: 12px; background: #fafafa; color: #0a0a0a; font-weight: 700; text-decoration: none; }
@media (max-width: 900px) {
  .ss-watch-below-split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .ss-watch-main { align-items: start; }
  .ss-watch-stage { width: 100%; border-radius: 6px; }
  .ss-watch-stage-portrait { width: min(100%, calc((100dvh - 220px) * 9 / 16)); }
  .ss-watch-below { width: 100%; }
  .ss-watch-actions { display: grid; grid-template-columns: 1fr 1fr; }
}
.ss-embed-stage { position: fixed; inset: 0; width: 100vw; height: 100vh; }

.nx-stage:fullscreen,
.nx-stage:-webkit-full-screen { aspect-ratio: auto; border-radius: 0; width: 100%; height: 100%; }
.nx-stage:fullscreen .nx-video { object-fit: contain; }

/* ---------- captions ---------- */

.ss-caption-video::cue {
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", Helvetica, Arial, sans-serif;
  font-size: clamp(0.9rem, 2.2vw, 1.5rem);
  line-height: 1.45;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.ss-caption-video[data-caption-scale="75"]::cue { font-size: clamp(0.675rem, 1.65vw, 1.125rem); }
.ss-caption-video[data-caption-scale="125"]::cue { font-size: clamp(1.125rem, 2.75vw, 1.875rem); }
.ss-caption-video[data-caption-scale="150"]::cue { font-size: clamp(1.35rem, 3.3vw, 2.25rem); }
.ss-caption-video[data-caption-font="serif"]::cue { font-family: Georgia, "Noto Serif KR", serif; }
.ss-caption-video[data-caption-font="mono"]::cue { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ss-caption-video[data-caption-background="soft"]::cue { background: rgba(0, 0, 0, 0.48); }
.ss-caption-video[data-caption-background="none"]::cue { background: transparent; }

.nx-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Whole-picture tap target. Sits under the bar and the menus. */
.nx-surface {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

/* ---------- top: title + logo ---------- */

.nx-scrim-top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 40px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.36) 46%, rgba(0, 0, 0, 0) 100%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 180ms ease;
}

.nx-scrim-top[aria-hidden="true"]:not(:has(.nx-logo)) { display: none; }

.nx-title {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nx-logo {
  flex: none;
  height: 30px;
  width: auto;
  max-width: 96px;
  object-fit: contain;
  opacity: 0.92;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

.nx-nulx-brand {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  flex: 0 0 auto;
  margin-right: 4px;
  padding: 2px 4px;
  border-radius: 6px;
  color: inherit;
  text-decoration: none;
  transition: opacity 180ms ease, background-color 160ms ease;
}

.nx-nulx-brand:hover { background: rgba(255, 255, 255, 0.12); }
.nx-nulx-brand:focus-visible { outline: 2px solid var(--player-accent, #22c55e); outline-offset: 1px; }

.nx-nulx-brand img { width: 18px; height: 18px; object-fit: contain; filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.65)); }
.nx-nulx-wordmark { color: rgba(255, 255, 255, 0.78); font-size: 9px; font-weight: 600; line-height: 1; letter-spacing: 0.02em; }

/* ---------- center: big play + spinner ---------- */

.nx-center {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.nx-bigplay {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  /* A flat dark circle disappears on a dark frame; the hairline keeps the
     button findable on black as well as on white. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 6px 24px rgba(0, 0, 0, 0.4);
  color: #fff;
  cursor: pointer;
  pointer-events: auto;
  backdrop-filter: blur(6px);
  transition: transform 160ms ease, opacity 160ms ease, background-color 160ms ease;
}

.nx-bigplay:hover { background: var(--player-accent, #22c55e); transform: scale(1.06); }
.nx-bigplay .nx-icon-lg { margin-left: 3px; }
.nx-stage[data-nx-state="playing"] .nx-bigplay,
.nx-stage[data-nx-state="waiting"] .nx-bigplay { opacity: 0; transform: scale(0.85); pointer-events: none; }

.nx-spinner {
  position: absolute;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.24);
  border-top-color: var(--player-accent, #22c55e);
  opacity: 0;
  transition: opacity 140ms ease;
}

.nx-stage[data-nx-state="waiting"] .nx-spinner { opacity: 1; animation: nx-spin 800ms linear infinite; }

@keyframes nx-spin { to { transform: rotate(360deg); } }

/* ---------- bottom: scrubber + control bar ---------- */

.nx-chrome {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 4;
  padding: 44px 8px 6px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.45) 52%, rgba(0, 0, 0, 0) 100%);
  opacity: 1;
  transform: translateY(0);
  transition: opacity 200ms ease, transform 200ms ease;
  pointer-events: none;
}

.nx-stage:not([data-nx-idle="true"]) .nx-chrome > .nx-scrub,
.nx-stage:not([data-nx-idle="true"]) .nx-chrome > .nx-bar { pointer-events: auto; }

.nx-stage[data-nx-idle="true"] .nx-chrome,
.nx-stage[data-nx-idle="true"] .nx-scrim-top {
  opacity: 0;
  pointer-events: none;
}

.nx-stage[data-nx-idle="true"] .nx-chrome { transform: translateY(8px); }
.nx-stage[data-nx-idle="true"] { cursor: none; }

/* Scrubber ------------------------------------------------ */

.nx-scrub {
  position: relative;
  display: flex;
  align-items: center;
  height: 18px;
  margin: 0 8px;
  cursor: pointer;
  touch-action: none;
}

.nx-scrub-track {
  position: relative;
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  transition: height 120ms ease;
}

.nx-scrub:hover .nx-scrub-track,
.nx-scrub:focus-visible .nx-scrub-track,
.nx-scrub[data-nx-dragging="true"] .nx-scrub-track { height: 5px; }

.nx-scrub-buffered,
.nx-scrub-played {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 999px;
  width: 0;
}

.nx-scrub-buffered { background: rgba(255, 255, 255, 0.42); }
.nx-scrub-played { background: var(--player-accent, #22c55e); }

.nx-scrub-knob {
  position: absolute;
  top: 50%;
  left: 0;
  width: 13px;
  height: 13px;
  margin-left: -6.5px;
  border-radius: 999px;
  background: var(--player-accent, #22c55e);
  transform: translateY(-50%) scale(0);
  transition: transform 120ms ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.nx-scrub:hover .nx-scrub-knob,
.nx-scrub:focus-visible .nx-scrub-knob,
.nx-scrub[data-nx-dragging="true"] .nx-scrub-knob { transform: translateY(-50%) scale(1); }

.nx-scrub-tip {
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.85);
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 120ms ease;
}

.nx-scrub:hover .nx-scrub-tip,
.nx-scrub[data-nx-dragging="true"] .nx-scrub-tip { opacity: 1; }

/* Button row ---------------------------------------------- */

.nx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 2px;
}

.nx-bar-left,
.nx-bar-right {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.nx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  opacity: 0.92;
  transition: background-color 140ms ease, opacity 140ms ease, color 140ms ease;
}

.nx-btn:hover { background: rgba(255, 255, 255, 0.14); opacity: 1; }
.nx-btn:focus-visible { outline: 2px solid var(--player-accent, #22c55e); outline-offset: -2px; }
.nx-btn[aria-pressed="false"] { opacity: 0.5; }
.nx-btn[aria-expanded="true"] { background: rgba(255, 255, 255, 0.18); }
.nx-btn-sm { width: 30px; height: 30px; }

.nx-icon { display: block; width: 22px; height: 22px; }
.nx-icon-lg { width: 30px; height: 30px; }
.nx-btn-sm .nx-icon { width: 16px; height: 16px; }

/* Both states of every toggle ship in the DOM; CSS picks one. Swapping
   innerHTML from JS would mean a second copy of each path in JavaScript. */
.nx-i-pause,
.nx-i-fs-exit,
.nx-i-vol-low,
.nx-i-vol-mute { display: none; }

.nx-stage[data-nx-state="playing"] .nx-i-play { display: none; }
.nx-stage[data-nx-state="playing"] .nx-i-pause { display: block; }
.nx-stage[data-nx-fullscreen="true"] .nx-i-fs-enter { display: none; }
.nx-stage[data-nx-fullscreen="true"] .nx-i-fs-exit { display: block; }
.nx-stage[data-nx-volume="low"] .nx-i-vol-high { display: none; }
.nx-stage[data-nx-volume="low"] .nx-i-vol-low { display: block; }
.nx-stage[data-nx-volume="mute"] .nx-i-vol-high { display: none; }
.nx-stage[data-nx-volume="mute"] .nx-i-vol-mute { display: block; }

/* The big centre button is a play affordance only; it is hidden while
   playing, so it never needs a pause face. */
.nx-bigplay .nx-i-pause { display: none; }

.nx-btn[data-nulx-player-target="settingsButton"] .nx-icon { transition: transform 220ms ease; }
.nx-btn[aria-expanded="true"][data-nulx-player-target="settingsButton"] .nx-icon { transform: rotate(35deg); }

/* Volume: the slider only takes room once you reach for it. */
.nx-volume { display: flex; align-items: center; }

.nx-volume-slider {
  width: 0;
  height: 3px;
  margin: 0;
  padding: 0;
  opacity: 0;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  cursor: pointer;
  transition: width 160ms ease, opacity 160ms ease, margin 160ms ease;
}

.nx-volume:hover .nx-volume-slider,
.nx-volume:focus-within .nx-volume-slider { width: 66px; opacity: 1; margin: 0 8px 0 2px; }

.nx-volume-slider::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

.nx-volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: #fff;
}

.nx-time {
  margin: 0 6px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nx-time-sep { margin: 0 3px; opacity: 0.5; }
.nx-time-total { opacity: 0.7; }

/* ---------- settings menu ---------- */

.nx-menu {
  position: absolute;
  right: 10px;
  bottom: 62px;
  z-index: 6;
  width: min(300px, calc(100% - 20px));
  max-height: min(62%, 340px);
  overflow-y: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(20, 20, 22, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  font-size: 13px;
}

.nx-menu-row,
.nx-menu-item,
.nx-menu-back {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #f4f4f5;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.nx-menu-row:hover,
.nx-menu-item:hover,
.nx-menu-back:hover { background: rgba(255, 255, 255, 0.1); }

.nx-menu-row-icon { display: flex; opacity: 0.75; }
.nx-menu-row-icon .nx-icon { width: 18px; height: 18px; }
.nx-menu-row-label { flex: 1 1 auto; min-width: 0; }
.nx-menu-row-value { color: rgba(255, 255, 255, 0.55); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nx-menu-row-more { display: flex; opacity: 0.5; }
.nx-menu-row-more .nx-icon { width: 16px; height: 16px; }

.nx-menu-back {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px 9px 0 0;
  margin-bottom: 4px;
  font-weight: 600;
}

.nx-menu-back .nx-icon { width: 18px; height: 18px; }

.nx-menu-heading { margin: 6px 10px 8px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.55); }

.nx-menu-item-check { display: flex; width: 18px; flex: none; opacity: 0; }
.nx-menu-item-check .nx-icon { width: 16px; height: 16px; color: var(--player-accent, #22c55e); }
.nx-menu-item.is-on .nx-menu-item-check { opacity: 1; }

.nx-menu-field { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; color: rgba(255, 255, 255, 0.6); font-size: 12px; }

.nx-menu-field select {
  width: 100%;
  min-height: 36px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: #16181d;
  color: #f4f4f5;
  font: inherit;
  font-size: 13px;
}

.nx-menu-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nx-chapter { align-items: baseline; }
.nx-chapter-time { flex: none; font-variant-numeric: tabular-nums; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.nx-chapter-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- transcript ---------- */

.nx-transcript {
  position: absolute;
  right: 10px;
  top: 56px;
  bottom: 62px;
  z-index: 6;
  width: min(340px, calc(100% - 20px));
  overflow-y: auto;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(20, 20, 22, 0.94);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  color: #e4e4e7;
}

.nx-transcript-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.nx-transcript h2 { margin: 0; font-size: 13px; font-weight: 600; }
.nx-transcript p { margin: 10px 0 0; font-size: 12px; color: rgba(255, 255, 255, 0.55); }
.nx-transcript ol { margin: 8px 0 0; padding: 0; list-style: none; }

.ss-transcript-cue {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 8px;
  width: 100%;
  padding: 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e4e4e7;
  font: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.ss-transcript-cue:hover { background: rgba(255, 255, 255, 0.08); }
.ss-transcript-time { font-variant-numeric: tabular-nums; font-size: 12px; color: rgba(255, 255, 255, 0.5); }

/* ---------- error ---------- */

.nx-error {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 62px;
  z-index: 5;
  margin: 0;
  padding: 7px 11px;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.78);
  color: #fda4af;
  font-size: 13px;
  font-weight: 500;
}

.nx-error:empty { display: none; }

/* ---------- narrow / touch ---------- */

@media (max-width: 560px) {
  .nx-hide-sm { display: none; }
  .nx-chrome { padding: 36px 4px 4px; }
  .nx-btn { width: 38px; height: 38px; }
  .nx-icon { width: 20px; height: 20px; }
  .nx-time { margin: 0 4px; font-size: 12px; }
  .nx-scrim-top { padding: 10px 12px 32px; }
  .nx-nulx-brand { margin-right: 2px; }
  .nx-title { font-size: 13px; }
  .nx-bigplay { width: 58px; height: 58px; }
  /* Touch has no hover, so a hidden volume slider is unreachable. The mute
     button stays; the slider does not pretend to exist. */
  .nx-volume-slider { display: none; }
  .nx-menu, .nx-transcript { right: 6px; left: 6px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-chrome, .nx-scrim-top, .nx-bigplay, .nx-scrub-track, .nx-scrub-knob, .nx-volume-slider { transition: none; }
  .nx-stage[data-nx-state="waiting"] .nx-spinner { animation-duration: 1600ms; }
}
