/* Spotlight Card v2 - deployed client styles
   Immersive full-screen page: a single full-bleed photo/video/gradient/solid
   background under a fixed dark scrim (rgba(0,0,0,0.5)), with centered white
   content scrolling on top. Visuals mirror the editor's sp-* preview rules
   (NewEditor.css); the page chrome follows the legacy Spotlight Card deployed
   layout (the whole viewport IS the page - no desktop card frame): centered
   content column 460px mobile / 518px desktop, name 28px mobile / 32px
   desktop. Per-link surfaces (glass / solid / gradient) and corner radius
   arrive via inline CSS vars (--sp-link-*, --sp-card-*, --sp-gallery-*,
   --sp-media-*, --sp-note-radius).
   VERSION: 1.0 */

* { box-sizing: border-box; }

html,
body,
#root {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body {
  background: #000000;
  color: #ffffff;
  font-family: 'Inter', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Full-bleed root: fixed background + scrim, content scrolls above. */
.sp-root {
  position: fixed;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  color: #ffffff;
  background: #000000;
  font-family: 'Inter', system-ui, sans-serif;
}

.sp-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* The signature dark scrim that keeps white content readable */
.sp-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

.sp-scroll {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 40px 20px 36px;
  -webkit-overflow-scrolling: touch;
}
.sp-scroll::-webkit-scrollbar { display: none; width: 0; height: 0; }

.sp-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.sp-reorder-stack { width: 100%; display: flex; flex-direction: column; }
.sp-section-item { position: relative; width: 100%; display: flex; flex-direction: column; align-items: center; }
.sp-section-item + .sp-section-item { margin-top: 20px; }
.sp-reorder-stack .sp-section-item + .sp-section-item { margin-top: 20px; }
.sp-section-item.is-pinned { margin-bottom: 16px; }

/* Desktop: same full-bleed page, slightly wider column + larger name. */
@media (min-width: 768px) {
  .sp-stack { max-width: 518px; }
  .sp-name { font-size: 32px; }
}

/* Avatar - circular with ring (ring colour/size via inline vars) */
.sp-avatar {
  position: relative;
  width: var(--sp-avatar-size, 104px);
  height: var(--sp-avatar-size, 104px);
  padding: var(--sp-avatar-ring-size, 3px);
  border-radius: 50%;
  background: var(--sp-avatar-ring-color, #ffffff);
  display: grid;
  place-items: center;
}
.sp-avatar.has-shadow { box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); }
.sp-avatar-inner {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.12);
  font-size: calc(var(--sp-avatar-size, 104px) * 0.38);
  font-weight: 700;
  color: #ffffff;
}
.sp-avatar-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-avatar.is-image .sp-avatar-inner { background: transparent; }

/* Profile */
.sp-profile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}
.sp-name { font-size: 28px; line-height: 1.25; margin: 0 0 4px; word-break: break-word; }
.sp-verified-badge { width: 0.9em; height: 0.9em; flex: none; vertical-align: middle; }
.sp-handle { margin: 0 0 4px; }
.sp-bio { margin: 6px 0 0; max-width: 340px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.sp-pills { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 8px; }
.sp-pill { display: inline-flex; align-items: center; gap: 5px; }
.sp-pill-icon { width: 12px; height: 12px; }
.sp-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  flex-shrink: 0;
  animation: sp-pulse 2s ease-in-out infinite;
}
@keyframes sp-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* Socials - circular chips */
.sp-socials {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.sp-social {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease;
  font-size: 10px;
  font-weight: 700;
  color: #111111;
}
.sp-social:hover { transform: translateY(-2px); }
.sp-social:focus-visible { outline: 2px solid rgba(120, 170, 255, 0.7); outline-offset: 2px; }
.sp-social.is-disabled { cursor: default; opacity: 0.7; }
.sp-social.is-disabled:hover { transform: none; }
.sp-social img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-socials.is-mono .sp-social { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.25); }
.sp-socials.is-mono .sp-social img { filter: grayscale(1) brightness(2); }
.sp-socials.is-badge .sp-social { width: 46px; height: 46px; }

/* Links column */
.sp-links { display: flex; flex-direction: column; gap: 12px; width: 100%; }
.sp-link-wrap { position: relative; width: 100%; }
.sp-link-anchor {
  display: block;
  position: relative;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  outline-offset: 2px;
  border-radius: var(--sp-link-radius, 14px);
}
.sp-link-anchor:focus-visible { outline: 2px solid rgba(120, 170, 255, 0.7); }

