:root {
    --brown-950: #2b1a11;
    --brown-900: #3b2518;
    --brown-800: #523620;
    --brown-700: #6f482c;
    --brown-600: #8a5e3b;
    --brown-400: #c8a98a;
    --brown-200: #eaded2;
    --paper: #fffdf9;
    --paper-soft: #f7f3ed;
    --paper-warm: #f3ebe1;
    --line: rgba(82, 54, 32, 0.16);
    --shadow: 0 20px 60px rgba(43, 26, 17, 0.10);
    --shadow-soft: 0 10px 25px rgba(43, 26, 17, 0.08);
    --radius-xl: 28px;
    --radius-lg: 20px;
    --radius-md: 14px;
    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    font-size: 16px;
}

body {
    min-height: 100%;
    margin: 0;
    color: var(--brown-950);
    background:
        radial-gradient(circle at 12% 8%, rgba(200, 169, 138, 0.18), transparent 26rem),
        radial-gradient(circle at 84% 24%, rgba(111, 72, 44, 0.08), transparent 28rem),
        var(--paper);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--brown-700);
}

.contour-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image: url("/img/contours_real.png");
    background-size: 980px auto;
    background-position: top right;
    background-repeat: repeat;
    opacity: 0.20;
    mask-image: linear-gradient(to bottom, black, rgba(0,0,0,0.75), transparent 92%);
}

/* Header */

.site-header {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 22px auto 0;
    padding: 14px 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 14px;
    z-index: 10;
    border: 1px solid rgba(82, 54, 32, 0.12);
    border-radius: 999px;
    background: rgba(255, 253, 249, 0.86);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-soft);
}
.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--brown-900);
}

.brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    color: var(--brown-900);
}

    .brand:hover {
        color: var(--brown-700);
    }

.brand-wordmark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    line-height: 1;
}

.brand-o {
    width: clamp(46px, 4vw, 58px);
    height: clamp(46px, 4vw, 58px);
    flex: 0 0 auto;
    display: block;
    transform: translateY(1px);
}

.brand-word {
    font-size: clamp(1.9rem, 3vw, 2.45rem);
    letter-spacing: -0.075em;
    font-weight: 650;
    line-height: 1;
    color: inherit;
}
.main-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(14px, 4vw, 36px);
    font-size: 0.98rem;
    font-weight: 700;
}

.main-nav a {
    position: relative;
    padding: 9px 0;
    color: var(--brown-900);
}

.main-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: 2px;
    height: 2px;
    border-radius: 4px;
    background: var(--brown-700);
    transition: right 160ms ease;
}

.main-nav a:hover::after {
    right: 0;
}

.header-actions {
    display: flex;
    justify-content: flex-end;
}

.focus-pill {
    border: 1px solid rgba(82, 54, 32, 0.18);
    background: var(--paper-soft);
    color: var(--brown-800);
    border-radius: 999px;
    padding: 9px 14px;
    font-weight: 700;
    cursor: pointer;
    list-style: none;
    user-select: none;
    white-space: nowrap;
}

.focus-pill::-webkit-details-marker {
    display: none;
}

.focus-menu {
    position: relative;
}

.focus-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    z-index: 20;
    width: 260px;
    padding: 18px;
    border: 1px solid rgba(82, 54, 32, 0.16);
    border-radius: var(--radius-md);
    background: var(--paper);
    box-shadow: var(--shadow);
}

.focus-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.focus-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.focus-actions .button {
    padding: 9px 14px;
    flex: 1;
    justify-content: center;
}

.news-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.news-focus-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--brown-900);
    color: var(--paper);
    border-radius: 999px;
    padding: 6px 8px 6px 14px;
    font-size: 0.82rem;
    font-weight: 800;
}

.news-focus-tag a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: rgba(255, 253, 249, 0.18);
    color: var(--paper);
    font-size: 0.78rem;
}

.news-focus-tag a:hover {
    background: rgba(255, 253, 249, 0.32);
    color: var(--paper);
}

/* Layout */

.page-shell {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 42px auto 70px;
}

.page-kicker {
    color: var(--brown-600);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 800;
    font-size: 0.73rem;
    margin: 0 0 10px;
}

.page-title {
    margin: 0;
    font-size: clamp(2.3rem, 7vw, 5.8rem);
    letter-spacing: -0.075em;
    line-height: 0.93;
    color: var(--brown-950);
}

