/* ==========================================================================
   RADAX STUDIO · Plataforma
   Piezas compartidas por Inicio, Creadores, Eventos, Addons y el panel:
   héroe de evento, bloques de fecha, filas de evento, fichas de creador,
   portadas de addon y cabeceras de página.
   ========================================================================== */

/* Colores y tipografía de siempre: las piezas nuevas usan la paleta de Radax
   (diamante y hierba) y la misma fuente que el resto del sitio. */
:root {
  --brand: var(--diamond-40);
  --brand-hover: var(--diamond-30);
  --on-brand: #ffffff;
  --ice: var(--diamond-80);
  --font-display: var(--font-sans);
  --display-stretch: 100%;
}

[hidden] { display: none !important; }

/* ══ CABECERA DE SECCIÓN ═══════════════════════════════════════════════════ */

.sec { padding-block: var(--sp-8) 0; }
.sec:first-child { padding-top: 0; }

@media (min-width: 900px) { .sec { padding-top: var(--sp-10); } }

.sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-5);
}

.sec-head h2 {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: clamp(1.35rem, 2.6vw, 2rem);
  font-weight: 850;
  letter-spacing: -.02em;
  line-height: 1.05;
}

.sec-head p { margin-top: 6px; max-width: 56ch; color: var(--on-surface-var); font-size: var(--t-body-sm); }

.sec-link {
  flex-shrink: 0;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--outline-var);
  color: var(--on-surface);
  font-size: var(--t-label-lg);
  font-weight: 650;
  white-space: nowrap;
  transition: border-color var(--dur-2) var(--ease-standard);
}

.sec-link:hover { border-color: var(--brand); }

/* ══ CABECERA DE PÁGINA ════════════════════════════════════════════════════ */

.masthead {
  padding-block: var(--sp-5) var(--sp-6);
  margin-bottom: var(--sp-6);
  border-bottom: 1px solid var(--outline-var);
}

@media (min-width: 900px) { .masthead { padding-block: var(--sp-6) var(--sp-8); } }

.masthead h1 {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: clamp(2.2rem, 6vw, 4.25rem);
  font-weight: 900;
  letter-spacing: -.03em;
  line-height: .95;
}

.masthead p {
  max-width: 58ch;
  margin-top: var(--sp-4);
  color: var(--on-surface-var);
  font-size: clamp(var(--t-body), 1.4vw, 1.0625rem);
  line-height: var(--lh-normal);
}

.masthead-row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-5); }
.masthead-tools { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }

/* ══ HÉROE DE EVENTO ═══════════════════════════════════════════════════════
   Lo primero que se ve: el evento del servidor, a sangre, con su banner. */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: clamp(520px, 86vh, 780px);
  margin-top: calc((var(--appbar-h) + env(safe-area-inset-top)) * -1);
  padding: calc(var(--appbar-h) + 48px) 0 var(--sp-7);
  overflow: hidden;
  background: #0d1011;
  color: #fff;
}

@media (max-width: 599px) { .hero { min-height: 560px; padding-bottom: var(--sp-6); } }

.hero-media { position: absolute; inset: 0; z-index: -2; }

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  transition: opacity var(--dur-5) var(--ease-standard), transform 1.2s var(--ease-decel);
}

.hero-media img.is-swapping { opacity: 0; transform: scale(1.06); }

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(9, 13, 14, .97) 0%, rgba(9, 13, 14, .78) 30%, rgba(9, 13, 14, .2) 62%, rgba(9, 13, 14, .45) 100%),
    linear-gradient(to right, rgba(9, 13, 14, .7) 0%, rgba(9, 13, 14, 0) 60%);
}

.hero-inner {
  width: 100%;
  max-width: var(--content-max-wide);
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  gap: var(--sp-6);
  align-items: end;
}

@media (min-width: 1000px) { .hero-inner { grid-template-columns: minmax(0, 1fr) auto; } }

