:root {
    --bg: #081412;
    --panel: #0f211e;
    --panel-soft: #132b27;
    --surface: #f5f2ea;
    --surface-2: #ebe5d8;
    --text: #10201d;
    --muted: #68756f;
    --muted-light: #a6b2ac;
    --white: #ffffff;
    --line: rgba(255,255,255,0.12);
    --line-dark: rgba(16,32,29,0.12);
    --green: #0d5b46;
    --green-2: #137356;
    --gold: #c6a15b;
    --danger: #8f302d;
    --shadow: 0 24px 70px rgba(0,0,0,0.24);
    --radius: 22px;
}









* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(198,161,91,0.18), transparent 30rem),
        linear-gradient(135deg, #07110f 0%, #10241f 34%, #f5f2ea 34%, #f5f2ea 100%);
    background-attachment: fixed;
    background-position: top center;
    background-repeat: no-repeat;
    background-size: 100vw 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent 70%);
}

a {
    color: inherit;
}

.topbar {
    flex: 0 0 auto;
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1rem clamp(1rem, 4vw, 3.5rem);
    background: rgba(8,20,18,0.86);
    color: var(--white);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--white);
    text-decoration: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    color: var(--bg);
    background: linear-gradient(135deg, var(--gold), #f2d999);
    font-weight: 900;
    letter-spacing: -0.04em;
}

.brand strong,
.brand small {
    display: block;
    line-height: 1.1;
}

.brand small {
    margin-top: 0.22rem;
    color: var(--muted-light);
    font-size: 0.78rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav a {
    padding: 0.68rem 0.85rem;
    color: rgba(255,255,255,0.78);
    text-decoration: none;
    border-radius: 999px;
    font-size: 0.92rem;
    font-weight: 700;
}

.nav a:hover,
.nav a.active {
    color: var(--white);
    background: rgba(255,255,255,0.1);
}

.page {
    position: relative;
    z-index: 1;
    flex: 1 0 auto;
    width: min(1240px, calc(100% - 2rem));
    min-height: calc(100vh - 78px);
    margin: 0 auto;
    padding: clamp(2rem, 4vw, 3rem) 0 clamp(2rem, 4vh, 3.2rem);
    text-align: center;
}

.page > * {
    width: 100%;
}

.page-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: none;
    margin: 0 0 1.75rem;
    color: var(--white);
    text-align: left;
}

.page-title > div {
    width: auto;
    max-width: 760px;
    text-align: left;
}

.page-title h1 {
    margin: 0.2rem 0 0;
    color: var(--white);
    font-size: clamp(2rem, 5vw, 4.6rem);
    letter-spacing: -0.07em;
    line-height: 0.92;
    text-shadow: 0 16px 40px rgba(0,0,0,0.38);
}

.page-title p:not(.eyebrow) {
    max-width: 660px;
    margin: 0.85rem 0 0;
    color: rgba(255,255,255,0.86);
    font-size: 1.05rem;
}

.page-title-action {
    display: flex;
    justify-content: flex-end;
    width: auto;
    flex: 0 0 auto;
}

.eyebrow {
    margin: 0 0 0.4rem;
    color: var(--gold);
    font-size: 0.74rem;
    font-weight: 900;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.card,
.auth-card,
.stat-card,
.club-card {
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.74);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    backdrop-filter: blur(18px);
    text-align: left;
}

.card {
    padding: clamp(1.1rem, 3vw, 2rem);
    margin-right: auto;
    margin-bottom: 1.2rem;
    margin-left: auto;
}

.narrow-card {
    width: min(100%, 560px);
    max-width: 560px;
}

.auth-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: min(620px, calc(100vh - 150px));
    padding: clamp(1rem, 3vw, 2rem) 0;
}

.auth-card {
    width: min(100%, 460px);
    padding: clamp(1.3rem, 4vw, 2.4rem);
}

.auth-card h1,
.card h2,
.club-card h2 {
    margin: 0.2rem 0 0.7rem;
    letter-spacing: -0.04em;
}

