/* Mappa interattiva del girone (championships#map) */
.gm-page { --gm-panel: #1b1b26; --gm-line: rgba(255, 255, 255, 0.08); --gm-text: #f1f5f9; --gm-muted: #94a3b8; }

.gm-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.gm-switch { display: inline-flex; padding: 4px; gap: 4px; background: var(--gm-panel); border: 1px solid var(--gm-line); border-radius: 999px; }
.gm-switch a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; color: var(--gm-muted); text-decoration: none; }
.gm-switch a.is-active { background: var(--red); color: #fff; }
.gm-stats { display: flex; flex-wrap: wrap; gap: 18px; }
.gm-stats div { display: flex; flex-direction: column; line-height: 1.15; }
.gm-stats b { font-size: 18px; font-weight: 900; color: var(--yellow); font-variant-numeric: tabular-nums; }
.gm-stats span { font-size: 11px; color: var(--gm-muted); text-transform: uppercase; letter-spacing: .06em; }

.gm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 1023px) { .gm-layout { grid-template-columns: minmax(0, 1fr); } }
.gm-map-col { min-width: 0; display: flex; flex-direction: column; gap: 12px; }

/* isolation: i livelli interni di Leaflet (fino a z-index 1000) restano sotto menu e barre fisse del sito */
.gm-map-wrap { position: relative; isolation: isolate; z-index: 0; border-radius: 16px; overflow: hidden; border: 1px solid var(--border); box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.gm-map { height: min(68vh, 640px); min-height: 420px; background: #0d0d14; }
.gm-map:focus { outline: none; }
.gm-legend { position: absolute; left: 12px; bottom: 12px; z-index: 500; display: flex; flex-wrap: wrap; gap: 12px; padding: 6px 12px; border-radius: 999px;
  background: rgba(10, 10, 16, .78); backdrop-filter: blur(6px); font-size: 11px; color: var(--gm-muted); }
.gm-legend span { display: inline-flex; align-items: center; gap: 6px; }
.gm-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.gm-dot--ours { background: var(--yellow); box-shadow: 0 0 0 3px rgba(245, 192, 0, .3); }
.gm-line { width: 18px; height: 0; display: inline-block; border-top: 2px dashed var(--yellow); }
.gm-line--round { border-top: 2px solid var(--red-light); }

/* Segnaposto con logo */
.gm-marker { background: none; border: 0; }
.gm-marker.is-moved::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 0 2px #111118; }
/* Mappa OpenStreetMap scurita per stare nei colori del sito */
.gm-map .gm-tiles { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.95) saturate(.35); }
.gm-pin { border-radius: 50%; background: #fff; border: 3px solid #2a2a38; box-shadow: 0 6px 18px rgba(0, 0, 0, .55); overflow: hidden;
  display: flex; align-items: center; justify-content: center; transition: transform .25s ease, opacity .3s ease, border-color .2s; cursor: pointer; }
.gm-pin img { width: 100%; height: 100%; object-fit: contain; }
.gm-pin--ours { border-color: var(--yellow); position: relative; overflow: visible; }
.gm-pin--ours img { border-radius: 50%; object-fit: cover; }
.gm-pin--ours::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid var(--yellow); animation: gm-pulse 2.2s ease-out infinite; pointer-events: none; }
.gm-marker:hover .gm-pin, .gm-marker.is-selected .gm-pin { transform: scale(1.18); border-color: var(--yellow); }
.gm-marker.is-dimmed .gm-pin { opacity: .28; filter: grayscale(1); transform: scale(.85); }
.gm-initials { font-weight: 900; font-size: 13px; color: #334155; }
@keyframes gm-pulse { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.6); opacity: 0; } }

.gm-flow { stroke-dasharray: 8 10; animation: gm-dash 1.1s linear infinite; }
.gm-flow--ours { stroke-dasharray: 10 8; filter: drop-shadow(0 0 4px rgba(245, 192, 0, .8)); }
@keyframes gm-dash { to { stroke-dashoffset: -36; } }
@media (prefers-reduced-motion: reduce) {
  .gm-flow, .gm-flow--ours, .gm-pin--ours::after { animation: none; }
}

