:root {
  --bg1: #f5f7f4;
  --bg2: #edf2ea;
  --bg3: #e4eee6;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-strong: rgba(255, 255, 255, 0.97);
  --line: rgba(15, 36, 28, 0.09);
  --line-strong: rgba(15, 36, 28, 0.16);
  --ink: #16261d;
  --muted: #66756d;
  --brand: rgb(14, 164, 99);
  --brand-mid: rgb(30, 203, 107);
  --brand-light: rgb(46, 232, 121);
  --brand2: rgb(14, 164, 99);
  --brand3: #143d2f;
  --accent: rgb(255, 109, 27);
  --accent-ink: #8a3907;
  --blue: rgb(46, 124, 255);
  --danger: #b53a2f;
  --shadow: 0 18px 42px rgba(11, 30, 22, 0.08);
  --shadow-soft: 0 10px 22px rgba(11, 30, 22, 0.05);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 100%;
}

body {
  min-height: 100vh;
  font-family: "Barlow", sans-serif;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 9% 8%, rgba(15, 106, 73, 0.14), transparent 36%),
    radial-gradient(circle at 88% 10%, rgba(241, 165, 47, 0.13), transparent 30%),
    radial-gradient(circle at 78% 84%, rgba(15, 106, 73, 0.08), transparent 38%),
    linear-gradient(180deg, var(--bg1), var(--bg2) 46%, var(--bg3));
}

.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(20, 42, 32, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 42, 32, 0.014) 1px, transparent 1px);
  background-size: 28px 28px;
}

.app {
  width: min(1160px, 100%);
  max-width: 100%;
  margin: 0 auto;
  padding: 14px 14px 28px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,251,248,0.92));
  border: 1px solid rgba(255,255,255,0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.topbar::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: min(44%, 440px);
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(255,109,27,0.18), transparent 55%),
    radial-gradient(circle at 54% 32%, rgba(46,232,121,0.14), transparent 60%),
    radial-gradient(circle at 30% 80%, rgba(46,124,255,0.13), transparent 62%);
}

.site-menu-nav {
  padding: 10px;
  margin-bottom: 10px;
  position: sticky;
  top: 8px;
  z-index: 12;
  max-width: 100%;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,250,247,0.93));
  border: 1px solid rgba(255,255,255,0.86);
  box-shadow: var(--shadow);
  transition: opacity 170ms ease, transform 170ms ease, max-height 170ms ease, padding 170ms ease, margin-bottom 170ms ease, border-width 170ms ease;
  max-height: 360px;
  overflow: visible;
}

.site-menu-nav.is-hidden-on-scroll {
  opacity: 0;
  transform: translateY(-12px);
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  margin-bottom: 0;
  border-width: 0;
  pointer-events: none;
}

.site-menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.site-menu-head strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.95rem;
  color: var(--brand3);
}

.current-path-bar {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid rgba(15, 36, 28, 0.08);
  min-width: 0;
}

.path-chip {
  border: 1px solid rgba(15, 36, 28, 0.1);
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.82rem;
  cursor: pointer;
  box-shadow: 0 2px 0 rgba(15, 36, 28, 0.02);
}

.path-chip.current {
  background: rgba(15,106,73,0.09);
  border-color: rgba(15,106,73,0.24);
  color: var(--brand);
  font-weight: 700;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  padding: 2px;
  text-align: left;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.brand-mark {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(247,250,247,0.96));
  border: 1px solid rgba(15,36,28,0.08);
  box-shadow:
    0 10px 18px rgba(11, 30, 22, 0.08),
    inset 0 1px 0 rgba(255,255,255,0.85);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 15px;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,109,27,0.08), transparent 55%),
    radial-gradient(circle at 82% 18%, rgba(46,124,255,0.08), transparent 58%),
    radial-gradient(circle at 56% 84%, rgba(46,232,121,0.08), transparent 58%);
  pointer-events: none;
}

.brand-mark-core {
  position: relative;
  z-index: 1;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.22rem;
  line-height: 1;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 6px rgba(8, 21, 16, 0.26);
}

.brand-mark-logo {
  position: relative;
  z-index: 1;
  width: 88%;
  height: 88%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(8, 21, 16, 0.08));
}

.brand-mark-core[hidden] {
  display: none !important;
}