.muted,
.form-footer {
    color: var(--muted);
}

.form-footer {
    margin-bottom: 0;
}

.stacked-form,
.shot-form {
    display: grid;
    gap: 1rem;
}

label,
.group-label {
    display: grid;
    gap: 0.45rem;
    justify-items: stretch;
    color: #253632;
    font-size: 0.9rem;
    font-weight: 800;
    text-align: left;
}

input,
select {
    width: 100%;
    min-height: 50px;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--line-dark);
    border-radius: 14px;
    background: rgba(255,255,255,0.82);
    color: var(--text);
    font: inherit;
    text-align: left;
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--green-2);
    box-shadow: 0 0 0 4px rgba(19,115,86,0.12);
}

.button,
button.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 48px;
    padding: 0.78rem 1.15rem;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--green), var(--green-2));
    color: var(--white);
    text-decoration: none;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 14px 28px rgba(13,91,70,0.26);
}

.button:hover,
button.button:hover {
    transform: translateY(-1px);
}

.button.full {
    width: 100%;
}

.button.small {
    min-height: 36px;
    padding: 0.46rem 0.75rem;
    font-size: 0.86rem;
}

.button.outline {
    color: var(--green);
    background: rgba(255,255,255,0.58);
    border: 1px solid rgba(13,91,70,0.22);
    box-shadow: none;
}

.button.danger {
    background: linear-gradient(135deg, var(--danger), #b8453f);
    box-shadow: 0 14px 28px rgba(143,48,45,0.22);
}

.error-list,
.flash {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 16px;
    font-weight: 800;
}

.error-list {
    color: #7a1714;
    background: rgba(143,48,45,0.12);
    border: 1px solid rgba(143,48,45,0.18);
}

.flash.success {
    color: #124f3d;
    background: rgba(19,115,86,0.14);
    border: 1px solid rgba(19,115,86,0.18);
}

.dashboard-empty {
    min-height: clamp(360px, 45vh, 520px);
    display: grid;
    place-items: center;
}

.empty-state {
    text-align: center;
}

.empty-icon {
    display: inline-grid;
    place-items: center;
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    border-radius: 22px;
    background: var(--panel);
    color: var(--gold);
    font-weight: 900;
}

.game-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1.2rem;
    align-items: stretch;
    width: 100%;
}

.game-grid > .card {
    min-width: 0;
    height: 100%;
    margin-bottom: 0;
}

.hole-header,
.club-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.3rem;
    text-align: left;
}

.hole-header h2,
.club-header h2 {
    margin: 0;
    font-size: 2rem;
}

.hole-par,
.club-usage {
    padding: 0.8rem 1rem;
    border-radius: 16px;
    background: var(--panel);
    color: var(--white);
    font-weight: 900;
    text-align: center;
}

.club-usage small {
    display: block;
    margin-top: 0.2rem;
    color: var(--muted-light);
    font-size: 0.75rem;
}

.hit-banner {
    padding: 1rem;
    border-radius: 18px;
    background: linear-gradient(135deg, var(--panel), var(--panel-soft));
    color: var(--white);
    font-size: 1.35rem;
    font-weight: 950;
    letter-spacing: -0.03em;
}

.conditional-group,
.nested-group {
    display: grid;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid var(--line-dark);
    border-radius: 18px;
    background: rgba(255,255,255,0.5);
}

.conditional-group.is-hidden,
.nested-group.is-hidden {
    display: none;
}

.radio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.7rem;
}

.choice {
    display: block;
}

.choice input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.choice span {
    display: grid;
    place-items: center;
    min-height: 52px;
    padding: 0.75rem;
    border: 1px solid var(--line-dark);
    border-radius: 15px;
    background: rgba(255,255,255,0.78);
    color: #263833;
    font-weight: 900;
    text-align: center;
    cursor: pointer;
}

.choice input:checked + span {
    color: var(--white);
    border-color: var(--green);
    background: linear-gradient(135deg, var(--green), var(--green-2));
}

