:root {
    --green: #1f5d4b;
    --green-dark: #164638;
    --coral: #e07a6a;
    --blush: #f6dcd6;
    --bg: #fbf7f2;
    --surface: #ffffff;
    --text: #1d2621;
    --muted: #5f6b65;
    --border: #e6ded4;
    --danger: #b3261e;
    --shadow: 0 1px 2px rgb(29 38 33 / 6%), 0 8px 24px rgb(29 38 33 / 8%);
    --radius: 18px;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --green: #6fbf9f;
        --green-dark: #8fd1b6;
        --coral: #f0998b;
        --blush: #4a2f2b;
        --bg: #121714;
        --surface: #1b221e;
        --text: #eef2ef;
        --muted: #a4b0aa;
        --border: #2e3832;
        --danger: #f2827a;
        --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 8px 24px rgb(0 0 0 / 30%);
        color-scheme: dark;
    }
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

h1, h2 { font-family: Fraunces, Georgia, serif; line-height: 1.15; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
h2 { font-size: 1.35rem; }
a { color: var(--green); }
p { margin: 0 0 .75rem; }

.site-header {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .9rem clamp(1rem, 4vw, 2.5rem);
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--text);
    font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.3rem; }
.nav-links { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
.nav-links a, .link-button {
    color: var(--muted); text-decoration: none; padding: .4rem .7rem; border-radius: 999px; font-weight: 500;
}
.nav-links a:hover, .link-button:hover { color: var(--text); }
.nav-links a.active { color: var(--green); background: color-mix(in srgb, var(--green) 12%, transparent); }
.nav-links a.button { color: #fff; }
.link-button { background: none; border: 0; font: inherit; cursor: pointer; }
form.inline { display: inline; }

main { padding: 2rem clamp(1rem, 4vw, 2.5rem) 4rem; }
.narrow { max-width: 560px; margin: 0 auto; }
.muted { color: var(--muted); }
.center { text-align: center; }
.small { font-size: .875rem; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.5rem; }

.button {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    padding: .75rem 1.3rem; border-radius: 999px; border: 1px solid transparent;
    background: var(--green); color: #fff; font: 600 1rem/1 Inter, system-ui, sans-serif;
    text-decoration: none; cursor: pointer; transition: background .15s;
}
@media (prefers-color-scheme: dark) { .button { color: #0f1a15; } .nav-links a.button { color: #0f1a15; } }
.button:hover { background: var(--green-dark); }
.button-small { padding: .5rem .95rem; font-size: .9rem; }
.button-ghost { background: transparent; color: var(--green); border-color: var(--border); }
.button-ghost:hover { background: color-mix(in srgb, var(--green) 8%, transparent); }
.button-danger { background: var(--danger); color: #fff; }
.button-danger:hover { background: var(--danger); filter: brightness(.9); }
.actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }

.notice, .alert { border-radius: 12px; padding: .8rem 1rem; margin-bottom: 1.25rem; font-weight: 500; }
.notice { background: color-mix(in srgb, var(--green) 12%, var(--surface)); color: var(--green-dark); }
.alert { background: color-mix(in srgb, var(--danger) 12%, var(--surface)); color: var(--danger); }

/* Forms */
.form { display: grid; gap: 1.1rem; margin-top: 1rem; }
.form label { display: grid; gap: .35rem; font-weight: 600; font-size: .95rem; }
.form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: .5rem; }
.form legend { font-weight: 600; font-size: .95rem; margin-bottom: .35rem; padding: 0; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=datetime-local], textarea {
    width: 100%; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font: 400 1rem/1.4 Inter, system-ui, sans-serif;
}
input:focus-visible, textarea:focus-visible, .button:focus-visible, a:focus-visible, .player-card:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--coral) 70%, transparent); outline-offset: 2px;
}
.optional, .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
.field-error { color: var(--danger); font-weight: 500; font-size: .875rem; }
.checkbox { grid-template-columns: auto 1fr; align-items: start; font-weight: 400 !important; }
.checkbox input { margin-top: .3rem; width: 1.1rem; height: 1.1rem; accent-color: var(--green); }

.level-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; }
.level-option { position: relative; font-weight: 400 !important; }
.level-option input, .segmented-radio input { position: absolute; opacity: 0; }
.level-option span {
    display: grid; gap: .15rem; padding: .7rem .85rem; border: 1px solid var(--border);
    border-radius: 12px; cursor: pointer; height: 100%;
}
.level-option small { color: var(--muted); }
.level-option input:checked + span { border-color: var(--green); background: color-mix(in srgb, var(--green) 10%, transparent); }
.level-option input:focus-visible + span, .segmented-radio input:focus-visible + span { outline: 3px solid var(--coral); }

