/* ==========================================================================
   Scorecard – Fairway/Sand Design
   Fonts: add once in your base template <head>:
   <link rel="preconnect" href="https://fonts.googleapis.com">
   <link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600;700&display=swap" rel="stylesheet">
   ========================================================================== */

:root {
    --cream: #F7F5EF;
    --ink: #1E2A22;
    --ink-soft: #5B665D;
    --fairway: #35563F;
    --fairway-deep: #233A2A;
    --sand: #C89B5C;
    --sand-soft: #EFE2CC;
    --flag: #A8341F;
    --flag-light: #DE8973;
    --mud: #6B4A3A;
    --hairline: #DAD5C7;
}

body {
    background: var(--cream);
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--ink);
}

.page-header h1,
.round-header h1 {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: -0.01em;
}

/* Wrapper: card + horizontal scroll on small screens */
.scorecard-wrap {
    display: inline-block;
    max-width: 100%;
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid var(--hairline);
    box-shadow: 0 1px 3px rgba(30, 42, 34, .08);
    background: #fff;
}

.scorecard {
    font-family: "IBM Plex Mono", monospace;
    margin-bottom: 0;
    table-layout: fixed;
    width: auto;
}

.scorecard th:not(:first-child),
.scorecard td:not(:first-child) {
    width: 58px;
}

.scorecard td,
.scorecard th {
    padding: 0.55rem 0.5rem;
    border-color: var(--hairline) !important;
    color: var(--ink);
    white-space: nowrap;
}

/* Header row */
.scorecard thead th {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--ink-soft);
    border-bottom: 2px solid var(--fairway) !important;
    padding-top: .8rem;
    padding-bottom: .6rem;
    background: #fff;
}

/* Row labels (first column) — sticky so they stay visible on scroll */
.scorecard th:first-child {
    width: 140px;
    text-align: left;
    padding-left: 1rem;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: #fff;
    position: sticky;
    left: 0;
    z-index: 2;
    border-right: 1px solid var(--hairline) !important;
}

/* OUT / IN / TOTAL summary columns (Bootstrap's table-secondary, retinted) */
.scorecard .table-secondary {
    background-color: var(--sand-soft) !important;
    color: var(--fairway-deep) !important;
    border-left: 2px solid var(--sand) !important;
}

.scorecard .table-secondary:last-child {
    border-left: 2px solid var(--fairway) !important;
    background-color: #EDEAE2 !important;
}

/* Score row + classic golf notation */
.score-row td {
    padding: 0.3rem;
    font-size: 1.05rem;
    font-weight: 500;
}

.mark {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.15rem;
    height: 2.15rem;
    vertical-align: middle;
}

/* Birdie: red circle */
.mark.birdie { color: var(--flag); }
.mark.birdie::after {
    content: "";
    position: absolute;
    inset: 1px;
    border: 1.5px solid var(--flag);
    border-radius: 50%;
}

/* Eagle: double red circle */
.mark.eagle { color: var(--flag); }
.mark.eagle::before {
    content: "";
    position: absolute;
    inset: 1px;
    border: 1.5px solid var(--flag);
    border-radius: 50%;
}
.mark.eagle::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1.5px solid var(--flag);
    border-radius: 50%;
}

/* Bogey: square */
.mark.bogey { color: var(--ink); }
.mark.bogey::after {
    content: "";
    position: absolute;
    inset: 3px;
    border: 1.5px solid var(--ink);
}

/* Double bogey (or worse): double square. triple-bogey-plus ist in der
   Statistik (stats.py) eine eigene Kategorie, aber auf der klassischen
   Scorecard bekommt es bewusst dasselbe Symbol wie double-bogey - die
   traditionelle Notation unterscheidet "+2" und "+3 oder mehr" nicht. */
.mark.double-bogey,
.mark.triple-bogey-plus { color: var(--ink); }
.mark.double-bogey::before,
.mark.triple-bogey-plus::before {
    content: "";
    position: absolute;
    inset: 1px;
    border: 1.5px solid var(--ink);
}
.mark.double-bogey::after,
.mark.triple-bogey-plus::after {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1.5px solid var(--ink);
}

/* Kill Chrome's autofill yellow tint if score cells are <input> elements */
.scorecard input:-webkit-autofill,
.scorecard input:-webkit-autofill:hover,
.scorecard input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px #fff inset !important;
    -webkit-text-fill-color: var(--ink) !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* ==========================================================================
   Round header + stat cards
   ========================================================================== */

