:root {
    --bg: #f5f7fb;
    --card: #ffffff;
    --border: #d8deea;
    --text: #1e293b;
    --muted: #64748b;
    --primary: #0f766e;
    --primary-dark: #115e59;
    --danger: #b91c1c;
    --danger-dark: #991b1b;
    --flash-success-bg: #dcfce7;
    --flash-success-border: #86efac;
    --flash-error-bg: #fee2e2;
    --flash-error-border: #fca5a5;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px;
}

.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--border);
}

.site-header .container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.site-header h1 {
    margin: 0;
    font-size: 1.2rem;
}

.site-header h1 a {
    color: var(--text);
    text-decoration: none;
}

.brand-logos {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.site-brand a {
    display: inline-flex;
    align-items: center;
}

.site-logo {
    display: block;
    width: clamp(190px, 24vw, 300px);
    height: 64px;
    object-fit: contain;
    object-position: left center;
}

.balletour-logo {
    width: clamp(150px, 20vw, 240px);
}

.balletour-header .container {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 14px;
    padding-top: 6px;
    padding-bottom: 6px;
}

.balletour-header .site-brand {
    min-width: 0;
}

.balletour-header .site-logo {
    height: 48px;
}

.balletour-header .balletour-logo {
    width: clamp(104px, 15vw, 158px);
}

.balletour-header nav {
    align-items: center;
    justify-content: flex-end;
    gap: 6px 10px;
    min-width: 0;
}

.balletour-header nav a {
    font-size: 0.88rem;
    white-space: nowrap;
}

nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

nav a {
    text-decoration: none;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.nav-form {
    display: inline;
    margin: 0;
}

.nav-form button {
    border: 0;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    padding: 0;
}

button.submit-is-loading,
input.submit-is-loading {
    cursor: progress;
    opacity: 0.76;
}

.loading-popup {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.24);
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
    z-index: 2000;
}

.loading-popup.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.loading-card {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    width: min(420px, 100%);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.24);
    padding: 18px;
}

.loading-card strong {
    display: block;
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.loading-card p {
    margin: 0;
    color: var(--muted);
}

.bouncing-golf-ball {
    position: relative;
    height: 76px;
}

.golf-ball {
    position: absolute;
    left: 19px;
    bottom: 18px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 15px 13px, rgba(148, 163, 184, 0.55) 0 2px, transparent 3px),
        radial-gradient(circle at 27px 11px, rgba(148, 163, 184, 0.45) 0 2px, transparent 3px),
        radial-gradient(circle at 20px 25px, rgba(148, 163, 184, 0.45) 0 2px, transparent 3px),
        radial-gradient(circle at 31px 27px, rgba(148, 163, 184, 0.4) 0 2px, transparent 3px),
        #ffffff;
    border: 1px solid #cbd5e1;
    box-shadow: inset -7px -9px 12px rgba(148, 163, 184, 0.26);
    animation: golf-ball-bounce 760ms cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

.golf-ball-shadow {
    position: absolute;
    left: 16px;
    bottom: 9px;
    width: 48px;
    height: 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.2);
    animation: golf-ball-shadow 760ms cubic-bezier(0.42, 0, 0.58, 1) infinite;
}

@keyframes golf-ball-bounce {
    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-28px) rotate(18deg);
    }
}

@keyframes golf-ball-shadow {
    0%,
    100% {
        transform: scaleX(1);
        opacity: 0.28;
    }
    50% {
        transform: scaleX(0.62);
        opacity: 0.12;
    }
}

@media (prefers-reduced-motion: reduce) {
    .golf-ball,
    .golf-ball-shadow {
        animation: none;
    }
}

.narrow-form {
    max-width: 440px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.stat-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 12px;
}

.stat-card strong {
    display: block;
    font-size: 1.35rem;
}

.stat-card span {
    color: var(--muted);
    font-size: 0.88rem;
}

.round-summary-heading {
    align-items: flex-end;
    margin-bottom: 18px;
}

.round-summary-heading h2,
.round-summary-heading p,
.section-heading h3,
.section-heading p,
.round-scorecard-section h3,
.round-player-statistics h4,
.round-player-statistics h5 {
    margin-top: 0;
}

.round-summary-heading h2,
.round-scorecard-section h3,
.round-player-statistics h4,
.round-player-statistics h5 {
    margin-bottom: 6px;
}

.round-summary-heading p {
    margin-bottom: 4px;
}

.round-summary-card,
.round-statistics-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    margin-bottom: 18px;
}

.section-heading,
.round-player-statistics-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
}