.leaflet-tooltip.gm-tip { background: #111118; color: #fff; border: 1px solid var(--border); font-weight: 700; font-size: 12px; box-shadow: none; }
.leaflet-tooltip.gm-tip::before { display: none; }
.leaflet-tooltip.gm-km { background: var(--yellow); color: #111; border: 0; font-weight: 900; font-size: 12px; border-radius: 999px; padding: 2px 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, .4); }
.leaflet-tooltip.gm-km::before { display: none; }
.gm-map .leaflet-control-attribution { background: rgba(10, 10, 16, .7); color: #64748b; font-size: 10px; }
.gm-map .leaflet-control-attribution a { color: #94a3b8; }
.gm-map .leaflet-bar a { background: #1b1b26; color: #f1f5f9; border-color: #2a2a38; }

/* Giornate */
.gm-rounds { background: var(--gm-panel); border: 1px solid var(--gm-line); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.gm-rounds-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gm-round-label { flex: 1; min-width: 160px; color: var(--gm-text); font-size: 14px; }
.gm-round-label strong { font-weight: 900; margin-right: 6px; }
.gm-round-label span { color: var(--gm-muted); font-size: 12px; }
.gm-btn { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 10px; background: #26263a; color: #fff; font-weight: 900; font-size: 16px; border: 1px solid var(--gm-line); cursor: pointer; }
.gm-btn:hover { background: #30304a; }
.gm-btn--play, .gm-btn.is-active { background: var(--red); border-color: var(--red); }
.gm-btn--text { font-size: 12px; font-weight: 700; }
.gm-range { width: 100%; accent-color: var(--yellow); }
.gm-round-matches { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 8px; }
.gm-chip { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto minmax(0, 1fr) 22px; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 12px;
  background: #22222f; border: 1px solid var(--gm-line); color: var(--gm-text); text-decoration: none; font-size: 12px; position: relative; }
.gm-chip:hover { border-color: var(--red-light); }
.gm-chip small { grid-column: 1 / -1; text-align: center; color: var(--gm-muted); font-size: 10px; margin-top: -2px; }
.gm-chip--ours { border-color: var(--yellow); background: rgba(245, 192, 0, .08); }
.gm-chip--rest { display: block; text-align: center; color: var(--gm-muted); }
.gm-chip-logo { width: 22px; height: 22px; border-radius: 50%; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gm-chip-logo img { width: 100%; height: 100%; object-fit: contain; }
.gm-chip-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.gm-chip-name:nth-of-type(2) { text-align: right; }
.gm-chip-score { font-weight: 900; color: #fff; background: #111118; padding: 1px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }

/* Pannello */
.gm-panel { background: var(--gm-panel); border: 1px solid var(--gm-line); border-radius: 16px; overflow: hidden; min-width: 0; }
.gm-card { padding: 16px; border-bottom: 1px solid var(--gm-line); background: linear-gradient(160deg, rgba(197, 0, 15, .22), transparent 70%); }
.gm-card-head { display: flex; align-items: center; gap: 12px; }
.gm-card-logo { width: 56px; height: 56px; border-radius: 14px; background: #fff; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.gm-card-logo img { width: 100%; height: 100%; object-fit: contain; }
.gm-card-name { font-weight: 900; font-size: 17px; color: #fff; line-height: 1.15; }
.gm-card-sub { font-size: 12px; color: var(--gm-muted); margin-top: 2px; }
.gm-card-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }
.gm-card-stats div { background: rgba(0, 0, 0, .25); border-radius: 10px; padding: 8px 4px; text-align: center; }
.gm-card-stats b { display: block; font-size: 16px; font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; }
.gm-card-stats span { font-size: 10px; color: var(--gm-muted); text-transform: uppercase; letter-spacing: .05em; }
.gm-card-form { display: flex; align-items: center; gap: 4px; margin-top: 10px; font-size: 11px; color: var(--gm-muted); text-transform: uppercase; letter-spacing: .05em; }
.gm-card-form span { margin-right: 4px; }
.gm-form { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.gm-form--W { background: #22c55e; } .gm-form--D { background: #94a3b8; } .gm-form--L { background: #ef4444; }
.gm-card-venue { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-top: 12px; font-size: 12px; color: #cbd5e1; }
.gm-directions { font-weight: 800; color: var(--yellow); text-decoration: none; white-space: nowrap; }
.gm-legs { display: grid; gap: 6px; margin-top: 12px; }
.gm-leg { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, .25); text-decoration: none; font-size: 12px; }
.gm-leg-kind { color: var(--gm-muted); }
.gm-leg-when { color: #fff; font-weight: 700; text-align: right; }
.gm-res { padding: 1px 8px; border-radius: 6px; font-weight: 900; }
.gm-res--W { background: #16a34a; } .gm-res--D { background: #64748b; } .gm-res--L { background: #dc2626; }

.gm-list-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--gm-muted); }
.gm-sort { display: inline-flex; gap: 2px; background: #111118; border-radius: 999px; padding: 3px; }
.gm-sort button { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; color: var(--gm-muted); background: none; border: 0; cursor: pointer; text-transform: none; letter-spacing: 0; }
.gm-sort button.is-active { background: #2a2a38; color: #fff; }
.gm-list { list-style: none; margin: 0; padding: 0 8px 10px; max-height: 520px; overflow-y: auto; }
.gm-row { width: 100%; display: grid; grid-template-columns: 30px 28px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 10px;
  background: none; border: 0; color: var(--gm-text); text-align: left; cursor: pointer; font-size: 13px; }
.gm-row:hover { background: rgba(255, 255, 255, .05); }
.gm-row.is-selected { background: rgba(197, 0, 15, .25); }
.gm-row.is-ours .gm-row-name { color: var(--yellow); }
.gm-row-pos { color: var(--gm-muted); font-weight: 800; font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.gm-row-logo { width: 28px; height: 28px; border-radius: 50%; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.gm-row-logo img { width: 100%; height: 100%; object-fit: contain; }
.gm-row-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-row-val { font-weight: 900; font-size: 12px; color: #fff; font-variant-numeric: tabular-nums; }

.gm-note { margin-top: 12px; font-size: 11px; color: #64748b; }
.gm-btn:focus-visible, .gm-row:focus-visible, .gm-chip:focus-visible, .gm-switch a:focus-visible, .gm-sort button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