.brand-copy {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.brand-kicker {
  display: inline-block;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand strong {
  display: block;
  font-family: "Space Grotesk", sans-serif;
  line-height: 0.98;
  color: var(--brand3);
  letter-spacing: 0.02em;
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  text-transform: uppercase;
}

.brand small {
  color: var(--muted);
  font-size: 0.84rem;
}

.brand:hover .brand-mark {
  transform: translateY(-1px);
  box-shadow:
    0 12px 20px rgba(11, 30, 22, 0.1),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.status-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(15,36,28,0.1);
  background: rgba(255,255,255,0.96);
  padding: 7px 11px;
  font-size: 0.9rem;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.status-pill span { color: var(--muted); }

.btn {
  border: 1px solid rgba(15,36,28,0.1);
  background: rgba(255,255,255,0.97);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 13px;
  cursor: pointer;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(11, 30, 22, 0.04);
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(15,106,73,0.18);
  box-shadow: 0 8px 16px rgba(11, 30, 22, 0.06);
}

.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  color: #f3fff9;
  background: linear-gradient(135deg, rgb(46, 232, 121) 0%, rgb(30, 203, 107) 50%, rgb(14, 164, 99) 100%);
  border-color: rgba(15,106,73,0.3);
  box-shadow: 0 10px 18px rgba(15,106,73,0.18);
}

.breadcrumbs {
  margin-bottom: 12px;
  min-width: 0;
}

.breadcrumbs ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li:not(:last-child)::after { content: "/"; color: var(--muted); }
.breadcrumbs button,
.breadcrumbs span {
  border: 0;
  background: transparent;
  padding: 0;
  font: inherit;
}
.breadcrumbs button { cursor: pointer; color: var(--muted); }
.breadcrumbs button:hover { color: var(--brand); }
.breadcrumbs .current { color: var(--ink); font-weight: 700; }

.view {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.node-view-layout.with-announcements {
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  align-items: start;
}

.home-selector-panel {
  display: grid;
  gap: 14px;
}

.home-selector-panel[hidden] {
  display: none !important;
}

.home-hero-panel {
  background:
    radial-gradient(circle at 12% 18%, rgba(46,124,255,0.08), transparent 46%),
    radial-gradient(circle at 86% 18%, rgba(255,109,27,0.08), transparent 44%),
    radial-gradient(circle at 70% 86%, rgba(46,232,121,0.08), transparent 48%),
    rgba(255,255,255,0.95);
}

.home-announcement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.node-announcement-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.home-announcement-card {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  padding: 10px;
  display: grid;
  gap: 5px;
}

.home-announcement-card strong {
  font-size: 0.95rem;
}

.home-announcement-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.home-announcement-tag {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  border: 1px solid rgba(46,124,255,0.18);
  background: rgba(46,124,255,0.08);
  color: var(--blue);
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 700;
}

.home-area-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-height: none;
  overflow: visible;
}

.home-collapsed-note .subtitle-tight {
  margin-top: 2px;
}

.panel {
  background: var(--panel);
  border: 1px solid rgba(255,255,255,0.84);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(8px);
  min-width: 0;
}

.hero h1, .panel-head h2, .panel h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 700;
}

.eyebrow-inline {
  margin-bottom: 4px;
  color: var(--muted);
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 70ch;
}

.subtitle-small {
  margin-top: 6px;
  font-size: 0.95rem;
}

.hero-search {
  margin-top: 12px;
}

input[type="search"] {
  width: 100%;
  border: 1px solid rgba(15,36,28,0.1);
  border-radius: 14px;
  padding: 11px 12px;
  font: inherit;
  background: rgba(255,255,255,0.98);
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

input[type="search"]:focus {
  outline: 2px solid rgba(15,106,73,0.14);
  border-color: rgba(15,106,73,0.28);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.panel-head-wrap {
  flex-wrap: wrap;
  align-items: flex-start;
}

.hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow: auto;
  padding-right: 2px;
}

.menu-card {
  width: 100%;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,247,0.95));
  padding: 9px 10px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 4px;
  position: relative;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease, background 140ms ease;
}

.menu-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
  border-color: rgba(15, 106, 73, 0.18);
}

.menu-card.has-teams {
  border-color: rgba(213, 123, 48, 0.2);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,249,239,0.96));
}

.menu-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.menu-card-badge {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border-radius: 999px;
  padding: 1px 6px;
  border: 1px solid rgba(15,106,73,0.16);
  background: rgba(15,106,73,0.08);
  color: var(--brand);
  font-size: 0.7rem;
  font-weight: 700;
}

.menu-card-badge.badge-girone {
  border-color: rgba(255,109,27,0.28);
  background: rgba(255,109,27,0.12);
  color: var(--accent-ink);
}

.menu-card-badge.badge-sezione {
  border-color: rgba(93,103,97,0.14);
  background: rgba(93,103,97,0.06);
  color: var(--muted);
}

.menu-card-arrow {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid rgba(15,36,28,0.08);
  background: rgba(255,255,255,0.9);
  color: var(--muted);
  display: grid;
  place-items: center;
  font-size: 1rem;
  line-height: 1;
}

.menu-card-title {
  font-size: 0.94rem;
  line-height: 1.1;
}

.menu-card-meta {
  color: var(--muted);
  font-size: 0.78rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.toolbar input {
  min-width: 260px;
}

.subhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
}

.subhead h3 {
  margin: 0;
  font-size: 1rem;
}

.dropdown-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  min-width: 0;
  max-width: 100%;
}

.drop-item {
  position: relative;
  min-width: 0;
}

.drop-item > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  border: 1px solid rgba(15,36,28,0.1);
  border-radius: 999px;
  background: rgba(255,255,255,0.97);
  padding: 6px 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  max-width: 100%;
  box-shadow: 0 2px 8px rgba(11, 30, 22, 0.03);
}

.drop-item > summary::-webkit-details-marker {
  display: none;
}

.drop-item > summary::after {
  content: "▾";
  color: var(--muted);
  font-size: 0.8rem;
}

.drop-item[open] > summary {
  border-color: rgba(15,106,73,0.22);
  background: rgba(15,106,73,0.08);
}

.drop-item.current > summary {
  border-color: rgba(255,109,27,0.3);
  background: rgba(255,109,27,0.12);
}

.drop-item.primary > summary {
  border-color: rgba(46,124,255,0.2);
  background: linear-gradient(180deg, rgba(46,124,255,0.09), rgba(46,124,255,0.05));
}

.drop-item.disabled > summary {
  cursor: not-allowed;
  color: rgba(102, 117, 109, 0.9);
  border-color: rgba(15,36,28,0.07);
  background: linear-gradient(180deg, rgba(245,247,244,0.95), rgba(239,243,239,0.94));
  box-shadow: none;
  opacity: 0.92;
}

.drop-item.disabled > summary::after {
  color: rgba(102, 117, 109, 0.65);
}

.drop-item.disabled.current > summary,
.drop-item.disabled.primary > summary {
  border-color: rgba(15,36,28,0.07);
  background: linear-gradient(180deg, rgba(245,247,244,0.95), rgba(239,243,239,0.94));
}

.drop-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 15;
  min-width: 260px;
  max-width: 360px;
  max-height: 340px;
  overflow: auto;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.99);
  box-shadow: 0 20px 32px rgba(11, 30, 22, 0.12);
  padding: 6px;
  overscroll-behavior: contain;
}

.drop-panel.right {
  left: auto;
  right: 0;
}