.segmented-radio { display: flex; gap: .5rem; }
.segmented-radio label { position: relative; flex: 1; }
.segmented-radio span { display: block; text-align: center; padding: .6rem; border: 1px solid var(--border);
    border-radius: 999px; font-weight: 500; cursor: pointer; }
.segmented-radio input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }

/* Landing */
.hero { max-width: 1040px; margin: 0 auto; display: grid; gap: 3rem; grid-template-columns: 1.2fr 1fr;
    align-items: center; padding-top: clamp(2rem, 8vw, 5rem); }
.hero h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); }
.eyebrow { color: var(--coral); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34rem; }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 0; display: grid; gap: 1rem; }
.steps li { counter-increment: step; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.1rem 1.25rem 1.1rem 4rem; position: relative; display: grid; gap: .2rem; }
.steps li::before { content: counter(step); position: absolute; left: 1.2rem; top: 1.1rem; width: 1.9rem; height: 1.9rem;
    border-radius: 50%; background: var(--blush); color: var(--text); display: grid; place-items: center; font-weight: 600; }
.steps span { color: var(--muted); }
@media (max-width: 760px) { .hero { grid-template-columns: 1fr; gap: 2rem; } }

/* Player cards */
.avatar { width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--blush), color-mix(in srgb, var(--coral) 55%, var(--blush)));
    color: #3b2420; font: 700 2rem/1 Fraunces, Georgia, serif; }