.hero-logo { max-height: 84px; max-width: 220px; width: auto; object-fit: contain; margin-bottom: var(--sp-4); filter: drop-shadow(0 4px 16px rgba(0, 0, 0, .5)); }

.hero-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }

.hero-title {
  max-width: 15ch;
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: clamp(2.5rem, 7.2vw, 6.25rem);
  font-weight: 900;
  letter-spacing: -.035em;
  line-height: .92;
  color: #fff;
  text-wrap: balance;
}

.hero-summary {
  max-width: 52ch;
  margin-top: var(--sp-4);
  color: rgba(255, 255, 255, .84);
  font-size: clamp(var(--t-body), 1.5vw, 1.125rem);
  line-height: var(--lh-normal);
}

.hero-actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-6); }

.hero-side { display: flex; flex-direction: column; align-items: flex-start; gap: var(--sp-5); }

@media (min-width: 1000px) { .hero-side { align-items: flex-end; } }

/* Fecha grande: la cifra en Archivo expandida, la cuenta atrás debajo */
.hero-date { display: grid; gap: 2px; }
@media (min-width: 1000px) { .hero-date { text-align: right; } }

.hero-date b {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 900;
  line-height: .9;
  letter-spacing: -.03em;
}

.hero-date span { font-size: var(--t-body-sm); color: rgba(255, 255, 255, .78); font-weight: 600; }
.hero-date em { font-style: normal; color: var(--ice); font-weight: 700; font-size: var(--t-body-sm); }

/* Selector de eventos destacados */
.hero-picker { display: flex; gap: var(--sp-2); }

.hero-pick {
  position: relative;
  width: 132px;
  padding: 0;
  text-align: left;
  color: rgba(255, 255, 255, .7);
  cursor: pointer;
}

.hero-pick img, .hero-pick .img-empty {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--shape-xs);
  background: rgba(255, 255, 255, .1);
  opacity: .6;
  transition: opacity var(--dur-2) var(--ease-standard);
}

