:root {
    /* Pas deze variabelen aan voor de uiteindelijke huisstijl. */
    --brand: #49a6ff;
    --brand-strong: #1477d4;
    --text: #ffffff;
    --muted: rgba(255, 255, 255, .68);
    --panel: rgba(10, 18, 31, .82);
    --panel-border: rgba(255, 255, 255, .13);
    --admin-background: #f2f4f7;
    --admin-surface: #ffffff;
    --admin-text: #182230;
    --error: #b42318;
    --success: #067647;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }

.scoreboard-page { min-height: 100vh; overflow-x: hidden; background: #09111f; color: var(--text); }
.background { position: fixed; inset: 0; z-index: -2; background: url("background.jpg") center/cover no-repeat; }
.shade { position: fixed; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(3, 9, 18, .82) 0%, rgba(3, 9, 18, .45) 48%, rgba(3, 9, 18, .7) 100%); }
.scoreboard-shell { position: relative; min-height: 100svh; padding: clamp(28px, 3.2vw, 70px); display: grid; grid-template-columns: minmax(360px, .78fr) minmax(560px, 1.22fr); grid-template-rows: auto 1fr auto; gap: clamp(24px, 2.4vw, 52px); }
.scoreboard-header { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.eyebrow { margin: 0 0 .25em; color: var(--brand); font-size: clamp(.74rem, .65vw, 1.15rem); font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(2.2rem, 4vw, 5.2rem); line-height: .95; letter-spacing: -.055em; }
h2 { margin-bottom: 0; font-size: clamp(2rem, 2.8vw, 4rem); line-height: 1; letter-spacing: -.045em; }
.live-status { display: inline-flex; align-items: center; gap: .65em; padding: .65em 1em; border: 1px solid var(--panel-border); border-radius: 999px; background: rgba(7, 14, 26, .7); backdrop-filter: blur(14px); font-size: clamp(.8rem, .7vw, 1.15rem); font-weight: 750; }
.status-dot { width: .65em; height: .65em; border-radius: 50%; background: #37d38a; box-shadow: 0 0 0 .3em rgba(55, 211, 138, .15); }
.offline .status-dot { background: #fdb022; box-shadow: 0 0 0 .3em rgba(253, 176, 34, .15); }

.ranking-panel { grid-column: 2; grid-row: 2 / 4; align-self: stretch; overflow: hidden; border: 1px solid var(--panel-border); border-radius: clamp(18px, 1.6vw, 34px); background: var(--panel); box-shadow: 0 24px 80px rgba(0, 0, 0, .28); backdrop-filter: blur(22px); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: clamp(24px, 2.2vw, 48px); border-bottom: 1px solid var(--panel-border); }
.updated { margin: 0; color: var(--muted); font-size: clamp(.78rem, .68vw, 1.08rem); white-space: nowrap; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: clamp(12px, 1.12vw, 25px) clamp(18px, 2vw, 42px); border-bottom: 1px solid var(--panel-border); text-align: left; }
th { color: var(--muted); font-size: clamp(.68rem, .58vw, .95rem); letter-spacing: .09em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(-n+3) { background: rgba(255, 255, 255, .035); }
.numeric { text-align: right; }
.score { font-size: clamp(1rem, 1vw, 1.7rem); font-variant-numeric: tabular-nums; font-weight: 850; }
.rank { display: grid; place-items: center; width: clamp(30px, 2.15vw, 48px); height: clamp(30px, 2.15vw, 48px); border-radius: 50%; background: rgba(255, 255, 255, .1); font-weight: 850; }
tr:nth-child(1) .rank { background: #f6d365; color: #3d2c00; }
tr:nth-child(2) .rank { background: #d5dae2; color: #344054; }
tr:nth-child(3) .rank { background: #cf916a; color: #402313; }
.empty-row td { height: 180px; color: var(--muted); text-align: center; }

.all-time { grid-column: 1; grid-row: 3; align-self: end; padding-left: clamp(4px, 1vw, 20px); text-shadow: 0 4px 30px rgba(0, 0, 0, .5); transform-origin: left bottom; }
.all-time-score { margin: 0 0 .08em; color: #fff; font-family: ui-monospace, "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: clamp(3.6rem, 5.8vw, 8.5rem); font-weight: 900; line-height: .88; letter-spacing: -.06em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.all-time-name { margin: 0; font-size: clamp(1.25rem, 1.7vw, 2.6rem); font-weight: 800; }
.company-logo { position: absolute; right: calc(clamp(28px, 3.2vw, 70px) + 10px); bottom: calc(clamp(24px, 2.8vw, 60px) + 10px); width: clamp(150px, 12vw, 330px); height: auto; filter: drop-shadow(0 6px 25px rgba(0, 0, 0, .35)); }
.ranking-panel + .all-time + .company-logo { pointer-events: none; }
.scoreboard-page tbody tr.score-change { animation: row-score-change 8s ease-out; }
.all-time.score-change { animation: record-score-change 8s ease-out; }

@keyframes row-score-change {
    0%, 18% { background: rgba(73, 166, 255, .34); box-shadow: inset 5px 0 0 var(--brand); }
    100% { background: transparent; box-shadow: inset 0 0 0 transparent; }
}
@keyframes record-score-change {
    0%, 18% { transform: scale(1.035); filter: drop-shadow(0 0 24px rgba(73, 166, 255, .8)); }
    100% { transform: scale(1); filter: none; }
}

.admin-page { background: var(--admin-background); color: var(--admin-text); }
.admin-shell { width: min(1040px, calc(100% - 32px)); margin: 0 auto; padding: 48px 0 70px; }
.admin-header { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 28px; }
.admin-header h1 { font-size: clamp(2rem, 6vw, 3.6rem); }
.form-card { width: min(680px, 100%); padding: clamp(24px, 5vw, 40px); border: 1px solid #e4e7ec; border-radius: 18px; background: var(--admin-surface); box-shadow: 0 12px 34px rgba(16, 24, 40, .08); }
.form-stack { display: grid; gap: 10px; }
label { margin-top: 10px; font-weight: 750; }
input, select { width: 100%; padding: 14px 15px; border: 1px solid #cfd4dc; border-radius: 10px; background: #fff; color: var(--admin-text); font: inherit; }
select { cursor: pointer; }
input:focus, select:focus { border-color: var(--brand-strong); outline: 3px solid rgba(20, 119, 212, .14); }
.optional, .field-help { color: #667085; font-size: .86rem; font-weight: 500; }
.field-help { margin: -2px 0 10px; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 13px 18px; margin-top: 16px; border: 0; border-radius: 10px; background: var(--brand-strong); color: #fff; font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; }
.button.secondary { margin: 0; border: 1px solid #d0d5dd; background: #fff; color: var(--admin-text); }
.button.danger { background: var(--error); }
.notice { padding: 13px 15px; border-radius: 10px; }
.notice.error { background: #fef3f2; color: var(--error); }
.notice.success { background: #ecfdf3; color: var(--success); }
.back-link { margin-top: 22px; text-align: center; }
a { color: var(--brand-strong); font-weight: 750; }
.form-title-row, .management-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.form-title-row { margin-bottom: 12px; }
.form-title-row h2 { font-size: 1.65rem; }
.confirmation h2 { margin-bottom: 22px; font-size: 1.8rem; }
.confirmation-data { display: grid; gap: 0; margin: 0; border: 1px solid #e4e7ec; border-radius: 12px; overflow: hidden; }
.confirmation-data div { display: grid; grid-template-columns: 140px 1fr; gap: 18px; padding: 14px 16px; border-bottom: 1px solid #e4e7ec; }
.confirmation-data div:last-child { border-bottom: 0; }
.confirmation-data dt { color: #667085; font-weight: 650; }
.confirmation-data dd { margin: 0; font-weight: 800; overflow-wrap: anywhere; }
.button-row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.button-row .button { margin-top: 0; }
.danger-label { color: var(--error); }
.management-card { margin-top: 28px; overflow: hidden; border: 1px solid #e4e7ec; border-radius: 18px; background: var(--admin-surface); box-shadow: 0 12px 34px rgba(16, 24, 40, .08); }
.management-heading { padding: 24px 28px; border-bottom: 1px solid #e4e7ec; }
.management-heading h2 { margin: 0; font-size: 1.65rem; }
.management-heading > span { color: #667085; font-size: .88rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { min-width: 720px; color: var(--admin-text); }
.admin-table th, .admin-table td { padding: 15px 20px; border-bottom: 1px solid #e4e7ec; }
.admin-table th { color: #667085; }
.admin-table tbody tr:nth-child(-n+3) { background: transparent; }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.table-actions { display: flex; align-items: center; gap: 14px; }
.table-actions form { margin: 0; }
.small-action { padding: 0; border: 0; background: transparent; color: var(--brand-strong); font: inherit; font-size: .88rem; font-weight: 750; white-space: nowrap; cursor: pointer; }
.delete-link { color: var(--error); }

@media (prefers-reduced-motion: reduce) {
    .scoreboard-page tbody tr.score-change, .all-time.score-change { animation: none; }
}

@media (max-width: 980px) {
    .scoreboard-shell { display: flex; min-height: 100svh; flex-direction: column; }
    .ranking-panel { order: 2; width: 100%; }
    .all-time { order: 3; padding: 24px 0 110px; }
    .company-logo { bottom: 34px; }
}
@media (max-width: 640px) {
    .scoreboard-header, .panel-heading, .admin-header { align-items: flex-start; flex-direction: column; }
    .scoreboard-shell { padding: 24px 16px; }
    th, td { padding: 13px 16px; }
    .updated { margin-top: -12px; }
    .company-logo { right: 18px; width: 140px; }
    .confirmation-data div { grid-template-columns: 1fr; gap: 3px; }
    .button-row { flex-direction: column-reverse; }
    .button-row .button { width: 100%; }
}