.advanced-panel {
    border: 1px solid var(--line-dark);
    border-radius: 18px;
    background: rgba(255,255,255,0.48);
    overflow: hidden;
}

.advanced-panel summary {
    padding: 1rem;
    cursor: pointer;
    font-weight: 900;
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 1rem;
    padding: 0 1rem 1rem;
}

.hole-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.hole-actions form {
    flex: 1 1 220px;
    max-width: 280px;
}

.hole-actions button {
    width: 100%;
}

.shot-list {
    display: grid;
    gap: 0.8rem;
}

.shot-item {
    padding: 0.9rem;
    border: 1px solid var(--line-dark);
    border-radius: 16px;
    background: rgba(255,255,255,0.58);
}

.shot-main {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    text-align: center;
}

.shot-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
    margin-top: 0.6rem;
}

.shot-meta span {
    padding: 0.25rem 0.55rem;
    border-radius: 999px;
    background: var(--surface-2);
    color: #3c4945;
    font-size: 0.78rem;
    font-weight: 800;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

th,
td {
    padding: 0.9rem;
    border-bottom: 1px solid var(--line-dark);
    text-align: center;
    vertical-align: top;
}

th {
    color: #42504b;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.history-list {
    display: grid;
    gap: 1rem;
}

.game-accordion {
    padding: 0;
    overflow: hidden;
}

.game-accordion summary {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    cursor: pointer;
    list-style: none;
    text-align: center;
}

.game-accordion summary::-webkit-details-marker {
    display: none;
}

.game-accordion summary small {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-weight: 700;
}

.accordion-body {
    padding: 0 1.3rem 1.3rem;
}

.hole-history {
    padding: 1rem 0;
    border-top: 1px solid var(--line-dark);
}

.hole-history-title {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    text-align: center;
}

.hole-history-title h3 {
    margin: 0;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.stat-card {
    padding: 1.2rem;
}

.stat-card span {
    display: block;
    color: var(--muted);
    font-weight: 800;
}

.stat-card strong {
    display: block;
    margin-top: 0.4rem;
    color: var(--green);
    font-size: 2rem;
    letter-spacing: -0.06em;
}

.focus-list {
    display: grid;
    gap: 0.8rem;
}

.focus-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    justify-items: start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line-dark);
    border-radius: 18px;
    background: rgba(255,255,255,0.5);
    text-align: left;
}

.focus-rank {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    background: var(--panel);
    color: var(--gold);
    font-weight: 950;
}

.focus-item h3,
.focus-item p {
    margin: 0 0 0.35rem;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    align-items: stretch;
    gap: 1.2rem;
}

.analytics-grid .club-card {
    display: flex;
    flex-direction: column;
    min-height: 430px;
    height: 100%;
}

.analytics-grid .club-header {
    min-height: 92px;
}

.analytics-grid .club-header h2 {
    min-height: 2.35em;
    display: flex;
    align-items: center;
    margin-bottom: 0;
    line-height: 1.05;
}

.analytics-grid .club-diagnostics {
    margin-top: auto;
}

.club-card h3 {
    margin: 1.2rem 0 0.7rem;
    color: #263833;
    font-size: 0.95rem;
}

.metric-line {
    display: grid;
    gap: 0.35rem;
    margin-bottom: 0.7rem;
}

.metric-label {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 1rem;
    font-size: 0.9rem;
    text-align: left;
}

.metric-label small {
    color: var(--muted);
    font-size: 0.78rem;
}

.meter {
    width: 100%;
    height: 9px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(16,32,29,0.1);
}

.meter span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--gold));
}

.club-diagnostics {
    display: grid;
    gap: 0.45rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line-dark);
    color: var(--muted);
    font-size: 0.9rem;
}

.club-diagnostics strong {
    color: var(--text);
}



.club-card,
.advanced-panel,
.conditional-group,
.nested-group,
.shot-item,
.game-accordion,
.hole-history,
.table-wrap {
    text-align: left;
}