.eyebrow {
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.round-timing {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px 16px;
    color: var(--muted);
    font-size: 0.86rem;
}

.round-scorecard-section + .round-scorecard-section {
    margin-top: 20px;
}

.round-scorecard-wrap {
    border: 1px solid var(--border);
    border-radius: 6px;
}

.round-summary-scorecard {
    width: 100%;
    min-width: 720px;
    table-layout: fixed;
}

.round-summary-scorecard th,
.round-summary-scorecard td {
    padding: 8px 4px;
    text-align: center;
    white-space: nowrap;
}

.round-summary-scorecard th:first-child {
    width: 142px;
    text-align: left;
    padding-left: 10px;
}

.round-summary-scorecard thead th {
    background: #e8eef5;
}

.round-summary-scorecard .course-data-row {
    background: #f8fafc;
    color: var(--muted);
}

.round-summary-scorecard .tee-row {
    font-size: 0.82rem;
}

.round-summary-scorecard .player-score-row th {
    color: var(--text);
}

.round-summary-scorecard .player-score-row th span,
.round-summary-scorecard .player-score-row th small,
.round-summary-scorecard .score-total-to-par {
    display: block;
}

.round-summary-scorecard .player-score-row th small,
.round-summary-scorecard .score-total-to-par {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 400;
    margin-top: 2px;
}

.round-player-statistics {
    border-top: 1px solid var(--border);
    padding-top: 18px;
    margin-top: 14px;
}

.round-score-summary {
    min-width: 88px;
    text-align: right;
}

.round-score-summary strong,
.round-score-summary span {
    display: block;
}

.round-score-summary strong {
    font-size: 1.7rem;
}

.round-score-summary span {
    color: var(--muted);
    font-size: 0.82rem;
}

.round-stat-grid {
    margin-top: 14px;
}

.round-hole-statistics {
    margin: 18px 0 14px;
}

.round-hole-stat-table {
    font-size: 0.88rem;
}

.round-hole-stat-table th,
.round-hole-stat-table td {
    padding: 9px 8px;
    vertical-align: middle;
}

.round-hole-stat-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.round-stat-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.round-stat-details > div {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px;
}

.compact-stat-list {
    margin: 0;
}

.compact-stat-list div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}

.compact-stat-list div:last-child {
    border-bottom: none;
}

.compact-stat-list dd {
    margin: 0;
    font-weight: 700;
    text-align: right;
}

.round-summary-actions {
    justify-content: space-between;
}

.muted {
    color: var(--muted);
}

.page-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.page-title-row h2,
.page-title-row p {
    margin: 0;
}

.page-title-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.page-heading-line {
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.balletour-title-row {
    align-items: flex-start;
}

.balletour-title-row .version-link {
    margin-left: auto;
    padding-top: 6px;
    text-align: right;
}

.balletour-home-actions {
    margin-bottom: 14px;
}

.version-link {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
}

.version-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

.changelog-list {
    display: grid;
    gap: 12px;
}

.changelog-entry {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 14px;
}

.changelog-entry h3,
.changelog-entry p {
    margin: 0 0 8px;
}

.changelog-entry ul {
    margin: 0;
    padding-left: 20px;
}

.github-status-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
    margin: 10px 0;
}

.github-status-box p {
    margin: 0 0 8px;
}

.ai-action-row {
    margin-top: 8px;
}

.ai-action-row form {
    margin: 0;
}

.ai-example-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0;
}

.ai-example-button {
    text-align: left;
    white-space: normal;
}

.ai-answer {
    white-space: pre-wrap;
}

.ai-list-heading {
    margin-top: 18px;
}

.ai-fix-heading {
    color: var(--danger);
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.filter-tabs a {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: var(--primary);
    padding: 7px 9px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.86rem;
}

.filter-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.ai-issue-list {
    display: grid;
    gap: 8px;
}

.ai-issue-card {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 10px;
}

.ai-issue-main {
    min-width: 0;
}

.ai-issue-title {
    display: flex;
    gap: 8px;
    align-items: baseline;
    font-weight: 800;
    min-width: 0;
}

.ai-issue-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ai-issue-meta,
.ai-issue-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.ai-issue-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.ai-issue-details {
    grid-column: 1 / -1;
}

.ai-issue-details summary,
.github-comment summary {
    cursor: pointer;
    font-weight: 700;
}

.status-pill,
.label-pill {
    border-radius: 999px;
    padding: 2px 7px;
    font-size: 0.76rem;
    font-weight: 800;
}

.status-pill {
    background: #e0f2fe;
    color: #075985;
}

.label-pill {
    background: #ecfdf5;
    color: #166534;
}

.ai-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 10px;
}

.prompt-preview.compact {
    max-height: 220px;
    overflow: auto;
    white-space: pre-wrap;
}

.github-comment-list {
    display: grid;
    gap: 8px;
}

.github-comment {
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.github-comment summary {
    display: grid;
    gap: 3px;
}

.ai-error-line {
    grid-column: 1 / -1;
}

.tee-tabs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 10px 0 14px;
}

.tee-tabs-label {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
    margin-right: 2px;
}

.tee-tabs a {
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--card);
    color: var(--primary);
    padding: 7px 11px;
    text-decoration: none;
    font-weight: 700;
}

.tee-tabs a.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.profile-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    background: var(--card);
}

