:root {
    --green: #23613a;
    --green-dark: #153d25;
    --green-soft: #e5f0e5;
    --presence-green: #1f7a3b;
    --presence-red: #b4232d;
    --activity-open-bg: #eef7ee;
    --activity-closed-bg: #eee7da;
    --red: #9a2f2f;
    --red-soft: #f5dddd;
    --activity-card-closed-bg: #f1f3f5;
    --activity-card-present-bg: #dff5e1;
    --activity-card-absent-bg: #fde2e2;
    --gold-soft: #f3ead6;
    --blue-soft: #e8eef8;
    --ink: #1e2a22;
    --muted: #5d6b61;
    --line: #dbe5da;
    --surface: #ffffff;
    --background: #f4f7f1;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--background);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

.page-shell {
    display: flex;
    flex-direction: column;
    width: min(1020px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 40px;
}

.hero {
    order: 0;
}

#message-zone {
    order: 1;
}

#identification-section {
    order: 2;
}

#confirmation-section {
    order: 3;
}

#member-space-section {
    order: 4;
}

#le-19e-trou-section {
    order: 5;
}

#portal-section {
    order: 6;
}

.hero {
    margin-bottom: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--green);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    color: var(--green-dark);
    font-size: clamp(32px, 7vw, 50px);
    line-height: 1;
}

h2 {
    margin-bottom: 12px;
    color: var(--green-dark);
    font-size: 21px;
}

h3 {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 17px;
}

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

.card {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(21, 61, 37, 0.07);
}

.message {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf3ed;
    color: var(--green-dark);
    font-weight: 700;
}

.message-error {
    background: var(--red-soft);
    color: var(--red);
}

.message-info {
    background: #edf3ed;
    color: var(--green-dark);
}

.message-success {
    background: var(--green-soft);
    color: var(--green-dark);
}

.member-form label,
.remember-option {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.remember-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 6px 0 16px;
    color: var(--ink);
    font-size: 15px;
}

.remember-option input {
    width: auto;
    min-height: auto;
}

.form-row {
    display: flex;
    gap: 10px;
}

input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #c7d6c5;
    border-radius: 8px;
    font-size: 16px;
}

select {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #c7d6c5;
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    font-size: 16px;
}

button,
.secondary-button {
    min-height: 44px;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--green);
    color: #fff;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    text-decoration: none;
}

.secondary-button {
    background: #edf3ed;
    color: var(--green-dark);
}

.button-row,
.section-heading,
.member-card,
.presence-main,
.presence-badges,
.presence-details,
.season-summary div,
.detail-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.section-heading--column,
.section-heading--column > div {
    display: block;
}

.le19e-subtitle {
    margin: 0;
    color: var(--muted);
    font-weight: 700;
}

.member-card {
    flex-wrap: wrap;
}

.member-card h2,
.member-name {
    margin-bottom: 4px;
    color: var(--green-dark);
    font-size: 24px;
    font-weight: 700;
}

.is-hidden {
    display: none;
}

.presence-list,
.details-list {
    display: grid;
    gap: 10px;
}

.presence-card {
    padding: 12px 0;
    border-top: 1px solid var(--line);
}

.presence-card:first-child {
    border-top: 0;
}