.stat-card,
.dashboard-empty,
.dashboard-empty .empty-state,
.empty-state {
    text-align: center;
}

.stat-card span,
.stat-card strong,
.dashboard-empty h2,
.dashboard-empty p {
    text-align: center;
}

.dashboard-empty {
    justify-items: center;
}

.stacked-form,
.shot-form,
.advanced-grid {
    justify-items: stretch;
}

.stacked-form > *,
.shot-form > *,
.advanced-grid > * {
    width: 100%;
}



.card h2,
.card h3,
.card p,
.card li,
.auth-card h1,
.auth-card p,
.club-card h2,
.club-card h3,
.club-card p,
.club-diagnostics,
.shot-item,
th,
td {
    text-align: left;
}

.dashboard-empty.card h2,
.dashboard-empty.card p,
.stat-card span,
.stat-card strong {
    text-align: center;
}

.shot-main,
.shot-meta,
.hole-history-title,
.game-accordion summary {
    justify-content: flex-start;
    text-align: left;
}

.choice span,
.button,
button.button,
.empty-icon,
.hole-par,
.club-usage,
.hit-banner {
    text-align: center;
}

.site-footer,
body > footer {
    flex: 0 0 56px;
    min-height: 56px;
    max-height: 56px;
    overflow: hidden;
}

@media (max-width: 900px) {
    .topbar,
    .game-grid {
        display: block;
    }

    .game-grid > .card {
        height: auto;
        margin-bottom: 1.2rem;
    }

    .page-title {
        display: block;
        text-align: left;
    }

    .page-title > div {
        max-width: 760px;
        text-align: left;
    }

    .nav {
        justify-content: center;
        margin-top: 1rem;
    }

    .page-title-action {
        justify-content: flex-start;
        margin-top: 1rem;
    }

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

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

@media (max-width: 560px) {
    body {
        background-size: auto 100vh;
    }

    .page {
        width: min(100% - 1rem, 1240px);
        min-height: calc(100vh - 118px);
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .topbar {
        padding: 0.85rem;
        text-align: center;
    }

    .brand {
        justify-content: center;
    }

    .brand small {
        display: none;
    }

    .nav a {
        padding: 0.54rem 0.65rem;
        font-size: 0.84rem;
    }

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

    .game-accordion summary,
    .hole-header,
    .club-header,
    .hole-history-title {
        display: block;
        text-align: left;
    }

    .focus-item {
        grid-template-columns: 1fr;
    }

    .analytics-grid .club-card {
        min-height: 0;
    }
}

/* Analytics club grid hard fix */
.analytics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    width: 100%;
}

.analytics-grid .club-card {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
}

.analytics-grid .club-header {
    width: 100%;
    min-width: 0;
}

.analytics-grid .club-header > div:first-child {
    min-width: 0;
    flex: 1 1 auto;
}

.analytics-grid .club-header h2 {
    max-width: 100%;
    min-height: 0;
    font-size: clamp(1.18rem, 1.55vw, 1.62rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
    overflow-wrap: anywhere;
    word-break: normal;
}

.analytics-grid .club-usage {
    flex: 0 0 auto;
}

.analytics-grid .metric-label,
.analytics-grid .club-diagnostics {
    min-width: 0;
}

@media (min-width: 981px) {
    .analytics-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 641px) and (max-width: 980px) {
    .analytics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .analytics-grid {
        grid-template-columns: 1fr !important;
    }
}

/* History search, yearly grouping, and delete controls */
.history-tools {
    margin-bottom: 1.2rem;
}

.history-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem;
    align-items: end;
    width: 100%;
}

.history-search-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.history-search-actions .button {
    min-width: 118px;
}

.history-year-group {
    display: grid;
    gap: 1rem;
}

.history-year-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.25rem 0.15rem;
    color: var(--white);
    text-align: left;
}

.history-year-heading span {
    display: block;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 950;
    letter-spacing: -0.06em;
    text-shadow: 0 14px 34px rgba(0,0,0,0.34);
}

