/* TW4 Golf Management System Styles */

/* ==========================================================================
   Twilight Golf Scoring - Global UI Theme Variables
   ========================================================================== */
:root {
    --color-bg-main: #f0fdf4;
    --color-surface: #ffffff;
    --color-text-primary: #064e3b;
    --color-accent-mint: #34d399;
    --color-accent-gold: #f59e0b;
    --color-muted: #6b7280;

    --font-primary: 'Quicksand', 'Inter', system-ui, -apple-system, sans-serif;
    --radius-pill: 9999px;
    --radius-card: 16px;
    --max-width-site: 640px;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    padding-top: 50px;
}

.card {
    border: none;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.card-header {
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}

.d-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.card {
    min-height: 200px;
}

.card i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.btn {
    border-radius: 25px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.text-primary { color: #007bff !important; }
.text-success { color: #28a745 !important; }
.text-warning { color: #ffc107 !important; }
.text-info { color: #17a2b8 !important; }

.bg-primary { background-color: #007bff !important; }
.bg-success { background-color: #28a745 !important; }
.bg-warning { background-color: #ffc107 !important; }
.bg-info { background-color: #17a2b8 !important; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .d-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding-top: 20px;
    }
    
    .card {
        min-height: 150px;
    }
    
    .card i {
        font-size: 2rem;
    }
}

/* Under construction page (scoped) */
body.page-under-construction {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.uc-layout {
    margin: 0 auto;
    max-width: var(--max-width-site);
}

.uc-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.uc-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.uc-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.uc-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.uc-card-body {
    padding: 22px;
    text-align: center;
}

.section-title-wrap {
    margin-bottom: 16px;
}

.section-title-wrap h2 {
    font-size: 1.3rem;
    margin: 0 0 6px 0;
}

.section-title-accent {
    width: 60px;
    height: 4px;
    margin: 0 auto;
    background-color: var(--color-accent-mint);
    border-radius: var(--radius-pill);
}

.uc-intro {
    color: var(--color-muted);
    margin-bottom: 8px;
}

.uc-status {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    padding: 14px;
    text-align: left;
}

.uc-status strong {
    color: var(--color-text-primary);
}

.btn-primary-pill {
    background-color: var(--color-text-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    font-weight: 700;
    padding: 12px 24px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-primary-pill:hover,
.btn-primary-pill:focus {
    background-color: #065f46;
    color: #ffffff;
}

.uc-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

/* Welcome page (scoped) */
body.page-welcome {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.welcome-layout {
    margin: 0 auto;
    max-width: var(--max-width-site);
}

.welcome-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.welcome-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.welcome-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.welcome-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.1rem;
    font-weight: 700;
}

.welcome-card-body {
    padding: 22px;
}

.welcome-intro {
    color: var(--color-muted);
    margin-bottom: 18px;
    text-align: center;
}

.welcome-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

.welcome-panel {
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-card);
    padding: 16px;
    text-align: center;
}

.welcome-panel h3 {
    font-size: 1.05rem;
    margin: 0 0 8px 0;
}

.welcome-panel p {
    color: var(--color-muted);
    margin: 0 0 12px 0;
}

.welcome-panel-action {
    padding: 14px 16px;
}

.welcome-tooltip-wrap {
    display: inline-block;
    position: relative;
}

.welcome-tooltip {
    background: var(--color-text-primary);
    border-radius: 6px;
    bottom: calc(100% + 9px);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    left: 50%;
    line-height: 1.35;
    max-width: min(280px, calc(100vw - 48px));
    opacity: 0;
    padding: 8px 10px;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, 4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    visibility: hidden;
    width: max-content;
    z-index: 5;
}

.welcome-tooltip::after {
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--color-text-primary);
    content: '';
    left: 50%;
    position: absolute;
    top: 100%;
    transform: translateX(-50%);
}

.welcome-tooltip-wrap:hover .welcome-tooltip,
.welcome-tooltip-wrap:focus-within .welcome-tooltip {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

.welcome-user {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    font-size: 0.95rem;
    margin: 0 0 12px 0;
    padding: 10px;
}

.welcome-actions {
    display: grid;
    gap: 10px;
}

.btn-primary-pill,
.btn-secondary-pill,
.btn-accent-pill,
.btn-gold-pill,
.btn-disabled-pill {
    border: none;
    border-radius: var(--radius-pill);
    color: #ffffff;
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    font-weight: 700;
    padding: 12px 24px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-secondary-pill {
    background-color: #4b5563;
}

.btn-secondary-pill:hover,
.btn-secondary-pill:focus {
    background-color: #374151;
    color: #ffffff;
}

.btn-accent-pill {
    background-color: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.btn-accent-pill:hover,
.btn-accent-pill:focus {
    background-color: #2bbd84;
    color: var(--color-text-primary);
}

.btn-gold-pill {
    background-color: var(--color-accent-gold);
    color: #1f2937;
}

.btn-gold-pill:hover,
.btn-gold-pill:focus {
    background-color: #d97706;
    color: #1f2937;
}

.btn-disabled-pill {
    background-color: #9ca3af;
    color: #f9fafb;
    cursor: not-allowed;
    opacity: 0.9;
    pointer-events: none;
}

.welcome-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

/* System configuration page (scoped) */
body.page-config {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.config-layout {
    margin: 0 auto;
    max-width: 1040px;
}

.config-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.config-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.config-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.config-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.config-card-body {
    padding: 22px;
}

.config-intro {
    color: var(--color-muted);
    margin-bottom: 14px;
    text-align: center;
}

.config-session {
    align-items: center;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    padding: 10px 14px;
    text-align: center;
}

.config-alert {
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.config-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #166534;
}

.config-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.config-table-wrap {
    overflow-x: auto;
}

.config-table {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 780px;
    width: 100%;
}

.config-table th,
.config-table td {
    border-bottom: 1px solid #d1fae5;
    padding: 12px;
    vertical-align: top;
}

.config-table th {
    background: #f0fdf4;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.config-badge {
    border-radius: 999px;
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 8px;
    padding: 4px 9px;
}

.config-badge-critical {
    background: #fef3c7;
    color: #92400e;
}

.config-badge-int {
    background: #dbeafe;
    color: #1e3a8a;
    margin-left: 0;
}

.config-badge-string {
    background: #dcfce7;
    color: #166534;
    margin-left: 0;
}

.config-input {
    border: 2px solid #d1fae5;
    border-radius: 12px;
    box-sizing: border-box;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 10px 11px;
    width: 100%;
}

.config-input:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    outline: none;
}

.config-help {
    color: var(--color-muted);
    font-size: 0.82rem;
    margin-top: 5px;
}

.config-error-inline {
    color: #991b1b;
    font-size: 0.82rem;
    margin-top: 5px;
}

.config-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.config-notes {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    margin-top: 20px;
    padding: 14px 16px;
}

.config-notes h3 {
    font-size: 1rem;
    margin: 0 0 8px 0;
}

.config-notes ul {
    margin: 0;
    padding-left: 18px;
}

.config-notes li {
    margin-bottom: 5px;
}

.config-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

/* Course club management page (scoped) */
body.page-course-club {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.course-club-layout,
.course-played-layout {
    margin: 0 auto;
    max-width: 1080px;
}

.course-club-header,
.course-played-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.course-club-header h1,
.course-played-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.course-club-card,
.course-played-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.course-club-card-title,
.course-played-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.course-club-card-body,
.course-played-card-body {
    padding: 22px;
}

.course-club-intro,
.course-played-intro {
    color: var(--color-muted);
    margin-bottom: 14px;
    text-align: center;
}

.course-club-session,
.course-played-session {
    align-items: center;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
    padding: 10px 14px;
    text-align: center;
}

.course-club-toolbar,
.course-played-toolbar {
    display: flex;
    justify-content: center;
    margin-bottom: 14px;
}

.course-club-toolbar-bottom,
.course-played-toolbar-bottom {
    margin-bottom: 0;
    margin-top: 18px;
}

.course-club-alert,
.course-played-alert {
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.course-club-alert-success,
.course-played-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #166534;
}

.course-club-alert-error,
.course-played-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.course-club-alert-info {
    background: #ecfeff;
    border: 2px solid #a5f3fc;
    color: #0e7490;
}

body.page-course-club .form-select,
body.page-course-club .form-control {
    border: 2px solid #d1fae5;
}

body.page-course-club .form-select:focus,
body.page-course-club .form-control:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.tw-table-wrap .table {
    margin-bottom: 0;
}

.tw-table-wrap .table thead th {
    background: #064e3b;
    color: #ffffff;
}

.course-club-empty,
.course-played-empty {
    background: #f8fffb;
    border: 1px solid #d1fae5;
    border-radius: 14px;
}

.course-club-footer,
.course-played-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

/* Course played management page (scoped) */
body.page-course-played {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

body.page-course-played .table tbody td {
    vertical-align: middle;
}

/* Shared management/form pages (scoped) */
body.page-course-club-form,
body.page-course-played-form,
body.page-roster,
body.page-roster-form,
body.page-roster-show,
body.page-staff,
body.page-staff-form,
body.page-scoring-state,
body.page-logs {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
}

body.page-course-club-form .card,
body.page-course-played-form .card,
body.page-roster .card,
body.page-roster-form .card,
body.page-roster-show .card,
body.page-staff .card,
body.page-staff-form .card,
body.page-scoring-state .card,
body.page-logs .card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

body.page-course-club-form .card-header,
body.page-course-played-form .card-header,
body.page-roster .card-header,
body.page-roster-form .card-header,
body.page-roster-show .card-header,
body.page-staff .card-header,
body.page-staff-form .card-header,
body.page-scoring-state .card-header,
body.page-logs .card-header {
    background: var(--color-text-primary) !important;
    color: #ffffff !important;
}

body.page-course-club-form .form-control,
body.page-course-club-form .form-select,
body.page-course-played-form .form-control,
body.page-course-played-form .form-select,
body.page-roster .form-control,
body.page-roster .form-select,
body.page-roster-form .form-control,
body.page-roster-form .form-select,
body.page-roster-show .form-control,
body.page-roster-show .form-select,
body.page-staff .form-control,
body.page-staff .form-select,
body.page-staff-form .form-control,
body.page-staff-form .form-select,
body.page-logs .form-control,
body.page-logs .form-select {
    border: 2px solid #d1fae5;
}

body.page-course-club-form .form-control:focus,
body.page-course-club-form .form-select:focus,
body.page-course-played-form .form-control:focus,
body.page-course-played-form .form-select:focus,
body.page-roster .form-control:focus,
body.page-roster .form-select:focus,
body.page-roster-form .form-control:focus,
body.page-roster-form .form-select:focus,
body.page-roster-show .form-control:focus,
body.page-roster-show .form-select:focus,
body.page-staff .form-control:focus,
body.page-staff .form-select:focus,
body.page-staff-form .form-control:focus,
body.page-staff-form .form-select:focus,
body.page-logs .form-control:focus,
body.page-logs .form-select:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

body.page-course-club-form .alert,
body.page-course-played-form .alert,
body.page-roster .alert,
body.page-roster-form .alert,
body.page-roster-show .alert,
body.page-staff .alert,
body.page-staff-form .alert,
body.page-scoring-state .alert,
body.page-logs .alert {
    border-radius: 14px;
}

body.page-course-club-form .table thead th,
body.page-course-played-form .table thead th,
body.page-roster .table thead th,
body.page-roster-show .table thead th,
body.page-staff .table thead th,
body.page-logs .table thead th {
    background: #064e3b;
    color: #ffffff;
}

body.page-course-club-form .btn-danger,
body.page-course-played-form .btn-danger,
body.page-roster .btn-danger,
body.page-roster-form .btn-danger,
body.page-roster-show .btn-danger,
body.page-staff .btn-danger,
body.page-staff-form .btn-danger,
body.page-scoring-state .btn-danger,
body.page-logs .btn-danger {
    background: #b91c1c;
    border-color: #b91c1c;
}

body.page-course-club-form .btn-primary,
body.page-course-played-form .btn-primary,
body.page-roster .btn-primary,
body.page-roster-form .btn-primary,
body.page-roster-show .btn-primary,
body.page-staff .btn-primary,
body.page-staff-form .btn-primary,
body.page-scoring-state .btn-primary,
body.page-logs .btn-primary {
    background: #0f766e;
    border-color: #0f766e;
}

body.page-course-club-form .btn-secondary,
body.page-course-played-form .btn-secondary,
body.page-roster .btn-secondary,
body.page-roster-form .btn-secondary,
body.page-roster-show .btn-secondary,
body.page-staff .btn-secondary,
body.page-staff-form .btn-secondary,
body.page-scoring-state .btn-secondary,
body.page-logs .btn-secondary {
    background: #4b5563;
    border-color: #4b5563;
}

.logs-layout,
.roster-layout,
.staff-layout,
.scoring-state-layout {
    margin: 0 auto;
    max-width: 1100px;
    padding: 16px;
}

.logs-header,
.roster-header,
.staff-header,
.scoring-state-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.logs-header h1,
.roster-header h1,
.staff-header h1,
.scoring-state-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.logs-card,
.roster-card,
.staff-card,
.scoring-state-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.logs-card-title,
.roster-card-title,
.staff-card-title,
.scoring-state-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.logs-card-body,
.roster-card-body,
.staff-card-body,
.scoring-state-card-body {
    padding: 22px;
}

.logs-session,
.roster-session,
.staff-session,
.scoring-state-session {
    align-items: center;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 14px;
    padding: 10px 14px;
    text-align: center;
}

.logs-toolbar,
.roster-toolbar,
.staff-toolbar,
.scoring-state-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 14px;
}

.logs-toolbar-bottom,
.roster-toolbar-bottom,
.staff-toolbar-bottom,
.scoring-state-toolbar-bottom {
    margin-bottom: 0;
    margin-top: 18px;
}

.logs-summary {
    background: #ecfeff;
    border: 2px solid #a5f3fc;
    border-radius: 14px;
    color: #0e7490;
    margin-bottom: 14px;
    padding: 10px 14px;
}

.roster-alert,
.staff-alert,
.scoring-state-alert {
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.roster-alert-success,
.staff-alert-success,
.scoring-state-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #166534;
}

.roster-alert-error,
.staff-alert-error,
.scoring-state-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.logs-empty,
.roster-empty,
.staff-empty {
    background: #f8fffb;
    border: 1px solid #d1fae5;
    border-radius: 14px;
}

.scoring-state-panel {
    background: #f8fffb;
    border: 1px solid #bbf7d0;
    border-radius: 14px;
    padding: 14px 16px;
}

.scoring-state-panel h3 {
    font-size: 1rem;
    margin: 0 0 10px 0;
}

.scoring-state-panel p {
    margin-bottom: 10px;
}

.scoring-state-panel .btn {
    font-weight: 700;
    padding-left: 14px;
    padding-right: 14px;
}

.scoring-state-panel-danger {
    border-color: #fecaca;
}

.logs-footer,
.roster-footer,
.staff-footer,
.scoring-state-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

.staff-form-layout {
    margin: 0 auto;
    max-width: 860px;
    padding: 16px;
}

.roster-form-layout {
    margin: 0 auto;
    max-width: 860px;
    padding: 16px;
}

.staff-form-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.roster-form-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.staff-form-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.roster-form-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.staff-form-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.roster-form-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.staff-form-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.roster-form-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.staff-form-card-body {
    padding: 22px;
}

.roster-form-card-body {
    padding: 22px;
}

.staff-form-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

.roster-form-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

.roster-form-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
}

.roster-detail-table td:first-child {
    width: 44%;
}

@media (max-width: 768px) {
    .course-club-toolbar a,
    .course-played-toolbar a {
        width: 100%;
        text-align: center;
    }

    .logs-toolbar a,
    .roster-toolbar a,
    .staff-toolbar a,
    .scoring-state-toolbar a {
        width: 100%;
        text-align: center;
    }

    .roster-form-actions {
        flex-direction: column;
    }

    .roster-form-actions > * {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .config-actions > * {
        width: 100%;
    }
}

/* Staff login page (scoped) */
body.page-login {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.login-layout {
    margin: 0 auto;
    max-width: 520px;
}

.login-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.login-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.login-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.login-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.login-card-body {
    padding: 22px;
}

.login-intro {
    color: var(--color-muted);
    margin-bottom: 18px;
    text-align: center;
}

.tw-form-group {
    margin-bottom: 14px;
}

.tw-form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.tw-form-input {
    border: 2px solid #d1fae5;
    border-radius: var(--radius-card);
    box-sizing: border-box;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 12px;
    width: 100%;
}

.tw-form-input:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    outline: none;
}

.login-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 14px;
    color: #991b1b;
    margin-top: 16px;
    padding: 12px 14px;
}

.login-error p {
    margin: 0 0 6px 0;
}

.login-error p:last-child {
    margin-bottom: 0;
}

.login-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.page-login .btn-primary-pill {
    background-color: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.page-login .btn-primary-pill:hover,
.page-login .btn-primary-pill:focus {
    background-color: #2bbd84;
    color: var(--color-text-primary);
}

.page-login .btn-secondary-pill {
    background-color: var(--color-accent-gold);
    color: #1f2937;
}

.page-login .btn-secondary-pill:hover,
.page-login .btn-secondary-pill:focus {
    background-color: #d97706;
    color: #1f2937;
}

.login-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

/* Leaderboard page (scoped) */
body.page-leaderboard {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.leaderboard-layout {
    margin: 0 auto;
    max-width: 1040px;
}

.leaderboard-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.leaderboard-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.leaderboard-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.leaderboard-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.leaderboard-card-body {
    padding: 22px;
}

.leaderboard-status {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.status-chip {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: var(--radius-pill);
    color: var(--color-text-primary);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
}

.leaderboard-alert {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.leaderboard-alert-info {
    background: #eff6ff;
    border: 2px solid #bfdbfe;
    color: #1e3a8a;
}

.leaderboard-alert-secondary {
    background: #f9fafb;
    border: 2px solid #d1d5db;
    color: #374151;
}

.leaderboard-alert a {
    color: inherit;
    font-weight: 700;
}

.leaderboard-table-wrap {
    border: 1px solid #d1fae5;
    border-radius: 14px;
    overflow: hidden;
}

.leaderboard-table {
    margin-bottom: 0;
}

.leaderboard-table th,
.leaderboard-table td {
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.leaderboard-table thead th {
    background: #ecfdf5;
    border-bottom: 1px solid #d1fae5;
    color: var(--color-text-primary);
    font-weight: 700;
}

.leaderboard-table tbody td {
    border-color: #d1fae5;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: #f8fffb;
}

.leaderboard-table .player-col {
    min-width: 180px;
    text-align: left;
    white-space: normal;
}

.leaderboard-empty {
    color: var(--color-muted);
    font-weight: 700;
    padding: 20px 12px;
}

.leaderboard-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
}

.leaderboard-note {
    color: var(--color-muted);
    font-size: 0.9rem;
    margin-top: 16px;
    text-align: center;
}

/* Player progress page (scoped) */
body.page-player-progress {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.player-progress-layout {
    margin: 0 auto;
    max-width: 1120px;
}

.player-progress-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.player-progress-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.player-progress-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.player-progress-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.player-progress-card-body {
    padding: 22px;
}

.player-progress-intro {
    color: var(--color-muted);
    margin: 0 0 16px 0;
    text-align: center;
}

.player-progress-panel {
    background: #f8fffb;
    border: 1px solid #d1fae5;
    border-radius: 18px;
    padding: 18px;
}

.player-progress-panel-controls {
    background: #ffffff;
}

.player-progress-panel-chart {
    background: #f8fffb;
}

.player-progress-controls {
    margin: 0 auto 16px auto;
    max-width: 640px;
}

.player-progress-control-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.player-progress-control-row-center {
    justify-content: center;
}

.player-progress-control-row .form-select {
    flex: 1 1 260px;
    border: 2px solid #d1fae5;
    border-radius: 12px;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 10px 11px;
}

.player-progress-control-row .form-select:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
}

.player-progress-summary {
    align-items: center;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
    justify-content: center;
    margin: 0 auto 16px auto;
    max-width: 940px;
    padding: 12px 16px;
    text-align: center;
}

.player-progress-summary strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
}

.player-progress-alert {
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 14px;
    color: #991b1b;
    margin: 0 auto 16px auto;
    max-width: 940px;
    padding: 12px 14px;
    text-align: center;
}

.player-progress-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    justify-content: center;
    margin-bottom: 16px;
}

.player-progress-legend-item {
    align-items: center;
    color: var(--color-text-primary);
    display: inline-flex;
    gap: 8px;
    font-size: 0.9rem;
}

.legend-swatch {
    background: #e5e7eb;
    border-radius: 999px;
    display: inline-block;
    height: 14px;
    width: 14px;
}

.legend-points {
    background: #2563eb;
    border-radius: 4px;
}

.legend-handicap-start {
    background: transparent;
    border: 2px solid #111827;
}

.legend-handicap-change {
    background: transparent;
    border: 2px solid #f59e0b;
}

.legend-handicap-base {
    background: transparent;
    border-radius: 0;
    border-top: 2px dashed #f59e0b;
    height: 0;
    margin-top: 6px;
    width: 16px;
}

.progress-chart-scroll {
    overflow-x: auto;
    padding-bottom: 8px;
}

.progress-chart {
    display: block;
    min-width: 780px;
}

.progress-grid {
    stroke: #d1fae5;
    stroke-dasharray: 4 4;
    stroke-width: 1;
}

.progress-base-line {
    stroke: #86efac;
    stroke-width: 2;
}

.progress-handicap-base-line {
    stroke: #f59e0b;
    stroke-dasharray: 6 4;
    stroke-width: 2;
}

.progress-handicap-base-label {
    fill: #b45309;
    font-size: 11px;
    font-weight: 700;
}

.progress-axis-label {
    fill: var(--color-muted);
    font-size: 11px;
}

.progress-bar {
    fill: #2563eb;
}

.progress-points-dot {
    fill: #2563eb;
    stroke: #f8fffb;
    stroke-width: 2;
}

.progress-points-dot-label {
    fill: #ffffff;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.progress-bar-label {
    fill: #ffffff;
    font-size: 12px;
    font-weight: 700;
    paint-order: stroke;
    stroke: #1e3a8a;
    stroke-width: 2.5px;
    text-anchor: middle;
}

.progress-round-label {
    fill: var(--color-text-primary);
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.progress-round-date {
    fill: var(--color-muted);
    font-size: 10px;
    text-anchor: middle;
}

.player-progress-subheading {
    color: var(--color-text-primary);
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-align: center;
}

.progress-handicap-circle {
    fill: #f8fffb;
    stroke-width: 1.5;
}

.progress-handicap-start {
    stroke: #111827;
}

.progress-handicap-change {
    stroke: #f59e0b;
}

.progress-handicap-trend-line {
    fill: none;
    opacity: 0.6;
    stroke: #111827;
    stroke-dasharray: 3 3;
    stroke-width: 1.5;
}

.progress-handicap-label {
    fill: #111827;
    font-size: 12px;
    font-weight: 700;
    paint-order: stroke;
    stroke: #ffffff;
    stroke-width: 3px;
    text-anchor: middle;
}

.progress-audit-points-circle {
    stroke-width: 1.2;
}

.progress-audit-points-label {
    font-size: 9px;
    stroke-width: 2px;
}

.progress-empty {
    background: #f8fffb;
    border: 1px dashed #bbf7d0;
    border-radius: 14px;
    color: var(--color-muted);
    padding: 24px;
    text-align: center;
}

.player-progress-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .player-progress-control-row {
        align-items: stretch;
        flex-direction: column;
    }

    .player-progress-control-row .btn-primary-pill {
        width: 100%;
    }
}

.leaderboard-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

/* ── Leaderboard player link ────────────────────────────────────────────── */
.leaderboard-player-link {
    color: var(--color-text-primary);
    text-decoration: underline dotted;
    text-underline-offset: 3px;
}

.leaderboard-player-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* ── Leaderboard card chart ─────────────────────────────────────────────── */
.card-chart-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.card-chart-summary {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    font-size: 0.9rem;
    gap: 18px;
    justify-content: center;
    padding: 10px 16px;
}

.card-chart-summary-sep {
    color: var(--color-muted);
    font-weight: 700;
}

.card-chart-legend {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.82rem;
    gap: 14px;
    justify-content: center;
}

.card-chart-legend-item {
    align-items: center;
    display: flex;
    gap: 6px;
}

.card-chart-swatch {
    border-radius: 3px;
    display: inline-block;
    height: 14px;
    width: 18px;
}

.card-chart-swatch-score  { background: #2563eb; }
.card-chart-swatch-shots  { background: #ec4899; border-radius: 50%; width: 14px; }
.card-chart-swatch-points { background: #16a34a; border-radius: 50%; width: 14px; }
.card-chart-swatch-par    { background: #e2e8f0; border: 1px solid #94a3b8; }

.card-chart-scroll {
    overflow-x: auto;
    padding-bottom: 4px;
}

.card-chart-svg {
    display: block;
    min-width: 560px;
}

/* SVG element classes */
.card-chart-grid {
    stroke: #d1fae5;
    stroke-width: 1;
}

.card-chart-base-line {
    stroke: #6b7280;
    stroke-width: 1.5;
}

.card-chart-par-block {
    fill: #e2e8f0;
    stroke: #94a3b8;
    stroke-width: 1;
}

.card-chart-shot-dot {
    fill: #ec4899;
    stroke: #ffffff;
    stroke-width: 1.5;
}

.card-chart-point-dot {
    fill: #16a34a;
    stroke: #ffffff;
    stroke-width: 1.5;
}

.card-chart-axis-label {
    fill: var(--color-muted);
    font-size: 11px;
    text-anchor: end;
}

.card-chart-block-label {
    dominant-baseline: middle;
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.card-chart-shot-label {
    fill: #5f1d35;
}

.card-chart-score-label {
    fill: #1e3a8a;
    font-size: 12px;
    font-weight: 700;
    text-anchor: middle;
}

.card-chart-hole-label {
    fill: var(--color-text-primary);
    font-size: 11px;
    font-weight: 700;
    text-anchor: middle;
}

.card-chart-par-label {
    fill: var(--color-muted);
    font-size: 10px;
    text-anchor: middle;
}

.card-chart-empty {
    background: #f8fffb;
    border: 1px dashed #bbf7d0;
    border-radius: 14px;
    color: var(--color-muted);
    padding: 24px;
    text-align: center;
}

.card-chart-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 8px;
}

/* Admin menu page (scoped) */
body.page-admin-menu {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 12px;
    line-height: 1.5;
}

.admin-layout {
    margin: 0 auto;
    max-width: 940px;
}

.admin-header {
    margin: 0 auto 16px auto;
    text-align: center;
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.admin-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.admin-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 11px 16px;
    font-size: 1.05rem;
    font-weight: 700;
}

.admin-card-body {
    padding: 16px;
}

.admin-intro {
    color: var(--color-muted);
    margin-bottom: 10px;
    text-align: center;
}

.admin-session {
    align-items: center;
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    border-radius: 14px;
    color: var(--color-text-primary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 12px;
    padding: 8px 12px;
    text-align: center;
}

.admin-alert {
    border-radius: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    padding: 8px 12px;
}

.admin-alert-success {
    background: #ecfdf5;
    border: 2px solid #34d399;
    color: #065f46;
}

.admin-alert-error {
    background: #fef2f2;
    border: 2px solid #ef4444;
    color: #991b1b;
}

.admin-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-panel {
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-card);
    padding: 12px;
    text-align: center;
}

.admin-panel h3 {
    font-size: 1rem;
    margin: 0 0 8px 0;
}

.admin-panel p {
    color: var(--color-muted);
    margin: 0 0 8px 0;
}

.admin-panel-action {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 62px;
}

.btn-admin-config,
.btn-admin-staff,
.btn-admin-course,
.btn-admin-played,
.btn-admin-logs,
.btn-admin-scoring {
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    font-weight: 700;
    padding: 8px 14px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-admin-config {
    background: #0f766e;
    color: #ffffff;
}

.btn-admin-config:hover,
.btn-admin-config:focus {
    background: #115e59;
    color: #ffffff;
}

.btn-admin-staff {
    background: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.btn-admin-staff:hover,
.btn-admin-staff:focus {
    background: #2bbd84;
    color: var(--color-text-primary);
}

.btn-admin-course {
    background: var(--color-accent-gold);
    color: #1f2937;
}

.btn-admin-course:hover,
.btn-admin-course:focus {
    background: #d97706;
    color: #1f2937;
}

.btn-admin-played {
    background: #2563eb;
    color: #ffffff;
}

.btn-admin-played:hover,
.btn-admin-played:focus {
    background: #1d4ed8;
    color: #ffffff;
}

.btn-admin-logs {
    background: #166534;
    color: #ffffff;
}

.btn-admin-logs:hover,
.btn-admin-logs:focus {
    background: #14532d;
    color: #ffffff;
}

.btn-admin-scoring {
    background: #4b5563;
    color: #ffffff;
}

.btn-admin-scoring:hover,
.btn-admin-scoring:focus {
    background: #374151;
    color: #ffffff;
}

.btn-action-primary,
.btn-action-destructive {
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    display: inline-block;
    font-family: inherit;
    font-weight: 700;
    padding: 10px 18px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-action-primary {
    background: #0f766e;
    color: #ffffff;
}

.btn-action-primary:hover,
.btn-action-primary:focus {
    background: #115e59;
    color: #ffffff;
}

.btn-action-destructive {
    background: #b91c1c;
    color: #ffffff;
}

.btn-action-destructive:hover,
.btn-action-destructive:focus {
    background: #991b1b;
    color: #ffffff;
}

.btn-action-primary.btn-sm,
.btn-action-destructive.btn-sm {
    font-size: 0.85rem;
    padding: 6px 12px;
}

.btn-compact {
    font-size: 0.85rem;
    line-height: 1;
    padding: 6px 12px;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.admin-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .admin-grid {
        grid-template-columns: 1fr;
    }

    .admin-actions a {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .leaderboard-actions {
        flex-direction: column;
    }

    .leaderboard-actions a {
        width: 100%;
    }
}

/* Scorer menu page (scoped) */
body.page-scorer-menu {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.scorer-layout {
    margin: 0 auto;
    max-width: 760px;
}

.scorer-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.scorer-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.scorer-card,
.scorer-panel {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.scorer-card-title,
.scorer-panel-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.scorer-card-body,
.scorer-panel-body {
    padding: 22px;
}

.scorer-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.btn-toolbar-main,
.btn-toolbar-roster,
.btn-toolbar-leader,
.btn-toolbar-results,
.btn-step-go,
.btn-step-disabled {
    border: none;
    border-radius: var(--radius-pill);
    display: inline-block;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 10px 18px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.btn-toolbar-main {
    background: #4b5563;
    color: #ffffff;
}

.btn-toolbar-main:hover,
.btn-toolbar-main:focus {
    background: #374151;
    color: #ffffff;
}

.btn-toolbar-roster {
    background: #d97706;
    color: #ffffff;
}

.btn-toolbar-roster:hover,
.btn-toolbar-roster:focus {
    background: #b45309;
    color: #ffffff;
}

.btn-toolbar-leader,
.btn-step-go {
    background: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.btn-toolbar-leader:hover,
.btn-toolbar-leader:focus,
.btn-step-go:hover,
.btn-step-go:focus {
    background: #2bbd84;
    color: var(--color-text-primary);
}

.btn-toolbar-results {
    background: #0f766e;
    color: #ffffff;
}

.btn-toolbar-results:hover,
.btn-toolbar-results:focus {
    background: #115e59;
    color: #ffffff;
}

.btn-step-disabled {
    background: #d1d5db;
    color: #6b7280;
    cursor: not-allowed;
}

.scorer-alert {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.scorer-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #166534;
}

.scorer-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.lock-banner {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.lock-banner {
    background: #ecfdf5;
    border: 2px solid #a7f3d0;
    color: var(--color-text-primary);
}

.lock-banner.lock-blocked {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #991b1b;
}

.lock-banner .lock-icon {
    font-weight: 700;
    margin-right: 0.35rem;
}

.scorer-section-label {
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    text-align: center;
    text-transform: uppercase;
}

.step-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.step-row {
    align-items: center;
    background: #f8fffb;
    border: 1px solid #d1fae5;
    border-radius: 14px;
    display: flex;
    gap: 14px;
    padding: 14px 16px;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.step-row:hover {
    box-shadow: 0 8px 24px rgba(6, 78, 59, 0.12);
    transform: translateY(-1px);
}

.step-row.step-disabled {
    background: #f9fafb;
    border-color: #e5e7eb;
}

.step-num {
    align-items: center;
    border-radius: 50%;
    display: flex;
    flex-shrink: 0;
    font-size: 0.9rem;
    font-weight: 700;
    height: 36px;
    justify-content: center;
    width: 36px;
}

.step-num.num-waiting {
    background: #d1d5db;
    color: #374151;
}

.step-num.num-inprog {
    background: #0f766e;
    color: #ffffff;
}

.step-num.num-done {
    background: var(--color-accent-gold);
    color: #1f2937;
}

.step-info {
    flex: 1;
    min-width: 0;
}

.step-title {
    color: var(--color-text-primary);
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.step-hint {
    color: var(--color-muted);
    font-size: 0.82rem;
    margin: 2px 0 0 0;
}

.step-row.step-disabled .step-title,
.step-row.step-disabled .step-hint {
    color: #9ca3af;
}

.status-badge {
    align-items: center;
    border-radius: var(--radius-pill);
    display: inline-flex;
    font-size: 0.76rem;
    font-weight: 700;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
}

.status-badge .sb-dot {
    border-radius: 50%;
    height: 0.5rem;
    width: 0.5rem;
}

.status-badge.badge-waiting {
    background: #e5e7eb;
    color: #4b5563;
}

.status-badge.badge-waiting .sb-dot {
    background: #9ca3af;
}

.status-badge.badge-inprog {
    background: #ccfbf1;
    color: #115e59;
}

.status-badge.badge-inprog .sb-dot {
    background: #0f766e;
}

.status-badge.badge-done {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.badge-done .sb-dot {
    background: #d97706;
}

.scorer-note {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-top: 14px;
    text-align: center;
}

.scorer-meta-stack {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-top: 14px;
    text-align: center;
}

.scorer-meta-stack p {
    margin: 0 0 4px 0;
}

.scorer-meta-stack p:last-child {
    margin-bottom: 0;
}

.scorer-meta-stack strong,
.scorer-note strong {
    color: var(--color-text-primary);
}

.scorer-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 576px) {
    .scorer-toolbar {
        flex-direction: column;
    }

    .scorer-toolbar a,
    .step-action a,
    .step-action button {
        width: 100%;
    }

    .step-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .step-status,
    .step-action {
        width: 100%;
    }
}

/* Handicap reference page (scoped) */
.handicap-reference-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.handicap-reference-field,
.handicap-reference-action-row {
    align-items: center;
    border: 0;
    column-gap: 18px;
    display: grid;
    grid-template-columns: minmax(110px, 150px) minmax(0, 380px);
    justify-content: center;
    margin: 0;
    min-width: 0;
    padding: 0;
}

.handicap-reference-field > label,
.handicap-reference-field legend {
    color: var(--color-text-primary);
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    text-align: right;
}

.handicap-reference-field input[type="text"],
.handicap-reference-field input[type="number"],
.handicap-reference-field select {
    background: #ffffff;
    border: 2px solid #d1fae5;
    border-radius: var(--radius-card);
    box-sizing: border-box;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 12px;
    width: 100%;
}

.handicap-reference-field input[type="number"]:focus,
.handicap-reference-field select:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    outline: none;
}

.handicap-reference-field input[readonly] {
    background: #f9fafb;
    color: var(--color-muted);
}

.handicap-reference-field .handicap-reference-index-input {
    max-width: 150px;
}

.handicap-reference-segmented {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.handicap-reference-segmented input {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.handicap-reference-segmented label {
    background: #f9fafb;
    border: 2px solid #d1fae5;
    cursor: pointer;
    font-weight: 700;
    padding: 12px;
    text-align: center;
}

.handicap-reference-segmented label:first-of-type {
    border-radius: var(--radius-card) 0 0 var(--radius-card);
}

.handicap-reference-segmented label:last-of-type {
    border-left: 0;
    border-radius: 0 var(--radius-card) var(--radius-card) 0;
}

.handicap-reference-segmented input:checked + label {
    background: var(--color-accent-mint);
    border-color: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.handicap-reference-segmented input:focus-visible + label {
    outline: 3px solid rgba(52, 211, 153, 0.3);
    outline-offset: 2px;
}

.handicap-reference-submit {
    min-height: 48px;
    min-width: 240px;
}

.handicap-reference-action-row {
    display: flex;
    justify-content: center;
}

.handicap-reference-result {
    border-top: 2px solid #d1fae5;
    margin-top: 24px;
    padding-top: 22px;
}

.handicap-reference-result-value {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 20px;
}

.handicap-reference-result-value span {
    font-size: 1rem;
    font-weight: 700;
}

.handicap-reference-result-value strong {
    color: #047857;
    font-size: 3rem;
    line-height: 1;
}

.handicap-reference-result-value small {
    background: #d1fae5;
    border-radius: 999px;
    color: #065f46;
    font-weight: 700;
    padding: 4px 9px;
}

.handicap-reference-facts {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
    overflow: hidden;
}

.handicap-reference-facts div {
    background: #ecfdf5;
    padding: 12px 8px;
    text-align: center;
}

.handicap-reference-facts dt {
    color: var(--color-muted);
    font-size: 0.74rem;
    font-weight: 700;
}

.handicap-reference-facts dd {
    font-size: 1rem;
    font-weight: 700;
    margin: 3px 0 0;
}

.handicap-reference-actions {
    margin-top: 24px;
    text-align: center;
}

@media (max-width: 576px) {
    .handicap-reference-field,
    .handicap-reference-action-row {
        column-gap: 10px;
        grid-template-columns: 116px minmax(0, 1fr);
    }

    .handicap-reference-facts {
        grid-template-columns: 1fr;
    }

    .handicap-reference-submit {
        min-width: 200px;
    }

    .handicap-reference-result-value {
        align-items: center;
        flex-direction: column;
    }

    .handicap-reference-actions a {
        width: 100%;
    }
}

/* Start round page (scoped) */
body.page-start-round {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.start-round-layout {
    margin: 0 auto;
    max-width: 720px;
}

.start-round-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.start-round-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.start-round-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.start-round-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.start-round-card-body {
    padding: 22px;
}

.start-round-alert {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.start-round-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.start-round-alert-error div {
    margin: 0 0 6px 0;
}

.start-round-alert-error div:last-child {
    margin-bottom: 0;
}

.start-round-form-group {
    margin-bottom: 16px;
}

.start-round-form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-text-primary);
}

.start-round-form-input,
.start-round-form-select,
.start-round-form-readonly {
    border: 2px solid #d1fae5;
    border-radius: var(--radius-card);
    box-sizing: border-box;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 12px;
    width: 100%;
}

.start-round-form-input:focus,
.start-round-form-select:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    outline: none;
}

.start-round-form-readonly {
    background: #f9fafb;
    color: var(--color-muted);
}

.start-round-form-text {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

.start-round-form-text.text-danger {
    color: #dc2626;
}

.start-round-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
}

.start-round-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 576px) {
    .start-round-actions {
        flex-direction: column;
    }

    .start-round-actions a,
    .start-round-actions button {
        width: 100%;
    }
}

/* Enter card page (scoped) */
body.page-enter-card {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 12px;
    line-height: 1.5;
    font-size: 0.94rem;
}

.enter-card-layout {
    margin: 0 auto;
    max-width: 900px;
}

.enter-card-header {
    margin: 0 auto 16px auto;
    text-align: center;
}

.enter-card-header h1 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 700;
}

.enter-card-toolbar {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.enter-card-toolbar a {
    padding: 8px 16px;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 20px;
    border: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.enter-card-toolbar .btn-toolbar-cancel,
.enter-card-toolbar .btn-toolbar-back {
    background: #e5e7eb;
    color: #374151;
}

.enter-card-toolbar .btn-toolbar-cancel:hover,
.enter-card-toolbar .btn-toolbar-back:hover {
    background: #d1d5db;
}

.enter-card-toolbar .btn-toolbar-home {
    background: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.enter-card-toolbar .btn-toolbar-home:hover {
    background: #10b981;
}

.enter-card-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.enter-card-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 12px 18px;
    font-size: 1rem;
    font-weight: 700;
}

.enter-card-card-body {
    padding: 16px;
}

.enter-card-player-banner {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--color-text-primary);
    margin-bottom: 14px;
}

.enter-card-player-banner strong {
    font-weight: 700;
}

.enter-card-alert {
    border-radius: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.enter-card-alert div {
    margin: 0 0 6px 0;
}

.enter-card-alert div:last-child {
    margin-bottom: 0;
}

.score-grid {
    border-collapse: separate;
    border-spacing: 0.22rem;
    width: 100%;
}

.score-grid th,
.score-grid td {
    text-align: center;
    vertical-align: middle;
    padding: 0.42rem 0.45rem;
    line-height: 1.1;
    font-size: 0.94rem;
}

.score-grid thead th {
    font-weight: 600;
    padding: 0.38rem 0.42rem;
    background: transparent !important;
    color: var(--color-text-primary);
}

.score-grid td.meta-cell {
    background: #e3f2fd;
    color: #0f3554;
}

.score-grid td.pink-cell {
    background: #fce4ec;
    color: #5f1d35;
}

.score-grid td.total-green {
    background: #a5d6a7;
    color: #1a3d1c;
}

.score-grid td.total-blue {
    background: #90caf9;
    color: #0a2540;
}

.score-grid .score-input {
    width: 42px;
    min-height: 30px;
    margin: 0 auto;
    text-align: center;
    padding: 0.15rem 0.2rem;
    font-size: 0.93rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.score-grid .score-input.sfp-0,
.score-grid .score-input.sfp-1,
.score-grid .score-input.sfp-2,
.score-grid .score-input.sfp-3,
.score-grid .score-input.sfp-4,
.score-grid .score-input.sfp-5 {
    font-weight: 700;
    border-width: 1px;
}

.score-grid td.sfp-cell {
    font-weight: 700;
    border-width: 1px;
}

.score-grid td.sfp-0 { background: #C62828; color: #fff5f5; }
.score-grid td.sfp-1 { background: #E64A19; color: #fff7f3; }
.score-grid td.sfp-2 { background: #FBC02D; color: #3d2f00; }
.score-grid td.sfp-3 { background: #388E3C; color: #f3fff3; }
.score-grid td.sfp-4 { background: #1976D2; color: #f4f9ff; }
.score-grid td.sfp-5 { background: #6A1B9A; color: #fbf5ff; }

.score-grid .score-input.sfp-0 { background: #C62828; color: #fff5f5; border-color: #C62828; }
.score-grid .score-input.sfp-1 { background: #E64A19; color: #fff7f3; border-color: #E64A19; }
.score-grid .score-input.sfp-2 { background: #FBC02D; color: #3d2f00; border-color: #FBC02D; }
.score-grid .score-input.sfp-3 { background: #388E3C; color: #f3fff3; border-color: #388E3C; }
.score-grid .score-input.sfp-4 { background: #1976D2; color: #f4f9ff; border-color: #1976D2; }
.score-grid .score-input.sfp-5 { background: #6A1B9A; color: #fbf5ff; border-color: #6A1B9A; }

.score-grid .score-input::placeholder {
    color: inherit;
}

.enter-card-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 16px;
}

.enter-card-actions button {
    padding: 10px 24px;
    font-size: 0.92rem;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.enter-card-actions #calculate-button {
    background: var(--color-accent-mint);
    color: var(--color-text-primary);
}

.enter-card-actions #calculate-button:hover:not(:disabled) {
    background: #10b981;
}

.enter-card-actions #save-button {
    background: #16a34a;
    color: #ffffff;
}

.enter-card-actions #save-button:hover:not(:disabled) {
    background: #15803d;
}

.enter-card-actions button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.enter-card-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 20px auto 0 auto;
    text-align: center;
}

.table-responsive {
    overflow-x: auto;
}

@media (max-height: 860px) {
    .enter-card-card-body {
        padding: 12px;
    }

    .score-grid th,
    .score-grid td {
        padding: 0.32rem 0.34rem;
        font-size: 0.9rem;
    }

    .score-grid .score-input {
        width: 40px;
        min-height: 28px;
        font-size: 0.88rem;
    }

    .enter-card-actions {
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .enter-card-toolbar {
        flex-wrap: wrap;
    }

    .score-grid th,
    .score-grid td {
        font-size: 0.86rem;
        padding: 0.28rem 0.28rem;
    }

    .score-grid .score-input {
        width: 38px;
    }

    .enter-card-actions {
        flex-direction: column;
    }

    .enter-card-actions button {
        width: 100%;
    }
}

/* Select player page (scoped) */
body.page-select-player {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.select-player-layout {
    margin: 0 auto;
    max-width: 860px;
}

.select-player-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.select-player-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.select-player-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.select-player-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.select-player-card-body {
    padding: 22px;
}

.select-player-intro {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    padding: 12px 16px;
    font-size: 0.95rem;
    color: var(--color-muted);
    margin-bottom: 16px;
}

.select-player-alert {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.select-player-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #15803d;
}

.select-player-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.select-player-alert-warning {
    background: #fef3c7;
    border: 2px solid #fde047;
    color: #92400e;
}

.select-player-alert-error div {
    margin: 0 0 6px 0;
}

.select-player-alert-error div:last-child {
    margin-bottom: 0;
}

.select-player-form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--color-text-primary);
}

.select-player-form-select {
    border: 2px solid #d1fae5;
    border-radius: var(--radius-card);
    box-sizing: border-box;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 12px;
    width: 100%;
}

.select-player-form-select:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    outline: none;
}

.select-player-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 18px;
}

.select-player-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .select-player-actions {
        flex-direction: column;
    }

    .select-player-actions a {
        width: 100%;
    }
}

/* Present results page (scoped) */
body.page-present-results {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.present-results-layout {
    margin: 0 auto;
    max-width: 980px;
}

.present-results-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.present-results-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.present-results-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.present-results-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.present-results-card-body {
    padding: 22px;
}

.present-results-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 18px;
}

.present-results-chip {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 999px;
    color: var(--color-text-primary);
    font-size: 0.88rem;
    padding: 5px 14px;
}

.present-results-alert {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.present-results-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.present-results-alert-error div {
    margin: 0 0 6px 0;
}

.present-results-alert-error div:last-child {
    margin-bottom: 0;
}

.present-results-alert-warning {
    background: #fef3c7;
    border: 2px solid #fde047;
    color: #92400e;
}

.results-grid th,
.results-grid td {
    vertical-align: middle;
    text-align: center;
}

.results-grid td.name-col,
.results-grid th.name-col {
    text-align: left;
}

.place-row-1 { background: #fff8dc; }
.place-row-2 { background: #f5f7fa; }
.place-row-3 { background: #fff1e8; }

.present-results-form-group {
    margin-bottom: 16px;
}

.present-results-form-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-text-primary);
}

.present-results-form-select {
    border: 2px solid #d1fae5;
    border-radius: var(--radius-card);
    box-sizing: border-box;
    color: var(--color-text-primary);
    font-family: inherit;
    padding: 12px;
    width: 100%;
}

.present-results-form-select:focus {
    border-color: var(--color-accent-mint);
    box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2);
    outline: none;
}

.present-results-form-text {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin-top: 6px;
}

.present-results-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 18px;
}

.present-results-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .present-results-actions {
        flex-direction: column;
    }

    .present-results-actions a,
    .present-results-actions button {
        width: 100%;
    }
}

/* Results recorded page (scoped) */
body.page-results-recorded {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.results-recorded-layout {
    margin: 0 auto;
    max-width: 1020px;
}

.results-recorded-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.results-recorded-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.results-recorded-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.results-recorded-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.results-recorded-card-body {
    padding: 22px;
}

.results-recorded-alert {
    border-radius: 14px;
    margin-bottom: 16px;
    padding: 14px 16px;
}

.results-recorded-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #15803d;
}

.results-recorded-commiserations {
    background: #fef3c7;
    border: 1px solid #fde068;
    border-radius: 12px;
    margin-bottom: 20px;
    padding: 16px 18px;
}

.results-recorded-commiserations-note {
    color: #92400e;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.results-recorded-commiserations ol {
    color: #78350f;
    margin: 0;
    padding-left: 20px;
}

.results-recorded-commiserations li {
    margin-bottom: 4px;
}

.results-table th,
.results-table td {
    text-align: center;
    vertical-align: middle;
}

.results-recorded-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 22px;
}

.results-recorded-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .results-recorded-actions {
        flex-direction: column;
    }

    .results-recorded-actions a {
        width: 100%;
    }
}

/* Shared Twilight header icon */
.uc-header h1,
.welcome-header h1,
.config-header h1,
.course-club-header h1,
.course-played-header h1,
.logs-header h1,
.roster-header h1,
.staff-header h1,
.scoring-state-header h1,
.staff-form-header h1,
.roster-form-header h1,
.login-header h1,
.leaderboard-header h1,
.admin-header h1,
.scorer-header h1,
.start-round-header h1,
.enter-card-header h1,
.select-player-header h1,
.present-results-header h1,
.results-recorded-header h1 {
    align-items: center;
    display: inline-flex;
    gap: 12px;
    justify-content: center;
}

.uc-header h1::before,
.welcome-header h1::before,
.config-header h1::before,
.course-club-header h1::before,
.course-played-header h1::before,
.logs-header h1::before,
.roster-header h1::before,
.staff-header h1::before,
.scoring-state-header h1::before,
.staff-form-header h1::before,
.roster-form-header h1::before,
.login-header h1::before,
.leaderboard-header h1::before,
.admin-header h1::before,
.scorer-header h1::before,
.start-round-header h1::before,
.enter-card-header h1::before,
.select-player-header h1::before,
.present-results-header h1::before,
.results-recorded-header h1::before {
    background: url('/assets/img/twg-monogram.svg') center / contain no-repeat;
    content: '';
    flex: 0 0 34px;
    height: 34px;
    width: 34px;
}

@media (max-width: 768px) {
    .uc-header h1,
    .welcome-header h1,
    .config-header h1,
    .course-club-header h1,
    .course-played-header h1,
    .logs-header h1,
    .roster-header h1,
    .staff-header h1,
    .scoring-state-header h1,
    .staff-form-header h1,
    .roster-form-header h1,
    .login-header h1,
    .leaderboard-header h1,
    .admin-header h1,
    .scorer-header h1,
    .start-round-header h1,
    .enter-card-header h1,
    .select-player-header h1,
    .present-results-header h1,
    .results-recorded-header h1 {
        gap: 10px;
    }

    .uc-header h1::before,
    .welcome-header h1::before,
    .config-header h1::before,
    .course-club-header h1::before,
    .course-played-header h1::before,
    .logs-header h1::before,
    .roster-header h1::before,
    .staff-header h1::before,
    .scoring-state-header h1::before,
    .staff-form-header h1::before,
    .roster-form-header h1::before,
    .login-header h1::before,
    .leaderboard-header h1::before,
    .admin-header h1::before,
    .scorer-header h1::before,
    .start-round-header h1::before,
    .enter-card-header h1::before,
    .select-player-header h1::before,
    .present-results-header h1::before,
    .results-recorded-header h1::before {
        flex-basis: 30px;
        height: 30px;
        width: 30px;
    }
}

/* Results archive page (scoped) */
body.page-results-archive {
    background: radial-gradient(circle at top left, #dcfce7 0%, var(--color-bg-main) 45%, #ecfdf5 100%);
    color: var(--color-text-primary);
    font-family: var(--font-primary);
    margin: 0;
    min-height: 100vh;
    padding: 16px;
    line-height: 1.5;
}

.results-archive-layout {
    margin: 0 auto;
    max-width: 980px;
}

.results-archive-header {
    margin: 0 auto 24px auto;
    text-align: center;
}

.results-archive-header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.results-archive-card {
    background: var(--color-surface);
    border: 1px solid #d1fae5;
    border-radius: var(--radius-card);
    box-shadow: 0 18px 40px rgba(6, 78, 59, 0.14);
    overflow: hidden;
}

.results-archive-card-title {
    background: var(--color-text-primary);
    color: #ffffff;
    margin: 0;
    padding: 14px 18px;
    font-size: 1.05rem;
    font-weight: 700;
}

.results-archive-card-body {
    padding: 22px;
}

.results-archive-alert {
    border-radius: 14px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.results-archive-alert-success {
    background: #ecfdf5;
    border: 2px solid #86efac;
    color: #166534;
}

.results-archive-alert-error {
    background: #fef2f2;
    border: 2px solid #fecaca;
    color: #991b1b;
}

.results-archive-session {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 12px;
    color: var(--color-text-primary);
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 14px;
    padding: 12px 14px;
}

.results-archive-empty {
    background: #f8fffb;
    border: 1px solid #d1fae5;
    border-radius: 14px;
    padding: 14px;
    text-align: center;
}

.results-season,
.results-round {
    border: 1px solid #d1fae5;
    border-radius: 12px;
    margin-bottom: 10px;
    padding: 8px 10px;
}

.results-season > summary,
.results-round > summary {
    cursor: pointer;
    font-weight: 700;
    list-style: none;
}

.results-season > summary::-webkit-details-marker,
.results-round > summary::-webkit-details-marker {
    display: none;
}

.results-season > summary::before,
.results-round > summary::before {
    content: '>'; 
    display: inline-block;
    margin-right: 8px;
    transform: translateY(-1px);
}

.results-season[open] > summary::before,
.results-round[open] > summary::before {
    content: 'v';
}

.round-meta {
    color: var(--color-muted);
    font-weight: 500;
    margin-left: 10px;
}

.snapshot-list {
    margin: 8px 0 4px 0;
    padding-left: 20px;
}

.snapshot-list li {
    margin-bottom: 6px;
}

.snapshot-list a {
    color: #0369a1;
    font-weight: 400;
    text-decoration: none;
}

.snapshot-link {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
}

.snapshot-file {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 500;
}

.snapshot-list a:hover,
.snapshot-list a:focus {
    text-decoration: underline;
}

.snapshot-missing {
    color: #6b7280;
}

.results-archive-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 18px;
}

.results-archive-footer {
    color: var(--color-muted);
    font-size: 0.85rem;
    margin: 24px auto 0 auto;
    text-align: center;
}

@media (max-width: 768px) {
    .results-archive-actions a {
        width: 100%;
        text-align: center;
    }

    .round-meta {
        display: block;
        margin-left: 0;
        margin-top: 4px;
    }
}
