/* ═══════════════════════════════════════════════════════════════
   Platform layer — UX, navigation, live ecosystem
   ═══════════════════════════════════════════════════════════════ */

.main-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1;
  min-width: 0;
  gap: 0.5rem;
}

.main-nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
}

.main-nav__links > a:not(.btn),
.main-nav__links .nav-item__trigger {
  white-space: nowrap;
}

.main-nav .nav-item {
  list-style: none;
}

.site-header.is-hidden {
  transform: translateY(-100%);
  transition: transform 0.35s var(--ease-premium, ease);
}

.site-header {
  transition: transform 0.35s var(--ease-premium, ease);
}

body.platform-enter {
  animation: platformFadeIn 0.45s var(--ease-premium, cubic-bezier(0.22, 1, 0.36, 1));
}

@keyframes platformFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ─── Evento compacto dentro del nav ─── */
.header-event {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 11rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0.35rem 0 0.5rem;
  padding: 0.28rem 0.55rem;
  background: linear-gradient(90deg, rgba(200, 169, 107, 0.16), rgba(76, 201, 240, 0.06));
  border: 1px solid var(--border-gold, rgba(200, 169, 107, 0.35));
  border-radius: 6px;
  font-size: 0.7rem;
  line-height: 1.2;
}

.header-event[hidden] {
  display: none !important;
}

.header-event__label {
  flex-shrink: 0;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.58rem;
  color: var(--gold);
  padding: 0.12rem 0.35rem;
  border: 1px solid var(--border-gold, rgba(200, 169, 107, 0.4));
  border-radius: 3px;
  white-space: nowrap;
}

.header-event__link {
  color: var(--text);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-event__link:hover {
  color: var(--ice-glow);
}

.header-inner .nav-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: 0.25rem;
}

@media (max-width: 1280px) {
  .header-event {
    max-width: 9rem;
  }
}

@media (max-width: 1100px) {
  .header-event {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .main-nav.is-open {
    justify-content: flex-start !important;
    align-items: center !important;
  }

  .main-nav:not(.is-open) {
    justify-content: flex-start !important;
    align-items: stretch !important;
  }

  .main-nav.is-open .header-event {
    display: inline-flex !important;
    max-width: none;
    width: 100%;
    margin: 0.5rem 0 0;
    order: 10;
  }

  .main-nav.is-open .main-nav__links {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .nav-item .nav-dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
    box-shadow: none;
    margin: 0.15rem 0 0.35rem;
    text-align: center;
  }

  .nav-item.is-open .nav-dropdown {
    display: block;
  }
}

/* ─── Announcement stack (avisos secundarios) ─── */
.announce-stack {
  position: relative;
  z-index: 999;
}

.announce-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
  padding: 0.5rem 1rem;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border-ice);
}

.announce-bar--event {
  background: linear-gradient(90deg, rgba(200, 169, 107, 0.12), rgba(76, 201, 240, 0.08));
}

.announce-bar--info {
  background: rgba(76, 201, 240, 0.08);
}

.announce-bar--maintenance {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
}

.announce-bar__label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--gold);
}

.announce-bar__msg {
  color: var(--text);
  font-weight: 500;
}

.announce-bar__msg:hover { color: var(--ice-glow); }

.announce-bar__close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

.announce-bar__close:hover { color: #fff; }

/* ─── Realm status bar ─── */
.site-header:has(+ .announce-stack) + .realm-status-bar,
.announce-stack + .realm-status-bar {
  top: calc(var(--nav-height, 80px) + 2.25rem);
}

.realm-status-bar {
  position: sticky;
  top: var(--nav-height, 80px);
  z-index: 900;
  background: rgba(8, 11, 20, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-ice);
}

.realm-status-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
  padding: 0.55rem 0;
  font-size: 0.8rem;
}

.realm-status-bar__left,
.realm-status-bar__right {
  display: flex;
  align-items: center;
  gap: var(--space-4, 1rem);
  flex-wrap: wrap;
}

