/* ============================================================
   Outliers — design system
   Paper white, ink black, and gold: rare = precious.
   Signature: the word pyramid (3 / 4 / 5 tile rows).
   ============================================================ */

:root {
  --paper: #FCFBF7;
  --paper-raised: #FFFFFF;
  --ink: #191817;
  --ink-soft: #6F6A61;
  --ink-faint: #A39D91;
  --line: #E5E1D5;
  --line-strong: #C9C4B6;

  --gold: #B8860B;
  --gold-bright: #D9A425;
  --gold-soft: #F6EDD4;
  --gold-deep: #8A6508;

  --red: #C24141;
  --red-soft: #F9E9E7;

  --rare: #9A7B1E;
  --uncommon: #7C7867;
  --common: #A39D91;

  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --tile: 3.4rem;
  --radius: 0.45rem;
  --shadow: 0 1px 2px rgba(40, 35, 20, 0.06), 0 8px 24px rgba(40, 35, 20, 0.07);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; }

body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body.no-scroll { overflow: hidden; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden;
}

/* ---------- top bar ---------- */

.topbar {
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.topbar__inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.wordmark__gem {
  width: 0.72em; height: 0.72em;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  transform: rotate(45deg);
  border-radius: 0.14em;
  display: inline-block;
}

.topbar__nav { display: flex; gap: 0.25rem; }

.iconbtn {
  width: 2.4rem; height: 2.4rem;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--ink-soft);
  transition: background 0.15s, color 0.15s;
}
.iconbtn svg { width: 1.35rem; height: 1.35rem; }
.iconbtn:hover { background: var(--gold-soft); color: var(--ink); }
.iconbtn--active { color: var(--gold-deep); }

/* ---------- shared bits ---------- */

.page {
  max-width: 30rem;
  margin: 0 auto;
  padding: 1.75rem 1rem 6rem;
}

.eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: center;
  margin-bottom: 0.5rem;
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.7rem 1.5rem;
  border-radius: 2rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.15s;
}
.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow);
}
.btn--primary:hover { background: #000; }

.btn--ghost {
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
  background: var(--paper-raised);
}
.btn--ghost:hover { border-color: var(--ink-soft); }

.btn--block { width: 100%; }

.toast {
  position: fixed;
  top: 4.2rem; left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1.1rem;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: toast-in 0.25s ease-out;
  max-width: min(92vw, 26rem);
  text-align: center;
}
.toast--alert { background: var(--red); }
.toast--out { opacity: 0; transition: opacity 0.5s; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -0.5rem); } }

/* ---------- avatars, gems, trophies, chips ---------- */

.avatar {
  --hue: 200;
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.05rem;
  background: hsl(var(--hue) 45% 92%);
  box-shadow: inset 0 0 0 1.5px hsl(var(--hue) 35% 72%);
  flex: none;
}

.gem {
  display: inline-block;
  width: 0.85rem; height: 0.85rem;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  transform: rotate(45deg);
  border-radius: 0.15rem;
  flex: none;
}
.gem--inline { width: 0.7rem; height: 0.7rem; margin: 0 0.1rem; vertical-align: -0.05em; }

.trophy {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font-size: 0.82rem; font-weight: 600;
}
.trophy b { font-weight: 700; }
.trophy small { font-weight: 500; color: var(--ink-soft); font-size: 0.78rem; }

.trophy__glyph { display: inline-block; width: 1.05rem; height: 1.05rem; flex: none; }