.eyebrow {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .85rem;
    color: var(--ink-soft);
    margin-bottom: .1rem;
}

.stat-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(30, 42, 34, .06);
    padding: 1.1rem 1rem 1rem;
    text-align: center;
    overflow: hidden;
}

/* thin colored accent on top, ties each card to the scorecard palette */
.stat-card::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--hairline);
}
.stat-card--score::before { background: var(--fairway); }
.stat-card--putts::before { background: var(--sand); }
.stat-card--strokes::before { background: var(--flag); }
.stat-card--stableford::before { background: var(--fairway-deep); }

.stat-label {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: .3rem;
    /* .stat-card hat overflow:hidden - ohne das hier würde ein langes
       Wort (z.B. "STRAFSCHLÄGE") in einer schmalen Karte (Mobile, 2 pro
       Zeile) einfach am Kartenrand abgeschnitten statt umzubrechen. */
    overflow-wrap: break-word;
}

.stat-value {
    font-family: "IBM Plex Mono", monospace;
    font-size: 2.25rem;
    font-weight: 600;
    color: var(--ink);
    line-height: 1.15;
}

.stat-sub {
    font-family: "IBM Plex Mono", monospace;
    font-size: .85rem;
    color: var(--ink-soft);
    margin-top: .2rem;
    overflow-wrap: break-word;
}

/* Schmale Bildschirme: bei 2 Karten pro Zeile (col-6) ist weniger Platz -
   etwas kompakter, damit lange stat-sub-Zeilen (z.B. "Differential 21.5
   (-1.2)") nicht so schnell umbrechen. */
@media (max-width: 575.98px) {
    .stat-card {
        padding: .85rem .6rem .75rem;
    }
    .stat-value {
        font-size: 1.65rem;
    }
    .stat-label {
        font-size: .64rem;
        letter-spacing: .04em;
    }
    .stat-sub {
        font-size: .74rem;
    }
}

/* Rundendetail-Kopfzeile: Buttons "Runde bearbeiten" / "Scores bearbeiten" /
   "Löschen" - Text immer sichtbar (keine Icon-only-Verwirrung mehr), auf
   schmalen Bildschirmen untereinander gestapelt statt gequetscht. */
@media (max-width: 575.98px) {
    .round-header__actions {
        flex-direction: column;
        width: 100%;
    }
    .round-header__actions .btn {
        width: 100%;
    }
}
.stat-sub.under { color: var(--flag); font-weight: 600; }
.stat-sub.over { color: var(--fairway); font-weight: 600; }

/* Stat-Card als Link (z.B. "Bestleistungen" -> springt zur Runde) */
.stat-card--link {
    transition: box-shadow .15s ease, border-color .15s ease;
}

.stat-card--link:hover {
    border-color: var(--sand);
    box-shadow: 0 3px 10px rgba(30, 42, 34, .1);
}

/* ==========================================================================
   Generic card panel (used for the rounds list, etc.)
   ========================================================================== */

.panel {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(30, 42, 34, .06);
    overflow: hidden;
}

/* ==========================================================================
   Rounds list table
   ========================================================================== */

.rounds-table {
    margin-bottom: 0;
    font-family: "IBM Plex Sans", sans-serif;
}

.rounds-table thead th {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--ink-soft);
    background: #fff;
    border-bottom: 2px solid var(--fairway) !important;
    white-space: nowrap;
}

.rounds-table tbody td {
    vertical-align: middle;
    border-color: var(--hairline) !important;
}

.rounds-table tbody tr:hover {
    background: var(--sand-soft);
}

.rounds-table .round-date {
    font-family: "IBM Plex Mono", monospace;
    color: var(--ink-soft);
    font-size: .9rem;
    white-space: nowrap;
}

.rounds-table .club-name {
    font-weight: 600;
    color: var(--ink);
}

.rounds-table .tee-name {
    font-size: .8rem;
    color: var(--ink-soft);
}

.rounds-table .score-value {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
}

/* Nicht auf .rounds-table beschränkt - wird auch ausserhalb von Tabellen
   wiederverwendet (z.B. .recent-round-row auf dem Dashboard). */
.score-topar {
    font-family: "IBM Plex Mono", monospace;
    font-size: .8rem;
    color: var(--ink-soft);
    margin-left: .25rem;
}
.score-topar.under { color: var(--flag); font-weight: 600; }
.score-topar.over { color: var(--fairway); font-weight: 600; }

