/* Crash Cart — Kahoot! meets Mario Kart. Single dark game theme. */
:root {
  --bg1: #1d0b45; --bg2: #3a0f7a; --ink: #fff; --muted: #c9b8f2; --card: rgba(255,255,255,.08); --line: rgba(255,255,255,.16);
  --yellow: #ffd23f; --pink: #ff3d7f; --cyan: #22c7ff; --green: #2fd67b; --red: #ff4b5c; --orange: #ff8a1f;
  --a0: #7b4dff; --a1: #0fb5d6; --a2: #ff8a1f; --a3: #ff3d7f;
  --r: 18px; --shadow: 0 6px 0 rgba(0,0,0,.35);
  --display: 'Fredoka', 'Nunito', system-ui, sans-serif; --body: 'Nunito', system-ui, -apple-system, Segoe UI, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 500 16px/1.5 var(--body);
  background: radial-gradient(1200px 600px at 80% -10%, #6a1fd1 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #b3127a 0%, transparent 55%),
              linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
}
[hidden] { display: none !important; }
a { color: var(--yellow); }
button, input, select, textarea { font: inherit; color: inherit; }
.checker { height: 10px; background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 20px 20px; opacity: .9; }

/* header */
.top { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px; max-width: 1100px; margin: 0 auto; position: relative; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font: 700 22px/1 var(--display); letter-spacing: .5px; }
.logo b { color: var(--yellow); font-weight: 700; }
.topnav { display: flex; align-items: center; gap: 6px; }
.navlink { color: #fff; text-decoration: none; font-weight: 800; padding: 6px 10px; border-radius: 99px; background: var(--card); }
.iconbtn { background: var(--card); border: 0; border-radius: 99px; width: 38px; height: 38px; cursor: pointer; font-size: 17px; }
.langsw { display: flex; background: var(--card); border-radius: 99px; padding: 3px; }
.langsw button { border: 0; background: none; padding: 4px 9px; border-radius: 99px; font-weight: 800; cursor: pointer; color: var(--muted); }
.langsw button.on { background: var(--yellow); color: #2a1060; }
.menu { position: absolute; right: 16px; top: 56px; background: #2a1060; border: 1px solid var(--line); border-radius: 14px; padding: 6px; z-index: 30; min-width: 180px; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border-radius: 10px; color: #fff; text-decoration: none; background: none; border: 0; cursor: pointer; font-weight: 700; }
.menu a:hover, .menu button:hover { background: var(--card); }

main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 48px; }
.view { animation: pop .25s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* type */
h1, h2, h3, h4 { font-family: var(--display); font-weight: 600; margin: .3em 0 .4em; }
.title { font: 700 clamp(46px, 11vw, 92px)/.95 var(--display); margin: 8px 0; letter-spacing: 1px; text-shadow: 0 6px 0 rgba(0,0,0,.35); }
.title span { color: var(--yellow); }
.title.small { font-size: clamp(32px, 7vw, 48px); }
.tagline { font: 600 clamp(20px, 4vw, 26px)/1.2 var(--display); color: var(--cyan); margin: 0 0 8px; }
.sub { color: var(--muted); max-width: 560px; margin: 0 auto; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.lead { font-size: 18px; font-weight: 700; }

/* cards & buttons */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin: 14px 0; backdrop-filter: blur(6px); }
.card.narrow, .authcard { max-width: 460px; margin-left: auto; margin-right: auto; }
.btn { display: inline-block; border: 0; border-radius: 14px; padding: 11px 18px; font-weight: 800; cursor: pointer; text-decoration: none;
  background: #fff; color: #2a1060; box-shadow: var(--shadow); transition: transform .08s; }
.btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.btn.yellow { background: var(--yellow); }
.btn.big { font: 700 20px/1 var(--display); padding: 15px 24px; width: 100%; }
.linkbtn { background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; }
.linkbtn.danger { color: #ff9aa5; margin-top: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.row.center { justify-content: center; }

/* auth */
.hero { text-align: center; padding: 10px 0 4px; }
.lights { display: inline-flex; gap: 10px; background: #111; padding: 8px 12px; border-radius: 99px; border: 3px solid #333; }
.lights i { width: 18px; height: 18px; border-radius: 50%; background: #3a1414; }
.lights i.go { background: #123a1f; }
.hero .lights i { animation: lamp 2.4s infinite; }
.hero .lights i:nth-child(2) { animation-delay: .3s; } .hero .lights i:nth-child(3) { animation-delay: .6s; }
.hero .lights i.go { animation: lampgo 2.4s infinite; }
@keyframes lamp { 0%, 10% { background: #3a1414; } 15%, 70% { background: var(--red); box-shadow: 0 0 14px var(--red); } 75%, 100% { background: #3a1414; } }
@keyframes lampgo { 0%, 70% { background: #123a1f; } 75%, 95% { background: var(--green); box-shadow: 0 0 14px var(--green); } 100% { background: #123a1f; } }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
.or { text-align: center; color: var(--muted); margin: 14px 0; font-size: 14px; position: relative; }
.or::before, .or::after { content: ''; position: absolute; top: 50%; width: 28%; height: 1px; background: var(--line); }
.or::before { left: 0; } .or::after { right: 0; }
.tabs { display: flex; gap: 6px; background: rgba(0,0,0,.25); padding: 4px; border-radius: 14px; margin-bottom: 12px; overflow-x: auto; }
.tab { flex: 1; border: 0; background: none; padding: 9px 10px; border-radius: 10px; font-weight: 800; cursor: pointer; color: var(--muted); white-space: nowrap; }
.tab.active { background: #fff; color: #2a1060; }
.form label { display: block; margin: 10px 0; }
.form label > span { display: block; font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.form input, .form select, .form textarea, .dlg textarea, .filters select, .sharerow input {
  width: 100%; padding: 11px 12px; border-radius: 12px; border: 2px solid transparent; background: rgba(255,255,255,.95); color: #1d0b45; font-weight: 700; }
.form input:focus, .form select:focus { outline: none; border-color: var(--yellow); }
.err { background: rgba(255,75,92,.18); border: 1px solid var(--red); padding: 8px 12px; border-radius: 10px; font-weight: 700; }

/* home */
.hello { font-size: clamp(22px, 5vw, 32px); }
.startgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.startbtn { border: 0; border-radius: 22px; padding: 26px 18px; cursor: pointer; text-align: left; color: #fff; box-shadow: 0 8px 0 rgba(0,0,0,.35);
  transition: transform .08s; position: relative; overflow: hidden; min-height: 130px; }
.startbtn:active { transform: translateY(6px); box-shadow: 0 2px 0 rgba(0,0,0,.35); }
.startbtn b { display: block; font: 700 clamp(26px, 5vw, 40px)/1 var(--display); }
.startbtn small { display: block; margin-top: 8px; font-weight: 800; opacity: .9; }
.startbtn::after { content: ''; position: absolute; right: -20px; bottom: -20px; width: 120px; height: 120px; border-radius: 50%; background: rgba(255,255,255,.15); }
.startbtn.cyan { background: linear-gradient(135deg, #12a5e0, #1f6fe5); }
.startbtn.pink { background: linear-gradient(135deg, #ff3d7f, #ff8a1f); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px; text-align: center; }
.stat b { display: block; font: 700 26px/1.1 var(--display); color: var(--yellow); }
.stat span { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.famebar { height: 14px; border-radius: 99px; background: rgba(0,0,0,.3); overflow: hidden; }
.famebar i { display: block; height: 100%; background: linear-gradient(90deg, var(--yellow), var(--orange)); border-radius: 99px; transition: width .6s; }
.fame p { margin: 8px 0 0; font-weight: 700; }
.runs { list-style: none; margin: 0; padding: 0; }
.runs li { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ainote { margin-top: 20px; }

/* play */
.hud { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 4px 0 10px; }
.laps { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; max-width: 260px; } /* 10 pills always on one line: they shrink */
.laps i { flex: 1 1 0; min-width: 6px; max-width: 22px; height: 10px; border-radius: 99px; background: rgba(255,255,255,.18); }
.hudright { flex: 0 0 auto; }
.laps i.now { background: #fff; animation: blink 1s infinite; }
.laps i.ok { background: var(--green); } .laps i.bad { background: var(--red); } .laps i.done { background: var(--muted); }
@keyframes blink { 50% { opacity: .4; } }
.lapcount { font-weight: 800; color: var(--muted); }
.hudright { display: flex; align-items: center; gap: 10px; }
.flame { background: var(--card); border-radius: 99px; padding: 5px 12px; font-weight: 800; white-space: nowrap; }
.flame small { color: var(--yellow); }
.flame.hot { background: linear-gradient(90deg, #ff5a1f, #ffb21f); color: #2a1060; animation: wobble .8s infinite; }
.flame.hot small { color: #2a1060; }
@keyframes wobble { 50% { transform: scale(1.06); } }
.hudscore { background: #fff; color: #2a1060; border-radius: 12px; padding: 4px 14px; font: 700 22px/1.2 var(--display); min-width: 80px; text-align: center; }
.qcard { background: #fff; color: #1d0b45; border-radius: 22px; padding: 18px 20px 14px; box-shadow: 0 8px 0 rgba(0,0,0,.3); }
.qmeta { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; font-size: 12px; font-weight: 800; color: #6b5a99; text-transform: uppercase; letter-spacing: .4px; }
.qsrc { margin-left: auto; text-transform: none; font-weight: 700; }
.cc { color: #fff; border-radius: 99px; padding: 2px 9px; }
.cc.c50 { background: #17a35a; } .cc.c100 { background: #0f7fd6; } .cc.c150 { background: #e8364f; }
.stem { font: 600 clamp(19px, 3.2vw, 26px)/1.35 var(--display); margin: 10px 0 14px; }
.speedo { position: relative; height: 18px; border-radius: 99px; background: #ece6fb; overflow: visible; }
.speedo .fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), var(--yellow)); transition: width .1s linear; }
.speedo.low .fill { background: linear-gradient(90deg, var(--red), var(--orange)); }
.speedo .bonus { position: absolute; right: 8px; top: -1px; font: 700 13px/18px var(--display); color: #2a1060; }
.ghostmark { position: absolute; top: -9px; font-size: 22px; transform: translateX(-50%); filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
/* Answer "race cards": light card, letter in a coloured item block, chequered edge on hover. */
.ans { position: relative; display: flex; align-items: center; gap: 14px; border: 3px solid transparent; border-radius: 18px; padding: 14px 16px 14px 14px;
  min-height: 80px; cursor: pointer; text-align: left; color: #1d0b45; background: #f6f3ff; overflow: hidden;
  font: 700 clamp(16px, 2.2vw, 19px)/1.3 var(--body); box-shadow: 0 5px 0 rgba(0,0,0,.28); transition: transform .08s, opacity .2s, border-color .15s, background .15s; }
.ans::before { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 14px; opacity: 0; transition: opacity .15s;
  background: repeating-conic-gradient(#1d0b45 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.ans i { font: 700 20px/1 var(--display); font-style: normal; flex: none; width: 42px; height: 42px; display: grid; place-items: center; color: #fff;
  border-radius: 12px; transform: rotate(-4deg); box-shadow: inset 0 -4px 0 rgba(0,0,0,.2), 0 2px 0 rgba(0,0,0,.15); }
.ans.a0 i { background: var(--a0); } .ans.a1 i { background: var(--a1); } .ans.a2 i { background: var(--a2); } .ans.a3 i { background: var(--a3); }
.ans:not(:disabled):hover { border-color: var(--yellow); transform: translateY(-2px); background: #fff; }
.ans:not(:disabled):hover::before { opacity: 1; }
.ans:not(:disabled):hover i { transform: rotate(4deg) scale(1.06); }
.ans:not(:disabled):active { transform: translateY(4px); box-shadow: 0 1px 0 rgba(0,0,0,.28); }
.ans:disabled { cursor: default; }
.ans.picked { border-color: #fff; }
.ans.dim { opacity: .4; }
.ans.wrong { background: #ffe3e7; border-color: var(--red); }
.ans.wrong::after { content: '✘'; margin-left: auto; font-size: 24px; color: var(--red); }
.ans.right { background: #dcfbe9; border-color: var(--green); animation: bounce .45s; }
.ans.right::after { content: '✔'; margin-left: auto; font-size: 24px; color: #12a454; }
.ans.right::before { opacity: 1; }
@keyframes bounce { 40% { transform: scale(1.03); } }
.sh.a0 { background: var(--a0); } .sh.a1 { background: var(--a1); } .sh.a2 { background: var(--a2); } .sh.a3 { background: var(--a3); }
/* Two-option questions (Ja/Nee, Meer/Minder): two big cards side by side, also on mobile. */
.answers.binary { grid-template-columns: 1fr 1fr; }
.answers.binary .ans { min-height: 120px; justify-content: center; flex-direction: column; text-align: center; gap: 10px; font: 700 clamp(22px, 4vw, 30px)/1.1 var(--display); }
.answers.binary .ans::after { margin-left: 0; }
.keyhint { margin-top: 12px; }

/* pit stop */
.pit { margin-top: 18px; background: #fff; color: #1d0b45; border-radius: 22px; padding: 18px 20px; box-shadow: 0 8px 0 rgba(0,0,0,.3); animation: pop .3s; scroll-margin-top: 10px; }
.pitbanner { display: flex; justify-content: space-between; align-items: center; border-radius: 14px; padding: 10px 16px; color: #fff; margin: -4px -6px 10px; }
.pit.good .pitbanner { background: linear-gradient(90deg, var(--a3), #34c26a); }
.pit.badr .pitbanner { background: linear-gradient(90deg, var(--a0), #ff6a4c); }
.pitbanner b { font: 700 26px/1 var(--display); }
.pitbanner span { font: 700 30px/1 var(--display); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips span { background: #efe9fd; border-radius: 99px; padding: 3px 10px; font-weight: 800; font-size: 13px; }
.ghostres { font-weight: 800; background: #f1edfb; padding: 8px 12px; border-radius: 12px; }
.pit h4 { margin-top: 14px; }
.pit details { margin: 10px 0; }
.pit summary { font-weight: 800; cursor: pointer; }
.pit ul { padding-left: 4px; list-style: none; }
.pit li { margin: 6px 0; display: flex; gap: 8px; }
.sh { font-style: normal; color: #fff; border-radius: 6px; width: 22px; height: 22px; flex: none; display: inline-grid; place-items: center; font: 700 12px var(--display); }
.pit blockquote { margin: 12px 0; padding: 10px 14px; border-left: 5px solid var(--a1); background: #f4f1fc; border-radius: 0 12px 12px 0; font-style: italic; }
.pit blockquote .orig { display: block; margin-top: 6px; font-size: 12px; font-style: normal; color: #6b5a99; }
.srcline { font-size: 14px; }
.pit a { color: var(--a1); font-weight: 800; }
.pitbtns { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.pitbtns .btn.big { width: auto; min-width: 200px; }
.pit .linkbtn { color: #7a68a8; }

/* summary */
.bigscore { font: 700 clamp(56px, 14vw, 104px)/1 var(--display); color: var(--yellow); text-shadow: 0 6px 0 rgba(0,0,0,.35); }
.bigscore.ghosty { color: #e9e2ff; }
.lapbars { display: flex; align-items: flex-end; justify-content: center; gap: 6px; height: 110px; margin: 16px 0 6px; }
.lb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; width: 30px; }
.lb i { width: 100%; border-radius: 8px 8px 3px 3px; }
.lb.ok i { background: var(--green); } .lb.bad i { background: var(--red); }
.lb small { font-size: 10px; color: var(--muted); }
.sharerow { display: flex; gap: 8px; }
.sharerow input { flex: 1; min-width: 0; }

/* boards */
.boardtabs { max-width: 640px; margin: 4px auto 12px; }
.filters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; }
.filters select { width: auto; max-width: 100%; }
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 10px; margin: 20px 0 10px; min-height: 40px; }
.pod { text-align: center; width: 31%; max-width: 180px; }
.pod .medal { font-size: 30px; display: block; }
.pod .nm { display: block; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod .sc { display: block; font: 700 18px var(--display); color: var(--yellow); }
.pod .block { margin-top: 6px; border-radius: 12px 12px 0 0; font: 700 34px/1 var(--display); padding-top: 12px; color: rgba(255,255,255,.9); box-shadow: inset 0 -8px 0 rgba(0,0,0,.2); }
.pod.p1 .block { height: 120px; background: linear-gradient(#ffd23f, #e9a100); color: #6b4a00; }
.pod.p2 .block { height: 90px; background: linear-gradient(#dfe4f0, #a8b0c4); color: #4a5165; }
.pod.p3 .block { height: 66px; background: linear-gradient(#f0a46a, #c46a2b); color: #5c2c08; }
.pod.me .nm { color: var(--cyan); }
.board { list-style: none; padding: 0; margin: 0 auto; max-width: 720px; }
.board li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; margin: 6px 0; }
.board li.me { background: rgba(34,199,255,.2); border-color: var(--cyan); }
.board li.empty { justify-content: center; color: var(--muted); }
.board .rk { font: 700 18px var(--display); width: 30px; text-align: center; color: var(--muted); }
.board .who { flex: 1; min-width: 0; }
.board .nm { display: block; font-weight: 800; }
.board small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board b { font: 700 18px var(--display); color: var(--yellow); }
#board-note { text-align: center; margin-top: 10px; }

/* countdown, toast, dialog */
.countdown { position: fixed; inset: 0; background: rgba(13,4,34,.85); display: grid; place-items: center; z-index: 50; text-align: center; }
.countdown .lights.big i { width: 46px; height: 46px; }
.countdown .lights i.on { background: var(--red); box-shadow: 0 0 24px var(--red); }
.countdown .lights i.go.on { background: var(--green); box-shadow: 0 0 30px var(--green); }
.countdown b { display: block; font: 700 96px/1 var(--display); margin-top: 20px; animation: pop .3s; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: #fff; color: #1d0b45; font-weight: 800; padding: 12px 18px;
  border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.4); z-index: 60; max-width: calc(100% - 32px); }
.dlg { border: 0; border-radius: 20px; padding: 20px; max-width: 460px; width: calc(100% - 32px); color: #1d0b45; }
.dlg::backdrop { background: rgba(13,4,34,.7); }
.dlg label { display: block; margin: 8px 0; font-weight: 700; }
.dlg textarea { border: 2px solid #ddd; }
.radio { display: flex !important; gap: 8px; align-items: center; }
.prose h3 { margin-top: 1.2em; color: var(--yellow); }
.prose li { margin: 4px 0; }

@media (max-width: 640px) {
  .top { padding: 8px 12px; }
  .logo span { font-size: 19px; }
  .navlink { display: none; }
  .startgrid { grid-template-columns: 1fr; }
  .startbtn { min-height: 96px; padding: 20px 18px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .answers { grid-template-columns: 1fr; gap: 9px; }
  .ans { min-height: 60px; padding: 10px 12px; }
  .ans i { width: 36px; height: 36px; font-size: 18px; }
  .qcard, .pit { padding: 14px; border-radius: 18px; }
  .pitbtns { flex-direction: column-reverse; align-items: stretch; }
  .pitbtns .btn.big { width: 100%; }
  .keyhint { display: none; }
  .laps i { width: 16px; height: 8px; }
  .hudscore { min-width: 64px; font-size: 19px; }
  .qsrc { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.form .specs { border: 0; padding: 0; margin: 10px 0; }
.form .specs legend { font-size: 13px; font-weight: 800; color: var(--muted); margin-bottom: 4px; }
.specbox { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 2px 12px; }
.specbox .chk { display: flex; gap: 8px; align-items: center; margin: 3px 0; font-size: 14px; }
.specbox input { width: auto; }
/* University / hospital search suggestions */
.form label.org { position: relative; }
.orgsug { position: absolute; left: 0; right: 0; z-index: 20; max-height: 260px; overflow-y: auto; background: #fff; color: #1d0b45;
  border-radius: 12px; margin-top: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.35); padding: 4px; }
.orgsug .orgopt { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px;
  font: inherit; font-weight: 700; color: inherit; cursor: pointer; }
.orgsug .orgopt:hover, .orgsug .orgopt:focus { background: #f1ecff; }
.orgsug p { margin: 6px 10px; color: #6b5a99; }
.orghint { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.betanote { max-width: 560px; margin: 0 auto 14px; padding: 10px 14px; border-radius: 14px; background: rgba(255,210,63,.14);
  border: 1px solid rgba(255,210,63,.45); color: #fff; font-size: 14px; line-height: 1.45; text-align: center; }
.pitcheck { color: #6b5a99; font-size: 12px; }
.termsrow a { color: inherit; text-decoration: underline; }
