/* ==========================================================================
   Tennis & Pickleball Now — design system
   Light theme, green palette, mobile-first. macOS-inspired surfaces.
   ========================================================================== */

:root {
    /* green light theme */
    --bg:          #f4f8f1;
    --bg-tint:     #eef5ea;
    --surface:     #ffffff;
    --surface-2:   #f7faf5;
    --ink:         #16241a;
    --ink-soft:    #38473d;
    --muted:       #64756a;
    --line:        #e2eadd;
    --line-strong: #d2ddca;

    /* brand greens */
    --green:       #18a558;
    --green-600:   #148a49;
    --green-700:   #0f6f3b;
    --green-050:   #e9f8ee;
    --green-100:   #d2f0dc;
    --green-glow:  rgba(24, 165, 88, .28);

    /* sport accents */
    --tennis:      #b8dc2e;
    --tennis-ink:  #3f4d0a;
    --pickle:      #22b6a4;
    --pickle-ink:  #0b3f3a;

    /* gold accent (premium / trophy / featured) */
    --gold:      #d8a72a;
    --gold-600:  #b8891a;
    --gold-700:  #946d10;
    --gold-050:  #fbf3d8;
    --gold-100:  #f6e7b4;
    --gold-ink:  #7a5a06;
    --gold-glow: rgba(216, 167, 42, .30);

    /* status */
    --amber:  #e0952c;
    --red:    #dc4b3e;
    --blue:   #2f7bd6;

    --radius:    16px;
    --radius-sm: 11px;
    --radius-lg: 22px;
    --shadow-sm: 0 1px 2px rgba(20, 40, 26, .06), 0 1px 3px rgba(20, 40, 26, .05);
    --shadow:    0 4px 14px rgba(20, 50, 30, .08), 0 2px 6px rgba(20, 50, 30, .05);
    --shadow-lg: 0 18px 48px rgba(16, 70, 40, .16);

    --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-display: 'Bricolage Grotesque', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --tab-h: 64px;
    --side-w: 244px;
    --max: 1080px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
.btn, .tab, .fab, a, button, label, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body { min-height: 100dvh; }

a { color: var(--green-600); text-decoration: none; }
a:hover { color: var(--green-700); }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.02em; font-weight: 700; font-family: var(--font-display); }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.12rem; }
p { margin: 0 0 1rem; }
small { font-size: .82rem; }
img { max-width: 100%; }

.muted { color: var(--muted); }
.tiny { font-size: .78rem; }
.strong { font-weight: 650; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hide { display: none !important; }

/* ------------------------------------------------------------- app shell - */

.app-body {
    padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
}

.shell { display: block; }

/* top bar (mobile) */
.topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: max(.7rem, env(safe-area-inset-top)) 1rem .7rem;
    background: color-mix(in srgb, var(--surface) 86%, transparent);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar .brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.topbar .brand-logo { width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.topbar .brand-name { font-size: 1.06rem; }
.topbar .spacer { flex: 1; }
.topbar .top-av { width: 34px; height: 34px; }

.container {
    width: 100%;
    max-width: var(--max);
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}

.page-head { margin: .4rem 0 1.1rem; }
.page-head h1 { font-size: 1.55rem; margin-bottom: .15rem; }
.page-head .sub { color: var(--muted); font-size: .95rem; }

/* ------------------------------------------------------------- bottom nav - */

.tabbar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 2px;
    height: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: saturate(180%) blur(18px);
    -webkit-backdrop-filter: saturate(180%) blur(18px);
    border-top: 1px solid var(--line);
}
.tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .01em;
    text-decoration: none;
    padding-top: 6px;
}
.tab svg { width: 22px; height: 22px; stroke-width: 1.9; }
.tab.is-active { color: var(--green); }
.tab.is-active .tab-ico { transform: translateY(-1px); }
.tab .tab-ico { transition: transform .15s ease; }

/* desktop sidebar */
.sidebar { display: none; }

@media (min-width: 900px) {
    .app-body { padding-bottom: 0; }
    .tabbar { display: none; }
    .topbar { display: none; }
    .shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100dvh; }
    .sidebar {
        display: flex;
        flex-direction: column;
        gap: .2rem;
        position: sticky;
        top: 0;
        height: 100dvh;
        padding: 1.1rem .8rem;
        background: var(--surface);
        border-right: 1px solid var(--line);
    }
    .sidebar .brand { display: flex; align-items: center; gap: .55rem; padding: .4rem .6rem 1rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; color: var(--ink); }
    .sidebar .brand-logo { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--shadow-sm); }
    .side-link {
        display: flex; align-items: center; gap: .7rem;
        padding: .62rem .7rem; border-radius: 11px;
        color: var(--ink-soft); font-weight: 600; font-size: .96rem;
    }
    .side-link svg { width: 21px; height: 21px; stroke-width: 1.9; color: var(--muted); }
    .side-link:hover { background: var(--surface-2); color: var(--ink); }
    .side-link.is-active { background: var(--green-050); color: var(--green-700); }
    .side-link.is-active svg { color: var(--green); }
    .side-foot { margin-top: auto; padding-top: .6rem; border-top: 1px solid var(--line); }
    .container { padding: 1.6rem 2rem 3rem; }
    .page-head h1 { font-size: 1.85rem; }
}

/* ------------------------------------------------------------- cards ------ */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1.1rem;
}
.card + .card { margin-top: .9rem; }
.card-pad-lg { padding: 1.4rem; }
.grid { display: grid; gap: .9rem; }
@media (min-width: 620px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 820px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 1.4rem 0 .7rem; }
.section-title h2 { font-size: 1.16rem; margin: 0; }
.section-title a { font-size: .9rem; font-weight: 600; }