.drop-panel button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 10px;
  padding: 8px 9px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}

.drop-panel button:hover {
  background: rgba(15,106,73,0.06);
  border-color: rgba(15,106,73,0.12);
}

.drop-panel button.active {
  background: rgba(255,109,27,0.12);
  border-color: rgba(255,109,27,0.2);
}

.drop-line-title {
  font-weight: 700;
  line-height: 1.1;
}

.drop-line-meta {
  color: var(--muted);
  font-size: 0.75rem;
}

.drop-inline-label {
  color: var(--muted);
  font-size: 0.8rem;
  margin-right: 2px;
  font-weight: 600;
}

.node-nav-hint {
  margin: 0;
}

.girone-tabs {
  margin-top: 10px;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
  max-width: 100%;
}

.tab-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 10px;
  padding: 7px 11px;
  font-weight: 700;
  cursor: pointer;
}

.tab-btn.active {
  color: var(--blue);
  background: rgba(46,124,255,0.1);
  border-color: rgba(46,124,255,0.18);
  box-shadow: 0 3px 10px rgba(46,124,255,0.08);
}

.stack-list {
  display: grid;
  gap: 8px;
}

.compact-list {
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
  gap: 6px;
}

.compact-list .menu-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas:
    "badge title arrow"
    "badge meta  arrow";
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  padding: 8px 9px;
}

.compact-list .menu-card-top {
  display: contents;
}

.compact-list .menu-card-badge {
  grid-area: badge;
  align-self: start;
}

.compact-list .menu-card-title {
  grid-area: title;
  font-size: 0.9rem;
}

.compact-list .menu-card-meta {
  grid-area: meta;
  font-size: 0.75rem;
}

.compact-list .menu-card-arrow {
  grid-area: arrow;
  align-self: center;
}

.teams-section {
  margin-top: 14px;
  min-width: 0;
  max-width: 100%;
}

.node-columns {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.node-menu-pane {
  position: sticky;
  top: 8px;
}

.node-menu-pane .subhead,
.node-teams-pane .subhead {
  margin-top: 0;
}

.node-menu-pane .subhead h3,
.node-teams-pane .subhead h3 {
  font-size: 0.95rem;
}

.node-menu-pane {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: rgba(255,255,255,0.72);
}

.node-teams-pane {
  margin-top: 0;
  min-width: 0;
}

.dropdown-bar + .teams-section {
  margin-top: 12px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 16px;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
  background: rgba(255,255,255,0.88);
}

.teams-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: rgba(255,255,255,0.95);
}

.teams-table th,
.teams-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,36,28,0.07);
}

.standings-table th:nth-child(n + 3),
.standings-table td:nth-child(n + 3) {
  text-align: center;
  white-space: nowrap;
}

.standings-table td.rank-col {
  text-align: left;
}

.calendar-list {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.calendar-rounds-bar {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  padding: 4px 2px 2px;
  margin-bottom: 10px;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.88);
  scrollbar-width: thin;
  scroll-snap-type: x proximity;
}

.calendar-rounds-track {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  min-width: max-content;
  max-width: none;
  padding: 4px;
}

.round-chip {
  display: inline-flex;
  flex: 0 0 auto;
  border: 1px solid rgba(15,36,28,0.08);
  background: rgba(255,255,255,0.98);
  color: var(--ink);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  scroll-snap-align: start;
  box-shadow: 0 2px 8px rgba(11, 30, 22, 0.03);
}

.calendar-rounds-track .empty-inline {
  display: block;
  white-space: normal;
}

.calendar-rounds-bar::-webkit-scrollbar {
  height: 7px;
}

.calendar-rounds-bar::-webkit-scrollbar-thumb {
  background: rgba(93,103,97,0.25);
  border-radius: 999px;
}

.round-chip.active {
  background: rgba(46,124,255,0.1);
  border-color: rgba(46,124,255,0.22);
  color: var(--blue);
}

.giornata-card {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.94);
  overflow: hidden;
  min-width: 0;
  box-shadow: var(--shadow-soft);
}

.giornata-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,36,28,0.06);
  background:
    linear-gradient(180deg, rgba(248,251,248,0.96), rgba(244,249,245,0.95));
}

.giornata-head strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
}

.giornata-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.match-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.match-group {
  border: 1px solid rgba(15,36,28,0.06);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,0.9);
}

.match-group-head {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15,36,28,0.06);
  background: linear-gradient(180deg, rgba(248,251,248,0.98), rgba(244,248,245,0.95));
}

.match-group-head strong {
  color: var(--brand3);
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

.match-group-list {
  display: grid;
}

.match-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(15,36,28,0.06);
  min-width: 0;
}

.match-row.match-row-clickable {
  cursor: pointer;
}

.match-row.match-row-clickable:hover {
  background: rgba(46,124,255,0.04);
}

.match-row:nth-child(odd) {
  background: rgba(247, 251, 248, 0.45);
}

.match-row:last-child {
  border-bottom: 0;
}

.match-team {
  display: flex;
  align-items: center;
  gap: 9px;
  overflow-wrap: anywhere;
  min-width: 0;
  font-size: 1.02rem;
}

.match-team.away {
  justify-content: flex-end;
  text-align: right;
}

.match-team-name {
  min-width: 0;
}

.match-logo {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15,36,28,0.08);
  padding: 2px;
  flex: 0 0 auto;
}

.match-logo[hidden] {
  display: none !important;
}

.match-center {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 104px;
}

.match-score {
  font-weight: 700;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 1rem;
  background: rgba(46,124,255,0.1);
  border: 1px solid rgba(46,124,255,0.18);
  color: var(--blue);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.5);
}

.match-score.pending {
  background: rgba(93,103,97,0.06);
  border-color: rgba(93,103,97,0.14);
  color: var(--muted);
}

.match-meta {
  color: var(--muted);
  font-size: 0.74rem;
  text-align: center;
}