.presence-toggle-card {
    appearance: none;
    border: 1px solid var(--line);
    text-align: left;
    width: 100%;
    font: inherit;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.presence-toggle-card:hover,
.presence-toggle-card:focus-visible {
    border-color: #b3c2b0;
    box-shadow: 0 2px 8px rgba(21, 61, 37, 0.12);
}

.presence-toggle-label {
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 800;
}

.presence-toggle-detail {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.3;
}

.presence-empty-state {
    margin: 0;
}

.presence-card.activity-card--closed {
    background: var(--activity-card-closed-bg);
}

.presence-card.activity-card--present {
    background: var(--activity-card-present-bg);
}

.presence-card.activity-card--absent {
    background: var(--activity-card-absent-bg);
}

.presence-date {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 14px;
}

.presence-badges,
.presence-details {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.presence-badges {
    gap: 14px;
}

.presence-details {
    margin-top: 10px;
    color: var(--muted);
    font-size: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green-dark);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.badge-present {
    min-width: 98px;
    min-height: 34px;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid rgba(21, 61, 37, 0.16);
    background: var(--presence-green);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    box-shadow: 0 2px 5px rgba(21, 61, 37, 0.16);
}

.badge-absent {
    min-width: 98px;
    min-height: 34px;
    justify-content: center;
    padding: 8px 14px;
    border: 1px solid rgba(91, 20, 26, 0.16);
    background: var(--presence-red);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    box-shadow: 0 2px 5px rgba(91, 20, 26, 0.14);
}

.badge-open,
.badge-activity-open {
    min-height: 26px;
    padding: 5px 9px;
    background: var(--activity-open-bg);
    color: var(--green-dark);
    font-size: 12px;
}

.badge-closed {
    background: var(--gold-soft);
    color: #765b1f;
}

.badge-activity-closed {
    min-height: 26px;
    padding: 5px 9px;
    background: var(--activity-closed-bg);
    color: #5f4a25;
    font-size: 12px;
}

.badge-read {
    background: var(--blue-soft);
    color: #264d86;
}

.badge-readonly {
    background: #edf3ed;
    color: var(--green-dark);
}

.presence-action-button {
    min-height: 36px;
    padding: 8px 12px;
    font-size: 14px;
}

.btn-present {
    background: var(--green);
}

.btn-absent {
    background: var(--red);
}

.lecture-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.lecture-option input {
    width: auto;
    min-height: auto;
}

.save-confirmations-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.season-content {
    color: var(--ink);
}

.le19e-header h3 {
    margin-bottom: 4px;
    color: var(--green-dark);
}

.le19e-header .le19e-subtitle {
    margin: 2px 0 0;
    font-size: 14px;
}

.le19e-highlights {
    margin-top: 10px;
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

.le19e-highlight-card {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--green-soft);
    padding: 12px;
}

.le19e-highlight-card h3 {
    margin: 0 0 4px;
    font-size: 16px;
}

.le19e-highlight-icon {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    min-width: 24px;
}

.le19e-highlight-card p {
    margin: 0;
}

.le19e-card {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.le19e-message-card p {
    margin: 0;
}

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

.le19e-sub-grid {
    display: grid;
    gap: 10px;
    margin-top: 6px;
    grid-template-columns: 1fr;
}

.le19e-subtitle {
    margin: 0 0 4px;
    color: var(--green-dark);
    font-weight: 700;
}

.le19e-full-card {
    margin-top: 10px;
}

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

.le19e-team-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbf8;
    padding: 10px;
}

.le19e-team-title {
    margin: 0 0 6px;
    color: var(--green-dark);
    font-weight: 800;
}

.le19e-list {
    margin: 6px 0 0;
    padding-left: 20px;
}

.le19e-list li {
    margin: 0 0 6px;
}

.le19e-player-list p {
    margin: 4px 0;
}

.season-summary {
    display: grid;
    gap: 10px;
    margin: 0;
}

.season-summary div,
.detail-line {
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.season-summary div:first-child {
    border-top: 0;
}

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

dd {
    margin: 0;
    font-weight: 700;
}

.details-list {
    margin-top: 16px;
}

.scorecards-page {
    width: calc(100vw - 48px);
    max-width: none;
    margin-left: auto;
    margin-right: auto;
}

.page-shell.scorecards-page {
    width: calc(100vw - 48px);
    max-width: none;
}

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

.scorecards-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.scorecards-hero .intro {
    flex-basis: 100%;
}

.btn-retour-portail {
    background: var(--green);
    color: #fff;
}

.btn-retour-portail:hover {
    background: var(--green-dark);
}

.scorecards-selector {
    max-width: 760px;
}

.scorecards-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.scorecards-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
}

.round-summary-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 14px;
    color: var(--muted);
}

.round-summary-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.round-summary-block {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbf7;
}

.round-summary-block h3,
.round-summary-block h4 {
    margin: 0 0 10px;
    color: var(--green-dark);
}

.round-summary-block h4 {
    margin-top: 14px;
    font-size: 14px;
}

.round-summary-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding-left: 20px;
}

.round-summary-list li {
    padding-top: 8px;
    border-top: 1px solid var(--line);
}

.round-summary-list li:first-child {
    padding-top: 0;
    border-top: 0;
}

.round-summary-list li::marker {
    color: var(--green-dark);
    font-weight: 800;
}

.round-summary-list span {
    margin-right: 10px;
}