.hero-pick span { display: block; margin-top: 6px; font-size: var(--t-label); font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hero-pick::before { content: ""; position: absolute; top: -8px; left: 0; right: 0; height: 3px; background: rgba(255, 255, 255, .22); }
.hero-pick.is-active { color: #fff; }
.hero-pick.is-active::before { background: var(--brand); }
.hero-pick.is-active img, .hero-pick:hover img { opacity: 1; }

@media (max-width: 599px) { .hero-pick { width: 96px; } }

/* Héroe sin eventos: la marca sobre el paisaje del canal */
.hero--brand .hero-title { max-width: 13ch; }

/* ══ ETIQUETAS ═════════════════════════════════════════════════════════════ */

.plat-tag,
.phase,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border-radius: var(--shape-xs);
  font-size: var(--t-label);
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.plat-bedrock { background: color-mix(in srgb, var(--ice) 22%, transparent); color: var(--secondary); }
.plat-java { background: color-mix(in srgb, #f0a43a 24%, transparent); color: #9a5a00; }
[data-theme="dark"] .plat-java { color: #ffc56e; }

.hero .plat-bedrock, .on-media .plat-bedrock { background: rgba(156, 196, 255, .2); color: #cfe2ff; }
.hero .plat-java, .on-media .plat-java { background: rgba(240, 164, 58, .22); color: #ffd394; }

.phase { background: var(--surface-high); color: var(--on-surface-var); }
.phase-live { background: var(--brand); color: #fff; }
.phase-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse-dot 1.6s var(--ease-standard) infinite; }
.phase-upcoming { background: var(--secondary-container); color: var(--on-secondary-container); }
.phase-soon { background: var(--warning-container); color: var(--on-warning-container); }
.hero .phase { background: rgba(255, 255, 255, .14); color: #fff; }
.hero .phase-live { background: var(--brand); }

.pill { background: var(--surface-high); color: var(--on-surface-var); }
.pill-red { background: var(--primary-container); color: var(--on-primary-container); }
.pill-ice { background: var(--secondary-container); color: var(--on-secondary-container); }
.pill-ok { background: var(--success-container); color: var(--on-success-container); }
.pill-warn { background: var(--warning-container); color: var(--on-warning-container); }
.pill .material-icons { font-size: 15px; }

.vmark { font-size: 18px !important; color: var(--secondary); vertical-align: -3px; margin-left: 4px; font-variation-settings: 'FILL' 1, 'wght' 500 !important; }

/* ══ BLOQUE DE FECHA ═══════════════════════════════════════════════════════ */

.date-stub {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 76px;
  min-height: 76px;
  padding: 8px 4px;
  border-radius: var(--shape-sm);
  background: var(--surface-lowest);
  box-shadow: inset 0 0 0 1px var(--outline-var);
  text-align: center;
}

[data-theme="dark"] .date-stub { background: var(--surface-cont); }

.date-stub b {
  font-family: var(--font-display);
  font-stretch: var(--display-stretch);
  font-size: 1.85rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -.03em;
}

.date-stub small { margin-top: 4px; font-size: var(--t-label-sm); font-weight: 700; color: var(--on-surface-var); }
.date-stub--tba b { font-size: 1.1rem; color: var(--primary); }

/* ══ FILAS DE EVENTO ═══════════════════════════════════════════════════════ */

.erows { display: grid; gap: var(--sp-3); }

.erow {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: center;
  padding: var(--sp-3);
  border-radius: var(--shape-md);
  color: var(--on-surface);
  transition: background-color var(--dur-2) var(--ease-standard);
}

.erow:hover { background: var(--surface-low); }

.erow-media { display: none; }

.erow-body { min-width: 0; }
.erow-title { font-size: var(--t-title); font-weight: 750; line-height: 1.25; }
.erow-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.erow-sum { margin-top: 6px; color: var(--on-surface-var); font-size: var(--t-body-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

@media (min-width: 700px) {
  .erow { grid-template-columns: 76px 240px minmax(0, 1fr); gap: var(--sp-5); }
  .erow-media { display: block; }
  .erow-media img, .erow-media .img-empty {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--shape-sm);
    background: var(--surface-high);
  }
  .erow-title { font-size: var(--t-title-lg); }
}

/* Evento principal de la página de eventos: tarjeta ancha con imagen */
.efeature {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  min-height: 380px;
  padding: var(--sp-6);
  border-radius: var(--shape-lg);
  overflow: hidden;
  background: #0d1011;
  color: #fff;
}

.efeature > img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-decel); }
.efeature:hover > img { transform: scale(1.03); }
.efeature::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(9, 13, 14, .95), rgba(9, 13, 14, .2) 70%); }
.efeature h2 { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: clamp(1.8rem, 4.6vw, 3.4rem); font-weight: 900; line-height: .95; letter-spacing: -.03em; color: #fff; max-width: 18ch; }
.efeature p { max-width: 56ch; margin-top: var(--sp-3); color: rgba(255, 255, 255, .82); }
.efeature-top { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-3); }
.efeature-when { margin-top: var(--sp-4); font-weight: 700; color: var(--ice); font-size: var(--t-body-sm); }

@media (min-width: 900px) { .efeature { min-height: 460px; padding: var(--sp-8); } }

/* ══ CREADORES ═════════════════════════════════════════════════════════════ */

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(220px, 1fr);
  gap: var(--sp-4);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  margin-inline: calc(var(--gutter) * -1);
  padding-inline: var(--gutter);
  scroll-padding-inline: var(--gutter);
}

.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

@media (min-width: 1100px) { .rail { grid-auto-columns: calc((100% - 4 * var(--sp-4)) / 5); } }

.ctile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  color: var(--on-surface);
}

.ctile-banner {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: var(--shape-md);
  overflow: hidden;
  background: var(--surface-high);
}

.ctile-banner img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-5) var(--ease-decel); }
.ctile:hover .ctile-banner img { transform: scale(1.04); }

/* Sin banner: el avatar ampliado y desenfocado hace de fondo */
.ctile-banner--avatar img { filter: blur(18px) saturate(1.3); transform: scale(1.3); opacity: .8; }
.ctile:hover .ctile-banner--avatar img { transform: scale(1.34); }

.ctile-id { display: flex; align-items: center; gap: var(--sp-3); margin-top: -28px; padding-inline: var(--sp-3); }

.ctile .avatar-img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px var(--bg);
  background: var(--surface-high);
}

