@font-face {
  font-family: "Silkscreen";
  src: url("/static/fonts/Silkscreen-Regular.50fe74f11000.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Silkscreen";
  src: url("/static/fonts/Silkscreen-Bold.9492064671b6.ttf") format("truetype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f3e8;
  --paper-2: #efe9db;
  --panel: #fffdf7;
  --ink: #161412;
  --muted: #6b645c;
  --line: #d9d2c3;
  --red: #e0452f;
  --red-dark: #b83322;
  --green: #2f7d4f;
  --blue: #2f8fd8;
  --gold: #f6c945;
  --shadow: 4px 4px 0 var(--ink);
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1200px;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-pixel: "Silkscreen", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, canvas { max-width: 100%; }
a { color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 2px; }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
h1, h2, h3, h4 { margin: 0 0 0.5em; font-family: var(--font-body); font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.45rem, 2.3vw, 2rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; line-height: 1.55; }
.tiny { font-size: 0.8rem; line-height: 1.5; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.skip {
  position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper);
  padding: 0.75rem 1rem; z-index: 100;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

.wrap { width: min(100% - 2rem, var(--max)); margin-inline: auto; }
.narrow { width: min(100% - 2rem, 760px); margin-inline: auto; }
.reading { max-width: 70ch; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}
.header-inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: 64px; padding-block: 0.5rem;
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: var(--red); color: #fff; border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink); font-family: var(--font-pixel); font-size: 18px;
}
.brand-name { font-family: var(--font-pixel); font-size: 1.15rem; letter-spacing: 0.02em; }
.brand-sub { display: block; font-family: var(--font-body); font-size: 0.72rem; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; }
.nav { display: flex; gap: 1rem; align-items: center; margin-left: auto; }
.nav a { text-decoration: none; font-weight: 600; font-size: 0.94rem; padding: 0.4rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: var(--red); }
.nav-signout, .nav-auth { display: none; }
.header-actions { display: flex; align-items: center; gap: 0.6rem; }
.pixel-pill {
  display: inline-flex; align-items: center; gap: 0.45rem;
  border: 2px solid var(--ink); background: var(--panel);
  padding: 0.35rem 0.6rem; font-weight: 700; font-size: 0.85rem;
  box-shadow: 2px 2px 0 var(--ink); white-space: nowrap;
}
.pixel-pill .dot { width: 10px; height: 10px; background: var(--red); border: 1px solid var(--ink); }
.menu-toggle { display: none; }
.header-actions .btn.menu-toggle { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 44px; padding: 0.6rem 1rem; border: 2px solid var(--ink);
  border-radius: var(--radius-sm); background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  box-shadow: 3px 3px 0 var(--ink); transition: transform 0.06s ease, box-shadow 0.06s ease;
}
.btn:hover { color: var(--ink); background: #fff; }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: #000; color: var(--paper); }
.btn-ghost { background: transparent; box-shadow: none; }
.btn-ghost:hover { background: var(--paper-2); }
.btn-sm { min-height: 40px; padding: 0.4rem 0.75rem; font-size: 0.9rem; box-shadow: 2px 2px 0 var(--ink); }
.btn-wide { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Panels and forms */
.panel {
  background: var(--panel); border: 2px solid var(--ink);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}
.panel-flat { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.stack > * + * { margin-top: 0.9rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 1.5rem; align-items: start; }

form .field { margin-bottom: 1rem; }
label { display: block; font-weight: 700; margin-bottom: 0.35rem; }
.input, input[type="text"], input[type="email"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; min-height: 44px; padding: 0.55rem 0.7rem;
  border: 2px solid var(--ink); border-radius: var(--radius-sm);
  background: #fff; color: var(--ink); font: inherit;
}
textarea { min-height: 110px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; accent-color: var(--red); }
.helptext, .errorlist { font-size: 0.86rem; color: var(--muted); margin: 0.35rem 0 0; }
.errorlist { color: var(--red-dark); font-weight: 600; list-style: none; padding: 0; }
.form-errors { border: 2px solid var(--red); background: #fff2ef; padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; }
.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.85rem; margin: 1rem 0; }
.divider::before, .divider::after { content: ""; height: 1px; background: var(--line); flex: 1; }

/* Messages and badges */
.messages { list-style: none; padding: 0; margin: 0; position: fixed; top: 84px; right: 1rem; left: auto; z-index: 2000; width: min(380px, calc(100vw - 2rem)); }
.messages li { border: 2px solid var(--ink); background: var(--panel); padding: 0.7rem 2rem 0.7rem 1rem; border-radius: var(--radius-sm); box-shadow: 2px 2px 0 var(--ink); margin-bottom: 0.5rem; cursor: pointer; animation: toast-in 0.22s ease-out; position: relative; }
.messages li::after { content: "×"; position: absolute; right: 0.55rem; top: 0.35rem; font-weight: 800; }
@keyframes toast-in { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@media (max-width: 720px) { .messages { top: 70px; right: 0.5rem; width: calc(100vw - 1rem); } }
.messages .success { background: #eaf6ee; }
.messages .error { background: #fff2ef; }
.badge { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.15rem 0.5rem; border: 1px solid var(--ink); border-radius: 999px; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em; background: var(--paper-2); }
.badge-red { background: var(--red); color: #fff; }
.badge-green { background: #dff1e5; }
.badge-blue { background: #e2f0fb; }
.badge-gold { background: #fff1bf; }

/* Hero */
.hero { padding: 2rem 0 1.25rem; }
.eyebrow { font-family: var(--font-body); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--red-dark); margin-bottom: 0.6rem; }
.hero h1 { max-width: 22ch; }
.hero h1.display { font-family: var(--font-body); font-weight: 800; font-size: clamp(2.2rem, 4.2vw, 3.4rem); line-height: 1.08; letter-spacing: -0.035em; max-width: 24ch; text-wrap: balance; }
.hero-lede { font-size: 1.12rem; max-width: 62ch; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1rem; }
.stat-chip { border: 2px solid var(--ink); background: var(--panel); padding: 0.4rem 0.7rem; box-shadow: 2px 2px 0 var(--ink); font-size: 0.86rem; }
.stat-chip strong { font-family: var(--font-pixel); font-size: 1rem; }

/* Board */
.board-app { position: relative; }
.board-toolbar {
  display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center;
  border: 2px solid var(--ink); border-bottom: 0; border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper-2); padding: 0.5rem;
}
.tool-group { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.tool-btn {
  min-width: 40px; min-height: 40px; padding: 0.35rem 0.6rem;
  border: 1px solid var(--ink); background: var(--panel); color: var(--ink); font: inherit; font-size: 0.8rem;
  font-weight: 700; cursor: pointer; border-radius: 6px;
}
.tool-btn.is-active { background: var(--ink); color: var(--paper); }
.swatches { display: flex; flex-wrap: wrap; gap: 3px; max-width: 420px; }
.swatch { width: 26px; height: 26px; border: 1px solid var(--ink); cursor: pointer; padding: 0; border-radius: 4px; }
.swatch.is-active { outline: 3px solid var(--ink); outline-offset: 1px; }
.zoom-controls { display: flex; gap: 0.25rem; margin-left: auto; align-items: center; }
.zoom-hint { font-size: 0.72rem; line-height: 1.2; font-weight: 600; color: var(--muted); white-space: nowrap; margin-right: 0.3rem; }
.zoom-hint-touch { display: none; }
@media (hover: none), (max-width: 760px) {
  .zoom-hint-desktop { display: none; }
  .zoom-hint-touch { display: inline; }
}
.canvas-wrap {
  position: relative; border: 2px solid var(--ink);
  background: #ded6c4; overflow: hidden; touch-action: none;
  aspect-ratio: 3 / 2; width: 100%;
}
.canvas-wrap canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; cursor: crosshair; touch-action: none; }
.board-status {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  border: 2px solid var(--ink); border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
  background: var(--panel); padding: 0.45rem 0.7rem; font-size: 0.82rem;
}
.board-label { font-family: var(--font-body); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.pixel-hint { color: var(--muted); }

/* Side panel */
.side-card h3 { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.big-number { font-family: var(--font-pixel); font-size: 2.4rem; line-height: 1; }
.quota-bar { height: 12px; border: 2px solid var(--ink); background: #fff; margin: 0.5rem 0; }
.quota-bar span { display: block; height: 100%; background: var(--red); }
.streak-dots { display: flex; gap: 4px; margin-top: 0.5rem; }
.streak-dots i { width: 14px; height: 14px; border: 1px solid var(--ink); background: #fff; }
.streak-dots i.on { background: var(--gold); }
.powerup-row { display: flex; gap: 0.5rem; overflow-x: auto; padding: 0.25rem 0 0.5rem; }
.powerup-chip {
  flex: 0 0 auto; width: 92px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; padding: 0.35rem; text-align: center; cursor: pointer; font: inherit;
}
.powerup-chip img { width: 56px; height: 56px; image-rendering: pixelated; display: block; margin: 0 auto; }
.powerup-chip span { display: block; font-size: 0.72rem; font-weight: 700; margin-top: 0.2rem; }
.powerup-chip.is-active { outline: 3px solid var(--red); }

/* Leaderboard */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel); }
table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--line); }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.rank { font-family: var(--font-pixel); font-size: 1.1rem; }
.avatar {
  width: 28px; height: 28px; display: inline-grid; place-items: center;
  background: var(--paper-2); border: 1px solid var(--ink); font-size: 0.75rem; font-weight: 800;
}
.leader-name { display: flex; align-items: center; gap: 0.5rem; }

/* Marketing sections */
.section { padding: 2.5rem 0; }
.section-tight { padding: 1.5rem 0; }
.section-head { max-width: 65ch; margin-bottom: 1.25rem; }
.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.step { border: 2px solid var(--ink); background: var(--panel); padding: 1rem; border-radius: var(--radius); box-shadow: 3px 3px 0 var(--ink); }
.step::before { counter-increment: step; content: counter(step, decimal-leading-zero); font-family: var(--font-pixel); color: var(--red); font-size: 0.9rem; display: block; margin-bottom: 0.5rem; }
.banner {
  border: 2px solid var(--ink); background: var(--ink); color: var(--paper);
  padding: 1.25rem; border-radius: var(--radius); box-shadow: 5px 5px 0 var(--red);
}
.banner a { color: var(--gold); }
.banner h2 { color: var(--paper); }
.price-grid { display: grid; gap: 1rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.price-card { border: 2px solid var(--ink); border-radius: var(--radius); background: var(--panel); padding: 1.25rem; display: flex; flex-direction: column; }
.price-card.recommended { box-shadow: var(--shadow); }
.price { font-family: var(--font-pixel); font-size: 2rem; }
.price small { font-family: var(--font-body); font-size: 0.85rem; color: var(--muted); }
.feature-list { list-style: none; padding: 0; margin: 0.75rem 0 1.25rem; }
.feature-list li { padding-left: 1.4rem; position: relative; margin-bottom: 0.4rem; }
.feature-list li::before { content: "■"; position: absolute; left: 0; color: var(--red); font-size: 0.7rem; top: 0.4rem; }
.membership-card { border: 2px solid var(--ink); background: var(--panel); box-shadow: 6px 6px 0 var(--gold); border-radius: var(--radius); padding: 1.5rem; }
.land-map-wrap { aspect-ratio: 380 / 280; }
.quote-panel { font-size: 0.92rem; }
.quote-row { display: flex; justify-content: space-between; gap: 1rem; padding: 0.3rem 0; border-bottom: 1px dashed var(--line); }
.quote-row:last-child { border-bottom: 0; }
.quote-total { font-family: var(--font-pixel); font-size: 1.4rem; }
.deco-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 0.4rem; max-height: 240px; overflow: auto; padding: 0.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.deco-btn { border: 1px solid var(--line); background: #fff; padding: 0.3rem; border-radius: 6px; cursor: pointer; font: inherit; }
.deco-btn img { width: 40px; height: 40px; image-rendering: pixelated; display: block; margin: 0 auto; }
.deco-btn.is-active { outline: 3px solid var(--red); }

/* Auth */
.auth-wrap { min-height: 70vh; display: grid; place-items: center; padding: 2rem 1rem; }
.auth-card { width: min(100%, 420px); background: var(--panel); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.auth-card h1 { font-size: 1.8rem; }
.auth-card .brand { justify-content: center; margin-bottom: 1rem; }
.auth-alt { margin-top: 1rem; font-size: 0.9rem; }
details.auth-details { border-top: 1px solid var(--line); margin-top: 1rem; padding-top: 1rem; }
details.auth-details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }

/* Account */
.account-grid { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.account-nav { position: sticky; top: 80px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 0.5rem; }
.account-nav a { display: block; padding: 0.55rem 0.7rem; border-radius: 6px; text-decoration: none; font-weight: 600; }
.account-nav a:hover, .account-nav a[aria-current="page"] { background: var(--paper-2); }
.metric { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.8rem; background: var(--panel); }
.metric .value { font-family: var(--font-pixel); font-size: 1.6rem; display: block; }
.metric .label { font-size: 0.78rem; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.code-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.code { font-family: ui-monospace, monospace; font-size: 0.95rem; border: 1px dashed var(--ink); padding: 0.5rem; background: #fff; letter-spacing: 0.04em; }
.copy-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.token-code { flex: 1 1 100%; min-width: 0; word-break: break-all; overflow-wrap: anywhere; white-space: normal; font-size: 0.82rem; letter-spacing: 0.01em; }
.doc-code {
  margin: 0.65rem 0 1rem;
  padding: 0.85rem 1rem;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.55;
  overflow-x: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
#agent-status[data-state="error"] { color: var(--red-dark); font-weight: 700; }
#agent-status[data-state="ok"] { color: var(--green); font-weight: 700; }
.passkey-row { display: flex; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 1px solid var(--line); padding: 0.7rem 0; }
.passkey-row:last-child { border-bottom: 0; }

/* Ops */
.ops-body .site-header { border-bottom-color: var(--red); }
.ops-badge { background: var(--red); color: #fff; border: 2px solid var(--ink); padding: 0.15rem 0.5rem; font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.ops-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.75rem; }
.report-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.75rem; background: var(--panel); }
.report-card img { width: 120px; height: 120px; object-fit: contain; image-rendering: pixelated; background: var(--paper-2); border: 1px solid var(--line); }
.check-row { display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.check-row:last-child { border-bottom: 0; }
.check-dot { width: 12px; height: 12px; margin-top: 0.35rem; border: 1px solid var(--ink); flex: 0 0 auto; }
.check-dot.ok { background: var(--green); }
.check-dot.degraded, .check-dot.unknown { background: var(--gold); }
.check-dot.down, .check-dot.failing { background: var(--red); }
.check-dot.pending { background: #fff; }

/* Watchdog */
.state-strip { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 0.75rem 0; }
.state-pill { border: 2px solid var(--ink); padding: 0.3rem 0.7rem; font-weight: 800; }
.state-healthy { background: #dff1e5; }
.state-degraded { background: #fff1bf; }
.state-down { background: #ffd9d1; }
.state-unknown { background: var(--paper-2); }
.week-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.4rem; }
.week-day { border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem; min-height: 78px; background: var(--panel); }
.week-day strong { display: block; font-size: 0.75rem; text-transform: uppercase; color: var(--muted); }
.week-day .bar { height: 8px; border: 1px solid var(--ink); margin-top: 0.4rem; background: #fff; }
.week-day .bar span { display: block; height: 100%; }
.week-day.healthy .bar span { background: var(--green); }
.week-day.degraded .bar span { background: var(--gold); }
.week-day.down .bar span { background: var(--red); }
.week-day.empty .bar span { background: var(--line); }

/* Footer */
.site-footer { margin-top: 3rem; border-top: 2px solid var(--ink); background: var(--paper-2); padding: 1.5rem 0; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: flex-start; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.75rem 1.1rem; font-size: 0.86rem; }
.watchdog-link { font-size: 0.82rem; font-weight: 700; text-decoration: none; border-bottom: 1px dotted var(--ink); }
.footer-note { max-width: 42ch; font-size: 0.8rem; line-height: 1.5; color: var(--muted); }

/* Modal and toast */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22, 20, 18, 0.55); z-index: 90;
  display: grid; place-items: center; padding: 1rem;
}
.modal-backdrop[hidden] { display: none; }
.modal {
  width: min(100%, 520px); max-height: 90vh; overflow: auto; background: var(--panel);
  border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: 8px 8px 0 var(--ink); padding: 1.25rem;
}
.modal h2 { font-size: 1.5rem; }
.modal-close { float: right; border: 0; background: none; font-size: 1.4rem; cursor: pointer; line-height: 1; }
.toast {
  position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 0.7rem 1rem; border-radius: 8px;
  z-index: 100; max-width: 90vw; box-shadow: 3px 3px 0 var(--red); font-size: 0.9rem;
}
.toast[hidden] { display: none; }
.result-art { width: 96px; height: 96px; image-rendering: pixelated; display: block; margin: 0 auto 0.5rem; }
.claim-result { text-align: center; }
.claim-amount { font-family: var(--font-pixel); font-size: 3rem; color: var(--red); line-height: 1; }

/* Utility */
.hidden { display: none !important; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; } .gap-1 { gap: 0.5rem; } .gap-2 { gap: 1rem; }
.wrap-gap { display: flex; flex-wrap: wrap; gap: 0.5rem; }

@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; }
  .account-grid { grid-template-columns: 1fr; }
  .account-nav { position: static; display: flex; flex-wrap: wrap; }
  .steps, .price-grid { grid-template-columns: 1fr; }
  .ops-grid, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .nav { display: none; }
  .nav.is-open { display: flex; position: absolute; left: 0; right: 0; top: 64px; background: var(--paper); border-bottom: 2px solid var(--ink); padding: 0.75rem 1rem; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
  .nav.is-open a { width: 100%; padding: 0.6rem 0; }
  .menu-toggle { display: inline-flex; }
  .header-actions .btn.menu-toggle { display: inline-flex; }
}
@media (max-width: 760px) {
  .header-actions .pixel-pill { display: none; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .swatches { max-width: 100%; }
  .report-card { grid-template-columns: 1fr; }
  .report-card img { width: 100%; height: auto; }
  .week-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .wrap { width: min(100% - 1.25rem, var(--max)); }
  .ops-grid { grid-template-columns: 1fr; }
  .code-grid { grid-template-columns: 1fr; }
  h1 { font-size: 2rem; }
}
@media (max-width: 1024px) {
  .nav.is-open .nav-auth { display: block; width: 100%; }
  .nav.is-open .nav-signout { display: block; width: 100%; margin-top: 0.4rem; }
  .nav.is-open .nav-signout .btn { width: 100%; }
}
@media (max-width: 420px) {
  .header-inner { gap: 0.5rem; }
  .header-actions { gap: 0.35rem; }
  .site-header .brand-name,
  .site-header .brand-sub { display: none; }
  .header-actions .btn { white-space: nowrap; }
  .header-actions .btn-sm { padding: 0.3rem 0.5rem; font-size: 0.82rem; }
  .header-actions .inline-form { display: none; }
  .header-actions > a[href="/login/"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* final shell fixes */
.inline-form { display: inline; }
.footer-brand { margin-bottom: 0.5rem; }
.footer-note-gap { margin-top: 0.5rem; }
.eyebrow-gold { color: var(--gold); }
.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.plain-list li:last-child { border-bottom: 0; }
.land-preview { width: 100%; height: auto; image-rendering: pixelated; }
.auth-card-wide { width: min(100%, 760px); }
.auth-card pre { white-space: pre-wrap; word-break: break-word; }
.auth-card table { width: 100%; }

/* allauth default pages are rendered inside <main>; style that as the card. */
body.auth-page main {
  width: min(100% - 2rem, 440px);
  margin: 2rem auto;
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
body.auth-page.auth-page-wide main { width: min(100% - 2rem, 760px); }
body.auth-page main h1 { font-size: 1.8rem; }
body.auth-page main table { width: 100%; }
body.auth-page main pre { white-space: pre-wrap; word-break: break-word; }

/* Board modes, help strip and fullscreen */
.board-app[data-mode="move"] canvas { cursor: grab; }
.board-app.is-panning canvas { cursor: grabbing; }
.tool-help {
  border: 2px solid var(--ink);
  border-top: 0;
  border-bottom: 0;
  background: #fffdf7;
  padding: 0.55rem 0.75rem;
  font-size: 0.82rem;
  color: var(--muted);
  min-height: 2.4rem;
}
.tool-btn[data-action="fullscreen"] { min-width: 104px; }
body.no-scroll { overflow: hidden; }
.board-app.is-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100vw;
  height: 100vh;
  padding: 0.75rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.board-app:fullscreen {
  width: 100vw;
  height: 100vh;
  padding: 0.75rem;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.board-app.is-fullscreen .canvas-wrap,
.board-app:fullscreen .canvas-wrap {
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: auto;
  height: auto;
}
.board-app.is-fullscreen .board-toolbar,
.board-app:fullscreen .board-toolbar,
.board-app.is-fullscreen .board-status,
.board-app:fullscreen .board-status,
.board-app.is-fullscreen .tool-help,
.board-app:fullscreen .tool-help { flex: 0 0 auto; }
.board-app.is-fullscreen .board-toolbar,
.board-app:fullscreen .board-toolbar { border-radius: var(--radius) var(--radius) 0 0; }
.board-app.is-fullscreen .tool-help,
.board-app:fullscreen .tool-help { border-radius: 0 0 var(--radius) var(--radius); }

@media (max-width: 760px) {
  .board-toolbar { align-items: stretch; }
  .tool-group { order: 1; flex: 1 1 100%; }
  .tool-group .tool-btn { flex: 1 1 18%; min-width: 0; padding-left: 0.3rem; padding-right: 0.3rem; font-size: 0.74rem; }
  .swatches { order: 2; flex: 1 1 100%; max-width: 100%; }
  .zoom-controls { order: 3; flex: 1 1 100%; margin-left: 0; justify-content: flex-end; }
  .tool-btn[data-action="fullscreen"] { min-width: 0; }
  .tool-help { font-size: 0.78rem; }
}

.tool-btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* Paint bottom sheet */
.paint-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 130;
  width: min(100%, 760px);
  transform: translateX(-50%);
  background: var(--panel);
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -4px 0 rgba(22, 20, 18, 0.18);
  padding: 0.9rem 1rem 1.1rem;
}
.paint-sheet[hidden] { display: none; }
.paint-sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.6rem; }
.paint-sheet .swatches { max-width: none; gap: 5px; margin-bottom: 0.65rem; }
.paint-sheet .swatch { width: 32px; height: 32px; }
body.paint-sheet-open { overflow: hidden; }
.home-side { align-items: stretch; }
.home-side .side-card { height: 100%; display: flex; flex-direction: column; }
.home-side .side-card > :last-child { margin-top: auto; }
.home-secondary-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end; }

@media (max-width: 760px) {
  .paint-sheet { width: 100%; padding-bottom: max(1.1rem, env(safe-area-inset-bottom)); }
}

.image-controls { display: flex; flex-wrap: wrap; gap: 0.55rem; align-items: center; border: 2px solid var(--ink); border-top: 0; border-bottom: 0; background: #fffdf7; padding: 0.45rem 0.7rem; font-size: 0.8rem; }
.image-controls[hidden] { display: none; }
.image-controls input[type="range"] { width: 140px; accent-color: var(--red); }

/* Built by Kituwa: the studio signature, links to the product page. */
.built-by-kituwa {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  margin-top: 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  opacity: 0.85;
}
.built-by-kituwa:hover,
.built-by-kituwa:focus-visible { opacity: 1; text-decoration: underline; color: var(--ink); }
.built-by-kituwa svg { width: 1.1em; height: 1.1em; fill: currentColor; flex: none; }


/* Daily reveal and streak strip */
.streak-days { display: flex; flex-wrap: wrap; gap: 4px; margin: 0.45rem 0; }
.streak-day { position: relative; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--ink); border-radius: 4px; font-size: 0.72rem; font-weight: 800; background: #fff; }
.streak-day.is-unlocked { background: var(--gold); color: var(--ink); box-shadow: 2px 2px 0 var(--ink); }
.streak-day.is-locked { background: #ddd8cc; color: #8b8478; }
.streak-day.is-locked small { position: absolute; inset: 0; display: grid; place-items: center; font-size: 1rem; color: #6b645c; background: rgba(247, 243, 232, 0.45); }
.streak-day.is-unlocked::after { content: "✓"; position: absolute; right: -4px; top: -7px; font-size: 0.65rem; background: var(--green); color: #fff; border: 1px solid var(--ink); border-radius: 50%; width: 12px; height: 12px; display: grid; place-items: center; }
.claim-stage { position: relative; min-height: 150px; display: grid; place-items: center; overflow: hidden; margin: 0.25rem 0 0.5rem; }
.claim-stage::before { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(246, 201, 69, 0.75) 0%, rgba(246, 201, 69, 0) 70%); opacity: 0; transition: opacity 0.4s ease; }
.claim-chest { position: relative; z-index: 1; width: 128px; height: 128px; image-rendering: pixelated; filter: drop-shadow(4px 5px 0 rgba(22, 20, 18, 0.35)); animation: chest-float 1.8s ease-in-out infinite; }
.claim-result.is-shaking .claim-chest { animation: chest-shake 0.32s ease-in-out; }
.claim-result.is-open .claim-stage::before { opacity: 1; }
.claim-result.is-open .claim-chest { animation: chest-pop 0.55s cubic-bezier(.2,1.6,.4,1) both, chest-float 1.8s 0.55s ease-in-out infinite; }
.claim-burst { position: absolute; inset: 0; pointer-events: none; }
.claim-burst span { position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; border: 1px solid rgba(22, 20, 18, 0.5); }
.claim-amount { position: relative; z-index: 1; text-align: center; }
.claim-streak { justify-content: center; }
#claim-streak-note { text-align: center; }
@keyframes chest-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes chest-pop { 0% { transform: scale(0.7) rotate(-4deg); } 60% { transform: scale(1.1) rotate(2deg); } 100% { transform: scale(1); } }
@keyframes chest-shake { 0%,100% { transform: translateX(0) rotate(0); } 20% { transform: translateX(-3px) rotate(-2deg); } 40% { transform: translateX(3px) rotate(2deg); } 60% { transform: translateX(-2px) rotate(-1deg); } 80% { transform: translateX(2px) rotate(1deg); } }
@keyframes burst-fly { 0% { transform: translate(0,0) scale(1); opacity: 1; } 100% { transform: translate(var(--dx), var(--dy)) scale(0.2); opacity: 0; } }

/* Power-up inventory */
.powerup-card .result-art { display: block; margin: 0.5rem auto 0.25rem; image-rendering: pixelated; }
.powerup-card h3 { margin: 0.2rem 0; }
.odds-bar { display: flex; height: 22px; border: 1px solid var(--ink); overflow: hidden; font-size: 0.7rem; font-weight: 800; }
.odds-bar span { display: grid; place-items: center; color: var(--ink); }
.odds-common { background: var(--gold); width: 70%; }
.odds-rare { background: #8fc2e8; width: 24%; }
.odds-mega { background: #d9a3e8; width: 6%; }

/* Account land control panel */
.land-card { display: grid; grid-template-columns: 150px 1fr; gap: 0.9rem; border: 2px solid var(--ink); background: #fffdf7; box-shadow: 4px 4px 0 var(--ink); padding: 0.7rem; align-items: start; }
.land-thumb { display: block; border: 2px solid var(--ink); background: var(--paper); overflow: hidden; aspect-ratio: 4 / 3; }
.land-thumb img { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--paper); image-rendering: pixelated; }
.land-card-body { min-width: 0; }
.land-card-body h3 { overflow-wrap: anywhere; }
@media (max-width: 720px) { .land-card { grid-template-columns: 1fr; } .land-thumb { max-width: 220px; } }

/* Land market */
.market-card { border: 2px solid var(--ink); background: #fffdf7; box-shadow: 4px 4px 0 var(--ink); padding: 0.75rem; }
.market-card .land-thumb { aspect-ratio: 3 / 2; margin-bottom: 0.5rem; }
.market-card h3 { overflow-wrap: anywhere; }

/* Land sale tools */
.card-tools { margin-top: 0.55rem; border-top: 1px dashed var(--muted); padding-top: 0.4rem; }
.card-tools summary { cursor: pointer; font-size: 0.78rem; font-weight: 700; }
.card-tools .field { margin-bottom: 0.4rem; }
.bid-input { width: 92px; padding: 0.35rem; border: 2px solid var(--ink); border-radius: 4px; font: inherit; }

@media (max-width: 720px) {
  .tool-btn { padding: 0.3rem 0.45rem; min-width: 38px; }
  .btn-sm { min-height: 44px; }
  .market-card .btn, .land-card .btn { min-height: 44px; }
}

/* Decoration shop */
.shop-preview { display: grid; place-items: center; min-height: 190px; border: 2px solid var(--ink); background: var(--paper); margin-bottom: 0.4rem; padding: 0.6rem; }
.shop-preview img { width: 160px; height: 160px; object-fit: contain; image-rendering: pixelated; }
.thumb-xs { width: 32px; height: 32px; object-fit: contain; image-rendering: pixelated; vertical-align: middle; }
.text-danger { color: #b3261e; }
.qty-input { width: 72px; padding: 0.35rem; border: 2px solid var(--ink); border-radius: 4px; font: inherit; }

.rank-icon { image-rendering: pixelated; width: 96px; height: 96px; object-fit: contain; border: 2px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); }

.xp-progress { width: 100%; height: 16px; accent-color: var(--red); }

.rank-icon-sm { image-rendering: pixelated; width: 40px; height: 40px; object-fit: contain; }

.plot-art { display: block; border: 2px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); overflow: hidden; }
.plot-art img { display: block; width: 100%; height: auto; image-rendering: pixelated; }

/* Home land mode */
.land-mode-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 1rem; align-items: start; }
.land-world { display: block; border: 2px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); overflow: hidden; }
.land-world img { display: block; width: 100%; height: auto; image-rendering: pixelated; }
@media (max-width: 820px) { .land-mode-grid { grid-template-columns: 1fr; } }

/* Unified market */
.market-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; border: 2px solid var(--ink); background: #fffdf7; padding: 0.6rem; }
.market-filters .field { min-width: 130px; }
.market-card .shop-preview { min-height: 150px; }
.market-card .shop-preview img { width: 120px; height: 120px; }
.market-timer { font-weight: 700; }

.inline-form { display: inline; }
.shop-preview-large { min-height: 420px; }
.shop-preview-large img { width: 300px; height: 300px; }
.rule { border: 0; border-top: 1px dashed var(--muted); margin: 0.8rem 0; }

.plot-hero-head { text-align: center; }
.plot-hero { display: grid; place-items: center; border: 2px solid var(--ink); background: var(--paper); box-shadow: 6px 6px 0 var(--ink); overflow: hidden; }
.plot-hero img { display: block; width: 100%; max-width: 900px; height: auto; image-rendering: pixelated; }

/* Land templates */
.template-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.35rem; }
.template-btn { display: grid; gap: 0.2rem; padding: 0.3rem; border: 2px solid var(--ink); background: var(--panel); font: inherit; font-size: 0.68rem; font-weight: 700; cursor: pointer; border-radius: 5px; }
.template-btn.is-active { background: var(--gold); }
.template-swatch { display: block; height: 24px; border: 1px solid var(--ink); image-rendering: pixelated; }
.template-plain { background: #f7f3e8; }
.template-grass { background: repeating-linear-gradient(45deg, #2f7d4f 0 4px, #7fb53c 4px 8px, #90be6d 8px 10px); }
.template-stone { background: repeating-linear-gradient(0deg, #b8b2a6 0 6px, #6b645c 6px 8px, #2b2926 8px 9px); }
.template-sand { background: repeating-linear-gradient(90deg, #c9a06a 0 5px, #f6c945 5px 7px, #e0452f 7px 8px); }
.template-water { background: repeating-linear-gradient(135deg, #2f8fd8 0 7px, #8bd3ff 7px 11px, #2ec4a6 11px 13px); }
.template-brick { background: repeating-linear-gradient(0deg, #5c4033 0 5px, #e0452f 5px 9px, #8d5a3b 9px 10px); }
.template-snow { background: repeating-linear-gradient(45deg, #ffffff 0 6px, #b8b2a6 6px 8px); }
.template-void { background: repeating-linear-gradient(45deg, #161412 0 6px, #2b2926 6px 8px); }

.deco-scale { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; font-size: 0.78rem; }
.deco-scale input { width: 110px; accent-color: var(--red); }

/* Animated market/shop cards */
.shop-card { position: relative; overflow: hidden; border-radius: 14px; }
.shop-card > *:not(.shop-blob) { position: relative; z-index: 1; }
.shop-blob { position: absolute; z-index: 0; top: 50%; left: 50%; width: 150px; height: 150px; border-radius: 50%; filter: blur(14px); opacity: 0.75; animation: blob-bounce 6s infinite ease; }
.tone-red .shop-blob { background: #e0452f; }
.tone-blue .shop-blob { background: #2f8fd8; }
.tone-green .shop-blob { background: #2f7d4f; }
.tone-purple .shop-blob { background: #7b4bc4; }
.tone-gold .shop-blob { background: #f6c945; }
.tone-teal .shop-blob { background: #2ec4a6; }
.tone-rainbow .shop-blob { background: conic-gradient(#e0452f, #f6c945, #7fb53c, #2f8fd8, #7b4bc4, #e0452f); animation: blob-bounce 5s infinite ease, rainbow-spin 4s linear infinite; }
@keyframes blob-bounce { 0% { transform: translate(-100%, -100%); } 25% { transform: translate(0, -100%); } 50% { transform: translate(0, 0); } 75% { transform: translate(-100%, 0); } 100% { transform: translate(-100%, -100%); } }
@keyframes rainbow-spin { to { filter: blur(14px) hue-rotate(360deg); } }

/* Prize cards */
.prize-grid { align-items: stretch; }
.prize-card { display: grid; gap: 0.15rem; place-items: center; border: 2px solid var(--ink); background: #fffdf7; box-shadow: 4px 4px 0 var(--ink); padding: 0.8rem; border-radius: 8px; }
.prize-card strong { font-size: 1.5rem; }
.prize-card.prize-first { background: var(--gold); }
.prize-place { font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }

.tone-rainbow .shop-preview img { animation: rainbow-hue 6s linear infinite; }
@keyframes rainbow-hue { to { filter: hue-rotate(360deg); } }

.plot-hero > a { display: block; width: 100%; }

.selection-preview { border: 2px solid var(--ink); background: var(--paper); margin-bottom: 0.55rem; padding: 0.35rem; }
.selection-preview img { display: block; width: 100%; max-height: 220px; object-fit: contain; image-rendering: pixelated; }
.selection-preview span { display: block; margin-top: 0.2rem; }

/* Prevent the board toolbar from forcing horizontal overflow on small screens */
.board-app, .board-toolbar, .tool-group, .swatches, .zoom-controls, .canvas-wrap, .split > * { min-width: 0; max-width: 100%; }

/* Bug bounty: launcher, incident toast, report dialog and wall */
.bug-launcher {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 4px 4px 0 var(--ink);
}
.bug-launcher:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.bug-launcher-mark {
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--ink);
  color: var(--gold);
  font-size: 0.95rem;
  line-height: 1;
}

.bug-launcher.has-incident {
  background: #ffe2dd;
  box-shadow: 4px 4px 0 #a1221a;
  animation: bug-nudge 1.3s ease 2;
}
.bug-launcher.has-incident .bug-launcher-mark { background: linear-gradient(135deg, #e0452f, #f08a24, #f6c945, #7fb53c, #2f8fd8, #7b4bc4); color: #fff; }
.bug-launcher-code {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: var(--ink);
  color: var(--gold);
  border-radius: 4px;
  padding: 0.05rem 0.3rem;
}
@keyframes bug-nudge {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-3px); }
}

.bug-dialog {
  width: min(96vw, 640px);
  max-height: 92vh;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: auto;
}
.bug-dialog::backdrop { background: rgba(16, 24, 20, 0.55); }
.bug-dialog-inner { padding: 1.1rem 1.15rem 1.25rem; }
.bug-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.bug-dialog-head h2 { margin: 0; }
.bug-close {
  border: 2px solid var(--ink);
  background: var(--paper-2);
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.bug-dialog label { display: block; margin: 0.65rem 0 0.25rem; font-weight: 700; font-size: 0.86rem; }
.bug-dialog textarea, .bug-dialog input[type="email"], .bug-dialog input[type="text"], .bug-dialog select { width: 100%; }
.bug-dialog textarea { min-height: 74px; }
.bug-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.7rem; }
.bug-context { margin: 0.6rem 0 0.2rem; }
.check-line { display: flex; gap: 0.5rem; align-items: flex-start; font-weight: 500 !important; }
.check-line input { margin-top: 0.15rem; flex: 0 0 auto; }
.form-error { color: #a1221a; font-weight: 700; font-size: 0.86rem; }
.bug-done h3 { margin-top: 0.2rem; }
.bug-done code, .big-code { font-size: 1.05em; background: var(--paper-2); padding: 0.1rem 0.3rem; border-radius: 4px; }
.bug-split { align-items: start; }
.bug-side .panel-flat + .panel-flat { margin-top: 1rem; }
.helper-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.45rem; }
.helper-list li { border-bottom: 1px dashed rgba(16, 24, 20, 0.2); padding-bottom: 0.4rem; font-size: 0.9rem; }
.success-card { max-width: 640px; margin: 2rem auto; text-align: center; }
.stat-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.8rem; margin: 1rem 0 1.4rem; }
.stat-card { border: 2px solid var(--ink); border-radius: 8px; background: #fffdf7; box-shadow: 4px 4px 0 var(--ink); padding: 0.8rem; display: grid; gap: 0.2rem; }
.stat-card strong { font-size: 1.6rem; }
.stat-card .label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 800; }
.helper-table td { vertical-align: top; }
.bug-ref { display: grid; gap: 0.3rem; min-width: 8.5rem; align-content: start; }
.prewrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.kv { display: grid; grid-template-columns: 7.5rem 1fr; gap: 0.3rem 0.7rem; font-size: 0.9rem; }
.kv dt { font-weight: 700; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.badge-new { background: var(--gold); }
.badge-approved { background: #dff1e5; }
.badge-fixed { background: #d8ebf7; }
.badge-rejected, .badge-duplicate { background: #f3dedb; }
.badge-pending { background: #f6e9c4; }
.badge-sent { background: #dff1e5; }
.badge-failed { background: #f3dedb; }
.badge-triaged { background: #e6e1f5; }
.bug-action-form label { display: block; margin: 0.5rem 0 0.2rem; font-weight: 700; font-size: 0.86rem; }
.bug-action-form .input { width: 100%; }

@media (max-width: 700px) {
  .bug-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .bug-launcher { bottom: 0.7rem; right: 0.7rem; padding: 0.5rem 0.7rem; font-size: 0.85rem; }
}

/* Crypto checkout and wallet pages */
.pay-amount { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; margin: 0.45rem 0; }
.pay-amount .code { flex: 1 1 240px; word-break: break-all; }
.qr-box { display: flex; gap: 0.9rem; align-items: center; flex-wrap: wrap; margin-top: 0.8rem; }
.qr-box img { width: 176px; height: 176px; border: 2px solid var(--ink); background: #fff; image-rendering: pixelated; }
.status-dot { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.status-dot[data-tone="success"] { background: var(--green); }
.status-dot[data-tone="warn"] { background: var(--gold); }
.status-dot[data-tone="danger"] { background: var(--red); }
.text-success { color: var(--green); }
.text-warn { color: #8a5b00; }
.text-danger { color: var(--red-dark); }
.max-60 { max-width: 60ch; }
.wallet-row { display: flex; justify-content: space-between; gap: 0.8rem; align-items: center; flex-wrap: wrap; padding: 0.5rem 0; border-bottom: 1px dashed var(--line); }

.ops-note { border-left: 6px solid var(--gold); }
.ops-note h2 { font-size: 1.05rem; }

/* Long code blocks must scroll inside the article instead of widening the
   mobile layout viewport (which made the whole page, and the network panel,
   appear zoomed out). */
pre { max-width: 100%; overflow-x: auto; }

/* ------------------------------------------------------------------
   Home board v2 (2026-12-01): the board is the first thing on the page,
   sized to the screen, with a HUD over the canvas and a colour dock below.
   Scoped to .play so the land map and parcel editor keep their layout.
   ------------------------------------------------------------------ */
.play { padding: 0.5rem 0 0.75rem; }
.play-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.15rem 1rem; padding-bottom: 0.5rem; }
.play-title { margin: 0; font-family: var(--font-body); font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.25; }
.play-title span { font-weight: 500; color: var(--muted); font-size: 0.82em; letter-spacing: 0; }
.play-sub { margin: 0; font-size: 0.88rem; color: var(--muted); line-height: 1.45; }
.play-sub strong { color: var(--ink); }
.play-sub a { color: var(--ink); }

.play .board-app {
  display: flex; flex-direction: column;
  height: var(--board-h, calc(100svh - 150px)); min-height: 380px;
  border: 2px solid var(--ink); border-radius: 6px; overflow: hidden;
  background: var(--panel);
}
.play .board-stage {
  position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden;
  background: #e4ddcc; touch-action: none; user-select: none; -webkit-user-select: none;
}
.play .board-stage canvas {
  position: absolute; inset: 0; width: 100%; height: 100%; display: block;
  touch-action: none; cursor: crosshair; outline: none; max-width: none;
}
.play .board-stage canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--blue); }
.play .board-app.is-panning canvas { cursor: grabbing; }
.play .board-app[data-input="mouse"]:not(.is-brush) canvas { cursor: crosshair; }

/* HUD over the canvas */
.play .hud { position: absolute; z-index: 2; display: flex; gap: 0.35rem; pointer-events: none; }
.play .hud[hidden] { display: none; }
.play .hud button { pointer-events: auto; }
.play .hud-tl { top: 0.5rem; left: 0.5rem; right: 9.5rem; }
.play .hud-tr { top: 0.5rem; right: 0.5rem; }
.play .hud-zoom { right: 0.5rem; bottom: 0.5rem; flex-direction: column; }
.play .hud-chip {
  display: inline-flex; align-items: center; gap: 0.4rem; max-width: 100%;
  padding: 0.3rem 0.55rem; border: 1px solid var(--ink); border-radius: 6px;
  background: var(--panel); color: var(--ink); font-size: 0.8rem; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.play .live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: 0 0 auto; }
.play .hud-live.is-busy .live-dot { background: var(--green); }
.play .hud-btn {
  width: 40px; height: 40px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--ink); border-radius: 6px; background: var(--panel); color: var(--ink);
  cursor: pointer; transition: background-color 150ms ease;
}
.play .hud-btn svg { width: 16px; height: 16px; fill: currentColor; }
.play .hud-btn:hover { background: var(--paper); }
.play .hud-btn:focus-visible, .play .tool-btn:focus-visible, .play .swatch:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.play .hud-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.play .hud-hint, .play .hud-banner {
  left: 50%; transform: translateX(-50%); align-items: center; gap: 0.5rem;
  max-width: calc(100% - 1rem); padding: 0.45rem 0.5rem 0.45rem 0.8rem;
  border: 1px solid var(--ink); border-radius: 6px; background: var(--ink); color: var(--paper);
  font-size: 0.86rem; font-weight: 600; pointer-events: auto;
}
.play .hud-hint { bottom: 0.6rem; max-width: calc(100% - 4.5rem); left: calc(50% - 1.5rem); }
.play .hud-banner { top: 2.9rem; }
.play .hud-banner .tool-btn { min-height: 32px; background: var(--panel); color: var(--ink); }
.play .hint-close { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: var(--paper); font-size: 1.1rem; cursor: pointer; }
.play .hint-touch { display: none; }
.play .board-app[data-input="touch"] .hint-touch { display: inline; }
.play .board-app[data-input="touch"] .hint-desktop { display: none; }

/* Dock: colours, pixels left, tools */
.play .dock { flex: 0 0 auto; border-top: 2px solid var(--ink); background: var(--panel); padding: 0.5rem 0.6rem 0.55rem; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.45rem; }
.play .swatches {
  display: flex; flex-wrap: wrap; gap: 4px; max-width: none; align-items: center; order: 0;
}
.play .swatch {
  --sw: #fff;
  width: 30px; height: 30px; flex: 0 0 auto; padding: 0; cursor: pointer;
  border: 1px solid rgba(22, 20, 18, 0.55); border-radius: 4px; background: var(--sw);
  transition: box-shadow 150ms ease;
}
.play .swatch-paper { background: repeating-linear-gradient(45deg, var(--sw) 0 5px, #e8e1d1 5px 7px); border-style: dashed; border-color: var(--ink); }
.play .swatch.is-active { outline: 0; box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink); }
.play .dock-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.play .dock-meter { display: flex; align-items: center; flex-wrap: wrap; gap: 0.25rem 0.6rem; min-width: 0; }
.play .dock-count { font-size: 0.86rem; color: var(--muted); white-space: nowrap; }
.play .dock-count strong { font-family: var(--font-pixel); font-size: 1.15rem; color: var(--ink); font-weight: 400; }
.play .meter { width: 88px; height: 8px; border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--paper); }
.play .meter span { display: block; height: 100%; width: 100%; background: var(--green); transition: width 150ms ease; }
.play .board-app.is-empty .meter span { background: var(--red); }
.play .board-app.is-empty .dock-count strong { color: var(--red-dark); }
.play .board-app.is-saving .dock-count strong { opacity: 0.6; }
.play .dock-note { font-size: 0.8rem; color: var(--muted); }
.play .dock-note a { color: var(--ink); font-weight: 600; }
.play .dock-tools { display: flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }
.play .tool-btn { min-height: 38px; border-radius: 6px; transition: background-color 150ms ease, color 150ms ease; }
.play .tool-btn.is-active { background: var(--ink); color: var(--paper); }
.play .tool-primary { background: var(--red); color: #fff; border-color: var(--ink); min-width: 92px; }
.play .tool-primary:disabled { background: var(--panel); color: var(--muted); opacity: 1; }
.play .place-btn { display: none; }
.play .board-app[data-input="touch"] .place-btn { display: inline-flex; align-items: center; justify-content: center; }
.play .dock-more { position: relative; }
.play .dock-more summary { list-style: none; display: inline-flex; align-items: center; }
.play .dock-more summary::-webkit-details-marker { display: none; }
.play .dock-menu {
  position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 5; display: grid; gap: 0.3rem; min-width: 200px;
  padding: 0.4rem; border: 1px solid var(--ink); border-radius: 6px; background: var(--panel); box-shadow: 0 6px 18px rgba(22, 20, 18, 0.18);
}
.play .dock-menu .tool-btn { justify-content: flex-start; text-align: left; text-decoration: none; display: flex; align-items: center; }
.play .image-controls { border: 0; border-top: 2px solid var(--ink); }

/* Fullscreen: the board fills the screen */
.play .board-app.is-fullscreen, .play .board-app:fullscreen {
  position: fixed; inset: 0; z-index: 120; width: 100vw; height: 100dvh; max-width: none;
  margin: 0; padding: 0; border: 0; border-radius: 0;
}
.play .board-app:fullscreen { position: static; }

.home-below { padding-top: 1.5rem; }
.home-side > * { min-width: 0; max-width: 100%; }   /* a long button or countdown must never widen the page on phones */
@media (max-width: 420px) { .home-side { grid-template-columns: minmax(0, 1fr); } .home-side .btn { white-space: normal; text-align: center; } }
.home-intro { margin-bottom: 1.25rem; }
.home-intro h2.display { font-family: var(--font-body); font-weight: 800; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.1; letter-spacing: -0.02em; max-width: 24ch; margin-bottom: 0.5rem; }

@media (max-width: 760px) {
  .play { padding-top: 0.35rem; }
  .play-head { padding-bottom: 0.35rem; }
  .play-sub { font-size: 0.82rem; }
  .play .wrap.board-app { width: 100%; border-left: 0; border-right: 0; border-radius: 0; }
  .play .swatches {
    display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, 34px); grid-auto-columns: 34px;
    overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 4px 2px; margin: -4px -2px;
  }
  .play .swatches::-webkit-scrollbar { display: none; }
  .play .swatch { width: 34px; height: 34px; }
  .play .dock .swatches { order: 2; } /* palette sits by the thumb */
  .play .dock .dock-row { order: 1; }
  .play .dock { padding: 0.45rem 0.5rem calc(0.5rem + env(safe-area-inset-bottom)); }
  .play .dock-row { gap: 0.4rem; }
  .play .dock-meter { flex: 1 1 100%; }
  .play .dock-tools { flex: 1 1 100%; flex-wrap: nowrap; }
  .play .dock-tools .tool-btn { min-height: 44px; padding-inline: 0.55rem; }
  .play .place-btn { margin-left: auto; flex: 1 1 auto; font-size: 0.95rem; }
  .play .hud-btn { width: 44px; height: 44px; }
  .play .hud-tl { right: 8.5rem; }
  .play .hud-chip { font-size: 0.76rem; }
  .play .meter { width: 64px; }
}
@media (prefers-reduced-motion: reduce) {
  .play .meter span, .play .swatch, .play .hud-btn, .play .tool-btn { transition: none; }
}
/* While the board is on screen, keep floating UI off the dock. The footer
   still links to /bugs/, and the launcher returns once the board scrolls away. */
body.board-in-view .bug-launcher { display: none; }
body.board-in-view .toast { bottom: auto; top: 76px; }
