/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
    color: #2c3e50;
    background: #fff;
    line-height: 1.5;
    font-weight: 600;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* App-like scroll: no rubber-band / pull-to-refresh bounce at the page edges
       (the update banner covers refresh), and a subtler on-brand tap flash. */
    overscroll-behavior-y: none;
    -webkit-tap-highlight-color: rgba(44, 62, 80, 0.12);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0;
}

a {
    color: #2c3e50;
    text-decoration: none;
}

h1:focus {
    outline: none;
}

/* ===== App Layout ===== */
#app-root {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0;
    /* Safe-area insets (viewport-fit=cover): keep content clear of the notch /
       status bar at the top and of the rounded-corner gutters in landscape.
       Resolve to 0 on devices without insets, so this is harmless on desktop. */
    padding-top: env(safe-area-inset-top);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* ===== Top Bar (auth info) ===== */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #e0e0e0;
}

.top-bar .event-name {
    margin-right: auto;
    font-weight: 600;
    color: #2c3e50;
}

/* User menu (replaces the row of Account / Profile / Registrations / Logout links).
   Click the name → dropdown anchored to the right edge. Matches the .row-actions
   pattern used in the table kebabs but is wider and styled for an auth menu. */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid transparent;
    border-radius: 4px;
    padding: 0.25rem 0.6rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: inherit;
    color: #2c3e50;
}

.user-menu-trigger:hover,
.user-menu.open .user-menu-trigger {
    background-color: #f0f0f0;
    border-color: #ddd;
}

.user-menu-name {
    font-weight: 600;
}

.user-menu-caret {
    font-size: 0.7rem;
    color: #888;
}

.user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    list-style: none;
    padding: 0.3rem 0;
    margin: 0;
    min-width: 200px;
    z-index: 100;
}

.user-menu-dropdown li {
    margin: 0;
    padding: 0;
}

.user-menu-dropdown a,
.user-menu-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: #2c3e50;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.user-menu-dropdown a:hover,
.user-menu-dropdown button:hover {
    background-color: #f5f5f5;
}

.user-menu-email {
    padding: 0.5rem 1rem 0.3rem;
    color: #888;
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-divider {
    border-top: 1px solid #eee;
    margin: 0.25rem 0;
}

.user-menu-logout {
    color: #c0392b !important;
    font-weight: 600;
}

/* ===== Tournament Header ===== */
.tournament-header {
    text-align: left;
    padding: 1rem 1rem 0.5rem 1rem;
    margin-bottom: 0.5rem;
}

.round-status {
    display: flex;
    align-items: center;
    margin-bottom: 0.25rem;
}

.round-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
    color: white;
}

.round-badge.in-progress {
    background-color: #dc3545;
}

.round-badge.completed {
    background-color: #28a745;
}

.round-badge.scheduled {
    background-color: #6c757d;
}

.status-text {
    font-weight: 600;
    font-size: 0.9rem;
}

.tournament-name {
    margin: 0.25rem 0;
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.2;
}

.course-name {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.round-of-day {
    font-size: 0.9rem;
    font-weight: 400;
    color: #6c757d;
    margin-left: 0.25rem;
}

.weather-info {
    font-size: 0.9rem;
    color: #6c757d;
    display: flex;
    align-items: center;
}

.weather-icon {
    margin-right: 0.4rem;
    font-size: 1.2em;
}

/* ===== Main Navigation ===== */
.main-nav-header {
    padding: 0;
    margin-left: 16px;
    margin-right: 16px;
    margin-bottom: 0;
    margin-top: 1rem;
}

.main-nav {
    text-align: left;
    border-bottom: 4px solid #e0e0e0;
    position: relative;
}

.main-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-nav li {
    display: inline-block;
    margin-right: 24px;
    padding-bottom: 0.8rem;
    position: relative;
    font-weight: 600;
    line-height: 1.1;
    font-size: 1.2rem;
}

.main-nav li a {
    text-decoration: none;
    color: #9e9e9e;
    padding-bottom: 8px;
    transition: color 0.3s;
    font-weight: 600;
}

.main-nav li.active a {
    color: #2c3e50;
}

.main-nav li::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: transparent;
    z-index: 1;
}

.main-nav li.active::after {
    background-color: #2c3e50;
}

/* ===== Admin Dropdown ===== */
.admin-menu {
    margin-left: auto;
    margin-right: 0;
    position: relative;
}

.admin-toggle {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 1.2rem;
    font-weight: 600;
    color: #9e9e9e;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: color 0.3s;
}

.admin-menu.active .admin-toggle,
.admin-menu.open .admin-toggle {
    color: #2c3e50;
}

.admin-toggle:hover {
    color: #2c3e50;
}

.admin-gear {
    font-size: 1.1rem;
}

.admin-caret {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.admin-menu.open .admin-caret {
    transform: rotate(180deg);
}

.admin-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.admin-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    list-style: none;
    padding: 0.4rem 0;
    margin: 0;
    min-width: 160px;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.admin-dropdown li {
    display: block;
    margin: 0;
    padding: 0;
    font-size: 0.95rem;
}

.admin-dropdown li.admin-group-header {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9e9e9e;
    cursor: default;
    pointer-events: none;
}

/* Separator + spacing between groups (skip the first group's header). */
.admin-dropdown li.admin-group-header:not(:first-child) {
    margin-top: 0.25rem;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
}

.admin-dropdown li::after {
    display: none;
}

.admin-dropdown li a {
    display: block;
    padding: 0.5rem 1rem;
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s;
}

.admin-dropdown li a:hover {
    background-color: #f5f5f5;
}

.admin-dropdown li.active a {
    color: #2c3e50;
    background-color: #f0f0f0;
}

/* ===== Mobile Bottom Tab Bar =====
   Hidden on desktop; replaces the top result tabs ≤768px. Markup lives in
   NavMenu.razor (.bottom-nav + the .more-sheet overflow/admin menu). */
.bottom-nav {
    display: none;
}

.more-section {
    margin-bottom: 0.75rem;
}

.more-section:last-child {
    margin-bottom: 0;
}

.more-section-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #9e9e9e;
    padding: 0.5rem 0 0.25rem;
}

.more-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.6rem 0.25rem;
    color: #2c3e50;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
}

.more-link:last-child {
    border-bottom: none;
}

.more-link.active {
    background: #f5f5f5;
}

.more-link .material-symbols-outlined {
    font-size: 20px;
    color: #9e9e9e;
}

@media (max-width: 768px) {
    /* The bottom bar replaces the top result tabs on phones. Keep the wrapping
       header in the DOM (the fixed bar is its descendant, so display:none on the
       header would also kill the bar) but collapse its spacing and hide the
       horizontal tab list + admin gear — admin moves into the More sheet. */
    .main-nav {
        display: none;
    }

    .main-nav-header {
        margin: 0;
    }

    .bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 150;
        background: #fff;
        border-top: 1px solid #e0e0e0;
        box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
        /* Lift the bar above the home indicator. */
        padding-bottom: env(safe-area-inset-bottom);
    }

    .bottom-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 56px;
        padding: 6px 0;
        background: none;
        border: none;
        font-family: inherit;
        color: #9e9e9e;
        text-decoration: none;
        cursor: pointer;
    }

    .bottom-nav-item.active {
        color: #2c3e50;
    }

    .bottom-nav-item .material-symbols-outlined {
        font-size: 24px;
    }

    .bottom-nav-label {
        font-size: 0.65rem;
        font-weight: 600;
        line-height: 1;
    }
}

/* ===== Main Content ===== */
main {
    padding: 1rem;
}

@media (max-width: 768px) {
    main {
        padding: 0.5rem;
        /* Reserve room so the fixed bottom bar (56px + home-indicator inset)
           never covers the last rows of page content. */
        padding-bottom: calc(56px + env(safe-area-inset-bottom) + 0.75rem);
    }
}

/* ===== Shared Table Styles ===== */
.table-responsive {
    overflow-x: auto;
    position: relative;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    font-size: 0.75rem;
    border-style: none;
    margin-bottom: 1.5rem;
}

.data-table th {
    padding: 8px;
    text-align: center;
    font-weight: bold;
    color: #9e9e9e;
    text-transform: uppercase;
    background-color: white;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 2px solid #000;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background-color: #f5f5f5;
}

.data-table td {
    padding: 8px;
    text-align: center;
    border-top: none;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #ddd;
}

.data-table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: white;
}

.data-table tfoot td {
    font-weight: bold;
    border-top: 2px solid #000;
    border-bottom: none;
}

.data-table .text-left {
    text-align: left;
}

.data-table .text-right {
    text-align: right;
}

.data-table .player-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.data-table .player-row:hover {
    background-color: #f5f5f5;
}

/* Pending field rows (player grouped into the upcoming round but not yet teed off):
   dimmed slightly so the ranked field reads first, with the tee time emphasized. */
.data-table .player-row.pending-row {
    color: #777;
}

.data-table .player-row.pending-row .tee-time-cell {
    color: #1565c0;
    font-weight: 600;
    white-space: nowrap;
}

/* "Next tee time" note under a ranked player's name (mid-trip). */
.tee-time-note {
    font-size: 0.78rem;
    margin-top: 2px;
    white-space: nowrap;
}

/* ===== Score Coloring =====
   Traditional scorecard convention: under-par is red (birdies/eagles draw the eye),
   over-par is plain text. Applied app-wide — leaderboard, scorecard +/- columns,
   skins detail, etc. Even-par gets a muted green so a score of "E" still reads as
   "even" rather than blending with par. */
.under-par {
    color: #dc3545;
}

.even-par {
    color: #2c3e50;
}

.over-par {
    color: inherit;
}

/* Small over/under badge that sits next to the gross score in a single cell, used
   by the team / scramble results tables. Renders as "38 +1" with the +/- inheriting
   the colour from the score-class (under-par / even-par / over-par) applied by the
   page. Sized below the main score so the score still reads first on a narrow row. */
.score-ou-badge {
    display: inline-block;
    margin-left: 0.25rem;
    font-size: 0.85em;
    font-weight: 600;
    color: inherit;
}

.has-money {
    font-weight: bold;
}

/* ===== Position Arrows ===== */
.arrow {
    display: inline-flex;
    align-items: center;
}

.arrow.up {
    color: green;
}

.arrow.down {
    color: red;
}

.arrow .material-symbols-outlined {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== Status Badges ===== */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
}

.status-badge.active {
    background-color: #28a745;
}

.status-badge.setup {
    background-color: #17a2b8;
}

.status-badge.finished {
    background-color: #ffc107;
    color: #2c3e50;
}

.status-badge.archived,
.status-badge.default {
    background-color: #6c757d;
}

.status-badge.in-progress {
    background-color: #dc3545;
}

.status-badge.scheduled {
    background-color: #6c757d;
}

.status-badge.inprogress {
    background-color: #dc3545;
}

.calc-done {
    color: #28a745;
    font-weight: 600;
}

.calc-pending {
    color: #6c757d;
    font-style: italic;
}

/* ===== Round Pills ===== */
.round-pills {
    margin-bottom: 1.5rem;
}

