/* Identita' "jungle": verde profondo + oro, niente framework oltre Bootstrap. */
body {
  background:
    radial-gradient(1200px 400px at 10% -10%, rgba(31, 122, 77, .10), transparent 60%),
    radial-gradient(900px 380px at 110% 0%, rgba(242, 193, 78, .12), transparent 55%),
    #f6f8f7;
  min-height: 100vh;
}

.brand-bar {
  background: linear-gradient(100deg, var(--brand) 0%, color-mix(in srgb, var(--brand) 70%, #000) 100%);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .12);
}

/* ---- card evento ---- */
.event-card {
  border: 1px solid rgba(0, 0, 0, .06);
  border-radius: 16px;
  background: #fff;
  transition: transform .18s ease, box-shadow .18s ease;
  overflow: hidden;
}
.event-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 28px rgba(16, 51, 36, .13);
}
.event-card .card-strip {
  height: 5px;
  background: linear-gradient(90deg, var(--brand), var(--brand-accent));
}

/* Evento a cui si e' gia' iscritti: deve saltare all'occhio nell'elenco,
   senza dover aprire la scheda per scoprirlo. */
.event-card.is-mine {
  border: 1.5px solid var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, #fff);
}
.event-card.is-mine .card-strip {
  height: 6px;
}

.level-dot {
  width: .6rem; height: .6rem; border-radius: 50%;
  display: inline-block; vertical-align: middle;
}

/* ---- indicatore posti ---- */
.slots { display: flex; flex-wrap: wrap; gap: 5px; }
.slot {
  width: 22px; height: 22px; border-radius: 6px;
  background: #e3e9e6;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem; color: #7d8b84;
}
.slot.filled { background: var(--brand); color: #fff; }
.slot.reserve { background: var(--brand-accent); color: #4a3a08; }
.slot.free.last-free { animation: pulse 1.8s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242, 193, 78, .55); }
  50%      { box-shadow: 0 0 0 6px rgba(242, 193, 78, 0); }
}

.fill-bar {
  height: 8px; border-radius: 99px; background: #e6ebe8; overflow: hidden;
}
.fill-bar > span {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brand), var(--brand-accent));
  transition: width .6s cubic-bezier(.2, .8, .3, 1);
}

