/* YouTube-style share modal for all players.
   Mounted inside #player (position:relative) so it works in fullscreen.
   Sized to the player frame — header stays pinned so close is always visible. */
.pa-share-backdrop {
  position: absolute;
  inset: 0;
  z-index: 12000;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(6px, 2.2vmin, 16px);
  box-sizing: border-box;
  pointer-events: auto;
  overflow: hidden;
}
.pa-share-backdrop[hidden] {
  display: none !important;
}
.pa-share-modal {
  width: min(420px, 100%);
  max-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: clamp(10px, 2vmin, 14px);
  background: #212121;
  color: #f1f1f1;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-family: "Figtree", system-ui, sans-serif;
}
.pa-share-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: clamp(8px, 1.8vmin, 14px) clamp(10px, 2vmin, 16px) clamp(4px, 1vmin, 8px);
  background: #212121;
  position: relative;
  z-index: 1;
}
.pa-share-head h2 {
  margin: 0;
  font-size: clamp(0.95rem, 2.6vmin, 1.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}
.pa-share-close {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.pa-share-close:hover {
  background: rgba(255, 255, 255, 0.1);
}
.pa-share-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}
.pa-share-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: clamp(4px, 1vmin, 8px) clamp(10px, 2vmin, 16px) clamp(10px, 2vmin, 16px);
}
.pa-share-title {
  margin: 0 0 clamp(8px, 1.6vmin, 12px);
  font-size: clamp(0.8rem, 2.2vmin, 0.9rem);
  color: #aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pa-share-social {
  display: flex;
  gap: clamp(8px, 1.8vmin, 12px);
  overflow-x: auto;
  padding: 2px 2px clamp(10px, 2vmin, 14px);
  scrollbar-width: none;
}
.pa-share-social::-webkit-scrollbar {
  display: none;
}
.pa-share-social a,
.pa-share-social button.pa-share-social-item {
  appearance: none;
  border: 0;
  background: transparent;
  flex: 0 0 auto;
  width: clamp(52px, 12vmin, 60px);
  padding: 0;
  text-decoration: none;
  color: #fff;
  text-align: center;
  font-size: clamp(0.62rem, 1.8vmin, 0.7rem);
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.pa-share-social .pa-share-ico {
  width: clamp(42px, 10vmin, 52px);
  height: clamp(42px, 10vmin, 52px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin: 0 auto 5px;
  background: #3f3f3f;
}
.pa-share-social .pa-share-ico svg {
  width: clamp(20px, 4.8vmin, 24px);
  height: clamp(20px, 4.8vmin, 24px);
  fill: currentColor;
}
.pa-share-social [data-net="copy"] .pa-share-ico { background: #3ea6ff; color: #0f0f0f; }
.pa-share-social [data-net="copy"].is-done .pa-share-ico { background: #2ba640; color: #fff; }
.pa-share-social a[data-net="whatsapp"] .pa-share-ico { background: #25d366; color: #fff; }
.pa-share-social a[data-net="telegram"] .pa-share-ico { background: #229ed9; color: #fff; }
.pa-share-social a[data-net="x"] .pa-share-ico { background: #111; color: #fff; border: 1px solid rgba(255,255,255,.12); }
.pa-share-social a[data-net="facebook"] .pa-share-ico { background: #1877f2; color: #fff; }
.pa-share-social a[data-net="reddit"] .pa-share-ico { background: #ff4500; color: #fff; }
.pa-share-social a[data-net="email"] .pa-share-ico { background: #5f6368; color: #fff; }

.pa-share-field {
  margin-top: clamp(6px, 1.4vmin, 10px);
}
.pa-share-field label {
  display: block;
  font-size: clamp(0.68rem, 1.8vmin, 0.75rem);
  font-weight: 600;
  color: #aaa;
  margin-bottom: 5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pa-share-row {
  display: flex;
  gap: 6px;
  align-items: stretch;
}
.pa-share-row input,
.pa-share-row textarea {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: #121212;
  color: #fff;
  border-radius: 8px;
  padding: clamp(7px, 1.4vmin, 10px) clamp(8px, 1.6vmin, 12px);
  font: 600 clamp(0.72rem, 2vmin, 0.84rem)/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}
.pa-share-row textarea {
  min-height: clamp(40px, 10vmin, 64px);
  max-height: 18vmin;
  resize: none;
}
.pa-share-copy {
  appearance: none;
  border: 0;
  border-radius: 8px;
  background: #3ea6ff;
  color: #0f0f0f;
  font-weight: 700;
  font-size: clamp(0.75rem, 2vmin, 0.84rem);
  padding: 0 clamp(10px, 2vmin, 14px);
  cursor: pointer;
  white-space: nowrap;
}
.pa-share-copy:hover {
  filter: brightness(1.06);
}
.pa-share-copy.is-done {
  background: #2ba640;
  color: #fff;
}
.pa-share-start {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: clamp(6px, 1.4vmin, 10px);
  font-size: clamp(0.78rem, 2.1vmin, 0.86rem);
  color: #ddd;
  cursor: pointer;
  user-select: none;
}
.pa-share-start input {
  width: 15px;
  height: 15px;
  accent-color: #3ea6ff;
  flex: 0 0 auto;
}
.pa-share-hint {
  margin: 6px 0 0;
  font-size: clamp(0.68rem, 1.8vmin, 0.75rem);
  color: #888;
}

/* Short player / landscape phone — keep close in view, tighten stack */
@media (max-height: 480px) {
  .pa-share-backdrop {
    align-items: flex-start;
    padding: 6px;
  }
  .pa-share-close {
    width: 32px;
    height: 32px;
  }
  .pa-share-hint {
    display: none;
  }
  .pa-share-row textarea {
    min-height: 36px;
    max-height: 48px;
  }
}
@media (max-width: 360px) {
  .pa-share-backdrop {
    padding: 6px;
  }
  .pa-share-social a,
  .pa-share-social button.pa-share-social-item {
    width: 48px;
  }
}

/* Top-right share + partner — flex sibling of title (no absolute reserve) */
.embed-chrome-actions {
  position: static;
  z-index: 6;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  pointer-events: auto;
  max-width: min(46vw, 180px);
}
.embed-chrome-actions .embed-share-btn {
  order: 99; /* always last after partner logo */
}
.embed-share-btn {
  appearance: none;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(10, 13, 18, 0.55);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.embed-share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  display: block;
}
.embed-share-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  transform: scale(1.04);
}
/* Partner logo sits in the actions row now */
.embed-chrome-actions .partner-brand {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
}
body.is-series .embed-chrome-actions .embed-share-btn,
body.is-series-demo .embed-chrome-actions .embed-share-btn {
  /* Series uses #btnShareSeries in .top-actions */
  display: none !important;
}
/* Empty actions row (series: share hidden, no partner) — collapse */
body.is-series .embed-chrome-actions:not(:has(.partner-brand)),
body.is-series-demo .embed-chrome-actions:not(:has(.partner-brand)) {
  display: none;
}
.partner-brand-logo {
  max-width: min(28vw, 120px);
  max-height: 32px;
}
@media (max-width: 480px) {
  .embed-chrome-actions {
    gap: 8px;
    max-width: min(40vw, 140px);
  }
  .embed-share-btn {
    width: 34px;
    height: 34px;
  }
}