.rounds-table .stableford-value {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    color: var(--ink);
}

/* Garmin-style hole progress bar: one block per hole, no numbers, just color */
.hole-bar {
    display: flex;
    gap: 2px;
    width: 100%;
    min-width: 130px;
}

.hole-bar__seg {
    flex: 1 1 0;
    height: 12px;
    border-radius: 2px;
    background: var(--hairline); /* default: not played */
}

.hole-bar__seg.eagle { background: var(--flag); }
.hole-bar__seg.birdie { background: var(--flag-light); }
.hole-bar__seg.par { background: var(--fairway); }
.hole-bar__seg.bogey { background: var(--sand); }
.hole-bar__seg.double-bogey { background: var(--mud); }
.hole-bar__seg.triple-bogey-plus { background: var(--ink); }

/* Dashboard "Letzte Runden": kompakte Zeilen-Liste statt Tabelle - eine
   4-Spalten-Tabelle bricht bei 5 Einträgen in der schmalen Dashboard-Spalte
   leicht um (Club-Name/Score). Eine flexible Zeile pro Runde vermeidet das
   bei jeder Breite, ganz ohne separate Mobile-Variante. */
.recent-rounds {
    display: flex;
    flex-direction: column;
}

.recent-round-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: .75rem;
    padding: .65rem 0;
    border-bottom: 1px solid var(--hairline);
}

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

.recent-round-row:hover {
    background: var(--sand-soft);
}

.recent-round-row__club {
    font-weight: 600;
    color: var(--ink);
}

.recent-round-row__date {
    font-family: "IBM Plex Mono", monospace;
    font-size: .78rem;
    color: var(--ink-soft);
}

.recent-round-row__stats {
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}

.recent-round-row__stableford {
    display: block;
    font-family: "IBM Plex Mono", monospace;
    font-size: .78rem;
    color: var(--ink-soft);
}

/* Rundenliste auf Mobile: Cards statt Tabelle (kein horizontales Scrollen
   mehr nötig). Desktop-Tabelle bleibt unverändert (siehe .rounds-table). */
.round-cards {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.round-card {
    display: block;
}

.round-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .75rem;
}

.round-card__club {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--ink);
}

.round-card__tee {
    font-size: .78rem;
    color: var(--ink-soft);
}

.round-card__date {
    font-family: "IBM Plex Mono", monospace;
    font-size: .78rem;
    color: var(--ink-soft);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Zwei Werte nebeneinander, klar getrennt durch eine Trennlinie -
   bewusst nur Score-zu-Par + Stableford, kein roher Score (siehe
   .score-value in der Desktop-Tabelle: bei unvollständigen Runden ist
   der ohnehin nur ein Teilergebnis, siehe Fussnote "*"). */
.round-card__stats {
    display: flex;
    gap: 1.5rem;
}

.round-card__stat-label {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: .15rem;
}

.round-card__stat-value {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--ink);
}

.round-card__stat-value.under { color: var(--flag); }
.round-card__stat-value.over { color: var(--fairway); }

/* Equipment-Statistik auf Mobile: Karte pro Schläger statt der breiten
   8-Spalten-Tabelle (die bleibt für Desktop, siehe .club-cards d-md-none). */
.club-card__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: .5rem;
    margin-bottom: .75rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--hairline);
}

.club-card__name {
    font-weight: 600;
    color: var(--ink);
}

.club-card__shots {
    font-family: "IBM Plex Mono", monospace;
    font-size: .78rem;
    color: var(--ink-soft);
    white-space: nowrap;
}

/* 2-Spalten-Grid statt einer langen Liste - halbiert die Kartenhöhe bei
   5 Werten (3 Zeilen statt 5). */
.club-card__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .75rem 1rem;
}

.club-card__stat-label {
    font-size: .64rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: .1rem;
}

.club-card__stat-value {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 600;
    font-size: .95rem;
    color: var(--ink);
    overflow-wrap: break-word;
}

.club-card__miss {
    font-size: .78rem;
    color: var(--ink-soft);
    margin-top: .75rem;
    padding-top: .5rem;
    border-top: 1px solid var(--hairline);
}

/* ==========================================================================
   Forms (round create/edit, etc.)
   ========================================================================== */

.form-panel {
    padding: 1.5rem;
}