/* ---- lista giocatori ---- */
.player-row {
  display: flex; align-items: center; gap: .6rem;
  padding: .5rem .25rem; border-bottom: 1px dashed rgba(0, 0, 0, .08);
  animation: slide-in .35s ease both;
}
.player-row:last-child { border-bottom: 0; }
.player-index {
  width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: #eef3f0; color: #55645c;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 600; flex: none;
}
.player-row.is-reserve .player-index { background: #fdf2d6; color: #8a6b12; }

@keyframes slide-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* ---- messaggio da copiare ---- */
.message-box {
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem; line-height: 1.55;
  background: #0f1a15; color: #e8f2ec;
  border-radius: 12px; padding: 1rem; max-height: 460px; overflow: auto;
}

.countdown { font-variant-numeric: tabular-nums; }

.badge-soft {
  background: color-mix(in srgb, var(--brand) 12%, #fff);
  color: color-mix(in srgb, var(--brand) 75%, #000);
  border: 1px solid color-mix(in srgb, var(--brand) 22%, #fff);
}

@media (prefers-reduced-motion: reduce) {
  .event-card, .fill-bar > span, .player-row, .slot.free.last-free { transition: none; animation: none; }
}

/* ---- classifica ---- */
.standings tbody tr { transition: background-color .3s ease; }
.table-warning-subtle { background: color-mix(in srgb, var(--brand-accent) 22%, #fff); }

.live-dot::before {
  content: '';
  display: inline-block;
  width: .45rem; height: .45rem; border-radius: 50%;
  background: currentColor; margin-right: .35rem;
  animation: blink 1.6s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

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

@media (prefers-reduced-motion: reduce) {
  .live-dot::before { animation: none; }
}

/* Nome del club accanto a quello del servizio, solo dentro le sue pagine. */
.club-chip {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .2px;
  padding: .15rem .5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .28);
  white-space: nowrap;
}
@media (max-width: 575.98px) {
  .navbar-brand { font-size: 1rem; }
  .club-chip { display: none; }
}

/* ---- schede allineate ----
   Ogni informazione ha un'altezza fissa: se manca resta lo spazio vuoto,
   così barre e pulsanti di schede affiancate sono sempre alla stessa altezza. */
.event-card .slot-title  { min-height: 1.9rem; margin-bottom: .35rem; }
/* una riga sola: il titolo lungo si tronca e resta leggibile nel tooltip */
.event-card .slot-title h3 { min-width: 0; line-height: 1.4; }
.event-card .slot-level  { min-height: 1.7rem; }
.event-card .slot-when   { min-height: 2.9rem; margin-top: .35rem; }
.event-card .slot-meter  { min-height: 2.9rem; margin-top: .5rem; }
.event-card .slot-note   { min-height: 1.5rem; margin-top: .35rem; }
.event-card .slot-reasons{ min-height: 1.7rem; margin-top: .1rem; overflow: hidden; }
.event-card .slot-footer { padding-top: .75rem; }
.event-card .flex-none   { flex: none; }


/* ---- allineamento di icone ed etichette ----
   I contenitori che mescolano icona e testo diventano flex, così l'icona è
   centrata sulla riga invece di appoggiarsi alla base del testo. */
.btn, .badge, .nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.nav-link { justify-content: flex-start; }
.badge { line-height: 1.2; }

/* fuori dai contenitori flex l'icona si abbassa di un soffio per stare
   sulla stessa linea ottica del testo */
i[class*="fa-"] { line-height: 1; vertical-align: -0.02em; }

.level-dot { flex: none; }

/* anche le righe con icona dentro le schede si allineano al centro */
.event-card .slot-note span { display: inline-flex; align-items: center; }
/* data e orario restano su due righe: flex di blocco, non in linea */
.event-card .slot-when div { display: flex; align-items: center; }

/* tutta la scheda porta al dettaglio, non solo il pulsante */
.event-card:has(.stretched-link) { cursor: pointer; }

/* moduli del club */
.modules { padding-top: .35rem; border-top: 1px dashed var(--bs-border-color, #dee2e6); }
.label-modules {
  font-size: .75rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; color: #6c757d;
}

/* icona affiancata al testo: un filo più staccata di me-1 */
.ico { margin-right: .42rem; }

/* ---- avviso cookie ---- */
.cookie-bar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 1050;
  width: min(52rem, calc(100% - 2rem));
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1.1rem;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 14px;
  box-shadow: 0 10px 34px rgba(16, 51, 36, .18);
  font-size: .88rem;
}
.cookie-bar[hidden] { display: none; }
.cookie-bar .flex-none { flex: none; }

@media (max-width: 575.98px) {
  .cookie-bar { flex-direction: column; align-items: stretch; text-align: left; }
  .cookie-bar .btn { width: 100%; }
}

/* ---- informative ---- */
.legal h2 { scroll-margin-top: 1rem; }
.legal p, .legal li { max-width: 68ch; }
.legal ul { padding-left: 1.15rem; }
.legal li + li { margin-top: .35rem; }

.footer-line { display: inline-flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.footer-line .sep { opacity: .5; }

/* livello accanto al nome nelle liste */
.player { display: inline-flex; align-items: baseline; gap: .35rem; }
.player-level {
  font-size: .72rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--brand) 78%, #000);
  background: color-mix(in srgb, var(--brand) 11%, #fff);
  border: 1px solid color-mix(in srgb, var(--brand) 20%, #fff);
  border-radius: 999px;
  padding: 0 .35rem;
  line-height: 1.5;
}
