/* ═════════════════════════════════════════════════════════════════════════
   VM-konkurranse 2026 — design system
   Inspired by FotMob / Sofascore / Fantasy Premier League
   ═════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

:root {
    /* Surface colors — deep navy with subtle blue undertones */
    --bg:           #0a0e1a;
    --bg-1:         #111726;
    --bg-2:         #1a2236;
    --bg-3:         #232c43;

    /* Borders */
    --border:       rgba(255, 255, 255, 0.08);
    --border-2:     rgba(255, 255, 255, 0.14);
    --border-strong:rgba(255, 255, 255, 0.22);

    /* Text */
    --fg:           #f5f7fb;
    --fg-2:         #cbd2e0;
    --fg-3:         #8b95a8;
    --fg-faint:     #5d667a;

    /* Brand accent — vibrant green (pitch grass meets neon) */
    --acc:          #22d27a;
    --acc-2:        #00b366;
    --acc-3:        #008a4a;
    --acc-faint:    rgba(34, 210, 122, 0.13);
    --acc-glow:     rgba(34, 210, 122, 0.32);
    --acc-grad:     linear-gradient(135deg, #22d27a 0%, #00b366 100%);

    /* Secondary accents */
    --gold:         #f9c842;
    --gold-2:       #e0b13a;
    --silver:       #cdd5e3;
    --bronze:       #d97c43;
    --red:          #ff5566;
    --blue:         #5e9eff;
    --purple:       #a855f7;
    --orange:       #ff8c42;

    /* Tournament theme — gradient header */
    --hero-grad:    linear-gradient(135deg, #0a8d4a 0%, #00b366 30%, #1d6df0 100%);

    /* Sizing */
    --r-sm:         6px;
    --r:            10px;
    --r-lg:         14px;
    --r-xl:         20px;

    /* Shadows */
    --shadow-sm:    0 2px 6px rgba(0,0,0,0.18);
    --shadow:       0 6px 20px rgba(0,0,0,0.32);
    --shadow-lg:    0 12px 40px rgba(0,0,0,0.45);
    --shadow-glow:  0 0 0 1px var(--acc-faint), 0 6px 24px var(--acc-glow);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    color: var(--fg);
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 210, 122, 0.08), transparent 60%),
        radial-gradient(ellipse 60% 40% at 90% 100%, rgba(94, 158, 255, 0.06), transparent 60%),
        var(--bg);
    background-attachment: fixed;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--acc); text-decoration: none; transition: opacity 120ms ease; }
a:hover { opacity: 0.85; }

h1, h2, h3, h4 { font-family: 'Manrope', 'Inter', sans-serif; margin: 0 0 12px; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
h4 { font-size: 14px; font-weight: 600; }

.hidden { display: none !important; }
.muted { color: var(--fg-3); }
.muted-soft { color: var(--fg-2); }
.small { font-size: 12px; }
.tabular { font-variant-numeric: tabular-nums; }

/* ─── Top bar ─────────────────────────────────────────────────────────── */
.topbar {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 18px;
    padding: 12px 22px;
    background: rgba(10, 14, 26, 0.78);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border-bottom: 1px solid var(--border);
}
.brand {
    display: flex; align-items: center; gap: 10px;
    font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 17px;
    letter-spacing: -0.02em;
}
.brand .logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--acc-grad);
    color: #051911;
    font-size: 16px;
    box-shadow: 0 4px 14px var(--acc-glow);
}
.brand-text em { color: var(--acc); font-style: normal; font-weight: 800; }

#nav { display: flex; gap: 2px; flex: 1; margin-left: 14px; flex-wrap: wrap; }
#nav a {
    padding: 7px 13px;
    border-radius: 8px;
    color: var(--fg-2);
    font-size: 13px;
    font-weight: 500;
    transition: background 120ms, color 120ms;
}
#nav a:hover { background: var(--bg-2); color: var(--fg); opacity: 1; }
#nav a.active {
    background: var(--acc-faint);
    color: var(--acc);
    font-weight: 600;
}
.admin-only { display: none !important; }
body.is-admin .admin-only { display: inline-flex !important; }

.user-menu { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.user-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 10px 4px 4px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 99px;
}
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
    color: white;
    background: var(--acc-grad);
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: -0.02em;
}
.avatar.lg { width: 44px; height: 44px; font-size: 18px; }
.avatar.sm { width: 22px; height: 22px; font-size: 10px; }

/* ─── Buttons ─────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    border: 1px solid var(--border-2);
    background: var(--bg-2);
    color: var(--fg);
    padding: 8px 14px;
    border-radius: var(--r-sm);
    font-size: 13px;
    font-weight: 500;
    transition: background 120ms, border-color 120ms, transform 60ms, box-shadow 120ms;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn-primary {
    background: var(--acc-grad);
    border-color: transparent;
    color: #051911;
    font-weight: 700;
    box-shadow: 0 4px 14px var(--acc-glow);
}
.btn-primary:hover { box-shadow: 0 6px 20px var(--acc-glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--bg-2); }
.btn-warn { background: transparent; border-color: var(--red); color: var(--red); }
.btn-warn:hover { background: rgba(255, 85, 102, 0.1); }
.btn.small { padding: 5px 10px; font-size: 12px; }
.btn.tiny { padding: 3px 8px; font-size: 11px; }

/* ─── Auth shell ──────────────────────────────────────────────────────── */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 20px;
    background:
        radial-gradient(circle at top right, rgba(94, 158, 255, 0.18), transparent 50%),
        radial-gradient(circle at bottom left, rgba(34, 210, 122, 0.18), transparent 50%),
        linear-gradient(180deg, #0a0e1a, #060912);
}
.auth-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 36px 32px;
    width: 100%; max-width: 420px;
    box-shadow: var(--shadow-lg), 0 0 80px rgba(34, 210, 122, 0.05);
}
.auth-about { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border);
    font-size: 12.5px; line-height: 1.55; color: var(--fg-2); }
.auth-about p { margin: 0 0 6px; }
.auth-about p:last-child { margin-bottom: 0; }
.auth-about strong { color: var(--fg); }
.sidebar-foot-note { margin-top: 8px; font-size: 10.5px; line-height: 1.4; color: var(--fg-3); text-align: center; }
.auth-hero { text-align: center; margin-bottom: 22px; }
.auth-hero .auth-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: var(--acc-grad);
    font-size: 32px;
    margin-bottom: 14px;
    box-shadow: 0 8px 24px var(--acc-glow);
}
.auth-hero h1 { font-size: 24px; margin: 6px 0 4px; letter-spacing: -0.03em; }
.auth-hero p { margin: 0; font-size: 13px; }

.tabs { display: flex; gap: 4px; padding: 4px; background: var(--bg); border-radius: 10px; margin-bottom: 22px; border: 1px solid var(--border); }
.tab { flex: 1; padding: 9px; background: transparent; border: 0; border-radius: 8px; color: var(--fg-3); font-weight: 500; font-size: 13px; transition: background 120ms, color 120ms; }
.tab.active { background: var(--bg-2); color: var(--fg); box-shadow: var(--shadow-sm); }

.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--fg-3); font-weight: 500; }
.auth-form input, .auth-form select {
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    padding: 11px 13px;
    color: var(--fg);
    font-size: 14px;
    transition: border-color 120ms, box-shadow 120ms;
}
.auth-form input:focus, .auth-form select:focus {
    outline: none; border-color: var(--acc);
    box-shadow: 0 0 0 3px var(--acc-faint);
}
.auth-form button { margin-top: 8px; padding: 12px; font-size: 14px; }

.oauth-section {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
}
.oauth-divider { display: flex; align-items: center; gap: 10px; color: var(--fg-3); font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 14px; }
.oauth-divider::before, .oauth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.btn-oauth {
    width: 100%;
    background: white;
    color: #1f2937;
    border: 1px solid #d1d5db;
    padding: 10px;
    font-weight: 600;
    margin-top: 6px;
}
.btn-oauth:hover { background: #f3f4f6; border-color: #9ca3af; }
.btn-oauth img, .btn-oauth svg { width: 18px; height: 18px; }

/* ─── App layout ──────────────────────────────────────────────────────── */
main#app { padding: 24px 22px 80px; max-width: 1280px; margin: 0 auto; }

.card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
}
.card-tight { padding: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 800px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    main#app { padding: 14px 14px 80px; }
    h1 { font-size: 22px; }
}