.avatar-img--ph { display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: var(--on-secondary-container); background: var(--secondary-container) !important; }

.ctile-name { display: block; margin-top: 30px; font-weight: 750; font-size: var(--t-body); line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctile-bio { margin-top: var(--sp-2); padding-inline: var(--sp-3); color: var(--on-surface-var); font-size: var(--t-body-sm); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; min-height: 2.9em; }
.ctile-meta { margin-top: var(--sp-2); padding-inline: var(--sp-3); font-size: var(--t-label); color: var(--on-surface-dim); font-weight: 600; }

/* Fila de creador (página de creadores): perfil a la izquierda, obra a la derecha */
.crow {
  display: grid;
  gap: var(--sp-5);
  padding-block: var(--sp-6);
  border-top: 1px solid var(--outline-var);
}

.crow:first-child { border-top: 0; padding-top: 0; }

@media (min-width: 900px) { .crow { grid-template-columns: 340px minmax(0, 1fr); gap: var(--sp-8); align-items: start; } }

.crow-id { display: flex; gap: var(--sp-4); align-items: flex-start; }
.crow-id .avatar-img { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--surface-high); }
.crow-name { font-family: var(--font-display); font-stretch: 112%; font-size: var(--t-title-lg); font-weight: 800; line-height: 1.15; color: var(--on-surface); }
.crow-handle { color: var(--on-surface-dim); font-size: var(--t-label); font-weight: 600; }
.crow-bio { margin-top: var(--sp-3); color: var(--on-surface-var); font-size: var(--t-body-sm); max-width: 46ch; }
.crow-stats { display: flex; gap: var(--sp-5); margin-top: var(--sp-4); font-size: var(--t-label); color: var(--on-surface-dim); }
.crow-stats b { display: block; font-family: var(--font-display); font-stretch: 112%; font-size: var(--t-title-lg); color: var(--on-surface); line-height: 1.1; }
.crow-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-4); flex-wrap: wrap; }

.crow-work { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-3); }

@media (max-width: 599px) {
  .crow-work { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 72%; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scroll-snap-type: x mandatory; }
  .crow-work > * { scroll-snap-align: start; }
}

.crow-empty { padding: var(--sp-6); border-radius: var(--shape-md); background: var(--surface-low); color: var(--on-surface-dim); font-size: var(--t-body-sm); }

/* ══ OBRA (proyectos) ══════════════════════════════════════════════════════ */

.work { display: block; min-width: 0; color: var(--on-surface); }

.work-img {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--shape-md);
  overflow: hidden;
  background: var(--surface-high);
}