.teams-table th {
  color: var(--muted);
  font-size: 0.84rem;
  background:
    linear-gradient(180deg, rgba(248,251,248,0.98), rgba(244,248,245,0.96));
  position: sticky;
  top: 0;
  z-index: 1;
}

.teams-table tbody tr:last-child td { border-bottom: 0; }
.teams-table tbody tr:hover { background: rgba(15,106,73,0.035); }
.teams-table tbody tr.team-row-clickable { cursor: pointer; }
.teams-table tbody tr.team-row-clickable:hover { background: rgba(15,106,73,0.055); }

.rank-col {
  width: 48px;
  color: var(--muted);
  font-weight: 700;
}

.tipo-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  border: 1px solid rgba(46,124,255,0.18);
  background: rgba(46,124,255,0.08);
  color: var(--blue);
  font-size: 0.8rem;
  font-weight: 700;
}

.tipo-tag.muted {
  border-color: rgba(93,103,97,0.14);
  background: rgba(93,103,97,0.06);
  color: var(--muted);
}

.open-btn {
  border: 1px solid rgba(15,36,28,0.09);
  background: rgba(255,255,255,0.97);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.open-btn:hover {
  border-color: rgba(46,124,255,0.2);
  background: rgba(46,124,255,0.05);
}

.team-name-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-name-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.team-logo-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15,36,28,0.08);
  padding: 2px;
  flex: 0 0 auto;
}

.team-logo-thumb[hidden] {
  display: none !important;
}

.empty-inline { color: var(--muted); margin: 0; }
.empty-cell { color: var(--muted); text-align: center; }

.team-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 26, 20, 0.22);
  z-index: 24;
  backdrop-filter: blur(2px);
}

.team-drawer-backdrop[hidden] {
  display: none !important;
}

.roster-drawer-backdrop {
  z-index: 26;
  background: rgba(11, 26, 20, 0.16);
}

.match-drawer-backdrop {
  z-index: 28;
  background: rgba(11, 26, 20, 0.22);
}

.team-drawer {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: min(460px, 92vw);
  z-index: 25;
  transform: translateX(-102%);
  transition: transform 190ms ease;
  pointer-events: none;
  padding: 10px;
}

.team-drawer[hidden] {
  display: block !important;
  visibility: hidden;
}

.roster-drawer {
  left: auto;
  right: 0;
  z-index: 27;
  transform: translateX(102%);
}

.match-drawer {
  z-index: 29;
}

.team-drawer.is-open {
  transform: translateX(0);
  pointer-events: auto;
}

.roster-drawer.is-open {
  transform: translateX(0);
}

.match-detail-shell {
  background:
    radial-gradient(circle at 18% 18%, rgba(255,109,27,0.06), transparent 48%),
    radial-gradient(circle at 82% 18%, rgba(46,124,255,0.07), transparent 52%),
    radial-gradient(circle at 52% 86%, rgba(46,232,121,0.06), transparent 56%),
    rgba(255,255,255,0.94);
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 20px;
}

.match-detail-shell .toolbar {
  display: inline-flex;
  width: auto;
  align-items: center;
  justify-content: flex-end;
}

.match-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(15,36,28,0.1);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(246,250,247,0.94));
  padding: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.85);
}

.match-hero-team {
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.match-hero-team.away { justify-items: center; }

.match-hero-team strong {
  font-size: 1rem;
  text-align: center;
  line-height: 1.1;
  overflow-wrap: anywhere;
  min-height: 2.1em;
  margin: 0;
}

.match-rank-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(15,36,28,0.12);
  background: rgba(15,36,28,0.04);
  color: rgba(15,36,28,0.48);
  font-weight: 700;
  font-size: 0.82rem;
}

.match-rank-pill:not([hidden]) {
  background: rgba(15,36,28,0.06);
  border-color: rgba(15,36,28,0.16);
  color: rgba(15,36,28,0.64);
}

.match-rank-pill[hidden] {
  display: none !important;
}

.match-hero-logo,
.match-hero-logo-fallback {
  width: 58px;
  height: 58px;
  border-radius: 16px;
}

.match-hero-logo {
  object-fit: contain;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15,36,28,0.08);
  padding: 4px;
}

.match-hero-logo[hidden] {
  display: none !important;
}

.match-hero-logo:not([hidden]) + .match-hero-logo-fallback {
  display: none !important;
}

.match-hero-logo-fallback {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(46,124,255,0.12), rgba(46,232,121,0.12));
  border: 1px solid rgba(46,124,255,0.16);
  color: var(--brand3);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.match-hero-scorers {
  margin-top: 1px;
  display: grid;
  gap: 3px;
  width: 100%;
}

.match-hero-scorers[hidden] {
  display: none !important;
}

.match-scorer-line {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.match-scorer-line.home {
  text-align: left;
}

.match-scorer-line.away {
  text-align: right;
}

.match-hero-center {
  display: grid;
  justify-items: center;
  gap: 0;
  min-width: 124px;
  padding: 4px 8px;
  align-content: center;
}

.match-status-badge {
  color: var(--blue);
  font-weight: 700;
  letter-spacing: 0.05em;
  font-size: 1rem;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 0;
}

.match-status-badge[hidden] {
  display: none !important;
}

.match-hero-score {
  font-family: "Space Grotesk", sans-serif;
  font-size: 2.25rem;
  line-height: 1;
  font-weight: 700;
}

.match-hero-meta {
  color: var(--muted);
  font-size: 0.96rem;
  text-align: center;
}

.match-hero-meta[hidden] {
  display: none !important;
}

.match-detail-tabs {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
}

.match-detail-tab {
  flex: 1 1 0;
  border-radius: 999px;
  padding: 9px 12px;
  border: 1px solid rgba(15,36,28,0.08);
  background: rgba(255,255,255,0.86);
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
  min-width: 100px;
}

.match-detail-tab.active {
  color: var(--blue);
  border-color: rgba(46,124,255,0.18);
  background: rgba(46,124,255,0.08);
}

.match-goals-section[hidden] {
  display: none !important;
}

.match-gallery-section[hidden] {
  display: none !important;
}

.match-goals-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.match-gallery-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 12px;
}