/* ─── Hero (leaderboard) ──────────────────────────────────────────────── */
.hero {
    position: relative;
    padding: 28px 28px 24px;
    border-radius: var(--r-xl);
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.13), transparent 50%),
        var(--hero-grad);
    color: white;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.hero::after {
    content: ''; position: absolute; inset: 0;
    background:
        radial-gradient(circle at 12% 80%, rgba(255, 255, 255, 0.16), transparent 35%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><circle cx='50' cy='50' r='30' fill='none' stroke='white' stroke-width='1.5' opacity='0.08'/><line x1='50' y1='20' x2='50' y2='80' stroke='white' stroke-width='1.5' opacity='0.08'/></svg>") right -40px center / 220px no-repeat;
    pointer-events: none;
}
.hero h1 { font-size: 26px; margin: 0 0 4px; letter-spacing: -0.02em; }
.hero .subtitle { font-size: 13px; opacity: 0.85; margin-bottom: 18px; }
.hero-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; position: relative; z-index: 1; }
.hero-stat { background: rgba(255, 255, 255, 0.10); backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.14); border-radius: 12px; padding: 12px 16px; }
.hero-stat .label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.85; }
.hero-stat .value { font-family: 'Manrope', sans-serif; font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.hero-stat .sub { font-size: 12px; opacity: 0.85; }

@media (max-width: 600px) { .hero { padding: 22px 18px 18px; } }

/* ─── Stat tiles (other pages) ────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 16px 18px;
    transition: border-color 120ms, transform 120ms;
}
.stat:hover { border-color: var(--border-2); transform: translateY(-1px); }
.stat .label { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 600; }
.stat .value { font-family: 'Manrope', sans-serif; font-size: 26px; font-weight: 800; color: var(--acc); letter-spacing: -0.02em; }
.stat .sub { font-size: 12px; color: var(--fg-3); }

/* ─── Tables ──────────────────────────────────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
thead th { color: var(--fg-3); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; padding-top: 6px; padding-bottom: 6px; }
tbody tr { transition: background 120ms; }
tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ─── Leaderboard ─────────────────────────────────────────────────────── */
.lb-card { padding: 0; overflow: hidden; }
.lb-card { overflow-x: auto; }   /* never overlap — scroll if too narrow (#65) */
.lb-head, .lb-row { min-width: 600px; }
.lb-head {
    display: grid;
    grid-template-columns: 38px minmax(96px,1fr) repeat(9, 44px) 52px;
    padding: 9px 12px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--fg-3);
    font-weight: 600;
}
.lb-row {
    display: grid;
    grid-template-columns: 38px minmax(96px,1fr) repeat(9, 44px) 52px;
    padding: 9px 12px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    transition: background 120ms;
    gap: 2px;
}
.lb-row:last-child { border-bottom: 0; }
.lb-row:hover { background: rgba(255, 255, 255, 0.025); }
.lb-rank {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
    background: var(--bg-2);
    color: var(--fg-2);
    border: 1px solid var(--border-2);
}
.lb-rank.r1 { background: linear-gradient(135deg, #f9c842, #e0b13a); color: #2a1d00; border: 0; box-shadow: 0 4px 12px rgba(249, 200, 66, 0.32); }
.lb-rank.r2 { background: linear-gradient(135deg, #cdd5e3, #a8b3c7); color: #1a1f2c; border: 0; }
.lb-rank.r3 { background: linear-gradient(135deg, #d97c43, #b06030); color: #1a0e06; border: 0; }
.lb-name { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.lb-name a { color: var(--fg); }
.lb-pts { font-family: 'Manrope', sans-serif; font-size: 16px; font-weight: 800; color: var(--acc); text-align: right; letter-spacing: -0.01em; }
.lb-cell { text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; color: var(--fg-2); }
.lb-cell.zero { color: var(--fg-faint); }
.lb-name { font-size: 13px; }

@media (max-width: 980px) {
    .lb-card { overflow-x: visible; }
    .lb-head, .lb-row {
        grid-template-columns: 36px 1fr 56px;
        min-width: 0;
    }
    .lb-head .lb-cell:not(:first-of-type),
    .lb-row .lb-cell:not(:first-of-type) { display: none; }
    .lb-row .lb-cell { display: none; }
    .lb-row .lb-pts { display: block; }
    .lb-head .lb-pts { display: block; }
}

/* ─── Match cards ─────────────────────────────────────────────────────── */
.match-day { margin-bottom: 22px; }
.match-day-header {
    display: flex; align-items: baseline; gap: 10px;
    font-size: 12px; color: var(--fg-3);
    text-transform: uppercase; letter-spacing: 0.6px;
    margin: 16px 0 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}
.match-day-header .day-name { color: var(--fg); font-weight: 700; }
.match-day-header .day-count { color: var(--fg-faint); font-size: 11px; }

.match-row {
    display: grid;
    grid-template-columns: 70px 1fr 110px 1fr 60px;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--r);
    background: var(--bg-1);
    margin-bottom: 6px;
    transition: border-color 120ms, transform 80ms;
}
.match-row:hover { border-color: var(--border-2); }
.match-row .meta { font-size: 11px; color: var(--fg-3); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.match-row .home { display: flex; align-items: center; gap: 8px; justify-content: flex-end; min-width: 0; font-weight: 500; }
.match-row .home .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .away { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; }
.match-row .away .team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.match-row .vs {
    display: flex; gap: 4px; align-items: center; justify-content: center;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
}
.match-row .vs .ko-time { font-size: 13px; color: var(--fg-2); font-weight: 500; font-family: 'Inter', sans-serif; }
.match-row .vs .score { font-size: 18px; letter-spacing: -0.02em; }
.match-row .vs input {
    width: 38px; padding: 5px 6px; text-align: center;
    background: var(--bg); border: 1px solid var(--border-2);
    border-radius: var(--r-sm); color: var(--fg);
    font-family: 'Manrope', sans-serif; font-weight: 700;
    transition: border-color 120ms, box-shadow 120ms;
}
.match-row .vs input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
.match-row.locked .vs input { background: var(--bg); color: var(--fg-faint); cursor: not-allowed; }
/* Score dropdown (0–9) — replaces the old free-text score inputs */
.score-select {
    padding: 5px 4px; text-align: center; text-align-last: center;
    background: var(--bg); border: 1px solid var(--border-2);
    border-radius: var(--r-sm); color: var(--fg);
    font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14px;
    cursor: pointer; transition: border-color 120ms, box-shadow 120ms;
}
.score-select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
.score-select:disabled { color: var(--fg-faint); cursor: not-allowed; opacity: 0.7; }
.match-row .vs select.score-select { width: 46px; }
.match-row .flag-em { font-size: 18px; line-height: 1; flex-shrink: 0; }

.match-row .right-meta { font-size: 11px; color: var(--fg-3); text-align: right; }
.match-row.played { background: linear-gradient(180deg, var(--bg-1) 0%, rgba(34, 210, 122, 0.04) 100%); }

.badge {
    display: inline-flex; align-items: center;
    padding: 2px 8px;
    border-radius: 99px;
    background: var(--bg-3);
    font-size: 10px;
    color: var(--fg-2);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge.live { background: rgba(255, 85, 102, 0.18); color: var(--red); }
.badge.locked { background: rgba(255, 140, 66, 0.16); color: var(--orange); }
.badge.played { background: var(--acc-faint); color: var(--acc); }

@media (max-width: 720px) {
    .match-row { grid-template-columns: 1fr 108px 1fr; gap: 6px; padding: 10px; }
    .match-row .meta { grid-column: 1/-1; }
    .match-row .right-meta { display: none; }
    .match-row .home, .match-row .away { font-size: 13px; }
}

/* ─── Group standings ─────────────────────────────────────────────────── */
.standings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 14px; }
.standings-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
}
.standings-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 14px 18px;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
    border-bottom: 1px solid var(--border);
}
.standings-head h3 { margin: 0; font-size: 15px; font-family: 'Manrope', sans-serif; }
.standings-head .gh-status { font-size: 10px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.6px; padding: 3px 8px; border-radius: 99px; background: var(--bg-3); }
.standings-table { width: 100%; }
.standings-table th { padding: 8px 10px; font-size: 10px; }
.standings-table td { padding: 9px 10px; font-size: 13px; }
.standings-table td:first-child, .standings-table th:first-child { padding-left: 18px; }
.standings-table td:last-child, .standings-table th:last-child { padding-right: 18px; }
.standings-table .pos { width: 22px; text-align: center; font-weight: 700; font-family: 'Manrope', sans-serif; }
.standings-table .pos.p1 { color: var(--gold); }
.standings-table .pos.p2 { color: var(--silver); }
.standings-table .pos.p3 { color: var(--bronze); }
.standings-table .pos.p4 { color: var(--fg-faint); }
.standings-table .name { font-weight: 600; display: flex; align-items: center; gap: 8px; }
.standings-table .num { text-align: right; font-variant-numeric: tabular-nums; width: 30px; padding-left: 4px; padding-right: 4px; color: var(--fg-2); }
.standings-table .pts { font-weight: 700; color: var(--acc); font-family: 'Manrope', sans-serif; font-size: 14px; }
.standings-table tr.pos-1, .standings-table tr.pos-2 { background: rgba(34, 210, 122, 0.025); }
.advances-line { display: block; height: 2px; background: linear-gradient(to right, transparent, var(--acc) 30%, var(--acc) 70%, transparent); margin: 0; opacity: 0.5; }
.standings-card .footer-note { padding: 8px 18px 12px; font-size: 11px; color: var(--fg-3); }

.third-place-card { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.third-place-card table { width: 100%; }
.third-place-card .qualified { color: var(--acc); font-weight: 700; }
.third-place-card .out { color: var(--fg-faint); }
.third-place-card .cutoff-line td { border-top: 2px dashed var(--acc); padding-top: 12px; }

/* ─── Group tipping ───────────────────────────────────────────────────── */
.group-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 18px;
}
.group-card h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; font-family: 'Manrope', sans-serif; font-size: 16px; }
.group-table { display: flex; flex-direction: column; gap: 6px; }
.group-table .row {
    padding: 6px 8px;
    border-radius: var(--r-sm);
    background: var(--bg);
    border: 1px solid var(--border);
    gap: 8px;
    flex-wrap: nowrap;
}
.group-table select {
    flex: 1; min-width: 0;
    background: transparent;
    border: 0;
    color: var(--fg);
    padding: 4px 6px;
    font-size: 13px;
    cursor: pointer;
}
.group-table select:focus { outline: 2px solid var(--acc); border-radius: 4px; }
.pos-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    font-weight: 700; font-size: 11px;
    flex-shrink: 0;
    font-family: 'Manrope', sans-serif;
}
.pos-1 { background: rgba(249, 200, 66, 0.2);  color: var(--gold); }
.pos-2 { background: rgba(205, 213, 227, 0.18); color: var(--silver); }
.pos-3 { background: rgba(217, 124, 67, 0.18); color: var(--bronze); }
.pos-4 { background: var(--bg-3); color: var(--fg-faint); }

/* ─── Bracket ─────────────────────────────────────────────────────────── */
.bracket-wrap {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 12px 6px 24px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}
.bracket-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 240px;
    flex-shrink: 0;
    scroll-snap-align: start;
    justify-content: space-around;
}
.bracket-col.bc-r32 .bracket-match { margin-bottom: 0; }
.bracket-col h4 {
    margin: 0 0 4px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--fg-3);
    font-weight: 700;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.bracket-match {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 12px 14px;
    font-size: 13px;
    transition: border-color 120ms, transform 60ms;
}
.bracket-match:hover { border-color: var(--border-2); }
.bracket-match.locked { border-color: var(--border-2); opacity: 0.85; }
.bracket-match .meta { font-size: 11px; color: var(--fg-3); margin-bottom: 6px; }
.bracket-match .team-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 0; }
.bracket-match .team-row.win { color: var(--fg); font-weight: 600; }
.bracket-match .team-row.lose { color: var(--fg-faint); }
.bracket-match .team-row select {
    flex: 1; min-width: 0;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 6px;
    padding: 4px 6px;
    font-size: 12px;
}
.bracket-match .team-row input {
    width: 36px;
    padding: 3px 4px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--fg);
    border-radius: 6px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}
