/* ==========================================================================
   PAINEL 2026-11-13 — camada final da moldura (carregada por ultimo)
   Reorganiza o topo na ordem das pecas: escudo+nome, metricas, busca, links.
   ========================================================================== */

.stadium-app > header.topbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 10px 18px;
  border: 1px solid #31565c;
  border-radius: 14px;
  background: rgba(11, 35, 44, 0.78);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28);
}
.stadium-app > header.topbar > .club-identity { order: 1; flex: 0 0 auto; max-width: 260px; }
.stadium-app > header.topbar > .topbar-actions { display: contents; }
.stadium-app > header.topbar > .topbar-actions > .topbar-metrics { order: 2; margin-left: 0; }
.stadium-app > header.topbar > .topbar-actions > .user-links { order: 4; margin-left: auto; }
.stadium-app > header.topbar > .topbar-left { order: 3; flex: 0 1 190px; min-width: 120px; }
.stadium-app > header.topbar > .admin-controls { order: 5; flex: 0 0 auto; }

@media (max-width: 1180px) {
  .stadium-app > header.topbar { flex-wrap: wrap; }
  .stadium-app > header.topbar > .topbar-actions > .topbar-metrics { order: 2; width: 100%; }
  .stadium-app > header.topbar > .topbar-left { order: 3; flex: 1 1 160px; }
  .stadium-app > header.topbar > .topbar-actions > .user-links { order: 4; }
}
@media (max-width: 760px) {
  .stadium-app > header.topbar { flex-wrap: wrap; gap: 10px; padding: 12px; }
  .stadium-app > header.topbar > .club-identity { order: 1; flex: 1 1 100%; max-width: none; }
  .stadium-app > header.topbar > .topbar-actions > .topbar-metrics { order: 2; gap: 16px; }
  .stadium-app > header.topbar > .topbar-left { order: 3; flex: 1 1 100%; }
  .stadium-app > header.topbar > .topbar-actions > .user-links { order: 4; margin-left: 0; }
}

@media (max-width: 760px) {
  /* D34: o wrapper do radio nao desenha folha nenhuma. O card do player
     (.gm-radio-bar.in-sidebar) e a unica caixa visivel. */
  .gm-radio-bar.in-sidebar .gm-radio-btn { width: 44px; height: 44px; }
}

/* Grade do documento (secao 3). D20: sem teto de 1220 px. Aquele numero era a
   largura da PECA; com ele o app centralizava e sobrava a arte como faixa dos
   dois lados em monitor largo. O shell ocupa a janela, a lateral fica nos 220 px
   e o board cresce; o conteudo do painel acompanha (main.dashboard abaixo). */
.stadium-app { max-width: none; padding: 20px 28px; gap: 18px; }
.stadium-app .board > main.dashboard { max-width: none; }
.stadium-app .dashboard { gap: 16px; }
@media (max-width: 760px) {
  .stadium-app { padding: 14px; gap: 14px; }
  .stadium-app .dashboard { gap: 14px; }
}

/* Peca 10/11: em 1280 a folha ocupa a largura com 14 px de margem (o mockup
   nao tem margem central de 30 px). Acima disso, o container de 1220 volta. */
@media (max-width: 1400px) {
  .stadium-app { max-width: none; padding: 14px; }
}

/* D15: o radio nao flutua sobre o conteudo; so existe no painel da lateral.
   D34: o wrapper e so posicionamento; quem desenha o card e o player. */
.side-radio-panel {
  position: fixed;
  top: 96px;
  left: 16px;
  width: 240px;
  z-index: 90;
  display: none;
}
.side-radio-panel:not([hidden]) { display: grid; }
.gm-radio-bar:not(.in-sidebar) { display: none !important; }
@media (max-width: 760px) {
  .side-radio-panel {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: calc(96px + env(safe-area-inset-bottom));
    width: auto;
  }
}

/* Mobile: the same radio, an icon in the actions row (opens the bottom sheet). */
.stadium-app .topbar-radio { display: none; }
@media (max-width: 1023px) {
  .stadium-app .topbar-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid #31565c;
    border-radius: 8px;
    background: #102b35;
    color: var(--color-accent);
    font-size: var(--text-base);
    cursor: pointer;
  }
}

