/* Stadium overview and authenticated utility bar. Scoped to the stadium shell. */
@media (min-width: 1201px) {
  .stadium-app > header.topbar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) max-content max-content;
    align-items: center;
    column-gap: clamp(12px, 1.2vw, 24px);
  }
  .stadium-app > header.topbar > .topbar-left,
  .stadium-app > header.topbar > .club-identity,
  .stadium-app > header.topbar > .topbar-actions {
    grid-column: auto;
    flex: none;
    width: auto;
    justify-self: stretch;
  }
  .stadium-app > header.topbar > .topbar-left > .search {
    width: 100%;
    max-width: none;
  }
  .stadium-app > header.topbar > .admin-controls { grid-column: 1 / -1; justify-self: end; }
}
.stadium-app > header.topbar {
  padding-block: 10px;
  background:
    linear-gradient(110deg, rgba(8, 32, 40, .98), rgba(9, 39, 42, .95)),
    url('/assets/torcida-guache-sm.webp') center / cover;
}
.stadium-app > header.topbar > .club-identity {
  border-inline-end: 0;
  padding-right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.stadium-app > header.topbar > .club-identity .crest {
  flex: none;
}
.stadium-app > header.topbar > .club-identity .club-details {
  flex: 1 1 auto;
  min-width: 0;
  text-align: center;
}
.stadium-app > header.topbar > .club-identity .club {
  text-align: center;
}
.stadium-app > header.topbar > .topbar-actions { gap: 12px; justify-content: flex-end; }
.stadium-app > header.topbar .club-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.stadium-app > header.topbar .club-chips a.chip {
  display: inline-flex;
  align-items: center;   /* label, value and arrow share one centre line, not a text baseline */
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;   /* symmetric: the chip grows in width with a long value ( 123,4M), the text never wraps */
  min-height: 40px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.stadium-app > header.topbar .club-chips a.chip .chip-arrow {
  display: inline-flex;
  align-items: center;
  color: var(--color-accent);
  font-size: .9rem;
  line-height: 1;
}
.stadium-app > header.topbar .club-chips a.chip:is(:hover, :focus-visible) {
  border-color: var(--color-accent);
  color: #f4fff2;
  background: #204539;
}
.stadium-app > header.topbar .club-chips a.chip[aria-current='page'] {
  border-color: #91d44d;
  background: #25503c;
}
.stadium-app > header.topbar .user-links { gap: 5px; }
.stadium-app > header.topbar .user-links a { padding: 8px 9px; border-radius: 7px; }
.stadium-app > header.topbar :is(a, input):focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* Editorial first screen: cards are condensed management tools with clear actions. */
.stadium-app .main[data-view="estadio"] > .stadium-page-heading {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
  padding: 0 0 17px;
  border-bottom: 1px solid rgba(161, 202, 174, .27);
}
.stadium-app .main[data-view="estadio"] .stadium-page-heading-copy { min-width: 0; }
.stadium-app .main[data-view="estadio"] .stadium-page-heading h1 {
  margin: 0;
  font-size: clamp(1.6rem, 2.1vw, 2.25rem);
  letter-spacing: -.035em;
  overflow-wrap: anywhere;
}
.stadium-app .main[data-view="estadio"] .stadium-page-heading p {
  margin: 6px 0 0;
  font-size: .9rem;
  color: #b8d1c8;
}
.stadium-app .main[data-view="estadio"] .stadium-rename {
  flex-shrink: 0;
  min-height: 44px;
  padding-inline: 16px;
  color: #e9f8e8;
  border-color: #577961;
  background: #234b3c;
}
.stadium-app .main[data-view="estadio"] .stadium-rename:is(:hover, :focus-visible) {
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.stadium-app .main[data-view="estadio"] .stadium-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1vw, 16px);
  align-items: stretch;
}
.stadium-app .main[data-view="estadio"] .stadium-overview > .stadium-summary-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 18px clamp(14px, 1.5vw, 22px);
  border: 1px solid rgba(131, 179, 146, .3);
  border-radius: 13px;
  background: linear-gradient(150deg, #14342f, #102a28);
  box-shadow: none;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-card .stat-header { margin: 0; }
.stadium-app .main[data-view="estadio"] .stadium-summary-card .stat-header h3 {
  color: #c8e1c4;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  min-width: 0;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-primary .stat {
  color: #f5fff1;
  font-size: clamp(1.5rem, 1.25rem + 1vw, 2.1rem);
  line-height: 1.15;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-unit {
  color: #b6cfc2;
  font-size: .8rem;
}
.stadium-app .main[data-view="estadio"] .stadium-capacity-progress { margin-top: 2px; }
.stadium-app .main[data-view="estadio"] :is(.stadium-capacity-progress progress, progress.stadium-attendance-progress) {
  display: block;
  width: 100%;
  height: 8px;
  overflow: hidden;
  border: 0;
  border-radius: var(--space-2);
  background: #2d5046;
  accent-color: var(--color-accent);
}
.stadium-app .main[data-view="estadio"] progress::-webkit-progress-bar { background: #2d5046; }
.stadium-app .main[data-view="estadio"] progress::-webkit-progress-value { background: var(--color-accent); border-radius: var(--space-2); }
.stadium-app .main[data-view="estadio"] progress::-moz-progress-bar { background: var(--color-accent); border-radius: var(--space-2); }
.stadium-app .main[data-view="estadio"] .stadium-capacity-progress p {
  margin: 8px 0 0;
  font-size: .76rem;
  line-height: 1.5;
}
.stadium-app .main[data-view="estadio"] .stadium-status,
.stadium-app .main[data-view="estadio"] .stadium-card-note {
  margin: 0;
  color: #b5d2c1;
  font-size: .77rem;
  line-height: 1.5;
}
.stadium-app .main[data-view="estadio"] .stadium-status { color: #d9ecca; }
.stadium-app .main[data-view="estadio"] .stadium-summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-actions .btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 auto;
  min-height: 44px;
  padding: 8px 10px;
  font-size: .8rem;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-actions .stadium-expand {
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border-color: var(--color-accent);
  font-weight: 850;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-actions .seats-reduce {
  margin: 0;
  color: #e0eedd;
  background: #254638;
  border-color: #557562;
}
.stadium-app .main[data-view="estadio"] .stadium-summary-actions .seats-reduce:disabled { opacity: .48; }
.stadium-app .main[data-view="estadio"] .stadium-card-note { padding-top: 2px; }
.stadium-app .main[data-view="estadio"] .stadium-metric-details {
  display: grid;
  gap: 0;
  margin-top: auto;
  border-top: 1px solid rgba(148, 187, 157, .22);
}
.stadium-app .main[data-view="estadio"] .stadium-metric-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(148, 187, 157, .16);
  font-size: .81rem;
}
.stadium-app .main[data-view="estadio"] .stadium-metric-row span { color: #bfd3c8; }
.stadium-app .main[data-view="estadio"] .stadium-metric-row strong {
  color: #f0f8ef;
  font-variant-numeric: tabular-nums;
  text-align: right;
  overflow-wrap: anywhere;
}
.stadium-app .main[data-view="estadio"] .stadium-attendance-card .stadium-card-note { margin-top: 0; }
.stadium-app .main[data-view="estadio"] .stadium-finance-link {
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  min-height: 44px;
  margin-top: 3px;
  padding: 8px 12px;
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border: 1px solid var(--color-accent);
  text-decoration: none;
  font-weight: 800;
}
.stadium-app .main[data-view="estadio"] .stadium-finance-link:is(:hover, :focus-visible) {
  color: var(--color-accent-ink);
  background: var(--color-accent-light);
}
.stadium-app .main[data-view="estadio"] .stadium-hero-card { margin-top: 18px; padding: 0; }
.stadium-app .main[data-view="estadio"] .stadium-hero-caption { gap: 12px 20px; }
.stadium-app .main[data-view="estadio"] .stadium-hero-intro { min-width: 0; }
.stadium-app .main[data-view="estadio"] .stadium-hero-caption h2 { margin: 0; font-size: 1.23rem; }
.stadium-app .main[data-view="estadio"] .stadium-hero-intro p {
  margin: 4px 0 0;
  color: #c1d9ca;
  font-size: .84rem;
}

@media (max-width: 1200px) and (min-width: 761px) {
  .stadium-app > header.topbar { display: grid; grid-template-columns: minmax(180px, 1fr) max-content; gap: 10px 16px; }
  .stadium-app > header.topbar > .topbar-left { grid-column: 1; grid-row: 1; width: 100%; flex: none; }
  .stadium-app > header.topbar > .club-identity { grid-column: 2; grid-row: 1; flex: none; }
  .stadium-app > header.topbar > .topbar-actions { grid-column: 1 / -1; grid-row: 2; flex: none; justify-content: flex-end; }
  .stadium-app > header.topbar > .admin-controls { grid-column: 1 / -1; justify-self: end; }
  .stadium-app > header.topbar .topbar-left > .search { width: 100%; max-width: none; }
  .stadium-app .main[data-view="estadio"] .stadium-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stadium-app .main[data-view="estadio"] .stadium-upkeep-card { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .stadium-app > header.topbar { display: flex; gap: 9px; }
  .stadium-app > header.topbar > .club-identity { order: 0; flex: 1 1 100%; max-width: 100%; }
  .stadium-app > header.topbar > .topbar-left { display: contents; }
  .stadium-app > header.topbar > .topbar-left > .search { order: 1; flex: 1 1 100%; }
  .stadium-app > header.topbar > .topbar-actions { order: 2; flex: 1 1 100%; justify-content: space-between; }
  .stadium-app > header.topbar > .admin-controls { order: 3; }
  .stadium-app > header.topbar .club-chips a.chip { min-height: 44px; padding: 7px 9px; }
  .stadium-app .main[data-view="estadio"] .stadium-overview { grid-template-columns: minmax(0, 1fr); }
  .stadium-app .main[data-view="estadio"] .stadium-overview > .stadium-summary-card { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .stadium-app > header.topbar .club-chips a.chip { transition: none; }
}
/* Stadium map: a soft, structure-sized light appears on hover/keyboard focus.
   It follows the existing manifest coordinates without drawing rectangular boxes. */
.stadium-app .hotspots .stadium-zone-highlight {
  position: absolute;
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(184, 243, 75, .19) 0%, rgba(184, 243, 75, .10) 44%, transparent 72%);
  filter: drop-shadow(0 0 11px rgba(184, 243, 75, .52));
  opacity: 0;
  transform: scale(.91);
  transition: opacity .18s ease, transform .22s ease;
  pointer-events: none;
  z-index: 0;
}
.stadium-app .hotspots .stadium-zone-highlight.is-visible {
  opacity: 1;
  transform: scale(1.13);
}
.stadium-app .hotspots .hotspot.on-image {
  left: calc(var(--x) * 1%);
  top: calc(var(--y) * 1%);
  width: calc(var(--w) * 1%);
  height: calc(var(--h) * 1%);
  min-width: 32px;
  min-height: 32px;
  transform: none;
  scale: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.stadium-app .hotspots .hotspot.on-image:is(:hover, :focus-visible) {
  border: 0;
  background: transparent;
  box-shadow: none;
  scale: 1;
}
.stadium-app .hotspots .hotspot.on-image .hotspot-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(212, 252, 163, .82);
  border-radius: 50%;
  background: rgba(5, 32, 32, .82);
  box-shadow: 0 0 0 2px rgba(8, 30, 27, .3);
  transition: background .16s ease, box-shadow .16s ease, scale .16s ease;
}
.stadium-app .hotspots .hotspot.on-image:is(:hover, :focus-visible) .hotspot-pin {
  background: #164b39;
  box-shadow: 0 0 0 4px rgba(184, 243, 75, .22), 0 0 18px rgba(184, 243, 75, .45);
  scale: 1.17;
}
.stadium-app .hotspots .hotspot.on-image .hotspot-label {
  left: 50%;
  top: calc(50% - 29px);
}
@media (prefers-reduced-motion: reduce) {
  .stadium-app .hotspots .stadium-zone-highlight { transition: none; }
}
