/* GM Sports stadium visual system — phase 1: authenticated shell and dashboard.
   Login palette: #071922 (--surface-bg), #102a34, #b8f34b (--color-accent), #5bd6ae.
   Auth pages and gameplay logic are deliberately outside this stylesheet. */
.modern-shell {
  --bg: var(--surface-bg);
  --panel: #102a34;
  --panel-2: var(--surface-card);
  --line: var(--surface-border);
  --modern-edge: var(--surface-border-strong);
  --accent: var(--color-accent);
  --accent-ink: var(--color-accent-ink);
  background: radial-gradient(ellipse at 55% 0%, #193e3a 0%, var(--surface-bg) 53%);
  border-radius: 16px;
}
.modern-shell header.topbar,
.modern-shell .mainmenu {
  background: var(--surface-panel);
  border-color: var(--surface-border-strong);
}
.modern-shell .board {
  border: 1px solid var(--surface-border-strong);
  background: linear-gradient(165deg, var(--surface-card) 0%, #081d26 72%);
  box-shadow: 0 24px 60px #02111966;
}
.modern-shell .board .card {
  border-color: var(--surface-border-strong);
  background: linear-gradient(155deg, var(--surface-card-raised), #0d2630);
  box-shadow: 0 10px 28px #03141b35;
}
.modern-shell .board .btn.primary,
.modern-shell .board button.primary {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: var(--color-accent);
}
.modern-shell .board :is(a, button, select, input):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}
/* The live dashboard keeps its data and behavior while adopting the new hierarchy. */
.modern-shell .dashboard > .dash-matchday {
  background: radial-gradient(ellipse at 85% 115%, #34674675, transparent 60%),
    linear-gradient(120deg, #163b3b, #0d2932 72%);
  border-color: #44796a;
  border-radius: 18px;
}
.modern-shell .dashboard .next-match-head h2,
.modern-shell .dashboard .stat-header h3 {
  letter-spacing: .025em;
  text-transform: uppercase;
}
.modern-shell .dashboard .stat-card {
  border-radius: 14px;
  background: #102c36;
  border-color: #31565c;
}
.modern-shell .dashboard .stat-card::before { background: var(--color-accent); }
.modern-shell .dashboard .stat-card:nth-child(2)::before { background: #5bd6ae; }
.modern-shell .dashboard .stat-card:nth-child(3)::before { background: #d4bf6c; }
.modern-shell .dashboard .stat { color: #f0f9f3; }
.modern-shell .dashboard .result-row:hover {
  background: #20443e;
  border-color: #5a8a6a;
}
@media (max-width: 760px) {
  .modern-shell { border-radius: 0; }
  .modern-shell .board { min-width: 0; padding: 12px; border-radius: 14px; }
  .modern-shell .dashboard { min-width: 0; }
  .modern-shell .dashboard > .dash-matchday { padding: 16px 12px; }
  .modern-shell .dashboard .stat-card { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .modern-shell .board > .main > :is(.dashboard, .gm-view, .card, section) {
    animation: none;
  }
}

/* Authenticated stadium shell — independent desktop and touch navigation. */
body:has(.stadium-app) {
  background: #061720;
}
.stadium-app {
  --bg: var(--surface-bg);
  --panel: #102a34;
  --panel-2: var(--surface-card);
  --line: var(--surface-border);
  --accent: var(--color-accent);
  --accent-light: var(--color-accent-light);
  width: 100%;
  max-width: 1920px;
  min-width: 0;
  margin: 0 auto;
  padding: clamp(10px, 1.4vw, 22px);
  display: grid;
  gap: 14px;
  grid-template-columns: 238px minmax(0, 1fr);
  align-items: start;
  background: transparent;
}
.stadium-app > header.topbar {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
  min-width: 0;
  min-height: 76px;
  border: 1px solid #345861;
  border-radius: 16px;
  padding: 12px 17px;
  background: linear-gradient(120deg, #102d36, #09222d);
  box-shadow: 0 12px 30px #02101860;
}
.stadium-app > header.topbar > .topbar-left {
  grid-column: auto;
  display: flex;
  align-items: center;
  flex: 1 1 270px;
  min-width: 0;
  gap: 10px;
}
.stadium-app > header.topbar > .topbar-left > .search {
  flex: 1 1 190px;
  order: 0;
  width: auto;
  max-width: none;
}
.stadium-app > header.topbar > .club-identity {
  grid-column: auto;
  flex: 0 1 230px;
  max-width: 100%;
  min-width: 0;
  justify-self: auto;
}
.stadium-app > header.topbar > .topbar-actions {
  grid-column: auto;
  flex: 1 1 270px;
  min-width: 0;
  justify-self: auto;
}
.stadium-app > header.topbar > .admin-controls {
  grid-column: auto;
  flex: 1 1 100%;
  justify-self: auto;
  width: fit-content;
}
.stadium-app .topbar .brand-logo {
  width: 44px;
  height: 44px;
  border: 1px solid #547574;
  box-shadow: 0 2px 14px #010c1277;
}
.stadium-app .search input,
.stadium-app :is(select, input:not([type="checkbox"]):not([type="radio"]), textarea) {
  accent-color: var(--color-accent);
}
.stadium-app .topbar .search input {
  background: var(--surface-bg);
  border: 1px solid #3d636a;
  color: #f3fbf6;
}
.stadium-app .club-chips .chip {
  border: 1px solid #3e6265;
  border-radius: 10px;
  color: #e3f4ea;
  background: #102b34;
}
.stadium-app .user-links a:is(:hover, .active) {
  background: #234740;
  color: #d6ff89;
}
.stadium-app > .board {
  grid-column: 2;
  grid-row: 2;
  width: 100%;
  min-width: 0;
  padding: clamp(14px, 1.8vw, 28px);
  border: 1px solid #365960;
  border-radius: 18px;
  background: linear-gradient(155deg, #102b35, #081d26 72%);
  box-shadow: 0 24px 60px #02111966;
}
.stadium-app > .board > .main {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  min-width: 0;
}
.stadium-app > .board > .main:has(.dense-table-wrap, .table-wide, .table-wide-wrap) {
  max-width: 1320px;
}
.stadium-app .dashboard,
.stadium-app .dashboard > *,
.stadium-app .grid,
.stadium-app .grid > * {
  min-width: 0;
  max-width: 100%;
}
.stadium-app .board .card {
  min-width: 0;
  max-width: 100%;
  border: 1px solid #345861;
  border-radius: 15px;
  background: linear-gradient(150deg, #173540, #0d2630);
  box-shadow: 0 10px 26px #02101840;
}
.stadium-app .table-wrap { max-width: 100%; overflow-x: auto; }
.stadium-app .dashboard > .dash-matchday {
  min-height: 280px;
  padding: clamp(16px, 1.8vw, 28px);
  background: radial-gradient(ellipse at 85% 115%, #34674675, transparent 60%), linear-gradient(120deg, #163b3b, #0d2932 72%);
}
.stadium-app .dashboard .stat-card { padding: 12px 15px; }
.stadium-app .dashboard .stat { font-size: clamp(1.2rem, 1.6vw, 1.55rem); overflow-wrap: anywhere; }
.stadium-app .dashboard .stat-footer { font-size: .76rem; }
.stadium-app .dashboard .result-row,
.stadium-app .gm-metric,
.stadium-app .stat-card {
  border-color: #35575d;
}
.stadium-app > .site-footer {
  grid-column: 2;
  grid-row: 3;
  min-width: 0;
  padding: 6px 10px 12px;
}
.stadium-app .stadium-sidebar {
  grid-column: 1;
  grid-row: 1 / 4;
  position: sticky;
  inset: auto;
  top: 12px;
  z-index: 20;
  align-self: start;
  display: flex;
  flex-direction: column;
  grid-template-columns: none;
  width: 100%;
  max-height: calc(100dvh - 24px);
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  gap: 17px;
  margin: 0;
  padding: 16px 11px;
  border: 1px solid #31545c;
  border-radius: 18px;
  background: linear-gradient(175deg, #102e35, #061822 75%);
  box-shadow: 0 16px 40px #0006;
}
.stadium-app .stadium-sidebar :is(a, a:hover) { text-decoration: none; }
.stadium-sidebar-brand { padding: 4px 7px 14px; border-bottom: 1px solid #33545b; }
.stadium-sidebar-brand a {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  color: #eff9f4;
}
.stadium-brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 12px;
  background: var(--color-accent);
  color: var(--color-accent-ink);
  font-weight: 900;
  letter-spacing: -0.07em;
  font-size: 1.3rem;
}
.stadium-brand-words { display: grid; gap: 3px; min-width: 0; }
.stadium-brand-words strong { font-size: 0.93rem; letter-spacing: .025em; }
.stadium-brand-words small { color: #a6c8c5; font-size: 0.57rem; font-weight: 800; letter-spacing: .06em; }
.stadium-nav-section { min-width: 0; }
.stadium-nav-section h2, .stadium-more-section h2 {
  margin: 0 9px 8px;
  color: var(--color-accent);
  text-transform: uppercase;
  font-size: .67rem;
  font-weight: 900;
  line-height: 1.3;
  letter-spacing: .11em;
}
.stadium-nav-links { display: grid; gap: 3px; }
.stadium-app .stadium-page-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 40px;
  gap: 6px;
  padding: 9px 11px;
  color: #d1e5e1;
  font-size: .88rem;
  font-weight: 650;
  border: 1px solid transparent;
  border-radius: 9px;
  line-height: 1.2;
  background: transparent;
  transition: background-color .15s ease, color .15s ease;
}
.stadium-page-name { min-width: 0; overflow-wrap: anywhere; }
.stadium-app .stadium-page-link:hover { color: #f5fff0; background: #23423e; }
.stadium-app .stadium-page-link.active {
  color: var(--color-accent);
  background: #234239;
  border-color: #477763;
  box-shadow: inset 3px 0 var(--color-accent);
}
.stadium-nav-count {
  padding: 2px 7px;
  border-radius: 12px;
  color: var(--color-accent-ink);
  background: var(--color-accent);
  font-size: .75rem;
  font-weight: 850;
  flex: none;
}
.stadium-nav-count[hidden] { display: none !important; }
.stadium-sidebar-end {
  margin-top: auto;
  padding: 13px 9px 1px;
  border-top: 1px solid #31545c;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: .78rem;
}
.stadium-sidebar-end a { color: #afcbc8; }
.stadium-mobile-navigation { display: none; }
.stadium-app :is(.stadium-page-link, .stadium-mobile-tab, .stadium-sidebar-brand a):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}
@media (max-width: 1023px) {
  .stadium-app {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px 10px calc(94px + env(safe-area-inset-bottom));
  }
  .stadium-app .stadium-sidebar { display: none; }
  .stadium-app > :is(header.topbar, .board, .site-footer) { width: 100%; }
  .stadium-app > .board { padding: 18px; }
  .stadium-app > .site-footer { padding-block: 10px; }
  .stadium-app .stadium-mobile-navigation { display: block; }
  .stadium-mobile-nav {
    position: fixed;
    z-index: 71;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px max(6px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: stretch;
    gap: 3px;
    background: #0b222c;
    border-top: 1px solid #385d60;
    box-shadow: 0 -10px 28px #010d1580;
  }
  .stadium-mobile-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 62px;
    gap: 4px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 11px;
    text-decoration: none;
    color: #bad6d2;
    background: transparent;
    font: inherit;
    cursor: pointer;
  }
  .stadium-mobile-tab:is(:hover, .active) {
    color: var(--color-accent);
    background: #234239;
    border-color: #487364;
    text-decoration: none;
  }
  .stadium-tab-icon { display: grid; place-items: center; line-height: 1; }
  .stadium-tab-icon svg { width: 26px; height: 26px; }
  .stadium-tab-label {
    display: block;
    max-width: 100%;
    overflow-wrap: anywhere;
    text-align: center;
    line-height: 1.07;
    font-size: clamp(.57rem, 1.5vw, .75rem);
    font-weight: 750;
  }
  .stadium-more-scrim {
    position: fixed;
    z-index: 69;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: #010c12b5;
    cursor: default;
  }
  .stadium-more-drawer {
    position: fixed;
    z-index: 70;
    left: max(9px, env(safe-area-inset-left));
    right: max(9px, env(safe-area-inset-right));
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-height: min(74dvh, 640px);
    padding: 18px;
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid #477466;
    border-radius: 18px;
    color: #eff9f4;
    background: linear-gradient(160deg, #193740, #0a202c);
    box-shadow: 0 16px 55px #000a;
  }
  .stadium-more-heading {
    padding: 0 2px 15px;
    margin-bottom: 12px;
    border-bottom: 1px solid #375960;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .03em;
  }
  .stadium-more-section { margin-bottom: 14px; }
  .stadium-more-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; }
  .stadium-app .stadium-more-links .stadium-page-link {
    min-height: 46px;
    border: 1px solid #2d5055;
    padding: 11px;
    background: #102c35;
  }
  .stadium-app .stadium-more-links .stadium-page-link.active { background: #234239; }
  .stadium-more-settings { padding-top: 12px; border-top: 1px solid #375960; }
  .stadium-more-settings a {
    display: flex;
    align-items: center;
    color: #cee7df;
    min-height: 44px;
    padding: 8px 12px;
    text-decoration: none;
  }
  .stadium-more-settings a:hover { color: var(--color-accent); }
  .stadium-more-drawer[hidden], .stadium-more-scrim[hidden] { display: none !important; }
  .stadium-app > header.topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 9px 12px;
    min-height: 0;
  }
  .stadium-app > header.topbar > .topbar-left {
    display: flex;
    flex: 1 1 250px;
    gap: 10px;
  }
  .stadium-app > header.topbar > .club-identity { flex: 1 1 180px; }
  .stadium-app > header.topbar > .topbar-actions { flex: 1 1 100%; justify-content: space-between; }
  .stadium-app .gm-audio-control { bottom: calc(92px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(94px + env(safe-area-inset-bottom)); }
}
@media (max-width: 760px) {
  .stadium-app { padding: 8px 8px calc(93px + env(safe-area-inset-bottom)); }
  .stadium-app > header.topbar { padding: 10px; border-radius: 13px; }
  .stadium-app > header.topbar > .topbar-left { display: contents; }
  .stadium-app > header.topbar .brand { order: 0; flex: 0 0 auto; }
  .stadium-app > header.topbar .brand-logo { width: 40px; height: 40px; }
  .stadium-app > header.topbar > .club-identity { order: 1; flex: 1 1 calc(100% - 58px); max-width: calc(100% - 58px); }
  .stadium-app > header.topbar .topbar-left > .search {
    order: 2;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
  }
  .stadium-app > header.topbar > .topbar-actions {
    order: 3;
    flex: 1 1 100%;
    gap: 7px;
    min-width: 0;
  }
  .stadium-app > header.topbar > .admin-controls { order: 4; width: 100%; }
  .stadium-app .topbar-actions .club-chips { gap: 4px; flex-wrap: wrap; }
  .stadium-app .topbar-actions .club-chips .chip { padding: 5px 7px; font-size: .7rem; white-space: normal; }
  .stadium-app .user-links { gap: 3px; }
  .stadium-app .user-links a { min-height: 42px; padding: 9px 5px; font-size: .75rem; }
  .stadium-app > .board { padding: 12px 10px; border-radius: 14px; }
  .stadium-app .dashboard { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stadium-app .dashboard > * { grid-column: 1 / -1; }
  .stadium-app .dashboard > .dash-matchday { min-height: 220px; padding: 16px 12px; }
  .stadium-app .dashboard > .dash-metrics,
  .stadium-app .dashboard > .dash-matches,
  .stadium-app .dashboard > .dash-bottom { grid-template-columns: minmax(0, 1fr); }
  .stadium-app .board .card { padding: 13px 10px; }
  .stadium-app .board :is(.grid.cols-2, .grid.cols-3, .grid.cols-3-2, .grid.cols-1-2, .tactic-controls) {
    grid-template-columns: minmax(0, 1fr);
  }
  .stadium-app .gm-view,
  .stadium-app .board .main,
  .stadium-app .tactics { min-width: 0; max-width: 100%; }
  .stadium-app .gm-view .tabs { max-width: 100%; overflow-x: auto; }
  .stadium-app .dashboard .result-row { min-width: 0; }
  .stadium-app .search-results { min-width: 0; width: 100%; }
}
@media (max-width: 370px) {
  .stadium-mobile-tab { padding-inline: 1px; }
  .stadium-tab-icon svg { width: 23px; height: 23px; }
  .stadium-tab-label { font-size: .57rem; }
  .stadium-more-drawer { padding: 14px 11px; }
  .stadium-more-links { grid-template-columns: minmax(0, 1fr); }
  .stadium-app .board .card { padding-inline: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .stadium-app .stadium-page-link { transition: none; }
}

/* Football universe: photography and illustrated atmosphere, with dark surfaces
   kept behind controls and data. The publisher mark belongs to the sidebar. */
body:has(.stadium-app) {
  background:
    linear-gradient(105deg, rgba(3, 18, 25, .96), rgba(4, 20, 26, .93)),
    url('/assets/auth-immersive-supporters.jpg') center top / cover fixed;
}
.stadium-app > .board {
  background:
    radial-gradient(ellipse at 5% 2%, rgba(62, 124, 100, .16), transparent 48%),
    linear-gradient(160deg, rgba(14, 43, 51, .98), rgba(5, 24, 32, .98) 74%);
  border-color: rgba(101, 153, 145, .43);
}
.stadium-app > header.topbar {
  background:
    linear-gradient(110deg, rgba(8, 32, 40, .97), rgba(11, 42, 48, .92)),
    url('/assets/torcida-guache-sm.webp') center 42% / cover;
  border-color: rgba(111, 154, 147, .41);
}
.stadium-app > header.topbar > .club-identity {
  gap: 10px;
  padding: 5px 14px 5px 4px;
  border-inline-end: 1px solid rgba(178, 229, 192, .18);
}
.stadium-app > header.topbar > .club-identity .club {
  font-weight: 850;
  font-size: clamp(1rem, 1.05vw, 1.25rem);
  letter-spacing: -.02em;
  color: #f5fff7;
}
.stadium-app .stadium-sidebar {
  background:
    linear-gradient(180deg, rgba(9, 41, 45, .88) 0, rgba(7, 29, 38, .96) 200px, #061923 480px),
    url('/assets/torcida-guache-sm.webp') center top / 100% auto no-repeat;
  border-color: rgba(99, 157, 145, .45);
}
.stadium-app .stadium-sidebar-brand {
  padding-top: 7px;
  padding-bottom: 18px;
  border-color: rgba(185, 236, 206, .23);
}
.stadium-app .stadium-brand-mark {
  object-fit: contain;
  padding: 2px;
  background: var(--color-accent);
  box-shadow: 0 0 0 1px #d0ff8a55, 0 8px 26px #071d1f99;
}
.stadium-app .stadium-page-link.active {
  background: linear-gradient(90deg, rgba(63, 99, 68, .8), rgba(32, 73, 64, .8));
}

/* On the home screen, the stands are the hero, not a large empty teal block. */
.stadium-app .dashboard > .dash-matchday {
  min-height: clamp(300px, 29vw, 430px);
  padding: clamp(23px, 3vw, 46px);
  background:
    linear-gradient(92deg, rgba(3, 23, 30, .98) 0%, rgba(6, 30, 35, .94) 31%, rgba(7, 31, 35, .74) 60%, rgba(6, 28, 31, .3) 100%),
    linear-gradient(0deg, rgba(3, 24, 27, .67), transparent 53%),
    url('/assets/torcida-guache.webp') center 45% / cover;
  border: 1px solid #668f78;
  box-shadow: inset 4px 0 var(--color-accent), inset 0 0 90px #00151944, 0 18px 38px #0006;
}
.stadium-app .dashboard > .dash-matchday :is(h2, .next-team, .next-match-head) {
  text-shadow: 0 2px 15px rgba(0, 0, 0, .8);
}
.stadium-app .dashboard > .dash-matchday h2 {
  font-size: clamp(1.7rem, 1.45rem + 1.3vw, 2.7rem);
  letter-spacing: -.035em;
  text-transform: none;
  max-width: 20ch;
}
.stadium-app .dashboard > .dash-matchday .muted { color: #cde2d9; }
.stadium-app .dashboard > .dash-matchday .btn {
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border-color: #ddff93;
  font-weight: 850;
}
.stadium-app .dashboard > .dash-matchday .btn:hover { background: #d4ff82; }
.stadium-app .dashboard .stat-card {
  min-height: 154px;
  padding: 18px 19px;
  background:
    linear-gradient(90deg, rgba(9, 37, 43, .96), rgba(13, 42, 46, .83)),
    url('/assets/stadium-guache-900.webp') right center / cover;
}
.stadium-app .dashboard .stat-card:nth-child(2) {
  background:
    linear-gradient(90deg, rgba(9, 37, 43, .96), rgba(13, 42, 46, .77)),
    url('/assets/torcida-guache-sm.webp') center / cover;
}
.stadium-app .dashboard .stat-card:nth-child(3) {
  background:
    linear-gradient(90deg, rgba(9, 37, 43, .96), rgba(13, 42, 46, .78)),
    url('/assets/estadio-ilustrado.jpg') center / cover;
}
.stadium-app .dashboard .stat-card .stat {
  font-size: clamp(1.4rem, 1.25rem + .65vw, 2rem);
  color: #f4fff6;
  text-shadow: 0 2px 12px #001b20aa;
}
.stadium-app .dashboard :is(.dash-news, .dash-squad, .dash-matches > .card) {
  background:
    linear-gradient(140deg, rgba(20, 54, 61, .96), rgba(9, 31, 41, .99)),
    url('/assets/torcida-guache-sm.webp') center / cover;
  border-color: rgba(100, 155, 149, .42);
}
.stadium-app .dashboard :is(.dash-news, .dash-squad, .dash-matches > .card) h2 {
  letter-spacing: -.025em;
}
.stadium-app .dashboard .dash-news {
  background:
    linear-gradient(115deg, rgba(12, 40, 47, .97) 22%, rgba(13, 42, 45, .79)),
    url('/assets/torcida-guache-sm.webp') right center / cover;
}
.stadium-app .dashboard .result-row { background: rgba(9, 30, 38, .7); }

/* The inner football-management pages inherit the same atmosphere. */
.stadium-app .board .gm-view {
  min-width: 0;
  background:
    radial-gradient(ellipse at 90% 0, rgba(70, 138, 106, .13), transparent 46%),
    linear-gradient(180deg, rgba(8, 32, 40, .33), transparent 320px);
}
.stadium-app .board .gm-view > :is(h1, .topbar):first-child {
  position: relative;
  padding: clamp(16px, 2vw, 29px);
  min-height: 94px;
  margin-bottom: clamp(14px, 2vw, 25px);
  border: 1px solid rgba(118, 170, 152, .46);
  border-radius: 14px;
  color: #f5fff4;
  background:
    linear-gradient(95deg, rgba(7, 30, 38, .97) 8%, rgba(10, 37, 43, .81) 65%, rgba(7, 28, 36, .56)),
    url('/assets/torcida-guache-sm.webp') center 40% / cover;
  box-shadow: inset 3px 0 var(--color-accent), 0 12px 24px #0003;
}
.stadium-app .board .gm-view:has(.stadium-hero-card) > :is(h1, .topbar):first-child {
  background:
    linear-gradient(95deg, rgba(7, 30, 38, .97) 8%, rgba(10, 37, 43, .73)),
    url('/assets/stadium-guache-900.webp') center 42% / cover;
}
.stadium-app .board .gm-view > .card,
.stadium-app .board .gm-view > .grid > .card,
.stadium-app .board .gm-view > .grid > :is(section, article).card {
  border-color: rgba(91, 148, 143, .4);
  background: linear-gradient(150deg, #16363e, #092630 85%);
}
.stadium-app .board .gm-view .stat-card {
  box-shadow: inset 3px 0 rgba(184, 243, 75, .65), 0 12px 24px #0002;
}

/* Aerial stadium: an unobstructed illustration with small, keyboard/touch
   accessible facility buttons and labels that appear on hover/focus. */
.stadium-app .stadium-hero-card {
  overflow: hidden;
  padding: 0;
  border: 1px solid rgba(119, 168, 145, .7);
  border-radius: 18px;
  background: #102c35;
  box-shadow: 0 17px 40px #00151c8c;
}
.stadium-app .stadium-hero-caption {
  padding: 17px clamp(15px, 2vw, 26px);
  align-items: center;
  background:
    linear-gradient(100deg, rgba(6, 29, 37, .97), rgba(12, 45, 45, .91)),
    url('/assets/stadium-guache-900.webp') center / cover;
  border-bottom: 1px solid rgba(137, 184, 153, .51);
}
.stadium-app .stadium-hero-caption h2 { color: #f4fff0; letter-spacing: -.025em; }
.stadium-app .stadium-hero-caption p { color: #cfe3db; }
.stadium-app .stadium-hero-media { background: #203e39; }
.stadium-app .hotspot.on-image,
.stadium-app .hotspot.bowl.on-image {
  position: absolute;
  left: var(--cx, 50%);
  top: var(--cy, 50%);
  width: clamp(30px, 3.2vw, 42px);
  height: clamp(30px, 3.2vw, 42px);
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  padding: 0;
  border: 1px solid rgba(226, 255, 178, .83);
  border-radius: 50%;
  color: #dbff92;
  background: rgba(6, 35, 36, .9);
  box-shadow: 0 0 0 3px rgba(4, 24, 28, .55), 0 2px 10px rgba(0, 0, 0, .47);
  transition: background .16s ease, box-shadow .16s ease, scale .16s ease;
  z-index: 1;
  touch-action: manipulation;
}
.stadium-app .hotspot.on-image:hover,
.stadium-app .hotspot.on-image:focus-visible,
.stadium-app .hotspot.bowl.on-image:hover,
.stadium-app .hotspot.bowl.on-image:focus-visible {
  z-index: 5;
  border-color: #eaffb6;
  background: #174639;
  box-shadow: 0 0 0 4px rgba(184, 243, 75, .28), 0 4px 19px #001a20b0;
  scale: 1.08;
}
.stadium-app .hotspot.on-image.building {
  color: #ffdd8b;
  border-color: #ffcd6b;
  background: #49341e;
}
.stadium-app .hotspot.on-image .hotspot-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.stadium-app .hotspot.on-image .hotspot-pin svg {
  display: block;
  width: 55%;
  height: 55%;
}
.stadium-app .hotspot.on-image .hotspot-label {
  display: block;
  position: absolute;
  left: 50%;
  top: -12px;
  transform: translate(-50%, -100%);
  width: max-content;
  max-width: min(230px, 75vw);
  padding: 7px 11px;
  white-space: normal;
  text-align: center;
  line-height: 1.35;
  font-size: .76rem;
  font-weight: 700;
  background: rgba(5, 30, 36, .97);
  border: 1px solid var(--color-accent);
  border-radius: 9px;
  color: #f2fff1;
  box-shadow: 0 5px 18px #0008;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .12s ease;
}
.stadium-app .hotspot.on-image:is(:hover, :focus-visible) .hotspot-label {
  opacity: 1;
  visibility: visible;
}
.stadium-app .hotspot.on-image[data-tip-x="left"] .hotspot-label { left: -3px; transform: translate(0, -100%); }
.stadium-app .hotspot.on-image[data-tip-x="right"] .hotspot-label { left: auto; right: -3px; transform: translate(0, -100%); }
.stadium-app .hotspot.on-image[data-tip-y="bottom"] .hotspot-label { top: calc(100% + 11px); transform: translate(-50%, 0); }
.stadium-app .hotspot.on-image[data-tip-y="bottom"][data-tip-x="left"] .hotspot-label,
.stadium-app .hotspot.on-image[data-tip-y="bottom"][data-tip-x="right"] .hotspot-label { transform: translate(0, 0); }
.stadium-app .hotspot.on-image .hotspot-tag { display: none; }
.stadium-app .facility-extras {
  border-color: rgba(109, 163, 145, .45);
  background: linear-gradient(145deg, #102e36, #09222c);
}
.stadium-app .hotspot.compact {
  color: #eef9ef;
  background: rgba(15, 46, 49, .92);
  border-color: rgba(109, 164, 137, .58);
}
.stadium-app .hotspot.compact .hotspot-label { color: #f2fff1; }

@media (max-width: 1023px) {
  .stadium-app > .board { padding: 15px; }
  .stadium-app > header.topbar { gap: 12px; }
  .stadium-app > header.topbar > .club-identity { order: -2; flex: 1 1 190px; }
  .stadium-app > header.topbar > .topbar-left { order: -1; flex: 1 1 220px; }
}
@media (max-width: 760px) {
  .stadium-app > header.topbar { gap: 9px; padding: 12px; }
  .stadium-app > header.topbar > .club-identity {
    order: 0;
    flex: 1 1 100%;
    max-width: 100%;
    min-height: 46px;
    border-inline-end: 0;
    padding: 2px 4px 6px;
    border-bottom: 1px solid rgba(174, 230, 193, .16);
  }
  .stadium-app > header.topbar > .topbar-left > .search {
    order: 1;
    flex: 1 1 100%;
  }
  .stadium-app > header.topbar > .topbar-actions { order: 2; }
  .stadium-app .dashboard > .dash-matchday {
    min-height: 300px;
    padding: 24px 17px;
    background-position: center, center, 68% center;
  }
  .stadium-app .dashboard > .dash-matchday h2 { font-size: clamp(1.45rem, 7vw, 2.25rem); }
  .stadium-app .dashboard .stat-card { min-height: 120px; }
  .stadium-app .board .gm-view > :is(h1, .topbar):first-child { min-height: 74px; padding: 15px; }
  .stadium-app .stadium-hero-caption { gap: 6px 13px; }
  .stadium-app .hotspot.on-image,
  .stadium-app .hotspot.bowl.on-image { width: 29px; height: 29px; }
}
@media (hover: none) {
  .stadium-app .hotspot.on-image .hotspot-label { display: none; }
  .stadium-app .hotspot.on-image .hotspot-tag { display: none; }
}

.stadium-app .stadium-sidebar-brand a { display: block; }
.stadium-app .stadium-brand-logo { display: block; width: min(180px,100%); height: auto; max-height: 74px; object-fit: contain; object-position: left center; }
.stadium-app .stadium-brand-words { display: none; }
.stadium-app .stadium-nav-section h2 { color: #e3f0e7; font-size: .78rem; letter-spacing: .15em; margin: 8px 10px 9px; padding-bottom: 7px; border-bottom: 1px solid #45655f; }
.stadium-app .stadium-page-link.active { color: #f4fff0; font-weight: 700; }
.stadium-app .dashboard .stat-card:nth-child(2) { background: radial-gradient(circle at 90% 20%, #375849, transparent 50%), linear-gradient(120deg,#102e35,#09232b); }
.stadium-app .dashboard :is(.dash-matches > .card,.dash-squad) { background: linear-gradient(145deg,#15343b,#0b252e); }

.stadium-app .stadium-sidebar-brand { padding-bottom: 12px; }   /* 18 -> 12: the bigger shield must not push the menu down by its full growth */
/* Brand block: the shield 48 -> 58 px, GM SPORTS .94 -> 1.1rem, ONLINE SPORTS MANAGER .48 -> .7rem (letter-spacing .08 -> .04em), gap 10 -> 11 px; icon and texts stay centred on one line and the block must fit the sidebar. */
.stadium-app .stadium-sidebar-brand a { display: flex; align-items: center; gap: 10px; }
.stadium-app .stadium-brand-logo { width: 54px; height: 54px; flex: none; }
.stadium-app .stadium-brand-words { display: grid; gap: 4px; min-width: 0; flex: 1 1 auto; }
.stadium-app .stadium-brand-words strong { color: #f7faf2; font-size: 1.1rem; font-weight: 900; letter-spacing: .04em; line-height: 1.1; white-space: nowrap; }
.stadium-app .stadium-brand-words small { color: #c8d5d6; font-size: .58rem; font-weight: 800; letter-spacing: .02em; line-height: 1.15; white-space: nowrap; }   /* ONE line: .58rem fits the ~121 px left beside the shield */
