@font-face {
  font-family: 'KenneyPixel';
  src: url('assets/kenney-pixel.ttf') format('truetype');
  font-display: block;
}
:root {
  --bg: #f5f2ea;
  --ink: #1d2230;
  --card: #1c2130;
  --panel: #252b3c;
  --line: #343c52;
  --text: #ece8de;
  --dim: #a6aec0;
  --off: #ff6b6b;
  --on: #6ee787;
  --gold: #ffd166;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 16px 12px 24px; }
.intro h1 { font-family: 'KenneyPixel', monospace; font-weight: normal; font-size: 40px; line-height: 1; margin: 4px 0 8px; letter-spacing: 1px; }
.intro p { margin: 0 0 12px; font-size: 15.5px; }
.t-off { color: #c43b3b; } .t-on { color: #1f8a4c; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.tabs button {
  font: inherit; font-size: 14px; padding: 6px 11px; border-radius: 999px;
  border: 1.5px solid #cfc8b8; background: #fffdf8; color: var(--ink); cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabs button:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.demo { background: var(--card); color: var(--text); border-radius: 14px; padding: 14px 12px 12px; }
.demo-head h2 { font-family: 'KenneyPixel', monospace; font-weight: normal; font-size: 30px; line-height: 1; margin: 0 0 6px; color: var(--gold); letter-spacing: 1px; }
.demo-head .what { margin: 0 0 4px; font-size: 15px; }
.demo-head .moment { margin: 0 0 10px; font-size: 13.5px; color: var(--dim); }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.panel { background: var(--panel); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.tag { font-family: 'KenneyPixel', monospace; font-size: 18px; line-height: 1; display: flex; align-items: center; gap: 6px; letter-spacing: .5px; }
.tag::before { content: ''; width: 9px; height: 9px; border-radius: 50%; background: currentColor; }
.panel.off .tag { color: var(--off); } .panel.on .tag { color: var(--on); }
canvas { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; image-rendering: pixelated; background: #111; }

.acts { display: flex; flex-wrap: wrap; gap: 5px; min-height: 62px; align-content: flex-start; }
.act {
  font: inherit; font-size: 12.5px; line-height: 1.2; padding: 6px 8px; border-radius: 6px;
  border: 1px solid #4a5370; background: #343c54; color: var(--text); cursor: pointer;
  transition: transform .12s, background .12s, box-shadow .12s;
}
.act:hover:not(:disabled) { background: #414a66; }
.act.primary { background: #2f6b47; border-color: #46935f; }
.act.trick { border-color: var(--gold); box-shadow: inset 0 0 0 1px rgba(255,209,102,.35); }
.act.off { background: transparent; border-style: dashed; color: #8a90a2; text-decoration: line-through; text-decoration-color: rgba(255,107,107,.7); }
.act:disabled { opacity: .5; cursor: default; }
.act.off:disabled { opacity: .85; }
.auto .act { cursor: pointer; }
.act.press { transform: scale(.94); background: var(--gold) !important; color: #1d2230 !important; box-shadow: 0 0 0 3px rgba(255,209,102,.45); opacity: 1; }
.act:focus-visible { outline: 3px solid var(--gold); outline-offset: 1px; }

.cap {
  margin: 0; font-size: 13.5px; line-height: 1.4; min-height: 5.8em;
  background: #171b27; border-radius: 7px; padding: 7px 9px; border-left: 3px solid #4a5370;
}
.cap.win { border-left-color: var(--on); } .cap.lose { border-left-color: var(--off); }

.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ctl {
  font: inherit; font-size: 14px; padding: 7px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid #56607d; background: #2d3448; color: var(--text);
}
.ctl:hover { background: #39425b; }
.ctl.play[aria-pressed="true"] { background: var(--gold); color: #1d2230; border-color: var(--gold); }
.ctl:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.hint { font-size: 12.5px; color: var(--dim); flex: 1 1 200px; }
.insp { font-size: 12.5px; color: var(--dim); margin: 8px 0 0; }

.foot { font-size: 12.5px; color: #6b6556; margin-top: 12px; }
.foot code { font-size: 12px; background: #ebe5d6; padding: 1px 4px; border-radius: 4px; }

/* Solo: just the demo, for embedding */
body.solo { background: transparent; }
body.solo .wrap { padding: 0; }
body.solo .intro, body.solo .tabs, body.solo .foot { display: none; }

@media (max-width: 560px) {
  .panels { grid-template-columns: 1fr; }
  .wrap { padding: 12px 8px 20px; }
  .intro h1 { font-size: 34px; }
  .act { font-size: 13.5px; padding: 8px 10px; }
  .acts { min-height: 0; }
  .cap { min-height: 4.3em; }
  body.solo .wrap { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .act { transition: none; }
}