.history-year-heading small {
    color: rgba(255,255,255,0.72);
    font-size: 0.86rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    white-space: nowrap;
}

.history-year-rounds {
    display: grid;
    gap: 1rem;
}

.history-game-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.9rem;
}

.history-game-actions form {
    margin: 0;
}

@media (max-width: 720px) {
    .history-search {
        grid-template-columns: 1fr;
    }

    .history-search-actions {
        justify-content: stretch;
    }

    .history-search-actions .button {
        flex: 1 1 140px;
    }

    .history-year-heading {
        display: block;
    }

    .history-year-heading small {
        display: block;
        margin-top: 0.2rem;
    }

    .history-game-actions {
        justify-content: stretch;
    }

    .history-game-actions .button {
        width: 100%;
    }
}

/* History month accordion and compact search upgrade */
.history-tools {
    width: min(100%, 620px);
    max-width: 620px;
    margin-right: auto;
    margin-left: auto;
}

.history-search,
.history-search label,
.history-search input {
    text-align: left;
}

.history-month-list {
    display: grid;
    gap: 1rem;
}

.month-accordion {
    padding: 0;
    overflow: hidden;
}

.month-accordion > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.1rem 1.3rem;
    cursor: pointer;
    list-style: none;
    text-align: left;
}

.month-accordion > summary::-webkit-details-marker {
    display: none;
}

.month-accordion > summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    border-radius: 999px;
    background: var(--panel);
    color: var(--gold);
    font-size: 1.1rem;
    font-weight: 950;
    line-height: 1;
}

.month-accordion[open] > summary::after {
    content: "-";
}

.month-accordion > summary strong,
.month-accordion > summary small {
    display: block;
}

.month-accordion > summary strong {
    color: var(--text);
    font-size: clamp(1.12rem, 1.8vw, 1.45rem);
    letter-spacing: -0.045em;
}

.month-accordion > summary small {
    margin-top: 0.25rem;
    color: var(--muted);
    font-weight: 800;
}

.month-accordion-body {
    display: grid;
    gap: 1rem;
    padding: 0 1.3rem 1.3rem;
}

.month-accordion-body .game-accordion {
    margin-bottom: 0;
    box-shadow: 0 14px 38px rgba(0,0,0,0.12);
}

@media (max-width: 720px) {
    .history-tools {
        width: 100%;
        max-width: none;
    }

    .month-accordion > summary {
        align-items: flex-start;
    }
}

/* History year heading: stable contrast on all backgrounds */
.history-year-heading {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: min(100%, 480px) !important;
    margin: 0 auto 0.15rem !important;
    padding: 0.95rem 1.25rem !important;
    border: 1px solid rgba(255,255,255,0.82) !important;
    border-radius: 20px !important;
    background: rgba(255,255,255,0.94) !important;
    box-shadow: 0 18px 44px rgba(0,0,0,0.18) !important;
    color: #07100e !important;
    text-align: center !important;
}

.history-year-heading span {
    color: #07100e !important;
    text-align: center !important;
    text-shadow: none !important;
}

.history-year-heading small {
    margin-top: 0.15rem !important;
    color: rgba(7,16,14,0.62) !important;
    text-align: center !important;
}

@media (max-width: 720px) {
    .history-year-heading {
        width: 100% !important;
        padding: 0.9rem 1rem !important;
    }
}


/* Active game precision layout fix */
.active-game-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important;
    gap: 1.35rem !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 1.35rem !important;
}

.active-game-grid > .current-hole-card,
.active-game-grid > .hole-log-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 100% !important;
    margin: 0 !important;
}

.active-game-grid > .current-hole-card {
    grid-column: 1 / 2 !important;
}

.active-game-grid > .hole-log-card {
    grid-column: 2 / 3 !important;
}

.round-data-card {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto 1.2rem !important;
    clear: both !important;
}