.work-img img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-5) var(--ease-decel); }
.work:hover .work-img img { transform: scale(1.04); }
.work-type { position: absolute; left: 8px; top: 8px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: var(--shape-xs); background: rgba(9, 13, 14, .72); color: #fff; font-size: var(--t-label-sm); font-weight: 700; backdrop-filter: blur(6px); }
.work-title { display: block; margin-top: var(--sp-2); font-weight: 700; font-size: var(--t-body-sm); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.work-sub { display: block; font-size: var(--t-label); color: var(--on-surface-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Lo último: una pieza grande y una lista */
.latest { display: grid; gap: var(--sp-6); }

@media (min-width: 900px) { .latest { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: var(--sp-7); } }

.latest-feature { position: relative; display: block; color: #fff; border-radius: var(--shape-lg); overflow: hidden; isolation: isolate; background: #0d1011; aspect-ratio: 16 / 10; }
.latest-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform 1s var(--ease-decel); }
.latest-feature:hover img { transform: scale(1.03); }
.latest-feature::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(9, 13, 14, .92), rgba(9, 13, 14, 0) 58%); }
.latest-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: var(--sp-5); }
.latest-cap h3 { font-family: var(--font-display); font-stretch: 118%; font-size: clamp(1.3rem, 2.6vw, 2rem); font-weight: 850; line-height: 1.05; color: #fff; letter-spacing: -.02em; }
.latest-by { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); font-size: var(--t-body-sm); color: rgba(255, 255, 255, .86); font-weight: 600; }
.latest-by .avatar-img { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.latest-by .avatar-img--ph { font-size: .8rem; }

.lrows { display: grid; align-content: start; }

.lrow {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--sp-4);
  align-items: center;
  padding-block: var(--sp-3);
  border-bottom: 1px solid var(--outline-var);
  color: var(--on-surface);
}

.lrow:first-child { padding-top: 0; }
.lrow img, .lrow .img-empty { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--shape-sm); background: var(--surface-high); }
.lrow-title { display: block; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow:hover .lrow-title { color: var(--primary); }
.lrow-sub { display: block; margin-top: 2px; font-size: var(--t-label); color: var(--on-surface-dim); }

/* Rejilla de obra general */
.work-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-4); }
@media (min-width: 700px) { .work-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .work-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ══ ADDONS ════════════════════════════════════════════════════════════════ */

.band {
  margin-top: var(--sp-10);
  padding-block: var(--sp-8) var(--sp-9);
  background: #0d1011;
  color: #e8eef9;
}

.band .sec { padding-top: 0; }
.band .sec-head h2 { color: #fff; }
.band .sec-head p { color: rgba(232, 238, 249, .7); }
.band .sec-link { color: #fff; border-color: rgba(255, 255, 255, .3); }
.band .sec-link:hover { border-color: var(--brand); }

.band-inner { max-width: var(--content-max); margin-inline: auto; padding-inline: var(--gutter); }

.agrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-5) var(--sp-4); }
@media (min-width: 800px) { .agrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .agrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.atile {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.atile-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  border-radius: var(--shape-md);
  overflow: hidden;
  background: linear-gradient(135deg, #232829, #0d1011);
}

.atile-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-5) var(--ease-decel), filter var(--dur-3) var(--ease-standard); }
.atile:hover .atile-cover img { transform: scale(1.04); }

.atile-cover .img-empty { position: absolute; inset: 0; display: grid; place-items: center; }
.atile-cover .img-empty::before { content: "extension"; font-family: 'Material Symbols Rounded'; font-size: 44px; color: rgba(255, 255, 255, .25); }

.atile-state {
  position: absolute;
  right: 8px;
  top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  border-radius: var(--shape-xs);
  font-size: var(--t-label-sm);
  font-weight: 750;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.atile-state .material-icons { font-size: 15px; }
.atile-state--locked { background: rgba(9, 13, 14, .74); color: #fff; }
.atile-state--owned { background: #1b7a3c; color: #fff; }
.atile-state--pending { background: rgba(240, 194, 0, .92); color: #241a00; }

.atile.is-locked .atile-cover img { filter: grayscale(.65) brightness(.72); }
.atile.is-locked:hover .atile-cover img { filter: grayscale(.2) brightness(.9); }

.atile-feat { position: absolute; left: 8px; top: 8px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; border-radius: var(--shape-xs); background: var(--brand); color: #fff; font-size: var(--t-label-sm); font-weight: 750; }

.atile-name { display: block; margin-top: var(--sp-3); font-weight: 750; font-size: var(--t-body); line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.atile-sub { display: block; margin-top: 2px; font-size: var(--t-label); color: var(--on-surface-dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.band .atile-sub { color: rgba(232, 238, 249, .62); }

/* ══ YOUTUBE LIGERO ════════════════════════════════════════════════════════ */

.yt {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--shape-md);
  overflow: hidden;
  background: #000;
  cursor: pointer;
}

.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .86; transition: opacity var(--dur-2) var(--ease-standard); }
.yt:hover img { opacity: 1; }
.yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.yt-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 68px;
  height: 48px;
  margin: -24px 0 0 -34px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  transition: transform var(--dur-2) var(--ease-standard);
}

.yt:hover .yt-play { transform: scale(1.06); }
.yt-play .material-icons { font-size: 34px; font-variation-settings: 'FILL' 1; }

/* Visor de tráiler a pantalla completa */
.yt-modal { position: fixed; inset: 0; z-index: var(--z-sheet); display: grid; place-items: center; padding: var(--sp-4); background: rgba(0, 0, 0, .86); }
.yt-modal-box { position: relative; width: min(1100px, 100%); aspect-ratio: 16 / 9; }
.yt-modal-box iframe { width: 100%; height: 100%; border: 0; border-radius: var(--shape-md); background: #000; }
.yt-modal-x { position: absolute; top: -48px; right: 0; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer; }

/* ══ HERRAMIENTAS (línea compacta) ═════════════════════════════════════════ */

.toolline { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: var(--shape-md); overflow: hidden; background: var(--outline-var); }
@media (min-width: 800px) { .toolline { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.toolline a { display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-4); background: var(--bg); color: var(--on-surface); transition: background-color var(--dur-2) var(--ease-standard); }
.toolline a:hover { background: var(--surface-low); }
.toolline .material-icons { color: var(--primary); }
.toolline b { display: block; font-size: var(--t-body-sm); }
.toolline small { display: block; color: var(--on-surface-var); font-size: var(--t-label); line-height: 1.35; margin-top: 2px; }

/* ══ ESTADOS ═══════════════════════════════════════════════════════════════ */

.sk { background: linear-gradient(90deg, var(--surface-cont) 0%, var(--surface-high) 50%, var(--surface-cont) 100%); background-size: 200% 100%; animation: sk 1.4s linear infinite; border-radius: var(--shape-md); }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.blank {
  display: grid;
  justify-items: start;
  gap: var(--sp-2);
  padding: var(--sp-7) var(--sp-6);
  border-radius: var(--shape-md);
  background: var(--surface-low);
  color: var(--on-surface-var);
}

.blank h3 { font-size: var(--t-title); }
.blank p { max-width: 50ch; font-size: var(--t-body-sm); }
.band .blank { background: rgba(255, 255, 255, .05); color: rgba(232, 238, 249, .7); }
.band .blank h3 { color: #fff; }

.img-failed, .img-empty { background: var(--surface-high); }
img.img-failed { visibility: hidden; }

.seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: var(--shape-sm); background: var(--surface-cont); }
.seg button { height: 34px; padding: 0 var(--sp-4); border-radius: var(--shape-xs); color: var(--on-surface-var); font-size: var(--t-label-lg); font-weight: 650; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface-lowest); color: var(--on-surface); box-shadow: var(--elev-1); }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--surface-highest); }

.searchline { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.searchline input { width: 100%; height: 42px; padding: 0 var(--sp-4) 0 40px; border: 0; border-radius: var(--shape-sm); background: var(--surface-cont); color: var(--on-surface); font-size: var(--t-body-sm); }
.searchline input:focus { outline: 2px solid var(--secondary); outline-offset: 0; }
.searchline .material-icons { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--on-surface-dim); pointer-events: none; }

/* ══ CATÁLOGO DE ADDONS ════════════════════════════════════════════════════ */

.cat-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-6); }
.seg-n { margin-left: 4px; color: var(--on-surface-dim); font-weight: 600; }
.cat-foot { margin-top: var(--sp-8); font-size: var(--t-body-sm); color: var(--on-surface-var); }
.cat-foot a { text-decoration: underline; text-underline-offset: 3px; }

.addon-modal { padding-top: 0; }
@media (min-width: 600px) { .addon-modal { max-width: 600px !important; } }
.addon-modal::before { display: none; }

.addon-modal { max-height: min(88dvh, 820px); }
.addon-modal-cover { position: relative; height: clamp(150px, 25vh, 220px); flex: 0 0 auto; overflow: hidden; background: radial-gradient(ellipse at 50% 35%, #293637, #111718 72%); }
.addon-modal-cover img { width: 100%; height: 100%; object-fit: cover; object-position: center 45%; }
.addon-modal-cover:has(img)::after { position: absolute; inset: 45% 0 0; background: linear-gradient(0deg, rgba(13, 16, 17, .42), transparent); content: ""; pointer-events: none; }
.addon-modal-x { position: absolute !important; top: 14px; right: 14px; z-index: 2; border: 1px solid rgba(255, 255, 255, .3) !important; background: rgba(9, 13, 14, .72) !important; color: #fff !important; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }

.addon-modal .addon-modal-info { flex: 1 1 auto; min-height: 100px; padding: var(--sp-5) var(--sp-6) var(--sp-4); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--outline-var) transparent; }
.addon-modal-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: var(--sp-3); }
.addon-modal-name { font-family: var(--font-display); font-stretch: var(--display-stretch); font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 850; letter-spacing: -.02em; line-height: 1.05; }
.addon-modal-meta { margin-top: 7px; color: var(--on-surface-dim); font-size: var(--t-label-lg); line-height: 1.45; }
.addon-modal-desc { margin-top: var(--sp-4); color: var(--on-surface-var); font-size: var(--t-body-sm); line-height: 1.65; white-space: pre-line; }
.addon-modal-action { display: grid; flex: 0 0 auto; gap: var(--sp-3); max-height: 46%; overflow-y: auto; padding: var(--sp-4) var(--sp-6) calc(var(--sp-5) + env(safe-area-inset-bottom)); border-top: 1px solid var(--outline-var); background: var(--surface-cont); }
.addon-modal-action p { color: var(--on-surface-var); font-size: var(--t-body-sm); line-height: 1.5; }
.addon-modal-action .btn { width: 100%; }
.addon-modal-action textarea { min-height: 76px; max-height: 120px; resize: vertical; }

@media (max-width: 599px) {
  .addon-modal { max-height: 92dvh; }
  .addon-modal-cover { height: clamp(150px, 23vh, 195px); }
  .addon-modal .addon-modal-info { padding: var(--sp-4) var(--sp-5) var(--sp-3); }
  .addon-modal-action { max-height: 48%; padding: var(--sp-3) var(--sp-5) calc(var(--sp-4) + env(safe-area-inset-bottom)); }
}

/* ══ PIEZAS DE APOYO ═══════════════════════════════════════════════════════ */

/* Botón claro sobre imagen (héroes) */
.btn-on-media {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-on-media:hover { background: rgba(255, 255, 255, .22); }

/* Marca blanca sobre el héroe del inicio mientras la barra es transparente */
.app-bar--transparent:not(.is-scrolled) .app-bar-brand { color: #fff; }
.app-bar--transparent:not(.is-scrolled) .brand-logo--light { display: none !important; }
.app-bar--transparent:not(.is-scrolled) .brand-logo--dark { display: block !important; }

/* Aviso para administradores dentro de una ficha */
.admin-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2) var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-5);
  border-radius: var(--shape-md);
  background: var(--surface-cont);
  font-size: var(--t-body-sm);
}

.admin-strip > .material-icons { color: var(--primary); }
.admin-strip-text { flex: 1; min-width: 180px; color: var(--on-surface-var); }
.admin-strip-text b { color: var(--on-surface); }

/* ══ SORTEOS ═══════════════════════════════════════════════════════════════ */

.gv-list { display: grid; gap: var(--sp-5); }
.gv-on-addons { margin-bottom: var(--sp-8); }

.gv-card {
  display: grid;
  overflow: hidden;
  border-radius: var(--shape-xl);
  background: var(--surface-cont);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary) 22%, transparent);
  scroll-margin-top: calc(var(--appbar-h) + 24px);
}

@media (min-width: 860px) { .gv-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); } }

