/* Eredivisie blessure tracker: clean, subtle sport style */
:root {
    --bg: #f2f4f7;
    --surface: #ffffff;
    --surface-2: #f6f8fb;
    --text: #0f172a;
    --muted: #64748b;
    --border: #e3e8ef;
    --accent: #1d4ed8;          /* links */
    --brand: #0c1626;           /* header navy */
    --brand-2: #14243b;
    --volt: #c8f135;            /* sport accent, used on dark surfaces */
    --star: #e2a100;
    --row-hover: #f5f8fc;
    --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 20px -8px rgba(15, 23, 42, .12);
    --low-bg: #e3f5e8;   --low-fg: #17663a;
    --mid-bg: #fdf0d5;   --mid-fg: #8a5a00;
    --high-bg: #fde4e1;  --high-fg: #a72318;
    --warn: #b45309;
    --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
    --font-body: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0a0f17;
        --surface: #111a26;
        --surface-2: #0e1621;
        --text: #e6eaf0;
        --muted: #8d98aa;
        --border: #1f2b3b;
        --accent: #8ab4ff;
        --brand: #070d16;
        --brand-2: #0f1d30;
        --star: #d9f34a;
        --row-hover: #152131;
        --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -10px rgba(0, 0, 0, .6);
        --low-bg: #12301f;   --low-fg: #8fdca9;
        --mid-bg: #352a0f;   --mid-fg: #f2c46b;
        --high-bg: #3b1916;  --high-fg: #f6a49a;
        --warn: #f0a35b;
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font-body);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-underline-offset: 2px; }
h1 { font-family: var(--font-display); font-weight: 800; font-style: italic; text-transform: uppercase; letter-spacing: .01em; font-size: 2rem; line-height: 1; margin: 0 0 .3rem; }
h3 { font-family: var(--font-display); font-weight: 700; font-size: .95rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.3rem 0 .5rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 24px 16px 40px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.page-head { margin-bottom: 18px; }
.page-head p { margin: 0; }
.page-foot { margin-top: 28px; padding-top: 14px; max-width: 70ch; }
.page-foot p { margin: 0 0 8px; }
.credit { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: .8rem; }
.credit a { color: var(--text); text-decoration: none; border-bottom: 2px solid var(--volt); }
.credit a:hover { color: var(--accent); }
.empty { padding: 30px 0; color: var(--muted); }

/* Header band */
.hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background:
        radial-gradient(ellipse 60% 120% at 85% 0%, rgba(200, 241, 53, .10), transparent 60%),
        linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
    border-bottom: 3px solid var(--volt);
}
/* Faint pitch markings */
.hero::after {
    content: "";
    position: absolute;
    right: -60px; top: 50%;
    width: 420px; height: 420px;
    transform: translateY(-50%);
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='none' stroke='white' stroke-width='3'%3E%3Ccircle cx='200' cy='200' r='90'/%3E%3Ccircle cx='200' cy='200' r='5' fill='white'/%3E%3Cline x1='0' y1='200' x2='400' y2='200'/%3E%3Crect x='2' y='2' width='396' height='396'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: .06;
    pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; padding-top: 26px; padding-bottom: 22px; }
