[hidden]{display:none!important}
:root{
  box-sizing:border-box;
  padding-top:env(safe-area-inset-top,0px);
  padding-bottom:env(safe-area-inset-bottom,0px);
  /* Layout: een beige kantoormonitor op een winterse ondergrond, spel in het midden, besturing eronder. */
  --bg:#dfe3ea; --ink:#2a2833; --muted:#5e5a68; --link:#a8261f;
  --case:#d9d0b3; --case-hi:#ece5cd; --case-shade:#aea385;
  --bezel:#1f1d26; --led:#3ddc6a; --key-ink:#2a2833;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --bg:#141a2e; --ink:#e7e2d4; --muted:#9b97ab; --link:#ff7a6a;
    --case:#cfc6a8; --case-hi:#e2dac0; --case-shade:#9e9476; --bezel:#0e0d14;
    color-scheme:dark;
  }
}
:root[data-theme="dark"]{
  --bg:#141a2e; --ink:#e7e2d4; --muted:#9b97ab; --link:#ff7a6a;
  --case:#cfc6a8; --case-hi:#e2dac0; --case-shade:#9e9476; --bezel:#0e0d14;
  color-scheme:dark;
}
html{height:100%}
*,*::before,*::after{box-sizing:inherit}
body{
  margin:0;min-height:100%;background:var(--bg);color:var(--ink);
  font-family:"VT323",ui-monospace,"Courier New",monospace;font-size:21px;line-height:1.2;
  display:flex;justify-content:center;-webkit-tap-highlight-color:transparent;
}
main{
  width:100%;
  max-width:max(300px, min(980px, calc((100vh - 230px) * 1.3333 + 56px)));
  max-width:max(300px, min(980px, calc((100dvh - 230px) * 1.3333 + 56px)));
  padding-block:16px 20px;
  padding-left:max(16px,env(safe-area-inset-left,0px));
  padding-right:max(16px,env(safe-area-inset-right,0px));
  display:flex;flex-direction:column;align-items:center;gap:16px;
}
.monitor{
  width:100%;background:var(--case);border-radius:14px 14px 10px 10px;padding:18px 18px 8px;
  box-shadow:inset 0 2px 0 var(--case-hi), inset 0 -4px 0 var(--case-shade), 0 8px 0 -2px var(--case-shade);
}
.screen{background:var(--bezel);border-radius:10px;padding:10px;position:relative}
.screen::after{
  content:"";position:absolute;inset:10px;border-radius:4px;pointer-events:none;
  background:repeating-linear-gradient(to bottom, rgba(0,0,0,0) 0, rgba(0,0,0,0) 2px, rgba(0,0,0,.13) 3px);
  box-shadow:inset 0 0 40px rgba(0,0,0,.45);
}
canvas{
  display:block;width:100%;height:auto;aspect-ratio:auto;border-radius:4px;
  image-rendering:crisp-edges;image-rendering:pixelated;touch-action:none;
}
.chin{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 4px 0;color:#6d6550}
.badge{font-size:19px;letter-spacing:.04em}
.chin-right{display:flex;align-items:center;gap:10px;margin-left:auto}
.led{width:12px;height:6px;border-radius:2px;background:#e2483d;box-shadow:0 0 6px #e2483d;animation:xmas 1.2s steps(1) infinite}
@keyframes xmas{50%{background:var(--led);box-shadow:0 0 6px var(--led)}}
.key{
  appearance:none;border:0;background:var(--case);color:var(--key-ink);border-radius:8px;cursor:pointer;
  font:inherit;touch-action:manipulation;-webkit-user-select:none;user-select:none;
  box-shadow:inset 0 2px 0 var(--case-hi), 0 5px 0 var(--case-shade);
}
.key:active,.key.on{transform:translateY(3px);box-shadow:inset 0 2px 0 var(--case-hi), 0 2px 0 var(--case-shade)}
.key:focus-visible{outline:3px solid #3a6ad0;outline-offset:3px}
.small{padding:2px 10px 4px;font-size:19px;box-shadow:inset 0 2px 0 var(--case-hi), 0 3px 0 var(--case-shade)}
.small:active{transform:translateY(2px);box-shadow:inset 0 2px 0 var(--case-hi), 0 1px 0 var(--case-shade)}
.controls{display:none;width:100%;gap:14px}
.arrow{flex:1;height:78px;display:grid;place-items:center}
.arrow svg{width:30px;height:30px;fill:currentColor}
.help{margin:0;color:var(--muted);text-align:center;max-width:64ch}
.help kbd{font:inherit;background:var(--case);color:var(--key-ink);border-radius:4px;padding:0 6px;box-shadow:0 2px 0 var(--case-shade)}
.mid{flex:0 0 auto;width:clamp(76px,22vw,120px);height:auto;font-size:22px;text-transform:uppercase;letter-spacing:.04em}
/* Mobile: one full screen, game on top, controls at the bottom */
html.mobile,html.mobile body{height:100%;overflow:hidden;overscroll-behavior:none}
html.mobile body{display:block;background:var(--bezel);-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
html.mobile main{max-width:none;height:100%;padding-block:0;gap:0;align-items:stretch}
html.mobile .monitor{flex:1;min-height:0;display:flex;flex-direction:column;background:transparent;box-shadow:none;border-radius:0;padding:8px 0 0}
html.mobile .screen{flex:1;min-height:0;padding:0;background:transparent;border-radius:0;container-type:size;display:grid;place-items:center}
html.mobile .screen::after{display:none}
html.mobile canvas{width:min(100cqw, calc(100cqh * var(--ar, 1.33333)));border-radius:2px}
html.mobile .chin{padding:8px 0 4px;color:#9b97ab}
html.mobile .chin-right{width:100%;gap:6px;flex-wrap:wrap}
html.mobile .chin .small{flex:1 1 auto;white-space:nowrap;font-size:17px;padding:2px 6px 4px}
@media (orientation:portrait){
  html.mobile main .controls .arrow{height:clamp(68px,12vh,110px)}
}
html.mobile .badge,html.mobile .led,html.mobile .help{display:none}
html.mobile .chin-right{margin:0 auto}
html.mobile .controls{display:flex;padding:8px 0 12px;gap:10px}
html.mobile .arrow{height:clamp(68px,15vh,112px)}
@media (orientation:landscape){html.mobile .arrow{height:clamp(52px,16vh,72px)}html.mobile .monitor{padding-top:4px}html.mobile .chin{padding:4px 0 2px}html.mobile .controls{padding:4px 0 6px}}
html:not(.mobile) .controls{display:none}
@media (max-width:520px){
  .monitor{padding:8px 8px 6px;border-radius:10px}
  .screen{padding:5px;border-radius:7px}
  .screen::after{inset:5px}
  .badge{display:none}
}
@media (prefers-reduced-motion:reduce){.led{animation:none}}

/* ---------- wedstrijdformulier, over het speelveld ---------- */
.signup{
  position:absolute;inset:10px;z-index:2;overflow:auto;-webkit-overflow-scrolling:touch;
  background:rgba(16,14,40,.95);color:#f4efe4;border-radius:4px;
  padding:clamp(12px,3vw,26px);display:flex;flex-direction:column;gap:10px;
  font-family:"VT323",ui-monospace,"Courier New",monospace;font-size:20px;line-height:1.15;
  -webkit-user-select:text;user-select:text;
}
.signup h1{margin:0;font-family:"Press Start 2P",ui-monospace,monospace;font-size:clamp(14px,3vw,22px);color:#fff27a;text-shadow:2px 2px 0 #c02030;text-align:center;line-height:1.3}
.signup .intro{margin:0;color:#c8cbe0;text-align:center}
.signup label{display:flex;flex-direction:column;gap:3px;color:#9ab0d0;min-width:0}
.signup input:not([type=checkbox]){
  font:inherit;font-size:20px;color:#14122a;background:#f4f0e6;border:2px solid #5a6382;border-radius:4px;padding:4px 8px;width:100%;
}
.signup input:focus-visible{outline:3px solid #fff27a;outline-offset:1px}
.signup .grid2{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.signup .check{flex-direction:row;align-items:flex-start;gap:10px;color:#e7e2d4}
.signup .check input{width:22px;height:22px;margin:0;flex:none;accent-color:#e2483d}
.signup a{color:#fff27a}
.signup .hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}
.signup .err{margin:0;color:#ff8a8a}
.signup .go{align-self:center;padding:8px 22px 10px;font-size:24px}
.signup .go[disabled]{opacity:.6;cursor:wait}
html.mobile .signup{inset:0}
@media (max-width:420px){.signup .grid2{grid-template-columns:1fr}}

/* ---------- deelpaneel ---------- */
.share #share-img{width:100%;height:auto;max-width:560px;align-self:center;border:2px solid #5a6382;border-radius:4px;image-rendering:pixelated;background:#141a2e}
.share-buttons{display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.sbtn{padding:6px 12px 8px;font-size:20px;text-decoration:none;display:inline-block}
.share-text{margin:0;color:#c8cbe0;font-size:18px;text-align:center}
.share-status{margin:0;text-align:center;color:#7ee07a;min-height:1.2em}
.share-status.err{color:#ff8a8a}
.share .sbtn,.share .sbtn:visited{color:var(--key-ink)}
.chin .small,.badge{white-space:nowrap}
.chin-right{flex-wrap:wrap;justify-content:flex-end}
.mid{font-size:clamp(15px,4.4vw,22px);letter-spacing:0}
