/* The home planning: the season grid, a weekend, the slot and conflict drawers, the mobile list
   and the states. Built on imports.css (gi-) and licences.css (gl- drawer); what the planning adds
   is prefixed gd- (domicile). Five states, each a colour, a tint and a ring; confirmed is the kit's
   blue, never green. Every flexible column is minmax(0, Nfr). */

:root {
    --gd-conf: var(--thonon-blue-bright);
    --gd-conf-tint: rgba(52, 164, 224, 0.14);
    --gd-conf-ring: rgba(52, 164, 224, 0.40);
    --gd-todo: #F0C030;
    --gd-todo-tint: rgba(240, 192, 48, 0.13);
    --gd-todo-ring: rgba(240, 192, 48, 0.42);
    --gd-confl: #F02030;
    --gd-confl-text: #F06A75;
    --gd-confl-tint: rgba(240, 32, 48, 0.13);
    --gd-confl-ring: rgba(240, 32, 48, 0.38);
    --gd-ext: #8A93A1;
    --gd-sug: #34A4E0;
    --gd-vio: #A58BE8;
}

.gd--conf { --gd-c: var(--gd-conf); --gd-tint: var(--gd-conf-tint); --gd-ring: var(--gd-conf-ring); }
.gd--todo { --gd-c: var(--gd-todo); --gd-tint: var(--gd-todo-tint); --gd-ring: var(--gd-todo-ring); }
.gd--confl { --gd-c: var(--gd-confl); --gd-tint: var(--gd-confl-tint); --gd-ring: var(--gd-confl-ring); }
.gd--ext { --gd-c: var(--gd-ext); --gd-tint: rgba(255, 255, 255, 0.02); --gd-ring: var(--dark-border-2); }
.gd--repos { --gd-c: var(--gd-ext); --gd-tint: transparent; --gd-ring: var(--dark-border-1); }

/* ── Phase tabs and counters ───────────────────────────── */

.gd-tabs {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 0 0 16px;
    padding: 0 28px;
    border-bottom: 1px solid var(--dark-border-1);
}

.gd-tab {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: -1px;
    padding: 10px 18px 12px 0;
    margin-right: 18px;
    border-bottom: 2px solid transparent;
    color: var(--dark-fg-2);
    text-decoration: none;
}

