/* Espacio del creador: linktree y sitio personal. Las variables --sp-* vienen del diseño del creador. */
.nx-space {
    min-height: 100%;
    color: var(--sp-text);
    font-family: var(--sp-font);
    position: relative;
    padding: 56px 18px 32px;
}
.nx-space * { box-sizing: border-box; }
.sp-wrap { width: min(var(--sp-width), 100%); margin: 0 auto; text-align: var(--sp-align); }
.sp-head { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 18px; }
.nx-space.align-left .sp-head { align-items: flex-start; }
.sp-avatar { width: var(--sp-avatar); height: var(--sp-avatar); border-radius: var(--sp-avatar-radius); object-fit: cover; border: 3px solid var(--sp-border); box-shadow: 0 10px 30px var(--sp-shadow); }
.sp-avatar-empty { display: grid; place-items: center; font: 800 calc(var(--sp-avatar) / 2.6) var(--sp-heading); background: var(--sp-button); color: var(--sp-button-text); }
.sp-name { font-family: var(--sp-heading); font-size: clamp(24px, 8vw, var(--sp-name)); line-height: 1.08; margin: 6px 0 0; font-weight: 800; letter-spacing: -.01em; }
.sp-tagline { margin: 0; color: var(--sp-accent); font-weight: 600; }
.sp-verified { margin: 0; font-size: .85rem; color: var(--sp-muted); }
.sp-verified i { color: var(--sp-accent); }
.sp-networks { list-style: none; padding: 0; margin: 0 0 18px; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.nx-space.align-left .sp-networks { justify-content: flex-start; }
.sp-networks > li > a, .sp-networks > li > span { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--sp-button); color: var(--sp-button-text); border: 1px solid var(--sp-border); text-decoration: none; font-size: .9rem; font-weight: 600; }
.sp-bio { color: var(--sp-muted); line-height: 1.6; margin: 0 auto 22px; max-width: 60ch; white-space: pre-line; }
.sp-content { display: grid; gap: var(--sp-gap); }
.sp-links { display: grid; gap: var(--sp-gap); }
.sp-link {
    display: flex; align-items: center; gap: 12px; min-height: var(--sp-height); padding: 10px 18px; width: 100%;
    border-radius: var(--sp-radius); background: var(--sp-button); color: var(--sp-button-text); border: 1px solid var(--sp-border);
    text-decoration: none; font: 600 1rem var(--sp-font); cursor: pointer; text-align: left;
    box-shadow: 0 6px 20px var(--sp-shadow); transition: transform .15s, box-shadow .15s;
}
.sp-link span { flex: 1; text-align: center; padding-right: 28px; }
.nx-space.align-left .sp-link span { text-align: left; padding-right: 0; }
.sp-link i { width: 22px; text-align: center; color: var(--sp-accent); font-size: 1.1rem; }
.sp-link-highlight { background: var(--sp-accent); color: var(--sp-accent-text, #fff); border-color: var(--sp-accent); }
.sp-link-highlight i { color: inherit; }
.buttons-glass .sp-link { backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.buttons-solid .sp-link:not(.sp-link-highlight) { background: var(--sp-button-solid); }
.buttons-outline .sp-link:not(.sp-link-highlight) { background: transparent; border-width: 2px; color: var(--sp-text); box-shadow: none; }
.buttons-soft .sp-link:not(.sp-link-highlight) { border-color: transparent; }
.hover-lift .sp-link:hover { transform: translateY(-2px); }
.hover-glow .sp-link:hover { box-shadow: 0 0 0 3px var(--sp-accent), 0 10px 30px var(--sp-shadow); }
.sp-section { margin-top: 18px; padding: 22px; border-radius: var(--sp-radius); background: var(--sp-button); border: 1px solid var(--sp-border); text-align: left; color: var(--sp-button-text); }
.sp-section h2 { font-family: var(--sp-heading); font-size: 1.2rem; margin: 0 0 10px; }
.sp-section p { margin: 0 0 10px; line-height: 1.6; }
.sp-section .sp-link { box-shadow: none; }
.sp-highlights { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.sp-videos { display: grid; gap: 12px; }
.sp-video { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: #000; }
.sp-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.sp-empty { color: var(--sp-muted); text-align: center; }
.sp-share { position: absolute; top: 16px; right: 16px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--sp-border); background: var(--sp-button); color: var(--sp-button-text); cursor: pointer; }
.sp-footer { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; font-size: .82rem; color: var(--sp-muted); }
.sp-footer a { color: var(--sp-muted); }
.sp-admin { opacity: .7; }

/* Estructura «tarjetas»: enlaces en dos columnas en pantallas amplias */
@media (min-width: 720px) {
    .layout-cards .sp-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .layout-split .sp-wrap { width: min(1080px, 100%); display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px 48px; text-align: left; }
    .layout-split .sp-head, .layout-split .sp-networks, .layout-split .sp-bio { grid-column: 1; align-items: flex-start; justify-content: flex-start; margin-left: 0; }
    .layout-split .sp-content { grid-column: 2; grid-row: 1 / span 4; }
    .layout-split .sp-footer { grid-column: 1 / -1; }
}
.is-animated .sp-link, .is-animated .sp-head { animation: sp-in .5s ease-out both; }
.is-animated .sp-link:nth-child(2) { animation-delay: .04s; } .is-animated .sp-link:nth-child(3) { animation-delay: .08s; }
.is-animated .sp-link:nth-child(4) { animation-delay: .12s; } .is-animated .sp-link:nth-child(n+5) { animation-delay: .16s; }
@keyframes sp-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .is-animated .sp-link, .is-animated .sp-head { animation: none; } }

/* Página independiente del espacio */
body.space-page { margin: 0; min-height: 100vh; background: #050814; }
body.space-page #space { min-height: 100vh; }
.sp-dialog { width: min(520px, calc(100vw - 24px)); border: 0; border-radius: 18px; padding: 24px; font-family: system-ui, sans-serif; color: #0e1424; }
.sp-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.sp-dialog h2 { margin: 0 0 6px; }
.sp-dialog p { color: #4a5570; margin: 0 0 16px; }
.sp-dialog form { display: grid; gap: 10px; }
.sp-dialog label { display: grid; gap: 4px; font-size: .9rem; font-weight: 600; }
.sp-dialog input, .sp-dialog textarea { font: inherit; padding: 10px 12px; border: 1px solid #c7cfe0; border-radius: 10px; }
.sp-dialog textarea { min-height: 100px; }
.sp-dialog .row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.sp-dialog button { font: 600 .95rem system-ui, sans-serif; padding: 11px 18px; border-radius: 999px; border: 1px solid #c7cfe0; background: #fff; cursor: pointer; }
.sp-dialog button[type="submit"] { background: #1f5eff; border-color: #1f5eff; color: #fff; }
.sp-dialog .status { min-height: 1.2em; font-size: .9rem; color: #b4234a; margin: 0; }

/* Galería de colaboraciones */
.sp-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.sp-photo { position: relative; padding: 0; border: 0; border-radius: 12px; overflow: hidden; aspect-ratio: 1; cursor: zoom-in; background: rgba(0, 0, 0, .2); }
.sp-photo img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.sp-photo:hover img, .sp-photo:focus-visible img { transform: scale(1.05); }
.sp-photo-cap { position: absolute; inset: auto 0 0; display: grid; padding: 18px 10px 8px; text-align: left; color: #fff; font-size: .78rem; background: linear-gradient(transparent, rgba(0, 0, 0, .75)); }
.sp-photo-cap small { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-viewer { max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; margin: 0; padding: 0; border: 0; background: rgba(4, 8, 20, .94); color: #fff; display: grid; place-items: center; }
.sp-viewer:not([open]) { display: none; }
.sp-viewer::backdrop { background: rgba(0, 0, 0, .7); }
.sp-viewer img { max-width: min(92vw, 1600px); max-height: 80vh; object-fit: contain; border-radius: 10px; }
.sp-viewer p { position: absolute; bottom: 18px; left: 0; right: 0; margin: 0; text-align: center; font: 500 .95rem system-ui, sans-serif; padding: 0 70px; }
.sp-viewer button { position: absolute; width: 48px; height: 48px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .08); color: #fff; cursor: pointer; font-size: 1.1rem; }
.sp-viewer-close { top: 16px; right: 16px; }
.sp-viewer-prev { left: 16px; top: 50%; translate: 0 -50%; }
.sp-viewer-next { right: 16px; top: 50%; translate: 0 -50%; }

/* Contacto comercial discreto en el enlace para compartir */
.sp-contact-link { flex-basis: 100%; background: none; border: 0; padding: 4px; color: var(--sp-muted); font: 600 .85rem var(--sp-font); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.sp-contact-link:hover { color: var(--sp-text); }