/* The phone's mini-player media rule must not shrink the player inside the sheet. */
@media (max-width: 1023px) {
  .side-radio-panel .gm-radio-bar.in-sidebar {
    position: static;
    width: 100%;
    height: auto;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
}

/* The player inside the panel must take part in the layout (the floating pill's
   children are absolutely positioned on phones). */
.side-radio-panel .gm-radio-bar,
.side-radio-panel .gm-radio-bar * { position: static !important; }
.side-radio-panel .gm-radio-bar { display: grid !important; height: auto !important; width: 100% !important; }
.side-radio-panel .gm-radio-content { display: grid !important; height: auto !important; opacity: 1 !important; max-width: none !important; }
.side-radio-panel .gm-radio-info { display: grid !important; opacity: 1 !important; max-width: none !important; }

/* ==========================================================================
   SUPERFICIE PADRAO E CABECALHO DE PAGINA (14/11/2026)
   Decisao do Gabriel: todas as telas usam a superficie de card do Painel e o
   mesmo cabecalho (titulo, rotulo da divisao e fio). Um token, uma regra.
   ========================================================================== */
.stadium-app .board :is(.card, .gm-data-panel, .gm-filter-panel):not(.stadium-hero-card, .dash-matchday, .scoreboard, .crest-editor, .crest-landing) {
  background: var(--surface-glass-bg) !important;
  border: 1px solid var(--surface-glass-border) !important;
  border-radius: var(--surface-glass-radius) !important;
  box-shadow: var(--surface-glass-shadow) !important;
  -webkit-backdrop-filter: blur(var(--surface-glass-blur)) !important;
  backdrop-filter: blur(var(--surface-glass-blur)) !important;
}

/* O cabecalho de pagina: a faixa de arte ja vem do board; aqui ficam a
   tipografia do titulo, o rotulo pequeno da divisao e o fio. A moldura vale
   para o cabecalho da pagina; dentro de um card (Conquistas) ela e zerada,
   porque o card ja tem padding e borda. */
.stadium-app .board .main .page-heading {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 4px 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 0 14px !important;
  margin-left: var(--heading-shift, 0) !important;
  padding: 0 16px 10px !important;
  /* Mesma altura em toda tela (44 do botao de acao + 10 de folga + 1 do fio),
     entao o fio cai sempre na mesma altura relativa. */
  border-bottom: 1px solid rgba(130, 178, 154, .34) !important;
}
.stadium-app .board .main .card .page-heading {
  margin: 0 !important;
  margin-left: var(--heading-shift, 0) !important;
  padding: 0 !important;
  border-bottom: 0 !important;
}
.stadium-app .board .main .page-heading > h1,
.stadium-app .board .main .page-heading .ach-title-row > h1 {
  min-width: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  color: var(--text) !important;
  font-size: var(--text-lg) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -.02em !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .85) !important;
}
.stadium-app .board .main .page-heading > h1,
.stadium-app .board .main .page-heading .ach-title-row > h1 {
  flex: 0 1 auto !important;
  min-width: 0 !important;
  max-width: 100% !important;
}
.stadium-app .board .main .page-heading > .page-heading-actions {
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
}
.stadium-app .board .main .page-heading > .page-heading-actions > * { margin-left: 0 !important; }
/* No celular o titulo desce para 20 px para caber com o rotulo da divisao. */
@media (max-width: 430px) {
  .stadium-app .board .main .page-heading > h1,
  .stadium-app .board .main .page-heading .ach-title-row > h1 {
    font-size: var(--text-lg) !important;
    text-wrap: balance;
  }
}




.stadium-app .board .main .page-heading .ach-title-row { justify-content: flex-start !important; }
.stadium-app .board .main .page-heading .ach-title-row > .ach-info { margin-left: auto !important; }

@media (max-width: 430px) {
  /* O chip de folha nao cabe inteiro ao lado do titulo: sai do cabecalho no
     celular (continua na tela do Elenco), em vez de aparecer cortado. */
  .stadium-app .board .main .page-heading .squad-wage-chip-link { display: none !important; }
}

/* O main do Painel era o unico sem a folga lateral de 16 px no celular que as
   outras telas tem dentro do board: com ela, o card e o titulo caem no mesmo x. */
@media (max-width: 760px) {
  .stadium-app .board > .main.dashboard { padding-inline: 16px !important; }
}
.stadium-app .board .main .page-heading .ach-title-row { gap: 4px 12px !important; }

@media (max-width: 430px) {
  /* Sem o atalho "Vender pelo Elenco" o titulo do Mercado cabe numa linha em
     360; o atalho continua no desktop e o Elenco esta no dock. */
  .stadium-app .board .main .page-heading .gm-hero-shortcut { display: none !important; }
}

@media (max-width: 380px) {
  /* 360 px: 18 px no titulo para "Mercado de transferencias" e "Calendario -
     temporada 1" caberem numa linha, com o texto completo. */
  .stadium-app .board .main .page-heading > h1,
  .stadium-app .board .main .page-heading .ach-title-row > h1 { font-size: var(--text-lg) !important; }
}

/* O cabecalho dentro de um card (Conquistas) nao tem a moldura externa, mas o
   fio sob o titulo continua: mesma folga de 10 px e mesma cor das outras telas. */
.stadium-app .board .main .card .page-heading .ach-title-row {
  padding-bottom: 10px !important;
  border-bottom: 1px solid rgba(130, 178, 154, .34) !important;
}