.eyebrow { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .14em; font-size: .8rem; color: var(--volt); margin-bottom: 6px; }
.hero h1 { font-size: 2.6rem; }
.hero h1 span { color: var(--volt); }
.stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.stats > div { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); border-radius: 10px; padding: 8px 14px; min-width: 120px; }
.stats dt { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255, 255, 255, .6); }
.stats dd { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stats .short, .eyebrow-time { display: none; }
.stats dd small { font-family: var(--font-body); font-weight: 400; font-size: .72rem; color: rgba(255, 255, 255, .6); margin-left: 6px; }

/* Toolbar: tabs and filters */
.toolbar { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px 16px; margin-bottom: 14px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow); }
.tabs a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: .9rem; transition: background .15s, color .15s; }
.tabs a:hover { color: var(--text); }
.tabs a.active { background: var(--brand); color: #fff; }
.count { font-size: .75em; background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 1px 7px; margin-left: 4px; font-variant-numeric: tabular-nums; }
.tabs a.active .count { background: var(--volt); color: var(--brand); }
.filters { display: grid; grid-template-columns: minmax(130px, 170px) minmax(130px, 170px) minmax(180px, 280px); justify-content: end; gap: 8px; }
.filters label { display: block; min-width: 0; }
select, input[type="search"], input[type="text"], input[type="url"], input[type="password"] {
    font: inherit; font-size: .92rem; color: var(--text); background: var(--surface);
    border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; width: 100%; height: 38px;
    transition: border-color .15s, box-shadow .15s;
}
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.filters select { width: 100%; }

/* Table */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
table.list { width: 100%; border-collapse: collapse; }
.list th, .list td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.list th {
    font-family: var(--font-display); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); background: var(--surface-2); cursor: pointer; user-select: none; white-space: nowrap;
}
.list th:hover { color: var(--text); }
.list th[aria-sort="ascending"]::after { content: " ▲"; font-size: .7em; color: var(--accent); }
.list th[aria-sort="descending"]::after { content: " ▼"; font-size: .7em; color: var(--accent); }
.list tbody tr.row { cursor: pointer; transition: background .12s; }
.list tbody tr.row:hover, .list tbody tr.row.open { background: var(--row-hover); }
.list tbody tr.row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.list tbody tr.row.top > td:first-child { box-shadow: inset 3px 0 0 var(--volt); }
.list tbody tr:last-child td { border-bottom: 0; }
.player { font-weight: 600; }
.list td.col-since, .list td.col-recovered { white-space: nowrap; }
.list tbody tr.row td:nth-child(3) { white-space: nowrap; }
.sub { display: block; font-size: .8rem; color: var(--muted); }
.sub.warn { color: var(--warn); }
.tag { display: inline-block; font-size: .7rem; font-weight: 500; padding: 0 6px; border-radius: 4px; border: 1px solid var(--border); color: var(--muted); margin-left: 4px; vertical-align: 1px; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 600; padding: 2px 9px 2px 7px; border-radius: 999px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.u-laag { background: var(--low-bg); color: var(--low-fg); }
.u-middel { background: var(--mid-bg); color: var(--mid-fg); }
.u-hoog { background: var(--high-bg); color: var(--high-fg); }

/* Club with shirt-colour chip */
.club { display: inline-flex; align-items: center; gap: 7px; }
.kit {
    width: 10px; height: 14px; border-radius: 3px; flex: none;
    background: linear-gradient(90deg, var(--c1) 50%, var(--c2) 50%);
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
}

/* Detail */
.detail-row > td { background: var(--surface-2); padding: 18px 18px 22px; }
.detail-grid { display: grid; grid-template-columns: minmax(240px, 2fr) 3fr; gap: 28px; }
.summary { margin: 0 0 14px; font-size: 1rem; font-weight: 500; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 7px 16px; margin: 0; }
.facts dt { color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; }
.note { display: block; font-size: .85rem; color: var(--muted); margin-top: 3px; }
.history { margin: 0; padding-left: 18px; }
.reports { list-style: none; margin: 0; padding: 0; }
.report { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 13px; margin-bottom: 8px; }
.report-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; margin-bottom: 3px; }
.report-title { font-weight: 600; margin-bottom: 2px; }
.report-tags { margin-left: auto; display: inline-flex; gap: 4px; }
.report-tags .tag { margin-left: 0; }
blockquote { margin: 7px 0 3px; padding: 2px 0 2px 11px; border-left: 3px solid var(--volt); font-style: italic; }
cite { font-style: normal; color: var(--muted); font-size: .85rem; }
.rel { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--border); }
.rel-3 { background: var(--low-fg); }
.rel-2 { background: var(--mid-fg); }
.rel-1 { background: var(--muted); opacity: .6; }