.goal-event-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  justify-items: start;
}

.goal-event-row.away {
  grid-template-columns: auto minmax(0, 1fr) auto;
  justify-items: end;
}

.goal-event-row.away .goal-event-meta {
  text-align: right;
}

.goal-event-chip {
  border-radius: 999px;
  border: 1px solid rgba(46,232,121,0.24);
  background: rgba(46,232,121,0.08);
  color: var(--brand2);
  padding: 7px 13px;
  font-weight: 700;
}

.goal-event-row.autogol .goal-event-chip {
  border-color: rgba(255, 109, 27, 0.25);
  background: rgba(255, 109, 27, 0.08);
  color: rgb(173, 77, 19);
}

.goal-event-row.rigore:not(.autogol) .goal-event-chip {
  border-color: rgba(46,124,255,0.26);
  background: rgba(46,124,255,0.1);
  color: var(--blue);
}

.goal-event-meta {
  min-width: 0;
  border: 1px solid rgba(46,232,121,0.18);
  background: rgba(255,255,255,0.88);
  border-radius: 14px;
  padding: 10px 12px;
  display: grid;
  gap: 3px;
}

.goal-event-row.autogol .goal-event-meta {
  border-color: rgba(255, 109, 27, 0.22);
}

.goal-event-meta strong {
  font-size: 0.94rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.goal-event-meta span {
  color: var(--muted);
  font-size: 0.82rem;
}

.goal-event-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.goal-event-flag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(15,36,28,0.12);
  background: rgba(15,36,28,0.05);
  color: var(--brand3);
  font-size: 0.74rem;
  font-weight: 700;
}

.goal-event-flag.rigore {
  border-color: rgba(46,124,255,0.22);
  background: rgba(46,124,255,0.1);
  color: var(--blue);
}

.goal-event-flag.autogol {
  border-color: rgba(255,109,27,0.26);
  background: rgba(255,109,27,0.1);
  color: rgb(173, 77, 19);
}

.goal-event-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgba(46,124,255,0.2);
  background: rgba(46,124,255,0.1);
  color: var(--blue);
}

.goal-event-icon.autogol {
  border-color: rgba(255, 109, 27, 0.28);
  background: rgba(255, 109, 27, 0.12);
  color: rgb(196, 74, 17);
}

.gallery-media-card {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 22px;
  background: rgba(255,255,255,0.9);
  overflow: hidden;
  display: grid;
  gap: 0;
  box-shadow: 0 12px 24px rgba(11, 30, 22, 0.08);
}

.gallery-media-link {
  display: block;
  aspect-ratio: 4 / 3;
  background: rgba(245,247,244,0.92);
  position: relative;
  text-decoration: none;
}

.gallery-media-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-link-card {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 16px;
  text-decoration: none;
  color: var(--blue);
  font-weight: 700;
  background:
    radial-gradient(circle at 20% 18%, rgba(46,124,255,0.08), transparent 42%),
    rgba(248,251,248,0.96);
}

.gallery-media-overlay {
  position: absolute;
  inset: auto 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, transparent, rgba(8, 18, 14, 0.56));
}

.gallery-media-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 42px;
  border-radius: 999px;
  padding: 0 18px;
  background: rgba(255,255,255,0.9);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 8px 16px rgba(11, 30, 22, 0.12);
}

.gallery-provider-card {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(233, 239, 231, 0.92);
  color: var(--ink);
  box-shadow: 0 8px 16px rgba(11, 30, 22, 0.12);
}

.gallery-provider-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: contain;
  background: #000;
  padding: 5px;
}

.gallery-provider-copy {
  display: grid;
  gap: 2px;
}

.gallery-provider-copy strong {
  font-size: 0.95rem;
  line-height: 1;
}

.gallery-provider-copy span {
  color: var(--muted);
  font-size: 0.82rem;
}

.gallery-media-meta {
  display: grid;
  gap: 4px;
  padding: 14px 16px 16px;
  background: rgba(250,251,249,0.96);
}

.gallery-media-meta strong {
  font-size: 0.98rem;
  line-height: 1.15;
}

.gallery-media-meta span {
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.match-primary-cards {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-info-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.9);
  padding: 11px;
}

.match-info-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(46,124,255,0.14);
  background: rgba(46,124,255,0.08);
  color: var(--blue);
  font-weight: 700;
}

.match-info-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.match-info-text strong {
  font-size: 0.92rem;
}

.match-info-text span {
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.match-info-action {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  text-decoration: none;
  border: 1px solid rgba(46,124,255,0.18);
  background: rgba(46,124,255,0.08);
  color: var(--blue);
  font-weight: 700;
}

.match-timeline-info {
  margin-top: 12px;
}

.match-timeline-chip {
  border-radius: 999px;
  border: 1px solid rgba(46,124,255,0.14);
  background: rgba(46,124,255,0.08);
  color: var(--brand3);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.85rem;
}

.team-drawer.is-open[hidden] {
  visibility: visible;
}

.team-drawer-inner {
  height: 100%;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-content: start;
  padding-right: 2px;
  overscroll-behavior: contain;
}

.roster-list {
  display: grid;
  gap: 10px;
}

.roster-role-group {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 14px;
  background: rgba(255,255,255,0.94);
  overflow: hidden;
}

.roster-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-bottom: 1px solid rgba(15,36,28,0.06);
  background: linear-gradient(180deg, rgba(248,251,248,0.98), rgba(244,248,245,0.95));
}

.roster-role-head strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.92rem;
}

.roster-role-head span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.roster-players {
  display: grid;
}

.roster-player-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid rgba(15,36,28,0.06);
}

