/* KartOnline Portal - thema afgeleid van het Emerald Online-portaal */
@font-face {
  font-family: "Pixel";
  src: url("fonts/pixel.woff2") format("woff2");
  font-display: swap;
}

:root {
  --bg: #0a1430;
  --bg2: #10204d;
  --panel: #13224f;
  --panel2: #1a2d66;
  --line: #27418a;
  --text: #f1f4ff;
  --muted: #9fb0e0;
  --red: #e52521;
  --red-dark: #a3140f;
  --yellow: #fbd000;
  --yellow-dark: #b89600;
  --blue: #049cd8;
  --green: #43b047;
  --ink: #16181f;
  --danger: #ff6b6b;
  --pixel: "Pixel", ui-monospace, monospace;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #2a3a8a55, transparent 70%),
    radial-gradient(800px 500px at 100% 100%, #e5252122, transparent 60%),
    linear-gradient(var(--bg), var(--bg));
  background-attachment: fixed;
  color: var(--text);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
/* pixelraster en scanlines over de achtergrond */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    linear-gradient(transparent 50%, #00000022 50%) 0 0 / 100% 4px,
    linear-gradient(90deg, #ffffff06 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(#ffffff06 1px, transparent 1px) 0 0 / 24px 24px;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { font-family: var(--pixel); }

/* ---------- knoppen ---------- */
.arcade {
  font-family: var(--pixel); font-size: 12px; letter-spacing: .04em; text-transform: uppercase;
  padding: 14px 18px; border: 0; border-radius: 10px; color: var(--ink);
  background: linear-gradient(var(--yellow), #ffd93d);
  box-shadow: 0 5px 0 var(--yellow-dark), 0 8px 18px #0008;
  transition: transform .06s, box-shadow .06s, filter .15s;
}
.arcade:hover { filter: brightness(1.06); }
.arcade:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--yellow-dark), 0 3px 8px #0008; }
.arcade:disabled { opacity: .6; cursor: progress; }
.arcade.danger { background: linear-gradient(#ff5a36, var(--red)); color: #fff; box-shadow: 0 5px 0 var(--red-dark), 0 8px 18px #0008; }
.arcade.small { padding: 10px 12px; font-size: 11px; box-shadow: 0 3px 0 var(--yellow-dark); }
.arcade.small:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--yellow-dark); }
.ghost { background: transparent; border: 2px solid var(--line); border-radius: 10px; padding: 11px 16px; color: var(--muted); }
.ghost:hover { border-color: var(--muted); color: var(--text); }
.textlink { background: none; border: 0; padding: 6px 0; color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.textlink:hover { color: var(--yellow); }
.icon-btn {
  background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  width: 36px; height: 32px; display: inline-grid; place-items: center; font-size: 15px;
}
.icon-btn:hover { border-color: var(--muted); }

/* ---------- formulieren ---------- */
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.form input, .form textarea, .form select {
  font: 16px system-ui, sans-serif; color: var(--text); padding: 12px 14px;
  background: #0a0f26; border: 2px solid var(--line); border-radius: 10px; text-transform: none; letter-spacing: 0;
}
.form textarea { resize: vertical; min-height: 3em; }
.form input:focus, .form textarea:focus, .form select:focus { outline: none; border-color: var(--yellow); box-shadow: 0 0 0 3px #fbd00030; }
.form select option { color: var(--text); background: #0a0f26; }
.form input[readonly] { color: var(--muted); border-style: dashed; }
.error { color: var(--danger); min-height: 1.2em; margin: 0; font-size: 13px; }
.error.ok { color: var(--green); }
.note { margin: 0; color: var(--muted); font-size: 14px; }
.facts { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding-top: 2px; }
.facts dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }
.buttons { display: flex; gap: 10px; }
.buttons .arcade { flex: 1; }

/* ---------- inloggen: de bal ---------- */
.gate { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.ball-card {
  width: min(400px, 100%); border-radius: 28px; overflow: hidden;
  background: var(--panel); border: 4px solid var(--ink);
  box-shadow: 0 0 0 4px #ffffff10, 0 30px 80px #000a, 0 0 60px #3b6cf633;
}
.ball-top { /* finishvlag */
  position: relative; height: 92px;
  background:
    linear-gradient(180deg, #0000 0 70%, #000000aa) ,
    repeating-conic-gradient(#f4f4f8 0 25%, var(--ink) 0 50%) 0 0 / 46px 46px;
  border-bottom: 10px solid var(--red);
}
.ball-top::after { /* rode streep met glans */
  content: ""; position: absolute; left: 0; right: 0; bottom: -10px; height: 10px;
  background: linear-gradient(90deg, var(--red-dark), #ff5a36 50%, var(--red-dark));
}
.ball-emblem { /* band */
  position: absolute; left: 50%; bottom: -38px; width: 64px; height: 64px; margin-left: -32px; border-radius: 50%;
  background: radial-gradient(circle, #c9cee3 0 11px, var(--ink) 12px 15px, #3a3d47 16px 20px, var(--ink) 21px);
  border: 6px solid var(--ink); box-shadow: 0 0 0 4px #ffffff22;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 0 4px #ffffff22, 0 0 24px #fbd000aa; } }
.ball-body { padding: 52px 28px 26px; }
.logo { margin: 0 0 22px; text-align: center; font-family: var(--pixel); font-weight: normal; line-height: 1.5; }
.logo span {
  display: block; font-size: 17px; color: var(--yellow);
  text-shadow: 3px 3px 0 var(--blue), 0 0 18px #ffcb0555;
}
.logo small { display: block; margin-top: 8px; font-size: 10px; letter-spacing: .5em; color: var(--muted); }

/* ---------- ingelogd ---------- */
.portal { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.navbar {
  display: flex; align-items: center; gap: 12px; padding: 8px 16px; min-height: 52px;
  background: #0a0f26e6; border-bottom: 3px solid var(--ink); box-shadow: 0 2px 0 var(--red);
  backdrop-filter: blur(6px); position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--pixel); font-size: 11px; color: var(--yellow); white-space: nowrap; }
.mini-ball { /* bandje */
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink); flex: none;
  background: radial-gradient(circle, #c9cee3 0 4px, var(--ink) 5px 6px, #3a3d47 7px);
  position: relative;
}
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: nowrap; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 10px; border-radius: 9px;
  background: var(--panel); border: 1px solid var(--line); font-size: 13px; position: relative;
}
.nav-btn:hover { border-color: var(--yellow); }
a.nav-btn { color: inherit; text-decoration: none; }
.nav-btn .ico { font-size: 14px; line-height: 1; }
.nav-user { font-family: var(--pixel); font-size: 10px; color: var(--muted); padding: 0 6px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-toggle { display: none; }
.badge {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--red); color: #fff; font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
}

.stage {
  flex: 1; display: grid; gap: 18px; padding: 18px; align-items: start;
  grid-template-columns: 250px minmax(0, 1fr) 320px; max-width: 1600px; width: 100%; margin: 0 auto;
}
.panel {
  background: linear-gradient(var(--panel), #121a3c); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: 0 10px 30px #0006;
}
.panel h2, .panel h3 { font-family: var(--pixel); font-weight: normal; margin: 0 0 14px; color: var(--yellow); font-size: 11px; letter-spacing: .08em; }
.panel h3 { margin-top: 18px; color: var(--muted); font-size: 9px; }


/* ---------- KartOnline: dashboard ---------- */
.stage { grid-template-columns: minmax(0, 1fr) 340px; max-width: 1100px; }
@media (max-width: 860px) { .stage { grid-template-columns: 1fr; padding: 12px; } }
.hero { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.hero .ball-emblem { position: static; margin: 0; animation: none; flex: none; }
.hero h1 { margin: 0; font-family: var(--pixel); font-weight: normal; font-size: 16px; color: var(--yellow); text-shadow: 3px 3px 0 var(--blue); }
.hero p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; font-size: 14px; counter-increment: s; }
.steps li::before { content: counter(s); display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--yellow); color: var(--ink); font-family: var(--pixel); font-size: 11px; box-shadow: 0 3px 0 var(--yellow-dark); }
.steps code, .mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: #0a0f26; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--line); font-size: 13px; }
.chip b { color: var(--yellow); font-weight: 600; }
.chip.on::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 8px var(--green); }
.chip.off::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); }
.rooms { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rooms li { background: #0a0f26; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.rooms .head { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.rooms .players { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.rooms .players span small { color: var(--muted); }
.empty { color: var(--muted); font-size: 14px; margin: 0; }
.radio-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.radio-grid label { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: #0a0f26; cursor: pointer; font-size: 14px; color: var(--text); text-transform: none; letter-spacing: 0; flex-direction: row; }
.radio-grid label:has(input:checked) { border-color: var(--yellow); box-shadow: 0 0 0 3px #fbd00030; }
.radio-grid input { accent-color: var(--yellow); width: 16px; height: 16px; margin: 0; }
.wizard-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.wizard-steps span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.wizard-steps span.done { background: var(--yellow); }
.footer { padding: 14px 18px; text-align: center; color: var(--muted); font-size: 12px; }
.footer a { color: var(--muted); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-family: var(--pixel); font-size: 9px; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--line); }
.table td { padding: 8px 10px; border-bottom: 1px solid #ffffff10; vertical-align: top; }
.table tr:hover td { background: #ffffff06; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table a { color: var(--text); text-decoration: none; border-bottom: 1px dotted var(--muted); }
.table a:hover { color: var(--yellow); }
.rank-1 td:first-child { color: var(--yellow); font-weight: 700; }
.rank-2 td:first-child { color: #d7dbe8; font-weight: 700; }
.rank-3 td:first-child { color: #d49a5a; font-weight: 700; }
