/* Gereedschapsroulette — oefenversie voor leerlingen (thuis).
   Zelfde eigen palet als de klasversie (index.html), geen --lk-* tokens. */
:root{
  --navy:#2F5E7C; --navy-d:#24485F; --orange:#F5883B; --orange-d:#C96C2C;
  --ink-dark:#253D41; --paper:#F4F1EA; --line:#DDE3E6; --muted:#8A9AA1;
  --green:#3E8E6E; --green-s:#E8F3EE; --red:#C6483C; --red-s:#FBEAE7; --gold:#E0A526;
}
*{box-sizing:border-box;margin:0;padding:0}
body{font-family:'Nunito Sans',system-ui,sans-serif; background:var(--paper);
     color:var(--ink-dark); min-height:100vh; display:flex; flex-direction:column}
h1,h2,h3,.ff{font-family:'Poppins',system-ui,sans-serif}
button{font:inherit}

header{background:var(--navy); color:#fff; padding:8px 14px;
       display:flex; align-items:center; gap:12px; flex:none; position:sticky; top:0; z-index:20}
header h1{font-size:16px; font-weight:600; letter-spacing:.3px; white-space:nowrap}
.tag{background:var(--orange); padding:3px 10px; border-radius:99px;
     font-size:12px; font-weight:700; letter-spacing:.6px}
.spacer{flex:1}
.iconbtn{background:rgba(255,255,255,.12); border:0; color:#fff; cursor:pointer;
  width:34px; height:34px; border-radius:9px; font-size:16px; display:grid; place-items:center}
.iconbtn:hover{background:rgba(255,255,255,.3)}

.wrap{flex:1; width:100%; max-width:1080px; margin:0 auto; padding:16px}
.screen{display:none}
.screen.is-active{display:block}

.panel{background:#fff; border:1px solid var(--line); border-radius:16px;
  box-shadow:0 4px 20px rgba(37,61,65,.07); padding:20px}
.startgrid{display:grid; grid-template-columns:1fr 320px; gap:16px; align-items:start}
.panel h2{font-size:24px; color:var(--navy); line-height:1.2; margin-bottom:8px}
.panel h3{font-size:13px; letter-spacing:1.4px; text-transform:uppercase; color:var(--muted); margin-bottom:10px}
.lead{font-size:16px; line-height:1.55; margin-bottom:16px}
.mini{font-size:13px; color:var(--muted); line-height:1.5}
.mini.up{text-transform:uppercase; letter-spacing:1.4px; font-family:'Poppins'; font-weight:600}
.center{text-align:center; margin-top:10px}

.rules{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-bottom:18px}
.rule{background:#F7F9FA; border:1px solid var(--line); border-radius:12px; padding:12px;
  display:flex; flex-direction:column; align-items:center; text-align:center; gap:2px}
.rule .ico{font-size:22px}
.rule b{font-family:'Poppins'; color:var(--navy)}
.rule span:last-child{font-size:13px; color:var(--muted)}

.fset{margin-bottom:18px}
.fset > label{font-family:'Poppins'; font-weight:600; font-size:12px; letter-spacing:1.4px;
  text-transform:uppercase; color:var(--muted); display:block; margin-bottom:8px}
.fset .mini{margin-top:8px}
.pills{display:flex; flex-wrap:wrap; gap:7px}
.pill{border:1.5px solid var(--line); background:#fff; border-radius:99px; padding:7px 13px;
  font-size:14px; font-weight:600; cursor:pointer; color:var(--ink-dark)}