.flash.success {
    color: var(--white) !important;
    background: linear-gradient(135deg, var(--green), var(--green-2)) !important;
    border-color: rgba(255,255,255,0.22) !important;
}

/* History month boxes locked to year-box width and consistent typography */
.history-month-list {
    justify-items: center !important;
}

.month-accordion {
    width: min(100%, 480px) !important;
    max-width: 480px !important;
    margin-right: auto !important;
    margin-left: auto !important;
}

.month-accordion > summary {
    min-height: 96px !important;
    padding: 0.95rem 1.25rem !important;
    align-items: center !important;
}

.month-accordion > summary span {
    min-width: 0 !important;
}

.month-accordion > summary strong {
    font-size: clamp(1.18rem, 1.65vw, 1.42rem) !important;
    line-height: 1.05 !important;
    letter-spacing: -0.045em !important;
    overflow-wrap: anywhere !important;
}

.month-accordion > summary small {
    font-size: 0.82rem !important;
    line-height: 1.2 !important;
}

.month-accordion-body {
    width: 100% !important;
}

@media (max-width: 900px) {
    .active-game-grid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1.2rem !important;
        margin-bottom: 1.2rem !important;
    }

    .active-game-grid > .current-hole-card,
    .active-game-grid > .hole-log-card {
        grid-column: auto !important;
        height: auto !important;
    }
}

@media (max-width: 560px) {
    .month-accordion,
    .history-year-heading {
        width: 100% !important;
        max-width: none !important;
    }

    .month-accordion > summary {
        min-height: 88px !important;
    }
}

/* History page width fix: search and month accordions only */
.history-tools {
    width: 100% !important;
    max-width: none !important;
}

.history-month-list {
    justify-items: stretch !important;
}

.month-accordion {
    width: 100% !important;
    max-width: none !important;
}

.month-accordion-body,
.month-accordion-body .game-accordion,
.game-accordion .accordion-body {
    width: 100% !important;
    max-width: none !important;
}

.month-accordion-body {
    overflow-x: visible !important;
}

.game-accordion .accordion-body,
.hole-history,
.table-wrap {
    min-width: 0 !important;
}

.table-wrap {
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
}


/* Settings page */
.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
    gap: 1.2rem;
    align-items: start;
}

.settings-card {
    width: 100%;
    max-width: none;
}

.settings-divider {
    width: 100%;
    height: 1px;
    margin: 1.6rem 0;
    background: var(--line-dark);
}

.club-check-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
    gap: 0.7rem;
}

.club-check {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-height: 52px;
    padding: 0.75rem 0.85rem;
    border: 1px solid var(--line-dark);
    border-radius: 15px;
    background: rgba(255,255,255,0.58);
    color: #263833;
    font-weight: 900;
}

.club-check input {
    width: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    padding: 0;
}

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

/* Analytics inner section accordions */
.analytics-grid .club-card {
    min-height: 0 !important;
}

.analytics-section-list {
    display: grid;
    gap: 0.75rem;
}

.analytics-section-accordion {
    overflow: hidden;
    border: 1px solid var(--line-dark);
    border-radius: 16px;
    background: rgba(255,255,255,0.5);
}

.analytics-section-accordion > summary {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    min-height: 52px;
    padding: 0.85rem 1rem;
    color: #263833;
    cursor: pointer;
    list-style: none;
    font-size: 0.92rem;
    font-weight: 950;
    text-align: left;
}

.analytics-section-accordion > summary::-webkit-details-marker {
    display: none;
}

.analytics-section-accordion > summary::after {
    content: "+";
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 999px;
    background: var(--panel);
    color: var(--gold);
    font-size: 1rem;
    font-weight: 950;
    line-height: 1;
}

.analytics-section-accordion[open] > summary::after {
    content: "-";
}

.analytics-section-body {
    display: grid;
    gap: 0.65rem;
    padding: 0 1rem 1rem;
}

.analytics-section-body .metric-line:last-child {
    margin-bottom: 0;
}