/* Importance stars */
.stars { color: var(--star); letter-spacing: 1px; white-space: nowrap; }
.stars .off { color: var(--border); }
.stars-inline { display: none; font-size: .8rem; }

/* Rumours */
.hint { font-style: italic; }
.rumor-intro { margin: -4px 0 8px; }
.rumor-topic { margin-bottom: 10px; }
.rumor-topic-label { font-size: .82rem; font-weight: 600; margin-bottom: 2px; }
.rumor summary { position: relative; margin-left: 12px; display: grid; grid-template-columns: minmax(90px, 1.2fr) 80px auto auto; gap: 8px; align-items: center; cursor: pointer; padding: 3px 0; font-size: .9rem; list-style: none; }
.rumor summary::-webkit-details-marker { display: none; }
.rumor summary::before { content: "▸"; position: absolute; margin-left: -12px; color: var(--muted); font-size: .7rem; }
.rumor[open] summary::before { content: "▾"; }
.rumor ul { margin: 2px 0 8px 12px; padding-left: 16px; font-size: .85rem; }
.rumor li { margin-bottom: 4px; }
.meter { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; display: block; }
.meter > span { display: block; height: 100%; border-radius: 4px; }
.meter .m-high { background: var(--low-fg); }
.meter .m-mid { background: var(--mid-fg); }
.meter .m-low { background: var(--muted); }