.gd-tab__label {
    font: 700 13px/1 var(--font-condensed);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gd-tab__sub {
    font-size: 12px;
    color: var(--dark-fg-3);
}

.gd-tab__sub--count {
    font: 400 13px/1 var(--font-mono);
    color: var(--dark-fg-2);
}

.gd-tab--on {
    border-bottom-color: var(--thonon-yellow);
    color: #fff;
}

/* ── The season grid ───────────────────────────────────── */

.gd-grid-wrap {
    overflow-x: auto;
    padding-bottom: 4px;
}

.gd-grid {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: calc(80px + var(--gd-weeks) * 75px);
}

.gd-grid__row {
    display: grid;
    grid-template-columns: 80px repeat(var(--gd-weeks), minmax(0, 1fr));
    gap: 3px;
    align-items: stretch;
}

.gd-grid__corner {
    align-self: center;
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

/* The column's date and its weekday, never the day number: each championship counts its own. */
.gd-week {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 44px;
    border-radius: 4px;
    text-decoration: none;
}

.gd-week__date {
    font: 700 13px/1 var(--font-mono);
    color: var(--dark-fg-1);
}

.gd-week__day {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

.gd-week--now {
    background: rgba(240, 192, 48, 0.12);
}

.gd-week--now .gd-week__date {
    color: var(--thonon-yellow);
}

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

.gd-team__dot {
    flex: 0 0 8px;
    height: 8px;
    border-radius: 2px;
}

.gd-team__name {
    overflow: hidden;
    font: 800 15px/1.1 var(--font-condensed);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
}

.gd-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 48px;
    border: 1px solid var(--gd-ring);
    border-radius: 4px;
    background: var(--gd-tint);
    color: var(--gd-c);
    text-decoration: none;
    transition: filter 0.12s;
}

.gd-cell:hover {
    filter: brightness(1.25);
}

/* A confirmed slot on its hall's dark tint, with the gymnasium's 3 px rule on its left; a slot
   whose hall has no colours keeps the confirmed blue. */
.gd-cell.gd--conf {
    --hall-c: var(--gd-conf);
    border-color: transparent;
    background: color-mix(in srgb, var(--hall-c) 18%, var(--thonon-night));
    box-shadow: inset 3px 0 0 var(--hall-c);
    color: #fff;
}

.gd-cell.gd--conf .gd-cell__hall {
    color: color-mix(in srgb, var(--hall-c) 70%, #fff);
}

/* Away: a blue outline, nothing to set. */
.gd-cell.gd--ext {
    border-color: rgba(16, 128, 192, 0.55);
    background: transparent;
    color: var(--thonon-blue-bright);
}

.gd-cell.gd--repos {
    border-color: transparent;
}

.gd-cell--now {
    outline: 2px solid var(--thonon-yellow);
    outline-offset: -2px;
}

/* The engine's kick-off for a slot still to plan: offered, never applied. */
.gd-cell--sug {
    border-style: dashed;
}

.gd-cell--sug .gd-cell__time {
    opacity: 0.85;
}

.gd-cell__time {
    font: 700 14px/1 var(--font-mono);
}

.gd-cell__hall {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--dark-fg-3);
}

.gd-cell__ext {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.gd-cell__rest {
    color: var(--dark-border-2);
}

/* ── Legend, pills and the reading band ────────────────── */

.gd-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    margin: 14px 0 16px;
    font-size: 13px;
    color: var(--dark-fg-2);
}

.gd-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* A cell in small: the same tint and ring as the grid's. */
.gd-swatch {
    display: inline-grid;
    place-items: center;
    width: 14px;
    height: 14px;
    border: 1px solid var(--gd-ring);
    border-radius: 3px;
    background: var(--gd-tint);
    color: var(--dark-border-2);
    line-height: 1;
}

.gd-swatch.gd--conf {
    border-color: transparent;
    background: color-mix(in srgb, var(--gd-conf) 18%, var(--thonon-night));
    box-shadow: inset 3px 0 0 var(--gd-conf);
}

.gd-swatch.gd--ext {
    border-color: rgba(16, 128, 192, 0.55);
    background: transparent;
}

.gd-swatch.gd--repos {
    border-color: transparent;
}

.gd-legend__help {
    margin-left: auto;
    font-size: 13px;
    color: var(--dark-fg-3);
}

.gd-band {
    display: flex;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid rgba(16, 128, 192, 0.22);
    border-radius: 6px;
    background: rgba(16, 128, 192, 0.06);
}

.gd-band p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--dark-fg-2);
}

.gd-band strong {
    color: #fff;
}

.gd-band .gd-band__alert {
    color: var(--thonon-yellow);
}

.gd-band__icon {
    display: grid;
    flex: 0 0 28px;
    place-items: center;
    height: 28px;
    border-radius: 6px;
    background: rgba(16, 128, 192, 0.14);
    color: var(--thonon-blue-bright);
}

/* ── Loading skeleton ──────────────────────────────────── */

.gd-skel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.gd-skel__row {
    display: grid;
    grid-template-columns: 132px repeat(12, minmax(0, 1fr));
    gap: 5px;
}

.gd-skel__head { height: 30px; border-radius: 4px; }
.gd-skel__cell { height: 46px; border-radius: 4px; }

/* ── The weekend: the matches received ────────────────── */

.gd-match + .gd-match {
    border-top: 1px solid var(--dark-border-1);
}

.gd-match__main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 72px;
    padding: 10px 20px;
}

.gd-match__time {
    display: flex;
    flex: 0 0 96px;
    flex-direction: column;
    gap: 4px;
}

.gd-match__kickoff {
    font: 700 18px/1 var(--font-mono);
    color: #fff;
}

.gd--todo .gd-match__kickoff {
    color: var(--dark-fg-3);
}

.gd--todo .gd-match__kickoff--sug {
    color: var(--gd-todo);
}

.gd-match__sug {
    font: 700 12px/1.2 var(--font-condensed);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gd-todo);
}

.gd-match__ends,
.gd-match__day {
    font: 400 12px/1.2 var(--font-mono);
    color: var(--dark-fg-3);
}

.gd-match__team {
    flex: 0 0 64px;
    font: 800 17px/1.1 var(--font-condensed);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #fff;
}

.gd-match__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.gd-match__opp {
    font-weight: 600;
    font-size: 15px;
    color: #fff;
}

.gd-match__hall {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--dark-fg-2);
}

.gd-match__proposal {
    color: #7FC6F0;
}

.gd-match__action {
    flex: 0 0 auto;
    min-width: 112px;
    justify-content: center;
}

