:root {
    color-scheme: light;
    --background: #f8fafc;
    --surface: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --primary: #1d4ed8;
    --headline-font: "Hanken Grotesk", "Inter", sans-serif;
    --mono-font: "JetBrains Mono", ui-monospace, monospace;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 88px;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--background);
    color: var(--text-primary);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.4286;
    -webkit-font-smoothing: antialiased;
}

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

button {
    font: inherit;
}

button:disabled {
    opacity: 1;
    cursor: default;
}

h1, h2, h3, p, dl, dd {
    margin: 0;
}

h1, h2 {
    font-family: var(--headline-font);
}

:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 4px;
}

.container {
    width: 100%;
    max-width: 1400px;
    margin-inline: auto;
    padding-inline: 32px;
}

.icon {
    display: inline-block;
    flex-shrink: 0;
    width: 1em;
    height: 1em;
    vertical-align: middle;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 16px;
    z-index: 100;
    transform: translateY(-160%);
    padding: 12px 16px;
    border-radius: 6px;
    background: var(--primary);
    color: white;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: fixed;
    inset: 0 0 auto;
    z-index: 50;
    border-bottom: 1px solid rgb(226 232 240 / 80%);
    background: rgb(255 255 255 / 90%);
    backdrop-filter: blur(12px);
}

.header-content {
    min-height: 64px;
    display: flex;
    align-items: center;
    gap: 40px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.brand-mark {
    display: block;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgb(0 0 0 / 10%);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-name {
    font-family: var(--headline-font);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -.025em;
}

.brand:hover .brand-name {
    color: var(--primary);
}

.brand-tagline {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 40px;
    padding-inline: 12px;
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-link:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

main {
    flex: 1;
    padding-top: 64px;
}

.intro-section {
    padding-top: 24px;
    padding-bottom: 48px;
}

.intro-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: radial-gradient(ellipse at top right, #eff6ff80, transparent 35%), var(--surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}

.intro-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

h1, .coupon-header h2 {
    font-size: 36px;
    line-height: 44px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #f8fafc;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 16px;
    font-weight: 600;
}

.feature-badge .icon, .intro-features .icon {
    color: var(--primary);
}

.feature-badge-green {
    border-color: #a7f3d0;
    background: #ecfdf5;
    color: #065f46;
}

.feature-badge-green .icon {
    color: inherit;
}

.intro-description h2 {
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
    letter-spacing: -.025em;
}

.intro-description p {
    max-width: 896px;
    margin-top: 4px;
    color: var(--text-secondary);
    line-height: 1.625;
}

.intro-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    padding-top: 4px;
    border-top: 1px solid #f1f5f9;
}

.intro-features h3 {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    line-height: 16px;
    font-weight: 600;
}

.intro-features p {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.625;
}

.primary-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 4px;
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--primary);
    color: white;
    font-size: 13px;
    line-height: 16px;
    font-weight: 600;
    box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
}

.primary-link:hover {
    background: #1e40af;
}

.coupon-section {
    padding-bottom: 24px;
}

.coupon-section + .coupon-section {
    padding-top: 24px;
}

#europatipset-sektion {
    --primary: #047857;
}

#europatipset-sektion .coupon-header {
    background: linear-gradient(105deg, #064e3b, #065f46 50%, var(--primary));
}

#europatipset-sektion .tone-blue {
    color: var(--primary);
    background: #ecfdf5;
    border-color: #a7f3d099;
}

#europatipset-sektion :focus-visible {
    outline-color: var(--primary);
}

.coupon-header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding: 16px;
    overflow: hidden;
    border-radius: 8px;
    background: linear-gradient(105deg, #1e3a8a, #1e40af 50%, var(--primary));
    color: white;
    box-shadow: 0 4px 6px rgb(0 0 0 / 10%);
}

.coupon-header::after {
    content: "";
    position: absolute;
    right: -40px;
    bottom: -40px;
    width: 256px;
    height: 256px;
    border-radius: 50%;
    background: rgb(251 191 36 / 10%);
    filter: blur(40px);
    pointer-events: none;
}

.coupon-introduction {
    position: relative;
    z-index: 1;
}

.coupon-introduction {
    min-width: 0;
}

.round-badges {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.round-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 11px;
    line-height: 14px;
    font-weight: 600;
}

.jackpot {
    padding-inline: 12px;
    border-color: #fcd34d;
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
    color: #020617;
    font-weight: 700;
}

.deadline {
    border-color: #fecdd3;
    background: #fff1f2;
    color: #be123c;
}

.round {
    border-color: rgb(52 211 153 / 20%);
    background: rgb(16 185 129 / 20%);
    color: #6ee7b7;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
}