.player-card-link {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.gallery-filter-form {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(150px, 0.45fr) auto;
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.gallery-filter-form label {
    margin: 0;
}

.gallery-filter-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.gallery-filter-group legend {
    margin-bottom: 6px;
    font-weight: 800;
}

.gallery-filter-options {
    display: grid;
    gap: 6px;
    max-height: 260px;
    overflow: auto;
    margin-top: 6px;
    padding: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}

.gallery-filter-options label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-weight: 700;
}

.gallery-hole-options {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.gallery-filter-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .gallery-filter-form {
        grid-template-columns: 1fr;
    }
}

.gallery-grid figure {
    margin: 0;
}

.gallery-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--card);
}

.gallery-grid figcaption {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.86rem;
}

.gallery-grid figcaption span {
    padding: 3px 7px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #fff;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 12px;
}

.hole-entry-page {
    max-width: 560px;
    margin: 0 auto;
}

.hole-entry-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.hole-entry-top h2,
.hole-entry-top p {
    margin: 0;
}

.hole-entry-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.compact-button {
    padding: 8px 10px;
    white-space: nowrap;
}

.hole-info-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 6px;
}

.hole-info-strip div {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 8px 6px;
    text-align: center;
}

.hole-info-strip strong {
    display: block;
    font-size: 1.15rem;
    line-height: 1.1;
}

.hole-info-strip small {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.hole-info-strip span {
    color: var(--muted);
    font-size: 0.72rem;
}

.hole-entry-form {
    margin: 0;
}

.hole-player-list {
    display: grid;
    gap: 7px;
}

.hole-player-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 8px;
}

.hole-player-row.with-stats {
    grid-template-columns: minmax(0, 1fr);
}

.hole-player-row.with-club {
    grid-template-columns: minmax(0, 1fr);
}

.hole-player-row.has-validation-error {
    border-color: var(--flash-error-border);
    background: #fff7f7;
}

.hole-player-meta {
    min-width: 0;
}

.hole-player-meta strong,
.hole-player-meta span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hole-player-meta span {
    color: var(--muted);
    font-size: 0.78rem;
}

.score-final-field,
.club-mini-field,
.hole-stat-grid label {
    margin: 0;
    font-weight: 600;
}

.score-final-field span,
.club-mini-field span,
.hole-stat-grid span {
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 600;
}

.club-mini-field select {
    width: 100%;
    min-width: 0;
    padding: 7px 4px;
    font-size: 0.86rem;
}

.hole-stat-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.hole-stat-grid .wide-stat-field {
    grid-column: span 2;
}

.green-direction-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.green-direction-grid label {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 52px;
    margin: 0;
    padding: 6px 4px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.1;
    text-align: center;
    overflow-wrap: anywhere;
}

.green-radio-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
}

.green-radio-group > span {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.green-radio-group label {
    min-height: 52px;
    padding: 6px 4px;
}

.green-direction-grid input {
    width: auto;
    margin: 0;
}

.info-strip {
    margin-bottom: 16px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
}

.compact-filter-form {
    margin-bottom: 16px;
    padding: 12px;
}

.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.checkbox-row label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-weight: 700;
}

.checkbox-row input {
    width: auto;
    margin: 0;
}

.hole-stat-grid input,
.hole-stat-grid select {
    width: 100%;
    min-width: 0;
    padding: 7px 5px;
    font-size: 0.9rem;
}

.score-final-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 84px;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    padding: 10px 12px;
    border: 2px solid var(--primary);
    border-radius: 8px;
    background: #ecfdf5;
}

.score-final-field span {
    margin: 0;
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 800;
}

.score-final-field select {
    width: 100%;
    padding: 8px 5px;
    border-color: var(--primary);
    background: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
}

.form-error-panel {
    grid-column: 1 / -1;
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid var(--flash-error-border);
    border-radius: 8px;
    background: var(--flash-error-bg);
    color: #7f1d1d;
    font-weight: 700;
}

.form-error-panel[hidden] {
    display: none;
}

.form-error-panel ul {
    margin: 0;
    padding-left: 18px;
}

.last-putt-selects {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px;
}

.hole-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
}

.hole-nav .button {
    width: 100%;
    text-align: center;
}

.hole-image-panel {
    margin-top: 12px;
}

.hole-image-form {
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    padding: 10px;
}

.hole-image-form h3,
.hole-image-form p {
    margin: 0;
}

.hole-image-form label {
    margin-top: 10px;
}

.hole-image-form button {
    width: 100%;
    margin-top: 10px;
}

.hole-image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.hole-image-grid figure {
    margin: 0;
}

.hole-image-grid img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.hole-image-grid figcaption {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.78rem;
}

.club-stat-table-wrap {
    margin-bottom: 22px;
    overflow-x: auto;
}

.club-stat-table {
    min-width: 760px;
}

.club-stat-table th,
.club-stat-table td {
    text-align: center;
    white-space: nowrap;
}

