@font-face { font-family: "Kenney Mini"; src: url("assets/kenney-fonts/kenney-mini.ttf") format("truetype"); font-display: swap; }
@font-face { font-family: "Kenney Pixel"; src: url("assets/kenney-fonts/kenney-pixel.ttf") format("truetype"); font-display: swap; }

:root {
  --bg: #fbfaf6; --ink: #1d2030; --muted: #5c6178; --card: #ffffff; --line: #e3e1d8;
  --off: #8a8fa6; --on: #2f9e5b; --accent: #f2b33d; --frame: #20243a;
  --yes: #2f9e5b; --no: #d2462e;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15171f; --ink: #eceef5; --muted: #a2a7bc; --card: #1e2130; --line: #30344a; --frame: #0b0c12; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 12px 40px; }

h1, h2 { font-family: "Kenney Pixel", system-ui, sans-serif; font-weight: normal; line-height: 1.05; letter-spacing: 0.5px; }
h1 { font-size: 40px; margin: 0 0 10px; }
h2 { font-size: 30px; margin: 0 0 6px; display: flex; align-items: center; gap: 10px; }
.intro p { margin: 0 0 10px; color: var(--muted); }
.intro b { color: var(--ink); }

.verbs { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; font-size: 14px; }
.verbs li { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; color: var(--muted); }
.verbs b { display: block; color: var(--ink); }
.verbs .i { float: right; font-size: 16px; color: var(--accent); }

.trick { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--frame); color: #fff6a0; font-size: 24px; flex: none; }
.solo-link { margin-left: auto; font-family: system-ui, sans-serif; font-size: 16px; color: var(--muted); text-decoration: none; padding: 2px 6px; border-radius: 6px; }
.solo-link:hover { background: var(--line); }
.lede { margin: 0 0 12px; color: var(--muted); font-size: 15px; }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; min-width: 0; }
.panel.playing { outline: 3px solid var(--accent); outline-offset: -1px; }
.label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin: 0 0 6px; min-height: 22px; }
.badge { font-family: "Kenney Mini", monospace; font-weight: normal; font-size: 12px; text-transform: uppercase; color: #fff; background: var(--off); padding: 2px 7px 1px; border-radius: 5px; }
.panel.on .badge { background: var(--on); }
.stage { position: relative; background: var(--frame); border-radius: 6px; overflow: hidden; }
.stage canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; image-rendering: pixelated; image-rendering: crisp-edges; outline: none; }

.pad { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.pad button { font: inherit; font-size: 11px; line-height: 1.1; border: 1px solid var(--line); background: var(--bg); color: var(--muted); border-radius: 6px; padding: 4px 2px; display: grid; grid-template-columns: auto auto; justify-content: center; align-items: center; column-gap: 4px; pointer-events: none; transition: background .08s, color .08s, transform .08s; user-select: none; -webkit-user-select: none; touch-action: none; }
.pad .i { grid-row: span 2; font-size: 14px; }
.pad .l { font-weight: 600; }
.pad .n { font-family: "Kenney Mini", monospace; font-size: 10px; opacity: .8; }
.pad button.lit { background: var(--accent); color: #1d2030; border-color: var(--accent); transform: translateY(1px); }
.panel.playing .pad button { pointer-events: auto; cursor: pointer; color: var(--ink); padding: 9px 2px; font-size: 12px; }
.panel.playing .pad button:active { background: var(--accent); }

.cap { font-size: 14px; line-height: 1.4; margin-top: 8px; min-height: 4.2em; color: var(--ink); }

table.grid { border-collapse: collapse; width: 100%; margin-top: 8px; font-size: 11px; table-layout: fixed; }
.grid th, .grid td { border: 1px solid var(--line); padding: 2px 3px; text-align: center; height: 20px; }
.grid thead th { font-weight: 600; color: var(--muted); font-size: 10px; }
.grid th[scope=row] { text-align: left; font-weight: 600; width: 27%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid .cur { background: rgba(242, 179, 61, .18); }
.grid td.yes { color: #fff; background: var(--yes); font-weight: 700; }
.grid td.no { color: var(--no); }
.grid tr.sum th, .grid tr.sum td { font-weight: 700; border-top: 2px solid var(--muted); }
.grid tr.sum td.zero { color: var(--no); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.controls button { font: inherit; font-size: 14px; font-weight: 600; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 7px 12px; cursor: pointer; }
.controls button:hover { border-color: var(--muted); }
.controls button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #1d2030; }
.keys { font-size: 12px; color: var(--muted); margin-left: auto; }
kbd { font-family: "Kenney Mini", monospace; font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: var(--card); }

.credits { margin-top: 36px; font-size: 13px; color: var(--muted); }
.credits a { color: inherit; }

/* solo: one trick, no page chrome, fits an iframe */
.solo .intro, .solo .credits, .solo .solo-link { display: none; }
.solo .wrap { padding: 8px; }
.solo .trick { margin: 0; padding: 0; border: 0; }

@media (max-width: 560px) {
  .wrap { padding: 14px 10px 32px; }
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  .verbs { grid-template-columns: 1fr 1fr; }
  .pair { grid-template-columns: 1fr; }
  .cap { min-height: 0; }
  .keys { display: none; }
  .controls button { flex: 1 1 auto; }
}
@media (hover: none) { .keys { display: none; } }