.bracket-match .team-row select.score-select {
    flex: 0 0 auto; width: 50px;
    background: var(--bg-2); border-color: var(--border);
    font-size: 13px; padding: 4px 4px;
}
.bracket-match .actual-line {
    color: var(--acc); font-size: 12px; padding-top: 6px;
    border-top: 1px dashed var(--border-2); margin-top: 6px;
    font-family: 'Manrope', sans-serif; font-weight: 700;
    text-align: center;
}
.bracket-match .vs-mid { font-size: 11px; color: var(--fg-3); text-align: center; padding: 2px 0; letter-spacing: 0.4px; }

/* ─── Specials ────────────────────────────────────────────────────────── */
.specials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.special-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    padding: 14px 16px;
    border-radius: var(--r);
}
.special-card h3 { font-size: 14px; margin-bottom: 10px; }
.special-card label { font-size: 11px; color: var(--fg-3); display: block; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.4px; font-weight: 600; }
.special-card .input-line { display: flex; gap: 6px; }
.special-card .input-line input,
.special-card .input-line select {
    flex: 1;
    padding: 8px 10px;
    background: var(--bg);
    border: 1px solid var(--border-2);
    color: var(--fg);
    border-radius: var(--r-sm);
    font-size: 13px;
}
.special-card .input-line input:focus,
.special-card .input-line select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }

/* ─── Tabs / sub-nav ──────────────────────────────────────────────────── */
.subnav {
    display: flex; gap: 4px;
    margin-bottom: 18px;
    overflow-x: auto;
    padding: 4px;
    background: var(--bg-1);
    border-radius: 10px;
    border: 1px solid var(--border);
    scrollbar-width: thin;
}
.subnav button {
    background: transparent;
    border: 0;
    color: var(--fg-3);
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    transition: background 120ms, color 120ms;
    white-space: nowrap;
}
.subnav button:hover { background: var(--bg-2); color: var(--fg-2); }
.subnav button.active { background: var(--acc-faint); color: var(--acc); font-weight: 600; }

/* ─── Tags / pills ────────────────────────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.tag-group { background: rgba(94, 158, 255, 0.16); color: var(--blue); }
.tag-r32 { background: var(--bg-3); color: var(--fg-2); }
.tag-r16 { background: var(--bg-3); color: var(--fg-2); }
.tag-qf { background: rgba(249, 200, 66, 0.18); color: var(--gold); }
.tag-sf { background: var(--acc-faint); color: var(--acc); }
.tag-final { background: linear-gradient(135deg, var(--gold), #e8a936); color: #2a1d00; font-weight: 700; }
.tag-bronze { background: rgba(217, 124, 67, 0.20); color: var(--bronze); }

/* ─── Toast ───────────────────────────────────────────────────────────── */
.toast {
    position: fixed; top: 18px; right: 22px;
    background: var(--bg-1);
    border: 1px solid var(--border-2);
    color: var(--fg);
    padding: 10px 16px;
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    transform: translateY(-12px); opacity: 0; pointer-events: none;
    transition: opacity 180ms, transform 180ms;
    z-index: 100; max-width: 360px;
    font-size: 13px;
    display: flex; align-items: center; gap: 8px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { border-color: var(--red); }
.toast.error::before { content: '⚠'; color: var(--red); }
.toast.ok { border-color: var(--acc); }
.toast.ok::before { content: '✓'; color: var(--acc); font-weight: 700; }

/* ─── Misc ────────────────────────────────────────────────────────────── */
.banner {
    background: var(--acc-faint);
    border: 1px solid var(--acc);
    color: var(--acc);
    padding: 12px 16px;
    border-radius: var(--r-sm);
    margin-bottom: 16px;
    font-size: 13px;
}
.banner-warn { background: rgba(255, 85, 102, 0.08); border-color: var(--red); color: var(--red); }
.banner-info { background: rgba(94, 158, 255, 0.08); border-color: var(--blue); color: var(--blue); }

.divider { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }

.spinner {
    width: 32px; height: 32px;
    border: 3px solid var(--border-2);
    border-top-color: var(--acc);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 60px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty {
    text-align: center; color: var(--fg-3);
    padding: 50px 20px;
    background: var(--bg-1);
    border: 1px dashed var(--border-2);
    border-radius: var(--r-lg);
}
.empty-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.5; }

/* ─── Notes FAB & panel ───────────────────────────────────────────────── */
.notes-fab {
    position: fixed; bottom: 24px; right: 24px;
    width: 54px; height: 54px;
    border-radius: 50%;
    background: var(--acc-grad);
    color: #051911;
    border: 0; cursor: pointer;
    font-size: 22px; font-weight: 700;
    box-shadow: 0 8px 24px var(--acc-glow);
    z-index: 9000;
    display: flex; align-items: center; justify-content: center;
    transition: transform 160ms, box-shadow 160ms;
}
.notes-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 32px var(--acc-glow); }
.notes-fab:active { transform: translateY(0) scale(1); }
.notes-fab.hidden { display: none; }