.round-pills ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.round-pills li {
    padding: 0.4rem 1rem;
    border-radius: 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.round-pills li.active {
    background-color: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.round-pills li:hover:not(.active) {
    background-color: #f5f5f5;
    border-color: #aaa;
}

@media (max-width: 768px) {
    .round-pills li {
        padding: 0.3rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* ===== Result-view switcher (Leaderboard page) =====
   Picks which concurrent result view renders (Leaderboard / Money List / Skins / Par 3s / Groups /
   Scrambles). Desktop shows a segmented pill strip; ≤768px swaps to a trigger button that opens the
   shared bottom sheet (.modal-panel/.more-sheet). Markup: Shared/ResultViewSwitcher.razor. */
.view-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.view-switcher__pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 1rem;
    border-radius: 1rem;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid #ddd;
    background: #fff;
    color: #2c3e50;
    transition: all 0.2s ease;
}

.view-switcher__pill .material-symbols-outlined {
    font-size: 18px;
}

.view-switcher__pill.active {
    background-color: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.view-switcher__pill:hover:not(.active) {
    background-color: #f5f5f5;
    border-color: #aaa;
}

/* Mobile trigger — hidden on desktop, shown ≤768px (see media query below). */
.view-switcher-trigger {
    display: none;
}

.view-switcher-trigger__label {
    flex: 1;
    text-align: left;
}

/* The sheet rows are <button>s reusing .more-link (an anchor style) — reset button chrome. */
.view-switcher-sheet .more-link {
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 1rem;
    text-align: left;
}

.view-switcher-sheet .more-link:last-child {
    border-bottom: none;
}

@media (max-width: 768px) {
    .view-switcher {
        display: none;
    }

    .view-switcher-trigger {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        min-height: 44px;
        padding: 0.6rem 0.9rem;
        margin-bottom: 1rem;
        border: 1px solid #ddd;
        border-radius: 0.6rem;
        background: #fff;
        color: #2c3e50;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
    }

    .view-switcher-trigger .material-symbols-outlined {
        font-size: 20px;
        color: #2c3e50;
    }

    .view-switcher-trigger__caret {
        color: #9e9e9e !important;
    }
}

/* ===== Auth & Form Styles ===== */
.auth-container {
    max-width: 400px;
    margin: 3rem auto;
    padding: 2rem;
}

.auth-card {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.auth-card h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: #666;
    text-transform: uppercase;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.6rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: inherit;
    background: white;
    color: #2c3e50;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #2c3e50;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background-color 0.2s, opacity 0.2s;
    text-align: center;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background-color: #2c3e50;
    color: white;
    width: 100%;
}

.btn-primary:hover:not(:disabled) {
    background-color: #1a252f;
}

.btn-outline {
    background: transparent;
    border: 1px solid #2c3e50;
    color: #2c3e50;
}

.btn-outline:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.btn-small {
    padding: 0.3rem 0.75rem;
    font-size: 0.8rem;
}

.form-footer {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.form-footer a {
    color: #2c3e50;
    font-weight: 600;
    text-decoration: underline;
}

.form-error {
    color: #dc3545;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.form-info {
    background: #fffbea;
    border: 1px solid #f0d35a;
    color: #7a5c00;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.6rem 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.form-hint {
    color: #6c757d;
    font-size: 0.85rem;
    margin: 0.5rem 0 0;
}

.form-hint a {
    color: #2c3e50;
    text-decoration: underline;
}

.scoring-mode-badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    margin-left: 0.75rem;
    vertical-align: middle;
}

.scoring-mode-gross {
    background: #eef2f6;
    color: #2c3e50;
}

.scoring-mode-net {
    background: #e3f2fd;
    color: #0d47a1;
}

/* Compact variant for the per-round Net column header — tighter padding and a small
   left margin so it sits flush next to the "R1" label. */
.net-column-pill {
    margin-left: 0.35rem;
    padding: 0.1rem 0.4rem;
    font-size: 0.7rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
}

.checkbox-group label {
    margin-bottom: 0;
    text-transform: none;
    font-size: 0.95rem;
    color: #2c3e50;
}

/* ===== Event Cards ===== */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.event-card {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 1.25rem;
    cursor: pointer;
    transition: box-shadow 0.2s, transform 0.1s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.event-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.event-card h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.event-card .card-meta {
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
    margin-top: 0.5rem;
}

.event-card .card-meta div {
    margin-bottom: 0.15rem;
}

/* ===== Player Cards ===== */
.player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.player-card {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.player-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #2c3e50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.player-card .player-info {
    flex: 1;
}

.player-card .player-info .name {
    font-size: 1rem;
    font-weight: 600;
}

.player-card .player-info .role {
    font-size: 0.8rem;
    color: #666;
    font-weight: 400;
}

/* ===== Hero / Landing ===== */
.hero {
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.hero p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    font-weight: 400;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.hero-buttons .btn {
    width: auto;
    padding: 0.75rem 2rem;
    font-size: 1rem;
}

/* ===== Section Headers ===== */
.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-align: left;
}

/* ===== Empty State ===== */
.empty-state {
    padding: 2rem;
    text-align: center;
    color: #666;
    font-style: italic;
    font-weight: 400;
}

/* ===== Loading Spinner ===== */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.loading-spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #2c3e50;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== Settings / Detail Panel ===== */
.detail-panel {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 1.5rem;
    max-width: 500px;
}

.detail-panel h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #ddd;
    font-size: 0.9rem;
}

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

.detail-row .label {
    color: #666;
    font-weight: 400;
}

.detail-row .value {
    font-weight: 600;
}

/* ===== Create Button (FAB replacement) ===== */
.create-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0.6rem 1.25rem;
    background-color: #2c3e50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    transition: background-color 0.2s;
}

.create-btn:hover {
    background-color: #1a252f;
}

/* ===== Settings Page ===== */
.settings-container {
    max-width: 500px;
}

.settings-card {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.settings-card h3 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.settings-section {
    margin-bottom: 1.5rem;
}

.settings-section h3 {
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #ddd;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.status-pipeline {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.pipeline-step {
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #e0e0e0;
    color: #999;
}

.pipeline-step.current {
    background-color: #2c3e50;
    color: white;
}

.pipeline-step.past {
    background-color: #b0bec5;
    color: white;
}

.form-success {
    color: #28a745;
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.clone-description {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.75rem;
}

.danger-zone {
    border: 1px solid #dc3545;
}

.danger-zone h3 {
    color: #dc3545;
    border-bottom-color: #f5c6cb;
}

.danger-text {
    font-size: 0.9rem;
    font-weight: 400;
    color: #666;
    margin-bottom: 0.75rem;
}

.danger-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

/* ===== Player Management ===== */
.add-mode-toggle {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.invite-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
}

.invite-btn {
    width: auto;
    white-space: nowrap;
    height: 38px;
}

.member-table th,
.member-table td {
    font-size: 0.85rem;
}

.member-table td {
    vertical-align: middle;
}

.member-cell {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

/* Member rows stay a single line at any width: [avatar] Name (index) … [menu].
   min-width:0 lets a long name wrap/ellipsis inside its cell instead of pushing
   the table wider than the screen. */
.member-cell-text {
    min-width: 0;
}

.member-name-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.member-index {
    color: #666;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
}

/* Keep the action menu pinned to the right and as narrow as its content so the
   player cell takes the remaining width. */
.member-table td.actions-cell {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.player-avatar.small {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

.member-name {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Muted role / status subline under the player name. Only rendered for non-Player
   roles, the commissioner, or inactive members — a plain active Player shows just
   the name so the row stays clean. */
.member-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.15rem;
    font-size: 0.78rem;
    font-weight: 400;
    color: #666;
}

.member-inactive-tag {
    color: #c0392b;
    font-weight: 600;
}

.role-select {
    padding: 0.25rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    background: white;
    color: #2c3e50;
    cursor: pointer;
}

.role-select:focus {
    outline: none;
    border-color: #2c3e50;
}

.commissioner-badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: 600;
    background-color: #ffc107;
    color: #2c3e50;
}

.toggle-btn {
    white-space: nowrap;
}

.inactive-row {
    opacity: 0.55;
}

.row-actions {
    position: relative;
    display: inline-block;
}

.row-actions__trigger {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    color: #2c3e50;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.row-actions__trigger:hover,
.row-actions.open .row-actions__trigger {
    background-color: #f0f0f0;
    border-color: #ddd;
}

.row-actions__backdrop {
    position: fixed;
    inset: 0;
    z-index: 99;
}

.row-actions__dropdown {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    list-style: none;
    padding: 0.3rem 0;
    margin: 0;
    min-width: 150px;
    z-index: 100;
}

/* Stacked, full-width action buttons inside the round Settings modal. */
/* Card header with a heading on the left and an action button on the right
   (e.g. the Rounds list "+ Add Round" trigger). Wraps gracefully on narrow
   phones so the button drops below the heading instead of squashing it. */
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.card-header-row h3 {
    margin: 0;
}

/* Compact "add new" pill — overrides .btn-primary's full width so it sits inline
   in a card header. The leading "+" reads as a clear create affordance. */
.btn-add {
    width: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    border-radius: 999px;
}

.btn-add-icon {
    font-size: 1.15em;
    line-height: 1;
    font-weight: 700;
}

@media (max-width: 480px) {
    /* Full-width on phones so the tap target spans the card. */
    .card-header-row .btn-add {
        width: 100%;
        justify-content: center;
    }
}

/* Footer actions inside a bottom-sheet form (e.g. Add Round): stack full-width
   so the primary + Cancel are even-width with a clear gap, matching the
   per-round Settings sheet. Without this, .btn-primary's width:100% leaves the
   outline button auto-width and crammed beside it. */
.sheet-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.sheet-actions .btn {
    width: 100%;
    margin: 0;
}

.round-settings-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.round-settings-actions .btn {
    width: 100%;
}

/* Rounds list: course cell carries a muted subline (tee · date · format) so the
   row reads as title + detail instead of a wide grid of columns. */
.round-row-meta {
    width: 100%;
    margin-top: 0.15rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: #666;
}

.round-row-9hole {
    color: #666;
    font-size: 0.85em;
    font-weight: 400;
}

@media (max-width: 768px) {
    /* In card mode the Settings button reads as the card's primary action — give it
       the full card width like the bottom-sheet buttons, instead of a small chip. */
    .data-table--cards td.card-actions .round-settings-btn {
        width: 100%;
    }
}

.row-actions__dropdown li {
    margin: 0;
    padding: 0;
}

.row-actions__dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-family: inherit;
    color: #2c3e50;
    cursor: pointer;
    white-space: nowrap;
}

.row-actions__dropdown button:hover:not(:disabled) {
    background-color: #f5f5f5;
}

.row-actions__dropdown button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.row-actions__dropdown button.danger {
    color: #c0392b;
}

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

    .invite-row .form-group {
        width: 100% !important;
    }

    .invite-btn {
        width: 100%;
    }

    .member-table {
        font-size: 0.75rem;
    }
}

/* ===== Course Setup ===== */
.course-mgmt-table th,
.course-mgmt-table td {
    font-size: 0.85rem;
}

.course-detail-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.course-detail-header h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.tee-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.tee-header h3 {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tee-color-dot {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1px solid #ccc;
}

.tee-details {
    font-weight: 400;
    font-size: 0.8rem;
    color: #666;
}

.tee-actions {
    display: flex;
    gap: 0.5rem;
}

.hole-grid {
    margin-bottom: 1rem;
}

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

.hole-table th,
.hole-table td {
    font-size: 0.8rem;
    padding: 0.3rem 0.5rem;
    text-align: center;
}

.hole-number {
    font-weight: 600;
    width: 40px;
}

.hole-input {
    width: 60px;
    padding: 0.2rem 0.3rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: inherit;
    text-align: center;
}

.hole-input:focus {
    outline: none;
    border-color: #2c3e50;
}

.nine-summary td {
    border-top: 2px solid #ccc;
    background-color: #f8f8f8;
}

.total-summary td {
    border-top: 2px solid #2c3e50;
    background-color: #eee;
}

/* ===== Group Assignment ===== */
.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
}

.group-name-label {
    font-weight: 400;
    color: #666;
}

.group-member-count {
    font-weight: 400;
    font-size: 0.85rem;
    color: #999;
    margin-left: 0.5rem;
}

.group-member-table {
    margin-bottom: 0;
}

.handicap-input {
    width: 60px;
    padding: 0.25rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    text-align: center;
}

.handicap-input:focus {
    outline: none;
    border-color: #2c3e50;
}

.name-edit-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.name-edit-form input {
    padding: 0.25rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    font-family: inherit;
}

.name-edit-form input:focus {
    outline: none;
    border-color: #2c3e50;
}

.unassigned-players {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.unassigned-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    background-color: #e0e0e0;
    color: #2c3e50;
}

.assign-player-select {
    padding: 0.25rem 0.4rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    background: white;
    color: #2c3e50;
    width: 100%;
}

.assign-player-select:focus {
    outline: none;
    border-color: #2c3e50;
}

/* ===== Blazor Loading (initial) ===== */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: #2c3e50;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

/* ===== Blazor Error UI ===== */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ===== Filter Controls ===== */
.filter-controls {
    margin: 1rem 0 0 1rem;
}

/* ===== Course Info ===== */
.course-info {
    margin: 0.5rem 0 1rem 1rem;
    text-align: left;
}

.course-info h4 {
    font-size: 1.1rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

/* ===== Mobile Hide ===== */
@media (max-width: 768px) {
    .mobile-hide {
        display: none;
    }
}

/* ===== Player Detail (Leaderboard Expansion) =====
   Scope the flush padding to the DIRECT detail cell only. A descendant
   selector (`.player-detail-row td`) leaks `padding:0 !important` into every
   nested table — including the scorecard — and overrides its cell padding,
   crushing the score rows together. The detail row has a single colspan td. */
.player-detail-row > td {
    padding: 0 !important;
    border-bottom: 1px solid #ddd;
}

.player-detail-cell {
    padding: 0 !important;
}

.player-detail {
    background-color: #f2f2f2;
    padding: 1rem;
    width: 100%;
    box-sizing: border-box;
}

.data-table .player-row.active {
    background-color: #e3f2fd;
}

.close-button-wrapper {
    display: flex;
    justify-content: flex-end;
}

.close-button {
    background: none;
    border: 1px solid #666;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    margin: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-button:hover {
    background-color: #e0e0e0;
}

.player-detail-header {
    display: flex;
    align-items: center;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.avatar-container {
    position: relative;
    margin-right: 0.75rem;
}

.avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
}

.default-avatar {
    background-color: white;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
}

.player-info-detail {
    flex: 1;
    text-align: left;
}

.player-name-detail {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

/* ===== Sub Navigation (Player Detail Tabs) ===== */
.sub-nav {
    margin-bottom: 1rem;
    border-bottom: 4px solid #e0e0e0;
}

.sub-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.sub-nav li {
    display: inline-block;
    margin-right: 16px;
    padding-bottom: 0.6rem;
    position: relative;
    font-weight: 600;
}

.sub-nav li a {
    text-decoration: none;
    color: #9e9e9e;
    transition: color 0.3s;
    font-weight: 600;
    font-size: 1rem;
}

.sub-nav li.active a {
    color: #2c3e50;
}

.sub-nav li::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 4px;
    background-color: #e0e0e0;
}

.sub-nav li.active::after {
    background-color: #2c3e50;
}

/* ===== Scorecard ===== */
.scorecard {
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 1.5rem;
    width: 100%;
}

/* Course / tee / yardage / rating / slope line above a player's scorecard. Middot-separated,
   name first. */
.scorecard-course-info {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    margin-bottom: 0.6rem;
    font-size: 0.85rem;
    color: #666;
}

.scorecard-course-info > span {
    white-space: nowrap;
}

.scorecard-course-info .course-info-name {
    font-weight: 600;
    color: #222;
}

.scorecard-course-info > span + span::before {
    content: "·";
    margin: 0 0.5rem;
    color: #bbb;
}

.desktop-scorecard {
    display: block;
}

.mobile-scorecard {
    display: none;
}

.scorecard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    border-top: 3px solid #2c3e50;
    table-layout: fixed;
}

.scorecard-table .out-column,
.scorecard-table .in-column,
.scorecard-table .total-column {
    background-color: #e6e6e6;
    width: 2.5rem;
}

.scorecard-table thead tr th {
    color: #9e9e9e;
    text-transform: uppercase;
}

.scorecard-table th,
.scorecard-table td {
    padding: 0.85rem 0.5rem;
    text-align: center;
    border-bottom: 1px solid #ddd;
    border-left: none;
    border-right: none;
    min-width: 2.5rem;
}

.scorecard-table .hole-header,
.scorecard-table .heading-cell {
    width: auto;
    min-width: 3.5rem;
    max-width: 4rem;
    text-align: left;
    padding-left: 0.5rem;
    white-space: nowrap;
}

.scorecard-table td:first-child,
.scorecard-table thead tr th:first-child {
    text-align: left;
}

.scorecard-table th {
    background-color: #f5f5f5;
    font-weight: 600;
}

.heading-cell {
    color: #9e9e9e;
    text-transform: uppercase;
    font-weight: 600;
    text-align: left;
}

.heading-cell.dark {
    color: #2c3e50;
}

.par-row,
.yards-row {
    background-color: #f9f9f9;
    color: #9e9e9e;
}

.scorecard-table .par-row td {
    border-bottom: 2px solid #ccc;
    padding-bottom: 0.85rem;
}

.scorecard-table .score-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
    position: relative;
}

/* `tr.net-row` (specificity 0,2,2) intentionally outranks `.scorecard-table
   .score-row td` (0,2,1) so the net row keeps its own generous top padding —
   the score marks are absolutely-positioned and vertically centered, so each
   row must be tall enough or adjacent marks (gross vs net) overlap. */
/* Padding kept symmetric so the numeral stays vertically centred inside the
   mark — the mark is centred on the cell's padding box, so unequal top/bottom
   padding would shift the text off-centre. */
.scorecard-table tr.net-row td {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
    font-style: italic;
    color: #555;
}

/* ===== Score Indicators (Circles & Squares) =====
   Broadcast-style scorecard marks: birdie = filled red circle, eagle-or-better
   = filled red double circle, bogey = black square outline, double-bogey-or-worse
   = black double square. The shapes are drawn with pseudo-elements that sit BEHIND
   the numeral (z-index:-1). The score-entry table reuses these classes but hides
   the shapes (see `.score-entry-table .birdie::before { display:none }` below), so
   the fill / numeral-colour rules are scoped with :not(.score-entry-table). */
.birdie,
.eagle,
.bogey,
.double-bogey {
    position: relative;
    z-index: 1;
}

.birdie::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #d32f2f;
    z-index: -1;
}

.eagle::before, .eagle::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: -1;
}

/* eagle: outer ring + inner filled disc = double circle */
.eagle::before {
    width: 32px;
    height: 32px;
    border: 1.5px solid #d32f2f;
}

.eagle::after {
    width: 26px;
    height: 26px;
    background-color: #d32f2f;
}

.bogey::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 26px;
    height: 26px;
    background-color: #1a1a1a;
    z-index: -1;
}

/* double bogey: concentric rings from the outside in — thin black border,
   thin white border, then the black fill. Done on a single border-box square:
   the black `border` is the outer ring, the inset white box-shadow is the
   middle ring, and the black `background` is the fill. */
.double-bogey::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    width: 26px;
    height: 26px;
    box-sizing: border-box;
    background-color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    box-shadow: inset 0 0 0 1.5px #fff;
}

/* All four marks are filled (red circles / black squares), so every numeral is
   white. Excluded from the score-entry table, which hides the shapes entirely. */
.scorecard-table:not(.score-entry-table) .birdie,
.scorecard-table:not(.score-entry-table) .eagle,
.scorecard-table:not(.score-entry-table) .bogey,
.scorecard-table:not(.score-entry-table) .double-bogey {
    color: #fff;
    font-weight: 700;
}

.scorecard-table .birdie,
.scorecard-table .eagle,
.scorecard-table .par,
.scorecard-table .bogey,
.scorecard-table .double-bogey {
    background-color: inherit;
}

/* ===== Scorecard Scoring Key (legend) ===== */
.scorecard-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 1.5rem;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: #555;
}