/* Simple link - the spotlight button (glass / solid / gradient surface) */
.sp-link-card {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  padding: 16px 20px;
  border-radius: var(--sp-link-radius, 14px);
  background: var(--sp-link-bg, rgba(255, 255, 255, 0.1));
  border: 1px solid var(--sp-link-border, rgba(255, 255, 255, 0.2));
  box-shadow: var(--sp-link-shadow, 0 4px 12px rgba(0, 0, 0, 0.2));
  color: var(--sp-link-text, #ffffff);
  overflow: hidden;
  transition: transform 0.15s ease;
}
.sp-link-card.is-glass { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sp-link-wrap:hover .sp-link-card { transform: translateY(-1px); }
.sp-link-icon { display: inline-flex; align-items: center; flex-shrink: 0; }
.sp-link-icon img {
  width: 17px;
  height: 17px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-link-icon span { font-size: 10px; font-weight: 800; line-height: 1; }
.sp-link-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-align: center;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Header block */
.sp-link-header {
  width: 100%;
  padding: 6px 2px 0;
  letter-spacing: 0.1em;
  font-weight: 600;
  background: var(--sp-header-bg, transparent);
  border-bottom: 1px solid var(--sp-header-border, transparent);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.4);
}

/* Text block - glass note */
.sp-link-note {
  width: 100%;
  box-sizing: border-box;
  padding: 14px 16px;
  border-radius: var(--sp-note-radius, 14px);
  background: var(--sp-text-bg, rgba(255, 255, 255, 0.1));
  border: 1px solid var(--sp-text-border, rgba(255, 255, 255, 0.2));
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Divider */
.sp-link-divider { display: flex; align-items: center; width: 100%; padding: 4px 0; }
.sp-link-divider span {
  display: block;
  width: 100%;
  height: var(--sp-divider-thickness, 2px);
  border-radius: 99px;
  background: var(--sp-divider-color, rgba(255, 255, 255, 0.35));
}
.sp-link-divider-chars { color: var(--sp-divider-color, rgba(255, 255, 255, 0.7)); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); }
.sp-link-divider-chars span { background: none; width: auto; height: auto; letter-spacing: 0.3em; }

/* Featured card - image hero with overlay copy */
.sp-featured-card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--sp-card-radius, 14px);
  border: 1px solid var(--sp-card-border, rgba(255, 255, 255, 0.2));
  background: var(--sp-card-bg, rgba(255, 255, 255, 0.1));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.sp-featured-card.is-glass { backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sp-featured-image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-featured-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 12px, rgba(255,255,255,0.09) 12px 24px);
}
.sp-featured-copy {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 14px 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.sp-featured-card.is-empty .sp-featured-copy { background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 100%); }
.sp-featured-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
  font-weight: 700;
  color: var(--sp-card-title, #ffffff);
}
.sp-featured-icon { display: inline-flex; align-items: center; }
.sp-featured-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-featured-icon span { font-size: 9px; font-weight: 800; line-height: 1; }
.sp-featured-subtitle { font-size: 12px; color: var(--sp-card-subtitle, rgba(255, 255, 255, 0.85)); }

/* Gallery - rounded glass tiles */
.sp-gallery-card { width: 100%; }
.sp-gallery-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sp-gallery-text, #ffffff);
  opacity: 0.8;
  margin-bottom: 8px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.sp-gallery-grid {
  display: grid;
  grid-template-columns: repeat(var(--sp-gallery-columns, 2), minmax(0, 1fr));
  gap: 12px;
}
.sp-gallery-tile {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}
.sp-gallery-tile.is-clickable { cursor: zoom-in; }
.sp-gallery-tile.is-clickable:focus-visible { outline: 2px solid rgba(120, 170, 255, 0.7); outline-offset: 2px; }
.sp-gallery-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--sp-gallery-radius, 14px);
  border: 1px solid var(--sp-gallery-border, rgba(255, 255, 255, 0.2));
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}
.sp-gallery-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}
.sp-gallery-empty {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 12px, rgba(255,255,255,0.09) 12px 24px);
}
.sp-gallery-label {
  padding: 7px 4px 0;
  font-size: 12px;
  font-weight: 500;
  color: var(--sp-gallery-text, #ffffff);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Media embed - rounded frame, sizing applied inline per platform */
.sp-media-card { width: 100%; }
.sp-media-frame {
  width: 100%;
  display: block;
  border: 1px solid var(--sp-media-border, rgba(255, 255, 255, 0.2));
  border-radius: var(--sp-media-radius, 14px);
  background: #000;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}
.sp-media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  border: 1px dashed var(--sp-media-border, rgba(255, 255, 255, 0.3));
  border-radius: var(--sp-media-radius, 14px);
  color: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.06);
}
.sp-media-copy { padding: 8px 4px 0; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4); }
.sp-media-title { font-size: 13px; font-weight: 600; color: var(--sp-media-title, #ffffff); }
.sp-media-caption { font-size: 11px; margin-top: 2px; color: var(--sp-media-caption, rgba(255, 255, 255, 0.65)); }

/* Link animations - bounce/pulse/shine shared shapes + spotlight neon/glow */
@keyframes sp-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.sp-link-anim-bounce { animation: sp-bounce 2s ease-in-out infinite; }
@keyframes sp-scale-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.03); } }
.sp-link-anim-pulse { animation: sp-scale-pulse 2s ease-in-out infinite; }
.sp-link-anim-shine { position: relative; overflow: hidden; }
.sp-link-anim-shine::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -100%;
  width: 60%;
  height: 200%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 25%, rgba(255,255,255,0.16) 50%, rgba(255,255,255,0.03) 75%, transparent 100%);
  transform: skewX(-15deg);
  animation: sp-shine 4s ease-in-out infinite;
  z-index: 1;
  pointer-events: none;
}
@keyframes sp-shine {
  0% { left: -100%; opacity: 0; }
  10% { opacity: 1; }
  50% { left: 100%; opacity: 1; }
  55% { opacity: 0; }
  100% { left: 100%; opacity: 0; }
}
@keyframes sp-link-glow {
  0%, 100% { box-shadow: 0 0 6px rgba(255, 255, 255, 0.35), 0 0 14px rgba(255, 255, 255, 0.2); }
  50% { box-shadow: 0 0 16px rgba(255, 255, 255, 0.55), 0 0 30px rgba(255, 255, 255, 0.3); }
}
.sp-link-anim-glow { animation: sp-link-glow 2.4s ease-in-out infinite; }
@keyframes sp-link-neon {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6), 0 0 18px rgba(255, 255, 255, 0.4), 0 0 32px rgba(255, 255, 255, 0.25);
    filter: brightness(1.15);
  }
  20%, 24%, 55% {
    box-shadow: 0 0 4px rgba(255, 255, 255, 0.3), 0 0 8px rgba(255, 255, 255, 0.2);
    filter: brightness(0.85);
  }
}
.sp-link-anim-neon { animation: sp-link-neon 1.6s infinite alternate; }