/* Admin */
.admin-nav { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.admin-nav .right { margin-left: auto; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
.btn { font: inherit; font-size: .9rem; font-weight: 600; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 8px; padding: 6px 12px; cursor: pointer; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.small { padding: 2px 8px; font-size: .8rem; }
.form-row { display: grid; grid-template-columns: 2fr 3fr 1fr 1fr auto; gap: 8px; align-items: end; }
.form-row label { font-size: .8rem; color: var(--muted); display: block; }
.status-ok { color: var(--low-fg); }
.status-error, .status-warning { color: var(--high-fg); }
.bar { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; border: 1px solid var(--border); }
.bar > span { display: block; height: 100%; background: var(--accent); }
pre.log { white-space: pre-wrap; font-size: .8rem; background: var(--surface-2); padding: 10px; border-radius: 8px; max-height: 420px; overflow: auto; }
.list.compact td, .list.compact th { padding: 7px 10px; cursor: default; }
/* Admin pages keep the simple header and tab underline */
.page-head + .tabs { display: flex; border-radius: 0; background: none; border: 0; border-bottom: 1px solid var(--border); box-shadow: none; padding: 0; margin-bottom: 16px; }
.page-head + .tabs a { border-radius: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.page-head + .tabs a.active { background: none; color: var(--text); border-color: var(--volt); }

/* Tablet and small laptop */
@media (max-width: 900px) {
    .toolbar { grid-template-columns: 1fr; }
    .tabs { justify-self: start; }
    .filters { grid-template-columns: 1fr 1fr 1.3fr; justify-content: stretch; }
}

/* Narrow laptop / tablet landscape: drop the least important columns */
@media (max-width: 1100px) {
    .list th, .list td { padding: 10px 10px; }
    .list .col-since, .list .col-imp { display: none; }
    .stars-inline { display: inline; }
    .list tbody tr.row td:nth-child(3) { white-space: normal; }
    .sub { overflow-wrap: anywhere; }
}

/* Tablet and phone: one card per player */
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; gap: 6px; }
    .hero h1 { font-size: 2.1rem; }
    .form-row { grid-template-columns: 1fr; }
    .list thead { display: none; }
    .list tbody tr.row {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas: "player team" "type unc" "ret unc" "dur dur";
        gap: 2px 12px;
        padding: 11px 16px;
        border-bottom: 1px solid var(--border);
    }
    .list tbody tr.row.top { box-shadow: inset 3px 0 0 var(--volt); }
    .list tbody tr.row.top > td:first-child { box-shadow: none; }
    .list tbody tr.row td { border: 0; padding: 0; }
    .list tbody tr.row .col-player { grid-area: player; }
    .list tbody tr.row .col-team { grid-area: team; text-align: right; color: var(--muted); }
    .list tbody tr.row .col-type { grid-area: type; }
    .list tbody tr.row .col-return, .list tbody tr.row .col-recovered { grid-area: ret; color: var(--muted); font-size: .9rem; }
    .list tbody tr.row .col-return::before { content: "Terug: "; }
    .list tbody tr.row .col-recovered::before { content: "Hersteld: "; }
    .list tbody tr.row .col-return .sub { display: inline; margin-left: 4px; }
    .list tbody tr.row .col-unc { grid-area: unc; text-align: right; align-self: center; }
    .list tbody tr.row .col-imp, .list tbody tr.row .col-since, .list tbody tr.row .col-duration { display: none; }
    /* A duration rumour is worth showing on small screens too */
    .list tbody tr.row .col-duration:has(.hint) { display: block; grid-area: dur; font-size: .85rem; color: var(--muted); }
    .list tbody tr.row .col-duration:has(.hint)::before { content: "Duur: "; }
    .stars-inline { display: inline; }
    .detail-row { display: block; }
    .detail-row > td { display: block; padding: 14px 16px 18px; }
    .rumor summary { grid-template-columns: 1fr 60px auto; }
    .rumor summary > .small { display: none; }
    .report-tags { margin-left: 0; flex-basis: 100%; }
    .facts { grid-template-columns: 7.5rem 1fr; }
}

/* Phone */
@media (max-width: 640px) {
    .hero-inner { padding-top: 18px; padding-bottom: 14px; }
    .hero h1 { font-size: 1.85rem; }
    .hero::after { width: 260px; height: 260px; right: -90px; }
    .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 12px; }
    .stats > div { min-width: 0; padding: 6px 10px; display: flex; flex-direction: column-reverse; }
    .stats dd { font-size: 1.45rem; }
    .stats .long, .stats > .stat-time { display: none; }
    .stats .short { display: inline; }
    .eyebrow-time { display: inline; }
    .toolbar { gap: 10px; }
    .filters { grid-template-columns: 1fr 1fr; }
    .filters .grow { grid-column: 1 / -1; }
    /* 16px keeps iOS Safari from zooming in on focus */
    select, input[type="search"], input[type="text"], input[type="password"] { font-size: 16px; height: 42px; }
    .table-wrap { border-left: 0; border-right: 0; border-radius: 0; margin: 0 -16px; box-shadow: none; }
}

/* Recent updates (last 24 hours) */
.list tbody tr.row.fresh { background: color-mix(in srgb, var(--volt) 9%, var(--surface)); }
.list tbody tr.row.fresh:hover, .list tbody tr.row.fresh.open { background: color-mix(in srgb, var(--volt) 15%, var(--surface)); }
.fresh-chip {
    display: inline-flex; align-items: center; gap: 5px; margin-left: 6px; vertical-align: 1px;
    font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    padding: 1px 7px; border-radius: 999px; background: var(--brand); color: #fff; white-space: nowrap;
}
.fresh-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--volt); animation: pulse 2s ease-in-out infinite; }
.fresh-chip .ago { font-weight: 500; text-transform: none; letter-spacing: 0; opacity: .7; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .fresh-chip::before { animation: none; } }
.events { list-style: none; margin: 0; padding: 0; font-size: .9rem; }
.events li { padding: 4px 0 4px 14px; position: relative; }
.events li::before { content: ""; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--border); }
.events li.recent::before { background: var(--volt); box-shadow: 0 0 0 2px color-mix(in srgb, var(--volt) 30%, transparent); }
.event-label { font-weight: 600; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .fresh-chip { background: var(--volt); color: #0c1626; }
    :root:not([data-theme="light"]) .fresh-chip::before { background: #0c1626; }
}