.club-stat-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--card);
    text-align: left;
}

.club-stat-table th.sticky-col {
    background: #eef2f7;
    z-index: 2;
}

.club-stat-table td strong,
.club-stat-table td span {
    display: block;
}

.club-stat-table td span {
    color: var(--muted);
    font-size: 0.72rem;
}

.club-stat-table td.club-stat-best {
    background: #dcfce7;
    color: #14532d;
}

.club-stat-table td.club-stat-worst {
    background: #fee2e2;
    color: #7f1d1d;
}

.club-stat-table td.club-stat-best span,
.club-stat-table td.club-stat-worst span {
    color: inherit;
}

.best-hole-table-wrap {
    margin-top: 10px;
}

.best-hole-table {
    table-layout: fixed;
}

.best-hole-table th,
.best-hole-table td {
    text-align: center;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    padding-left: 3px;
    padding-right: 3px;
}

.best-hole-table th:first-child,
.best-hole-table td:first-child {
    width: 92px;
    min-width: 92px;
    max-width: 92px;
    text-align: left;
    font-weight: 700;
}

.best-hole-table .score-shape {
    --score-shape-size: 30px;
    background: transparent;
}

.best-hole-score {
    background: #dcfce7;
    color: #14532d;
    font-weight: 700;
}

.best-hole-total-row td {
    border-top: 2px solid var(--text);
    font-weight: 700;
}

.compact-round-card {
    margin-bottom: 16px;
}

.compact-round-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.compact-round-card-header h3,
.compact-round-card-header p {
    margin: 0;
}

.balletour-compact-scorecard {
    min-width: 620px;
    table-layout: fixed;
}

.balletour-compact-scorecard th,
.balletour-compact-scorecard td {
    text-align: center;
    width: 38px;
    min-width: 38px;
    max-width: 38px;
    padding: 6px 3px;
}

.balletour-compact-scorecard th:first-child,
.balletour-compact-scorecard td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    width: 120px;
    min-width: 120px;
    max-width: 120px;
    text-align: left;
    background: var(--card);
    font-weight: 700;
}

.balletour-compact-scorecard th:first-child {
    background: #eef2f7;
    z-index: 2;
}

.balletour-compact-scorecard .score-shape {
    --score-shape-size: 28px;
    background: transparent;
}

.scorecard-popup-shell {
    min-height: calc(100vh - 130px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 18px 0;
}

.scorecard-popup {
    width: min(100%, 760px);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
    padding: 14px;
}

.scorecard-popup-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.scorecard-popup-header h2,
.scorecard-popup-header p {
    margin: 0;
}

.balletour-popup-scorecard {
    min-width: 560px;
}

.default-club-popup {
    width: min(100%, 680px);
}

.default-club-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.default-club-grid label {
    margin: 0;
}

.default-club-grid span {
    display: block;
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.default-club-grid select {
    width: 100%;
}

.ai-request-list {
    display: grid;
    gap: 12px;
}

.prompt-preview {
    white-space: pre-wrap;
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    padding: 10px;
    font: inherit;
}

.balletour-stats-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
    gap: 14px;
    align-items: start;
    margin-top: 16px;
}

.balletour-stats-layout section {
    min-width: 0;
}

.green-map-panel {
    min-width: 0;
}

.green-map-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.green-map-header h3,
.green-map-header p {
    margin: 0;
}

.green-map-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.green-map-legend span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.green-dot,
.green-point {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.green-dot.hit,
.green-point.hit {
    background: #22c55e;
}

.green-dot.miss,
.green-point.miss {
    background: #ef4444;
}

.green-dot.bunker,
.green-point.bunker {
    background: #f59e0b;
}

.green-map {
    position: relative;
    width: 100%;
    max-width: 680px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: url("/static/green.png") center / cover no-repeat;
}

.green-point {
    position: absolute;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 5px rgba(2, 6, 23, 0.45);
}

.button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.fairway-panel {
    overflow: hidden;
}

.fairway-panel-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

.fairway-panel-header h3 {
    margin-bottom: 4px;
}

.fairway-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.fairway-metrics div {
    min-width: 82px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    padding: 8px 10px;
    text-align: center;
}

.fairway-metrics strong {
    display: block;
    font-size: 1.1rem;
}

.fairway-metrics span {
    color: var(--muted);
    font-size: 0.78rem;
}

.hole-heatmap {
    position: relative;
    width: min(100%, 520px);
    aspect-ratio: 2 / 3;
    margin: 0 auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.12)),
        url("/static/fairway.png") center / cover no-repeat;
}

.heatmap-label {
    position: absolute;
    top: 10px;
    z-index: 1;
    padding: 4px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.58);
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
}

.heatmap-label.left {
    left: 9%;
}

.heatmap-label.fairway {
    left: 50%;
    transform: translateX(-50%);
}

.heatmap-label.right {
    right: 9%;
}