.round-summary-list strong {
    color: var(--green-dark);
    white-space: nowrap;
}

.round-summary-empty {
    margin: 0 0 10px;
}

.scorecards-content {
    display: grid;
    gap: 16px;
    width: 100%;
}

.scorecard-team-card {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
}

.scorecard-team-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    background: #f7faf5;
}

.scorecard-team-header h3 {
    margin: 0;
}

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

.scorecard-table {
    width: 100%;
    min-width: 1208px;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

.scorecard-col-player {
    width: 210px;
}

.scorecard-col-hcp {
    width: 48px;
}

.scorecard-col-hole {
    width: 38px;
}

.scorecard-col-result {
    width: 64px;
}

.scorecard-table th,
.scorecard-table td {
    height: 42px;
    padding: 5px;
    border: 1px solid var(--line);
    text-align: center;
    vertical-align: middle;
}

.scorecard-table th:first-child,
.scorecard-table td:first-child {
    text-align: left;
    white-space: nowrap;
}

.scorecard-table th:nth-child(12),
.scorecard-table td:nth-child(12),
.scorecard-table th:nth-child(22),
.scorecard-table td:nth-child(22),
.scorecard-table th:nth-child(23),
.scorecard-table td:nth-child(23),
.scorecard-table th:nth-child(24),
.scorecard-table td:nth-child(24) {
    border-left: 2px solid #aac3a7;
    background: #f2f7ef;
    font-size: 16px;
    font-weight: 800;
    padding-left: 8px;
    padding-right: 8px;
    white-space: nowrap;
}

.scorecard-table th:nth-child(12),
.scorecard-table td:nth-child(12) {
    border-right: 2px solid #aac3a7;
}

.scorecard-table th:nth-child(22),
.scorecard-table td:nth-child(22) {
    border-left: 3px solid #8fae8d;
}

.scorecard-table th:nth-child(23),
.scorecard-table td:nth-child(23),
.scorecard-table th:nth-child(24),
.scorecard-table td:nth-child(24) {
    background: #eef5eb;
}

.scorecard-score-cell,
.scorecard-total-cell {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
}

.scorecard-score-value {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.scorecard-total-cell {
    background: #f2f7ef;
    color: var(--green-dark);
    font-size: 16px;
    font-weight: 800;
}

.scorecard-top-score {
    color: #b4232d;
    font-weight: 900 !important;
}

.scorecard-table thead th {
    background: #eef5eb;
    color: var(--green-dark);
    font-size: 13px;
}

.scorecard-player-row th span,
.scorecard-player-row th small {
    display: block;
}

.scorecard-player-row th small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.scorecard-player-absent,
.scorecard-player-a_saisir {
    background: #fafaf8;
    color: var(--muted);
}

.score-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    min-height: 28px;
    padding: 2px 5px;
    border: 2px solid var(--ink);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 800;
    line-height: 1;
}

.score-symbol-circle {
    border-radius: 999px;
}

.score-symbol-square {
    border-radius: 4px;
}

.score-symbol-double {
    border-width: 4px;
    border-style: double;
}

@media (max-width: 760px) {
    .round-summary-grid {
        grid-template-columns: 1fr;
    }

    .form-row,
    .button-row,
    .member-card,
    .presence-main,
    .presence-details {
        flex-direction: column;
        align-items: stretch;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .le19e-highlights {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) {
    .page-shell {
        width: min(1180px, calc(100% - 56px));
    }

    .page-shell.scorecards-page {
        width: calc(100vw - 48px);
        max-width: none;
    }

    .presence-card {
        display: grid;
        grid-template-columns: minmax(280px, 1fr) minmax(460px, 1.35fr);
        gap: 18px;
        align-items: center;
        padding: 16px 0;
    }

    .presence-main {
        justify-content: space-between;
        min-width: 0;
    }

    .presence-main h3 {
        overflow-wrap: anywhere;
    }

    .presence-badges {
        justify-content: flex-end;
        min-width: 178px;
    }

    .presence-details {
        justify-content: flex-end;
        margin-top: 0;
    }

    .lecture-option {
        min-width: 178px;
        justify-content: flex-start;
    }

    .presence-action-button {
        min-width: 174px;
    }

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

    .le19e-sub-grid {
        grid-template-columns: 1fr;
    }

    .le19e-team-grid {
        grid-template-columns: 1fr 1fr;
    }

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