.form-label-golf {
    display: block;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ink-soft);
    margin-bottom: .35rem;
}

.form-panel .form-control,
.form-panel .form-select {
    border-color: var(--hairline);
    color: var(--ink);
}

.form-panel .form-control:focus,
.form-panel .form-select:focus {
    border-color: var(--fairway);
    box-shadow: 0 0 0 .2rem rgba(53, 86, 63, .15);
}

.form-panel .form-check-input:checked {
    background-color: var(--fairway);
    border-color: var(--fairway);
}

.form-panel .form-check-input:focus {
    border-color: var(--fairway);
    box-shadow: 0 0 0 .2rem rgba(53, 86, 63, .15);
}

.form-panel .form-check-label {
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--ink);
    font-size: .95rem;
}

.form-divider {
    border-top: 1px solid var(--hairline);
    margin: .25rem 0 .5rem;
    opacity: 1;
}

.field-error {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .8rem;
    color: var(--flag);
    margin-top: .3rem;
}

.btn-fairway {
    background: var(--fairway);
    border-color: var(--fairway);
    color: #fff;
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    padding: .5rem 1.5rem;
}

.btn-fairway:hover,
.btn-fairway:focus {
    background: var(--fairway-deep);
    border-color: var(--fairway-deep);
    color: #fff;
}

/* Fairway / GIR icon columns, if you switch those cells to ✓ / ✕ / ↷ / ↶ */
.scorecard .icon-hit { color: var(--fairway); font-weight: 600; }
.scorecard .icon-miss { color: var(--hairline); }
.scorecard .icon-dir { color: var(--sand); font-weight: 600; }

/* Fairway indicator: mini top-down fairway with a dot marking the tee shot */
.fw-icon {
    position: relative;
    display: inline-block;
    width: 30px;
    height: 26px;
    vertical-align: middle;
}
.fw-icon::before {
    /* the fairway shape, narrow far / wide near */
    content: "";
    position: absolute;
    inset: 0;
    background: var(--sand-soft);
    clip-path: polygon(38% 0%, 62% 0%, 84% 92%, 16% 92%);
}
.fw-icon::after {
    /* the ball position dot */
    content: "";
    position: absolute;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    top: 42%;
    transform: translate(-50%, -50%);
}

.fw-icon.fw-center::after {
    left: 50%;
    background: var(--fairway);
}
.fw-icon.fw-left::after {
    left: 14%;
    background: var(--sand);
}
.fw-icon.fw-right::after {
    left: 86%;
    background: var(--sand);
}
.fw-icon.fw-short::after {
    left: 50%;
    top: 100%;
    background: var(--ink-soft);
}

@media (max-width: 640px) {
    .scorecard th:not(:first-child),
    .scorecard td:not(:first-child) {
        width: 46px;
    }
}

/* ==========================================================================
   Navbar & footer
   ========================================================================== */

.navbar-golf {
    background: var(--fairway);
}

.navbar-golf .navbar-brand {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.navbar-golf .nav-link.disabled {
    opacity: .45;
}

/* Abmelden-Button in der Navbar: sieht aus wie ein normaler nav-link,
   ist aber ein <button> in einem <form method="post">, weil Djangos
   LogoutView aus Sicherheitsgründen nur POST akzeptiert (kein simpler
   <a href>). */
.nav-link-button {
    background: none;
    border: 0;
    cursor: pointer;
}

.footer-golf {
    background: var(--cream);
    color: var(--ink-soft);
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .82rem;
    border-color: var(--hairline) !important;
}

/* ==========================================================================
   Course cards
   ========================================================================== */

.course-card {
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(30, 42, 34, .06);
    padding: 1.15rem 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: box-shadow .15s ease, border-color .15s ease;
}

.course-card:hover {
    border-color: var(--sand);
    box-shadow: 0 3px 10px rgba(30, 42, 34, .1);
}

.course-card__header {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    margin-bottom: .9rem;
}

.course-card__flag {
    font-size: 1.3rem;
    line-height: 1.3;
}

.course-card__club {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 700;
    color: var(--ink);
    font-size: 1.02rem;
    line-height: 1.25;
}

.course-card__name {
    font-family: "IBM Plex Sans", sans-serif;
    color: var(--ink-soft);
    font-size: .82rem;
}

.course-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: auto;
    padding-top: .5rem;
}