.notes-panel {
    position: fixed; bottom: 90px; right: 24px;
    width: 380px; max-width: calc(100vw - 32px);
    background: var(--bg-1);
    border: 1px solid var(--border-strong);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg);
    z-index: 9001;
    display: flex; flex-direction: column;
    animation: notes-pop 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes notes-pop {
    from { opacity: 0; transform: translateY(10px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.notes-panel.hidden { display: none; }
.notes-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.notes-panel-title { font-weight: 600; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.notes-panel-close {
    background: transparent; border: 0; color: var(--fg-3);
    font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.notes-panel-close:hover { color: var(--fg); background: var(--bg-3); }
.notes-panel-body { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.notes-panel-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.notes-panel select {
    background: var(--bg); color: var(--fg);
    border: 1px solid var(--border-2); border-radius: 6px;
    padding: 6px 10px; font-size: 13px; cursor: pointer; outline: none;
}
.notes-panel select:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
#notes-panel-type-hint { flex: 1; min-width: 0; font-size: 11px; color: var(--fg-3); }
.notes-panel textarea {
    width: 100%; background: var(--bg);
    border: 1px solid var(--border-2); border-radius: 6px;
    padding: 10px 12px; font-family: inherit; font-size: 14px; line-height: 1.5;
    color: var(--fg); resize: vertical; min-height: 110px; outline: none;
}
.notes-panel textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
.notes-panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body:not(.is-admin) [data-admin-only] { display: none; }

/* ─── VM-hjelpa assistant (chat widget, all users) ────────────────────── */
.assistant-fab {
    position: fixed; bottom: 24px; left: 24px;
    width: 54px; height: 54px; border-radius: 50%;
    background: var(--acc-grad); color: #051911;
    border: 0; cursor: pointer; font-size: 24px;
    box-shadow: 0 8px 24px var(--acc-glow);
    z-index: 9000; display: flex; align-items: center; justify-content: center;
    transition: transform 160ms, box-shadow 160ms;
}
.assistant-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 14px 32px var(--acc-glow); }
.assistant-fab:active { transform: translateY(0) scale(1); }
.assistant-fab.hidden { display: none; }

.assistant-panel {
    position: fixed; bottom: 90px; left: 24px;
    width: 380px; max-width: calc(100vw - 32px);
    height: min(560px, calc(100vh - 130px));
    background: var(--bg-1); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    z-index: 9001; display: flex; flex-direction: column; overflow: hidden;
    animation: notes-pop 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.assistant-panel.hidden { display: none; }
.assistant-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; background: var(--bg-2);
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.assistant-title { font-weight: 700; display: flex; align-items: center; gap: 8px; font-size: 15px; }
.assistant-close {
    background: transparent; border: 0; color: var(--fg-3);
    font-size: 22px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px;
}
.assistant-close:hover { color: var(--fg); background: var(--bg-3); }
.assistant-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.assistant-msg {
    max-width: 86%; padding: 9px 12px; border-radius: 14px;
    font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere;
}
.assistant-msg.bot { align-self: flex-start; background: var(--bg-2); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.assistant-msg.me { align-self: flex-end; background: var(--acc-grad); color: #051911; border-bottom-right-radius: 4px; font-weight: 500; }
.assistant-msg.bot a { color: var(--acc); }
.assistant-typing { align-self: flex-start; color: var(--fg-3); font-size: 13px; padding: 2px 6px; font-style: italic; }
.assistant-starters { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.assistant-chip {
    background: var(--bg-2); border: 1px solid var(--border-2); color: var(--fg-2);
    border-radius: 16px; padding: 6px 11px; font-size: 12px; cursor: pointer; font-family: inherit;
    transition: background 120ms, border-color 120ms, color 120ms;
}
.assistant-chip:hover { border-color: var(--acc); color: var(--fg); }
.assistant-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }
.assistant-form input {
    flex: 1; min-width: 0; background: var(--bg); color: var(--fg);
    border: 1px solid var(--border-2); border-radius: 20px; padding: 9px 14px;
    font-size: 13.5px; font-family: inherit; outline: none;
}
.assistant-form input:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
.assistant-send {
    flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; border: 0;
    background: var(--acc-grad); color: #051911; font-size: 15px; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.assistant-send:disabled { opacity: 0.5; cursor: default; }
@media (max-width: 760px) {
    .assistant-fab { bottom: 18px; left: 16px; }
    .assistant-panel { left: 12px; right: 12px; width: auto; bottom: 80px; height: min(72vh, calc(100vh - 110px)); }
}

/* ─── Importer tips fra Excel (modal) ─────────────────────────────────── */
.import-ov {
    position: fixed; inset: 0; z-index: 9500;
    background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; padding: 16px;
}
.import-card {
    width: 540px; max-width: 100%; max-height: 90vh; overflow-y: auto;
    background: var(--bg-1); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
    animation: notes-pop 160ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.import-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px; background: var(--bg-2); border-bottom: 1px solid var(--border);
    border-radius: var(--r-lg) var(--r-lg) 0 0; font-size: 15px;
}
.import-x { background: transparent; border: 0; color: var(--fg-3); font-size: 24px; line-height: 1; cursor: pointer; padding: 0 6px; border-radius: 6px; }
.import-x:hover { color: var(--fg); background: var(--bg-3); }
.import-body { padding: 16px; }
.import-body textarea {
    width: 100%; background: var(--bg); color: var(--fg);
    border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.5;
    resize: vertical; min-height: 130px; outline: none;
}
.import-body textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
.import-sum {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
    padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; font-size: 14px;
}
.warn-box {
    background: rgba(214,69,69,.14); color: #ffb4b4; border-left: 3px solid #d64545;
    padding: 8px 12px; border-radius: 0 8px 8px 0; margin: 10px 0;
}
.link-danger {
    background: none; border: 0; color: var(--fg-3); cursor: pointer;
    font-size: 11px; padding: 4px 2px; margin-top: 4px; width: 100%; text-align: center;
    text-decoration: underline; text-underline-offset: 2px;
}
.link-danger:hover { color: #ff6b6b; }

/* ─── Notes view ──────────────────────────────────────────────────────── */
.notes-list { display: flex; flex-direction: column; gap: 8px; }
.note-item {
    display: grid; grid-template-columns: 30px 1fr auto; gap: 12px;
    padding: 12px 14px; background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r); transition: background 120ms;
}
.note-item:hover { background: var(--bg-2); }
.note-item.note-type-code { border-left: 3px solid var(--purple); }
.note-item.note-type-note { border-left: 3px solid var(--acc); }
.note-icon { font-size: 18px; }
.note-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--fg-3); margin-bottom: 4px; }
.note-body { white-space: pre-wrap; word-break: break-word; font-size: 14px; line-height: 1.5; }
.note-actions { display: flex; flex-direction: column; gap: 4px; }
.note-action-btn {
    background: transparent; border: 1px solid transparent;
    color: var(--fg-3); cursor: pointer; padding: 3px 7px;
    border-radius: 4px; font-size: 13px;
}
.note-action-btn:hover { background: var(--bg-3); color: var(--fg); }
.note-action-btn.danger:hover { color: var(--red); border-color: var(--red); }
.note-edit-textarea {
    width: 100%; background: var(--bg); border: 1px solid var(--acc);
    border-radius: 6px; padding: 8px 10px; color: var(--fg);
    font-family: inherit; font-size: 14px; line-height: 1.5;
    resize: vertical; min-height: 80px; outline: none;
}
.notes-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.notes-filter-chip {
    background: var(--bg-1); border: 1px solid var(--border);
    color: var(--fg-3); padding: 5px 12px; border-radius: 99px;
    font-size: 12px; cursor: pointer;
}
.notes-filter-chip.active { border-color: var(--acc); color: var(--acc); background: var(--acc-faint); }

/* ─── Lock / status icons ─────────────────────────────────────────────── */
.lock-icon { color: var(--orange); font-size: 12px; }

/* ─── Flag images (flagcdn) — Windows-friendly ───────────────────────── */
.flag {
    display: inline-block;
    width: 24px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 3px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 1px 2px rgba(0, 0, 0, 0.4);
    vertical-align: -0.18em;
    margin-right: 6px;
    flex-shrink: 0;
}
.flag.sm { width: 18px; }
.flag.lg { width: 32px; }
.flag-em { display: inline-block; vertical-align: middle; margin-right: 4px; line-height: 1; flex-shrink: 0; }
.match-row .home, .match-row .away { gap: 6px; }
.standings-table .name .flag { margin-right: 8px; }

/* ─── Admin team grid ─────────────────────────────────────────────────── */
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.team-grid-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 14px 16px;
}
.team-grid-card h3 { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.team-edit-row { display: grid; grid-template-columns: 50px 60px 1fr; gap: 6px; align-items: center; margin-bottom: 6px; }
.team-edit-row input {
    background: var(--bg); border: 1px solid var(--border-2);
    color: var(--fg); border-radius: 6px;
    padding: 6px 8px; font-size: 13px;
    transition: border-color 120ms;
}
.team-edit-row input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); }
.team-edit-row .t-flag { text-align: center; font-size: 16px; }
.team-edit-row .t-code { text-transform: uppercase; font-weight: 600; font-size: 12px; text-align: center; }

.bulk-paste-area {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border-2);
    border-radius: var(--r-sm);
    padding: 12px 14px;
    color: var(--fg);
    font-family: 'Menlo', monospace;
    font-size: 12px;
    line-height: 1.55;
    resize: vertical;
    min-height: 200px;
}

/* ─── Search ──────────────────────────────────────────────────────────── */
.search-box { margin-bottom: 12px; }
.search-box input {
    width: 100%; padding: 11px 14px;
    background: var(--bg-1); border: 1px solid var(--border-2);
    border-radius: var(--r); color: var(--fg);
    font-size: 14px;
    transition: border-color 120ms;
}
.search-box input:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-faint); }

/* ─── User detail ─────────────────────────────────────────────────────── */
.user-hero {
    display: flex; align-items: center; gap: 18px;
    padding: 22px;
    background: linear-gradient(135deg, var(--bg-1), var(--bg-2));
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    margin-bottom: 18px;
}
.user-hero .avatar { width: 60px; height: 60px; font-size: 22px; }
.user-hero .info h1 { margin: 0; font-size: 24px; }
.user-hero .info .username { font-size: 13px; color: var(--fg-3); }
.user-hero .stats-inline { display: flex; gap: 20px; margin-top: 8px; }
.user-hero .stat-mini .label { font-size: 11px; color: var(--fg-3); text-transform: uppercase; letter-spacing: 0.5px; }
.user-hero .stat-mini .value { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 22px; color: var(--acc); }

/* ─── Detail breakdown table ──────────────────────────────────────────── */
.detail-card .detail-cat {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 8px; border-radius: 4px;
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px;
    background: var(--bg-3); color: var(--fg-2);
    font-weight: 600; width: max-content;
}
.detail-card .points-cell strong { color: var(--acc); font-family: 'Manrope', sans-serif; font-size: 14px; }

/* ─── Live indicator pulse ────────────────────────────────────────────── */
@keyframes pulse-live {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}
.live-dot {
    display: inline-block; width: 6px; height: 6px;
    background: var(--red); border-radius: 50%;
    animation: pulse-live 1.5s ease-in-out infinite;
    margin-right: 4px;
}

/* ═════════════════════════════════════════════════════════════════════════
   vmkonk2 HUB SHELL — sidebar · content · shoutbox
   ═════════════════════════════════════════════════════════════════════════ */
:root { --sidebar-w: 232px; --rail-w: 304px; }

.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr var(--rail-w); min-height: 100vh; }
.shell.hidden { display: none; }

/* Content column overrides the standalone main#app centering */
.shell main#app { min-width: 0; max-width: none; margin: 0; padding: 26px 30px 90px; }

/* gate: superadmin-only elements */
body:not(.is-superadmin) [data-superadmin-only] { display: none; }

/* ── Sidebar ──────────────────────────────────────────────────────────── */
.sidebar {
    position: sticky; top: 0; align-self: start; height: 100vh;
    display: flex; flex-direction: column; gap: 10px;
    background: linear-gradient(180deg, var(--bg-1), var(--bg));
    border-right: 1px solid var(--border);
    padding: 18px 12px 14px;
}
.sidebar .brand { padding: 0 8px 6px; margin: 0; }
#nav {
    display: flex; flex-direction: column; gap: 1px; flex: 1;
    margin: 4px 0; overflow-y: auto; flex-wrap: nowrap;
}
#nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--r);
    color: var(--fg-3); font-size: 13.5px; font-weight: 500;
    text-decoration: none; opacity: 1; white-space: nowrap; transition: background .12s, color .12s;
}
#nav a .nav-ic { width: 18px; text-align: center; font-size: 14px; flex: none; }
#nav a:hover { background: var(--bg-2); color: var(--fg); }
#nav a.active {
    background: var(--acc-faint); color: var(--acc);
    box-shadow: inset 2px 0 0 var(--acc); font-weight: 600;
}
.nav-sec {
    font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
    color: var(--fg-faint); padding: 12px 12px 4px; font-weight: 700;
}
/* Collapsible sidebar sections */
button.nav-sec {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; background: none; border: none; cursor: pointer;
    font-family: inherit; border-radius: var(--r-sm);
}
button.nav-sec:hover { color: var(--fg-3); background: var(--bg-2); }
.nav-caret { font-size: 9px; opacity: .6; transition: transform .15s ease; }
.nav-group.collapsed .nav-caret { transform: rotate(-90deg); }
.nav-group.collapsed .nav-items { display: none; }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.sidebar-user { display: flex; align-items: center; gap: 8px; padding: 0 8px; font-weight: 600; font-size: 13px; }
.user-badge {
    font-size: 9px; font-weight: 800; letter-spacing: .06em;
    background: var(--acc-grad); color: #07121b; padding: 2px 6px; border-radius: 5px;
}
.sidebar-foot .btn { width: 100%; justify-content: center; }

