:root {
  --bg: #b8cab0;        /* medium-light sage — soothing backdrop */
  --panel: #f3f6ee;     /* near-white pale-sage card */
  --panel-2: #e6ecdd;   /* wells */
  --line: #c7d4bd;
  --text: #232b22;
  --muted: #5d6b56;
  --accent: #4a8159;
  --accent-dim: #3c6b49;
  --gold: #a8731a;
  --tent: #d98a3c;
  --radius: 16px;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

/* Brand ------------------------------------------------------------------- */
.topbar { display: flex; justify-content: center; margin-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { display: block; }
.logo {
  margin: 0;
  font-size: 27px;
  letter-spacing: 1px;
  font-weight: 800;
}

.who { text-align: center; color: var(--muted); margin: 0 0 6px; font-size: 13px; }
.name-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
}
.name-btn:hover { background: rgba(0,0,0,.05); }
.name-btn .pencil { color: var(--muted); font-size: 12px; margin-left: 2px; }
.anonymous-toggle { display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; color: var(--muted); font-size: 12px; cursor: pointer; white-space: nowrap; }
.anonymous-toggle input { accent-color: var(--accent); margin: 0; }

.tagline {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
  max-width: 42ch;
  margin: 0 auto 26px;
}

/* Game cards -------------------------------------------------------------- */
.cards { display: grid; gap: 16px; }
@media (min-width: 560px) { .cards { grid-template-columns: 1fr 1fr; } }

.game-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, transform .1s, box-shadow .15s;
}
.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: 0 8px 22px rgba(60, 107, 73, .12);
}

.game-art { display: flex; gap: 8px; align-items: flex-end; height: 52px; }
.art-glyph { width: 46px; height: 46px; display: block; }

.game-art-stairs { align-items: center; }
.game-art-stairs .stairs-svg { width: 68px; height: 52px; display: block; }
.game-art-squareup { align-items: center; }
.game-art-squareup .squareup-svg { width: 52px; height: 52px; display: block; }
.game-art-word { align-items: center; }
.word-frame {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 1px;
  color: var(--accent-dim);
}
.word-blank {
  display: inline-block;
  border-bottom: 3px solid var(--tent);
  min-width: 22px;
  color: transparent;
}

.game-art-fork { align-items: center; }
.fork-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
}
.fork-stack span { display: block; min-width: 2.2ch; text-align: center; }
.fork-stack span:first-child { border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.fork-stack span:last-child { padding-top: 3px; color: var(--muted); }

.game-art-grader { align-items: center; gap: 6px; }
.grader-letter {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 800;
  font-size: 16px;
  color: var(--accent-dim);
}

.game-title { font-size: 21px; font-weight: 800; }
.game-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--accent-dim);
  background: rgba(74, 129, 89, .13);
  border-radius: 999px;
  padding: 3px 10px;
}
.game-desc { color: var(--muted); font-size: 13px; line-height: 1.5; max-width: 30ch; }
.game-desc b { color: var(--text); }
.game-go {
  margin-top: 6px;
  font-weight: 700;
  font-size: 14px;
  color: var(--accent);
}
.game-go .arrow { transition: transform .15s; display: inline-block; }
.game-card:hover .game-go .arrow { transform: translateX(4px); }

/* Yesterday's top 3 — deliberately small and quiet. */
.mini-board {
  margin: 26px auto 0;
  max-width: 400px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px 14px;
}
.mini-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.mini-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .8px;
  text-transform: uppercase;
  color: var(--muted);
}
.mini-date { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }

.mini-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.mini-tab {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.mini-tab:hover { color: var(--text); }
.mini-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

.mini-panel { display: none; }
.mini-panel.active { display: block; }
.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: baseline;
  padding: 4px 2px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.mini-rank { color: var(--gold); font-size: 13px; }
.mini-name { color: var(--text); font-weight: 600; word-break: break-word; }
.mini-score { color: var(--accent); font-weight: 700; font-family: var(--mono); font-size: 12.5px; }
.mini-empty { color: var(--muted); font-size: 12.5px; padding: 4px 2px; }

.feedback { max-width: 400px; margin: 26px auto 0; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.feedback h2 { margin: 0; font-size: 16px; }
.feedback p { color: var(--muted); font-size: 13px; line-height: 1.45; margin: 6px 0 12px; }
.feedback textarea { display: block; width: 100%; resize: vertical; min-height: 86px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--text); font: inherit; }
.feedback textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.feedback-send-btn { margin-top: 10px; padding: 9px 14px; border: none; border-radius: 9px; background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; }
.feedback-send-btn:hover { background: var(--accent-dim); }
.feedback .feedback-note { margin: 8px 0 0; font-size: 11px; }

.footnote {
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  margin: 26px auto 0;
  max-width: 34ch;
  line-height: 1.5;
}