/* Analytics spacing and summary stat update */
@media (min-width: 981px) {
    .stat-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    }
}

@media (min-width: 641px) and (max-width: 980px) {
    .stat-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 640px) {
    .stat-grid {
        grid-template-columns: 1fr !important;
    }
}

.analytics-section-list {
    gap: 1rem !important;
}

.analytics-section-accordion {
    margin: 0 !important;
}

.analytics-section-accordion > summary {
    min-height: 56px !important;
    padding: 0.95rem 1rem !important;
    background: rgba(15,33,30,0.08) !important;
    color: #12241f !important;
    font-size: 0.78rem !important;
    font-weight: 950 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
}

.analytics-section-accordion[open] > summary {
    background: linear-gradient(135deg, var(--panel), var(--panel-soft)) !important;
    color: var(--white) !important;
}

.analytics-section-body {
    gap: 0.78rem !important;
    padding: 1rem 1rem 1rem !important;
}

.analytics-section-body .metric-line {
    margin-bottom: 0.75rem !important;
}

.analytics-section-body .metric-line:last-child {
    margin-bottom: 0 !important;
}

/* Mobile/tablet background lock and burger menu */
.nav-state,
.nav-toggle {
    display: none;
}

@media (max-width: 900px) {
    html {
        background: #f5f2ea !important;
    }

    body {
        background: #f5f2ea !important;
    }

    body::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background:
            radial-gradient(circle at top left, rgba(198,161,91,0.18), transparent 30rem),
            linear-gradient(135deg, #07110f 0%, #10241f 34%, #f5f2ea 34%, #f5f2ea 100%);
        background-position: top center;
        background-repeat: no-repeat;
        background-size: 100vw 100vh;
    }

    body::before {
        z-index: 1 !important;
    }

    .topbar,
    .page {
        position: relative;
        z-index: 2;
    }

    .topbar {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        flex-wrap: wrap !important;
        text-align: left !important;
    }

    .brand {
        flex: 1 1 auto;
        justify-content: flex-start !important;
        min-width: 0;
    }

    .nav-state {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

    .nav-toggle {
        display: inline-flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 42px;
        height: 42px;
        flex: 0 0 42px;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        cursor: pointer;
    }

    .nav-toggle span {
        display: block;
        width: 28px;
        height: 3px;
        border-radius: 999px;
        background: #ffffff;
    }

    .nav {
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        gap: 0.35rem !important;
        width: 100%;
        flex: 0 0 100%;
        margin-top: 0.9rem !important;
        padding: 0.75rem;
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 18px;
        background: rgba(8,20,18,0.96);
        box-shadow: 0 18px 44px rgba(0,0,0,0.28);
        backdrop-filter: blur(18px);
    }

    .nav-state:checked ~ .nav {
        display: flex !important;
    }

    .nav a {
        display: flex !important;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        min-height: 44px;
        padding: 0.75rem 0.9rem !important;
        border-radius: 14px !important;
        text-align: left !important;
        font-size: 0.95rem !important;
    }

    .nav a.button.small {
        justify-content: center;
    }
.module-read-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    margin-top: 1rem;
    padding: 0.58rem 1rem;
    border: 1px solid rgba(16,32,29,0.12);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.45);
}

.module-read-button:hover {
    border-color: rgba(198,161,91,0.48);
    color: var(--green);
    background: var(--surface-2);
}
}

@supports (-webkit-touch-callout: none) {
    body {
        background: #f5f2ea !important;
    }

    body::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 0;
        pointer-events: none;
        background:
            radial-gradient(circle at top left, rgba(198,161,91,0.18), transparent 30rem),
            linear-gradient(135deg, #07110f 0%, #10241f 34%, #f5f2ea 34%, #f5f2ea 100%);
        background-position: top center;
        background-repeat: no-repeat;
        background-size: 100vw 100vh;
    }

    body::before {
        z-index: 1 !important;
    }

    .topbar,
    .page {
        position: relative;
        z-index: 2;
    }
}
