/* GVSA Public Styles — calendario e classifiche */

/* ── Phase sections ──────────────────────────────────────────────────────── */
.gvsa-cal-phase { margin-bottom: 2.5rem; }

.gvsa-cal-phase__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--season-color, #e67e22);
    border-bottom: 2px solid var(--season-color, #e67e22);
    padding-bottom: .35rem;
    margin-bottom: .75rem;
}

/* ── Calendar table ──────────────────────────────────────────────────────── */
.gvsa-calendar__table,
.gvsa-standings__table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    table-layout: fixed;
}

.gvsa-calendar__table th,
.gvsa-calendar__table td,
.gvsa-standings__table th,
.gvsa-standings__table td {
    padding: .4rem .6rem;
    border: 1px solid #e5e7eb;
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gvsa-calendar__table thead th,
.gvsa-standings__table thead th {
    background: #f9fafb;
    font-weight: 600;
}

/* Fixed columns */
.gvsa-col-group, .gvsa-cal-group { width: 36px;  text-align: center; }
.gvsa-col-field, .gvsa-cal-field { width: 58px;  text-align: center; }
.gvsa-col-time,  .gvsa-cal-time  { width: 62px;  text-align: center; }
.gvsa-col-score, .gvsa-cal-score { width: 82px;  text-align: center; }
/* Squadra A, Squadra B, Arbitra — equal width, fills remaining space */
.gvsa-col-team, .gvsa-cal-team,
.gvsa-col-ref,  .gvsa-cal-ref   { width: calc((100% - 238px) / 3); }

/* Date separator rows */
.gvsa-date-row td {
    background: var(--season-color, #e67e22);
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: .5rem .75rem;
    letter-spacing: .02em;
    border: none;
}

.gvsa-match--played { background: #f9fafb; }

/* Winner highlight */
.gvsa-cal-winner { font-weight: 700; }

/* ── Group row colors (applied to Squadra A / B / Arbitra cells) ──────────── */
.gvsa-group-row--A { background: #e3f2fd; }
.gvsa-group-row--B { background: #e8f5e9; }
.gvsa-group-row--C { background: #fffde7; }
.gvsa-group-row--D { background: #ffebee; }
.gvsa-group-row--E { background: #f3e5f5; }
.gvsa-group-row--F { background: #e0f2f1; }
.gvsa-group-row--G { background: #fff3e0; }
.gvsa-group-row--H { background: #fce4ec; }
/* Seconda fase Bravi (I-N) */
.gvsa-group-row--I { background: #e3f2fd; }
.gvsa-group-row--L { background: #e1f5fe; }
.gvsa-group-row--M { background: #e0f2f1; }
.gvsa-group-row--N { background: #e8f5e9; }
/* Seconda fase Belli (O-R) */
.gvsa-group-row--O { background: #ffebee; }
.gvsa-group-row--P { background: #fce4ec; }
.gvsa-group-row--Q { background: #ede7f6; }
.gvsa-group-row--R { background: #eceff1; }

/* ── Group tags (badge in Girone column) ─────────────────────────────────── */
.gvsa-group-tag {
    display: inline-block;
    font-size: .75rem;
    font-weight: 700;
    color: #fff;
    border-radius: 3px;
    padding: 2px 6px;
    vertical-align: middle;
    line-height: 1.4;
    white-space: nowrap;
}
.gvsa-group-tag--A { background: #1e88e5; }
.gvsa-group-tag--B { background: #43a047; }
.gvsa-group-tag--C { background: #f9a825; color: #000; }
.gvsa-group-tag--D { background: #e53935; }
.gvsa-group-tag--E { background: #8e24aa; }
.gvsa-group-tag--F { background: #00897b; }
.gvsa-group-tag--G { background: #fb8c00; color: #000; }
.gvsa-group-tag--H { background: #d81b60; }
/* Seconda fase Bravi (I-N) — distinti */
.gvsa-group-tag--I { background: #1565c0; }
.gvsa-group-tag--L { background: #0277bd; }
.gvsa-group-tag--M { background: #00695c; }
.gvsa-group-tag--N { background: #2e7d32; }
/* Seconda fase Belli (O-R) — distinti */
.gvsa-group-tag--O { background: #b71c1c; }
.gvsa-group-tag--P { background: #880e4f; }
.gvsa-group-tag--Q { background: #4a148c; }
.gvsa-group-tag--R { background: #37474f; }

/* ── Admin result entry (score column, logged-in) ────────────────────────── */
.gvsa-score-display { white-space: nowrap; }
.gvsa-result-form   { white-space: nowrap; gap: 3px; }

.gvsa-btn-edit {
    background: none;
    border: none;
    cursor: pointer;
    font-size: .85rem;
    padding: 0 2px;
    opacity: .4;
    transition: opacity .15s;
    vertical-align: middle;
}
.gvsa-btn-edit:hover { opacity: 1; }

.gvsa-btn-save {
    padding: 2px 6px;
    cursor: pointer;
    font-size: .85rem;
}

.gvsa-score-in-a,
.gvsa-score-in-b {
    width: 36px;
    padding: 2px 4px;
    text-align: center;
    font-size: .85rem;
}

/* ── Standings ───────────────────────────────────────────────────────────── */
.gvsa-standings__phase { margin-bottom: 2.5rem; }
.gvsa-standings__phase-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--season-color, #e67e22);
    border-bottom: 2px solid var(--season-color, #e67e22);
    padding-bottom: .35rem;
    margin-bottom: .75rem;
}
.gvsa-standings__phase > .gvsa-standings__group {
    display: inline-block;
    vertical-align: top;
    margin-right: 1.5rem;
    margin-bottom: 1.5rem;
    min-width: 280px;
}
.gvsa-standings__title { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; }
.gvsa-standings__row--qualify { background: rgba(34, 197, 94, .08); }
.gvsa-standings__row--qualify td:first-child { border-left: 3px solid var(--season-color, #e67e22); }

/* ── Playoff table: wider first column for match label ───────────────────── */
.gvsa-calendar__table--playoff .gvsa-col-group,
.gvsa-calendar__table--playoff .gvsa-cal-group { width: 96px; }
.gvsa-calendar__table--playoff .gvsa-col-team,
.gvsa-calendar__table--playoff .gvsa-cal-team,
.gvsa-calendar__table--playoff .gvsa-col-ref,
.gvsa-calendar__table--playoff .gvsa-cal-ref   { width: calc((100% - 298px) / 3); }

/* Playoff match label (in first column) */
.gvsa-playoff-label {
    font-size: .72rem;
    font-weight: 600;
    color: #555;
    white-space: normal;
    line-height: 1.25;
}

/* ── Recovery / empty day row ─────────────────────────────────────────────── */
.gvsa-day-empty td {
    padding: .25rem .6rem;
    color: #bbb;
    font-style: italic;
    font-size: .8rem;
    border-top: none;
}

/* ── Playoff bracket ──────────────────────────────────────────────────────── */
.gvsa-standings__phase--playoff { margin-top: 2rem; }

.gvsa-playoff-round {
    margin-bottom: 2rem;
}
.gvsa-playoff-round__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--season-color, #e67e22);
    border-left: 4px solid var(--season-color, #e67e22);
    padding-left: .6rem;
    margin-bottom: .75rem;
}
.gvsa-playoff-round__cards {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
}

.gvsa-playoff-card {
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    background: #fff;
    min-width: 200px;
    max-width: 260px;
    flex: 1 1 200px;
    overflow: hidden;
}
.gvsa-playoff-card--played {
    border-color: #c8d5b9;
    background: #f8fbf5;
}

.gvsa-playoff-card__label {
    background: #f3f4f6;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: #6b7280;
    padding: .25rem .6rem;
    border-bottom: 1px solid #e5e7eb;
}
.gvsa-playoff-card--played .gvsa-playoff-card__label {
    background: #eaf2e3;
    border-color: #c8d5b9;
}

.gvsa-playoff-card__match {
    display: flex;
    flex-direction: column;
    padding: .5rem .7rem .55rem;
    gap: .25rem;
}
.gvsa-playoff-card__team {
    font-size: .85rem;
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.gvsa-playoff-card__team--winner {
    color: #166534;
    font-weight: 700;
}
.gvsa-playoff-card__team--winner::before {
    content: '✓ ';
    font-size: .7rem;
    opacity: .7;
}
.gvsa-playoff-card__score {
    font-size: .9rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    background: #1f2937;
    color: #fff;
    border-radius: 3px;
    padding: .1rem .5rem;
    align-self: center;
    letter-spacing: .06em;
}
.gvsa-playoff-card__vs {
    font-size: .75rem;
    color: #9ca3af;
    text-align: center;
    align-self: center;
}

@media (max-width: 640px) {
    .gvsa-calendar__table { font-size: .78rem; }
    .gvsa-col-ref, .gvsa-cal-ref { display: none; }
    .gvsa-standings__phase > .gvsa-standings__group { display: block; margin-right: 0; }
    .gvsa-playoff-card { min-width: 160px; }
}