/* ── Shoutbox (right rail) ────────────────────────────────────────────── */
.shoutbox {
    position: sticky; top: 0; align-self: start; height: 100vh;
    display: flex; flex-direction: column;
    background: var(--bg-1); border-left: 1px solid var(--border);
}
.shout-head {
    display: flex; align-items: center; gap: 8px; justify-content: space-between;
    padding: 14px 14px 10px; border-bottom: 1px solid var(--border);
}
.shout-title { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.shout-filter {
    background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--border);
    border-radius: var(--r-sm); padding: 5px 8px; font-size: 12px; max-width: 150px;
}
.shout-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.shout-empty { color: var(--fg-faint); font-size: 13px; text-align: center; margin: auto 0; padding: 20px; }
.shout {
    background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r);
    padding: 8px 10px; animation: shout-in .18s ease;
}
.shout--mine { background: var(--acc-faint); border-color: var(--acc-glow); }
@keyframes shout-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.shout-meta { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg-3); margin-bottom: 3px; }
.shout-author { font-weight: 700; color: var(--fg-2); }
.shout-tag { background: var(--bg-3); color: var(--fg-3); padding: 1px 6px; border-radius: 5px; font-size: 10px; }
.shout-time { margin-left: auto; color: var(--fg-faint); }
.shout-del {
    background: none; border: none; color: var(--fg-faint); cursor: pointer;
    font-size: 15px; line-height: 1; padding: 0 2px; border-radius: 4px;
}
.shout-del:hover { color: var(--red); background: var(--bg-3); }
.shout-body { font-size: 13px; color: var(--fg); word-break: break-word; white-space: pre-wrap; }
.shout-compose { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--border); }
.shout-compose input {
    flex: 1; min-width: 0; background: var(--bg-2); color: var(--fg);
    border: 1px solid var(--border); border-radius: var(--r); padding: 9px 12px; font-size: 13px;
}
.shout-compose input:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); outline: none; }
.shout-send { padding: 0 14px; font-size: 16px; font-weight: 800; }

/* ── Dashboard ────────────────────────────────────────────────────────── */
.hero--dash { background: var(--hero-grad); }
.dash-next {
    display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px;
    background: rgba(255,255,255,.12); backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,.16); border-radius: 12px; padding: 8px 14px; position: relative; z-index: 1;
}
.dash-next-label { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; opacity: .85; }
.dash-next-teams { font-weight: 700; } .dash-next-teams em { opacity: .7; font-style: normal; margin: 0 2px; }
.dash-next-time { font-size: 12px; opacity: .9; }

.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 16px; margin: 20px 0; }
.tile {
    display: flex; flex-direction: column; gap: 8px;
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: var(--r-lg); padding: 16px 16px 14px; text-decoration: none; color: var(--fg);
    position: relative; overflow: hidden; transition: transform .14s, box-shadow .14s, border-color .14s;
    border-top: 3px solid var(--tile-accent, var(--acc));
}
a.tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--border-2); }
.tile-top { display: flex; align-items: center; justify-content: space-between; }
.tile-icon { font-size: 26px; }
.tile-badge {
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
    color: var(--tile-accent, var(--acc)); background: color-mix(in srgb, var(--tile-accent, var(--acc)) 14%, transparent);
    padding: 3px 8px; border-radius: 6px;
}
.tile h3 { margin: 2px 0 0; font-size: 17px; font-family: 'Manrope', sans-serif; }
.tile-desc { margin: 0; font-size: 12.5px; color: var(--fg-3); line-height: 1.4; flex: 1; }
.tile-stats { display: flex; gap: 14px; margin-top: 4px; }
.tile-stats > div { display: flex; flex-direction: column; }
.ts-num { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 20px; color: var(--tile-accent, var(--acc)); }
.ts-lab { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-faint); }
.tile-toplist { list-style: none; margin: 4px 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.tile-toplist li { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.tile-toplist .rk { width: 18px; height: 18px; display: grid; place-items: center; background: var(--bg-3); border-radius: 5px; font-size: 11px; font-weight: 700; color: var(--fg-3); }
.tile-toplist .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-toplist b { color: var(--acc); font-family: 'Manrope', sans-serif; }
.tile-cta { font-size: 12.5px; font-weight: 700; color: var(--tile-accent, var(--acc)); margin-top: auto; }
.tile-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dash-notecard textarea {
    width: 100%; background: var(--bg-2); color: var(--fg); border: 1px solid var(--border);
    border-radius: var(--r); padding: 10px 12px; font: inherit; font-size: 13px; resize: vertical; margin: 6px 0;
}
.dash-notecard textarea:focus { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc-faint); outline: none; }
.dash-note-actions { display: flex; gap: 8px; align-items: center; }
.dash-note-actions select { background: var(--bg-2); color: var(--fg-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 9px; font-size: 12px; }

/* ── Total leaderboard table + placeholder ────────────────────────────── */
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); }
.lb-table td { padding: 10px; border-bottom: 1px solid var(--border); font-size: 14px; }
.lb-table td.rank, .lb-table td.num, .lb-table th.num { text-align: right; font-family: 'Manrope', sans-serif; }
.lb-table td.rank { text-align: left; color: var(--fg-3); width: 40px; }
.lb-table tr.is-me { background: var(--acc-faint); }
.lb-table tr.is-me td { color: var(--fg); }
.empty-card { text-align: center; padding: 40px 20px; }
.empty-ic { font-size: 44px; margin-bottom: 8px; }

/* ── Mobile drawers ───────────────────────────────────────────────────── */
.shell-mobile-btn {
    display: none; position: fixed; top: 12px; z-index: 60;
    width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--border-2);
    background: var(--bg-2); color: var(--fg); font-size: 18px; cursor: pointer; box-shadow: var(--shadow-sm);
}
.shell-mobile-btn--left { left: 12px; }
.shell-mobile-btn--right { right: 12px; }
.shell-scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 50; }
.shell-scrim.show { display: block; }

@media (max-width: 1140px) {
    .shell { grid-template-columns: var(--sidebar-w) 1fr; }
    .shoutbox {
        position: fixed; right: 0; top: 0; width: min(330px, 86vw); z-index: 55;
        transform: translateX(100%); transition: transform .22s ease; border-left: 1px solid var(--border-2);
    }
    .shoutbox.open { transform: none; box-shadow: var(--shadow-lg); }
    .shell-mobile-btn--right { display: flex; }
    .shell main#app { padding-top: 64px; }
}
@media (max-width: 760px) {
    .shell { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; width: min(264px, 84vw); z-index: 55;
        transform: translateX(-100%); transition: transform .22s ease;
    }
    .sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
    .shell-mobile-btn--left { display: flex; }
    .shell main#app { padding: 64px 16px 90px; }
}

/* ── Phase 2a additions ───────────────────────────────────────────────── */
/* Group 'ferdig' badge — shown when all 6 group matches are tipped (#3) */
.g-done-badge {
    display: none; margin-left: 8px; font-size: 11px; font-weight: 700;
    color: var(--acc); background: var(--acc-faint); padding: 2px 8px;
    border-radius: 6px; vertical-align: middle; white-space: nowrap;
}
.group-combined.is-done .g-done-badge { display: inline-block; }
.group-combined.is-done { border-color: var(--acc-glow); }

/* 'Andre konkurranser' summary tile (#6) */
.tile-others-icons { display: flex; gap: 8px; font-size: 22px; margin-top: 2px; }