.shot-dot {
    position: absolute;
    z-index: 2;
    width: 11px;
    height: 11px;
    transform: translate(-50%, -50%);
    border-radius: 999px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 6px rgba(2, 6, 23, 0.5);
}

.shot-dot.hit {
    background: #22c55e;
}

.shot-dot.left {
    background: #facc15;
}

.shot-dot.right {
    background: #ef4444;
}

h2, h3 {
    margin-top: 0;
}

.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.section-title-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.section-title-row h3 {
    margin: 0;
}

.form-card,
.card-link,
.flash {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
}

.form-card {
    padding: 12px;
    margin-bottom: 14px;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px;
}

.card-link {
    display: block;
    padding: 14px;
    text-decoration: none;
    color: var(--text);
}

.card-link h3 {
    margin-bottom: 8px;
}

.disabled-card {
    opacity: 0.8;
}

.flash-wrapper {
    margin-bottom: 14px;
}

.flash {
    padding: 12px 14px;
    margin-bottom: 10px;
}

.flash-success {
    background: var(--flash-success-bg);
    border-color: var(--flash-success-border);
}

.flash-error {
    background: var(--flash-error-bg);
    border-color: var(--flash-error-border);
}

.flash-warning {
    background: #fef3c7;
    border-color: #f59e0b;
}

.booking-status {
    display: inline-block;
    padding: 0.25rem 0.55rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    font-weight: 700;
    white-space: nowrap;
}

.booking-status-success {
    color: #166534;
    background: var(--flash-success-bg);
    border-color: var(--flash-success-border);
}

.booking-status-error {
    color: #991b1b;
    background: var(--flash-error-bg);
    border-color: var(--flash-error-border);
}

.booking-history-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin: 1.5rem 0 0;
}

.booking-history-facts div {
    min-width: 0;
}

.booking-history-facts dt {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.booking-history-facts dd {
    margin: 0.2rem 0 0;
}

.booking-history-log ol {
    margin: 1rem 0 0;
    padding-left: 1.4rem;
}

.booking-history-log li {
    padding: 0 0 1rem 0.5rem;
}

.booking-history-log li > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
}

.booking-history-log time {
    color: var(--muted);
}

.booking-history-log p {
    margin: 0.35rem 0 0;
}

@media (max-width: 700px) {
    .booking-history-table-wrap {
        overflow: visible;
    }

    .booking-history-table,
    .booking-history-table tbody,
    .booking-history-table tr,
    .booking-history-table td {
        display: block;
        width: 100%;
    }

    .booking-history-table thead {
        display: none;
    }

    .booking-history-table tr {
        padding: 0.75rem;
        border: 1px solid var(--border);
        border-radius: 6px;
        margin-bottom: 0.75rem;
        background: #fff;
    }

    .booking-history-table td {
        display: grid;
        grid-template-columns: minmax(6.5rem, 0.4fr) minmax(0, 1fr);
        gap: 0.75rem;
        padding: 0.35rem 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .booking-history-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 700;
    }

    .booking-history-facts {
        grid-template-columns: 1fr;
    }
}

.checkbox-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.checkbox-line input {
    width: auto;
}

.notification-player-filter {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin: 12px 0;
}

.notification-player-filter legend {
    padding: 0 6px;
    font-weight: 700;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 4px 12px;
    margin-top: 8px;
}