.meta-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    background: var(--sand-soft);
    color: var(--fairway-deep);
    font-family: "IBM Plex Mono", monospace;
    font-size: .76rem;
    font-weight: 600;
    padding: .28rem .55rem;
    border-radius: 20px;
    white-space: nowrap;
}

.meta-chip i {
    font-size: .82rem;
}

.meta-chip--warn {
    background: rgba(168, 52, 31, .1);
    color: var(--flag);
}

.course-card .btn-outline-fairway {
    margin-top: .9rem;
    border: 1px solid var(--fairway);
    color: var(--fairway);
    background: transparent;
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    font-size: .85rem;
}

.course-card .btn-outline-fairway:hover:not(:disabled) {
    background: var(--fairway);
    color: #fff;
}

.course-card .btn-outline-fairway:disabled {
    border-color: var(--hairline);
    color: var(--ink-soft);
    background: transparent;
    opacity: 1;
}

/* ==========================================================================
   Course list — row/list variant (alternative to the card grid)
   ========================================================================== */

.course-row-list {
    display: flex;
    flex-direction: column;
}

.course-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .85rem 1.25rem;
    border-bottom: 1px solid var(--hairline);
    border-left: 3px solid var(--fairway);
    transition: background-color .15s ease;
}

.course-row:last-child {
    border-bottom: none;
}

.course-row:hover {
    background: var(--sand-soft);
}

.course-row--warn {
    border-left-color: var(--flag);
}

.course-row__flag {
    font-size: 1.25rem;
    flex: 0 0 auto;
}

.course-row__info {
    flex: 1 1 220px;
    min-width: 160px;
}

.course-row__club {
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 700;
    color: var(--ink);
    font-size: .98rem;
    line-height: 1.3;
}

.course-row__name {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .8rem;
    color: var(--ink-soft);
}

.course-row__tees {
    display: flex;
    gap: .3rem;
    flex-wrap: wrap;
    flex: 0 1 auto;
}

.tee-pill {
    font-family: "IBM Plex Mono", monospace;
    font-size: .72rem;
    font-weight: 600;
    padding: .22rem .55rem;
    border-radius: 12px;
    background: var(--sand-soft);
    color: var(--fairway-deep);
    white-space: nowrap;
}

.tee-pill--more {
    background: var(--hairline);
    color: var(--ink-soft);
}

.course-row__holes {
    flex: 0 0 auto;
}

.course-row__action {
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 700px) {
    .course-row {
        flex-wrap: wrap;
    }
    .course-row__action {
        width: 100%;
        margin-left: 0;
        margin-top: .4rem;
    }
    .course-row__action .btn {
        width: 100%;
    }
}

/* ==========================================================================
   Statistik-Seite
   ========================================================================== */

.dist-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: .55rem;
}

.dist-label {
    width: 110px;
    flex-shrink: 0;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .8rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--ink-soft);
}

.dist-bar {
    flex: 1;
    height: 10px;
    background: var(--hairline);
    border-radius: 5px;
    overflow: hidden;
}

.dist-bar__fill {
    height: 100%;
}

.dist-bar__fill--eagle { background: var(--flag); }
.dist-bar__fill--birdie { background: var(--flag-light); }
.dist-bar__fill--par { background: var(--fairway); }
.dist-bar__fill--bogey { background: var(--sand); }
.dist-bar__fill--double-bogey { background: var(--mud); }
.dist-bar__fill--triple-bogey-plus { background: var(--ink); }

.dist-count {
    width: 84px;
    flex-shrink: 0;
    text-align: right;
    font-family: "IBM Plex Mono", monospace;
    font-size: .85rem;
    color: var(--ink-soft);
}

/* Fairway-Richtung: dieselben dist-row-Zeilen wie die Scoring-Verteilung,
   nur mit eigenen Füllfarben (fir-L/F/R/S statt eagle/birdie/...). Läuft
   in einer schmaleren Spalte (neben "Ø Score nach Par-Typ") besser als
   ein einzelner gestapelter Balken. */
.dist-bar__fill--fir-L { background: var(--sand); }
.dist-bar__fill--fir-F { background: var(--fairway); }
.dist-bar__fill--fir-R { background: var(--mud); }
.dist-bar__fill--fir-S { background: var(--ink-soft); }

/* GIR% nach Lochlänge: kurz = am ehesten machbar (fairway/grün), lang =
   am schwierigsten (flag/rot) - dieselbe gut-neutral-schlecht-Logik wie
   bei den Putts pro Loch. */