.page-lead {
    max-width: 720px;
    margin: 18px 0 0;
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    color: rgba(43, 26, 17, 0.78);
}

.hero {
    display: block;
}

.hero-panel {
    border: 1px solid rgba(82, 54, 32, 0.12);
    border-radius: var(--radius-xl);
    padding: clamp(28px, 5vw, 56px);
    background:
        linear-gradient(135deg, rgba(255,253,249,0.95), rgba(247,243,237,0.72)),
        url("/img/contours.svg");
    background-size: 900px auto;
    background-position: right top;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card {
    border: 1px solid rgba(82, 54, 32, 0.12);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 249, 0.90);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.card.pad {
    padding: 24px;
}

.card-header {
    padding: 22px 24px 16px;
    border-bottom: 1px solid rgba(82, 54, 32, 0.10);
}

.card-title {
    margin: 0;
    font-size: 1.28rem;
    letter-spacing: -0.025em;
}

.card-subtitle {
    margin: 6px 0 0;
    color: rgba(43, 26, 17, 0.64);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border-radius: 999px;
    padding: 12px 18px;
    border: 1px solid rgba(82, 54, 32, 0.18);
    font-weight: 800;
    background: var(--brown-900);
    color: white;
    box-shadow: 0 14px 24px rgba(59, 37, 24, 0.16);
}

.button:hover {
    color: white;
    background: var(--brown-800);
}

.button.secondary {
    color: var(--brown-900);
    background: rgba(255, 253, 249, 0.82);
    box-shadow: none;
}

.button.secondary:hover {
    color: var(--brown-700);
}

/* Tables */

.table-card {
    border: 1px solid rgba(82, 54, 32, 0.12);
    border-radius: var(--radius-lg);
    background: rgba(255, 253, 249, 0.92);
    box-shadow: var(--shadow-soft);
    overflow: hidden;
}

.table-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    border-bottom: 1px solid rgba(82, 54, 32, 0.10);
}

.table-title {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    letter-spacing: -0.045em;
}

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

.orank-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    min-width: 760px;
}

.orank-table th,
.orank-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(82, 54, 32, 0.09);
    text-align: left;
    vertical-align: middle;
}

.orank-table th {
    color: var(--brown-600);
    font-size: 0.72rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-weight: 850;
    background: rgba(247, 243, 237, 0.68);
    position: sticky;
    top: 0;
}

.orank-table tbody tr {
    transition: background 130ms ease;
}

.orank-table tbody tr:hover {
    background: rgba(234, 222, 210, 0.32);
}