.pill.on{background:var(--navy); border-color:var(--navy); color:#fff}

button.big{font-family:'Poppins'; font-weight:600; font-size:16px; cursor:pointer;
  border:0; border-radius:12px; padding:12px 26px; color:#fff; background:var(--navy);
  box-shadow:0 3px 0 var(--navy-d); transition:transform .08s, box-shadow .08s}
button.big:active{transform:translateY(2px); box-shadow:0 1px 0 var(--navy-d)}
button.big.o{background:var(--orange); box-shadow:0 3px 0 var(--orange-d)}
button.big.ghost{background:#fff; color:var(--navy); border:1.5px solid var(--line); box-shadow:0 3px 0 var(--line)}
button.big:disabled{opacity:.45; cursor:default; transform:none}
button.big.wide{width:100%; font-size:18px; padding:15px}

/* ===== hiscores ===== */
.hslist{list-style:none; counter-reset:r; display:flex; flex-direction:column; gap:4px}
.hslist li{counter-increment:r; display:grid; grid-template-columns:28px 1fr auto; gap:8px;
  align-items:center; padding:7px 8px; border-radius:9px; font-size:14.5px}
.hslist li::before{content:counter(r); font-family:'Poppins'; font-weight:700; color:var(--muted); text-align:center}
.hslist li:nth-child(1)::before{content:"🥇"} .hslist li:nth-child(2)::before{content:"🥈"} .hslist li:nth-child(3)::before{content:"🥉"}
.hslist li:nth-child(odd){background:#F7F9FA}
.hslist li.me{background:#FFF1E4; outline:2px solid var(--orange)}
.hslist .nm{font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap}
.hslist .nm small{display:block; font-weight:400; color:var(--muted); font-size:11.5px}
.hslist .pt{font-family:'Poppins'; font-weight:700; color:var(--navy)}
.hslist li.empty{display:block; color:var(--muted); background:none}
.hslist li.empty::before{content:none}

/* ===== spel ===== */
.hud{display:flex; align-items:center; gap:8px; margin-bottom:8px; flex-wrap:wrap}
.chip{font-family:'Poppins'; font-weight:600; font-size:14px; color:var(--navy);
  background:#fff; border:1px solid var(--line); padding:7px 13px; border-radius:11px; white-space:nowrap}
.chip.score{font-size:17px; min-width:70px; text-align:center}
.chip.bonus{color:var(--orange-d)}
.chip.bonus.gone{color:var(--muted)}
.chip.streak.hot{background:var(--orange); border-color:var(--orange); color:#fff; animation:pulse 1s ease-in-out infinite}
@keyframes pulse{50%{transform:scale(1.07)}}

.timebar{height:8px; background:#E4EAED; border-radius:99px; overflow:hidden; margin-bottom:12px}
.timebar i{display:block; height:100%; width:100%; background:var(--orange); border-radius:99px}
.timebar i.late{background:var(--red)}

.stage{background:#fff; border:1px solid var(--line); border-radius:16px; min-height:220px;
  box-shadow:0 4px 20px rgba(37,61,65,.07); padding:40px 18px 18px; position:relative;
  display:grid; place-items:center; text-align:center; margin-bottom:12px}
.stage .q{position:absolute; top:12px; left:0; right:0; font-family:'Poppins'; font-weight:600;
  color:var(--orange); text-transform:uppercase; letter-spacing:2px; font-size:12px}
.stage img{max-width:100%; height:min(34vh,300px); object-fit:contain}
.stage .woord{font-family:'Poppins'; font-weight:700; color:var(--navy);
  font-size:clamp(30px,7vw,64px); line-height:1.05; overflow-wrap:anywhere}
.stage .functie{font-weight:600; font-size:clamp(17px,2.6vw,24px); line-height:1.4; max-width:700px}

.opts{display:grid; grid-template-columns:1fr 1fr; gap:10px}
.opt{background:#fff; border:2px solid var(--line); border-radius:14px; cursor:pointer;
  padding:14px 12px 14px 44px; text-align:left; font-family:'Poppins'; font-weight:600;
  font-size:17px; color:var(--ink-dark); position:relative; min-height:62px;
  box-shadow:0 3px 0 var(--line); transition:border-color .12s, transform .08s}
.opt:hover:not(:disabled){border-color:var(--navy)}
.opt:active:not(:disabled){transform:translateY(2px)}
.opt .k{position:absolute; left:12px; top:50%; transform:translateY(-50%); width:22px; height:22px;
  border-radius:6px; background:#EEF2F4; color:var(--navy); font-size:12px; display:grid; place-items:center}
.opt.pic{padding:10px; text-align:center}
.opt.pic img{width:100%; height:min(18vh,150px); object-fit:contain; display:block}
.opt.pic .k{top:10px; transform:none}
.opt:disabled{cursor:default}
.opt.good{border-color:var(--green); background:var(--green-s); box-shadow:0 3px 0 var(--green)}
.opt.bad{border-color:var(--red); background:var(--red-s); box-shadow:0 3px 0 var(--red); animation:shake .35s}
.opt.dim{opacity:.45}
@keyframes shake{25%{transform:translateX(-6px)}75%{transform:translateX(6px)}}

.feedback{margin-top:12px; background:#fff; border:1px solid var(--line); border-left:5px solid var(--red);
  border-radius:14px; padding:14px 16px; display:grid; grid-template-columns:110px 1fr; gap:14px; align-items:center}
.feedback[hidden]{display:none}
.feedback img{width:110px; height:90px; object-fit:contain}
.feedback .t{font-family:'Poppins'; font-weight:700; color:var(--red); font-size:13px;
  letter-spacing:1.2px; text-transform:uppercase}
.feedback .nm{font-family:'Poppins'; font-weight:700; color:var(--navy); font-size:20px; margin:2px 0 4px}
.feedback p{font-size:15px; line-height:1.45}
.feedback p.vg{color:var(--red); margin-top:4px}
.feedback .next{grid-column:1/-1; justify-self:end}

.pop{position:fixed; left:50%; top:40%; transform:translate(-50%,-50%); pointer-events:none;
  font-family:'Poppins'; font-weight:700; font-size:34px; color:var(--green); opacity:0;
  text-shadow:0 2px 0 #fff; text-align:center; z-index:30; white-space:nowrap}
.pop small{display:block; font-size:18px; color:var(--orange-d)}
.pop.show{animation:pop .9s ease-out}
@keyframes pop{0%{opacity:0; transform:translate(-50%,-30%) scale(.7)}
  20%{opacity:1; transform:translate(-50%,-50%) scale(1.08)}
  70%{opacity:1} 100%{opacity:0; transform:translate(-50%,-90%)}}

/* ===== einde ===== */
.result{text-align:center; margin-bottom:18px}
.bigscore{font-family:'Poppins'; font-weight:700; font-size:64px; color:var(--navy); line-height:1.1}
.record{display:inline-block; background:#FFF6DC; color:#8A6200; border:1px solid var(--gold);
  border-radius:99px; padding:4px 14px; font-weight:700; margin:4px 0 8px}
.record[hidden]{display:none}
.stats{display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:12px}
.stats div{background:#F7F9FA; border-radius:12px; padding:10px; display:flex; flex-direction:column}
.stats b{font-family:'Poppins'; font-size:22px; color:var(--navy)}
.stats span{font-size:12.5px; color:var(--muted)}

.nameform{border-top:1px solid var(--line); padding-top:16px; margin-bottom:8px}
.nameform[hidden]{display:none}
.nameform label{font-family:'Poppins'; font-weight:600; color:var(--navy); display:block; margin-bottom:8px}
.namerow{display:flex; gap:8px; margin-bottom:6px}
.namerow input{flex:1; min-width:0; border:1.5px solid var(--line); border-radius:12px; padding:10px 12px;
  font-size:17px; font-family:'Poppins'; font-weight:600; color:var(--ink-dark)}
.namerow input:focus{outline:none; border-color:var(--navy)}
.namerow input.err{border-color:var(--red)}
.msg{font-size:14px; font-weight:700; min-height:1.2em}
.msg.err{color:var(--red)} .msg.ok{color:var(--green)}
.endbtns{display:flex; gap:10px; flex-wrap:wrap; justify-content:center; margin-top:14px}

.review{margin-top:16px}
.revgrid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px}
.rev{border:1px solid var(--line); border-radius:12px; padding:12px; font-size:14px; line-height:1.45}
.rev img{width:100%; height:110px; object-fit:contain; margin-bottom:6px}
.rev .nm{font-family:'Poppins'; font-weight:700; color:var(--navy); font-size:16px}
.rev .vg{color:var(--red); margin-top:4px}

.err-box{color:var(--red); text-align:center; padding:30px}

@media (max-width:820px){
  .startgrid{grid-template-columns:1fr}
}
@media (max-width:520px){
  .wrap{padding:10px}
  .panel{padding:16px}
  .rules{grid-template-columns:1fr; gap:6px}
  .rule{flex-direction:row; justify-content:flex-start; gap:10px; padding:8px 12px}
  .opt{font-size:15px; padding-left:40px}
  .stage{min-height:180px}
  .feedback{grid-template-columns:1fr}
  .feedback img{justify-self:center}
  .bigscore{font-size:52px}
  header h1{font-size:13px}
}
