/* ========================================
   Page layout — mobile-first
   ----------------------------------------
   On mobile the sidebar is hidden and replaced by the bottom-tab
   (see components/bottom-tab.css). Main content reserves space for
   that bar via .main.-with-bottom-tab. From 720px the sidebar
   appears collapsed; from 1024px it expands to its full width.
   ======================================== */
.page-layout {
  display: flex;
  min-height: 100vh;
  overflow-x: clip; /* keep nested overflow from forcing a horizontal
                       scrollbar on the page (the fixed sidebar +
                       margin-left dance occasionally causes one) */
}

.page-layout > .main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  margin-left: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 200ms ease;
}

.page-layout > .main.-with-bottom-tab {
  padding-bottom: var(--bottom-tab-height);
}

.page-layout > .main > .content {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem var(--content-pad);
}

.page-layout > .main > .footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 8px var(--content-pad);
  border-top: 1px dashed var(--line-strong);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--muted);
  text-transform: uppercase;
}
.page-layout > .main > .footer .footer-stamp {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
}
.page-layout > .main > .footer .footer-legal {
  justify-self: center;
}
.page-layout > .main > .footer .footer-version {
  justify-self: end;
}
.page-layout > .main > .footer .footer-stamp > .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green-glow);
}
.page-layout > .main > .footer .footer-version {
  color: var(--muted);
  opacity: 0.7;
}

/* The footer is for marketing / credibility on public pages — drop
   it from mobile entirely. The bottom-tab is the bottom UI element. */
@media (max-width: 719px) {
  .page-layout > .main > .footer { display: none; }

  /* Heroes de página (título Bebas gigante + tagline) duplican el crumb del
     ribbon y comen mucho alto en mobile; el ribbon ya identifica la página.
     El .tournament-hero "pleno" (detalle del torneo) se conserva; solo se
     oculta la variante -compact (fixture/ranking/hinchas/palpitar). */
  .lobby-hero,
  .salas-hero,
  .invite-hero,
  .wallet-page-head,
  .tournament-hero.-compact { display: none; }

  /* body trae `zoom: 1.05` (escala global, ver --app-zoom). El zoom multiplica
     cualquier `min-height: 100vh`, así que estos contenedores miden 105% del
     viewport y dejan ~5% de scroll fantasma aunque el contenido entre. Dividir
     por el zoom hace que "una pantalla" sea exactamente el viewport. */
  html body,
  .page-layout,
  .page-layout > .main {
    min-height: calc(100vh / var(--app-zoom));
  }
}

@media (min-width: 720px) {
  .page-layout > .main {
    margin-left: var(--sidebar-width-collapsed);
  }
  .page-layout > .main.-no-sidebar {
    margin-left: 0;
  }
  .page-layout > .main.-with-bottom-tab {
    padding-bottom: 0;
  }

  /* Scroll exterior contra el borde derecho de la ventana — el body
     es la región scrolleable y el sidebar/bottom-tab quedan fijos.
     Antes había overflow hidden en html/body/page-layout/main y un
     overflow-y interno en .content; sacamos esa pista interna. */
  .page-layout > .main > .content {
    display: flex;
    flex-direction: column;
  }
  html {
    scrollbar-width: thin;
    scrollbar-color: var(--line-strong) transparent;
  }
  html::-webkit-scrollbar { width: 5px; }
  html::-webkit-scrollbar-track { background: transparent; }
  html::-webkit-scrollbar-thumb {
    background: var(--line-strong);
    border-radius: 3px;
  }
}

@media (min-width: 1024px) {
  .page-layout > .main {
    margin-left: var(--sidebar-width);
    transition: margin-left 200ms ease;
  }
  .page-layout > .main.-no-sidebar {
    margin-left: 0;
  }
  .page-layout.-sidebar-collapsed > .main {
    margin-left: var(--sidebar-width-collapsed);
  }
}

/* Page header */
.page-header {
  margin-bottom: 1.5rem;
}

.page-header > .title {
  font-size: 2rem;
}

.page-header > .subtitle {
  color: var(--text-2);
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* .section-label moved to components/_primitives.css with boletería styling. */
