:root { color-scheme:light; --paper:#fff; --ink:#000; --font:Consolas,"Courier New",Courier,monospace; }
:root[data-theme="dark"] { color-scheme:dark; --paper:#000; --ink:#fff; }
* { box-sizing:border-box; }
body { margin:0; background:var(--paper); color:var(--ink); font:normal .8125rem/1.5 var(--font); letter-spacing:.025em; }
header,main { width:100%; max-width:1140px; margin:auto; padding:8px 15px; }
header { display:flex; align-items:center; gap:1rem; min-height:51px; }
h1 { display:table; margin:0; font:inherit; background:var(--ink); color:var(--paper); }
a { color:inherit; text-decoration:none; }
.home { background:var(--ink); color:var(--paper); }
.home:hover { background:var(--paper); color:var(--ink); }
.controls { margin-left:auto; display:flex; align-items:center; gap:5px; }
button,.button { display:inline-grid; place-items:center; min-height:35px; border:1px solid var(--ink); border-radius:0; background:var(--paper); color:var(--ink); font:inherit; letter-spacing:inherit; padding:.35rem .65rem; cursor:pointer; }
button:hover,.choice:hover .button { background:var(--ink); color:var(--paper); }
:focus-visible { outline:2px solid var(--ink); outline-offset:5px; }
.theme-toggle { position:relative; flex:0 0 35px; width:35px; padding:0; }
.theme-toggle::before { content:""; width:14px; height:21px; border:1px solid currentColor; }
.theme-toggle::after { content:""; position:absolute; width:9px; height:8px; background:currentColor; transform:translateY(-4px); }
.theme-toggle[aria-pressed="true"]::after { transform:translateY(4px); }
main { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:32px; min-height:calc(100svh - 51px); align-content:center; padding-bottom:7svh; }
.choice { display:flex; min-width:0; flex-direction:column; align-items:center; gap:20px; }
canvas { display:block; width:100%; height:clamp(220px,58svh,500px); pointer-events:none; }
.button { min-width:90px; }
@media(max-width:520px) {
  header { gap:10px; }
  main { gap:12px; padding-left:8px; padding-right:8px; }
  .choice { gap:12px; }
  .button { min-width:75px; }
  canvas { height:clamp(200px,49svh,370px); }
}