.scorecard-legend .legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    white-space: nowrap;
}

.scorecard-legend .legend-swatch {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    box-sizing: border-box;
}

/* Birdie: filled red circle */
.scorecard-legend .birdie-swatch {
    border-radius: 50%;
    background-color: #d32f2f;
}

/* Eagle or better: filled red double circle (disc + outer ring via box-shadow) */
.scorecard-legend .eagle-swatch {
    width: 10px;
    height: 10px;
    margin: 2px;
    border-radius: 50%;
    background-color: #d32f2f;
    box-shadow: 0 0 0 1.5px #fff, 0 0 0 3px #d32f2f;
}

/* Bogey: filled black square */
.scorecard-legend .bogey-swatch {
    background-color: #1a1a1a;
}

/* Double bogey or worse: black border, white border, then black fill */
.scorecard-legend .double-bogey-swatch {
    box-sizing: border-box;
    background-color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    box-shadow: inset 0 0 0 1.5px #fff;
}

@media (max-width: 768px) {
    .scorecard-legend {
        gap: 0.6rem 1rem;
        font-size: 0.72rem;
    }
}

/* ===== Handicap Stroke Dots ===== */
.stroke-dots {
    display: flex;
    gap: 2px;
    position: absolute;
    top: 3px;
    right: 3px;
}

/* No score yet on this hole: center the dots under the hole instead of the top-right corner. */
.stroke-dots.stroke-dots-centered {
    top: 50%;
    left: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    justify-content: center;
}

.stroke-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background-color: #333;
}

.stroke-dot.giving {
    background-color: #d32f2f;
}