.num {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

.muted {
    color: rgba(43, 26, 17, 0.58);
}

.strong-link {
    font-weight: 800;
    color: var(--brown-900);
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.02em;
    border: 1px solid rgba(82, 54, 32, 0.12);
    background: var(--paper-soft);
    color: var(--brown-800);
}

.badge.ok {
    background: rgba(247, 243, 237, 0.9);
    color: var(--brown-900);
}

.badge.dnf,
.badge.dsq {
    background: rgba(200, 169, 138, 0.18);
    color: var(--brown-700);
}

.search-form {
    display: flex;
    gap: 10px;
    margin: 24px 0;
    max-width: 720px;
}

.search-input {
    flex: 1;
    min-width: 180px;
    border: 1px solid rgba(82, 54, 32, 0.18);
    border-radius: 999px;
    background: rgba(255, 253, 249, 0.92);
    padding: 13px 17px;
    color: var(--brown-950);
    font: inherit;
    outline: none;
}

.search-input:focus {
    border-color: rgba(82, 54, 32, 0.42);
    box-shadow: 0 0 0 4px rgba(200, 169, 138, 0.20);
}

.site-footer {
    width: min(calc(100% - 32px), var(--max-width));
    margin: 0 auto 32px;
    padding: 26px 4px;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    color: rgba(43, 26, 17, 0.62);
    border-top: 1px solid rgba(82, 54, 32, 0.12);
}

.site-footer strong {
    color: var(--brown-900);
    margin-right: 8px;
}

.footer-links {
    display: flex;
    gap: 18px;
    font-weight: 750;
}

@media (max-width: 860px) {
    .site-header {
        grid-template-columns: 1fr;
        border-radius: 28px;
        align-items: start;
    }

    .main-nav {
        justify-content: start;
    }

    .header-actions {
        justify-content: start;
    }

    .table-toolbar {
        align-items: start;
        flex-direction: column;
    }

    .search-form {
        flex-direction: column;
    }

    .site-footer {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .page-shell {
        width: min(calc(100% - 20px), var(--max-width));
    }

    .site-header {
        width: min(calc(100% - 20px), var(--max-width));
        top: 10px;
    }

    .hero-panel {
        padding: 28px 22px;
    }

    .orank-table th,
    .orank-table td {
        padding: 12px 14px;
    }
}
.class-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.class-separator td {
    padding-top: 24px;
    background: transparent;
    border-top: 2px solid rgba(82, 54, 32, 0.18);
    font-size: 1.05rem;
}
.split-card {
    margin-top: 32px;
    width: calc(100vw - 32px);
    margin-left: calc(50% - 50vw + 16px);
    margin-right: calc(50% - 50vw + 16px);
    border-radius: 14px;
}

    .split-card .table-toolbar {
        padding-left: 18px;
        padding-right: 18px;
    }

.split-table-wrap {
    overflow-x: auto;
    padding-left: 0;
    padding-right: 0;
}

.split-table {
    min-width: 1000px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.86rem;
}

    .split-table th,
    .split-table td {
        white-space: nowrap;
        padding-left: 5px;
        padding-right: 5px;
    }

.split-control {
    min-width: 58px;
    text-align: right;
}

.split-runner-col {
    position: sticky;
    left: 0;
    z-index: 2;
    min-width: 210px;
    max-width: 230px;
    background: var(--orank-surface, #fffdf9);
}

.split-row td {
    font-size: 0.80rem;
    padding-top: 3px;
    padding-bottom: 3px;
}

.split-place {
    margin-left: 2px;
    font-size: 0.72em;
    opacity: 0.72;
}

.split-table thead .split-runner-col {
    z-index: 3;
}

.split-control {
    min-width: 72px;
    text-align: right;
}

.split-runner-main td {
    padding-top: 14px;
    padding-bottom: 7px;
    border-top: 2px solid rgba(82, 54, 32, 0.18);
    background: rgba(255, 253, 249, 0.96);
}

.split-row td {
    font-size: 0.88rem;
    padding-top: 4px;
    padding-bottom: 4px;
}

.split-label-col {
    width: 58px;
    min-width: 58px;
}

.split-row-label {
    width: 58px;
    min-width: 58px;
    color: rgba(82, 54, 32, 0.68);
    font-weight: 700;
    text-align: right;
    padding-right: 8px;
}

.split-cell {
    border-radius: 7px;
}

.split-place {
    margin-left: 3px;
    font-size: 0.78em;
    opacity: 0.72;
}

/* Akkumulert: leder og topp 10 */
.split-acc-1 {
    background: #f1cf73;
    color: #352313;
    font-weight: 800;
}

.split-acc-2-3 {
    background: #f6df9e;
    color: #422b18;
    font-weight: 750;
}

.split-acc-4-6 {
    background: #faecc7;
    color: #4a321d;
    font-weight: 650;
}

.split-acc-7-10 {
    background: #fdf5df;
    color: #523620;
}

/* Strekk: beste strekktider og topp 10 */
.split-leg-1 {
    background: #a9dca7;
    color: #143816;
    font-weight: 800;
}

.split-leg-2-3 {
    background: #c8e9c3;
    color: #1e401e;
    font-weight: 750;
}

.split-leg-4-6 {
    background: #dff2d8;
    color: #294729;
    font-weight: 650;
}

.split-leg-7-10 {
    background: #edf8e8;
    color: #314d2e;
}

/* Innenfor ca. 10 % av beste strekktid, selv om ikke topp 10 */
.split-leg-good {
    background: #f5fbf2;
    color: #385036;
}
.split-loss-small {
    background: #fff3d6;
    color: #5a3a13;
}

.split-loss-medium {
    background: #f7d99a;
    color: #4d2e0d;
    font-weight: 650;
}

.split-loss-large {
    background: #e9ad72;
    color: #3d2109;
    font-weight: 750;
}

.split-loss-huge {
    background: #cf7f58;
    color: #fff8ef;
    font-weight: 800;
}

.search-form {
    margin-left: 16px;
    margin-right: 16px;
}

/* Nyheter på forsiden */

.news-section {
    margin-top: 40px;
}

.news-card {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
    gap: 0;
    /* Kurve-designet fra hero-panelet, gjenbrukt på hovedsaken */
    background:
        linear-gradient(135deg, rgba(255, 253, 249, 0.96), rgba(247, 243, 237, 0.80)),
        url("/img/contours.svg");
    background-size: 900px auto;
    background-position: right top;
}

.news-body {
    padding: clamp(24px, 4vw, 40px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.news-kicker {
    color: var(--brown-600);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 800;
    font-size: 0.73rem;
    margin: 0 0 12px;
}

.news-headline {
    margin: 0;
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    letter-spacing: -0.045em;
    line-height: 1.04;
    color: var(--brown-950);
}

.news-lead {
    margin: 16px 0 0;
    font-size: 1.06rem;
    color: rgba(43, 26, 17, 0.78);
    max-width: 520px;
}

.news-cta {
    margin-top: 24px;
}

.news-side {
    border-left: 1px solid rgba(82, 54, 32, 0.10);
    background: rgba(247, 243, 237, 0.72);
    padding: 14px 6px;
    display: flex;
    align-items: center;
}

.mini-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.92rem;
}

.mini-table th,
.mini-table td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(82, 54, 32, 0.09);
    text-align: left;
    vertical-align: middle;
}

.mini-table th {
    color: var(--brown-600);
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    font-weight: 850;
}

.mini-table tbody tr:last-child td {
    border-bottom: none;
}

.mini-club {
    display: block;
    font-size: 0.8rem;
}

.news-secondary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 22px;
}

.news-mini {
    display: flex;
    flex-direction: column;
    /* Samme kurve-tekstur, dempet, i hjørnet */
    background:
        linear-gradient(150deg, rgba(255, 253, 249, 0.97), rgba(247, 243, 237, 0.88)),
        url("/img/contours.svg");
    background-size: 620px auto;
    background-position: right -40px top -60px;
}

.news-mini-headline {
    margin: 8px 0 0;
    font-size: 1.32rem;
    letter-spacing: -0.03em;
    line-height: 1.08;
    color: var(--brown-950);
}

.news-mini .news-lead {
    font-size: 0.98rem;
    margin-top: 10px;
}

.news-mini-link {
    margin-top: auto;
    padding-top: 14px;
}

.type-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

/* Bommet seg bort: navigasjonstabbe (varm oransje) */
.type-bom {
    background: #f7d99a;
    color: #4d2e0d;
}

/* Feilstemplet: teknisk diska (kjølig grå) */
.type-feil {
    background: #d9d2c7;
    color: #4b3a28;
}

.trend-up {
    color: #2f7d32;
    font-weight: 850;
}

.trend-down {
    color: #b3402a;
    font-weight: 850;
}

/* Filterskjema (aktivitetssiden) */

.filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid rgba(82, 54, 32, 0.10);
}

.filter-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 130px;
}

