:root {
  color-scheme: dark;
  --bg: #000000;
  --surface: #141217;
  --surface-2: #1E1A24;
  --surface-3: #2A2530;
  --text: #F4F1FA;
  --muted: #A79FB5;
  --ink: #08070A;
  --green: #3DD68C;
  --green-soft: #10331F;
  --green-text: #5BE3A0;
  --purple: #7C4DEB;
  --purple-soft: #2A1D47;
  --purple-text: #C4B0FF;
  --red: #D9201C;
  --display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --body: 'Figtree', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--purple-text); }
a:hover { color: #E2D8FF; }
:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; border-radius: 12px; }
h1, h2, h3 { font-family: var(--display); margin: 0; }

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 88px;
}

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 24px;
  border-radius: 999px; border: 0;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn:active { transform: translateY(0); }
.btn-green { background: var(--green); color: var(--ink); }
.btn-green:hover { color: var(--ink); }
.btn-purple { background: var(--purple); color: #fff; }
.btn-purple:hover { color: #fff; }
.btn-ghost { background: var(--surface-3); color: var(--text); }
.btn-ghost:hover { color: var(--text); }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; }
.btn-outline:hover { color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* Logo del canal */
.logo-circle {
  border-radius: 999px; background: var(--purple-soft); color: var(--purple-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; overflow: hidden; flex: none;
}
.logo-circle img { width: 100%; height: 100%; object-fit: cover; }

/* Navegación */
.nav {
  position: sticky; top: 12px; z-index: 10;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  background: rgba(20, 18, 23, .88); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-radius: 999px; padding: 8px;
}
.brand {
  display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text);
  font-family: var(--display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; padding-right: 12px;
}
.brand:hover { color: var(--text); }
.brand .logo-circle { width: 44px; height: 44px; font-size: 20px; box-shadow: 0 0 0 2px var(--green); }
.nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.nav-links a:not(.btn) { color: var(--text); text-decoration: none; padding: 12px 14px; border-radius: 999px; font-weight: 500; }
.nav-links a:not(.btn):hover { background: var(--surface-3); }

/* Bienvenida */
.hero {
  background: var(--purple); color: #fff; border-radius: 40px;
  padding: clamp(32px, 6vw, 64px) clamp(24px, 5vw, 56px);
  display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: space-between;
}
.hero-text { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero h1 { font-weight: 800; font-size: clamp(52px, 9vw, 112px); line-height: .92; letter-spacing: -0.04em; }
.hero p { margin: 0; font-size: 20px; max-width: 34ch; color: #F3EEFF; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-side { flex: 0 1 340px; display: flex; flex-direction: column; align-items: center; gap: 20px; margin: 0 auto; }
.hero-side .logo-circle {
  width: clamp(160px, 30vw, 220px); height: clamp(160px, 30vw, 220px);
  font-size: 96px; background: #000; box-shadow: 0 0 0 8px var(--green);
  animation: pop .7s cubic-bezier(.2, 1.4, .4, 1) both;
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { border-radius: 999px; padding: 10px 18px; font-weight: 600; background: #000; color: #fff; }
.chip.green { background: var(--green); color: var(--ink); }
.chip.chip-kick { color: var(--green-text); }
.chip:nth-child(1) { transform: rotate(-4deg); }
.chip:nth-child(2) { transform: rotate(3deg); }
.chip:nth-child(3) { transform: rotate(-5deg); }
.chip:nth-child(4) { transform: rotate(2deg); }
.chip:nth-child(5) { transform: rotate(5deg); }

/* Secciones */
.section { display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.section-head h2 { font-weight: 700; font-size: clamp(38px, 5vw, 48px); letter-spacing: -0.03em; line-height: 1; }
.section-head p { margin: 0; color: var(--muted); max-width: 42ch; }

/* Proyectos */
.projects { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.project {
  background: var(--surface); border-radius: 28px; padding: 32px;
  display: flex; flex-direction: column; gap: 14px; min-height: 220px;
  min-width: 0; container-type: inline-size;
}
.project h3 { font-weight: 700; font-size: 32px; letter-spacing: -0.02em; line-height: 1.1; }
.project p { margin: 0; color: var(--muted); flex-grow: 1; }
.project a { font-weight: 600; text-decoration: none; color: var(--green-text); }
.tag { align-self: flex-start; border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.tag.purple { background: var(--purple-soft); color: var(--purple-text); }
.tag.green { background: var(--green-soft); color: var(--green-text); }
.empty { color: var(--muted); background: var(--surface); border-radius: 28px; padding: 32px; }

/* Tienda */
.shop { background: var(--surface); border-radius: 40px; padding: clamp(24px, 5vw, 56px); display: flex; flex-direction: column; gap: 28px; }
.shop-note { display: flex; align-items: flex-start; gap: 10px; margin: 0; font-size: 15px; color: var(--text) !important; }
.shop-note svg { flex: none; margin-top: 2px; }
#myShop { min-height: 300px; border-radius: 24px; overflow: hidden; }
.shop-placeholder { background: var(--surface-2); border-radius: 24px; padding: 32px; color: var(--muted); }

/* Vídeos y directos */
.media { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.media-card {
  border-radius: 40px; text-decoration: none; display: flex; flex-direction: column;
  justify-content: space-between; gap: 18px; transition: transform .2s ease;
}
.media-card:hover { transform: translateY(-3px); }
.media-card .title { font-family: var(--display); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-size: 56px; }
.media-card .sub { font-size: 17px; }
.yt { flex: 1 1 420px; min-height: 420px; padding: 48px; background: var(--red); color: #fff; }
.yt:hover { color: #fff; }
.yt .logo-circle { width: 120px; height: 120px; font-size: 52px; background: #000; }
.yt .title { font-size: clamp(56px, 7vw, 88px); letter-spacing: -0.04em; line-height: .95; }
.yt .handle { font-size: 18px; font-weight: 600; }
.live-col { flex: 1 1 340px; display: flex; flex-direction: column; gap: 16px; }
.twitch { flex: 1 1 auto; padding: 36px; background: var(--purple); color: #fff; }
.twitch:hover { color: #fff; }
.kick { flex: 1 1 auto; padding: 36px; background: var(--green); color: var(--ink); }
.kick:hover { color: var(--ink); }
.status {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 10px;
  background: #000; color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 15px;
}
.status .dot { width: 10px; height: 10px; border-radius: 999px; background: #6E6878; }
.status.is-live .dot { background: var(--green); animation: livepulse 1.6s infinite; }
@keyframes livepulse {
  0% { box-shadow: 0 0 0 0 rgba(61, 214, 140, .7); }
  70% { box-shadow: 0 0 0 10px rgba(61, 214, 140, 0); }
  100% { box-shadow: 0 0 0 0 rgba(61, 214, 140, 0); }
}

/* Pie */
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; color: var(--muted); font-size: 15px; padding: 0 8px; }
.footer a { color: var(--muted); text-decoration: none; padding: 12px 0; }
.footer a:hover { color: var(--text); }

/* Portal */
.panel { background: var(--surface); border-radius: 36px; padding: clamp(24px, 4vw, 40px); display: flex; flex-direction: column; gap: 24px; }
.panel h1, .panel h2 { font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.panel h1 { font-size: 40px; }
.panel h2 { font-size: 32px; }
.muted { color: var(--muted); margin: 0; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 600; font-size: 15px; }
.input {
  font: inherit; font-weight: 400; color: var(--text); background: var(--bg);
  border: 2px solid var(--surface-3); border-radius: 999px; padding: 12px 20px; min-height: 48px; width: 100%;
}
textarea.input { border-radius: 22px; resize: vertical; min-height: 110px; }
select.input { appearance: none; }
.input:focus { outline: none; border-color: var(--green); }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > .field { flex: 1 1 260px; }
.check { display: flex; align-items: center; gap: 12px; font-weight: 600; min-height: 44px; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--green); }
.admin-item {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  background: var(--surface-2); border-radius: 24px; padding: 14px 14px 14px 22px;
}
.admin-item.editing { background: var(--purple-soft); }
.admin-item .info { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; }
.admin-item .name { font-weight: 600; font-size: 17px; }
.admin-item .repo { color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.pill { border-radius: 999px; padding: 6px 14px; font-size: 14px; font-weight: 600; }
.pill.on { background: var(--green-soft); color: var(--green-text); }
.pill.off { background: #24202B; color: var(--muted); }
.icon-btn {
  width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--surface-3); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font: inherit;
}
.icon-btn:hover { filter: brightness(1.2); }
.icon-btn[disabled] { opacity: .35; cursor: not-allowed; }
.editor { border: 2px solid var(--purple); border-radius: 28px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--text); color: var(--ink); border-radius: 999px; padding: 12px 22px; font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .5); z-index: 50; max-width: calc(100% - 32px); text-align: center;
}
.toast.error { background: #FF8A80; }
.unsaved { background: var(--purple-soft); color: var(--purple-text); border-radius: 20px; padding: 12px 18px; font-weight: 600; }
[hidden] { display: none !important; }

@media (max-width: 640px) {
  .nav { border-radius: 28px; }
  .nav-links { width: 100%; justify-content: space-between; }
  .nav-links a:not(.btn) { padding: 10px 8px; }
  .yt { min-height: 340px; padding: 32px; }
  .twitch, .kick { padding: 28px; }
  .media-card { border-radius: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 640px) {
  .nav-cta { min-height: 42px; padding: 10px 16px; font-size: 14px; }
}

/* Colecciones */
.collections-block { display: flex; flex-direction: column; gap: 16px; }
.collections-block h3 { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; }
.collections {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr);
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px;
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.collection {
  scroll-snap-align: start; border-radius: 32px; overflow: hidden; text-decoration: none;
  display: flex; flex-direction: column; background: var(--surface-2); color: var(--text);
  transition: transform .2s ease;
}
.collection:hover { transform: translateY(-3px); color: var(--text); }
.collection .cover {
  aspect-ratio: 4 / 3; position: relative; display: flex; align-items: center; justify-content: center;
  font-family: var(--display); font-weight: 800; font-size: 96px; letter-spacing: -0.04em;
}
.collection .cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.collection.purple .cover { background: var(--purple); color: #fff; }
.collection.green .cover { background: var(--green); color: var(--ink); }
.collection.red .cover { background: var(--red); color: #fff; }
.collection .badge {
  position: absolute; top: 16px; left: 16px; z-index: 1; background: #000; color: var(--green-text);
  border-radius: 999px; padding: 6px 14px; font-family: var(--body); font-size: 14px; font-weight: 600; letter-spacing: 0;
}
.collection .body { padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.collection .name { font-family: var(--display); font-weight: 700; font-size: 26px; letter-spacing: -0.02em; line-height: 1.1; }
.collection .desc { color: var(--muted); margin: 0; flex-grow: 1; }
.collection .go { font-weight: 600; color: var(--green-text); }
.cover-preview {
  width: 100%; aspect-ratio: 4 / 3; border-radius: 22px; background: var(--surface-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden; color: var(--muted);
}
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Pie de tienda integrado con el diseño de Mixden */
.shop-information {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; width: 100%; padding: 16px 20px;
  border: 1px solid var(--surface-3); border-radius: 18px;
  background: var(--surface); color: var(--muted);
  font: 500 15px/1.5 var(--body); text-align: left; cursor: pointer;
}
.shop-information:hover, .shop-information[aria-expanded="true"] {
  border-color: var(--purple); color: var(--text);
}
.shop-information span { color: var(--green-text); font-size: 22px; line-height: 1; }
#myShop:not(.shop-details-open) #sprd-footer { display: none !important; }
#myShop #sprd-signup-banner,
#myShop #buttonSpreadshirt,
#myShop .sprd-info-footer__open-shop,
#myShop .sprd-service-footer { display: none !important; }
#myShop #sprd-footer {
  margin: 20px 0 0 !important; padding: 0 !important;
  border: 0 !important; background: transparent !important;
  color: var(--muted) !important; font-family: var(--body) !important;
}
#myShop .sprd-info-footer {
  display: flex !important; flex-wrap: wrap !important;
  justify-content: flex-start !important; gap: 20px 32px !important;
  padding: 22px !important; border: 1px solid var(--surface-3) !important;
  border-radius: 20px !important; background: var(--surface) !important;
  color: var(--muted) !important;
}
#myShop .sprd-info-footer__col {
  flex: 1 1 160px !important; padding: 0 !important;
  border: 0 !important; background: transparent !important;
}
#myShop .sprd-info-footer__link,
#myShop .sprd-info-footer button {
  color: var(--muted) !important; font-family: var(--body) !important;
  font-size: 14px !important; line-height: 1.7 !important;
}
#myShop .sprd-info-footer a:hover,
#myShop .sprd-info-footer button:hover { color: var(--green-text) !important; }
@media (max-width: 640px) {
  #myShop .sprd-info-footer { padding: 16px !important; gap: 16px !important; }
  #myShop .sprd-info-footer__col { flex-basis: 130px !important; }
}

/* Logo y etiqueta comparten la cabecera de cada tarjeta de proyecto. */
.project-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; min-width: 0; }
.project-heading .tag { min-width: 0; max-width: calc(100% - 76px); overflow-wrap: anywhere; }
.project-logo { display: block; flex: none; width: 64px; height: 64px; width: clamp(44px, 20cqi, 64px); height: clamp(44px, 20cqi, 64px); object-fit: contain; object-position: top right; margin-left: auto; border-radius: 12px; }
@media (max-width: 640px) { .project { padding: 24px; } }

.project-logo-corefox { object-fit: cover; object-position: left top; }