.gd-match__conflict {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-top: 1px solid rgba(240, 32, 48, 0.24);
    background: rgba(240, 32, 48, 0.07);
    font-size: 13px;
    color: var(--gd-confl-text);
}

/* ── The weekend: the halls' day ───────────────────────── */

.gd-timeline {
    display: flex;
    flex-direction: column;
}

/* One row a hall: its code in its colour over its name, then its day on a grid of hours. */
.gd-hall {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    border-top: 1px solid var(--dark-border-1);
}

.gd-hall__name {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    min-height: 44px;
    min-width: 0;
    padding-right: 10px;
}

.gd-hall__code {
    font: 700 13px/1.2 var(--font-mono);
    color: color-mix(in srgb, var(--hall-c) 70%, #fff);
}

.gd-hall__code--plain {
    color: var(--dark-fg-2);
}

.gd-hall__name small {
    overflow: hidden;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--dark-fg-3);
}

.gd-track {
    position: relative;
    min-height: 44px;
    background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 14 - 1px), var(--dark-border-1) calc(100% / 14 - 1px) calc(100% / 14));
}

.gd-range {
    position: absolute;
    top: 6px;
    bottom: 6px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 0 8px;
    border: 1px solid;
    border-radius: 3px;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gd-range--libre { border-color: var(--dark-border-2); border-style: dashed; background: transparent; color: var(--dark-fg-3); }
.gd-range--confl { border-color: rgba(240, 32, 48, 0.45); background: rgba(240, 32, 48, 0.15); color: #F06A75; }
.gd-range--bloq { border-color: var(--dark-border-1); background: rgba(255, 255, 255, 0.03); color: #8A93A1; }

/* A confirmed slot on its hall's dark tint and 3 px rule, as in the season grid. */
.gd-range--conf {
    border-color: transparent;
    background: color-mix(in srgb, var(--hall-c, var(--gd-conf)) 18%, var(--thonon-night));
    box-shadow: inset 3px 0 0 var(--hall-c, var(--gd-conf));
    color: #fff;
    font-weight: 600;
}

.gd-axis {
    position: relative;
    height: 20px;
    margin-left: 96px;
    font: 400 12px/1 var(--font-mono);
    color: var(--dark-fg-3);
}

.gd-axis span {
    position: absolute;
    transform: translateX(-50%);
}

.gd-axis span:first-child {
    transform: none;
}

.gd-axis span:last-child {
    transform: translateX(-100%);
}

/* ── Blocks: conflict, arbitration, suggestion ─────────── */

.gd-block {
    overflow: hidden;
    border: 1px solid var(--dark-border-1);
    border-left: 3px solid var(--gd-block, var(--gd-sug));
    border-radius: 8px;
    background: var(--thonon-night);
}

.gd-block--confl { --gd-block: var(--gd-confl); }
.gd-block--todo { --gd-block: var(--gd-todo); }
.gd-block--sug { --gd-block: var(--gd-sug); }

.gd-block__head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    border-bottom: 1px solid var(--dark-border-1);
    color: var(--gd-block);
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.gd-block--confl .gd-block__head {
    color: var(--gd-confl-text);
}

.gd-block__count {
    font: 400 16px/1 var(--font-display);
}

.gd-block__body,
.gd-block__list {
    margin: 0;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--dark-fg-1);
}

.gd-block__list {
    padding-left: 30px;
}

.gd-block__action {
    margin: 0;
    padding: 0 14px 12px;
}

.gd-block__foot {
    margin: 0;
    padding: 10px 14px;
    border-top: 1px solid var(--dark-border-1);
    font-size: 12px;
    line-height: 1.5;
    color: var(--dark-fg-3);
}

/* ── Drawers ───────────────────────────────────────────── */

.gd-drawer {
    width: min(440px, 100vw);
}

.gd-drawer__head {
    background: rgba(240, 192, 48, 0.07);
}

.gd-drawer__head--confl {
    background: rgba(240, 32, 48, 0.07);
}

.gd-drawer__eyebrow {
    margin-bottom: 6px;
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--thonon-yellow);
}

.gd-drawer__eyebrow--confl {
    color: var(--gd-confl);
}

.gd-drawer__sub {
    margin: 6px 0 0;
    font: 400 12px/1.4 var(--font-mono);
    color: var(--dark-fg-2);
}

.gd-drawer__body {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.gd-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 420px;
    margin: 0;
    padding: 0;
    border: 0;
}

.gd-field__label {
    margin: 0 0 9px;
    padding: 0;
    font: 700 12px/1.2 var(--font-condensed);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--dark-fg-3);
}

