/* Zen: warm dark ground, flat fills, one green that only ever means "you can
 * act here". Chrome comes off the board — the river is the whole picture, and
 * everything else is a chip on top of it or a rail beside it. */
:root {
  --ground: #262421;
  --panel: #21201d;
  --panel-2: #2c2a26;
  --ink: #e4e1dd;
  --dim: #98948e;
  --rule: #221f1c;
  --tile: #4b4741;
  --green: #81b64c;
  --amber: #d9a13b;
  --red: #d1493f;
  --radius: 12px;
  --ui: 'Space Grotesk', ui-sans-serif, -apple-system, 'Segoe UI', system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: var(--ground); color: var(--ink);
  font-family: var(--ui);
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

#app {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  grid-template-areas: 'top' 'stage';
  max-width: 1120px; margin: 0 auto;
  padding: 0 max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-bottom));
}
#rail { display: none; }
@media (min-width: 900px) and (min-height: 620px) {
  #app {
    grid-template-columns: minmax(0, 440px) 280px;
    grid-template-areas: 'top top' 'stage rail';
    gap: 0 28px; align-content: start;
  }
  #rail { display: block; grid-area: rail; align-self: start; padding-top: 4px; }
}

#top {
  grid-area: top;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 2px 10px;
}
#wordmark {
  font-size: clamp(20px, 5.5vw, 28px); letter-spacing: .04em;
  text-transform: uppercase; margin: 0; font-weight: 600;
}
#wordmark span { color: var(--green); }
#chips { display: flex; gap: 8px; }
.chip {
  padding: 8px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--rule); background: var(--panel);
  font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* One portrait box, 10:16, the same rectangle on every screen. */
#stage {
  grid-area: stage; position: relative;
  width: 100%; max-width: 440px; margin: 0 auto;
  aspect-ratio: 10 / 16; max-height: 100%;
  background: var(--panel);
  border: 1.5px solid var(--rule); border-radius: var(--radius);
  overflow: hidden;
}
#board { display: block; width: 100%; height: 100%; }

#banner {
  position: absolute; left: 0; right: 0; top: 16%;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 16px 18px; text-align: center;
  background: rgba(28, 26, 24, .9);
  border-top: 1.5px solid var(--green); border-bottom: 1.5px solid var(--green);
}
#banner[hidden] { display: none; }
#banner b {
  font-size: clamp(20px, 6cqw, 26px); letter-spacing: .06em;
  text-transform: uppercase; color: var(--green); font-weight: 600;
}
#banner span { color: var(--dim); font-size: 14px; }

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: 26px 22px;
  background: rgba(28, 26, 24, .93);
}
.screen[hidden] { display: none; }
.screen h2 {
  margin: 0; font-size: clamp(22px, 6.4cqw, 30px); line-height: 1.15;
  letter-spacing: .01em; font-weight: 600;
}
.screen .lede { margin: 0; color: var(--dim); font-size: 15px; line-height: 1.5; }
.screen .stat {
  margin: 0; font-size: clamp(38px, 13vw, 56px); font-weight: 600;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.keys { display: flex; flex-wrap: wrap; gap: 8px 14px; color: var(--dim); font-size: 13px; }
.keys b {
  display: inline-block; min-width: 22px; padding: 2px 6px; margin-right: 4px;
  background: var(--panel-2); border: 1.5px solid var(--rule); border-radius: 6px;
  color: var(--ink); font-weight: 600; text-align: center;
}
.buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.btn {
  min-height: 46px; padding: 0 18px; border-radius: var(--radius);
  border: 1.5px solid var(--rule); background: var(--panel-2); color: var(--ink);
  font: inherit; font-size: 16px; font-weight: 500; cursor: pointer;
}
.btn.primary { background: var(--green); border-color: #6d9c3f; color: #1b2110; }
.btn:active { transform: translateY(1px); }

#species-row { display: flex; flex-wrap: wrap; gap: 8px; }
#species-row[hidden] { display: none; }
.sp {
  padding: 7px 11px; border-radius: 999px; font-size: 13px; cursor: pointer;
  border: 1.5px solid var(--rule); background: var(--panel-2); color: var(--ink);
  font-family: inherit;
}
.sp[aria-pressed='true'] { border-color: var(--green); color: var(--green); }
.sp[disabled] { color: var(--dim); cursor: default; opacity: .55; }

#rail h3 {
  margin: 18px 0 8px; font-size: 13px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--dim); font-weight: 600;
}
#rail ol, #rail ul { margin: 0; padding: 0; list-style: none; }
#rail li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 12px; margin-bottom: 6px;
  background: var(--panel); border: 1.5px solid var(--rule); border-radius: 10px;
  font-size: 14px; font-variant-numeric: tabular-nums;
}
#rail li span:last-child { color: var(--dim); }
#rail li.empty { color: var(--dim); justify-content: flex-start; }
#rail li.locked span:first-child { color: var(--dim); }
