/* =====================================================================
   HUB / ARCADE - Estilos (dark neon)
   ===================================================================== */

:root {
  color-scheme: dark;
  --bg: #070912;
  --bg-soft: #0f1324;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-strong: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.09);
  --text: #eef1ff;
  --muted: #9aa4c7;
  --brand: #00e5ff;
  --brand-2: #7c4dff;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 700px at 15% -10%, #17204a 0%, transparent 55%),
              radial-gradient(1000px 600px at 90% 0%, #3a1150 0%, transparent 50%),
              linear-gradient(180deg, var(--bg) 0%, var(--bg-soft) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

/* Halo animado de fondo */
body::before {
  content: "";
  position: fixed;
  inset: -30%;
  z-index: -1;
  background:
    radial-gradient(circle at 25% 30%, rgba(0, 229, 255, 0.16), transparent 45%),
    radial-gradient(circle at 75% 70%, rgba(124, 77, 255, 0.16), transparent 45%);
  animation: drift 16s ease-in-out infinite alternate;
  pointer-events: none;
}

@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to   { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

/* ------------------------------- HERO ------------------------------- */
.hero {
  text-align: center;
  padding: 72px 20px 28px;
}

.hero__logo {
  display: block;
  width: 96px;
  height: 96px;
  margin: 0 auto 16px;
  border-radius: 24px;
  filter: drop-shadow(0 14px 34px rgba(124, 77, 255, 0.4));
  animation: hero-float 4.5s ease-in-out infinite;
}

@keyframes hero-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@media (prefers-reduced-motion: reduce) {
  .hero__logo { animation: none; }
}

.hero__kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--brand);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.hero__title {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 4.6rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.04em;
  background: linear-gradient(120deg, #ffffff 0%, var(--brand) 45%, var(--brand-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 24px rgba(0, 229, 255, 0.25));
}

.hero__subtitle {
  max-width: 620px;
  margin: 18px auto 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  line-height: 1.55;
}

/* Buscador */
.search {
  position: relative;
  max-width: 460px;
  margin: 28px auto 0;
}

.search__input {
  width: 100%;
  padding: 14px 48px 14px 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 0.98rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.search__input::placeholder { color: var(--muted); }

.search__input:focus {
  border-color: rgba(0, 229, 255, 0.6);
  box-shadow: 0 0 0 4px rgba(0, 229, 255, 0.14);
  background: rgba(255, 255, 255, 0.1);
}

.search__icon {
  position: absolute;
  top: 50%;
  left: 18px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1rem;
  pointer-events: none;
}

/* ----------------------------- LAYOUT ------------------------------ */
.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 8px 20px 40px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 46px 4px 18px;
}

.section-head h2 {
  position: relative;
  margin: 0;
  padding-left: 15px;
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.section-head h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 5px;
  height: 1.15em;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.55);
}

.section-head span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.section-head span::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 10px var(--brand);
}

.section-head span strong {
  color: var(--brand);
  font-size: 1rem;
  font-weight: 800;
}

/* ------------------------------ GRID ------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}

/* Una sola tarjeta centrada (sección Próximamente) */
.grid--single {
  grid-template-columns: minmax(0, 360px);
  justify-content: center;
}

.wrap--soon { padding-top: 0; padding-bottom: 80px; }

/* ------------------------------ CARD ------------------------------- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-8px);
  border-color: color-mix(in srgb, var(--accent) 65%, transparent);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.55), 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
  outline: none;
}

.card:hover::after,
.card:focus-visible::after {
  opacity: 1;
}

/* Glow de acento al pasar el mouse */
.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(600px 160px at 50% -20%, color-mix(in srgb, var(--accent) 35%, transparent), transparent 70%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.card__media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: radial-gradient(120% 120% at 50% 0%, color-mix(in srgb, var(--accent) 28%, transparent), #0b0e1c 70%);
  overflow: hidden;
}

.card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.card:hover .card__img { transform: scale(1.07); }

.card__glyph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 3.6rem;
  font-weight: 900;
  color: var(--accent);
  text-shadow: 0 8px 26px color-mix(in srgb, var(--accent) 45%, transparent);
}

.card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #05070f;
  background: linear-gradient(135deg, var(--accent), #ffffff);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.card__body {
  position: relative;
  padding: 18px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.card__title { margin: 0; font-size: 1.15rem; }

.card__desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
  flex: 1;
}

.card__tags { display: flex; flex-wrap: wrap; gap: 8px; }

.tag {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text);
  background: var(--surface-strong);
  border: 1px solid var(--border);
}

/* --------------------------- PRÓXIMAMENTE -------------------------- */
.card--soon {
  cursor: not-allowed;
  opacity: 0.9;
}

.card--soon:hover { transform: translateY(-4px); }

.card--soon .card__badge {
  background: linear-gradient(135deg, #2a3455, #6b769c);
  color: #eef1ff;
}

.card--soon .card__glyph { opacity: 0.85; }

.empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
}

/* ------------------------------ FOOTER ----------------------------- */
.footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--muted);
  font-size: 0.82rem;
  border-top: 1px solid var(--border);
}

/* --------------------------- BUSCAR: limpiar ----------------------- */
.search__clear {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.search__clear:hover,
.search__clear:focus-visible {
  color: var(--text);
  border-color: rgba(0, 229, 255, 0.6);
  background: rgba(0, 229, 255, 0.12);
  outline: none;
}

/* ------------------------------ TOOLBAR ---------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 4px 20px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chip:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.25); transform: translateY(-1px); }

.chip.is-active {
  color: #05070f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  box-shadow: 0 8px 20px rgba(0, 229, 255, 0.3);
}

.sort { display: inline-flex; align-items: center; gap: 8px; }
.sort__label { color: var(--muted); font-size: 0.82rem; }

.segmented {
  display: inline-flex;
  gap: 2px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
}

.seg {
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.seg:hover { color: var(--text); }

.seg.is-active {
  color: #05070f;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 6px 16px rgba(0, 229, 255, 0.3);
}

/* ------------------------------ RECIENTES -------------------------- */
.wrap--recent { padding-top: 0; }
.wrap--recent .section-head { margin-top: 8px; }

/* ------------------------------ RÉCORD ----------------------------- */
.card__record {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* --------------------------- TOGGLE DE SONIDO ---------------------- */
.hub-sound {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 99999;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(10, 14, 28, 0.68);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.hub-sound:hover,
.hub-sound:focus-visible {
  border-color: rgba(0, 229, 255, 0.6);
  background: rgba(0, 229, 255, 0.12);
  outline: none;
}

.hub-sound.is-off { color: var(--muted); }

/* --------------------------- INSTALAR APP -------------------------- */
.hub-install {
  position: fixed;
  top: 58px;
  right: 14px;
  z-index: 99999;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(0, 229, 255, 0.5);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.18), rgba(124, 77, 255, 0.18));
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.hub-install:hover,
.hub-install:focus-visible {
  border-color: var(--brand);
  background: linear-gradient(135deg, rgba(0, 229, 255, 0.3), rgba(124, 77, 255, 0.3));
  transform: translateY(-1px);
  outline: none;
}

.hub-install[hidden] { display: none; }

@media (max-width: 560px) {
  .hero { padding-top: 54px; }
  .grid { grid-template-columns: 1fr; }
  .section-head { flex-wrap: wrap; gap: 6px; }
  .section-head h2 { font-size: 1.1rem; }
  .seg { padding: 6px 10px; font-size: 0.76rem; }
  .sort { flex-wrap: wrap; }
}