.trophy--gem .trophy__glyph {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep));
  transform: rotate(45deg) scale(0.78);
  border-radius: 0.18rem;
}
.trophy--gold .trophy__glyph,
.trophy--silver .trophy__glyph,
.trophy--bronze .trophy__glyph {
  border-radius: 50%;
  box-shadow: inset 0 -2px 3px rgba(0,0,0,0.18), inset 0 2px 3px rgba(255,255,255,0.55);
}
.trophy--gold .trophy__glyph { background: radial-gradient(circle at 35% 30%, #F3CE5E, #C89B18 70%); }
.trophy--silver .trophy__glyph { background: radial-gradient(circle at 35% 30%, #E8E8E8, #A9ADB5 70%); }
.trophy--bronze .trophy__glyph { background: radial-gradient(circle at 35% 30%, #E0A374, #A96A3B 70%); }
.trophy--weekly .trophy__glyph {
  background: linear-gradient(180deg, #F3CE5E, #C89B18);
  clip-path: polygon(6% 92%, 94% 92%, 100% 32%, 74% 52%, 50% 10%, 26% 52%, 0% 32%);
}

.chip {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 0.4rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border: 1px solid var(--line);
  background: var(--paper-raised);
}
.chip em { font-style: normal; font-weight: 600; color: var(--ink-soft); }
.chip--unique { border-color: var(--gold); background: var(--gold-soft); color: var(--gold-deep); }
.chip--rare { border-color: #D8C58C; background: #FBF6E6; color: var(--rare); }
.chip--uncommon { color: var(--uncommon); }
.chip--common { color: var(--common); }
.chip--retired { color: var(--ink-faint); text-decoration: line-through; text-decoration-thickness: 1px; }

.livedot {
  display: inline-block;
  width: 0.45rem; height: 0.45rem;
  border-radius: 50%;
  background: var(--gold-bright);
  margin-right: 0.4rem;
  animation: livedot 2.4s ease-in-out infinite;
}
@keyframes livedot { 50% { opacity: 0.35; } }

/* ---------- the round ---------- */

.round__title, .submitted__title, .results__title {
  font-family: var(--font-display);
  font-size: 1.6rem;
  line-height: 1.2;
  text-align: center;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0.25rem 0 0.4rem;
}

.round__meta {
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-soft);
  margin-bottom: 1.6rem;
}

.pyramid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto 1rem;
}

.pyramid__row {
  position: relative;
  display: flex;
  gap: 0.4rem;
  padding: 0.35rem;
  border-radius: calc(var(--radius) + 0.35rem);
  transition: background 0.15s;
}
.pyramid__row--active { background: rgba(184, 134, 11, 0.07); }
.pyramid__row--shake { animation: shake 0.4s; }
@keyframes shake {
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); } 80% { transform: translateX(4px); }
}

.pyramid__note {
  position: absolute;
  right: calc(100% + 0.5rem);
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--red);
  white-space: nowrap;
  display: none;
}

.tile {
  width: var(--tile); height: var(--tile);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--paper-raised);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: calc(var(--tile) * 0.48);
  font-weight: 800;
  text-transform: uppercase;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.tile--filled { border-color: var(--ink); }
.tile--cursor { box-shadow: inset 0 -3px 0 var(--gold-bright); }
.tile--conflict { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.tile--invalid { border-color: var(--red); color: var(--red); }
.tile--pop { animation: pop 0.12s ease-out; }
@keyframes pop { 50% { transform: scale(1.08); } }

.tile--locked {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.tile--small { width: 2.2rem; height: 2.2rem; font-size: 1.05rem; border-width: 1.5px; }
.tile--small.tile--unique { background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep)); border-color: var(--gold-deep); color: #fff; }
.tile--small.tile--rare { background: var(--gold-soft); border-color: #D8C58C; color: var(--gold-deep); }
.tile--small.tile--uncommon { border-color: var(--line-strong); color: var(--ink); }
.tile--small.tile--common { border-color: var(--line); color: var(--ink-soft); background: var(--paper); }

.tile--demo { width: 1.9rem; height: 1.9rem; font-size: 0.95rem; border-width: 1.5px; border-color: var(--ink); }
.tile--demo.tile--conflict { border-color: var(--red); }

.round__hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-faint);
  min-height: 1.3rem;
  margin-bottom: 1.1rem;
  transition: color 0.15s;
}
.round__hint--conflict { color: var(--red); font-weight: 600; }

/* keyboard */

.keyboard {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 31rem;
  margin: 0 auto;
  user-select: none;
  touch-action: manipulation;
}

.keyboard__row { display: flex; justify-content: center; gap: 0.3rem; }

.key {
  flex: 1;
  max-width: 2.7rem;
  height: 3.3rem;
  border-radius: 0.35rem;
  background: #EBE7DB;
  font-weight: 700;
  font-size: 0.92rem;
  text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.12s, color 0.12s, opacity 0.12s;
}
.key:active { background: var(--line-strong); }
.key svg { width: 1.4rem; height: 1.4rem; }

.key--wide { max-width: 4.6rem; flex: 1.6; font-size: 0.78rem; letter-spacing: 0.02em; }

.key--used { opacity: 0.35; }
.key--conflict { background: var(--red); color: #fff; opacity: 1; }

.key--enter { background: var(--ink); color: var(--paper); }
.key--enter:disabled { background: #EBE7DB; color: var(--ink-faint); cursor: default; }
.key--enter:not(:disabled) { animation: enter-glow 1.8s ease-in-out infinite; }
@keyframes enter-glow {
  50% { box-shadow: 0 0 0 4px rgba(217, 164, 37, 0.35); }
}

/* confirm sheet */

.sheet {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(25, 24, 23, 0.45);
  display: flex; align-items: flex-end; justify-content: center;
}
.sheet[hidden] { display: none; }

.sheet__card {
  background: var(--paper-raised);
  border-radius: 1rem 1rem 0 0;
  padding: 1.6rem 1.4rem calc(1.4rem + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 30rem;
  text-align: center;
  animation: sheet-up 0.22s ease-out;
  box-shadow: 0 -8px 40px rgba(40, 35, 20, 0.18);
}
@keyframes sheet-up { from { transform: translateY(2rem); opacity: 0; } }

.sheet__kicker {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}

.sheet__words {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.5rem 0;
}
.sheet__dot { color: var(--gold); margin: 0 0.55rem; }

.sheet__warning { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 1.2rem; }

.sheet__actions { display: flex; gap: 0.6rem; }
.sheet__actions .btn { flex: 1; }

/* ---------- submitted / countdown ---------- */

.submitted { text-align: center; }
.submitted .pyramid { margin-top: 1.4rem; }

.submitted__note { font-size: 0.9rem; color: var(--ink-soft); margin: 1rem 0 1.8rem; }

.countdown { margin-bottom: 1.6rem; }
.countdown__label {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint);
}
.countdown__clock {
  font-family: var(--font-display);
  font-size: 2.6rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.submitted .round__meta { margin-bottom: 1.4rem; }

/* ---------- results ---------- */

.results__sub {
  text-align: center; font-size: 0.85rem;
  color: var(--ink-soft); margin-bottom: 1.5rem;
}

.reveal-stack { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1rem; }

.reveal-card {
  display: flex; align-items: center; justify-content: space-between;
  gap: 0.8rem;
  padding: 0.85rem 1rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}
.reveal-card--unique { border-color: rgba(184, 134, 11, 0.55); background: linear-gradient(180deg, #FFFDF6, var(--paper-raised)); }

.reveal-card__word { display: flex; gap: 0.25rem; }

.reveal-card__info {
  display: flex; flex-direction: column; align-items: flex-end; gap: 0.15rem;
  text-align: right;
}

.reveal-card__count {
  font-size: 0.8rem; font-weight: 600; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 0.35rem;
}
.reveal-card--unique .reveal-card__count { color: var(--gold-deep); }
.reveal-card__count .gem { width: 0.65rem; height: 0.65rem; }

.reveal-card__score {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.results__total {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.2rem;
  border-top: 2px solid var(--ink);
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.2rem;
}
.results__points b {
  font-family: var(--font-display);
  font-size: 2.2rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.results__points small, .results__rank small {
  display: block; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
}
.results__rank {
  font-family: var(--font-display);
  font-size: 1.6rem; font-weight: 700;
  text-align: right;
}

.results__trophies {
  text-align: center;
  background: var(--gold-soft);
  border: 1px solid rgba(184, 134, 11, 0.35);
  border-radius: 0.8rem;
  padding: 0.9rem 1rem;
  margin-bottom: 1.4rem;
}
.results__trophies-kicker {
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.5rem;
}
.results__trophies-row { display: flex; justify-content: center; gap: 1.1rem; flex-wrap: wrap; }

.results__actions { display: flex; gap: 0.6rem; justify-content: center; flex-wrap: wrap; }

/* reveal animation */
[data-reveal-target~="card"] {
  opacity: 0;
  transform: translateY(0.8rem);
  transition: opacity 0.45s ease-out, transform 0.45s ease-out;
}
[data-reveal-target~="card"].is-in { opacity: 1; transform: none; }

/* ---------- leaderboards ---------- */

.board { max-width: 34rem; margin: 0 auto; }

.tabs {
  display: flex; justify-content: center; gap: 0.2rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.9rem;
}
.tab {
  padding: 0.55rem 0.9rem;
  font-size: 0.88rem; font-weight: 600;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1px;
}
.tab--active { color: var(--ink); border-color: var(--gold); }

.board__note {
  text-align: center; font-size: 0.78rem;
  color: var(--ink-faint); margin-bottom: 0.9rem;
}

.boardlist { list-style: none; }

.boardrow {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  font-size: 0.92rem;
}
.boardlist .boardrow:nth-child(odd) { background: rgba(229, 225, 213, 0.28); }

.boardrow--you {
  background: var(--gold-soft);
  border: 1px solid rgba(184, 134, 11, 0.4);
  margin-bottom: 0.7rem;
  font-weight: 600;
}
.boardrow--is-you { outline: 1.5px solid rgba(184, 134, 11, 0.5); }

.boardrow__rank {
  width: 2.2rem; flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-faint);
}
.boardrow__rank--gold { color: var(--gold-deep); }
.boardrow__rank--silver { color: #85898F; }
.boardrow__rank--bronze { color: #A96A3B; }

.boardrow__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.boardrow__chips { display: flex; gap: 0.55rem; flex: none; }
.boardrow__chips .trophy { font-size: 0.78rem; gap: 0.2rem; }
.boardrow__chips .trophy__glyph { width: 0.85rem; height: 0.85rem; }

.boardrow__days { font-size: 0.78rem; color: var(--ink-faint); flex: none; }

.boardrow__total {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  flex: none;
  min-width: 3rem;
  text-align: right;
}

/* ---------- profile ---------- */

.profile { max-width: 34rem; margin: 0 auto; }

.statgrid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.4rem;
}
.stat {
  text-align: center;
  padding: 0.7rem 0.2rem;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}
.stat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}
.stat small { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-faint); }

.shelf {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.8rem;
}
.shelf__slot {
  text-align: center;
  padding: 0.8rem 0.2rem 0.6rem;
  background: linear-gradient(180deg, #FFFDF6, var(--paper-raised));
  border: 1px solid rgba(184, 134, 11, 0.3);
  border-radius: 0.6rem;
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
}
.shelf__slot--empty { opacity: 0.45; background: var(--paper-raised); border-color: var(--line); }
.shelf__slot .trophy__glyph { width: 1.5rem; height: 1.5rem; }
.shelf__slot b { font-family: var(--font-display); font-size: 1.25rem; }
.shelf__slot small { font-size: 0.62rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-faint); }

.profile__heading {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  display: flex; align-items: baseline; gap: 0.5rem;
}
.profile__count { color: var(--ink-faint); font-family: var(--font-ui); font-size: 0.8rem; font-weight: 600; }
.profile__note { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 0.7rem; }

.history { list-style: none; margin-bottom: 1.8rem; }
.history__row {
  display: flex; align-items: center; gap: 0.8rem;
  padding: 0.5rem 0.2rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.history__date { width: 3.6rem; flex: none; color: var(--ink-soft); font-size: 0.82rem; }
.history__words { flex: 1; display: flex; gap: 0.35rem; flex-wrap: wrap; }
.history__score { font-weight: 700; font-variant-numeric: tabular-nums; }

.graveyard { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.8rem; }

/* ---------- account (name + recovery code) ---------- */

.textfield {
  font: inherit;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--paper-raised);
  color: var(--ink);
  min-width: 0;
}
.textfield:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }

.account__name { margin-bottom: 1.2rem; }
.account__row { display: flex; align-items: center; gap: 0.5rem; }
.account__input { flex: 1; }

.handle-status {
  min-height: 1.15rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
}
.handle-status__msg--err { color: var(--red); }
.handle-status__msg--ok { color: var(--gold-deep); }

.codebox {
  display: flex; align-items: center; gap: 0.5rem;
  margin-bottom: 0.7rem;
}
.codebox__code {
  flex: 1;
  padding: 0.55rem 0.7rem;
  border: 1px dashed var(--line);
  border-radius: 0.55rem;
  background: var(--paper-raised);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  overflow-wrap: anywhere;
}
.codebox__code--masked {
  filter: blur(6px);
  user-select: none;
}

/* ---------- onboarding name step (help modal) ---------- */

.namestep { border-top: 1px solid var(--line); padding-top: 1.1rem; }
.namestep__label {
  display: block;
  font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint);
  margin-bottom: 0.45rem;
}
.namestep__row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.45rem; }
.namestep__input { flex: 1; }
.namestep__hint { font-size: 0.8rem; color: var(--ink-soft); margin-bottom: 0.9rem; }

/* ---------- account recovery page ---------- */

.recover { max-width: 26rem; margin: 0 auto; }
.recover__lede { font-size: 0.92rem; color: var(--ink-soft); margin-bottom: 1.1rem; }
.recover__form { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.1rem; }
.recover__input { font-size: 0.9rem; }

/* ---------- help modal ---------- */

.modal { position: fixed; inset: 0; z-index: 70; }
.modal[hidden] { display: none; }
.modal__scrim { position: absolute; inset: 0; background: rgba(25, 24, 23, 0.5); }

.modal__card {
  position: relative;
  max-width: 26rem;
  margin: 7vh auto 0;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--paper-raised);
  border-radius: 1rem;
  padding: 2rem 1.7rem 1.7rem;
  box-shadow: 0 24px 80px rgba(40, 35, 20, 0.3);
  animation: modal-in 0.25s ease-out;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(1rem); } }

.modal__close { position: absolute; top: 0.7rem; right: 0.7rem; }

.wordmark--modal { font-size: 1.7rem; justify-content: center; display: flex; }
.modal__tag {
  text-align: center;
  font-size: 0.9rem;
  color: var(--ink-soft);
  margin: 0.2rem 0 1.4rem;
}

/* the how-to-play demo: a miniature round that plays itself (demo_controller) */

.hero {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.45rem;
  width: fit-content;
  margin: 0 auto 1.1rem;
}

.hero__row { display: flex; align-items: center; gap: 0.25rem; min-height: 1.9rem; }

.hero .tile--demo { border-color: var(--line-strong); transition: border-color 0.12s, background 0.12s, color 0.12s; }
.hero .tile--demo.is-filled { border-color: var(--ink); }
.hero .tile--demo.tile--conflict { border-color: var(--red); }

.hero__chip { margin-left: 0.45rem; white-space: nowrap; }
.hero__chip--pop { animation: chip-pop 0.25s ease-out; }
@keyframes chip-pop { from { opacity: 0; transform: scale(0.6); } }

.hero__caption { font-size: 0.9rem; color: var(--ink-soft); text-align: center; }
.hero__caption b { color: var(--ink); }
.hero__foot {
  font-size: 0.78rem; color: var(--ink-faint);
  text-align: center; margin: 0.4rem 0 1.3rem;
}

/* ---------- dev toolbar ---------- */

.devbar {
  position: fixed;
  left: 0.8rem; bottom: 0.8rem;
  z-index: 80;
  font-size: 0.75rem;
}
.devbar summary {
  list-style: none;
  cursor: pointer;
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-weight: 700;
  letter-spacing: 0.06em;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.devbar summary::-webkit-details-marker { display: none; }
.devbar[open] summary, .devbar summary:hover { opacity: 1; }

.devbar__panel {
  position: absolute;
  bottom: 3rem; left: 0;
  width: 12.5rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0.7rem;
  padding: 0.7rem;
  display: flex; flex-direction: column; gap: 0.35rem;
  box-shadow: var(--shadow);
}
.devbar__state { color: #B9B4A9; margin-bottom: 0.2rem; }
.devbar__state b { color: var(--gold-bright); }

.devbar__panel form button {
  width: 100%;
  text-align: left;
  padding: 0.4rem 0.6rem;
  border-radius: 0.4rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--paper);
  font-size: 0.75rem;
  font-weight: 600;
}
.devbar__panel form button:hover { background: rgba(255, 255, 255, 0.16); }
.devbar__panel form.devbar__btn--on button { background: var(--gold-deep); }
.devbar__panel form.devbar__btn--danger button { color: #F3A9A9; }

/* ---------- responsive ---------- */

@media (max-width: 420px) {
  :root { --tile: 2.9rem; }
  .stat b { font-size: 1.2rem; }
  .statgrid, .shelf { gap: 0.25rem; }
  .boardrow { gap: 0.5rem; padding: 0.55rem 0.5rem; }
  .boardrow__chips { gap: 0.3rem; }
  .boardrow__chips .trophy small { display: none; }
}

@media (min-width: 640px) {
  .round__title { font-size: 1.85rem; }
}

/* the inline row note only fits on wider screens */
@media (min-width: 720px) {
  .pyramid__note:not(:empty) { display: block; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
