/* Hyggeton
   Bygget til mobil først. Computer-layoutet ligger nederst i en media query.

   Farverne har faste betydninger:
   grøn  = gør noget / tilmeldt
   orange = dig
   gul   = venteliste
   grå   = meldt fra, aflyst, pause */

:root {
    --bg: #F5F2EA;
    --surface: #FFFFFF;
    --surface-2: #F0EDE4;
    --ink: #1A1F1C;
    --muted: #5B625D;
    --line: #E3DED2;
    --line-strong: #D3CDBF;

    --green: #1E5E4A;
    --green-dark: #154536;
    --green-soft: #DCEBE3;
    --on-green: #FFFFFF;

    --you: #C2410C;
    --you-text: #9A3412;
    --you-soft: #FDE7DA;

    --wait-text: #7A4F00;
    --wait-soft: #FBEFD2;

    --off-text: #5B625D;
    --off-soft: #ECE8DE;

    --danger: #B42318;
    --danger-soft: #FDECEA;

    --radius: 20px;
    --radius-sm: 14px;
    --display: 'Bricolage Grotesque', system-ui, sans-serif;
    --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --nav-height: 72px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);

    color-scheme: light;
}

/* Mørk tilstand følger telefonens indstilling. */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #121513;
        --surface: #1C201D;
        --surface-2: #252A26;
        --ink: #EEF0EC;
        --muted: #A3ABA5;
        --line: #2E3430;
        --line-strong: #3C433E;

        --green: #2F8A6C;
        --green-dark: #3FA181;
        --green-soft: #1D3A30;
        --on-green: #FFFFFF;

        --you: #EA6A2E;
        --you-text: #FDBA8C;
        --you-soft: #3A2317;

        --wait-text: #F5C860;
        --wait-soft: #3A2F14;

        --off-text: #A3ABA5;
        --off-soft: #2A2F2B;

        --danger: #F97066;
        --danger-soft: #3A1B19;

        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
}

body.has-nav { padding-bottom: calc(var(--nav-height) + var(--safe-bottom)); }

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

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.icon { flex-shrink: 0; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); border: 0; white-space: nowrap;
}

[hidden] { display: none !important; }

/* ---------- Tekst ---------- */

.title {
    margin: 0 0 16px;
    font-family: var(--display);
    font-size: 30px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.title-xl { font-size: 34px; }

.muted { color: var(--muted); }
.strong { font-weight: 700; color: var(--ink); }
.block { display: block; }
.hint { margin: 0; font-size: 14px; color: var(--muted); display: flex; align-items: center; justify-content: center; gap: 6px; }

/* ---------- Opbygning ---------- */

.content { padding: 8px 16px 32px; max-width: 720px; margin: 0 auto; }
.content.narrow { max-width: 520px; }

.section { margin-top: 24px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.section-title {
    margin: 0 0 10px;
    padding: 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: var(--muted);
    display: flex;
    justify-content: space-between;
}
.section-title-ok { color: var(--green); }
.section-title-wait { color: var(--wait-text); }
.section-title-you { color: var(--you-text); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 4px;
    padding-top: max(20px, env(safe-area-inset-top));
}

.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 52px;
    margin: 8px -4px 4px;
}
.page-head-pad { padding: 8px 12px 0; padding-top: max(8px, env(safe-area-inset-top)); margin: 0; }
.page-head-right { display: flex; align-items: center; gap: 8px; }

/* ---------- Kort ---------- */

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px;
}
.card-title { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }

.card-row {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--ink);
    min-height: 72px;
}
a.card-row:hover { color: var(--ink); border-color: var(--line-strong); }
.card-row.is-selected { border: 2px solid var(--green); }
.card-row-main { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.card-row-title { font-size: 17px; font-weight: 700; }
.card-row .muted { font-size: 14px; }

.empty-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.empty-card p { margin: 0; }
.empty-state { text-align: center; padding-top: 80px; }

/* ---------- Knapper ---------- */

.btn {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 17px;
    font-weight: 700;
    text-align: center;
    transition: transform 0.08s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn-block { width: 100%; }
.btn-grow { flex-grow: 1; }
.btn-lg { min-height: 60px; font-size: 18px; }
.btn-small { min-height: 44px; padding: 0 14px; font-size: 15px; border-radius: 12px; }

.btn-primary { background: var(--green); color: var(--on-green); }
.btn-primary:hover { background: var(--green-dark); color: var(--on-green); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn-secondary:hover { color: var(--ink); border-color: var(--muted); }
.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.btn-dashed { background: transparent; color: var(--green); border: 2px dashed var(--line-strong); margin-top: 24px; }

/* Når man har trykket én gang på en "farlig" knap (se app.js) */
.is-confirming { background: var(--danger) !important; color: #FFFFFF !important; border-color: var(--danger) !important; }

.icon-button {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    border: none;
    background: transparent;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.icon-button:hover { color: var(--ink); background: var(--surface-2); }
.icon-button-outline { border: 1px solid var(--line-strong); background: var(--surface); }
.icon-button-primary { background: var(--green); color: var(--on-green); }
.icon-button-primary:hover { background: var(--green-dark); color: var(--on-green); }

.link-button {
    background: none;
    border: none;
    padding: 12px 4px;
    color: var(--green);
    font-weight: 700;
    font-size: 15px;
}
.link-muted { color: var(--muted); font-weight: 700; font-size: 15px; padding: 12px 4px; }
.link-danger { color: var(--danger); }
.link-small { font-size: 14px; font-weight: 700; padding: 8px 4px; }

.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

/* ---------- Chips og badges ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    background: var(--surface-2);
    color: var(--muted);
    margin: 0;
}
.chip-small { height: 22px; font-size: 11px; padding: 0 8px; }
.chip-lg { height: 36px; padding: 0 14px; font-size: 14px; font-weight: 500; border-radius: 18px; }
.chip-ok { background: var(--green-soft); color: var(--green-dark); }
.chip-wait { background: var(--wait-soft); color: var(--wait-text); }
.chip-off { background: var(--off-soft); color: var(--off-text); }
.chip-you { background: var(--you-soft); color: var(--you-text); }
.chip .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--you); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.badge {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--you);
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ---------- Avatarer og klub-mærker ---------- */

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #FFFFFF;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-sm { width: 26px; height: 26px; font-size: 11px; }
.avatar-md { width: 34px; height: 34px; font-size: 14px; }
.avatar-lg { width: 44px; height: 44px; font-size: 16px; }
.avatar-xl { width: 72px; height: 72px; font-size: 28px; }
.avatar-link { display: inline-flex; }

.club-badge {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: var(--green);
    color: var(--on-green);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.club-badge-lg { width: 48px; height: 48px; border-radius: 14px; font-size: 20px; font-family: var(--display); }
.club-badge-xl { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; font-family: var(--display); }
.club-badge-muted { background: var(--surface-2); color: var(--muted); }

.club-switch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 44px;
    padding: 0 14px 0 6px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--surface);
    color: var(--ink);
    font-size: 15px;
    font-weight: 700;
    max-width: 75%;
}
.club-switch:hover { color: var(--ink); }
.club-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.logo-mark {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--green);
    color: #FFFFFF;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.logo-mark-lg { width: 72px; height: 72px; border-radius: 20px; }
.logo-mark-xl { width: 76px; height: 76px; border-radius: 20px; }

/* ---------- Dato-brik ---------- */

.date-tile {
    width: 56px;
    height: 60px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.date-tile-day { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--muted); }
.date-tile-num { font-family: var(--display); font-size: 24px; font-weight: 700; line-height: 1; }
.date-tile-icon { color: var(--muted); display: flex; margin-top: 2px; }
.date-tile-green { background: var(--green-soft); color: var(--green); }
.date-tile-green .date-tile-day { color: var(--green); }

/* ---------- Sessionskort på forsiden ---------- */

.session-list { display: flex; flex-direction: column; gap: 12px; }

.session-card { display: flex; flex-direction: column; gap: 14px; }
.session-card-link { display: flex; gap: 14px; align-items: center; color: var(--ink); }
.session-card-link:hover { color: var(--ink); }
.session-card-main { flex-grow: 1; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.session-card-title { font-size: 17px; font-weight: 700; }
.session-card-main > .muted { font-size: 14px; }
.session-card-status { display: flex; align-items: center; gap: 10px; margin-top: 5px; font-size: 14px; }
.session-card-status .muted { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }

.session-card.is-cancelled { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.session-card.is-cancelled .session-card-title { color: var(--muted); text-decoration: line-through; }
.session-card.is-cancelled .date-tile { background: var(--off-soft); color: var(--muted); }

/* ---------- Session-siden ---------- */

.session-head { margin-bottom: 8px; }
.session-head .title { margin-bottom: 8px; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; color: var(--muted); }
.meta-row span { display: inline-flex; align-items: center; gap: 5px; }

.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.person {
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    min-width: 0;
}
.person-name { font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.person.is-me { background: var(--you-soft); border: 2px solid var(--you); }
.person.is-me .person-name { color: var(--you-text); font-weight: 700; }
.person-wait { background: var(--wait-soft); border-color: transparent; }
.person-pos { width: 24px; text-align: center; font-family: var(--display); font-size: 16px; font-weight: 700; color: var(--wait-text); }

.action-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(var(--nav-height) + var(--safe-bottom));
    background: var(--surface);
    border-top: 1px solid var(--line);
    padding: 12px 16px;
    z-index: 10;
}
.action-bar-inner { display: flex; gap: 10px; max-width: 688px; margin: 0 auto; }
.action-bar-inner .btn-secondary { flex-shrink: 0; }
.session-page { padding-bottom: 110px; }

.state-button {
    flex-grow: 1;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 16px;
}
.state-ok { background: var(--green-soft); color: var(--green-dark); border: 2px solid var(--green); }
.state-wait { background: var(--wait-soft); color: var(--wait-text); }

/* ---------- Beskeder ---------- */

.alert {
    background: var(--danger-soft);
    color: var(--danger);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    font-size: 15px;
}
.alert p { margin: 0; }
.alert p + p { margin-top: 4px; }
.alert-off { background: var(--off-soft); color: var(--ink); margin-top: 16px; }

.toast {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
    z-index: 50;
    max-width: 520px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 52px;
    padding: 6px 8px 6px 18px;
    border-radius: 16px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    animation: toast-in 0.2s ease-out;
}
.no-nav .toast { bottom: calc(16px + var(--safe-bottom)); }
.has-action-bar .toast { bottom: calc(var(--nav-height) + var(--safe-bottom) + 90px); }
.toast-error { background: var(--danger); color: #FFFFFF; }
.toast form { margin: 0; }
.toast-undo {
    background: transparent;
    border: none;
    color: #7DD3B0;
    font-weight: 700;
    padding: 10px 12px;
}
.toast.is-hiding { opacity: 0; transform: translateY(8px); transition: all 0.25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.dev-note {
    margin: 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--wait-soft);
    color: var(--wait-text);
    font-size: 14px;
    text-align: center;
}

/* ---------- Formularer ---------- */

.field { display: flex; flex-direction: column; gap: 6px; border: none; padding: 0; margin: 0; min-width: 0; }
.field-label { font-size: 14px; font-weight: 700; padding: 0; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

input[type=text], input[type=email], input[type=number], input[type=date], input[type=time], select, textarea {
    width: 100%;
    min-height: 52px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--bg);
    font-size: 17px; /* 16px+ så iPhone ikke zoomer ind når man trykker i feltet */
    -webkit-appearance: none;
    appearance: none;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235B625D' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 40px;
}
textarea { resize: vertical; min-height: 88px; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--green-soft); border-color: var(--green); }
input[type=checkbox], input[type=radio] { accent-color: var(--green); }

.color-picker { display: flex; flex-wrap: wrap; gap: 10px; }
.color-option input { position: absolute; opacity: 0; }
.color-option {
    width: 44px;
    height: 44px;
    border-radius: 22px;
    background: var(--swatch);
    display: inline-block;
    position: relative;
    cursor: pointer;
}
.color-option:has(input:checked) { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.color-option:has(input:focus-visible) { outline: 3px solid var(--green); outline-offset: 4px; }

.weekday-picker { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.weekday-option input { position: absolute; opacity: 0; }
.weekday-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.weekday-option input:checked + span { background: var(--green); color: var(--on-green); border-color: var(--green); }
.weekday-option input:focus-visible + span { outline: 3px solid var(--green-soft); }

/* Tænd/sluk-knap (en helt almindelig checkbox under motorhjelmen) */
.switch-row { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; }
.switch {
    width: 52px;
    height: 32px;
    border-radius: 16px;
    background: var(--line-strong);
    position: relative;
    flex-shrink: 0;
    transition: background 0.15s;
}
.switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 26px;
    height: 26px;
    border-radius: 13px;
    background: #FFFFFF;
    transition: transform 0.15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
.switch-row input:checked + .switch { background: var(--green); }
.switch-row input:checked + .switch::after { transform: translateX(20px); }
.switch-row input:focus-visible + .switch { outline: 3px solid var(--green-soft); }

/* ---------- Login ---------- */

.login {
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 440px;
    margin: 0 auto;
    padding: 64px 24px 40px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.login-name { font-family: var(--display); font-size: 36px; font-weight: 700; letter-spacing: -0.02em; }
.login-card { display: flex; flex-direction: column; gap: 20px; padding: 24px; border-radius: 24px; }
.login-card .muted { margin: 4px 0 0; }
.login-links { display: flex; justify-content: center; gap: 28px; }
.login-links form { margin: 0; }

/* Kodefeltet er ét rigtigt input (så telefonen kan udfylde koden automatisk),
   lagt usynligt ovenpå nogle bokse der viser cifrene. JS fylder boksene ud. */
.code-input { position: relative; display: flex; justify-content: center; }
.code-input input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    font-size: 16px;
    border: none;
    z-index: 1;
}
.code-boxes { display: flex; gap: 12px; }
.code-box {
    width: 80px;
    height: 96px;
    border: 2px solid var(--line-strong);
    border-radius: 18px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--display);
    font-size: 52px;
    font-weight: 700;
}
.code-input:focus-within .code-box.is-active { border: 3px solid var(--green); background: var(--surface); }
/* Uden JavaScript viser vi bare det almindelige felt */
.no-js .code-input input { position: static; opacity: 1; font-size: 40px; text-align: center; letter-spacing: 12px; }
.no-js .code-boxes { display: none; }

.invite-card { align-items: center; text-align: center; }
.invite-card p { margin: 0; }
.invite-title { margin: 4px 0; font-size: 28px; }

/* ---------- Velkommen og profil ---------- */

.welcome-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 0 24px; }
.welcome-head .title { margin: 12px 0 0; }
.welcome-head p { margin: 0; }

.profile-head { display: flex; align-items: center; gap: 16px; padding: 24px 0 20px; }
.profile-head .title { margin: 0 0 2px; font-size: 26px; }
.profile-head p { margin: 0; font-size: 14px; }

.list-links { margin-top: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-links form { margin: 0; }
.list-link {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 0 16px;
    background: none;
    border: none;
    border-top: 1px solid var(--line);
    color: var(--ink);
    font-size: 16px;
    font-weight: 500;
    text-align: left;
}
.list-links > :first-child, .list-links > :first-child .list-link { border-top: none; }
.list-link span { flex-grow: 1; }
.list-link:hover { color: var(--ink); background: var(--surface-2); }

/* ---------- Klub ---------- */

.club-head { display: flex; align-items: center; gap: 16px; padding: 16px 0 4px; }
.club-head .title { margin: 0 0 2px; font-size: 28px; }
.club-head p { margin: 0; font-size: 14px; }
.club-desc { margin: 8px 0 0; color: var(--muted); }

.row-actions { display: flex; gap: 8px; margin: 0; }

.invite-row { display: flex; gap: 8px; align-items: center; }
.invite-row input { font-size: 14px; min-height: 44px; color: var(--muted); }

.member-list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.member { border-top: 1px solid var(--line); }
.member:first-child { border-top: none; }
.member summary {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 0 16px;
    list-style: none;
    cursor: pointer;
}
.member summary::-webkit-details-marker { display: none; }
.member[data-static] summary { cursor: default; }
.member-name { flex-grow: 1; font-weight: 500; }
.member.is-me .member-name { color: var(--you-text); font-weight: 700; }
.member-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 0 16px 14px 62px; margin: 0; }
.member-actions .muted { width: 100%; font-size: 14px; }

.leave-form { margin-top: 32px; text-align: center; }

/* ---------- Hjemmeskærm-guide ---------- */

.a2hs-page { background: #2B302C; }
.a2hs { min-height: 100vh; min-height: 100dvh; display: flex; align-items: flex-end; justify-content: center; }
.a2hs-sheet {
    width: 100%;
    max-width: 480px;
    background: var(--surface);
    border-radius: 28px 28px 0 0;
    padding: 32px 24px calc(24px + var(--safe-bottom));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
}
.a2hs-title { text-align: center; font-size: 26px; margin: 0; max-width: 300px; }
.a2hs-steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; width: 100%; }
.a2hs-steps li {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 60px;
    padding: 0 14px;
    border-radius: 16px;
    background: var(--bg);
    font-size: 17px;
    font-weight: 500;
}
.a2hs-sheet > div, .a2hs-sheet > .btn { width: 100%; }
.step-num {
    width: 30px;
    height: 30px;
    border-radius: 15px;
    background: var(--green);
    color: var(--on-green);
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.step-icon-blue { color: #2563EB; }
.a2hs-done { display: flex; align-items: center; gap: 8px; color: var(--green); font-weight: 700; }
.a2hs-sheet > .a2hs-arrow { width: auto; color: #2563EB; display: flex; pointer-events: none; animation: nudge 1.2s ease-in-out infinite; }
.a2hs-arrow.is-up svg { transform: rotate(180deg); }
@keyframes nudge { 50% { translate: 0 6px; } }

.a2hs-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 8px 0 4px;
    padding: 6px 6px 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--green-soft);
}
.a2hs-banner a { flex-grow: 1; display: flex; align-items: center; gap: 10px; color: var(--green-dark); font-weight: 700; font-size: 15px; }

/* ---------- Menuen ---------- */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: flex;
    height: calc(var(--nav-height) + var(--safe-bottom));
    padding: 8px 12px var(--safe-bottom);
    background: var(--surface);
    border-top: 1px solid var(--line);
}
.bottom-nav .nav-link {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
}
.bottom-nav .nav-icon { width: 60px; height: 32px; border-radius: 16px; display: flex; align-items: center; justify-content: center; }
.bottom-nav .nav-link.is-active { color: var(--green); font-weight: 700; }
.bottom-nav .nav-link.is-active .nav-icon { background: var(--green-soft); }

.sidebar { display: none; }

/* ---------- Små telefoner ---------- */

@media (max-width: 360px) {
    .content { padding-left: 12px; padding-right: 12px; }
    .title { font-size: 26px; }
    .title-xl { font-size: 30px; }
    .people-grid { gap: 6px; }
    .person { padding: 0 8px; gap: 8px; }
    .code-box { width: 68px; height: 84px; font-size: 44px; }
    .action-bar { padding: 10px 12px; }
    .btn { padding: 0 14px; }
}

/* ---------- Computer ---------- */

@media (min-width: 960px) {
    body.has-nav { padding-bottom: 0; padding-left: 248px; }

    .bottom-nav { display: none; }
    .has-nav .top-bar .club-switch { display: none; }
    .has-nav .top-bar { justify-content: flex-end; padding: 24px 32px 0; }

    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: 248px;
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding: 24px 16px;
        background: var(--surface);
        border-right: 1px solid var(--line);
        overflow-y: auto;
    }
    .sidebar-logo { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--ink); }
    .sidebar .club-switch { max-width: none; width: 100%; background: var(--bg); border-radius: 14px; height: 48px; }
    .sidebar .club-switch-name { flex-grow: 1; }
    .sidebar-nav { display: flex; flex-direction: column; gap: 4px; }
    .sidebar-nav .nav-link {
        height: 44px;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 0 12px;
        border-radius: 12px;
        color: var(--ink);
        font-size: 15px;
        font-weight: 500;
    }
    .sidebar-nav .nav-icon { display: flex; }
    .sidebar-nav .nav-link:hover { background: var(--surface-2); }
    .sidebar-nav .nav-link.is-active { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }
    .sidebar-admin { display: flex; flex-direction: column; gap: 2px; }
    .sidebar-label { padding: 0 12px 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
    .sidebar-admin a {
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0 12px;
        border-radius: 12px;
        color: var(--ink);
        font-size: 15px;
    }
    .sidebar-admin a:hover { background: var(--surface-2); }

    .content { padding: 16px 40px 48px; max-width: 960px; margin: 0; }
    .content.narrow { max-width: 600px; }
    .page-head-pad { padding: 24px 40px 0; }

    .session-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
    .people-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

    .action-bar { left: 248px; bottom: 0; padding: 16px 40px; }
    .action-bar-inner { margin: 0; max-width: 560px; }
    .session-page { padding-bottom: 120px; }

    .toast { bottom: 24px; left: calc(248px + 40px); right: auto; width: 440px; margin: 0; }
    .has-action-bar .toast { bottom: 110px; }
    .no-nav .toast { left: 50%; transform: translateX(-50%); }

    .a2hs { align-items: center; }
    .a2hs-sheet { border-radius: 28px; }
}

/* =====================================================================
   Fase 2: guiden "Start session", live-siden og score-skærmen
   ===================================================================== */

/* ---------- Guiden ---------- */

.wizard-head { padding: 16px 16px 0; padding-top: max(16px, env(safe-area-inset-top)); max-width: 552px; margin: 0 auto; }
.wizard-head-row { display: flex; align-items: center; justify-content: space-between; margin: 0 -4px 12px; }
.wizard-step { font-size: 14px; font-weight: 700; color: var(--muted); }
.progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.progress span { height: 6px; border-radius: 3px; background: var(--line); }
.progress span.is-done { background: var(--green); }

.wizard { padding-top: 20px; padding-bottom: 120px; display: flex; flex-direction: column; gap: 16px; }
.wizard .title { margin: 0; }
.wizard-title-row { display: flex; align-items: baseline; justify-content: space-between; padding: 8px 4px 0; }
.wizard-count { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--green); }
.wizard-foot {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 16px calc(16px + var(--safe-bottom));
    background: linear-gradient(to top, var(--bg) 70%, transparent);
    z-index: 10;
}
.wizard-foot .btn { max-width: 520px; margin: 0 auto; display: flex; }

.quick-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 64px;
    padding: 0 16px;
    border: none;
    border-radius: 16px;
    background: var(--green-soft);
    color: var(--green-dark);
    text-align: left;
    width: 100%;
}
.quick-card-main { flex-grow: 1; display: flex; flex-direction: column; font-size: 14px; }
.quick-card-main .strong { color: var(--green-dark); font-size: 16px; }

.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-chip {
    min-height: 54px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 15px;
    font-weight: 500;
    color: var(--muted);
    cursor: pointer;
    min-width: 0;
}
.check-chip span:first-of-type { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check-chip input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.check-chip:has(input:checked) { background: var(--green-soft); border: 2px solid var(--green); color: var(--ink); }
.check-chip.is-me:has(input:checked) { background: var(--you-soft); border-color: var(--you); color: var(--you-text); font-weight: 700; }
.check-chip.is-guest { background: var(--green-soft); border: 2px solid var(--green); color: var(--ink); padding-right: 4px; }
.chip-tag { margin-left: auto; font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.chip-remove { width: 36px; height: 36px; border: none; background: none; color: var(--muted); display: flex; align-items: center; justify-content: center; border-radius: 18px; }

.guest-add { display: flex; gap: 8px; }
.guest-add input { flex-grow: 1; }
.guest-add .btn { flex-shrink: 0; }

.stepper { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; }
.stepper-button {
    width: 56px;
    height: 56px;
    border-radius: 28px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
}
.stepper-button:disabled { opacity: 0.35; }
.stepper-value { display: flex; flex-direction: column; align-items: center; }
.stepper-number { font-family: var(--display); font-size: 56px; font-weight: 700; line-height: 1; }

.option-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
}
.option-card:has(input:checked) { border: 2px solid var(--green); }
.option-card-head { display: flex; align-items: center; gap: 10px; }
.option-card-head input { width: 22px; height: 22px; margin: 0; }
.option-card-title { flex-grow: 1; font-size: 17px; }
.mini-courts { display: flex; flex-wrap: wrap; gap: 10px; }
.mini-court-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; }
.mini-court {
    width: 84px;
    height: 48px;
    border: 2px solid var(--green);
    border-radius: 6px;
    background: var(--green-soft);
    color: var(--green);
    display: flex;
    align-items: center;
    justify-content: space-around;
    font-family: var(--display);
    font-size: 16px;
    font-weight: 700;
}
.mini-net { width: 2px; height: 44px; background: var(--green); }
.mini-court.is-empty { border: 2px dashed var(--line-strong); background: transparent; color: var(--muted); justify-content: center; }

.option-row {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    cursor: pointer;
    color: var(--muted);
}
.option-row-small { min-height: 56px; }
.option-row input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; }
.option-row-main { flex-grow: 1; display: flex; flex-direction: column; font-size: 14px; }
.option-row-main .strong { font-size: 16px; }
.option-row:has(input:checked) { border: 2px solid var(--green); color: var(--green); }
.soon { padding: 4px 0; }

.segmented { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 8px 0 0; border: none; border-radius: 16px; background: var(--off-soft); }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; font-weight: 500; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.segmented input:focus-visible + span { outline: 3px solid var(--green-soft); }

/* ---------- Live ---------- */

.live-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 8px;
    padding-top: max(20px, env(safe-area-inset-top));
    max-width: 720px;
    margin: 0 auto;
}
.live-title { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 700; }
.live-head-right { display: flex; align-items: center; gap: 10px; }
.timer-chip {
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 700;
}
.sync-dot { width: 10px; height: 10px; border-radius: 5px; background: #16A34A; display: inline-block; flex-shrink: 0; }
.sync-dot.is-offline { background: #D97706; }
.live-content { padding-bottom: 120px; }
.time-hint { margin: 0 4px 10px; font-size: 14px; color: var(--muted); }
.time-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--wait-soft);
    color: var(--wait-text);
    font-weight: 700;
}

/* Dit eget kort øverst */
.me-card { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px 18px; border-radius: 24px; background: var(--surface); margin: 0; }
.me-card.is-on-court { border: 3px solid var(--you); }
.me-card-plain { flex-direction: row; align-items: center; justify-content: space-between; border: 1px solid var(--line); }
.me-card-plain .strong { display: flex; align-items: center; gap: 8px; }
.me-card-wait { border: 2px solid var(--you-soft); }
.me-card-top { display: flex; align-items: center; justify-content: space-between; }
.me-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    background: var(--you);
    color: #FFFFFF;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
}
.me-pill .dot { width: 7px; height: 7px; border-radius: 4px; background: #FFFFFF; }
.me-court { font-family: var(--display); font-size: 22px; font-weight: 700; }
.me-teams { display: flex; flex-direction: column; gap: 8px; }
.me-team { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 18px; }
.me-divider { height: 1px; background: var(--line); }
.me-score { font-family: var(--display); font-size: 40px; font-weight: 700; line-height: 1; color: var(--muted); }
.me-score.is-mine { color: var(--green); }
.me-name { color: var(--you); }
.me-result { margin: 0; font-weight: 700; color: var(--green-dark); }
.me-wait-row { display: flex; align-items: center; gap: 14px; }
.me-wait-num {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: var(--you-soft);
    color: var(--you-text);
    font-family: var(--display);
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Banerne */
.courts { display: flex; flex-direction: column; gap: 8px; }
.court { border-radius: 18px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.court.is-mine { border: 3px solid var(--you); }
.court.is-ready { border-style: dashed; border-color: var(--green); border-width: 2px; }
.court.is-ready.is-mine { border-color: var(--you); }
.court.is-free { background: transparent; border-style: dashed; border-color: var(--line-strong); }
.court-main { display: flex; align-items: center; gap: 12px; padding: 12px 14px; color: var(--ink); }
a.court-main:hover { color: var(--ink); }
.court-label { width: 44px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.court-kicker { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.court-num { font-family: var(--display); font-size: 22px; font-weight: 700; line-height: 1; }
.court-teams { flex-grow: 1; display: flex; flex-direction: column; gap: 2px; font-size: 15px; min-width: 0; }
.court-score { font-family: var(--display); font-size: 22px; font-weight: 700; white-space: nowrap; }
.court-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 14px 10px 70px; margin: 0; font-size: 13px; }
.court-actions .link-small { display: inline-flex; align-items: center; gap: 4px; }
.link-muted-small { color: var(--muted); background: none; border: none; font-weight: 700; }

.swap-team { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.swap-team .plus { color: var(--muted); padding: 0 2px; }
.swap-player {
    border: 1px solid transparent;
    background: none;
    padding: 4px 6px;
    margin: -4px -2px;
    border-radius: 8px;
    font-size: 15px;
    color: var(--ink);
}
.is-swapping .swap-player, .is-swapping .queue-chip summary { border: 1px dashed var(--green); }
.swap-player.is-selected, .queue-chip summary.is-selected { background: var(--green); color: var(--on-green); border-color: var(--green); }
.swap-player.is-selected .me-name { color: var(--on-green); }

.hints { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.hints li { padding: 10px 14px; border-radius: 12px; background: var(--green-soft); color: var(--green-dark); font-size: 14px; }
.hints li::before { content: '💡 '; }

/* Køen */
.queue { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.queue-chip summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-size: 15px;
    cursor: pointer;
}
.queue-chip summary::-webkit-details-marker { display: none; }
.queue-chip.is-next summary { background: var(--green-soft); color: var(--green-dark); font-weight: 700; border-color: transparent; }
.queue-chip.is-me summary { background: var(--you-soft); color: var(--you-text); font-weight: 700; border-color: var(--you); }
.queue-chip.is-paused summary { background: var(--off-soft); color: var(--off-text); border-color: transparent; }
.queue-chip.is-gone summary { background: transparent; color: var(--muted); border-style: dashed; }
.queue-tag { font-weight: 500; }
.queue-chip[open] { flex-basis: 100%; }
.queue-menu { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 0 4px; margin: 0; }

.my-matches { display: flex; flex-direction: column; gap: 10px; }
.my-match { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.my-match strong { white-space: nowrap; }
.is-won { color: var(--green); }
.is-lost { color: var(--muted); }

.add-player { padding: 0; margin-top: 8px; }
.add-player summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 16px; cursor: pointer; }
.add-player summary::-webkit-details-marker { display: none; }
.add-player form { padding: 0 16px 16px; }

.icon-button-lg { width: 52px; height: 52px; border-radius: var(--radius-sm); }

/* "Du er på Bane 3" */
.call-banner {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    left: 16px;
    right: 16px;
    z-index: 60;
    max-width: 520px;
    margin: 0 auto;
    padding: 18px 20px;
    border-radius: 18px;
    background: var(--you);
    color: #FFFFFF;
    font-family: var(--display);
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    animation: toast-in 0.25s ease-out;
}

/* Forsiden og sessionssiden når der spilles */
.live-card {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0 20px;
    padding: 14px 16px;
    border-radius: var(--radius);
    background: var(--you-soft);
    border: 2px solid var(--you);
    color: var(--you-text);
}
.live-card:hover { color: var(--you-text); }
.live-card-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.live-card-pill .dot, .btn-live .dot { width: 8px; height: 8px; border-radius: 4px; background: currentColor; }
.live-card-title { flex-grow: 1; font-weight: 700; }
.btn-live { background: var(--you); }
.btn-live:hover { background: var(--you-text); }
.state-button-small { flex-grow: 0; padding: 0 16px; }
button.state-button { cursor: pointer; }

/* ---------- Score ---------- */

.score-page { background: var(--bg); }
.score {
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 560px;
    margin: 0 auto;
}
.score-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px; padding-top: max(12px, env(safe-area-inset-top)); }
.score-halves { flex-grow: 1; display: flex; flex-direction: column; gap: 10px; padding: 0 12px; min-height: 0; }
.score-half { position: relative; flex: 1 1 0; display: flex; min-height: 0; }
.score-tap {
    flex-grow: 1;
    border: 1px solid var(--line);
    border-radius: 28px;
    background: var(--surface);
    color: var(--ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    transition: transform 0.06s ease;
}
.score-tap:active { transform: scale(0.985); }
.score-team { font-size: 20px; font-weight: 500; padding: 0 60px; text-align: center; }
.score-number { font-family: var(--display); font-size: clamp(96px, 22vh, 170px); font-weight: 700; line-height: 1; color: var(--muted); }
.score-half.is-bottom .score-tap { background: var(--green); color: var(--on-green); border-color: var(--green); }
.score-half.is-bottom .score-number { color: var(--on-green); }
.score-half.is-mine .score-tap { border: 3px solid var(--you); }
.score-half.is-mine .score-team { font-weight: 700; }
.score-minus {
    position: absolute;
    left: 14px;
    top: 14px;
    width: 48px;
    height: 48px;
    border-radius: 24px;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-half.is-bottom .score-minus { background: var(--green-dark); border-color: rgba(255, 255, 255, 0.25); color: #FFFFFF; }
.score-status { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.score-finish { text-align: center; padding-bottom: calc(8px + var(--safe-bottom)); margin: 0; }
.score-finish .link-button { color: var(--muted); }

.set-won {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 20px calc(20px + var(--safe-bottom));
    border-radius: 28px 28px 0 0;
    background: var(--surface);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: toast-in 0.2s ease-out;
}
.set-won-title { margin: 0 0 6px; text-align: center; font-family: var(--display); font-size: 26px; font-weight: 700; }

/* ---------- Sæt hold ---------- */

.team-picker { display: flex; flex-direction: column; gap: 8px; }
.team-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0;
    padding: 8px 8px 8px 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface);
}
.team-row.is-me { border: 2px solid var(--you); }
.team-row-name { float: left; padding: 0; font-weight: 700; }
.team-choice { display: flex; gap: 4px; margin-left: auto; }
.team-choice input { position: absolute; opacity: 0; }
.team-choice span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border-radius: 12px;
    background: var(--off-soft);
    color: var(--muted);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}
.team-choice label:nth-child(2) input:checked + span { background: var(--green); color: var(--on-green); }
.team-choice label:nth-child(3) input:checked + span { background: #3B5BA5; color: #FFFFFF; }
.team-choice label:first-child input:checked + span { background: var(--surface); border: 1px solid var(--line-strong); }
.team-choice input:focus-visible + span { outline: 3px solid var(--green-soft); }

@media (max-width: 360px) {
    .live-head { padding-left: 12px; padding-right: 12px; }
    .live-title { font-size: 20px; }
    .check-grid { gap: 6px; }
    .mini-court { width: 70px; }
    .team-choice span { min-width: 40px; padding: 0 8px; font-size: 13px; }
    .me-team { font-size: 16px; }
}

@media (min-width: 960px) {
    .live-head { max-width: 960px; margin: 0; padding: 24px 40px 8px; }
    .courts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .court-main { flex-wrap: wrap; }
    .court-actions { padding-left: 14px; }
    .wizard-foot { left: 248px; }
    .no-nav .wizard-foot { left: 0; }
    .call-banner { left: calc(248px + 40px); right: auto; width: 440px; }
}

/* =====================================================================
   Fase 3: statistik, turneringer, niveauer og beskeder
   ===================================================================== */

.stat-card { display: flex; flex-direction: column; gap: 12px; color: var(--ink); }
a.stat-card:hover { color: var(--ink); border-color: var(--line-strong); }
.stat-card-head { display: flex; align-items: center; justify-content: space-between; }
.stat-card-head .section-title { margin: 0; padding: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.stat { display: flex; flex-direction: column; align-items: center; padding: 8px 0; border-radius: 14px; background: var(--bg); }
.stat-num { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat .muted { font-size: 13px; }
.stat-link { margin-top: 16px; }

.push-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; min-height: 56px; }
.push-box + .push-box { border-top: 1px solid var(--line); padding-top: 12px; }
.push-box-text { display: flex; flex-direction: column; font-size: 14px; }
.push-box-text .strong { font-size: 16px; }

.segmented-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segmented-links a { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 12px; color: var(--muted); font-weight: 500; }
.segmented-links a.is-active { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }
.hint-left { justify-content: flex-start; text-align: left; margin: 12px 4px; }

/* Rangliste */
.leaderboard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.leader-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 60px;
    padding: 8px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
}
a.leader-row:hover { color: var(--ink); border-color: var(--line-strong); }
.leader-row.is-me { background: var(--you-soft); border: 2px solid var(--you); }
.leader-pos { width: 26px; text-align: center; font-family: var(--display); font-size: 18px; font-weight: 700; color: var(--muted); flex-shrink: 0; }
.leader-row.is-top .leader-pos { color: var(--green); }
.leader-row.is-top:first-child .leader-pos::after { content: ' 🏆'; font-size: 13px; }
.leader-name { flex-grow: 1; display: flex; flex-direction: column; min-width: 0; font-size: 14px; }
.leader-name .strong { font-size: 16px; }
.leader-points { font-family: var(--display); font-size: 24px; font-weight: 700; white-space: nowrap; }
.leaderboard-compact .leader-row { min-height: 52px; }

.winner-card {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 12px 0 0;
    padding: 16px 18px;
    border-radius: var(--radius);
    background: var(--wait-soft);
    color: var(--wait-text);
}
.winner-card .muted { color: var(--wait-text); opacity: 0.8; font-size: 13px; }
.winner-name { font-family: var(--display); font-size: 24px; font-weight: 700; color: var(--ink); }

/* Turneringstabel */
.table-card { padding: 4px 8px; overflow-x: auto; }
.standings { width: 100%; border-collapse: collapse; font-size: 15px; }
.standings th { font-size: 12px; font-weight: 700; color: var(--muted); padding: 8px 6px; text-align: center; }
.standings td { padding: 10px 6px; text-align: center; border-top: 1px solid var(--line); }
.standings .left { text-align: left; }
.standings .pos { color: var(--muted); font-weight: 700; width: 24px; }
.standings tr.is-me td { background: var(--you-soft); }
.my-match.is-unplayed { color: var(--muted); }

/* Guiden */
.option-row-you { background: var(--you-soft); border-color: transparent; color: var(--you-text); }
.option-row-you .muted { color: var(--you-text); }
.option-row-you:has(input:checked) { border-color: var(--you); color: var(--you-text); }
.option-row-dashed { background: transparent; border: 2px dashed var(--line-strong); color: var(--green); }
.option-row-dashed:hover { color: var(--green-dark); }
.court-note { margin: -4px 14px 8px 70px; font-size: 13px; color: var(--muted); }

/* Niveauer */
.chip-level { background: var(--green-soft); color: var(--green-dark); }
.member-level { padding-top: 0; }
.level-button {
    min-height: 36px;
    padding: 0 12px;
    border-radius: 18px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
}
.level-button.is-active { background: var(--green); border-color: var(--green); color: var(--on-green); }