.roster-player-card:last-child {
  border-bottom: 0;
}

.shirt-badge {
  width: 44px;
  height: 32px;
  border-radius: 10px 10px 12px 12px;
  border: 1px solid rgba(46,124,255,0.2);
  background: linear-gradient(135deg, rgba(46,124,255,0.12), rgba(46,232,121,0.12));
  color: var(--brand3);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  display: grid;
  place-items: center;
  position: relative;
}

.shirt-badge::before { left: -4px; }
.shirt-badge::after { right: -4px; }

.roster-player-main { min-width: 0; }

.roster-player-name {
  font-weight: 700;
  overflow-wrap: anywhere;
}

.roster-player-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 2px;
}

.team-header {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(15,36,28,0.1);
  border-radius: 18px;
  background:
    linear-gradient(140deg, rgba(46,232,121,0.08), rgba(255,109,27,0.06) 52%, rgba(46,124,255,0.08)),
    rgba(255,255,255,0.95);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.75);
}

.team-avatar {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgb(46, 232, 121) 0%, rgb(30, 203, 107) 50%, rgb(14, 164, 99) 100%);
  color: white;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  position: relative;
  overflow: hidden;
}

.team-avatar-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(255,255,255,0.95);
  padding: 7px;
}

.team-avatar.has-logo {
  background: rgba(255,255,255,0.96);
  color: transparent;
}

.team-header-main {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.team-header-controls {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  border: 1px solid rgba(15,36,28,0.14);
  background: rgba(255,255,255,0.96);
  color: var(--ink);
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.1rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(11, 30, 22, 0.04);
  transition: transform 120ms ease, box-shadow 120ms ease, border-color 120ms ease;
}

.icon-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(11, 30, 22, 0.08);
  border-color: rgba(15,106,73,0.22);
}

.icon-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.icon-btn-close {
  border-color: rgba(255,109,27,0.26);
  color: rgb(184, 71, 8);
  background: rgba(255,109,27,0.08);
}

.team-header-main #teamName {
  line-height: 1.04;
  font-size: clamp(1.25rem, 1.6vw, 1.56rem);
}

.team-header-main #teamSubline {
  margin-top: 0;
  margin-bottom: 0;
  font-size: 0.9rem;
  color: #55645d;
}

#teamContextLabel {
  margin-bottom: 2px;
  color: var(--blue);
  font-weight: 700;
}

.meta-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.meta-card {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.94);
  padding: 10px;
}

.meta-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
}

.meta-card strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.team-menu-actions {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.team-menu-btn {
  justify-content: center;
  border-color: rgba(15,36,28,0.1);
  background: rgba(255,255,255,0.97);
}

.team-menu-btn.is-active {
  color: var(--brand3);
  border-color: rgba(46,124,255,0.32);
  background:
    linear-gradient(180deg, rgba(46,124,255,0.12), rgba(46,124,255,0.06)),
    rgba(255,255,255,0.98);
  box-shadow:
    inset 0 0 0 1px rgba(46,124,255,0.2),
    0 6px 14px rgba(46,124,255,0.12);
}

.details-list {
  display: grid;
  gap: 8px;
}

.next-match-card {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 16px;
  background:
    radial-gradient(circle at 14% 20%, rgba(46,124,255,0.05), transparent 42%),
    radial-gradient(circle at 86% 18%, rgba(255,109,27,0.06), transparent 44%),
    radial-gradient(circle at 70% 86%, rgba(46,232,121,0.05), transparent 46%),
    rgba(255,255,255,0.95);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  align-items: center;
}

.next-match-left {
  display: grid;
  gap: 3px;
  align-content: start;
}

.next-match-lead {
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.72rem;
  font-weight: 700;
}

.next-match-countdown {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  line-height: 1.05;
  color: var(--brand3);
}

.next-match-when {
  color: var(--muted);
  font-size: 0.9rem;
}

.next-match-right {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  align-items: stretch;
}

.next-match-team-row {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.86);
  padding: 6px 9px;
}

.next-match-side-badge {
  border-radius: 999px;
  border: 1px solid rgba(46,124,255,0.16);
  background: rgba(46,124,255,0.08);
  color: var(--blue);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  width: fit-content;
}

.next-match-logo-wrap {
  width: 44px;
  height: 44px;
  position: relative;
}

.next-match-logo,
.next-match-logo-fallback {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.next-match-logo {
  object-fit: contain;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15,36,28,0.08);
  padding: 3px;
  position: absolute;
  inset: 0;
  z-index: 1;
}

.next-match-logo[hidden] {
  display: none !important;
}

.next-match-logo-fallback {
  display: grid;
  place-items: center;
  border: 1px solid rgba(46,124,255,0.14);
  background: rgba(46,124,255,0.07);
  color: var(--blue);
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
}

.next-match-team-name {
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.1;
  font-weight: 700;
  font-size: 0.93rem;
}

.detail-row {
  border: 1px solid rgba(15,36,28,0.08);
  border-radius: 12px;
  background: rgba(255,255,255,0.94);
  padding: 10px;
}