.dist-bar__fill--length-kurz { background: var(--fairway); }
.dist-bar__fill--length-mittel { background: var(--sand); }
.dist-bar__fill--length-lang { background: var(--flag); }

/* Putts pro Loch: 0/1 Putts sind gut (Richtung "flag"/"fairway"), 2 ist
   normal (sand), 3+ ist der Wert, den man senken will (mud) - dieselbe
   gut-neutral-schlecht-Logik wie bei der Scoring-Verteilung. */
.dist-bar__fill--putts-0 { background: var(--flag); }
.dist-bar__fill--putts-1 { background: var(--flag-light); }
.dist-bar__fill--putts-2 { background: var(--fairway); }
.dist-bar__fill--putts-3plus { background: var(--mud); }

/* Kompakte Legende neben einem Donut-Chart (z.B. Scoring-Verteilung) -
   dieselben dist-bar__fill--*-Farbklassen wie bei den dist-row-Balken,
   nur als kleines Quadrat statt eines vollen Balkens, weil die Farbe im
   Chart selbst schon die "Balken"-Funktion übernimmt. */
.legend-row {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin-bottom: .4rem;
}

.legend-swatch {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-label {
    flex: 1;
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .85rem;
    font-weight: 600;
    text-transform: capitalize;
    color: var(--ink-soft);
}

.legend-count {
    font-family: "IBM Plex Mono", monospace;
    font-size: .85rem;
    color: var(--ink-soft);
}

/* Kleinere Einheit neben einem großen Kennzahlwert, z.B. "zu Par" */
.stat-value__unit {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--ink-soft);
}

/* Hinweisbanner für unvollständige Runden */
.notice-incomplete {
    display: flex;
    align-items: center;
    gap: .6rem;
    border-left: 3px solid var(--sand);
    color: var(--ink-soft);
    font-size: .85rem;
}

.notice-incomplete i {
    color: var(--sand);
    font-size: 1.1rem;
}

/* Statistik/Trends: Tab-Umschalter zwischen den beiden Seiten */
.stats-nav .nav-link {
    color: var(--ink-soft);
    font-family: "IBM Plex Sans", sans-serif;
    font-weight: 600;
    font-size: .85rem;
}

.stats-nav .nav-link.active {
    background-color: var(--fairway);
    color: #fff;
}

/* Trends: Chart.js braucht einen Container mit fester Höhe */
.chart-box {
    position: relative;
    height: 220px;
}

.chart-box--lg {
    height: 320px;
}

.chart-box--sm {
    height: 140px;
}

/* Recovery-/Bogey Save-Quote: kleiner Ring-Gauge mit der Prozentzahl in
   der Mitte, statt eines einzeln stehenden Text-Badges - passt zur
   Donut-Optik der Scoring-Verteilung und wirkt weniger "verloren" neben
   dem Mini-Balkendiagramm darüber. */
.gauge-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.gauge {
    position: relative;
    width: 72px;
    height: 72px;
    flex-shrink: 0;
}

.gauge canvas {
    width: 100% !important;
    height: 100% !important;
}

.gauge__value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
}

/* ==========================================================================
   Score-Eingabe (Formset)
   ========================================================================== */

.score-entry-section {
    margin-top: 1.25rem;
    margin-bottom: .4rem;
    color: var(--fairway-deep);
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: .78rem;
    font-weight: 700;
    font-family: "IBM Plex Sans", sans-serif;
}

.score-entry-section:first-child {
    margin-top: 0;
}

.score-entry-card {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: .6rem;
    padding: .7rem .9rem;
    margin-bottom: .55rem;
    background: #fff;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(30, 42, 34, .05);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.score-entry-card:focus-within {
    border-color: var(--fairway);
    box-shadow: 0 0 0 .15rem rgba(53, 86, 63, .12);
}

.score-entry-card__hole {
    display: flex;
    flex-direction: column;
    width: 68px;
    flex-shrink: 0;
}

.score-entry-card__number {
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--ink);
}

.score-entry-card__par {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .7rem;
    color: var(--ink-soft);
}

.score-entry-card__field {
    display: flex;
    flex-direction: column;
    width: 64px;
}

.score-entry-card__field--fairway {
    width: 150px;
}

.score-entry-card__field--club {
    width: 130px;
}

.score-entry-card__field--check {
    width: 56px;
    align-items: center;
}

