:root {
  color-scheme: light;
  --ink: #1c302d;
  --muted: #4d615b;
  --paper: #f3f1e8;
  --line: #c8ccc0;
  --deep: #172e2b;
  --cream: #fff6dc;
  --yellow: #efbd58;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.page-width { width: min(1200px, calc(100% - 80px)); margin-inline: auto; }
header, footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
header { min-height: 68px; border-bottom: 1px solid var(--line); }
a { color: inherit; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; }
.brand-mark { width: 20px; height: 17px; border: 2px solid; border-radius: 4px; position: relative; }
.brand-mark::after { content: ""; position: absolute; inset: 3px; border: 1px solid; border-radius: 1px; }
.join { font-size: .83rem; font-weight: 650; text-underline-offset: 4px; }
.join span { margin-left: 4px; }
.skip { position: absolute; inset: 8px auto auto 8px; padding: 10px; background: var(--cream); z-index: 2; transform: translateY(-180%); }
.skip:focus { transform: none; }
.intro { margin: 46px 0 26px; display: grid; grid-template-columns: 1.1fr .9fr; align-items: end; gap: 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.55rem, 6.4vw, 5.3rem); line-height: .98; letter-spacing: -.065em; font-weight: 760; }
.intro p { color: var(--muted); max-width: 38ch; padding-bottom: 1px; }
.bench { display: grid; grid-template-columns: minmax(0, 2.3fr) minmax(220px, 1fr); color: var(--cream); background: var(--deep); border-radius: 17px; overflow: hidden; }
.stage {
  height: clamp(350px, 47vw, 548px);
  position: relative;
  background-color: #1d3935;
  background-image: linear-gradient(#ffffff10 1px, transparent 1px), linear-gradient(90deg, #ffffff10 1px, transparent 1px);
  background-size: 29px 29px;
  background-position: center;
}
.stage canvas { width: 100%; height: 100%; display: block; }
#world { touch-action: none; }
.stage canvas:focus-visible { outline-offset: -4px; outline-color: var(--yellow); }
.controls { display: flex; gap: 5px; flex-wrap: wrap; position: absolute; left: 14px; bottom: 14px; }
button { font: inherit; cursor: pointer; }
.controls button { min-height: 44px; min-width: 44px; padding: 0 10px; border: 1px solid #839d8f; border-radius: 6px; background: #172e2b; color: var(--cream); font-size: .9rem; }
.controls button:hover { background: #31504a; }
.detail { display: flex; flex-direction: column; align-items: start; padding: clamp(22px, 3vw, 42px); border-left: 1px solid #4d665e; }
.detail h2 { font-size: clamp(1.55rem, 3vw, 2.65rem); line-height: 1.07; letter-spacing: -.045em; overflow-wrap: anywhere; }
.detail p { margin-top: 12px; overflow-wrap: anywhere; }
.detail .meta, .tag, dt, .section-heading p { font: .72rem/1.4 ui-monospace, monospace; letter-spacing: .075em; }
.detail .meta { margin: 0 0 9px; color: #eec26c; }
#overview { margin-bottom: 15px; font-size: .86rem; text-underline-offset: 4px; }
.detail .hint { margin-top: auto; padding-top: 22px; font-size: .79rem; color: #c5d4bf; }
dl { display: grid; gap: 5px; margin: 20px 0; width: 100%; }
dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 1px solid #4d665e; padding-bottom: 4px; }
dt { color: #ccd8c7; }
dd { margin: 0; text-align: right; font-size: .86rem; }
#download { border: 0; border-radius: 6px; background: var(--yellow); color: #1b2d24; font-size: .91rem; font-weight: 800; min-height: 44px; padding: 10px 13px; }
#download:hover { background: #ffe09a; }
#download span { margin-left: 14px; }
.section-heading { margin: 37px 0 13px; display: flex; justify-content: space-between; align-items: baseline; gap: 14px; }
.section-heading h2 { font-size: clamp(1.45rem, 3vw, 2.2rem); letter-spacing: -.045em; }
.section-heading p { color: var(--muted); }
#bin-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; }
.card { display: block; text-decoration: none; overflow: hidden; border-radius: 12px; border: 1px solid var(--line); background: #faf8ee; height: 100%; }
.card:hover, .card[aria-current] { border-color: #537265; background: #e8eddd; }
.card canvas { width: 100%; display: block; background: #e1e7d7; aspect-ratio: 2.15; }
.card-body { display: grid; gap: 4px; padding: 12px 15px 15px; overflow-wrap: anywhere; }
.tag { color: var(--muted); text-transform: uppercase; }
.card strong { font-size: 1.08rem; }
.card small { color: var(--muted); }
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; padding-block: 18px; margin-top: 44px !important; }
:focus-visible { outline: 3px solid #9d5011; outline-offset: 3px; }
.bench :focus-visible { outline-color: var(--yellow); }
@media (max-width: 800px) {
  .page-width { width: calc(100% - 40px); }
  .intro { grid-template-columns: 1fr; gap: 13px; margin-top: 32px; }
  .bench { grid-template-columns: minmax(0,1fr); }
  .detail { border-left: 0; border-top: 1px solid #4d665e; }
  .stage { height: clamp(265px, 68vw, 500px); }
  #bin-list { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 480px) {
  .page-width { width: calc(100% - 32px); }
  header { gap: 9px; }
  .join { max-width: 16ch; text-align: right; }
  #bin-list { grid-template-columns: 1fr; }
  .card { display: grid; grid-template-columns: 104px minmax(0,1fr); }
  .card canvas { height: 100%; min-height: 100px; object-fit: contain; }
  footer { flex-wrap: wrap; }
}