label {
    display: block;
    margin: 10px 0 6px;
    font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
select,
input[type="file"] {
    width: 100%;
    padding: 10px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
}

th, td {
    border: 1px solid var(--border);
    padding: 8px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #eef2f7;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.button-row.compact {
    margin-top: 0;
}

.button {
    display: inline-block;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
}

.button:hover {
    background: var(--primary-dark);
}

.button.secondary {
    background: #475569;
}

.golfbox-chat-shell {
    display: grid;
    gap: 12px;
    min-height: calc(100vh - 170px);
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.golfbox-connection-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.golfbox-connection-card span,
.golfbox-connection-card a {
    color: var(--muted);
    font-size: 0.92rem;
}

.golfbox-scheduled-card {
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.golfbox-scheduled-card h3 {
    margin: 0 0 10px;
}

.golfbox-scheduled-card p {
    margin: 0;
}

.golfbox-chat-log {
    display: grid;
    align-content: end;
    gap: 12px;
    min-height: 0;
    padding-bottom: 4px;
}

.chat-message {
    display: flex;
}

.assistant-message {
    justify-content: flex-start;
}

.user-message {
    justify-content: flex-end;
}

.chat-bubble {
    width: min(100%, 840px);
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
}

.user-message .chat-bubble {
    width: min(100%, 720px);
    background: #e0f2f1;
    border-color: #99f6e4;
}

.chat-bubble p:first-child {
    margin-top: 0;
}

.chat-bubble p:last-child {
    margin-bottom: 0;
}

.interpretation-method {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    align-items: baseline;
    margin-bottom: 8px;
    color: var(--muted);
    font-size: 0.82rem;
}

.interpretation-method span {
    font-weight: 700;
    color: var(--text);
}

.interpretation-method small {
    font-size: inherit;
}

.golfbox-chat-form {
    position: sticky;
    bottom: 0;
    z-index: 5;
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    box-shadow: 0 -8px 18px rgba(15, 23, 42, 0.08);
}

.golfbox-chat-form textarea {
    width: 100%;
    min-height: clamp(92px, 18vh, 170px);
    max-height: min(42vh, 320px);
    resize: vertical;
}

.button.secondary:hover {
    background: #334155;
}

.button.danger {
    background: var(--danger);
}

.button.danger:hover {
    background: var(--danger-dark);
}

.button.warning {
    background: #b45309;
}

.button.warning:hover {
    background: #92400e;
}

.database-switch-form {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.database-switch-label {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
}

.inline-form {
    display: inline;
    margin: 0;
}

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.membership-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0 12px;
}

.membership-list span {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.88rem;
}

.player-slots {
    display: grid;
    gap: 16px;
}

.player-slot {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px;
}

.player-slot label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.player-select {
    width: 100%;
    margin-bottom: 8px;
}

.stats-toggle {
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-bottom: 0;
    color: var(--text);
}

.stats-toggle input {
    width: auto;
    margin: 0;
}

.new-player-fields,
.existing-player-fields {
    display: grid;
    gap: 8px;
    grid-template-columns: 1fr 80px 120px 130px;
    align-items: center;
}

.new-player-name {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .new-player-fields,
    .existing-player-fields {
        grid-template-columns: 1fr;
    }

    .new-player-name {
        grid-column: auto;
    }
}

.muted {
    color: var(--muted);
    font-size: 0.88rem;
}

.received-strokes-display {
    font-weight: 600;
    white-space: nowrap;
}

.table-wrap {
    overflow-x: auto;
    margin-top: 12px;
    margin-bottom: 12px;
    -webkit-overflow-scrolling: touch;
}

.course-hole-table .course-par-input {
    width: 68px;
    min-width: 68px;
}

.course-import-summary {
    width: auto;
    min-width: min(100%, 520px);
}

.course-import-summary th,
.course-import-summary td {
    white-space: nowrap;
}

.compact-table-wrap {
    max-height: calc(100vh - 230px);
    overflow: auto;
    border: 1px solid var(--border);
    background: var(--card);
}

.score-table input[type="number"] {
    min-width: 56px;
}

.score-table thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #eef2f7;
}

.compact-score-table {
    table-layout: auto;
    min-width: 100%;
}

.compact-score-table th,
.compact-score-table td {
    padding: 6px 4px;
    text-align: center;
}

.compact-score-table .meta-col {
    min-width: 42px;
    width: 42px;
}

.compact-score-table .tee-length-col {
    min-width: 64px;
    width: 64px;
}

.compact-score-table .player-col {
    min-width: 92px;
    width: 92px;
}

.compact-score-table .sticky-col {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #eef2f7;
}

.compact-score-table thead .sticky-col {
    z-index: 5;
}

.compact-score-table tbody .sticky-col {
    background: #fff;
}

.compact-score-table .player-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
}

.compact-score-table .player-name {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.1;
}

.score-cell {
    min-width: 82px;
    position: relative;
    text-align: center;
}

.hole-received-strokes {
    position: absolute;
    top: 50%;
    left: 6px;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #075985;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
}

.tee-length-cell {
    min-width: 64px;
    font-size: 0.76rem;
    color: var(--muted);
    white-space: nowrap;
}

.compact-score-input {
    display: block;
    width: 54px !important;
    min-width: 54px !important;
    margin: 0 auto;
    padding: 6px 4px !important;
    text-align: center;
    font-size: 16px;
}

.compact-score-input.score-birdie {
    color: #047857;
    -webkit-text-fill-color: #047857;
    font-weight: 700;
}

.compact-score-input.score-bogey {
    color: #b91c1c;
    -webkit-text-fill-color: #b91c1c;
    font-weight: 700;
}

.score-stat-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin-top: 5px;
}

.score-stat-fields .stat-input,
.score-stat-fields .stat-select {
    width: 100%;
    min-width: 0;
    padding: 4px 3px;
    border-radius: 6px;
    font-size: 0.72rem;
    text-align: center;
}

.score-stat-fields .stat-select {
    grid-column: 1 / -1;
}

.score-stat-fields .score-last-putt-selects {
    grid-column: 1 / -1;
}

.score-stat-fields .score-last-putt-selects .stat-select {
    grid-column: auto;
}

.score-green-directions {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, minmax(24px, 1fr));
    gap: 3px;
    width: 100%;
}

.score-green-directions label {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
    min-height: 26px;
    margin: 0;
    padding: 0 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 700;
}

.score-green-directions input {
    width: auto;
    margin: 0 1px 0 0;
}

.summary-row td {
    background: #f8fafc;
    font-weight: 700;
}