.filter-label {
    color: var(--brown-600);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.13em;
    font-weight: 850;
}

.filter-select,
.filter-input {
    border: 1px solid rgba(82, 54, 32, 0.18);
    border-radius: var(--radius-md);
    background: rgba(255, 253, 249, 0.92);
    padding: 10px 12px;
    color: var(--brown-950);
    font: inherit;
    outline: none;
}

.filter-input {
    min-width: 190px;
}

.filter-select:focus,
.filter-input:focus {
    border-color: rgba(82, 54, 32, 0.42);
    box-shadow: 0 0 0 4px rgba(200, 169, 138, 0.20);
}

.sort-link {
    color: inherit;
}

.sort-link.active {
    color: var(--brown-950);
}

@media (max-width: 860px) {
    .news-card {
        grid-template-columns: 1fr;
    }

    .news-side {
        border-left: none;
        border-top: 1px solid rgba(82, 54, 32, 0.10);
    }

    .news-secondary {
        grid-template-columns: 1fr;
    }

    .filter-form {
        align-items: stretch;
        flex-direction: column;
    }
}

@media (max-width: 760px) {
    .split-runner-col {
        min-width: 210px;
    }

    .split-runner-meta {
        margin-left: 16px;
        display: inline-flex;
        gap: 10px;
    }

    .split-control {
        min-width: 58px;
        text-align: right;
    }

    .split-row td {
        font-size: 0.82rem;
    }
}