.avatar.small { width: 56px; height: 56px; font-size: 1.3rem; margin: 0; flex-shrink: 0; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { background: color-mix(in srgb, var(--green) 12%, transparent); color: var(--green-dark);
    padding: .2rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.meta { color: var(--muted); }
.bio { white-space: pre-line; }

.discover-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.discover-head h1 { margin: 0; }
.segmented { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 3px; }
.segmented a { padding: .4rem .9rem; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 500; font-size: .9rem; }
.segmented a.active { background: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .segmented a.active, .segmented-radio input:checked + span { color: #0f1a15; } }

.swipe-area { display: grid; gap: 1.25rem; }
.player-card { position: relative; min-height: 380px; touch-action: pan-y; user-select: none; cursor: grab;
    transition: transform .2s ease; overflow: hidden; }
.player-card.static { min-height: 0; cursor: default; }
.player-card.dragging { transition: none; cursor: grabbing; }
.player-card.leaving { transition: transform .22s ease-in; }
.stamp { position: absolute; top: 1.25rem; padding: .3rem .8rem; border: 3px solid; border-radius: 10px;
    font: 700 1.3rem/1 Fraunces, Georgia, serif; text-transform: uppercase; pointer-events: none; }
.stamp-like { right: 1.25rem; color: var(--green); transform: rotate(12deg); opacity: var(--like, 0); }
.stamp-pass { left: 1.25rem; color: var(--coral); transform: rotate(-12deg); opacity: var(--pass, 0); }
.swipe-buttons { display: flex; justify-content: center; gap: 2rem; }
.round-button { width: 68px; height: 68px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface);
    box-shadow: var(--shadow); font-size: 1.7rem; cursor: pointer; transition: transform .12s; }
.round-button:hover { transform: scale(1.08); }
.round-button.pass { color: var(--coral); }
.round-button.like { color: var(--green); }

.match-banner { display: grid; gap: .5rem; justify-items: start; padding: 1.1rem 1.25rem; margin-bottom: 1.25rem;
    border-radius: var(--radius); background: linear-gradient(120deg, var(--blush), color-mix(in srgb, var(--green) 18%, var(--blush))); }
.match-banner strong { font: 700 1.4rem/1.1 Fraunces, Georgia, serif; }

.empty { text-align: center; display: grid; gap: .5rem; justify-items: center; padding: 2.5rem 1.5rem; }

/* Matches and schedule */
.match-list, .session-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.match-row, .session-row { display: flex; gap: 1rem; align-items: flex-start; }
.match-info, .session-info { flex: 1; min-width: 0; }
.match-info h2 { font-size: 1.2rem; margin-bottom: .35rem; }
.match-info .bio { margin: 0; color: var(--muted); font-size: .95rem; }
.match-actions, .session-actions { display: flex; flex-direction: column; gap: .4rem; align-items: flex-end; }
@media (max-width: 520px) {
    .match-row, .session-row { flex-wrap: wrap; }
    .match-actions, .session-actions { flex-direction: row; width: 100%; justify-content: flex-end; }
}
.section-title { font-size: 1.1rem; margin: 1.5rem 0 .75rem; }
.session-list.past { opacity: .7; }
.session-date { width: 56px; flex-shrink: 0; text-align: center; border-radius: 12px; background: var(--blush); padding: .4rem 0; }
.session-date .month { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.session-date .day { display: block; font: 700 1.5rem/1.1 Fraunces, Georgia, serif; }
.session-title { margin-bottom: .2rem; }
.status { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .6rem; border-radius: 999px;
    background: var(--border); color: var(--text); }
.status-proposed { background: color-mix(in srgb, var(--coral) 22%, transparent); }
.status-accepted { background: color-mix(in srgb, var(--green) 20%, transparent); color: var(--green-dark); }

.danger-zone { margin-top: 2.5rem; border-top: 1px solid var(--border); padding-top: 1rem; color: var(--muted); }
.danger-zone summary { cursor: pointer; font-weight: 600; color: var(--danger); }
.danger-zone p { margin: .75rem 0; }
.label-row { display: flex; align-items: baseline; gap: .5rem; }
.site-header .app-nav { margin-left: auto; }

/* On phones the main sections become a bottom tab bar. */
@media (max-width: 640px) {
    .app-nav {
        position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
        justify-content: space-around; gap: 0; flex-wrap: nowrap;
        background: var(--surface); border-top: 1px solid var(--border);
        padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
    }
    .app-nav a { flex: 1; text-align: center; font-size: .9rem; padding: .55rem .25rem; }
    body:has(.app-nav) main { padding-bottom: 6rem; }
}

/* ---- Player cards with photos ---- */
.player-card { padding: 0; min-height: 0; }
.player-card .card-body { padding: 1.25rem 1.5rem 1.5rem; display: grid; gap: .6rem; }
.player-card .card-body > * { margin: 0; }
.player-card h2 { font-size: 1.6rem; margin: 0; }
.player-card h2 .age { font-weight: 600; color: var(--muted); }
.player-card.swipeable { cursor: grab; }
.player-card.static { cursor: default; }
.stamp { z-index: 3; }

.photo-carousel { position: relative; aspect-ratio: 4 / 5; background: var(--border); overflow: hidden; }
.photo-carousel img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity .2s; -webkit-user-drag: none; user-select: none; }
.photo-carousel img.active { opacity: 1; }
.carousel-zone { position: absolute; top: 0; bottom: 0; width: 40%; background: none; border: 0; cursor: pointer; z-index: 2; }
.carousel-zone.prev { left: 0; }
.carousel-zone.next { right: 0; }
.carousel-zone:focus-visible { outline: 3px solid var(--coral); outline-offset: -3px; }
.carousel-dots { position: absolute; top: .6rem; left: .75rem; right: .75rem; display: flex; gap: 4px; z-index: 2; }
.carousel-dots span { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / 45%); }
.carousel-dots span.active { background: #fff; }
.photo-placeholder { aspect-ratio: 16 / 9; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--blush), color-mix(in srgb, var(--green) 25%, var(--blush))); }
.photo-placeholder .avatar { margin: 0; background: var(--surface); }

.facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.facts li { border: 1px solid var(--border); border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; }
.answer-group h3, .prompt h3 { font: 600 .8rem/1.3 Inter, system-ui, sans-serif; text-transform: uppercase;
    letter-spacing: .06em; color: var(--muted); margin: 0 0 .2rem; }
.answer-group p { margin: 0; }
.prompt { background: color-mix(in srgb, var(--blush) 45%, var(--surface)); border-radius: 14px; padding: .85rem 1rem; }
.prompt p { margin: 0; font: 600 1.15rem/1.35 Fraunces, Georgia, serif; }
.prompt p.bio { font: 400 1rem/1.5 Inter, system-ui, sans-serif; }

.swipe-buttons { position: sticky; bottom: 1rem; z-index: 5; }
@media (max-width: 640px) { .swipe-buttons { bottom: 5rem; } }

/* ---- Profile form ---- */
.profile-form { gap: 1.25rem; }
.form-section { display: grid; gap: 1.1rem; }
.form-section h2 { margin: 0; font-size: 1.25rem; }
.subhead { font: 600 .95rem/1.3 Inter, system-ui, sans-serif; margin: .5rem 0 0; }
.question { display: grid; gap: .5rem; }
.pills { display: flex; flex-wrap: wrap; gap: .45rem; }
.pills label { position: relative; font-weight: 400 !important; display: block !important; }
.pills input { position: absolute; opacity: 0; inset: 0; }
.pills span { display: inline-block; padding: .45rem .9rem; border: 1px solid var(--border); border-radius: 999px;
    cursor: pointer; font-size: .92rem; background: var(--surface); }
.pills input:checked + span { background: var(--green); border-color: var(--green); color: #fff; }
@media (prefers-color-scheme: dark) { .pills input:checked + span { color: #0f1a15; } }
.pills input:focus-visible + span { outline: 3px solid var(--coral); outline-offset: 2px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
@media (max-width: 480px) { .two-col { grid-template-columns: 1fr; } }
.location-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.location-status { color: var(--green-dark); font-weight: 500; font-size: .92rem; }
.prompt-slot { display: grid; gap: .4rem; }
select { width: 100%; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font: 400 1rem/1.4 Inter, system-ui, sans-serif; }
input[type=date] { width: 100%; padding: .7rem .85rem; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg); color: var(--text); font: 400 1rem/1.4 Inter, system-ui, sans-serif; }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 35%);
    padding: 1.25rem 0 1rem; margin: 0; }
@media (max-width: 640px) { .sticky-actions { bottom: 4.2rem; } }

/* ---- Photos ---- */
.photo-grid { list-style: none; padding: 0; margin: 1.25rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 480px) { .photo-grid { grid-template-columns: repeat(2, 1fr); } }
.photo-tile { position: relative; aspect-ratio: 4 / 5; border-radius: 14px; overflow: hidden; background: var(--border); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.main-badge { position: absolute; top: .5rem; left: .5rem; background: var(--green); color: #fff; font-size: .75rem;
    font-weight: 600; padding: .15rem .55rem; border-radius: 999px; }
.photo-actions { position: absolute; left: .4rem; right: .4rem; bottom: .4rem; display: flex; gap: .3rem; justify-content: flex-end; flex-wrap: wrap; }
.button-light { background: rgb(255 255 255 / 92%); color: #1d2621; padding: .35rem .7rem; font-size: .8rem; }
.button-light:hover { background: #fff; }
.photo-tile.add { background: none; border: 2px dashed var(--border); }
.upload-form, .upload-label { width: 100%; height: 100%; }
.upload-label { display: grid; place-content: center; justify-items: center; gap: .2rem; cursor: pointer; color: var(--muted); font-weight: 600; position: relative; }
.upload-label input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.upload-label:focus-within { outline: 3px solid var(--coral); outline-offset: -3px; border-radius: 12px; }
.upload-label .plus { font-size: 2rem; line-height: 1; color: var(--green); }
.upload-form.uploading .upload-label::after { content: "Uploading…"; font-weight: 400; }

.nudge { display: grid; gap: .15rem; padding: 1rem 1.25rem; margin-bottom: 1rem; border-radius: var(--radius);
    background: color-mix(in srgb, var(--coral) 18%, var(--surface)); color: var(--text); text-decoration: none; }
.nudge span { color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.page-head h1 { margin: 0; }
.actions.tight { margin: 0; }
.settings { margin-top: 1.25rem; }
.settings h2 { font-size: 1.15rem; }
.settings dl { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.25rem; margin: .5rem 0 .75rem; }
.settings dt { color: var(--muted); }
.settings dd { margin: 0; font-weight: 500; }

/* ---- Matches ---- */
.match-row { align-items: center; padding: 1rem; }
.match-link { display: flex; gap: 1rem; align-items: center; flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.thumb { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.match-info h2 .age { color: var(--muted); font-weight: 600; }
.match-info .meta { margin: 0; }
@media (max-width: 520px) { .match-row { flex-wrap: nowrap; } }
.back-link { color: var(--muted); text-decoration: none; font-weight: 500; }
.unmatch { margin-top: 1rem; text-align: center; }

/* ---- Courses ---- */
.course-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; max-height: 22rem; overflow-y: auto; }
.course-option { display: flex !important; grid-template-columns: none !important; gap: .75rem; align-items: flex-start;
    padding: .7rem .85rem; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; font-weight: 400 !important; }
.course-option input { margin-top: .25rem; accent-color: var(--green); }
.course-option:has(input:checked) { border-color: var(--green); background: color-mix(in srgb, var(--green) 8%, transparent); }
.course-text { display: grid; gap: .1rem; }
.course-text small { color: var(--muted); }
.course-links { display: flex; gap: .9rem; flex-wrap: wrap; margin: .35rem 0; font-size: .9rem; font-weight: 500; }
.map-credit { font-size: .75rem; color: var(--muted); margin: 0; }
.map-credit a { color: inherit; }