.realm-status-bar__item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
}

.realm-status-bar__item strong {
  color: var(--ice-glow);
  font-weight: 600;
}

.realm-status-bar__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success);
  animation: pulseDot 2s ease-in-out infinite;
}

.realm-status-bar__dot--warn {
  background: #f59e0b;
  box-shadow: 0 0 8px #f59e0b;
}

/* ─── Nav dropdowns ─── */
.nav-item {
  position: relative;
}

.nav-item__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.55rem 0.85rem;
  border-radius: 6px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: color 0.25s, background 0.25s;
}

.nav-item__trigger:hover,
.nav-item.is-open .nav-item__trigger,
.nav-item__trigger.is-active {
  color: #fff;
  background: rgba(76, 201, 240, 0.08);
}

.nav-item__chevron {
  font-size: 0.55rem;
  opacity: 0.7;
  transition: transform 0.25s;
}

.nav-item.is-open .nav-item__chevron {
  transform: rotate(180deg);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 200px;
  padding: 0.5rem;
  background: rgba(12, 16, 28, 0.98);
  border: 1px solid var(--border-ice);
  border-radius: var(--radius, 10px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--glow-ice, 0 0 32px rgba(76, 201, 240, 0.12));
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.25s, transform 0.25s, visibility 0.25s;
  z-index: 1100;
}

.nav-item.is-open .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown a {
  display: block;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
}

.nav-dropdown a:hover,
.nav-dropdown a.is-active {
  color: #fff;
  background: rgba(76, 201, 240, 0.12);
}

/* ─── Breadcrumbs + page meta ─── */
.platform-meta {
  padding: var(--space-4, 1rem) 0;
  border-bottom: 1px solid rgba(76, 201, 240, 0.08);
  margin-bottom: 0;
}

.platform-meta .container,
.platform-meta__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
}

.platform-meta__start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  min-width: 0;
}

.platform-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  border: 1px solid rgba(76, 201, 240, 0.28);
  background: linear-gradient(135deg, rgba(8, 18, 36, 0.92), rgba(12, 28, 52, 0.78));
  color: #e0f2fe;
  border-radius: 999px;
  padding: 0.38rem 0.85rem 0.38rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.platform-back-btn:hover {
  color: #fff;
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.16), 0 0 12px rgba(251, 191, 36, 0.08);
  transform: translateY(-1px);
}

.platform-back-btn:focus-visible {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 2px;
}

.platform-back-btn__icon {
  color: #7dd3fc;
  font-size: 0.95rem;
  line-height: 1;
}

.platform-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 0;
  padding: 0;
  list-style: none;
}

.platform-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.platform-breadcrumb li:not(:last-child)::after {
  content: "›";
  opacity: 0.45;
  margin-left: 0.15rem;
}

.platform-breadcrumb a {
  color: var(--text-muted);
}

.platform-breadcrumb a:hover { color: var(--ice-glow); }

.platform-breadcrumb [aria-current="page"] {
  color: var(--gold-light);
}

.platform-orientation {
  font-size: 0.8rem;
  color: var(--text-muted);
}

@media (max-width: 720px) {
  .platform-meta__inner {
    align-items: flex-start;
  }
  .platform-meta__start {
    width: 100%;
  }
  .platform-orientation {
    width: 100%;
  }
}

/* ─── Page actions (next steps) ─── */
.platform-actions {
  padding: var(--space-6, 2rem) 0 var(--space-8, 3rem);
  border-top: 1px solid var(--border-ice);
  margin-top: var(--space-6, 2rem);
  background: linear-gradient(180deg, transparent, rgba(12, 18, 32, 0.5));
}

.platform-actions__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4, 1rem);
}

.platform-actions__label {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--gold-light);
}

.platform-actions__btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

/* ─── Community hub (cross-page) ─── */
.platform-hub {
  padding: var(--space-7, 3rem) 0;
}