.nine-summary-row td {
    border-top: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
    background: #eefcf9;
}

.back-nine-start td {
    border-top: 2px solid var(--border);
}

.leaderboard-card {
    margin-bottom: 20px;
}

.leaderboard-table td strong {
    font-size: 1rem;
}

.leaderboard-player-link {
    color: var(--text);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.leaderboard-player-link:hover {
    color: var(--primary);
}

.leaderboard-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    z-index: 9999;
}

.leaderboard-modal-overlay.hidden {
    display: none;
}

.leaderboard-modal {
    width: min(920px, 100%);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18);
}

.leaderboard-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2;
}

.leaderboard-modal-close {
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

.leaderboard-modal-body {
    padding: 14px;
}

.leaderboard-modal-summary {
    margin-bottom: 12px;
}

.leaderboard-modal-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
}

.leaderboard-summary-block {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px 14px;
    margin: 12px 0;
}

.leaderboard-summary-block h4 {
    margin: 0 0 10px;
    font-size: 0.95rem;
}

.leaderboard-summary-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-summary-table th,
.leaderboard-summary-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
    text-align: center;
}

.leaderboard-summary-table th {
    background: #eef2f7;
    font-weight: 700;
}

.leaderboard-summary-table th:first-child {
    text-align: left;
}

.leaderboard-summary-table td strong {
    color: var(--text);
}

@media (max-width: 600px) {
    .leaderboard-summary-table th,
    .leaderboard-summary-table td {
        padding: 6px 8px;
        font-size: 0.88rem;
    }
}

.leaderboard-hole-grid {
    width: max-content;
    min-width: 100%;
    table-layout: fixed;
}

.leaderboard-hole-grid th,
.leaderboard-hole-grid td {
    text-align: center;
    width: 52px;
    min-width: 52px;
    max-width: 52px;
    white-space: nowrap;
}

.leaderboard-hole-grid th:first-child,
.leaderboard-hole-grid td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #eef2f7;
    width: 72px;
    min-width: 72px;
    max-width: 72px;
}

.leaderboard-hole-grid tbody td:first-child {
    background: #f8fafc;
    font-weight: 700;
}

.leaderboard-hole-grid .summary-cell {
    background: #eefcf9;
    font-weight: 700;
    width: 56px;
    min-width: 56px;
    max-width: 56px;
}

.score-shape {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--score-shape-size, 34px);
    min-width: var(--score-shape-size, 34px);
    height: var(--score-shape-size, 34px);
    min-height: var(--score-shape-size, 34px);
    padding: 0;
    font-weight: 700;
    color: var(--text);
    position: relative;
    background: #fff;
    line-height: 1;
}

.score-shape.plain {
    border: none;
}

.score-shape.circle {
    color: #047857;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.score-shape.double-circle {
    color: #047857;
    border: 2px solid currentColor;
    border-radius: 999px;
}

.score-shape.double-circle::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid currentColor;
    border-radius: 999px;
    pointer-events: none;
}

.score-shape.square {
    color: #b91c1c;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.score-shape.double-square {
    color: #b91c1c;
    border: 2px solid currentColor;
    border-radius: 2px;
}

.score-shape.double-square::after {
    content: "";
    position: absolute;
    inset: 4px;
    border: 2px solid currentColor;
    border-radius: 2px;
    pointer-events: none;
}

.mobile-stack-table th,
.mobile-stack-table td {
    padding: 8px 6px;
}