.detail-row strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-row span {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.detail-row a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.detail-row a:hover {
  text-decoration: underline;
}

.detail-link-btn {
  border: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
  text-align: left;
}

.detail-link-btn:hover {
  text-decoration: underline;
}

.detail-row-actions {
  margin-top: 10px;
}

.detail-row-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border-radius: 999px;
  padding: 7px 12px;
  border: 1px solid rgba(46,124,255,0.24);
  background: rgba(46,124,255,0.1);
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.detail-row-map-btn:hover {
  background: rgba(46,124,255,0.16);
}

.status-bar {
  margin: 12px 2px 0;
  color: var(--muted);
  min-height: 1.25em;
  font-size: 0.92rem;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(11, 26, 20, 0.26);
  backdrop-filter: blur(2px);
  z-index: 40;
}

.loading-overlay[hidden] {
  display: none !important;
}

.loading-card {
  min-width: 250px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(255,255,255,0.85);
  box-shadow: var(--shadow);
}

.spinner {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(15,106,73,0.18);
  border-top-color: var(--brand);
  animation: spin 0.8s linear infinite;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 960px) {
  .app {
    padding: 12px 12px 20px;
  }
  .home-announcement-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .home-area-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .node-columns { grid-template-columns: 1fr; }
  .node-menu-pane { position: static; }
  .compact-list { max-height: 320px; }
  .panel {
    border-radius: 16px;
    padding: 12px;
  }
  .teams-table {
    min-width: 620px;
  }
  #teamsSection .teams-table {
    min-width: 560px;
  }
  .drop-panel {
    position: fixed;
    left: 12px !important;
    right: 12px !important;
    min-width: 0;
    max-width: none;
    max-height: 42vh;
  }
}

@media (max-width: 760px) {
  .app {
    padding: 10px 10px 16px;
  }
  .topbar {
    gap: 8px;
    padding: 10px;
    border-radius: 16px;
  }
  .topbar::before {
    width: 100%;
    opacity: 0.8;
  }
  .brand {
    width: 100%;
    align-items: flex-start;
  }
  .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
  }
  .brand-mark::before {
    border-radius: 13px;
  }
  .brand-mark-core {
    font-size: 1.05rem;
  }
  .brand-kicker {
    font-size: 0.66rem;
  }
  .brand strong {
    font-size: 1.12rem;
  }
  .brand small {
    font-size: 0.8rem;
  }
  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }
  .status-pill {
    grid-column: 1 / -1;
    justify-content: center;
    padding: 8px 12px;
  }
  .topbar-actions .btn {
    width: 100%;
    justify-content: center;
  }
  .site-menu-nav {
    top: 6px;
    padding: 8px;
    border-radius: 16px;
  }
  .site-menu-head {
    margin-bottom: 6px;
  }
  .dropdown-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    align-items: start;
    overflow: visible;
    padding-bottom: 0;
  }
  .drop-item {
    min-width: 0;
  }
  .drop-item > summary {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    font-size: 0.88rem;
    max-width: none;
    overflow: hidden;
    text-overflow: clip;
    min-width: 0;
    line-height: 1.1;
  }
  .drop-item > summary > * {
    min-width: 0;
  }
  .drop-item > summary::after {
    justify-self: end;
  }
  .drop-inline-label {
    font-size: 0.74rem;
    margin-right: 0;
  }
  .drop-item.current > summary,
  .drop-item.primary > summary {
    padding: 6px 9px;
    font-size: 0.84rem;
  }
  .drop-item.current > summary .drop-inline-label,
  .drop-item.primary > summary .drop-inline-label {
    font-size: 0.7rem;
  }
  .current-path-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: 7px;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .current-path-bar .path-chip {
    flex: 0 0 auto;
    white-space: nowrap;
  }
  .breadcrumbs {
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 10px;
    -webkit-overflow-scrolling: touch;
  }
  .breadcrumbs ol {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    padding-bottom: 2px;
  }
  .home-collapsed-note .panel-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .home-announcement-grid,
  .home-area-grid {
    grid-template-columns: 1fr;
  }
  .node-view-layout.with-announcements {
    grid-template-columns: minmax(0, 1fr);
  }
  .panel-head {
    align-items: flex-start;
  }
  .panel-head.panel-head-wrap > * {
    width: 100%;
  }
  .toolbar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
  }
  .toolbar input {
    min-width: 0;
    width: 100%;
  }
  .girone-tabs {
    display: flex;
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    gap: 4px;
    padding: 4px;
  }
  .girone-tabs .tab-btn {
    flex: 0 0 auto;
  }
  .subhead {
    margin-top: 10px;
    margin-bottom: 6px;
  }
  .subhead h3 {
    font-size: 0.96rem;
  }
  .teams-table th,
  .teams-table td {
    padding: 9px 8px;
    font-size: 0.92rem;
  }
  .teams-table {
    min-width: 560px;
  }
  #teamsSection .teams-table {
    min-width: 500px;
  }
  .open-btn {
    padding: 5px 8px;
    font-size: 0.84rem;
  }
  .calendar-rounds-bar {
    padding: 4px 4px 3px;
    margin-bottom: 8px;
  }
  .round-chip {
    max-width: none;
    padding: 7px 12px;
    font-size: 0.8rem;
  }
  .giornata-head {
    padding: 9px 10px;
  }
  .match-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "home center"
      "away center";
    align-items: center;
    gap: 6px 8px;
    padding: 9px 10px;
  }
  .match-team.home {
    grid-area: home;
  }
  .match-team.away {
    grid-area: away;
    justify-content: flex-start;
    text-align: left;
  }
  .match-center {
    grid-area: center;
    align-self: stretch;
    align-content: center;
    min-width: 78px;
  }
  .match-meta {
    font-size: 0.72rem;
    line-height: 1.15;
    max-width: 90px;
  }
  .team-drawer {
    width: 100vw;
    padding: 8px;
  }
  .roster-drawer {
    width: 100vw;
    padding: 8px;
  }
  .match-drawer {
    width: 100vw;
    padding: 8px;
  }
  .team-header {
    grid-template-columns: 60px minmax(0, 1fr) auto;
    align-items: flex-start;
  }
  .team-header-controls {
    gap: 4px;
  }
  .icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    font-size: 1rem;
  }
  .next-match-card {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .next-match-right {
    gap: 6px;
  }
  .match-hero-card {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    text-align: initial;
    padding: 14px;
  }
  .match-hero-center {
    order: 0;
    min-width: 124px;
  }
  .match-hero-team {
    grid-template-columns: none;
    display: grid;
    align-items: initial;
    justify-items: center;
    text-align: center;
  }
  .match-hero-team.away {
    justify-items: center;
    grid-template-columns: none;
  }
  .match-hero-team.away .match-hero-logo,
  .match-hero-team.away .match-hero-logo-fallback {
    order: 0;
  }
  .match-hero-team.away strong {
    text-align: center;
  }
  .match-scorer-line.home {
    text-align: left;
  }
  .match-scorer-line.away {
    text-align: right;
  }
  .match-primary-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .match-detail-tab {
    min-width: 100px;
  }
  .match-gallery-list {
    grid-template-columns: 1fr;
  }
  .gallery-media-overlay {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 12px;
  }
  .gallery-media-cta,
  .gallery-provider-card {
    width: 100%;
    max-width: none;
  }
}