.score-entry-card__label {
    font-family: "IBM Plex Sans", sans-serif;
    font-size: .64rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--ink-soft);
    margin-bottom: .2rem;
}

.score-entry-card__errors {
    width: 100%;
    color: var(--flag);
    font-size: .78rem;
}

.score-entry-card__na {
    display: inline-block;
    padding: .25rem 0;
}

/* Score-Feld: live nach Score-zu-Par eingefärbt (siehe round_score_form.html
   extra_js) - dieselben 6 Kategorien/Farben wie SCORE_RESULT_ORDER überall
   sonst in der App. Nur Hintergrund/Rahmen/Text, keine Layout-Änderung. */
.score-input--eagle {
    background: color-mix(in srgb, var(--flag) 18%, white);
    border-color: var(--flag) !important;
    color: var(--flag);
    font-weight: 700;
}

.score-input--birdie {
    background: color-mix(in srgb, var(--flag-light) 25%, white);
    border-color: var(--flag-light) !important;
    color: var(--flag);
    font-weight: 700;
}

.score-input--par {
    background: color-mix(in srgb, var(--fairway) 14%, white);
    border-color: var(--fairway) !important;
    color: var(--fairway-deep);
}

.score-input--bogey {
    background: color-mix(in srgb, var(--sand) 20%, white);
    border-color: var(--sand) !important;
    color: var(--ink);
}

.score-input--double-bogey {
    background: color-mix(in srgb, var(--mud) 18%, white);
    border-color: var(--mud) !important;
    color: var(--mud);
}

.score-input--triple-bogey-plus {
    background: color-mix(in srgb, var(--ink) 14%, white);
    border-color: var(--ink) !important;
    color: var(--ink);
    font-weight: 700;
}

/* Fairway-Pillen (L/F/R/S) statt Standard-Dropdown, siehe round_score_
   form.html - das eigentliche <select> (.fairway-select) bleibt die
   Datenquelle fürs Formular, wird hier aber unsichtbar gemacht. */
.fairway-select {
    display: none;
}

.fairway-pill-group {
    display: flex;
    gap: .25rem;
}

.fairway-pill {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--hairline);
    background: #fff;
    color: var(--ink-soft);
    font-family: "IBM Plex Mono", monospace;
    font-weight: 700;
    font-size: .8rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.fairway-pill:hover {
    border-color: var(--ink-soft);
}

.fairway-pill--L.active { background: var(--sand); border-color: var(--sand); color: #fff; }
.fairway-pill--F.active { background: var(--fairway); border-color: var(--fairway); color: #fff; }
.fairway-pill--R.active { background: var(--mud); border-color: var(--mud); color: #fff; }
.fairway-pill--S.active { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; }

/* Score-Eingabe auf schmalen Bildschirmen (Handy - der wahrscheinlichste
   Ort, an dem tatsächlich Scores erfasst werden, direkt am Platz): die
   Desktop-Variante reiht alle Felder mit festen Breiten nebeneinander
   (~660px in Summe) - das bricht auf einem Handy unkontrolliert um. Ab
   576px (Bootstrap "sm") stattdessen ein festes 3-Zeilen-Raster pro
   Karte, das immer gleich aussieht statt an zufälligen Stellen
   umzubrechen: Loch/Score/Putts/Straf, dann Schläger/Weite, dann
   Fairway-Pillen/Fertig. */
@media (max-width: 576px) {
    .score-entry-card {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        grid-template-areas:
            "hole score putts penalty"
            "club club distance distance"
            "fairway fairway fairway check";
        column-gap: .5rem;
        row-gap: .6rem;
        align-items: end;
    }

    .score-entry-card__hole,
    .score-entry-card__field {
        width: auto;
    }

    .score-entry-card__hole { grid-area: hole; }
    .score-entry-card__field--score { grid-area: score; }
    .score-entry-card__field--putts { grid-area: putts; }
    .score-entry-card__field--penalty { grid-area: penalty; }
    .score-entry-card__field--club { grid-area: club; }
    .score-entry-card__field--distance { grid-area: distance; }
    .score-entry-card__field--fairway { grid-area: fairway; }
    .score-entry-card__field--check {
        grid-area: check;
        align-items: center;
    }

    .fairway-pill-group {
        justify-content: flex-start;
    }

    .score-entry-card__errors {
        grid-column: 1 / -1;
    }
}