/* ------------------------------------------------------------- buttons ---- */

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-size: .98rem; font-weight: 650;
    padding: .7rem 1.15rem; border-radius: 12px;
    border: 1px solid transparent; cursor: pointer;
    transition: transform .06s ease, background .15s ease, box-shadow .15s ease;
    text-decoration: none; line-height: 1;
}
.btn:active { transform: translateY(1px) scale(.995); }
.btn svg { width: 19px; height: 19px; stroke-width: 2; }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 2px 10px var(--green-glow); }
.btn-primary:hover { background: var(--green-600); color: #fff; }
.btn-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--green-050); color: var(--green-700); }
.btn-soft:hover { background: var(--green-100); color: var(--green-700); }
.btn-danger { background: #fdecea; color: var(--red); }
.btn-danger:hover { background: #fbdcd8; }
.btn-gold { background: var(--gold); color: #422f02; box-shadow: 0 2px 10px var(--gold-glow); }
.btn-gold:hover { background: var(--gold-600); color: #422f02; }
.btn-block { display: flex; width: 100%; }
.btn-sm { padding: .5rem .8rem; font-size: .87rem; border-radius: 10px; }
.btn-lg { padding: .85rem 1.4rem; font-size: 1.05rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; }

/* floating action button (mobile) */
.fab {
    position: fixed;
    right: 16px;
    bottom: calc(var(--tab-h) + env(safe-area-inset-bottom, 0px) + 14px);
    z-index: 45;
    width: 56px; height: 56px; border-radius: 18px;
    display: flex; align-items: center; justify-content: center;
    background: var(--green); color: #fff;
    box-shadow: var(--shadow-lg);
    border: none;
}
.fab svg { width: 26px; height: 26px; stroke-width: 2.2; }
@media (min-width: 900px) { .fab { display: none; } }

/* ------------------------------------------------------------- forms ------ */

.field { margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; color: var(--ink-soft); }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: .3rem; }
.input, .select, .textarea {
    width: 100%; font-family: inherit; font-size: 1rem; color: var(--ink);
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: 12px; padding: .72rem .85rem;
    transition: border-color .15s ease, box-shadow .15s ease;
    -webkit-appearance: none; appearance: none;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px var(--green-glow);
}
.textarea { min-height: 96px; resize: vertical; }
.select {
    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='%2364756a' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right .8rem center; padding-right: 2.2rem;
}
.field-error { color: var(--red); font-size: .82rem; margin-top: .3rem; }
.input.has-error, .select.has-error, .textarea.has-error { border-color: var(--red); }
.field-row { display: grid; gap: .7rem; }
@media (min-width: 560px) { .field-row-2 { grid-template-columns: 1fr 1fr; } }

/* checkbox / toggle pill */
.check {
    display: inline-flex; align-items: center; gap: .55rem;
    padding: .6rem .85rem; border: 1px solid var(--line-strong);
    border-radius: 12px; cursor: pointer; user-select: none; font-weight: 600;
    background: var(--surface); font-size: .95rem;
}
.check input { accent-color: var(--green); width: 18px; height: 18px; }
.check:has(input:checked) { border-color: var(--green); background: var(--green-050); color: var(--green-700); }

/* segmented control (sport switch) */
.segment { display: inline-flex; background: var(--bg-tint); border: 1px solid var(--line); border-radius: 12px; padding: 3px; gap: 2px; }
.segment a, .segment button {
    border: none; background: transparent; cursor: pointer; font-family: inherit;
    font-weight: 650; font-size: .9rem; color: var(--ink-soft);
    padding: .45rem .9rem; border-radius: 9px; text-decoration: none;
    display: inline-flex; align-items: center; gap: .35rem;
}
.segment .is-active { background: var(--surface); color: var(--green-700); box-shadow: var(--shadow-sm); }

/* ------------------------------------------------------------- badges ----- */

.badge {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .74rem; font-weight: 700; letter-spacing: .01em;
    padding: .2rem .5rem; border-radius: 999px;
    background: var(--surface-2); color: var(--ink-soft);
}
.badge.is-green  { background: var(--green-050); color: var(--green-700); }
.badge.is-amber  { background: #fdf1de; color: #9a6412; }
.badge.is-red    { background: #fdecea; color: #b33529; }
.badge.is-gray   { background: #eef1ee; color: #5b6b60; }
.badge.is-gold   { background: var(--gold-050); color: var(--gold-700); border: 1px solid var(--gold-100); }

/* gold pill for featured / pro / trophy accents */
.gold-pill {
    display: inline-flex; align-items: center; gap: .3rem;
    font-size: .74rem; font-weight: 800; letter-spacing: .02em;
    padding: .22rem .6rem; border-radius: 999px;
    background: linear-gradient(135deg, var(--gold-050), var(--gold-100));
    color: var(--gold-700); border: 1px solid color-mix(in srgb, var(--gold) 40%, #fff);
}
.gold-pill svg { width: 14px; height: 14px; }
.text-gold { color: var(--gold-700); }

.sport-tag {
    display: inline-flex; align-items: center; gap: .32rem;
    font-size: .76rem; font-weight: 700;
    padding: .22rem .55rem; border-radius: 999px;
    background: color-mix(in srgb, var(--tag) 22%, #fff);
    color: var(--tag-ink);
    border: 1px solid color-mix(in srgb, var(--tag) 45%, #fff);
}

.rating-chip {
    display: inline-flex; align-items: baseline; gap: .25rem;
    font-weight: 700; font-size: .8rem;
    padding: .2rem .5rem; border-radius: 8px;
    background: var(--bg-tint); color: var(--ink-soft);
}
.rating-chip b { font-size: .9rem; color: var(--ink); }

/* ------------------------------------------------------------- avatars ---- */

.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 50%;
    font-weight: 700; color: #fff; flex: none;
    background: linear-gradient(140deg, hsl(var(--h, 150), 55%, 52%), hsl(var(--h2, 165), 58%, 42%));
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
    font-size: .95rem; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 34px; height: 34px; font-size: .8rem; }
.avatar-lg { width: 76px; height: 76px; font-size: 1.6rem; }

/* ------------------------------------------------------------- list rows -- */

.list { display: flex; flex-direction: column; gap: .7rem; }
.row-card {
    display: flex; align-items: center; gap: .85rem;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .85rem .95rem;
    box-shadow: var(--shadow-sm); text-decoration: none; color: inherit;
    transition: border-color .15s ease, transform .06s ease;
}
a.row-card:hover { border-color: var(--line-strong); }
a.row-card:active { transform: scale(.995); }
.row-card .rc-body { flex: 1; min-width: 0; }
.row-card .rc-title { font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: .4rem; }
.row-card .rc-meta { color: var(--muted); font-size: .86rem; display: flex; flex-wrap: wrap; gap: .3rem .6rem; margin-top: .15rem; }
.row-card .rc-chevron { color: var(--line-strong); flex: none; }
.row-card .rc-chevron svg { width: 20px; height: 20px; }

.meta-dot::before { content: "·"; margin-right: .5rem; color: var(--line-strong); }

/* ------------------------------------------------------------- stats ------ */

.stat-tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
@media (min-width: 620px) { .stat-tiles { grid-template-columns: repeat(4, 1fr); } }
.stat-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow-sm); }
.stat-tile .stat-num { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.stat-tile .stat-label { color: var(--muted); font-size: .82rem; font-weight: 600; }

/* ------------------------------------------------------------- empty ------ */

.empty { text-align: center; padding: 2.4rem 1.2rem; color: var(--muted); }
.empty .empty-emoji { font-size: 2.4rem; }
.empty h3 { color: var(--ink); margin-top: .5rem; }

/* ------------------------------------------------------------- flash ------ */

.flash {
    position: fixed;
    left: 50%; transform: translateX(-50%);
    top: max(12px, env(safe-area-inset-top));
    z-index: 80;
    max-width: 92%;
    display: flex; align-items: center; gap: .55rem;
    padding: .7rem 1rem; border-radius: 13px;
    background: var(--ink); color: #fff; font-weight: 600; font-size: .92rem;
    box-shadow: var(--shadow-lg);
    animation: flashIn .35s cubic-bezier(.2,.9,.3,1.2);
}
.flash.is-success { background: var(--green-600); }
.flash.is-error { background: var(--red); }
.flash svg { width: 20px; height: 20px; flex: none; }
@keyframes flashIn { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ------------------------------------------------------------- pagination - */

.pager { display: flex; justify-content: center; gap: .5rem; margin-top: 1.4rem; }
.pager a, .pager span {
    padding: .5rem .9rem; border-radius: 10px; font-weight: 600; font-size: .9rem;
    border: 1px solid var(--line-strong); color: var(--ink-soft); background: var(--surface);
}
.pager span.is-disabled { opacity: .45; }

/* ------------------------------------------------------------- profile ---- */

.profile-hero { display: flex; align-items: center; gap: 1rem; }
.profile-hero .ph-name { font-size: 1.35rem; font-weight: 800; }
.profile-hero .ph-loc { color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .5rem 1rem; }
.kv dt { color: var(--muted); font-size: .9rem; }
.kv dd { margin: 0; font-weight: 600; }

/* divider */
.hr { height: 1px; background: var(--line); border: 0; margin: 1.1rem 0; }

/* helper spacing */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.gap-wrap { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ------------------------------------------------------------- marketing -- */

.marketing { background: var(--surface); }

.mk-nav {
    display: flex; align-items: center; gap: 1rem;
    max-width: var(--max); margin: 0 auto;
    padding: 1rem 1.2rem;
}
.mk-nav .brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -.03em; color: var(--ink); }
.mk-nav .brand img { width: 34px; height: 34px; border-radius: 10px; box-shadow: var(--shadow-sm); }
.mk-nav .brand .brand-short { display: none; }
.mk-nav .spacer { flex: 1; }
@media (max-width: 560px) {
    .mk-nav { padding: .8rem 1rem; gap: .5rem; }
    .mk-nav .brand { font-size: 1.02rem; }
    .mk-nav .brand .brand-full { display: none; }
    .mk-nav .brand .brand-short { display: inline; }
}

.hero {
    position: relative; overflow: hidden;
    background:
        radial-gradient(120% 90% at 85% -10%, rgba(216,167,42,.20), transparent 55%),
        linear-gradient(160deg, #16a355 0%, #0f7d40 60%, #0b6132 100%);
    color: #fff;
    border-radius: 0 0 34px 34px;
    padding: 2.4rem 1.3rem 3rem;
}
.hero-inner { max-width: var(--max); margin: 0 auto; }
.hero .eyebrow {
    display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap;
    font-weight: 700; font-size: .82rem; letter-spacing: .03em; text-transform: uppercase;
    background: rgba(255,255,255,.16); padding: .3rem .7rem; border-radius: 999px;
    border: 1px solid rgba(255,255,255,.22);
}
.hero .eyebrow svg { width: 15px; height: 15px; }
.hero h1 { font-size: 2.3rem; line-height: 1.08; margin: .9rem 0 .5rem; max-width: 16ch; }
.hero .lede { font-size: 1.12rem; color: rgba(255,255,255,.92); max-width: 42ch; margin-bottom: 1.4rem; }
.hero .gold-underline { color: #ffe08a; }
.hero .btn-row .btn-primary { background: #fff; color: var(--green-700); }
.hero .btn-row .btn-primary:hover { background: #f2fff7; }
.hero .btn-row .btn-ghost { background: rgba(255,255,255,.12); color: #fff; border-color: rgba(255,255,255,.3); }
.hero .hero-sports { display: flex; gap: .5rem; margin-top: 1.4rem; }
.hero .hero-sports .sport-tag { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.28); font-size: .82rem; padding: .3rem .7rem; }

@media (min-width: 780px) {
    .hero { padding: 3.6rem 2rem 4rem; }
    .hero h1 { font-size: 3.2rem; }
}
.hero-grid { max-width: var(--max); margin: 0 auto; }
.hero-grid .hero-inner { max-width: none; margin: 0; }
.hero-media { margin-top: 1.8rem; }
.hero-media img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 20px; box-shadow: 0 24px 50px rgba(9, 40, 22, .35); border: 1px solid rgba(255,255,255,.18); }
@media (min-width: 860px) {
    .hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.6rem; align-items: center; }
    .hero-media { margin-top: 0; }
}

.mk-section { max-width: var(--max); margin: 0 auto; padding: 2.4rem 1.3rem; }
.mk-section h2 { font-size: 1.6rem; text-align: center; }
.mk-section .section-lede { text-align: center; color: var(--muted); max-width: 46ch; margin: 0 auto 1.8rem; }

.feature-grid { display: grid; gap: 1rem; }
@media (min-width: 720px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 0; overflow: hidden; box-shadow: var(--shadow-sm);
}
.feat-img { aspect-ratio: 16 / 10; background: var(--green-050); }
.feat-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat-body { padding: 1.3rem; }
.feature .feat-ico {
    width: 46px; height: 46px; border-radius: 13px;
    display: flex; align-items: center; justify-content: center;
    background: var(--green-050); color: var(--green); margin-bottom: .8rem;
}
.feature .feat-ico svg { width: 24px; height: 24px; }
.feature.gold .feat-ico { background: var(--gold-050); color: var(--gold-600); }
.feature h3 { font-size: 1.08rem; }
.feature p { color: var(--muted); margin: 0; font-size: .94rem; }

.mk-cta {
    max-width: var(--max); margin: 1rem auto 2.4rem; padding: 0 1.3rem;
}
.mk-cta .cta-card {
    background: linear-gradient(150deg, var(--green-050), #fff);
    border: 1px solid var(--green-100); border-radius: var(--radius-lg);
    padding: 2rem 1.4rem; text-align: center;
}
.mk-cta h2 { margin-bottom: .3rem; }
.mk-cta p { color: var(--muted); }

.mk-foot { border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
.mk-foot .foot-inner { max-width: var(--max); margin: 0 auto; padding: 1.6rem 1.3rem; display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center; }
.mk-foot .spacer { flex: 1; }
.mk-foot a { color: var(--muted); }

/* ------------------------------------------------------------- auth ------- */

.auth-wrap {
    min-height: 100dvh; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    padding: 1.4rem; gap: 1rem;
    background:
        radial-gradient(90% 60% at 50% -10%, var(--green-050), transparent 60%),
        var(--bg);
}
.auth-card {
    width: 100%; max-width: 420px;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
    padding: 1.6rem 1.4rem;
}
.auth-brand { display: flex; align-items: center; gap: .55rem; justify-content: center; margin-bottom: 1rem; font-weight: 800; font-size: 1.2rem; letter-spacing: -.03em; }
.auth-brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: var(--shadow-sm); }
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: .2rem; }
.auth-card .auth-sub { text-align: center; color: var(--muted); margin-bottom: 1.3rem; }
.auth-foot { text-align: center; margin-top: 1rem; color: var(--muted); font-size: .92rem; }
.code-input { text-align: center; font-size: 1.9rem; letter-spacing: .5rem; font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; padding: .8rem; }
.btn-link { background: none; border: none; color: var(--green-600); font-weight: 600; font-family: inherit; font-size: .92rem; cursor: pointer; padding: .4rem; }
.btn-link:hover { color: var(--green-700); text-decoration: underline; }

/* city autocomplete */
.city-ac { position: relative; }
.city-suggest {
    position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 5px);
    background: var(--surface); border: 1px solid var(--line-strong);
    border-radius: 13px; box-shadow: var(--shadow-lg); overflow: hidden;
    max-height: 264px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.city-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
    width: 100%; text-align: left; background: none; border: none;
    border-bottom: 1px solid var(--line); padding: .72rem .9rem; cursor: pointer;
    font-family: inherit; font-size: .96rem; color: var(--ink);
}
.city-opt:last-child { border-bottom: none; }
.city-opt:hover, .city-opt:focus { background: var(--green-050); }
.city-opt b { font-weight: 650; }
.city-opt span { font-size: .8rem; color: var(--muted); }

/* ------------------------------------------------------------- misc UI ---- */

.sport-ico {
    width: 44px; height: 44px; border-radius: 13px; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.35rem;
    background: color-mix(in srgb, var(--tag, #18a558) 18%, #fff);
    color: var(--tag, #18a558);
}
.sport-ico svg { width: 22px; height: 22px; }
.pball { vertical-align: -.18em; }
.temoji { display: inline-block; line-height: 1; }

/* passkeys */
.passkey-msg { text-align: center; font-size: .88rem; font-weight: 600; margin: .6rem 0 0; min-height: 1.2em; }
.passkey-msg.is-error { color: var(--red); }
.passkey-msg.is-ok { color: var(--green-700); }
.auth-or { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .8rem; margin: 1rem 0; }
.auth-or::before, .auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-pw { border: 1px solid var(--line); border-radius: 12px; padding: 0 .9rem; margin-top: .2rem; }
.auth-pw summary { cursor: pointer; font-weight: 600; font-size: .92rem; padding: .7rem 0; color: var(--ink-soft); list-style: none; }
.auth-pw summary::-webkit-details-marker { display: none; }
.auth-pw[open] summary { margin-bottom: .2rem; }

/* god mode */
.gm-top { display: flex; align-items: center; gap: .7rem; padding: max(.7rem, env(safe-area-inset-top)) 1.2rem .7rem; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.gm-brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); text-decoration: none; }
.gm-brand img { width: 30px; height: 30px; border-radius: 9px; box-shadow: var(--shadow-sm); }
.gm-top .spacer { flex: 1; }
.gm-top form { display: inline; margin: 0; }

.quick-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: .3rem; }
.quick-actions .btn { flex: 1 1 auto; }
@media (max-width: 520px) {
    .quick-actions { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
    .quick-actions .btn { flex: 0 0 auto; }
}

.filters {
    display: flex; flex-wrap: wrap; gap: .55rem; align-items: center;
    background: var(--surface); border: 1px solid var(--line);
    border-radius: var(--radius); padding: .7rem; box-shadow: var(--shadow-sm);
    margin-bottom: 1.1rem;
}
.filters .select { width: auto; min-width: 132px; flex: 0 0 auto; }
.filters .input { flex: 1 1 140px; min-width: 120px; }
.filters .btn { flex: 0 0 auto; }

.mi { width: 14px; height: 14px; vertical-align: -2px; margin-right: 1px; color: var(--muted); }

.backlink {
    display: inline-flex; align-items: center; gap: .3rem;
    color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: .7rem;
}
.backlink svg { width: 18px; height: 18px; }
.backlink:hover { color: var(--green-700); }

.contact-box {
    display: flex; align-items: center; gap: .45rem;
    background: var(--green-050); border: 1px solid var(--green-100);
    border-radius: 11px; padding: .6rem .8rem; font-weight: 650; margin-top: .3rem;
}
.contact-box svg { color: var(--green); width: 18px; height: 18px; }

.brand-name, .brand-full, .brand-short { font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }
.hero h1, .auth-card h1 { font-weight: 800; }

/* External ranking profiles (USTA, UTR, WTA) */
.rank-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .7rem; }
.rank-badge { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600;
    color: var(--rc, #0b5cab); background: color-mix(in srgb, var(--rc, #0b5cab) 10%, #fff);
    border: 1px solid color-mix(in srgb, var(--rc, #0b5cab) 26%, transparent);
    padding: 5px 11px; border-radius: 999px; text-decoration: none; line-height: 1.2; }
.rank-badge b { font-weight: 800; }
.rank-badge.is-link::after { content: "\2197"; font-weight: 700; opacity: .6; }
.rank-badge.is-link:hover { background: color-mix(in srgb, var(--rc, #0b5cab) 16%, #fff); }
.rc-ranked { display: inline-flex; align-items: center; gap: .25rem; color: var(--green); font-weight: 600; }
.rc-ranked svg { width: 14px; height: 14px; }
.rank-details { border: 1px solid var(--line, #e4ece5); border-radius: 14px; padding: 12px 14px; margin: .2rem 0 1rem; }
.rank-details > summary { cursor: pointer; font-weight: 650; list-style: none; display: flex; align-items: center; gap: .4rem; }
.rank-details > summary::-webkit-details-marker { display: none; }
.rank-details > summary::before { content: "\25B8"; color: var(--green); transition: transform .15s ease; display: inline-block; }
.rank-details[open] > summary::before { transform: rotate(90deg); }
.rank-block { padding: 12px 0; border-top: 1px dashed var(--line, #e4ece5); }
.rank-block:first-of-type { border-top: 0; }
.rank-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rank-tag { font-size: .72rem; font-weight: 800; color: #fff; background: var(--rc, #0b5cab); padding: 3px 8px; border-radius: 6px; letter-spacing: .02em; }
.rank-join { display: inline-block; margin-top: 6px; color: var(--rc, var(--green)); font-weight: 600; font-size: .8rem; }

.pk-done { display: flex; align-items: center; gap: .75rem; background: color-mix(in srgb, var(--green) 10%, #fff); border: 1px solid color-mix(in srgb, var(--green) 25%, transparent); border-radius: 12px; padding: .8rem 1rem; }
.pk-done-ico { color: var(--green); display: inline-flex; }
.pk-done-ico svg { width: 26px; height: 26px; }
.pk-done-title { font-weight: 700; font-family: var(--font-display); }

/* Court geolocation pin */
.geo-pin-block { margin-bottom: 1rem; }
.geo-status { font-size: .82rem; color: var(--muted); margin-top: .4rem; text-align: center; }
.geo-status.is-ok { color: var(--green); }
.geo-status.is-error { color: #c0392b; }
.file-input { padding: .5rem; font-size: .9rem; }

/* Court photos */
.court-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.court-photo { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--line, #e4ece5); }
.court-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Court photo uploader (tap a square) */
.photo-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.photo-slot { position: relative; aspect-ratio: 1; border: 2px dashed color-mix(in srgb, var(--green) 38%, #d9e5dd); border-radius: 12px; display: grid; place-items: center; cursor: pointer; background-size: cover; background-position: center; overflow: hidden; transition: border-color .15s ease, background-color .15s ease; }
.photo-slot:hover { border-color: var(--green); background-color: color-mix(in srgb, var(--green) 7%, #fff); }
.photo-slot.has-image { border-style: solid; border-color: var(--green); }
.photo-slot:focus-within { outline: 2px solid var(--green); outline-offset: 2px; }
.photo-slot-empty { color: var(--green); display: grid; place-items: center; pointer-events: none; }
.photo-slot-empty svg { width: 20px; height: 20px; }
.photo-slot.has-image .photo-slot-empty { display: none; }
.photo-slot.is-loading { opacity: .55; }

/* Community confirmation */
.conf-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.conf-chip { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.conf-chip svg { width: 14px; height: 14px; }
.conf-chip.is-ok { color: var(--green); background: color-mix(in srgb, var(--green) 12%, #fff); }
.conf-chip.is-hours { color: #8a6b12; background: #faf1d6; }
.conf-chip.is-warn { color: #c0392b; background: #fbe9e7; }
.conf-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: .6rem; }
.conf-opt { display: flex; align-items: center; gap: .5rem; padding: .6rem .8rem; border: 1px solid var(--line, #e4ece5); border-radius: 12px; cursor: pointer; }
.conf-opt input { margin: 0; flex: none; }
.conf-opt span { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; font-size: .92rem; }
.conf-opt svg { width: 16px; height: 16px; }
.conf-note { display: flex; gap: .6rem; align-items: flex-start; padding: .5rem 0; border-top: 1px dashed var(--line, #e4ece5); }
.conf-note-badge { font-size: .66rem; font-weight: 800; padding: 2px 7px; border-radius: 6px; color: #fff; flex: none; text-transform: uppercase; letter-spacing: .02em; }
.conf-note-badge.conf-accurate { background: var(--green); }
.conf-note-badge.conf-hours { background: #d8a72a; }
.conf-note-badge.conf-inaccurate { background: #c0392b; }
.conf-note-text { font-weight: 600; font-size: .92rem; }

/* Avatar upload */
.avatar-upload { display: flex; align-items: center; gap: 1rem; }
.avatar-preview { width: 68px; height: 68px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.4rem; background-size: cover; background-position: center; flex: none; font-family: var(--font-display); }
.avatar-preview.has-image { color: transparent; }
.avatar-edit { position: relative; display: inline-flex; cursor: pointer; flex: none; border-radius: 50%; }
.avatar-edit .avatar-preview { transition: filter .15s ease; }
.avatar-edit:hover .avatar-preview, .avatar-edit:focus-within .avatar-preview { filter: brightness(.86); }
.avatar-edit:focus-within { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 50%; }
.avatar-edit-badge { position: absolute; right: -2px; bottom: -2px; width: 26px; height: 26px; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; border: 2px solid #fff; box-shadow: var(--shadow-sm); }
.avatar-edit-badge svg { width: 13px; height: 13px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.profile-hero .avatar-edit { flex: none; }
.profile-hero .avatar-preview { width: 76px; height: 76px; font-size: 1.65rem; }
.profile-hero .avatar-edit-badge { width: 28px; height: 28px; }
.profile-hero .avatar-edit-badge svg { width: 14px; height: 14px; }

/* Availability chips */
.chip-check-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: .5rem .9rem; border: 1px solid var(--line, #e4ece5); border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer; user-select: none; }
.chip-check input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.chip-check input:focus-visible + span { outline: 2px solid var(--green); outline-offset: 2px; }

/* Add to Home Screen banner */
.a2hs-banner {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    transform: translate(-50%, 150%);
    z-index: 120;
    width: min(440px, calc(100vw - 24px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 12px 14px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: transform .34s cubic-bezier(.2, .7, .3, 1), opacity .34s ease;
}
.a2hs-banner.is-in { transform: translate(-50%, 0); opacity: 1; }
/* Sit above the mobile tab bar on app pages */
.app-body .a2hs-banner { bottom: calc(var(--tab-h, 64px) + 14px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) {
    .app-body .a2hs-banner { bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
}
.a2hs-icon { flex: none; width: 44px; height: 44px; border-radius: 11px; box-shadow: var(--shadow-sm); }
.a2hs-body { flex: 1 1 auto; min-width: 0; }
.a2hs-title { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: .98rem; line-height: 1.2; color: var(--ink); }
.a2hs-text { margin: 2px 0 0; font-size: .82rem; line-height: 1.35; color: var(--muted); }
.a2hs-text b { color: var(--ink); font-weight: 700; }
.a2hs-share { vertical-align: -4px; color: var(--green-600); }
.a2hs-actions { flex: none; display: flex; align-items: center; gap: 6px; }
.a2hs-btn { border: 0; background: var(--green); color: #fff; font-weight: 700; font-size: .86rem; padding: .5rem .95rem; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.a2hs-btn:hover { background: var(--green-600); }
.a2hs-x { border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; width: 34px; height: 34px; border-radius: 999px; cursor: pointer; }
.a2hs-x:hover { background: var(--surface-2); color: var(--ink); }

/* Membership / billing */
.plan-badge { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 700; color: var(--green-700); background: var(--green-050); border: 1px solid var(--green-100); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.plan-badge svg { width: 13px; height: 13px; }
.plan-badge-club { color: var(--gold-700); background: var(--gold-050); border-color: var(--gold-100); }

.plan-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plan-status strong { display: block; font-family: var(--font-display); }
.plan-status-note { font-size: .85rem; color: var(--muted); }
.plan-status.is-trial, .plan-status.is-active { border-left: 3px solid var(--green); }
.plan-status.is-warn { border-left: 3px solid var(--gold-600); }

.cycle-toggle { display: inline-flex; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 4px; margin: 16px 0; }
.cycle-opt { display: inline-flex; align-items: center; gap: 6px; padding: .4rem .9rem; border-radius: 999px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.cycle-opt.is-on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.cycle-save { font-size: .66rem; font-weight: 700; color: var(--green-700); background: var(--green-050); padding: 1px 6px; border-radius: 999px; }

.plan-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .plan-grid { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.plan-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; }
.plan-card.is-popular { border-color: var(--green); box-shadow: 0 0 0 1px var(--green), var(--shadow); }
.plan-tag { position: absolute; top: -10px; left: 20px; background: var(--green); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.plan-name { font-family: var(--font-display); font-size: 1.3rem; font-weight: 800; margin: 0; }
.plan-card.is-club .plan-name { color: var(--gold-700); }
.plan-tagline { font-size: .85rem; color: var(--muted); margin: .25rem 0 .75rem; }
.plan-price { display: flex; align-items: baseline; gap: 2px; }
.plan-amount { font-family: var(--font-display); font-size: 2.1rem; font-weight: 800; }
.plan-per { color: var(--muted); font-weight: 600; }
.plan-permo { font-size: .78rem; color: var(--muted); margin-top: 2px; }
.plan-perks { list-style: none; padding: 0; margin: 14px 0 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.plan-perks li { display: flex; gap: 8px; font-size: .88rem; align-items: flex-start; }
.plan-perks svg { width: 16px; height: 16px; color: var(--green); flex: none; margin-top: 2px; }
.plan-current { cursor: default; }

.checkout-summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.co-plan { font-family: var(--font-display); font-weight: 800; font-size: 1.1rem; }
.co-price { display: flex; align-items: baseline; gap: 2px; }
.card-field { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 6px 10px; min-height: 44px; margin: .4rem 0; background: var(--surface); }
.field-label { display: block; font-weight: 700; font-size: .9rem; margin-top: .5rem; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: .85rem; }
.back-link svg { width: 16px; height: 16px; }
.btn.is-loading { opacity: .7; pointer-events: none; }
.refer-row { display: flex; gap: 8px; margin-top: 8px; }
.refer-row .input { flex: 1; }
.center { text-align: center; }

.home-banner { display: flex; align-items: center; gap: 10px; background: var(--green-050); border: 1px solid var(--green-100); color: var(--ink); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 16px; font-size: .9rem; text-decoration: none; }
.home-banner svg { width: 18px; height: 18px; color: var(--green-700); flex: none; }
.home-banner span { flex: 1; }
.home-banner.is-warn { background: var(--gold-050); border-color: var(--gold-100); }
.home-banner.is-warn svg { color: var(--gold-700); }
.membership-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; text-decoration: none; color: inherit; }
.membership-link:hover { border-color: var(--line-strong); }

/* Matches + leaderboard */
.opp-fixed { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 6px 0; }
.win-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: .3rem 0 .2rem; }
.win-opt { position: relative; }
.win-opt input { position: absolute; opacity: 0; pointer-events: none; }
.win-opt span { display: block; text-align: center; padding: .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm); font-weight: 700; cursor: pointer; }
.win-opt input:checked + span { background: var(--green); color: #fff; border-color: var(--green); }
.match-pending { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.match-head { display: flex; align-items: center; gap: 10px; }
.match-actions { display: flex; gap: 6px; }
.match-actions form { margin: 0; }
.list-card { padding: 4px 0; }
.match-line, .lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; text-decoration: none; color: inherit; border-bottom: 1px solid var(--line); }
.match-line:last-child, .lb-row:last-child { border-bottom: 0; }
.match-line:hover, .lb-row:hover { background: var(--surface-2); }
.match-main, .lb-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.match-main strong, .lb-main strong { font-weight: 700; }
.match-badge { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: .8rem; color: #fff; }
.match-badge.is-win { background: var(--green); }
.match-badge.is-loss { background: color-mix(in srgb, var(--ink) 45%, #fff); }
.match-delta { font-weight: 800; font-variant-numeric: tabular-nums; }
.match-delta.is-up { color: var(--green-700); }
.match-delta.is-down { color: var(--gold-700); }
.lb-rank { flex: none; width: 26px; text-align: center; font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.lb-row.is-me { background: var(--green-050); }
.lb-elo { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.empty-state { text-align: center; }
.empty-state p { color: var(--muted); margin-bottom: 12px; }

/* Tournaments */
.tourney-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .tourney-grid { grid-template-columns: repeat(2, 1fr); } }
.tourney-card { display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; }
.tourney-card:hover { border-color: var(--line-strong); }
.tourney-top { display: flex; align-items: center; justify-content: space-between; }
.tourney-sport { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--green-700); }
.tourney-status { width: auto; height: auto; padding: 2px 8px; border-radius: 999px; font-size: .68rem; }
.tourney-name { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; margin: 0; }
.tourney-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.tourney-meta { display: flex; flex-wrap: wrap; gap: 12px; color: var(--muted); font-size: .9rem; }
.tourney-meta svg { width: 15px; height: 15px; vertical-align: -2px; }
.tourney-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tourney-actions form { margin: 0; }
.gm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .gm-form-row { grid-template-columns: 1fr; } }

/* Invite card + username handle */
.invite-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.invite-copy { display: flex; flex-direction: column; }
.invite-copy strong { font-family: var(--font-display); }
.handle-input { position: relative; }
.handle-at { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; pointer-events: none; }
.handle-input .input { padding-left: 26px; }
.rc-handle { color: var(--muted); font-weight: 600; font-size: .85em; }
.ph-handle { color: var(--muted); font-weight: 600; font-size: .9rem; margin-top: 1px; }

/* Legal pages (privacy, terms) */
.legal { padding: 32px 20px 64px; }
.legal-inner { max-width: 760px; margin: 0 auto; }
.legal-inner h1 { font-family: var(--font-display); font-size: clamp(1.8rem, 5vw, 2.4rem); font-weight: 800; margin: 0 0 4px; }
.legal-updated { color: var(--muted); font-size: .9rem; margin: 0 0 24px; }
.legal-inner h2 { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; margin: 28px 0 8px; }
.legal-inner p, .legal-inner li { color: var(--ink-soft); line-height: 1.65; }
.legal-inner ul { padding-left: 20px; margin: 8px 0; }
.legal-inner li { margin: 4px 0; }
.legal-inner a { color: var(--green-600); font-weight: 600; }

/* God Mode UI */
.gm-nav { display: flex; gap: 4px; overflow-x: auto; padding: 8px 1.2rem; background: var(--surface); border-bottom: 1px solid var(--line); -webkit-overflow-scrolling: touch; }
.gm-nav-link { display: inline-flex; align-items: center; gap: 6px; padding: .5rem .85rem; border-radius: 999px; font-weight: 700; font-size: .88rem; color: var(--muted); white-space: nowrap; text-decoration: none; }
.gm-nav-link svg { width: 17px; height: 17px; }
.gm-nav-link:hover { background: var(--surface-2); color: var(--ink); }
.gm-nav-link.is-active { background: var(--green-050); color: var(--green-700); }
.gm-email { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) { .gm-email { display: none; } }
.gm-shell h2 svg { width: 18px; height: 18px; vertical-align: -3px; }

.gm-metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 620px) { .gm-metrics { grid-template-columns: repeat(4, 1fr); } }
.gm-metric { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; text-decoration: none; color: inherit; }
a.gm-metric:hover { border-color: var(--green); }
.gm-metric-num { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; line-height: 1; }
.gm-metric-label { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .82rem; font-weight: 600; }
.gm-metric-label svg { width: 14px; height: 14px; }

.gm-cols { display: grid; grid-template-columns: 1fr; gap: 8px; }
@media (min-width: 800px) { .gm-cols { grid-template-columns: 1fr 1fr; gap: 20px; } }
.gm-col { min-width: 0; }

.gm-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.gm-row:last-child { border-bottom: 0; }
.gm-row:hover { background: var(--surface-2); }
.gm-row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.gm-row-main strong { font-weight: 700; }
.gm-row-main .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gm-elo { font-family: var(--font-display); font-weight: 800; font-size: .9rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.gm-match-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.gm-match-row:last-child { border-bottom: 0; }
.gm-match-row:hover { background: var(--surface-2); }
.gm-match-players { flex: 1; display: flex; flex-direction: column; min-width: 0; font-weight: 600; }
.gm-mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .72rem; color: var(--muted); background: var(--surface-2); padding: 2px 6px; border-radius: 6px; }
.gm-mono-lg { font-size: .9rem; color: var(--ink); }

.gm-court-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 620px) { .gm-court-grid { grid-template-columns: repeat(4, 1fr); } }
.gm-court-card { display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: inherit; }
.gm-court-thumb { aspect-ratio: 4/3; border-radius: var(--radius-sm); background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.gm-court-thumb svg { width: 26px; height: 26px; }
.gm-court-name { font-weight: 700; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.gm-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-bottom: 16px; }
.gm-gallery-img { aspect-ratio: 4/3; border-radius: var(--radius-sm); background: var(--surface-2) center/cover no-repeat; border: 1px solid var(--line); }

.gm-detail-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 800px) { .gm-detail-grid { grid-template-columns: 340px 1fr; align-items: start; } }

.gm-vs { display: flex; align-items: center; gap: 12px; }
.gm-vs-side { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; text-decoration: none; color: inherit; padding: 8px; border-radius: var(--radius); }
.gm-vs-side.is-winner { background: var(--green-050); }
.gm-vs-side strong { font-weight: 700; }
.gm-vs-mid { text-align: center; }
.gm-vs-score { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; }

/* Picture pickers (match opponent + court) */
.pick { margin: .3rem 0 .2rem; }
.pick-search { margin-bottom: 8px; }
.pick-list { display: flex; flex-direction: column; gap: 6px; max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.pick-card { position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.pick-card input { position: absolute; opacity: 0; pointer-events: none; }
.pick-card:hover { border-color: var(--line-strong); }
.pick-card:has(input:checked) { border-color: var(--green); background: var(--green-050); }
.pick-card input:checked ~ .pick-tick { opacity: 1; }
.pick-body { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.pick-body strong { font-weight: 700; }
.pick-body .tiny { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick-thumb, .pick-icon { flex: none; width: 40px; height: 40px; border-radius: 9px; background: var(--surface-2) center/cover no-repeat; display: grid; place-items: center; color: var(--muted); }
.pick-thumb svg, .pick-icon svg { width: 18px; height: 18px; }
.pick-tick { flex: none; opacity: 0; color: var(--green); transition: opacity .12s ease; }
.pick-tick svg { width: 18px; height: 18px; }
.court-new { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }

/* Public player profile (viewed logged out) */
.profile-public { padding-top: 24px; padding-bottom: 56px; }

/* Podium (top 3 rankings) */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-items: end; max-width: 520px; margin: 16px auto 0; }
.podium-spot { display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 8px 14px; position: relative; }
.podium-spot .avatar { width: 60px; height: 60px; }
.podium-spot.is-gold { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold), var(--shadow); }
@media (min-width: 480px) { .podium-spot.is-gold { transform: translateY(-12px); } }
.podium-spot.is-silver { border-color: #c7cdd4; }
.podium-spot.is-bronze { border-color: #d8a877; }
.podium-medal { position: absolute; top: -12px; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .82rem; color: #fff; background: var(--muted); border: 2px solid var(--surface); }
.podium-spot.is-gold .podium-medal { background: var(--gold); }
.podium-spot.is-silver .podium-medal { background: #9aa3ad; }
.podium-spot.is-bronze .podium-medal { background: #b97e4e; }
.podium-name { font-weight: 700; font-size: .88rem; text-align: center; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.podium-elo { font-family: var(--font-display); font-weight: 800; }
.podium-elo-label { font-family: var(--font); font-weight: 600; font-size: .7rem; color: var(--muted); }
.mk-podium { text-align: center; }
.mk-nav-link { font-weight: 700; color: var(--ink); text-decoration: none; padding: 0 6px; font-size: .92rem; }
.mk-nav-link:hover { color: var(--green-700); }

/* Court "browse by area" SEO links */
.area-links { display: flex; flex-wrap: wrap; gap: 8px; }
.area-link { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .86rem; font-weight: 600; }
.area-link:hover { border-color: var(--green-600); color: var(--green-700); }
.area-link svg, .area-link .pball { flex: none; }

/* God Mode settings — passkeys */
.pk-list { display: flex; flex-direction: column; gap: 8px; }
.pk-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.pk-ico { flex: none; color: var(--green-700); display: grid; place-items: center; }
.pk-ico svg { width: 18px; height: 18px; }
.pk-main { flex: 1; min-width: 0; }
.pk-rename { display: flex; gap: 6px; align-items: center; }
.pk-rename .input { max-width: 260px; padding: 6px 10px; font-size: .9rem; }

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