@media (max-width: 680px) {
  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .site-menu-nav {
    top: 6px;
  }
  .site-menu-head {
    width: 100%;
  }
  .dropdown-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding: 1px 0 2px;
    overflow: visible;
  }
  .drop-item {
    min-width: 0;
  }
  .drop-item > summary {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 7px 9px;
    font-size: 0.82rem;
    gap: 6px;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .drop-inline-label {
    font-size: 0.7rem;
  }
  .toolbar { width: 100%; }
  .toolbar input { min-width: 0; width: 100%; }
  .card-grid { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .team-drawer {
    width: 100vw;
    padding: 8px;
  }
  .roster-drawer {
    width: 100vw;
    padding: 8px;
  }
  .match-drawer {
    width: 100vw;
    padding: 8px;
  }
  .compact-list .menu-card {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "title arrow"
      "meta  arrow";
  }
  .compact-list .menu-card-badge {
    display: none;
  }
}

@media (max-width: 560px) {
  .app {
    padding: 8px 8px 14px;
  }
  .brand {
    gap: 9px;
  }
  .brand-mark {
    width: 42px;
    height: 42px;
    border-radius: 13px;
  }
  .brand-mark::before {
    border-radius: 12px;
  }
  .brand-mark-core {
    font-size: 0.98rem;
  }
  .brand-kicker {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
  }
  .brand strong {
    font-size: 1.02rem;
  }
  .brand small {
    font-size: 0.74rem;
  }
  .panel {
    padding: 10px;
    border-radius: 14px;
    box-shadow: 0 12px 24px rgba(11, 30, 22, 0.06);
  }
  .site-menu-nav {
    border-radius: 14px;
    top: 4px;
  }
  .site-menu-head strong {
    font-size: 0.9rem;
  }
  .site-menu-head .hint {
    font-size: 0.8rem;
  }
  .drop-item > summary {
    max-width: none;
    padding: 7px 8px;
    font-size: 0.78rem;
  }
  .dropdown-bar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
  }
  .drop-inline-label {
    display: none;
  }
  .drop-item > summary {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .path-chip {
    padding: 4px 8px;
    font-size: 0.78rem;
  }
  .breadcrumbs {
    display: none;
  }
  .toolbar {
    grid-template-columns: 1fr;
  }
  .toolbar .btn {
    width: 100%;
  }
  #teamsSection .teams-table {
    min-width: 0;
  }
  #teamsSection .teams-table th:nth-child(3),
  #teamsSection .teams-table td:nth-child(3),
  #teamsSection .teams-table th:nth-child(4),
  #teamsSection .teams-table td:nth-child(4) {
    display: none;
  }
  #teamsSection .teams-table th,
  #teamsSection .teams-table td {
    padding: 8px 7px;
  }
  #standingsSection .teams-table {
    min-width: 520px;
  }
  .standings-table th,
  .standings-table td {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 0.86rem;
  }
  .rank-col {
    width: 38px;
  }
  .team-name-wrap {
    gap: 6px;
  }
  .team-logo-thumb {
    width: 21px;
    height: 21px;
    padding: 1px;
  }
  .match-logo {
    width: 20px;
    height: 20px;
    padding: 1px;
  }
  .round-chip {
    max-width: none;
    padding: 6px 10px;
  }
  .giornata-head strong {
    font-size: 0.88rem;
  }
  .giornata-head span {
    font-size: 0.76rem;
  }
  .match-team {
    gap: 6px;
    font-size: 0.92rem;
  }
  .match-score {
    min-width: 50px;
    text-align: center;
    padding: 2px 7px;
  }
  .team-drawer {
    padding: 6px;
  }
  .roster-drawer {
    padding: 6px;
  }
  .match-drawer {
    padding: 6px;
  }
  .match-hero-logo,
  .match-hero-logo-fallback {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }
  .match-hero-score {
    font-size: 2.25rem;
  }
  .match-status-badge {
    font-size: 1rem;
    padding: 0;
  }
  .match-rank-pill {
    min-width: 40px;
    padding: 2px 8px;
    font-size: 0.78rem;
  }
  .match-scorer-line {
    font-size: 0.78rem;
  }
  .match-detail-tabs {
    padding: 4px;
    gap: 6px;
  }
  .match-detail-tab {
    padding: 9px 12px;
    font-size: 1rem;
  }
  .match-info-card {
    grid-template-columns: 30px minmax(0, 1fr) auto;
    gap: 8px;
    padding: 9px;
  }
  .match-info-icon,
  .match-info-action {
    width: 30px;
    height: 30px;
    border-radius: 10px;
  }
  .team-avatar {
    width: 50px;
    height: 50px;
    border-radius: 12px;
  }
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .team-menu-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .actions .btn {
    width: 100%;
  }
  .next-match-countdown {
    font-size: 1.02rem;
  }
  .next-match-when {
    font-size: 0.84rem;
  }
  .next-match-team-name {
    font-size: 0.88rem;
  }
}

@media (max-width: 400px) {
  .topbar-actions {
    grid-template-columns: 1fr;
  }
  .status-pill {
    grid-column: 1;
  }
  .round-chip {
    max-width: none;
    font-size: 0.75rem;
  }
  .dropdown-bar {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