.match-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.coupon-message a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.coupon-edition {
    margin-bottom: 12px;
    font-weight: 600;
}

.coupon-message {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-secondary);
}

.coupon-error {
    border-color: #fecdd3;
    background: #fff1f2;
}

.match-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 3%);
    transition: box-shadow .15s;
}

.match-card:hover {
    box-shadow: 0 4px 6px rgb(0 0 0 / 8%);
}

.match-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px;
    padding-bottom: 6px;
    border-bottom: 1px solid #f1f5f9;
}

.match-league {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 11px;
    line-height: 14px;
}

.match-number {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f1f5f9;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
}

.match-badge {
    padding: 2px 8px;
    border: 1px solid;
    border-radius: 2px;
    font-size: 11px;
    line-height: 14px;
    font-weight: 600;
}

.tone-green { color: #047857; background: #ecfdf5; border-color: #a7f3d099; }
.tone-blue { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe99; }
.tone-amber { color: #b45309; background: #fffbeb; border-color: #fde68a99; }
.tone-purple { color: #7e22ce; background: #faf5ff; border-color: #e9d5ff99; }
.tone-rose { color: #be123c; background: #fff1f2; border-color: #fecdd399; }

.match-teams {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: center;
    gap: 6px;
    font-size: 16px;
    line-height: 24px;
    font-weight: 600;
}

.match-teams > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-teams > span:last-child {
    text-align: right;
}

.match-statistics {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 4px;
    color: var(--text-muted);
    font-family: var(--mono-font);
    font-size: 11px;
    line-height: 14px;
}

.public-percentages {
    color: var(--primary);
    font-weight: 500;
}

.match-picks {
    padding-top: 4px;
}

.signs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.sign {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--text-secondary);
}

.sign-label {
    font-family: var(--headline-font);
    font-size: 18px;
    line-height: 18px;
    font-weight: 600;
}

.sign-percentage {
    margin-top: 2px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 16px;
}

.sign-selected {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    font-weight: 700;
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}

.sign-selected .sign-percentage {
    color: rgb(255 255 255 / 90%);
}

.sign-outlined {
    box-shadow: 0 0 0 1px white, 0 0 0 3px var(--primary);
}

.match-commentary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px 8px;
    margin-top: 8px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 16px;
}

.match-insight {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-weight: 500;
}

.insight-green:has(.icon) { color: #047857; }
.insight-blue { color: #475569; }
.insight-blue:not(:has(.icon)) { color: var(--text-muted); }
.insight-amber { color: #b45309; }
.insight-purple { color: #7e22ce; }
.insight-rose { color: #e11d48; }

.system-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}

.system-information {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 32px;
}

.system-size {
    padding-right: 32px;
    border-right: 1px solid var(--border);
}

.system-label {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 16px;
    font-weight: 600;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.system-size > div {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-top: 2px;
}

.system-size strong {
    font-size: 24px;
    line-height: 32px;
}

.system-size > div > span {
    color: var(--text-muted);
    font-weight: 500;
}

.system-statistics {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
}

.system-statistics dt {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 16px;
}

.system-statistics dd {
    color: #1e293b;
    font-weight: 700;
}

.submit-system {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: 0;
    border-radius: 6px;
    background: #00875a;
    color: white;
    font-size: 14px;
    line-height: 20px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgb(0 0 0 / 5%);
}

.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 12px;
    line-height: 16px;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-block: 16px;
}

.footer-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 24px;
}

.footer-privacy-link {
    padding: 6px 0;
    color: var(--text-muted);
    font-size: 11px;
    cursor: pointer;
    text-underline-offset: 3px;
}

.footer-privacy-link:hover,
.footer-privacy-link:focus-visible {
    color: var(--text-secondary);
    text-decoration: underline;
}

.privacy-page {
    padding-block: 40px;
}

.privacy-policy {
    max-width: 760px;
    margin-inline: auto;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text-secondary);
}

.privacy-policy h1 {
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1.25;
}

.privacy-policy-content {
    margin-top: 24px;
    line-height: 1.7;
}

.privacy-policy-content p + p {
    margin-top: 16px;
}

.privacy-policy-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.responsible-play {
    color: #047857;
    font-family: var(--mono-font);
    font-size: 11px;
    font-weight: 600;
}

.message-page {
    padding-block: 48px;
}

.message-page p {
    margin-block: 12px;
}

@media (max-width: 1199px) {
    .coupon-header {
        flex-wrap: wrap;
    }

}

@media (min-width: 768px) and (max-width: 1023px) {
    .match-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .match-card-last {
        grid-column: span 2;
    }
}

@media (max-width: 1023px) {
    .system-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .submit-system {
        align-self: flex-end;
    }
}

@media (max-width: 767px) {
    html {
        scroll-padding-top: 116px;
    }

    .container {
        padding-inline: 16px;
    }

    .header-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        padding-block: 10px;
    }

    .main-nav {
        width: 100%;
        justify-content: space-between;
    }

    .nav-link {
        height: 32px;
        padding-inline: 8px;
        font-size: 12px;
    }

    main {
        padding-top: 106px;
    }

    .intro-card, .coupon-header {
        padding: 12px;
    }

    h1, .coupon-header h2 {
        font-size: 28px;
        line-height: 36px;
    }

    .intro-features, .match-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .feature-badge {
        padding-inline: 8px;
        font-size: 11px;
    }

    .system-summary {
        padding: 16px;
    }

    .system-information, .system-statistics {
        gap: 24px;
    }

    .system-size {
        padding-right: 24px;
    }
}

@media (max-width: 479px) {
    .nav-link .icon {
        display: none;
    }

    .system-size {
        border: 0;
    }

    .submit-system {
        width: 100%;
        padding-inline: 12px;
    }

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

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *, *::before, *::after {
        transition: none !important;
    }
}

[hidden] { display: none !important; }

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

.proposal-banner, .admin-heading, .admin-card-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.proposal-banner {
    margin-bottom: 16px;
    padding: 16px;
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    background: var(--surface);
}

.proposal-banner h3 { margin-top: 4px; font-size: 18px; }
.admin-page { padding-block: 40px; }
.admin-card { min-width: 0; padding: 24px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.admin-login { max-width: 440px; margin: 24px auto 64px; }
.admin-login h1 { margin-block: 8px; }
.admin-login > p, .admin-intro { color: var(--text-secondary); }
.login-form { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.login-form label { font-weight: 600; }
.login-form input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 6px; font: inherit; }
.login-form .primary-link { align-self: flex-start; }
.admin-page button { cursor: pointer; }
.admin-page button:disabled { cursor: not-allowed; opacity: .55; }
.admin-page .primary-link { min-height: 42px; gap: 8px; border: 0; }
.secondary-button { min-height: 42px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text-secondary); }
.admin-intro { max-width: 850px; margin-block: 16px 24px; line-height: 1.7; }
.admin-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.admin-card h2 { font-size: 24px; }
.proposal-status { padding: 5px 10px; border-radius: 20px; background: #f1f5f9; color: var(--text-muted); font-size: 12px; font-weight: 600; }
.is-published, .admin-success { background: #ecfdf5; color: #065f46; }
.admin-round { margin-top: 12px; color: var(--text-secondary); }
.admin-system { margin-block: 8px 20px; color: var(--primary); font-size: 13px; font-weight: 600; }
.admin-feedback { margin-block: 16px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; }
.admin-feedback a { text-decoration: underline; }
.admin-feedback.coupon-error { border-color: #fecdd3; }
.editor-heading, .editor-match { display: grid; grid-template-columns: minmax(0, 1fr) 144px; align-items: center; gap: 12px; }
.editor-heading { margin-bottom: 8px; color: var(--text-muted); font-size: 12px; }
.editor-heading > :last-child { text-align: center; }
.editor-match { min-width: 0; margin: 0; padding: 10px 0; border: 0; border-top: 1px solid var(--border); }
.editor-teams { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; }
.editor-teams .match-number { flex-shrink: 0; }
.editor-signs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.editor-signs label { position: relative; display: grid; cursor: pointer; }
.editor-signs input { position: absolute; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.editor-signs label > span:not(.visually-hidden) { display: grid; place-items: center; min-height: 42px; border: 1px solid var(--border); border-radius: 6px; background: #f8fafc; font-weight: 700; }
.editor-signs input:checked + span { border-color: var(--primary); background: var(--primary); color: white; }
.editor-signs input:focus-visible + span { outline: 3px solid var(--primary); outline-offset: 2px; }
.editor-count { margin-block: 16px; padding: 12px; border-radius: 6px; background: #f1f5f9; color: var(--text-secondary); font-size: 13px; }
.editor-count.is-complete { background: #ecfdf5; color: #065f46; }
.admin-saved { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 12px; }
.text-button { padding: 4px 0; border: 0; background: transparent; color: #be123c; text-decoration: underline; text-underline-offset: 3px; }
.admin-home-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 24px; color: var(--primary); font-weight: 600; }

@media (max-width: 1023px) {
    .admin-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 479px) {
    .admin-card { padding: 16px; }
    .editor-heading, .editor-match { grid-template-columns: minmax(0, 1fr) 126px; gap: 8px; }
    .editor-teams { font-size: 12px; }
    .admin-heading h1 { font-size: 26px; }
}