.platform-hub__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--space-4, 1rem);
}

.hub-panel {
  padding: var(--space-5, 1.5rem);
  height: 100%;
}

.hub-panel h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold-light);
  margin-bottom: var(--space-4, 1rem);
}

.hub-spotlight {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.hub-spotlight__row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(76, 201, 240, 0.06);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.hub-spotlight__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(76, 201, 240, 0.1);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
}

.hub-spotlight__name {
  color: #fff;
  font-weight: 600;
}

.hub-discord {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-4, 1rem);
}

.hub-discord p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.hub-launcher {
  font-size: 0.85rem;
}

.hub-launcher li {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(76, 201, 240, 0.06);
  color: var(--text-muted);
}

.hub-launcher strong {
  color: var(--ice-glow);
  display: block;
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}

/* ─── Account trust strip ─── */
.auth-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4, 1rem);
  margin-top: var(--space-5, 1.5rem);
  padding-top: var(--space-4, 1rem);
  border-top: 1px solid var(--border-ice);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-trust span::before {
  content: "✓ ";
  color: var(--success);
}

/* Vote panel */
.vote-panel {
  margin-top: var(--space-5, 1.5rem);
  padding: var(--space-4, 1rem);
  background: rgba(76, 201, 240, 0.05);
  border: 1px solid var(--border-ice);
  border-radius: var(--radius, 10px);
}

.vote-panel h4 {
  font-family: var(--font-display);
  color: var(--gold-light);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.vote-panel p {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.vote-sites {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.vote-sites span {
  font-size: 0.72rem;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border-ice);
  border-radius: 4px;
  color: var(--text-muted);
}

/* ─── Skeleton loading ─── */
[data-skeleton] {
  position: relative;
  min-height: 2rem;
}

[data-skeleton].is-loading {
  color: transparent !important;
  pointer-events: none;
}

[data-skeleton].is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(30, 40, 60, 0.4) 0%,
    rgba(76, 201, 240, 0.08) 50%,
    rgba(30, 40, 60, 0.4) 100%
  );
  background-size: 200% 100%;
  animation: skeletonShimmer 1.2s ease-in-out infinite;
}

@keyframes skeletonShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ─── Toast feedback ─── */
.platform-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: rgba(12, 18, 28, 0.95);
  border: 1px solid var(--ice);
  border-radius: var(--radius, 10px);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: var(--glow-ice, 0 0 24px rgba(76, 201, 240, 0.25));
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.platform-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Empty state ─── */
.platform-empty {
  text-align: center;
  padding: var(--space-8, 4rem) var(--space-5, 1.5rem);
  color: var(--text-muted);
}

.platform-empty__icon {
  font-size: 2.5rem;
  opacity: 0.5;
  margin-bottom: var(--space-4, 1rem);
}

/* ─── Footer platform ─── */
.site-footer--full .footer-grid {
  display: grid;
  grid-template-columns: 1.8fr repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Home: community + launcher sections */
.home-hub {
  padding: var(--space-9, 6rem) 0;
  border-top: 1px solid var(--border-ice);
  background: linear-gradient(180deg, transparent, rgba(12, 18, 32, 0.6));
}

@media (max-width: 1100px) {
  .platform-hub__grid,
  .home-hub .platform-hub__grid {
    grid-template-columns: 1fr;
  }

  .nav-item .nav-dropdown {
    position: static;
    box-shadow: none;
    border: none;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 0.25rem;
    display: none;
  }

  .nav-item.is-open .nav-dropdown {
    display: block;
  }

  .main-nav.is-open .nav-item__trigger {
    width: 100%;
    justify-content: center;
    gap: 0.45rem;
  }
}

@media (max-width: 768px) {
  .realm-status-bar__inner {
    font-size: 0.72rem;
  }

  .platform-actions__inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.platform-enter { animation: none; }
  [data-skeleton].is-loading::after { animation: none; }
}