/* ── Match meta: stadium · altitude · weather (#1) ─────────────────────── */
.match-row .match-venue {
    grid-column: 1 / -1;
    margin-top: 6px; padding-top: 6px;
    border-top: 1px dashed var(--border);
}
.match-meta-chip { font-size: 11px; color: var(--fg-3); white-space: nowrap; cursor: help; }
.match-meta-chip .moh { color: var(--blue); font-weight: 600; }
.match-meta-chip .wx { color: var(--fg-2); font-weight: 600; }
.match-meta-mini { cursor: help; opacity: .75; }
.match-meta-mini:hover { opacity: 1; }

/* ── Team detail modal (#5) ────────────────────────────────────────────── */
.team-link { cursor: pointer; border-radius: 4px; transition: color .12s; }
.team-link:hover { color: var(--acc); text-decoration: underline; text-underline-offset: 2px; }
.team-modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; }
.team-modal.hidden { display: none; }
.team-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.team-modal-card {
    position: relative; z-index: 1; width: min(680px, 94vw); max-height: 88vh; overflow-y: auto;
    background: var(--bg-1); border: 1px solid var(--border-2); border-radius: var(--r-lg);
    box-shadow: var(--shadow-lg); padding: 22px;
}
.team-modal-close {
    position: absolute; top: 12px; right: 14px; background: none; border: none;
    color: var(--fg-3); font-size: 24px; line-height: 1; cursor: pointer; border-radius: 6px; padding: 2px 6px;
}
.team-modal-close:hover { color: var(--fg); background: var(--bg-3); }
.td-header { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }
.td-flag .flag { width: 44px; height: auto; border-radius: 4px; }
.td-header h2 { margin: 0; font-family: 'Manrope', sans-serif; }
.td-section { margin-top: 18px; }
.td-section > h3 { font-size: 14px; margin: 0 0 8px; color: var(--fg-2); }
.td-matches { display: flex; flex-direction: column; gap: 4px; }
.td-match { display: grid; grid-template-columns: 50px 1fr auto 44px; gap: 10px; align-items: center; font-size: 13px; padding: 6px 8px; background: var(--bg-2); border-radius: 7px; }
.td-stage { font-size: 10px; text-transform: uppercase; color: var(--fg-faint); font-weight: 700; }
.td-opp { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-when { font-size: 11px; color: var(--fg-3); white-space: nowrap; }
.td-res { font-family: 'Manrope', sans-serif; font-weight: 700; text-align: right; }
.td-pos { margin-bottom: 12px; }
.td-pos h4 { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--acc); margin: 0 0 6px; }
.td-players { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.td-players li { display: flex; flex-direction: column; padding: 4px 0; border-bottom: 1px solid var(--border); }
.td-pname { font-weight: 600; font-size: 13px; }
.td-pmeta { font-size: 11px; color: var(--fg-3); }
@media (max-width: 560px) { .td-players { grid-template-columns: 1fr; } .td-match { grid-template-columns: 44px 1fr auto; } .td-when { display: none; } }

/* ── Oddsbot (Monte-Carlo probabilities) ──────────────────────────────── */
.ob-scroll { overflow-x: auto; }
.ob-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.ob-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--fg-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ob-table td { padding: 7px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.ob-table .ob-rank { color: var(--fg-faint); width: 28px; }
.ob-table .ob-rating { font-family: 'Manrope', sans-serif; color: var(--fg-2); }
.ob-bar { position: relative; background: var(--bg-2); border-radius: 5px; height: 18px; min-width: 92px; overflow: hidden; }
.ob-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; opacity: .5; }
.ob-pct { position: relative; z-index: 1; font-size: 11px; font-weight: 600; padding: 0 6px; line-height: 18px; display: block; font-variant-numeric: tabular-nums; }

/* ── Bracket Simulator ────────────────────────────────────────────────── */
.sim-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.sim-champ { font-size: 18px; background: var(--hero-grad); border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 16px; font-family: 'Manrope', sans-serif; }
.sim-h { font-size: 14px; color: var(--fg-2); margin: 20px 0 8px; }
.sim-bracket { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 12px; overflow-x: auto; }
.sim-round h4 { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--acc); margin: 0 0 8px; }
.sim-match { background: var(--bg-1); border: 1px solid var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; }
.sm-t { color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-t.w { color: var(--fg); font-weight: 600; }
.sm-score { font-family: 'Manrope', sans-serif; font-size: 11px; color: var(--fg-faint); align-self: center; }
.sm-score sup { color: var(--gold); font-size: 8px; }
.sim-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sim-group { background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.sim-group h4 { margin: 0 0 6px; font-size: 13px; font-family: 'Manrope', sans-serif; }
.sim-grow { display: grid; grid-template-columns: 18px 1fr auto auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 3px 0; }
.sim-grow.adv .sg-pos { color: var(--acc); font-weight: 700; }
.sim-grow.third .sg-pos { color: var(--gold); font-weight: 700; }
.sim-grow:not(.adv):not(.third) { color: var(--fg-faint); }
.sg-team { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 760px) { .sim-bracket { grid-template-columns: 1fr; } }

/* ── External result reporting + total breakdown ──────────────────────── */
.ext-result { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ext-result-head { font-size: 12px; color: var(--fg-3); margin-bottom: 6px; }
.hub-pts { color: var(--acc); font-weight: 700; }
.ext-result-form { display: flex; align-items: center; gap: 6px; }
.ext-result-form input { width: 64px; background: var(--bg-2); color: var(--fg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 8px; font-size: 13px; }
.ext-result-form input:focus { border-color: var(--acc); outline: none; }
.tlb-name { font-weight: 500; }
.tlb-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.tlb-chip { font-size: 10px; background: var(--bg-2); color: var(--fg-3); padding: 1px 6px; border-radius: 5px; }
.tlb-chip b { color: var(--fg-2); }

/* ── Info page + provisional-squad badge ──────────────────────────────── */
.info-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.info-card h3 { margin: 0 0 8px; font-size: 15px; }
.info-card p { color: var(--fg-2); font-size: 13.5px; line-height: 1.55; margin: 0 0 8px; }
.info-card ul { margin: 0; padding-left: 18px; color: var(--fg-2); font-size: 13.5px; line-height: 1.6; }
.info-card li { margin-bottom: 5px; }
.prov-badge { background: var(--gold); color: #1a1300; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 5px; white-space: nowrap; }

/* Admin nav group — hidden for non-admins */
body:not(.is-admin) .nav-group.nav-admin { display: none; }

/* Andre konkurranser overview (#other) */
.comp-h { font-size: 14px; color: var(--fg-2); margin: 20px 0 10px; }
.comp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.comp-card { display: flex; flex-direction: column; gap: 5px; background: var(--bg-1); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px; text-decoration: none; color: var(--fg); transition: transform .14s, border-color .14s, box-shadow .14s; }
.comp-card:hover { transform: translateY(-3px); border-color: var(--border-2); box-shadow: var(--shadow); }
.comp-top { display: flex; align-items: center; justify-content: space-between; }
.comp-type { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--acc); }
.comp-card h3 { margin: 2px 0 0; font-size: 16px; font-family: 'Manrope', sans-serif; }
.comp-org { font-size: 12px; color: var(--fg-3); }
.comp-desc { font-size: 12.5px; color: var(--fg-3); line-height: 1.45; margin: 4px 0 0; flex: 1; }
.comp-cta { font-size: 12.5px; font-weight: 700; color: var(--blue); margin-top: 4px; }
.comp-prize { font-size: 11.5px; color: var(--gold); margin-top: 4px; }
.comp-note { font-size: 11px; color: var(--fg-3); margin-top: 4px; line-height: 1.4; }
.comp-trust { font-size: 9px; font-weight: 700; padding: 1px 5px; border-radius: 4px; text-transform: uppercase; }
.comp-trust.ukjent { background: var(--bg-3); color: var(--fg-3); }
.comp-trust.skeptisk { background: rgba(255,85,102,.18); color: var(--red); }

/* #other: fliser/liste-kontroller + liste (#25) */
.comp-controls { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.seg button { background: none; border: none; color: var(--fg-3); padding: 7px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button.on { background: var(--acc-faint); color: var(--acc); font-weight: 600; }
.comp-controls select { background: var(--bg-2); color: var(--fg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 5px 8px; font-size: 13px; }
.comp-table { width: 100%; border-collapse: collapse; min-width: 640px; }
.comp-table th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--fg-faint); padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.comp-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: top; }

/* Hall of Fame per league (#21) */
.hof-form { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.hof-form input { background: var(--bg-2); color: var(--fg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 7px 9px; font-size: 13px; flex: 1; min-width: 110px; }
.hof-list { display: flex; flex-direction: column; gap: 4px; }
.hof-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.hof-year { font-family: 'Manrope', sans-serif; font-weight: 800; color: var(--gold); width: 44px; }
.hof-win { font-weight: 600; }

/* Minimize toggles — shoutbox (#7) + Skrik til oss (#19) */
.shout-min, .notecard-min { background: none; border: none; color: var(--fg-3); cursor: pointer; font-size: 18px; line-height: 1; padding: 0 6px; border-radius: 5px; }
.shout-min:hover, .notecard-min:hover { color: var(--fg); background: var(--bg-3); }
.shoutbox.minimized .shout-list, .shoutbox.minimized .shout-compose, .shoutbox.minimized .shout-filter { display: none; }
.notecard-head { display: flex; align-items: center; justify-content: space-between; }
.notecard-head h2 { margin: 0; }
.dash-notecard.minimized .notecard-body { display: none; }

/* ===== League stats page (#stats) + chart helpers ===== */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; align-items: start; }
.stats-card { padding: 18px 20px; }
.stats-card.span2 { grid-column: 1 / -1; }
.stats-card h3 { margin: 0 0 2px; font-size: 16px; }
.stats-card > .muted.small { margin: 0 0 12px; display: block; }
.stats-card, .ch-hbar-val, .ch-leg-val, .gw-pct, .ch-donut-top { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .stats-grid { grid-template-columns: 1fr; } }

/* Donut */
.ch-donut-wrap { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.ch-donut { flex: 0 0 auto; }
.ch-donut-top { fill: var(--fg); font-size: 22px; font-weight: 800; }
.ch-donut-bot { fill: var(--fg-3); font-size: 10px; text-transform: uppercase; letter-spacing: .06em; }
.ch-legend { flex: 1 1 180px; display: flex; flex-direction: column; gap: 5px; min-width: 160px; }
.ch-leg-row { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ch-dot { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 auto; }
.ch-leg-lab { flex: 1 1 auto; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-leg-val { color: var(--fg-3); font-size: 12px; }

/* Horizontal bars */
.ch-hbars { display: flex; flex-direction: column; gap: 7px; }
.ch-hbar { display: grid; grid-template-columns: 116px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.ch-hbar-lab { color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-hbar-track { background: var(--bg-3); border-radius: 6px; height: 16px; overflow: hidden; }
.ch-hbar-fill { height: 100%; border-radius: 6px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.ch-hbar-val { color: var(--fg); font-weight: 600; white-space: nowrap; }
.ch-hbar.is-me .ch-hbar-lab { color: var(--acc); font-weight: 700; }
.ch-hbar.is-me .ch-hbar-track { box-shadow: 0 0 0 1px var(--acc-faint); }

/* Scatter */
.ch-scatter { max-width: 380px; display: block; margin: 0 auto; }
.ch-grid { stroke: var(--border); stroke-width: 1; }
.ch-diag { stroke: var(--fg-faint); stroke-width: 1; stroke-dasharray: 4 4; }
.ch-axn { fill: var(--fg-faint); font-size: 9px; }
.ch-axlab { fill: var(--fg-3); font-size: 11px; }

/* Split bar */
.ch-split { display: flex; height: 22px; border-radius: 6px; overflow: hidden; background: var(--bg-3); }
.ch-split-seg { display: flex; align-items: center; justify-content: center; color: #06121f; font-size: 11px; font-weight: 700; min-width: 0; }

/* Group winners grid */
.gw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 8px; }
.gw-cell { background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; text-align: center; }
.gw-grp { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); }
.gw-top { font-size: 13px; font-weight: 600; margin: 2px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gw-pct { color: var(--acc); font-weight: 800; font-size: 15px; }

/* Divisive + fun */
.div-row { margin-bottom: 10px; }
.div-lab { font-size: 13px; margin-bottom: 4px; }
.fun-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.fun-chip { background: var(--bg-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px 10px; font-size: 12.5px; }
.stats-list { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.stats-list li { font-size: 13px; color: var(--fg-2); }
.stats-note { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); font-size: 13px; }
.stats-note .pos { color: var(--acc); font-weight: 600; }
.stats-note .neg { color: #5e9eff; font-weight: 600; }

/* ===== Tippebrettet (match board on stats page) ===== */
.mb-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 8px; }
.mb-nav b { font-size: 14px; color: var(--fg); }
.mb-card { padding: 0; overflow: hidden; margin-bottom: 8px; border-left: 4px solid var(--border-2); }
.mb-card:last-child { margin-bottom: 0; }
.mb-card.mb-upcoming { border-left-color: var(--blue); }
.mb-card.mb-live { border-left-color: var(--acc); box-shadow: 0 0 0 1px var(--acc-faint), var(--shadow-sm); }
.mb-card.mb-done { border-left-color: var(--gold); }

/* Compact summary (the always-visible row; click to expand) */
.mb-sum { list-style: none; cursor: pointer; padding: 9px 13px; display: flex; flex-direction: column; gap: 5px; outline: none; }
.mb-sum::-webkit-details-marker { display: none; }
.mb-sum:hover { background: rgba(255,255,255,.025); }
.mb-card[open] .mb-sum { border-bottom: 1px solid var(--border); }
.mb-line1 { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mb-line2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 12.5px; }
.mb-mine, .mb-most, .mb-tipcount { display: inline-flex; align-items: center; gap: 5px; color: var(--fg-3); }
.mb-mine { color: var(--fg-2); }
.mb-most-meta { color: var(--fg-3); font-style: normal; font-size: 11.5px; }
.mb-tipcount { color: var(--fg-3); }
.mb-chev { margin-left: auto; color: var(--fg-faint); font-size: 12px; transition: transform .18s ease; }
.mb-card[open] .mb-chev { transform: rotate(180deg); }
.mb-teams { font-weight: 700; font-size: 14px; color: var(--fg); }
.mb-vs { color: var(--fg-3); font-weight: 400; font-size: 12px; }
.mb-meta { font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.mb-result { font-weight: 800; color: var(--gold); font-size: 14px; }
.mb-livetag { font-weight: 800; color: var(--acc); }
.mb-livetag::before { content: '● '; animation: mbpulse 1.4s ease-in-out infinite; }
@keyframes mbpulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.mb-time { color: var(--blue); font-weight: 700; }
.mb-detail { animation: mbfade .2s ease; }
@keyframes mbfade { from { opacity: 0; } to { opacity: 1; } }
.pick-table { width: 100%; border-collapse: collapse; }
.pick-table tr { border-bottom: 1px solid var(--border); }
.pick-table tr:last-child { border-bottom: none; }
.pick-table tr.pick-me { background: var(--acc-faint); box-shadow: inset 3px 0 0 var(--acc); }
.pick-name { padding: 8px 14px; font-size: 13px; color: var(--fg-2); width: 52%; }
.pick-table tr.pick-me .pick-name { color: var(--fg); font-weight: 700; }
.pick-chip-cell { padding: 7px 14px 7px 4px; text-align: right; }
.pick-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 11px; border-radius: 20px; font-size: 12.5px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.chip-exact { background: rgba(34,210,122,.26); color: #4fe89a; border: 1px solid rgba(34,210,122,.55); box-shadow: 0 0 10px rgba(34,210,122,.25); }
.chip-sign  { background: rgba(249,200,66,.22); color: #ffd970; border: 1px solid rgba(249,200,66,.5); }
.chip-wrong { background: rgba(255,85,102,.2); color: #ff8d9b; border: 1px solid rgba(255,85,102,.45); }
.chip-home  { background: rgba(94,158,255,.22); color: #8fc0ff; border: 1px solid rgba(94,158,255,.5); }
.chip-draw  { background: rgba(168,176,196,.2); color: #c2cadb; border: 1px solid rgba(168,176,196,.42); }
.chip-away  { background: rgba(255,140,66,.22); color: #ffb37d; border: 1px solid rgba(255,140,66,.5); }
.chip-ready { background: rgba(34,210,122,.2); color: #4fe89a; border: 1px solid rgba(34,210,122,.45); }
.chip-missing { background: rgba(255,85,102,.14); color: #ff8d9b; border: 1px solid rgba(255,85,102,.3); font-weight: 700; }
.you-dot { color: var(--acc); font-size: 9px; vertical-align: middle; }
.pick-summary-bar { display: flex; height: 26px; overflow: hidden; border-top: 1px solid var(--border); font-size: 11px; font-weight: 800; color: rgba(6,18,31,.82); }
.psb-h { background: linear-gradient(180deg,#7db0ff,#5e9eff); display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.psb-x { background: linear-gradient(180deg,#aab2c4,#8b95a8); display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.psb-a { background: linear-gradient(180deg,#ffa765,#ff8c42); display: flex; align-items: center; justify-content: center; min-width: 0; overflow: hidden; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.psb-h span, .psb-x span, .psb-a span { white-space: nowrap; overflow: hidden; text-shadow: 0 1px 1px rgba(255,255,255,.25); }

/* ===== Polish pass — premium touches (tabular numbers, highlight-your-row) ===== */
.lb-pts, .lb-cell, .hero-stat .value, .num, td.num, .gw-pct { font-variant-numeric: tabular-nums; }
.lb-row.is-me { background: var(--acc-faint); box-shadow: inset 3px 0 0 var(--acc); }
.lb-row.is-model { background: rgba(94,158,255,.08); box-shadow: inset 3px 0 0 #5e9eff; }
.lb-row.is-model .lb-name span { color: #9cc0ff; }
.lb-row.is-me .lb-name a { color: var(--fg); font-weight: 700; }
.lb-badges { font-size: 12px; letter-spacing: 1px; vertical-align: middle; }
.stats-card { transition: border-color 140ms ease; }
.stats-card:hover { border-color: var(--border-2); }
.btn-primary:active { transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ===== Tips lock (global lock at first kickoff) ===== */
.banner-lock { background: linear-gradient(135deg, rgba(249,200,66,.16), rgba(249,200,66,.04)); border: 1px solid rgba(249,200,66,.38); color: var(--fg); border-radius: 12px; padding: 12px 16px; margin: 0 0 14px; font-size: 14px; line-height: 1.5; }
.tips-locked input, .tips-locked select, .tips-locked textarea { pointer-events: none; opacity: .55; filter: grayscale(.35); }
.tips-locked button:not(.subnav button) { pointer-events: none; opacity: .6; }

/* ===== News archive + lest/ulest (#C) ===== */
.nav-unread { background: var(--acc); color: #06121f; font-size: 10px; font-weight: 800; border-radius: 10px; padding: 0 6px; margin-left: 4px; line-height: 16px; }
.news-archive-link { display: block; padding: 10px 14px; font-size: 12px; color: var(--fg-3); border-top: 1px solid var(--border); text-align: center; }
.news-archive-link:hover { background: var(--bg-2); color: var(--fg-2); }
.news-paper-link { display: block; padding: 11px 14px; font-size: 13px; font-weight: 700; color: #06121f; background: var(--acc-grad); text-align: center; border-bottom: 1px solid var(--border); }
.news-paper-link:hover { opacity: .92; }
/* Pinned «Les dagens avis» banner — stays at the top while the feed scrolls (#52). */
.news-pinned { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 6px;
  padding: 11px 14px; font-size: 13.5px; color: #06121f; background: var(--acc-grad);
  text-decoration: none; border-bottom: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.news-pinned b { font-weight: 800; }
.news-pinned .np-arrow { margin-left: auto; font-weight: 800; }
.news-pinned:hover { filter: brightness(1.04); }
.news-pinned-wrap { position: sticky; top: 0; z-index: 3; }
button.news-pinned { width: 100%; border: 0; cursor: pointer; font-family: inherit; text-align: left; }
.np-choices { display: flex; flex-direction: column; background: var(--bg-2); border-bottom: 1px solid var(--border); }
.np-choice { display: flex; align-items: center; gap: 6px; padding: 9px 16px 9px 24px; font-size: 13px;
  color: var(--fg); text-decoration: none; border-bottom: 1px solid var(--border); }
.np-choice:last-child { border-bottom: 0; }
.np-choice:hover { background: var(--bg-3); }
.np-choice .np-arrow { margin-left: auto; font-weight: 800; }
.news-item.news-new { box-shadow: inset 3px 0 0 var(--acc); }
.news-day { margin-bottom: 22px; }
.news-day-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--fg-3); margin: 0 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
.news-arch { padding: 14px 16px; margin-bottom: 10px; }
.news-arch.news-new { box-shadow: inset 3px 0 0 var(--acc); border-color: var(--acc-faint); }
.na-line { font-size: 13px; line-height: 1.5; color: var(--fg-2); margin-top: 4px; }

/* Public scorer/card line under played matches (#A) */
.match-scorers { grid-column: 1 / -1; flex-basis: 100%; width: 100%; display: flex; justify-content: space-between; gap: 12px; font-size: 11.5px; color: var(--fg-3); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.match-scorers .r { text-align: right; }

/* ===== Dashboard header next-match boxes (#35) ===== */
.dnx { max-width: 660px; margin: 14px 0 0; }
.dnx-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: stretch; justify-content: flex-start; }
.dnx-row + .dnx-row { margin-top: 10px; }
.dnx-box { background: rgba(8,13,24,.62); border: 1px solid rgba(255,255,255,.14); border-radius: 12px; padding: 9px 16px; display: flex; flex-direction: column; justify-content: center; font-size: 13px; color: #fff; font-variant-numeric: tabular-nums; }
.dnx-match { gap: 1px; }
.dnx-lab { font-size: 10.5px; opacity: .82; text-transform: uppercase; letter-spacing: .04em; }
.dnx-teams { font-weight: 800; font-size: 15px; }
.dnx-time { font-size: 11.5px; opacity: .85; }
.dnx-count { min-width: 132px; align-items: center; font-weight: 700; }
.dnx-tips { margin-left: auto; align-items: center; text-align: center; font-weight: 700; }
.dnx-tips .dnx-sub { font-size: 10px; opacity: .8; font-weight: 400; }
.dnx-odds { align-self: flex-start; }
@media (max-width: 560px) { .dnx-tips { margin-left: 0; } .dnx-box { flex: 1 1 auto; } }

/* ===== Welcome card (dismissible) + 3-tile row (#36/#37) ===== */
.welcome-card { position: relative; padding: 14px 40px 14px 16px; margin-bottom: 16px; border-left: 3px solid var(--gold); }
.welcome-x { position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--fg-3); font-size: 20px; line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.welcome-x:hover { color: var(--fg); background: var(--bg-3); }
.dash-grid--row { grid-template-columns: repeat(3, 1fr); align-items: start; }
@media (max-width: 860px) { .dash-grid--row { grid-template-columns: 1fr; } }

/* ===== Login/registrering bakgrunn (#33) — CSS-only fotball-mesh ===== */
.auth-shell {
    min-height: 100vh;
    background:
        radial-gradient(1100px 560px at 12% -8%, rgba(34,210,122,.20), transparent 60%),
        radial-gradient(820px 460px at 112% 8%, rgba(94,158,255,.14), transparent 55%),
        radial-gradient(680px 680px at 50% 118%, rgba(249,200,66,.10), transparent 60%),
        linear-gradient(160deg, #0a0e1a 0%, #0e1726 58%, #0a0e1a 100%);
}

/* ===== Pick% — crowd tip split on locked matches (#B) ===== */
.pick-split { grid-column: 1 / -1; margin-top: 6px; }
.ps-bar { display: flex; height: 16px; border-radius: 5px; overflow: hidden; background: var(--bg-2, #0e1726); }
.ps-seg { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; color: #06210f; min-width: 0; transition: width .4s ease; }
.ps-1 { background: #22d27a; } .ps-x { background: #f9c842; } .ps-2 { background: #5e9eff; }
.ps-leg { margin-top: 4px; }
.ps-leg .c1 { color: #22d27a; } .ps-leg .cx { color: #f9c842; } .ps-leg .c2 { color: #5e9eff; }

/* ===== Bracket fasit-maling — paint KO tip cards by result (#B) ===== */
.bracket-match.bm-hit { border-color: rgba(34,210,122,.55); box-shadow: inset 3px 0 0 #22d27a; }
.bracket-match.bm-partial { border-color: rgba(249,200,66,.5); box-shadow: inset 3px 0 0 #f9c842; }
.bracket-match.bm-miss { border-color: rgba(255,107,107,.45); box-shadow: inset 3px 0 0 #ff6b6b; }
.bm-verdict { margin-top: 6px; font-size: 12.5px; font-weight: 700; }
.bm-hit .bm-verdict { color: #22d27a; } .bm-partial .bm-verdict { color: #f9c842; } .bm-miss .bm-verdict { color: #ff6b6b; }

/* ===== Micro-animation: count-up + subtle tile lift (#B) ===== */
.lb-pts[data-count] { font-variant-numeric: tabular-nums; }
.tile, .stats-card { transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease; }
.tile:hover { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) { .tile, .stats-card, .ps-seg { transition: none; } .tile:hover { transform: none; } }

/* ===== Bird's-eye knockout bracket (#B fugleperspektiv) ===== */
.bo-scroll { overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.bo-grid { display: flex; gap: 14px; min-width: max-content; align-items: stretch; }
.bo-col { flex: 0 0 196px; display: flex; flex-direction: column; justify-content: space-around; gap: 8px; scroll-snap-align: start; }
.bo-colhead { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 13px; color: var(--fg-2); text-align: center; padding: 4px 0; border-bottom: 1px solid var(--border-2); position: sticky; top: 0; }
.bo-match { background: var(--bg-2, #0e1726); border: 1px solid var(--border-2); border-radius: 8px; padding: 6px 8px; }
.bo-match.played { border-color: rgba(34,210,122,.35); }
.bo-no { font-size: 10px; color: var(--fg-3); margin-bottom: 3px; }
.bo-team { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 13px; padding: 2px 0; }
.bo-team .bo-name { display: flex; align-items: center; gap: 5px; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bo-team.bo-win { font-weight: 800; color: var(--acc); }
.bo-sc { font-variant-numeric: tabular-nums; color: var(--fg-2); }
.bo-bronze { margin-top: 18px; max-width: 260px; }
.bo-bronze h3 { margin: 0 0 8px; }

/* ===== Tips-stage completion badges on tabs (#53/#54) ===== */
.subnav .tab-done { color: #22d27a; font-weight: 800; }
.subnav .tab-undone { color: #ff6b6b; font-weight: 800; }

/* ===== KO team group-origin label (#55) ===== */
.ko-origin { font-size: 10px; font-weight: 700; color: var(--fg-3); background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 5px; padding: 1px 5px; white-space: nowrap; }

/* ===== Compact group tips: matches + table side-by-side (#49) ===== */
.groups-stack { display: flex; flex-direction: column; gap: 16px; }
.group-combined-body { display: flex; gap: 14px; align-items: flex-start; }
.group-combined-body .match-list-mini { flex: 1 1 56%; min-width: 0; }
.group-combined-body .auto-standings { flex: 1 1 40%; min-width: 210px; }
@media (max-width: 700px) {
    .group-combined-body { flex-direction: column; }
    .group-combined-body .match-list-mini, .group-combined-body .auto-standings { width: 100%; flex: 1 1 auto; }
}

/* ===== Configurable scoring profile editor (#75) ===== */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.sc-field { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--fg-2); }
.sc-field input { padding: 8px 10px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 6px; color: var(--fg); width: 100%; }
.sc-ko-head, .sc-ko-row { display: grid; grid-template-columns: 110px repeat(4, 1fr); gap: 8px; align-items: center; }
.sc-ko-head { font-size: 12px; color: var(--fg-3); margin-bottom: 6px; }
.sc-ko-name { font-weight: 600; font-size: 13px; }
.sc-ko-row { margin-bottom: 6px; }
.sc-ko-row .sc-field span { display: none; }
.sc-empty { visibility: hidden; }