.gv-cover {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 220px;
  background: linear-gradient(135deg, var(--primary-container), var(--secondary-container));
}

.gv-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gv-cover-ico { font-size: 72px !important; color: var(--on-primary-container); opacity: .55; }
[data-theme="light"] .gv-cover { background: linear-gradient(135deg, var(--diamond-40), color-mix(in srgb, var(--grass-40) 70%, var(--diamond-40))); }
[data-theme="light"] .gv-cover-ico { color: #fff; }
.gv-cover-more {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 4px 10px;
  border-radius: var(--shape-full);
  background: rgba(9, 13, 14, .72);
  color: #fff;
  font-size: var(--t-label);
  font-weight: 700;
}

.gv-body { display: grid; align-content: start; gap: var(--sp-3); padding: var(--sp-6); min-width: 0; }

.gv-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 4px 10px;
  border-radius: var(--shape-full);
  background: var(--primary);
  color: var(--on-primary);
  font-size: var(--t-label);
  font-weight: 800;
}

.gv-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse-dot 1.6s ease-in-out infinite; }

.gv-title { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.gv-desc { color: var(--on-surface-var); white-space: pre-line; }

.gv-prizes { display: flex; flex-wrap: wrap; gap: 6px; }
.gv-prize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: var(--shape-full);
  background: var(--secondary-container);
  color: var(--on-secondary-container);
  font-size: var(--t-label-lg);
  font-weight: 650;
}
.gv-prize .material-icons { font-size: 18px; }
a.gv-prize:hover { filter: brightness(.96); }