/* ===== Player Stat Boxes ===== */
.player-stat-boxes {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

.stat-box {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem;
    background-color: #f5f5f5;
    border-radius: 4px;
    text-align: center;
}

.stat-label {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
}

/* ===== Stats Detail Table ===== */
.stat-section {
    margin-bottom: 1.5rem;
}

.stat-section h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.25rem;
    text-align: left;
}

.stats-detail-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.stats-detail-table th,
.stats-detail-table td {
    width: 33.33%;
}

.stats-detail-table th:last-child,
.stats-detail-table td:last-child {
    text-align: right;
}

.stats-detail-table th {
    padding: 8px;
    text-align: left;
    font-weight: bold;
    color: #9e9e9e;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
}

.stats-detail-table td {
    padding: 8px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* ===== Money Leader Section ===== */
.money-leader-section {
    margin: 20px 0;
    text-align: left;
}

.money-leader-section h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: #2c3e50;
}

.leader-card {
    background-color: #f2f2f2;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    max-width: 500px;
}

.leader-name {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.leader-total {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
}

.leader-details {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.leader-detail {
    margin-right: 20px;
    margin-bottom: 10px;
}

.detail-label {
    color: #666;
    margin-right: 5px;
    text-transform: uppercase;
    font-weight: 600;
}

.detail-value {
    font-weight: bold;
}

/* ===== Player Rankings Section ===== */
.player-rankings-section {
    margin: 30px 0;
    text-align: left;
}

.player-rankings-section h3 {
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: #2c3e50;
}

.rankings-table-wrapper {
    max-width: 500px;
}

.rankings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.rankings-table th,
.rankings-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.rankings-table th {
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.rankings-table th:last-child,
.rankings-table td:last-child {
    text-align: right;
}

/* ===== Sort Indicator ===== */
.sort-indicator {
    margin-left: 3px;
    font-size: 0.7rem;
}

.participation-indicator {
    margin-left: 0.4rem;
    font-size: 0.75rem;
    color: #777;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.skipped-pot {
    color: #888;
    font-style: italic;
    font-size: 0.85rem;
}

.info-note {
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f5f7fa;
    border-left: 3px solid #888;
    color: #555;
    font-size: 0.9rem;
}

/* ===== Course Stats Table ===== */
.course-stats-table th,
.course-stats-table td {
    padding: 8px;
}

.course-under-par {
    color: green;
}

.course-over-par {
    color: red;
}

.summary-row {
    background-color: #f5f5f5;
    font-weight: 600;
}

.out-row td, .in-row td {
    border-top: 1px solid #000 !important;
    border-bottom: 1px solid #ddd !important;
}

.total-row td {
    border-top: 2px solid #000 !important;
    border-bottom: none !important;
}

/* ===== Scorecard Mobile ===== */
@media (max-width: 768px) {
    .desktop-scorecard {
        display: none;
    }

    .mobile-scorecard {
        display: block;
    }

    .scorecard-table.front-nine {
        margin-bottom: 0;
    }

    .scorecard-table.back-nine {
        border-top: 3px solid #2c3e50;
        margin-top: 0;
    }

    .scorecard-table th,
    .scorecard-table td {
        padding: 0.7rem 0.1rem;
    }

    .scorecard-table .score-row td {
        padding-top: 0.9rem;
        padding-bottom: 0.9rem;
    }

    /* Net row keeps clear separation from the gross row above (see desktop note);
       symmetric so the numeral stays centred inside the mark. */
    .scorecard-table tr.net-row td {
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
    }

    .scorecard-table {
        font-size: 0.7rem;
    }

    .scorecard-table .hole-header,
    .scorecard-table .heading-cell {
        min-width: 3rem;
        max-width: 3.5rem;
    }

    .scorecard-table .hole-header {
        min-width: 100px;
    }

    .birdie::before,
    .bogey::before {
        width: 22px;
        height: 22px;
    }

    /* eagle: inner disc matches the birdie circle (22px) so it isn't visually
       smaller; outer ring sits 6px outside it to read as a double circle. */
    .eagle::before {
        width: 28px;
        height: 28px;
    }

    .eagle::after {
        width: 22px;
        height: 22px;
    }

    .double-bogey::before {
        width: 24px;
        height: 24px;
    }

    .stroke-dots {
        top: 2px;
        right: 2px;
        gap: 1px;
    }

    .stroke-dot {
        width: 4px;
        height: 4px;
    }

    .player-stat-boxes {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .stat-box {
        min-width: unset;
        padding: 0.5rem;
    }

    .leader-details {
        flex-direction: column;
    }

    .leader-detail {
        margin-bottom: 8px;
    }

    .course-info h4 {
        font-size: 1rem;
    }

    .course-stats-table {
        font-size: 0.7rem;
    }

    .course-stats-table th,
    .course-stats-table td {
        padding: 6px 4px;
    }
}

@media (max-width: 480px) {
    .course-stats-table {
        font-size: 0.65rem;
    }

    .course-stats-table th,
    .course-stats-table td {
        padding: 4px 2px;
    }
}

/* ===== Score Entry ===== */
.score-entry-card {
    max-width: 100%;
    overflow-x: auto;
}

.score-entry-table .score-input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.2rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 0.85rem;
    background: #fff;
    -moz-appearance: textfield;
}

.score-entry-table .score-input::-webkit-outer-spin-button,
.score-entry-table .score-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.score-entry-table .score-input:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.15);
}

.score-entry-table .ndb-exceeded .score-input {
    border-color: #e67e22;
    background: #fff3e0;
    color: #b35900;
    font-weight: 600;
}

.score-entry-table .ndb-exceeded .score-input:focus {
    border-color: #e67e22;
    box-shadow: 0 0 0 2px rgba(230, 126, 34, 0.25);
}

.ndb-legend {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.ndb-legend .ndb-swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    background: #fff3e0;
    border: 1px solid #e67e22;
    border-radius: 2px;
    vertical-align: middle;
    margin-right: 0.35rem;
}

.score-entry-table .birdie::before,
.score-entry-table .eagle::before,
.score-entry-table .eagle::after,
.score-entry-table .bogey::before,
.score-entry-table .double-bogey::before,
.score-entry-table .double-bogey::after {
    display: none;
}

.score-entry-table .score-input::placeholder {
    color: transparent;
}

.score-entry-table td {
    padding: 0.35rem 0.15rem;
}

.score-entry-table .player-name-cell {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
    overflow: hidden;
    white-space: normal;
    font-size: 0.85rem;
    line-height: 1.15;
    vertical-align: middle;
    padding: 0.4rem 0.5rem;
}

.score-entry-table .player-name-line {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.score-entry-table .player-meta-line {
    display: flex;
    gap: 0.35rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 0.15rem;
    font-size: 0.7rem;
    color: #6c757d;
    text-transform: none;
    font-weight: 500;
}

.score-entry-table .player-hcp-chip {
    background: #eef2f6;
    color: #2c3e50;
    border-radius: 3px;
    padding: 0 0.35rem;
    line-height: 1.4;
    letter-spacing: 0;
}

.score-entry-table .player-meta-line .tee-indicator {
    color: #6c757d;
    font-size: 0.7rem;
}

.score-entry-table .player-status-line {
    margin-top: 0.2rem;
}

/* Override the .scorecard-table .hole-header max-width inside score entry so
   the player-name column has room for full names + Hcp chip. */
.score-entry-table .hole-header {
    width: 160px;
    min-width: 160px;
    max-width: 160px;
}

/* Net row inside score entry: per-hole net value with small "net" label, italic muted styling. */
.score-entry-table .net-row td {
    padding-top: 0.15rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #ddd;
    font-style: italic;
    color: #555;
    background-color: #fafafa;
}

.score-entry-table .score-row td {
    border-bottom: none;
}

.score-entry-table .net-row .net-cell {
    line-height: 1;
}

.score-entry-table .net-row .net-label {
    display: block;
    font-size: 0.55rem;
    color: #9e9e9e;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-style: normal;
    line-height: 1;
    margin-bottom: 0.1rem;
}

.score-entry-table .net-row .net-value {
    display: block;
    font-size: 0.8rem;
    font-style: normal;
    font-weight: 500;
}

.score-entry-table .net-row .out-column,
.score-entry-table .net-row .in-column,
.score-entry-table .net-row .total-column {
    font-style: normal;
    font-weight: 600;
}

.score-entry-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.group-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.group-nav-label {
    font-weight: 600;
    font-size: 1rem;
}

.save-indicator {
    color: #27ae60;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

/* .over-par / .under-par are defined once near the top of this file under
   "Score Coloring" — traditional scorecard convention: under-par is red, over-par
   is default text. The earlier override here that inverted them has been removed. */

/* ===== Score Entry — Mobile (touch-optimized, hole-by-hole) ===== */
.score-entry-mobile {
    display: none;
}

.mobile-group-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.mobile-group-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    text-align: center;
    flex: 1;
}

.mobile-hole-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.mobile-hole-display {
    text-align: center;
    flex: 1;
}

.mobile-hole-number {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
}

.mobile-hole-par {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.1rem;
}

.mobile-hole-yardage {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3e50;
    margin-top: 0.35rem;
    line-height: 1.1;
}

.mobile-hole-tee {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.05rem;
}

.mobile-hole-other-tees {
    font-size: 0.75rem;
    color: #888;
    margin-top: 0.25rem;
    line-height: 1.3;
}

.mobile-arrow-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #fff;
    color: #2c3e50;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}

.mobile-arrow-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.mobile-arrow-btn:not(:disabled):active {
    background: #f0f0f0;
}

.mobile-hole-arrow {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.mobile-hole-arrow:not(:disabled):active {
    background: #1a252f;
}

.mobile-progress-track {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin: 0.25rem 0 0.75rem;
    overflow: hidden;
}

.mobile-progress-fill {
    height: 100%;
    background: #27ae60;
    transition: width 0.3s;
}

.mobile-player-card {
    padding: 0.75rem 0;
    border-bottom: 1px solid #eee;
}

.mobile-player-card:last-of-type {
    border-bottom: none;
}

.mobile-player-card.inactive {
    opacity: 0.55;
}

.mobile-player-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.mobile-player-name {
    /* Allow the name column to shrink/wrap so a long name + WD/DNS badge doesn't push
       the running totals off the row. (Not ellipsis — that would clip the status badge.) */
    min-width: 0;
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.mobile-player-running {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    font-size: 0.85rem;
}

.mobile-running-line {
    display: flex;
    gap: 0.4rem;
    align-items: baseline;
}

.mobile-running-net {
    font-size: 0.8rem;
    color: #555;
}

.mobile-running-net-label {
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 600;
}

.mobile-running-total {
    font-weight: 700;
    color: #2c3e50;
}

.mobile-running-ou {
    font-weight: 600;
}

.mobile-running-holes {
    color: #888;
    font-size: 0.8rem;
}

/* Inline stroke dots next to a player's name (score entry / live scoring). Plain round dots,
   no pill container: black .stroke-dot when receiving, red .stroke-dot.giving when a plus
   handicap gives a stroke back. Slightly larger than the leaderboard cell dots so they read
   next to name text. */
.stroke-dots-inline {
    display: inline-flex;
    gap: 3px;
    margin-left: 0.4rem;
    vertical-align: middle;
}

.stroke-dots-inline .stroke-dot {
    width: 7px;
    height: 7px;
}

.mobile-quick-pick {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.mobile-pick-btn {
    flex: 1;
    min-width: 0;
    height: 52px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: white;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: transform 0.1s, background 0.15s;
}

.mobile-pick-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-pick-btn:not(:disabled):active {
    transform: scale(0.95);
}

.mobile-pick-btn.par-btn {
    border-color: #2c3e50;
    border-width: 3px;
}

.mobile-pick-btn.selected.eagle {
    background: #1e88e5;
    color: white;
    border-color: #1e88e5;
}

.mobile-pick-btn.selected.birdie {
    background: #27ae60;
    color: white;
    border-color: #27ae60;
}

.mobile-pick-btn.selected.par-score {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.mobile-pick-btn.selected.bogey {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
}

.mobile-pick-btn.selected.double-plus {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.mobile-pick-btn.ndb-warning {
    box-shadow: inset 0 0 0 2px #e67e22;
}

.mobile-pick-more {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 2px dashed #ccc;
    background: #f9f9f9;
    color: #888;
    font-size: 1.2rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.mobile-pick-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mobile-pick-more.expanded {
    border-style: solid;
    border-color: #2c3e50;
    background: #eee;
}

.mobile-more-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.mobile-more-value.eagle { color: #1e88e5; }
.mobile-more-value.birdie { color: #27ae60; }
.mobile-more-value.par-score { color: #6c757d; }
.mobile-more-value.bogey { color: #f39c12; }
.mobile-more-value.double-plus { color: #dc3545; }

.mobile-pick-expanded {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.mobile-pick-expanded-btn {
    flex: none;
    height: 44px;
    font-size: 1.05rem;
}

.mobile-ndb-warning {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: #fff3e0;
    border-left: 3px solid #e67e22;
    color: #b35900;
    font-size: 0.8rem;
    border-radius: 0 4px 4px 0;
}

.mobile-inactive-note {
    color: #888;
    font-size: 0.85rem;
    font-style: italic;
    padding: 0.25rem 0;
}

@media (max-width: 768px) {
    .score-entry-table .score-input {
        font-size: 0.75rem;
    }

    .score-entry-table .player-name-cell {
        min-width: 70px;
        max-width: 100px;
        font-size: 0.7rem;
    }

    .score-entry-table td {
        padding: 0.25rem 0.1rem;
    }

    .score-entry-desktop {
        display: none;
    }

    .score-entry-mobile {
        display: block;
    }
}

/* ===== Trip Dashboard ===== */
.dashboard-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.rsvp-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border);
}

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

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

.rsvp-row-title {
    font-weight: 500;
}

.rsvp-row-meta {
    color: var(--color-text-muted);
    font-size: 0.85em;
}

.rsvp-row-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

@media (max-width: 600px) {
    .rsvp-row {
        flex-direction: column;
        align-items: stretch;
    }
}

.stat-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
}

.stat-label {
    font-size: 0.8rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.checklist {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0;
    color: #666;
}

.checklist-item.complete {
    color: #2c3e50;
}

.checklist-icon {
    font-size: 1.1rem;
    width: 1.5rem;
    text-align: center;
}

.checklist-item.complete .checklist-icon {
    color: #27ae60;
}

.checklist-summary {
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.checklist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.checklist-header h3 {
    margin: 0;
}

/* Checklist rows that deep-link to their setup screen. */
a.checklist-link {
    text-decoration: none;
    border-radius: 6px;
    margin: 0 -0.5rem;
    padding: 0.4rem 0.5rem;
    transition: background-color 0.15s;
}

a.checklist-link:hover {
    background-color: #f5f5f5;
}

.quick-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

/* ===== Setup Guide ===== */
/* Get-started banner shown on an empty leaderboard for the commissioner. */
.setup-cta-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    background: #f0f7ff;
    border: 1px solid #cfe3fb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.setup-cta-text h3 {
    margin: 0 0 0.25rem;
    color: #2c3e50;
}

.setup-cta-text p {
    margin: 0;
    color: #555;
    font-size: 0.92rem;
}

.setup-cta-banner .btn {
    flex: 0 0 auto;
}

.setup-intro {
    color: #666;
    margin: 0 0 1rem;
    line-height: 1.5;
}

.setup-progress {
    margin-bottom: 1.25rem;
}

.setup-progress-bar {
    height: 8px;
    background: #eceff1;
    border-radius: 999px;
    overflow: hidden;
}

.setup-progress-fill {
    height: 100%;
    background: #27ae60;
    border-radius: 999px;
    transition: width 0.3s ease;
}

.setup-progress-label {
    margin-top: 0.4rem;
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.setup-steps {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.setup-step {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1rem;
}

.setup-step.next {
    border-color: #2c3e50;
    box-shadow: 0 2px 8px rgba(44, 62, 80, 0.12);
}

.setup-step-marker {
    flex: 0 0 auto;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #eceff1;
    color: #607d8b;
}

.setup-step.complete .setup-step-marker {
    background: #27ae60;
    color: white;
}

.setup-step.next .setup-step-marker {
    background: #2c3e50;
    color: white;
}

.setup-step-body {
    flex: 1 1 auto;
    min-width: 0;
}

.setup-step-title {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.setup-step-pill {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: #2c3e50;
    color: white;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
}

.setup-step-blurb {
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.2rem;
    line-height: 1.4;
}

.setup-step-action {
    flex: 0 0 auto;
}

.setup-step-optional {
    border: none;
    padding: 0;
}

.setup-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 600px) {
    .setup-step {
        flex-wrap: wrap;
    }

    .setup-step-action {
        flex-basis: 100%;
    }

    .setup-step-action .btn {
        width: 100%;
    }
}

/* ===== Live Scoring (Mobile) ===== */

.minimal-layout {
    max-width: 480px;
    margin: 0 auto;
    padding: 0;
    min-height: 100dvh;
    background: white;
}

/* Loading state */
.live-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    gap: 1rem;
    color: #666;
}

/* Invalid state */
.live-invalid {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 2rem;
    text-align: center;
}

.live-invalid-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.live-invalid h2 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.live-invalid p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Confirmation page */
.live-confirm {
    padding: 2rem 1.5rem;
}

.live-confirm-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.live-confirm-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.live-confirm-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin: 0;
}

.live-confirm-card {
    background: #f2f2f2;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.live-confirm-round {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
}

.live-confirm-label {
    color: #666;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.live-confirm-value {
    font-weight: 600;
    color: #2c3e50;
}

.live-confirm-group-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.live-confirm-players {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.live-confirm-player {
    padding: 0.3rem 0;
    font-size: 0.95rem;
    color: #333;
}

.live-notstarted-notice {
    background: #fff8e1;
    border: 1px solid #f0d878;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    color: #5b4a16;
}

.live-notstarted-notice strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 0.4rem;
    color: #3d2f00;
}

/* Par 3 contest card (magic-link scorer only, shown on par-3 holes) */
.par3-contest-card {
    background: #f1f7ee;
    border: 1px solid #c9deba;
    border-radius: 10px;
    padding: 0.85rem 1rem 1rem;
    margin: 0.75rem 1rem 0.5rem;
    box-sizing: border-box;
}

.par3-contest-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.par3-contest-title {
    font-weight: 700;
    font-size: 1rem;
    color: #2c3e50;
}

.par3-contest-rule {
    font-size: 0.8rem;
    color: #5b6e51;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.par3-contest-state {
    font-size: 0.9rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.par3-contest-state-winner strong {
    color: #2c3e50;
}

.par3-contest-state-winner .par3-contest-amount {
    margin-left: 0.5rem;
    color: #5b6e51;
    font-weight: 600;
}

.par3-contest-state-noq {
    color: #8a6d1a;
    background: #fff8e1;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    border: 1px solid #f0d878;
}

.par3-contest-players {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.6rem;
}

.par3-contest-player {
    display: block;
    width: 100%;
    min-height: 44px;
    box-sizing: border-box;
    text-align: left;
    background: #fff;
    border: 1px solid #d0d7c5;
    border-radius: 6px;
    padding: 0.6rem 0.85rem;
    font-size: 0.95rem;
    color: #2c3e50;
    cursor: pointer;
    font-family: inherit;
}

.par3-contest-player:hover:not(:disabled) {
    background: #f5f8f1;
}

.par3-contest-player:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.par3-contest-player.selected {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}

.par3-contest-notes {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.6rem;
}

.par3-contest-notes label {
    font-size: 0.8rem;
    color: #5b6e51;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.par3-contest-notes input {
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border: 1px solid #d0d7c5;
    border-radius: 6px;
    /* 16px (not 0.95rem) so iOS doesn't zoom-focus this field — its class selector
       would otherwise out-specify the global ≤768px 16px input guard. */
    font-size: 16px;
    background: #fff;
    box-sizing: border-box;
}

.par3-contest-notes input:disabled {
    background: #f0f0f0;
    color: #999;
}

.par3-contest-actions {
    display: flex;
    gap: 0.5rem;
}

.par3-contest-noq-btn,
.par3-contest-clear-btn {
    flex: 1;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    border: 1px solid #d0d7c5;
    background: #fff;
    color: #2c3e50;
}

.par3-contest-noq-btn:hover:not(:disabled),
.par3-contest-clear-btn:hover:not(:disabled) {
    background: #f5f8f1;
}

.par3-contest-noq-btn.selected {
    background: #8a6d1a;
    color: #fff;
    border-color: #8a6d1a;
}

.par3-contest-clear-btn {
    color: #c0392b;
    border-color: #e3b7b3;
}

.par3-contest-clear-btn:hover:not(:disabled) {
    background: #fdf3f2;
}

.par3-contest-error {
    margin-top: 0.5rem;
    color: #c0392b;
    font-size: 0.85rem;
}

.live-notstarted-notice p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.btn-start-scoring {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-top: 1.5rem;
    background: #2c3e50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-start-scoring:hover {
    background: #1a252f;
}

/* Landing page (anonymous, list of in-progress rounds + group scoring links) */
.landing-page {
    padding: 1.5rem 1rem 2rem;
    max-width: 600px;
    margin: 0 auto;
}

.landing-subtitle {
    color: #666;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.landing-empty {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

.landing-round {
    margin-bottom: 1.75rem;
}

.landing-round-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0 0.25rem 0.5rem;
    border-bottom: 1px solid #ddd;
    margin-bottom: 0.75rem;
}

.landing-round-day {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.landing-round-course {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1.05rem;
}

.landing-round-format {
    font-size: 0.75rem;
    background: #2c3e50;
    color: white;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.landing-group-link {
    display: block;
    background: #f2f2f2;
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.6rem;
    color: #2c3e50;
    text-decoration: none;
    border: 1px solid transparent;
    transition: background 0.15s, border-color 0.15s;
}

.landing-group-link:hover,
.landing-group-link:active {
    background: #e6ecf1;
    border-color: #2c3e50;
}

.landing-group-title {
    font-weight: 600;
    font-size: 1rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.landing-group-players {
    color: #444;
    font-size: 0.95rem;
}

.landing-group-cta {
    margin-top: 0.5rem;
    color: #2c3e50;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Scoring interface */
.live-scoring {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
}

.live-scoring-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #2c3e50;
    color: white;
    padding: 0.75rem 1rem 0.5rem;
}

.live-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.live-hole-label {
    font-size: 1.2rem;
    font-weight: 700;
}

.live-par-label {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

.live-progress-label {
    font-size: 0.85rem;
    opacity: 0.7;
}

.live-hole-info {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    color: white;
}

.live-hole-yardage {
    font-size: 1.35rem;
    font-weight: 700;
}

.live-hole-tee {
    font-size: 0.85rem;
    opacity: 0.85;
}

.progress-bar-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

.progress-bar-fill {
    height: 100%;
    background: #28a745;
    border-radius: 2px;
    transition: width 0.3s;
}

/* Player sections */
.live-players-container {
    flex: 1;
    overflow-y: auto;
    /* Reserve room for the fixed .hole-nav bar, including its safe-area inset, so the
       last hole's score buttons aren't hidden behind it. */
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.player-score-section {
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #eee;
}

.player-score-name {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.player-name-text {
    flex-shrink: 0;
}

.player-saved-indicator {
    color: #28a745;
    font-size: 0.9rem;
}

.scramble-team-roster {
    font-size: 0.8rem;
    color: #666;
    margin: -0.3rem 0 0.6rem 0;
    font-weight: 400;
}

.player-running {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    font-weight: 600;
}

.player-running-line {
    display: flex;
    gap: 0.35rem;
    align-items: baseline;
    font-size: 0.95rem;
}

.player-running-net {
    display: flex;
    gap: 0.3rem;
    align-items: baseline;
    font-size: 0.78rem;
    color: #555;
}

.player-running-net-label {
    text-transform: uppercase;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    color: #888;
    font-weight: 600;
}

.player-running-total {
    color: #2c3e50;
}

/* Quick-pick buttons */
.quick-pick-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.quick-pick-btn {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 2px solid #ddd;
    background: white;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.quick-pick-btn:active {
    transform: scale(0.95);
}

.quick-pick-btn.par-btn {
    border-color: #2c3e50;
    border-width: 3px;
}

/* Selected states with score colors */
.quick-pick-btn.selected.eagle {
    background: #1e88e5;
    color: white;
    border-color: #1e88e5;
}

.quick-pick-btn.selected.birdie {
    background: #28a745;
    color: white;
    border-color: #28a745;
}

.quick-pick-btn.selected.par-score {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

.quick-pick-btn.selected.bogey {
    background: #f39c12;
    color: white;
    border-color: #f39c12;
}

.quick-pick-btn.selected.double-plus {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* More button */
.quick-pick-more {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 2px dashed #ccc;
    background: #f9f9f9;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    -webkit-tap-highlight-color: transparent;
}

.quick-pick-more.expanded {
    border-color: #2c3e50;
    border-style: solid;
    background: #eee;
}

.more-with-value {
    font-size: 1.2rem;
    font-weight: 700;
}

.more-with-value.eagle { color: #1e88e5; }
.more-with-value.birdie { color: #28a745; }
.more-with-value.par-score { color: #6c757d; }
.more-with-value.bogey { color: #f39c12; }
.more-with-value.double-plus { color: #dc3545; }

/* Expanded picker grid */
.expanded-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.4rem;
    padding: 0.75rem 0;
    margin-top: 0.5rem;
}

.expanded-picker .expanded-btn {
    width: 100%;
    height: 44px;
    font-size: 1.1rem;
}

/* Auto-advance indicator */
.auto-advance-indicator {
    text-align: center;
    padding: 0.5rem;
    background: #d4edda;
    color: #155724;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Error */
.live-error {
    text-align: center;
    padding: 0.5rem;
    background: #f8d7da;
    color: #721c24;
    font-size: 0.85rem;
}

/* Bottom navigation */
.hole-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    /* Clear the iPhone home indicator so Prev / hole-jump / Next-Finish stay tappable. */
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    background: white;
    border-top: 1px solid #eee;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    z-index: 40;
}

.hole-nav-btn {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    min-width: 100px;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.hole-nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.hole-nav-btn.primary {
    background: #2c3e50;
    color: white;
}

.hole-nav-btn.primary:hover:not(:disabled) {
    background: #1a252f;
}

.hole-nav-btn.secondary {
    background: #e0e0e0;
    color: #2c3e50;
}

.hole-nav-btn.secondary:hover:not(:disabled) {
    background: #d0d0d0;
}

.hole-jump-select {
    flex: 0 0 auto;
    padding: 0.6rem 0.5rem;
    /* 16px (not 0.95rem) to avoid iOS zoom-focus; also a 44px tap target. */
    font-size: 16px;
    min-height: 44px;
    font-weight: 600;
    color: #2c3e50;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-width: 90px;
    text-align: center;
    text-align-last: center;
    -webkit-tap-highlight-color: transparent;
}

.hole-jump-select:disabled {
    opacity: 0.5;
}

.live-sync-banner {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.5rem 0.75rem 0;
    padding: 0.5rem 0.75rem;
    background: #fff8e1;
    border: 1px solid #f0d68a;
    color: #6b5300;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.3;
}

.live-sync-banner.fatal {
    background: #f8d7da;
    border-color: #f1aeb5;
    color: #721c24;
}

.live-sync-banner-text {
    flex: 1;
}

.live-sync-banner-btn {
    background: #721c24;
    color: white;
    border: none;
    padding: 0.35rem 0.85rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

.live-sync-spinner {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: live-sync-spin 0.9s linear infinite;
    flex-shrink: 0;
}

@keyframes live-sync-spin {
    to { transform: rotate(360deg); }
}

.live-summary-syncing {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem;
    padding: 0.6rem 0.85rem;
    background: #fff8e1;
    border: 1px solid #f0d68a;
    color: #6b5300;
    border-radius: 8px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.save-indicator {
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
}

/* Summary page */
.live-summary {
    padding: 2rem 1.5rem;
}

.live-summary-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.live-summary-header h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 0.25rem;
}

.live-summary-header p {
    color: #666;
    font-size: 0.9rem;
}

.live-summary-table {
    background: #f2f2f2;
    border-radius: 8px;
    overflow: hidden;
}

.live-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid #e0e0e0;
}

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

.live-summary-name {
    font-weight: 600;
    color: #2c3e50;
}

.live-summary-scores {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.live-summary-total {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
}

.live-summary-ou {
    font-size: 0.9rem;
    font-weight: 600;
}

/* Match the global scorecard convention: under-par red, over-par default. */
.live-summary-ou.over-par { color: inherit; }
.live-summary-ou.under-par { color: #dc3545; }

.live-summary-incomplete {
    font-size: 0.8rem;
    color: #999;
}

/* ===== Share Links Modal ===== */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 200;
}

/* Background scroll-lock: while any bottom sheet / modal dialog is open (each renders a
   .modal-backdrop), freeze the page behind it so touch/scroll can't move the background.
   The sheet itself stays scrollable via .modal-panel's own overflow-y + overscroll-behavior.
   Keyed off the backdrop with :has() so every current and future sheet is covered with no
   per-component wiring. overscroll-behavior:none also kills iOS rubber-band chaining. */
html:has(.modal-backdrop),
body:has(.modal-backdrop) {
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: none;
}

.modal-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px 12px 0 0;
    padding: 1.5rem;
    /* Keep the sheet's bottom content above the home indicator on devices with a
       bottom inset; collapses to the base 1.5rem on everything else. */
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    z-index: 201;
    max-height: 80vh;
    overflow-y: auto;
    /* Scrolling inside a sheet shouldn't chain to / bounce the page behind it. */
    overscroll-behavior: contain;
    /* The background lock sets touch-action:none on body; re-enable vertical panning here so
       the sheet's own content stays scrollable on touch (touch-action isn't inherited, but be
       explicit so a long sheet never gets stuck). */
    touch-action: pan-y;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* Grabber handle — the visual cue that a bottom sheet can be swiped down to
   dismiss (drag handled by js/sheet-dismiss.js). Only in bottom-sheet mode. */
@media (max-width: 480px) {
    /* Bottom sheets span the full phone width. Several dialogs carry an inline
       max-width sized for the desktop centered-dialog variant (e.g. settings 420px,
       shorten 360px); without this override that cap shrinks the sheet while left:0
       pins it to the left, leaving a gap on the right. !important is required to
       beat the inline style. */
    .modal-panel {
        max-width: none !important;
    }

    .modal-panel::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        margin: -0.5rem auto 0.75rem;
        border-radius: 2px;
        background: #d0d0d0;
    }
}

.modal-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.modal-panel-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0.25rem 0.5rem;
}

.modal-subtitle {
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.link-row {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.link-row:last-of-type {
    border-bottom: none;
}

.link-group-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
    color: #2c3e50;
}

.link-players {
    font-weight: 400;
    color: #666;
}

.link-url-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.link-input {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f9f9f9;
    color: #666;
    font-family: monospace;
}

@media (min-width: 481px) {
    .modal-panel {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%);
        bottom: 10%;
        border-radius: 12px;
    }
}

/* Full-screen variant for dense, multi-field forms (e.g. edit round): on phones
   take the whole screen instead of an 80vh sheet so long forms aren't cramped.
   On tablet/desktop it falls through to the centered-dialog rules above. */
@media (max-width: 480px) {
    .modal-panel--full {
        top: 0;
        max-height: none;
        border-radius: 0;
        /* Clear the status bar / notch now that the panel reaches the top edge.
           The bottom inset is already inherited from .modal-panel. */
        padding-top: calc(1.5rem + env(safe-area-inset-top));
    }
}

/* Rounds list status filter. */
.round-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.85rem;
}

.round-filter-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: 600;
    color: #666;
}

.round-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
}

.round-filter-caret {
    color: #888;
    font-size: 0.7rem;
}

/* Filter options inside the bottom sheet. */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filter-option {
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.filter-option:hover {
    border-color: #2c3e50;
}

.filter-option.active {
    border-color: #2c3e50;
    background: #f7f9fb;
}

.filter-option:disabled {
    color: #bbb;
    cursor: not-allowed;
    background: #fafafa;
}

/* ===== Unified dropdown (SheetSelect) =====
   Bordered-field trigger: looks like a text input so it reads unambiguously as a form control,
   with a chevron as the "this opens" affordance. Full-width, 44px tap target. The matching bottom
   sheet reuses .modal-panel + .filter-options above. */
.sheet-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 0.5rem 0.55rem 0.85rem;
    background: white;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    /* 16px keeps parity with the iOS focus-zoom guard on real inputs. */
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
    color: #2c3e50;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
}

/* Width modifier for inline / filter placements that shouldn't be full-bleed. */
.sheet-select-trigger--auto {
    width: auto;
    min-width: 12rem;
}

.sheet-select-trigger:hover:not(:disabled) {
    border-color: #9aa5b1;
}

.sheet-select-trigger:focus-visible,
.sheet-select-trigger.open {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.12);
}

.sheet-select-trigger:disabled {
    background: #f5f5f5;
    color: #9e9e9e;
    cursor: not-allowed;
}

.sheet-select-trigger__value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sheet-select-trigger__value.placeholder {
    color: #9aa5b1;
    font-weight: 400;
}

.sheet-select-trigger__caret {
    flex-shrink: 0;
    color: #667085;
    font-size: 1.4rem;
}

.sheet-select-trigger:disabled .sheet-select-trigger__caret {
    color: #bbb;
}

/* Stacked variant: a SheetSelect opened from inside an already-open .modal-panel (z-index 201)
   must layer above it. Standalone usage is unaffected (just a higher z than the page). */
.modal-backdrop--stacked {
    z-index: 220;
}

.modal-panel--stacked {
    z-index: 221;
}

/* ===== Unified inline/in-table dropdown (.native-select) =====
   Compact native <select> styled to match the SheetSelect trigger — used for dense in-table
   micro-selects (per-player tee, position pairings, attendance) where a full bottom sheet would be
   heavy. appearance:none + an inline chevron SVG so the caret looks identical across OSes. */
.native-select {
    appearance: none;
    -webkit-appearance: none;
    background-color: white;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1rem;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    padding: 0.4rem 1.9rem 0.4rem 0.6rem;
    font-size: 0.9rem;
    font-family: inherit;
    color: #2c3e50;
    min-height: 36px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.native-select:hover:not(:disabled) {
    border-color: #9aa5b1;
}

.native-select:focus {
    outline: none;
    border-color: #2c3e50;
    box-shadow: 0 0 0 2px rgba(44, 62, 80, 0.12);
}

.native-select:disabled {
    background-color: #f5f5f5;
    color: #9e9e9e;
    cursor: not-allowed;
    opacity: 1;
}

/* ===== Round Setup wizard ===== */
.wiz-steps {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.wiz-step {
    flex: 1;
    min-width: 70px;
    text-align: center;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    color: #9e9e9e;
    padding: 0.4rem 0.3rem;
    border-bottom: 3px solid #e0e0e0;
}

.wiz-step.active {
    color: #2c3e50;
    border-bottom-color: #2c3e50;
}

.wiz-step.done {
    color: #27ae60;
    border-bottom-color: #27ae60;
}

.wiz-search-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wiz-search-input {
    flex: 1;
    padding: 0.7rem 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
}

.wiz-search-input:focus {
    outline: none;
    border-color: #2c3e50;
}

.wiz-search-btn {
    width: auto;
    flex: 0 0 auto;
    padding-left: 1.25rem;
    padding-right: 1.25rem;
}

.wiz-resolving {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #666;
    padding: 1rem 0;
}

.wiz-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wiz-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wiz-result:hover {
    border-color: #2c3e50;
    background: #f7f9fb;
}

.wiz-result:active {
    transform: scale(0.99);
}

.wiz-result-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.wiz-result-name {
    font-weight: 600;
    color: #2c3e50;
}

.wiz-result-sub {
    font-size: 0.8rem;
    color: #777;
    margin-top: 0.15rem;
}

.wiz-tag {
    flex: 0 0 auto;
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 700;
    color: #27ae60;
    background: #eafaf0;
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
}

.wiz-selected {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    background: #f2f2f2;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.wiz-selected-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
}

.wiz-selected-name {
    font-weight: 600;
    color: #2c3e50;
}

/* Segmented control — large, easy-to-tap toggle row. */
.seg-control {
    display: flex;
    gap: 0;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
}

.seg-option {
    flex: 1;
    background: white;
    border: none;
    border-right: 1px solid #ccc;
    padding: 0.7rem 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.seg-option:last-child {
    border-right: none;
}

.seg-option.active {
    background: #2c3e50;
    color: white;
}

.seg-option:disabled {
    color: #bbb;
    cursor: not-allowed;
    background: #f5f5f5;
}

/* Tee picker — tappable cards. */
.wiz-tees {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tee-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    text-align: left;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.tee-card.active {
    border-color: #2c3e50;
    background: #f7f9fb;
}

.tee-card-name {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.tee-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.2);
    display: inline-block;
}

.tee-card-meta {
    font-size: 0.8rem;
    color: #777;
}

.wiz-advanced-toggle {
    background: none;
    border: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem 0;
}

.wiz-advanced {
    border-top: 1px solid #eee;
    padding-top: 0.75rem;
    margin-bottom: 0.5rem;
}

.wiz-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.wiz-actions .btn {
    flex: 1;
}

.wiz-next {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.wiz-section {
    border-top: 1px solid #eee;
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.wiz-copy-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.35rem;
}

.wiz-copy-row .link-input {
    flex: 1;
}

.wiz-copy-row .btn {
    width: auto;
    flex: 0 0 auto;
}

.wiz-hint {
    font-size: 0.78rem;
    color: #888;
    margin-top: 0.35rem;
}

/* Players checklist — large tap rows. */
.wiz-players {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 0.75rem;
}

.wiz-player {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wiz-player.checked {
    border-color: #2c3e50;
    background: #f7f9fb;
}

.wiz-player input[type="checkbox"] {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    accent-color: #2c3e50;
}

.wiz-player-name {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.wiz-player-hcp {
    flex: 0 0 auto;
    font-size: 0.8rem;
    color: #777;
    font-variant-numeric: tabular-nums;
}

.wiz-addplayer-btn {
    width: auto;
}

.wiz-groupbuild {
    border-top: 1px solid #eee;
    margin-top: 1rem;
    padding-top: 0.5rem;
}

/* Manual in-wizard group assignment. */
.wiz-manual {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.wiz-mgroup {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
}

.wiz-mgroup-head {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.4rem;
}

.wiz-mgroup-members {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.wiz-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #eef2f5;
    border-radius: 999px;
    padding: 0.25rem 0.3rem 0.25rem 0.7rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #2c3e50;
}

.wiz-chip-x {
    border: none;
    background: #d8e0e6;
    color: #2c3e50;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    line-height: 1;
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0;
}

.wiz-massign-btn {
    width: auto;
}

/* Player-picker bottom sheet (manual grouping). */
.wiz-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wiz-pick {
    width: 100%;
    text-align: left;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.85rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.wiz-pick:hover {
    border-color: #2c3e50;
    background: #f7f9fb;
}

.wiz-pick:active {
    transform: scale(0.99);
}

.wiz-unassigned {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.85rem;
    color: #555;
    padding: 0.5rem 0.2rem 0;
}

/* Wager toggles. */
.wiz-wagers {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wiz-wager {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 0.7rem 0.9rem;
}

.wiz-wager.on {
    border-color: #2c3e50;
    background: #f7f9fb;
}

.wiz-wager-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.wiz-wager-label {
    font-weight: 600;
    color: #2c3e50;
}

.wiz-wager-amount {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 0.6rem;
}

.wiz-amount-prefix {
    font-weight: 600;
    color: #555;
}

.wiz-wager-amount input {
    width: 8rem;
}

.wiz-wager-pots {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.6rem;
}

.wiz-pot {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.wiz-pot-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
}

.wiz-pot .wiz-wager-amount {
    margin-top: 0;
}

.wiz-pot .wiz-wager-amount input {
    width: 6rem;
}

.wiz-wager-scoring {
    margin-top: 0.75rem;
}

.wiz-wager-scoring .seg-control {
    margin-top: 0.25rem;
}

.wiz-back {
    background: none;
    border: none;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0 0 0.5rem;
}

.wiz-back:disabled {
    color: #bbb;
    cursor: not-allowed;
}

/* Review list (Done stage). */
.wiz-review {
    margin: 0 0 1rem;
}

.wiz-review > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eee;
}

.wiz-review dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #888;
    font-weight: 600;
    margin: 0;
}

.wiz-review dd {
    margin: 0;
    text-align: right;
    color: #2c3e50;
    font-weight: 600;
}

/* ===== Scoring Banner (sticky "Back to Score Entry") ===== */
.scoring-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    background: #2c3e50;
    padding: 0.5rem 1rem;
    text-align: center;
}

.scoring-banner-link {
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
}

.scoring-banner-link:hover {
    text-decoration: underline;
    color: #e0e0e0;
}

/* ===== Live Scoring — Leaderboard Links ===== */
.live-leaderboard-link {
    display: block;
    text-align: center;
    margin-top: 1.25rem;
    color: #2c3e50;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
}

.live-leaderboard-link:hover {
    text-decoration: underline;
}

.live-leaderboard-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.15);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
}

.live-leaderboard-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

/* ===== League pages ===== */
.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: flex-end;
    margin-bottom: 10px;
}

.form-group-grow {
    flex: 1 1 240px;
}

.member-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    margin-right: 6px;
    margin-bottom: 4px;
    background: #f9fafb;
    font-size: 0.8rem;
}

.captain-tag {
    display: inline-block;
    background: #1e40af;
    color: white;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: bold;
}

.member-remove {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 2px;
}

.member-remove:hover {
    color: #b91c1c;
}

.add-member {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.add-member select {
    min-width: 180px;
}

.captain-checkbox {
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.col-actions {
    width: 1%;
    white-space: nowrap;
}

.inactive-row {
    opacity: 0.5;
}

.button-row {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.standings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.standings-grid .span-full {
    grid-column: 1 / -1;
}

.standings-grid .card-title {
    margin-top: 0;
    margin-bottom: 12px;
}

.col-rank {
    width: 40px;
    text-align: center;
}

.col-numeric {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

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

/* ===== Match-play matchup chips + detail ===== */
.matchup-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.matchup-chip {
    display: inline-block;
    padding: 2px 10px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 0.8rem;
    text-decoration: none;
}

.matchup-chip:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.matchup-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 0;
}

.matchup-header .team-score {
    text-align: center;
    flex: 0 1 220px;
}

.matchup-header .team-name {
    font-size: 1rem;
    color: #374151;
}

.matchup-header .team-points {
    font-size: 2.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1;
    margin-top: 4px;
}

.matchup-header .vs {
    color: #9ca3af;
    font-weight: 600;
    font-size: 0.875rem;
}

.matchup-header .overridden-tag {
    font-size: 0.7rem;
    color: #92400e;
    margin-top: 4px;
}

.adjustment-reason {
    font-size: 0.8rem;
    color: #6b7280;
    margin-left: 8px;
    font-style: italic;
}

.slot-summary {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 8px;
}

.data-table.compact {
    font-size: 0.8rem;
}

.data-table tr.winner-a td {
    background: #dcfce7;
}

.data-table tr.winner-b td {
    background: #fee2e2;
}

.hole-winner {
    text-align: center;
    color: #6b7280;
    font-weight: 600;
}

.status-success {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.group-tee-time {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    color: #1e3a8a;
    font-size: 0.75rem;
    font-weight: 600;
    vertical-align: middle;
}

/* ===== Pairing sheet ===== */
.pairing-sheet-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.pairing-sheet {
    max-width: 920px;
    margin: 0 auto;
}

.pairing-sheet-header {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.pairing-sheet-header h1 {
    margin: 0;
    font-size: 1.25rem;
}

.pairing-sheet-header .course-line {
    color: #6b7280;
    font-size: 0.85rem;
}

.pairing-card {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 12px;
    page-break-inside: avoid;
    break-inside: avoid;
}

.pairing-card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 8px;
    font-weight: 600;
}

.pairing-card-header .group-number {
    font-size: 1rem;
}

.pairing-card-header .tee-time {
    font-size: 1.1rem;
    color: #1f2937;
}

.pairing-table {
    margin: 0;
    font-size: 0.85rem;
}

@media print {
    .no-print, .main-nav, header, footer { display: none !important; }
    body { background: white; padding: 0; }
    .pairing-card {
        box-shadow: none;
        border-color: #9ca3af;
    }
}

/* ===== Touch Targets (P1.2) =====
   Bring high-frequency interactive controls up toward the ~44px touch minimum.
   The close button is safe to enlarge everywhere; the rest are scoped to mobile
   so desktop table/toolbar density is unchanged. Bottom-nav items (56px) and
   .more-link (44px) are already sized in the nav section. */
.modal-close-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

/* Public results / schedule layout. Defined globally (NOT in a page <style>) so the
   registration pages that reuse these classes — PublicSchedule, SlotPicker — are styled
   on a cold load, not only while EventResults.razor happens to be in the render tree.
   EventResults keeps only its @media print overrides locally. */
.results-page { max-width: 960px; margin: 0 auto; padding: 1.5rem; }
.results-header { margin-bottom: 2rem; }
.results-header h1 { margin-bottom: 0.25rem; }
.results-flight, .results-money, .results-side-games, .results-rounds { margin-bottom: 2.5rem; }
.results-round { margin-bottom: 0.5rem; }
.results-round summary { cursor: pointer; padding: 0.5rem 0; font-weight: 500; }
.results-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #ddd; text-align: center; }

/* Small helpers flagged undefined in the Tier-1 audit (rendered as default block before). */
.tiebreak-tag { font-size: 0.7rem; color: #888; white-space: nowrap; }
.account-group-header { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; flex-wrap: wrap; }

@media (max-width: 480px) {
    .results-page { padding: 0.75rem; }
    /* Long label/value rows wrap instead of crowding on a narrow phone. */
    .detail-row { flex-wrap: wrap; }
}

/* Touch-target sweep — ≤768px only (desktop density unchanged): secondary nav / disclosure
   elements that were below the 44px floor (Tier-1 audit P2). */
@media (max-width: 768px) {
    .sub-nav li a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
    }

    .results-round summary {
        min-height: 44px;
        padding: 0.75rem 0;
    }

    a.checklist-link {
        min-height: 44px;
    }
}

@media (max-width: 768px) {
    /* Buttons grow via vertical padding so the label stays centered (inline-block).
       Horizontal padding is left untouched. */
    .btn {
        padding-top: 0.8rem;
        padding-bottom: 0.8rem;
    }

    .btn-small {
        padding-top: 0.7rem;
        padding-bottom: 0.7rem;
    }

    /* Result / week pills: guarantee height and vertically center the label
       (+ in-progress / upcoming markers). */
    .round-pills li {
        min-height: 40px;
        display: inline-flex;
        align-items: center;
    }

    /* Table row-action kebab triggers (28px on desktop). */
    .row-actions__trigger {
        width: 40px;
        height: 40px;
    }
}

/* ===== Responsive card tables (mobile) — P1.3 =====
   Opt-in via class "data-table--cards" on a .data-table. On phones each row
   collapses to a card and each cell becomes a labelled row (label pulled from
   the cell's data-label attribute). Desktop renders the normal table. */

/* card-only content is mobile-card-only; hidden in the desktop table. The matching
   "show in card" rule lives in the @media block below. */
.card-only {
    display: none;
}

/* Mobile-only totals summary card (Skins / Money List). On phones the spreadsheet-style
   tfoot reads as a second table, so we hide it (table gets .data-table--summary) and show
   this purpose-built summary instead. Desktop keeps the tfoot and hides this card. */
.totals-summary-card {
    display: none;
}

@media (max-width: 768px) {
    .data-table--cards thead {
        display: none;
    }

    .data-table--cards,
    .data-table--cards tbody,
    .data-table--cards tfoot,
    .data-table--cards tr,
    .data-table--cards td {
        display: block;
        width: 100%;
    }

    .data-table--cards tr {
        display: flex;
        flex-direction: column;
        border: 1px solid #ddd;
        border-radius: 8px;
        padding: 0.25rem 0.85rem 0.6rem;
        margin-bottom: 0.85rem;
        background: #fff;
    }

    .data-table--cards td {
        border: none;
        padding: 0.5rem 0;
        min-height: 44px;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.4rem 0.75rem;
    }

    /* Row label, left-aligned, from the cell's data-label. */
    .data-table--cards td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 0.8rem;
        color: #666;
        white-space: nowrap;
    }

    /* First cell is the card header: name, no label, divider beneath. Floated to
       the top of the card even when it isn't the first column in the source table
       (e.g. the Skins "Winner" column sits after Hole/Par). */
    .data-table--cards td.card-title {
        order: -1;
        justify-content: flex-start;
        font-size: 1rem;
        font-weight: 700;
        color: #2c3e50;
        border-bottom: 1px solid #eee;
        margin-bottom: 0.25rem;
    }

    .data-table--cards td.card-title::before {
        display: none;
    }

    /* Action-only cells (Set all button, kebab) — right-aligned, no label.
       Reset any desktop width:1% (e.g. .member-table td.actions-cell) so the card
       cell spans full width and the kebab doesn't overflow off the card's edge. */
    .data-table--cards td.card-actions {
        justify-content: flex-end;
        width: 100%;
    }

    .data-table--cards td.card-actions::before {
        display: none;
    }

    /* DNS/DQ member cards keep their muted treatment. */
    .data-table--cards tr.inactive-row {
        opacity: 0.6;
    }

    /* A table footer (totals) row reads as a distinct summary card. */
    .data-table--cards tfoot tr {
        background: #f5f5f5;
        border-color: #bbb;
    }

    /* Expandable scorecard detail rows (Scramble Results) carry their own nested
       table — opt them out of the card chrome so the scorecard renders normally
       below the group card instead of as another labelled flex row. */
    .data-table--cards tr.player-detail-row {
        border: none;
        border-radius: 0;
        padding: 0;
        background: transparent;
    }

    .data-table--cards td.player-detail-cell {
        display: block;
        padding: 0;
        min-height: 0;
    }

    .data-table--cards td.player-detail-cell::before {
        display: none;
    }

    /* Par-3 per-hole rule editor (WagerConfig) carries its own grid — opt it out of the
       card chrome so it renders as a normal block beneath the pot card. */
    .data-table--cards tr.per-hole-rules-row {
        border: none;
        border-radius: 0;
        padding: 0;
        margin: -0.5rem 0 0.85rem;
        background: transparent;
    }

    .data-table--cards tr.per-hole-rules-row td {
        display: block;
        padding: 0;
        min-height: 0;
    }

    .data-table--cards tr.per-hole-rules-row td::before {
        display: none;
    }

    /* Card-density helpers (used by the per-hole/per-group detail tables: Skins,
       Team/Scramble Results). They let one set of markup serve a full desktop table
       and a tight mobile card without duplicating the row logic:
         .card-hidden  — a cell or span that drops out of the card (kept on desktop)
         .card-only    — a span shown ONLY in the card (hidden on desktop, see base rule)
         .card-emphasis— a cell rendered as a label-less prominent line (e.g. the winner)
         .card-trailing— pushes content (e.g. payout) to the right edge of the title row */
    .data-table--cards .card-hidden {
        display: none;
    }

    .data-table--cards .card-only {
        display: inline;
    }

    .data-table--cards td.card-emphasis {
        font-weight: 600;
        color: #2c3e50;
        justify-content: flex-start;
        padding-top: 0;
    }

    .data-table--cards td.card-emphasis::before {
        display: none;
    }

    .data-table--cards td.card-title .card-trailing {
        margin-left: auto;
        font-weight: 700;
        color: #2c3e50;
    }

    /* Wager opt-in checkboxes become touch switches inside the cards. The base
       <input type=checkbox> is untouched on desktop (this rule is mobile-only). */
    .wager-toggle {
        appearance: none;
        -webkit-appearance: none;
        flex: 0 0 auto;
        width: 46px;
        height: 28px;
        margin: 0;
        border-radius: 14px;
        background: #ccc;
        position: relative;
        cursor: pointer;
        transition: background 0.2s;
    }

    .wager-toggle::after {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 22px;
        height: 22px;
        border-radius: 50%;
        background: #fff;
        box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
        transition: transform 0.2s;
    }

    .wager-toggle:checked {
        background: #2c3e50;
    }

    .wager-toggle:checked::after {
        transform: translateX(18px);
    }

    .wager-toggle:focus-visible {
        outline: 2px solid #2c3e50;
        outline-offset: 2px;
    }

    .wager-toggle:disabled {
        opacity: 0.5;
        cursor: default;
    }

    /* Toolbars (round picker, add-group, add-player) stack so their selects and
       buttons get full-width touch targets instead of cramming side by side. */
    .invite-row {
        flex-direction: column;
        align-items: stretch;
    }

    .invite-row .form-group {
        width: 100% !important;
    }

    .invite-row .invite-btn,
    .invite-row .btn {
        width: 100%;
    }

    /* Totals summary card — replaces the tfoot on phones for Skins / Money List. */
    .data-table--summary tfoot {
        display: none;
    }

    .totals-summary-card {
        display: block;
        background: #f2f2f2;
        border: 1px solid #ddd;
        border-left: 4px solid #2c3e50;
        border-radius: 8px;
        padding: 0.75rem 1rem;
        margin: 0 0 1rem;
    }

    .totals-summary-card__heading {
        font-size: 0.75rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: #666;
        margin-bottom: 0.5rem;
    }

    .totals-summary-row {
        display: flex;
        justify-content: space-between;
        align-items: baseline;
        padding: 0.25rem 0;
        font-size: 0.95rem;
        color: #2c3e50;
    }

    .totals-summary-row .totals-summary-row__label {
        color: #666;
    }

    .totals-summary-row--grand {
        border-top: 1px solid #ccc;
        margin-top: 0.4rem;
        padding-top: 0.5rem;
        font-weight: 700;
        font-size: 1.15rem;
    }

    /* Single-row summary cards (Pot total, Skins total) have nothing above the grand
       row, so the separator line is spurious — drop it when it's the first child. */
    .totals-summary-row--grand:first-child {
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }
}

/* ===== iOS focus-zoom guard (mobile) — P2.2 =====
   Mobile Safari zooms the whole page whenever a focused field's font-size is
   < 16px. Several inputs here use 0.85rem, so force 16px on phones. The
   :not() selectors raise specificity above the per-class font-sizes (e.g.
   .handicap-input) and skip the wager toggle / radios. */
@media (max-width: 768px) {
    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px;
    }
}