/* Empty state (also styles the SSR fallback) */
.sp-empty-prompt {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 64px 28px;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.sp-empty-title { font-size: 16px; font-weight: 700; color: #ffffff; }
.sp-empty-sub { font-size: 12px; margin-top: 6px; color: rgba(255, 255, 255, 0.7); }

/* Adult content inline warning - dark glass, hugs the card's radius */
.sp-link-anchor.has-adult-warning { overflow: hidden; }
.sp-adult-inline {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 10px;
  background: rgba(0, 0, 0, 0.88);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  color: #ffffff;
  text-align: center;
  border-radius: inherit;
}
.sp-adult-inline-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 300px; }
.sp-adult-inline-title {
  display: block;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sp-adult-inline-body { display: block; color: rgba(255, 255, 255, 0.8); font-size: 11px; font-weight: 400; line-height: 1.3; }
.sp-adult-actions { display: flex; justify-content: center; gap: 8px; width: 100%; }
.sp-adult-btn {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 6px 14px;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  transition: background 0.15s ease;
}
.sp-adult-btn.secondary { background: rgba(255, 255, 255, 0.1); color: #ffffff; }
.sp-adult-btn.secondary:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.35); }
.sp-adult-btn.primary { border-color: #ffffff; background: #ffffff; color: #0a0a0a; }
.sp-adult-btn.primary:hover { background: rgba(255, 255, 255, 0.9); }
/* Compact variant for the 56px simple buttons */
.sp-link-anchor-simple .sp-adult-inline { padding: 7px 10px; }
.sp-link-anchor-simple .sp-adult-inline-inner { gap: 6px; }
.sp-link-anchor-simple .sp-adult-inline-title { display: none; }
.sp-link-anchor-simple .sp-adult-inline-body { font-size: 10px; white-space: nowrap; }
.sp-link-anchor-simple .sp-adult-btn { min-height: 22px; padding: 3px 10px; font-size: 10px; }

/* Gallery image lightbox - dark glass */
.sp-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.8);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}
.sp-image-panel { position: relative; width: min(760px, 100%); max-height: min(82vh, 760px); display: grid; gap: 10px; }
.sp-image-preview {
  width: 100%;
  max-height: min(76vh, 700px);
  display: block;
  object-fit: contain;
  background: #000000;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
  user-select: none;
  -webkit-user-drag: none;
}
.sp-image-close {
  justify-self: end;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.12);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sp-image-close:hover { background: rgba(255, 255, 255, 0.2); }
.sp-image-caption {
  justify-self: center;
  max-width: min(560px, 100%);
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #ffffff;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  .sp-status-dot,
  .sp-link-anim-bounce,
  .sp-link-anim-pulse,
  .sp-link-anim-glow,
  .sp-link-anim-neon,
  .sp-link-anim-shine::before {
    animation: none !important;
  }
}