.gv-stats {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 1px;
  margin-top: var(--sp-2);
  overflow: hidden;
  border-radius: var(--shape-md);
  background: var(--outline-var);
}

.gv-stat { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-3) var(--sp-4); background: var(--surface-low); }
.gv-stat small { font-size: var(--t-label); font-weight: 600; color: var(--on-surface-var); }
.gv-stat b { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.gv-stat--time b { font-family: var(--font-mono); color: var(--primary); }

@media (max-width: 479px) {
  .gv-stats { grid-template-columns: 1fr 1fr; }
  .gv-stat--time { grid-column: 1 / -1; }
}

.gv-end, .gv-people, .gv-muted { display: flex; align-items: flex-start; gap: 8px; font-size: var(--t-body-sm); color: var(--on-surface-var); }
.gv-end .material-icons, .gv-people .material-icons, .gv-muted .material-icons { font-size: 18px; margin-top: 1px; }
.gv-action { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-2); }
.gv-in { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--shape-full); background: var(--success-container); color: var(--on-success-container); font-weight: 700; }

.gv-past {
  display: grid;
  overflow: hidden;
  border-radius: var(--shape-lg);
  background: var(--surface-low);
  scroll-margin-top: calc(var(--appbar-h) + 24px);
}

@media (min-width: 700px) { .gv-past { grid-template-columns: 240px minmax(0, 1fr); } }
.gv-past .gv-cover { min-height: 140px; }
.gv-past .gv-body { padding: var(--sp-5); gap: var(--sp-2); }
.gv-past-title { font-size: var(--t-title-lg); font-weight: 800; }
.gv-wtitle { margin-top: var(--sp-2); font-size: var(--t-label-lg); font-weight: 800; }

.gv-winners { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; }
.gv-winners li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--shape-full);
  background: color-mix(in srgb, #e8a400 22%, transparent);
  font-weight: 700;
}
.gv-winners .material-icons { font-size: 18px; color: #c98a00; font-variation-settings: 'FILL' 1; }
.gv-winners a { color: var(--on-surface); }