@media (max-width: 900px) {
    .player-select-item {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .container {
        padding: 10px;
    }

    .site-header h1 {
        font-size: 1.05rem;
    }

    nav {
        gap: 6px;
    }

    nav a {
        font-size: 0.88rem;
    }

    .balletour-header .container {
        grid-template-columns: auto minmax(0, 1fr);
        gap: 6px;
    }

    .balletour-header .site-logo {
        height: 42px;
    }

    .balletour-header .balletour-logo {
        width: 96px;
    }

    .balletour-header nav {
        gap: 4px 7px;
        justify-content: flex-end;
    }

    .balletour-header nav a {
        font-size: 0.78rem;
    }

    .form-card {
        padding: 10px;
    }

    .course-hole-table .course-par-input {
        width: 72px;
        min-width: 72px;
        padding-left: 8px;
        padding-right: 8px;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .button {
        padding: 10px 10px;
        font-size: 0.9rem;
    }

    .chat-bubble,
    .user-message .chat-bubble {
        width: 100%;
    }

    .golfbox-chat-form textarea {
        min-height: 88px;
        max-height: 34vh;
    }

    .hole-entry-top {
        gap: 6px;
        margin-bottom: 6px;
    }

    .hole-entry-top h2 {
        font-size: 1.05rem;
    }

    .hole-info-strip div {
        padding: 6px 4px;
    }

    .hole-player-list {
        gap: 5px;
    }

    .hole-player-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 6px;
        padding: 6px;
    }

    .hole-player-row.with-stats {
        grid-template-columns: minmax(0, 1fr);
    }

    .hole-player-row.with-club {
        grid-template-columns: minmax(0, 1fr);
    }

    .score-final-field select,
    .club-mini-field select,
    .hole-stat-grid input,
    .hole-stat-grid select {
        padding: 6px 4px;
        font-size: 0.86rem;
    }

    .hole-nav {
        margin-top: 8px;
    }

    .hole-history-table-wrap {
        overflow-x: visible;
    }

    .hole-history-table thead {
        display: none;
    }

    .hole-history-table,
    .hole-history-table tbody {
        display: block;
        width: 100%;
    }

    .hole-history-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px 14px;
        width: 100%;
        margin-bottom: 10px;
        padding: 12px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: #f8fafc;
    }

    .hole-history-table td {
        display: flex;
        min-width: 0;
        flex-direction: column;
        gap: 2px;
        padding: 0;
        border: 0;
        overflow-wrap: anywhere;
    }

    .hole-history-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
    }

    .hole-history-table .hole-history-result {
        grid-column: 1 / -1;
        padding: 8px 0;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
    }

    .compact-score-table .meta-col {
        min-width: 38px;
        width: 38px;
    }

    .compact-score-table .tee-length-col {
        min-width: 58px;
        width: 58px;
    }

    .compact-score-table .player-col {
        min-width: 78px;
        width: 78px;
    }

    .compact-table-wrap {
        max-height: calc(100vh - 190px);
    }

    .compact-score-input {
        width: 48px !important;
        min-width: 48px !important;
        padding: 5px 3px !important;
    }

    .tee-length-cell {
        font-size: 0.7rem;
    }

    .leaderboard-modal {
        width: 100%;
        max-height: 92vh;
        border-radius: 14px;
    }

    .leaderboard-hole-grid th,
    .leaderboard-hole-grid td {
        width: 32px;
        min-width: 32px;
        max-width: 32px;
        font-size: 0.75rem;
        padding: 4px 2px;
    }

    .leaderboard-hole-grid th:first-child,
    .leaderboard-hole-grid td:first-child {
        width: 56px;
        min-width: 56px;
        max-width: 56px;
    }

    .score-shape {
        --score-shape-size: 28px;
        font-size: 0.9rem;
    }

    .round-summary-heading,
    .section-heading,
    .round-player-statistics-header {
        align-items: flex-start;
    }

    .round-summary-heading,
    .section-heading {
        display: block;
    }

    .round-summary-heading .button-row {
        margin-top: 12px;
    }

    .round-summary-card,
    .round-statistics-section {
        padding: 12px;
    }

    .round-timing {
        justify-content: flex-start;
        margin-top: 8px;
    }

    .round-summary-scorecard {
        min-width: 0;
        font-size: 0.72rem;
    }

    .round-summary-scorecard th,
    .round-summary-scorecard td {
        padding: 6px 1px;
    }

    .round-summary-scorecard th:first-child {
        width: 78px;
        padding-left: 4px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .round-summary-scorecard .score-shape {
        --score-shape-size: 24px;
        font-size: 0.78rem;
    }

    .round-summary-scorecard .tee-row {
        font-size: 0.66rem;
    }

    .round-summary-scorecard .player-score-row th small {
        font-size: 0.62rem;
    }

    .round-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .round-stat-details {
        grid-template-columns: 1fr;
    }

    .round-hole-stat-table thead {
        display: none;
    }

    .round-hole-stat-table,
    .round-hole-stat-table tbody,
    .round-hole-stat-table tr,
    .round-hole-stat-table td {
        display: block;
        width: 100%;
    }

    .round-hole-stat-table tr {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px 12px;
        border: 1px solid var(--border);
        border-radius: 6px;
        background: #f8fafc;
        padding: 10px;
        margin-bottom: 8px;
    }

    .round-hole-stat-table td {
        border: none;
        padding: 0;
        overflow-wrap: anywhere;
    }

    .round-hole-stat-table td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: 0.68rem;
        font-weight: 700;
        text-transform: uppercase;
        margin-bottom: 2px;
    }

    .round-hole-stat-table td[data-label="Treff"] {
        grid-column: 1 / -1;
        border-top: 1px solid var(--border);
        border-bottom: 1px solid var(--border);
        padding: 8px 0;
    }

    .round-summary-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .mobile-stack-table thead {
        display: none;
    }

    .mobile-stack-table,
    .mobile-stack-table tbody,
    .mobile-stack-table tr,
    .mobile-stack-table td {
        display: block;
        width: 100%;
    }

    .mobile-stack-table tr {
        margin-bottom: 10px;
        border: 1px solid var(--border);
        border-radius: 10px;
        background: #f8fafc;
        padding: 8px;
    }

    .mobile-stack-table td {
        border: none;
        padding: 4px 0;
    }

    .balletour-stats-layout {
        grid-template-columns: 1fr;
    }

    .green-map {
        max-width: 100%;
    }
}