.gd-field__help {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--dark-fg-3);
}

.gd-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.gd-chip {
    min-width: 72px;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--dark-border-2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font: 700 13px/1 var(--font-mono);
    cursor: pointer;
}

.gd-chip:hover:not(:disabled) {
    border-color: rgba(255, 255, 255, 0.35);
}

.gd-chip:disabled {
    border-color: var(--dark-border-1);
    background: rgba(255, 255, 255, 0.02);
    color: #4C5361;
    cursor: not-allowed;
}

.gd-chip--sug {
    border-color: rgba(52, 164, 224, 0.45);
    background: rgba(52, 164, 224, 0.15);
    color: #7FC6F0;
}

.gd-chip--sel,
.gd-chip--sel:hover:not(:disabled) {
    border-color: var(--thonon-yellow);
    background: var(--thonon-yellow);
    color: #1A1208;
}

/* A hall's chip carries the gymnasium's rule; chosen, it takes the hall's dark tint, not yellow. */
.gd-chip--hall[style*="--hall-c"] {
    box-shadow: inset 3px 0 0 var(--hall-c);
}

.gd-chip--hall[style*="--hall-c"].gd-chip--sel,
.gd-chip--hall[style*="--hall-c"].gd-chip--sel:hover:not(:disabled) {
    border-color: var(--hall-c);
    background: color-mix(in srgb, var(--hall-c) 18%, var(--thonon-night));
    color: #fff;
}

.gd-chips--time .gd-chip {
    min-width: 84px;
}

.gd-exit {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid var(--dark-border-1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.03);
}

.gd-exit__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 5px;
    min-width: 0;
}

.gd-exit__what {
    font: 700 13px/1.2 var(--font-mono);
    color: #fff;
}

.gd-exit__why {
    font-size: 12px;
    color: var(--dark-fg-3);
}

.gd-drawer__foot {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gd-drawer__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 10px;
}

.gd-drawer__actions .gi-btn {
    justify-content: center;
    height: 44px;
}

.gd-drawer__rule {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--dark-fg-3);
}

.gd-drawer__rule strong {
    color: #fff;
}

/* ── Mobile: the list of weekends to set (96 · 1) ──────── */

.gd-mobile {
    display: none;
}

.gd-wcard {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 12px 12px 12px 14px;
    border: 1px solid var(--dark-border-1);
    border-left: 3px solid var(--gd-c);
    border-radius: 8px;
    background: var(--thonon-night);
    color: var(--dark-fg-3);
    text-decoration: none;
}

.gd-wcard__date {
    display: flex;
    flex: 0 0 48px;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding-right: 12px;
    border-right: 1px solid var(--dark-border-1);
}

.gd-wcard__day {
    font: 400 24px/1 var(--font-display);
    color: #fff;
}

.gd-wcard__month {
    font: 700 12px/1 var(--font-condensed);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.gd-wcard__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

.gd-wcard__title {
    font: 700 13px/1.1 var(--font-condensed);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
}

.gd-wcard__pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.gd-wcard__left {
    font-size: 12px;
}

/* ── Narrow screens ────────────────────────────────────── */

@media (max-width: 900px) {
    .gd .gd-grid-wrap,
    .gd .gd-legend,
    .gd .gd-band {
        display: none;
    }

    .gd .gd-mobile {
        display: block;
    }

    .gd-tabs {
        padding: 0 16px;
        overflow-x: auto;
    }

    .gd-tab {
        flex: 0 0 auto;
    }

    .gd-match__main {
        flex-wrap: wrap;
        padding: 12px 16px;
    }

    /* The time, the team and the state on one line, the opponent under them, the action last. */
    .gd-match__time {
        flex-basis: 72px;
    }

    .gd-match__team {
        flex: 1 1 auto;
    }

    .gd-match__text {
        flex-basis: 100%;
        order: 1;
    }

    .gd-match__action {
        flex: 1 1 100%;
        order: 2;
    }

    .gd-hall {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .gd-hall__name small {
        display: none;
    }

    .gd-axis {
        margin-left: 64px;
    }

    .gd-drawer {
        width: 100vw;
    }

    .gd-drawer__foot {
        position: sticky;
        bottom: 0;
    }

    .gd-drawer__actions .gi-btn--accent {
        height: 48px;
    }
}
