/* Theming. Two palettes, switched by a `data-theme` attribute on <html>.
   A tiny inline script in <head> sets the attribute before paint to avoid
   a flash of wrong theme on slow first loads.

   :root must come BEFORE the [data-theme] rules so the attribute selectors
   (same specificity, but later in the source) win when toggling. */

:root {
  --bg: #121213;
  --surface: #1e1e20;
  --surface-2: #2a2a2d;
  --border: #3a3a3d;
  --text: #f5f5f5;
  --text-dim: #a0a0a5;
  --green: #538d4e;
  --yellow: #b59f3b;
  --gray: #3a3a3c;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --danger: #c0392b;
  --orange: #d27537;
  --tile-color: #f6ecd2;
  --op-color: #dbe6ff;
  --paren-color: #c8a8a8;
  --title-border: #2a4060;
  --error-text: #ff7d7d;
  --streak-color: #ff7d3b;
}

[data-theme="dark"] {
  --bg: #121213;
  --surface: #1e1e20;
  --surface-2: #2a2a2d;
  --border: #3a3a3d;
  --text: #f5f5f5;
  --text-dim: #a0a0a5;
  --green: #538d4e;
  --yellow: #b59f3b;
  --gray: #3a3a3c;
  --accent: #4f8cff;
  --accent-hover: #6ba0ff;
  --danger: #c0392b;
  --orange: #d27537;
  --tile-color: #f6ecd2;
  --op-color: #dbe6ff;
  --paren-color: #c8a8a8;
  --title-border: #2a4060;
  --error-text: #ff7d7d;
  --streak-color: #ff7d3b;
}

[data-theme="light"] {
  --bg: #fafafa;
  --surface: #ffffff;
  --surface-2: #f0f0f3;
  --border: #d4d4d8;
  --text: #18181b;
  --text-dim: #71717a;
  --green: #538d4e;
  --yellow: #8a7825;
  --gray: #d4d4d8;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --danger: #b91c1c;
  --orange: #c2410c;
  --tile-color: #8b6f3f;
  --op-color: #3b62a8;
  --paren-color: #8b6868;
  --title-border: #2a4060;
  --error-text: #b91c1c;
  --streak-color: #c2410c;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  min-height: 100vh;
}

/* Suppress browsers' double-tap-to-zoom on every interactive element. Setting
   touch-action on body alone isn't reliable in iOS Safari — it has to be on
   the tap target itself. Pinch-zoom is still allowed elsewhere. */
button, input, .tile, header h1 {
  touch-action: manipulation;
}

header {
  text-align: center;
  padding: 1.25rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.header-inner {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.puzzle-date {
  position: absolute;
  top: 0;
  left: 0;
  height: 2rem;
  display: flex;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-dim);
  letter-spacing: 0.01em;
}

.help-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.help-btn:hover { color: var(--text); border-color: var(--accent); }

.theme-btn {
  position: absolute;
  top: 0;
  right: 2.5rem;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
  padding: 0;
}
.theme-btn:hover { color: var(--text); border-color: var(--accent); }

header h1 {
  margin: 0;
  display: inline-block;
  padding: 0.35rem 1rem 0.45rem;
  border: 2px solid var(--title-border);
  border-radius: 10px;
  font-family: "Space Grotesk", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 2.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  background: linear-gradient(
    100deg,
    #2f6b3a 0%,
    #538d4e 35%,
    #7ec070 65%,
    #b8e6a8 100%
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  transition: filter 0.2s, transform 0.08s;
}
header h1:active {
  transform: scale(0.98);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.45));
}

.tagline {
  margin: 0.25rem 0 0.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Target banner — solo block at the top. Goal you're solving for. */
.target-banner {
  text-align: center;
  padding: 0.5rem 0;
}

.target-area, .current-area {
  text-align: center;
}

.target-label,
.current-label,
.guesses-label {
  font-size: 0.75rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.25rem;
}

.target-number,
.current-number {
  font-size: 3rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  transition: color 0.15s;
}

.target-number { color: var(--accent); }
.current-number { color: var(--text-dim); }
/* While the player is building an expression that computes to something,
 * the result reads in a dull gold — clearly "not the target yet" but
 * not failure either. Flips to bright green only on an exact match. */
.current-number.has-value { color: var(--yellow); }
.current-number.match     { color: var(--green); }

/* Timer bar */
.timer-section {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.timer-bar {
  display: flex;
  gap: 2px;
  height: 18px;
  border-radius: 4px;
  padding: 2px;
  background: var(--surface);
  border: 1px solid var(--border);
}
.timer-bar .cell {
  flex: 1 1 0;
  min-width: 0;
  background: var(--gray);
  border-radius: 1px;
  transition: background 0.15s;
}
/* Positional gradient: each cell's hue is set inline (0 = red, 120 = green)
   so the bar shows a smooth red→yellow→green sweep when full. The legacy
   warn/danger per-cell overrides are no longer needed — running out of time
   naturally exposes the red end of the bar. */
.timer-bar .cell.on        { background: hsl(var(--cell-hue, 120), 55%, 45%); }
.timer-bar.danger          { animation: pulse 0.8s ease-in-out infinite; }
.timer-readout {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.02); }
}

.start-area { display: flex; flex-direction: column; align-items: stretch; gap: 0.5rem; padding: 0.5rem 0; }
.start-area[hidden] { display: none; }

.locked-notice {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  text-align: center;
}
.locked-notice strong { display: block; font-size: 1.05rem; margin-bottom: 0.35rem; }
.locked-notice p { margin: 0.2rem 0; color: var(--text-dim); font-size: 0.9rem; }
.locked-notice .hint { font-size: 0.8rem; opacity: 0.85; }

.big {
  padding: 1rem 1.5rem !important;
  font-size: 1.1rem !important;
  width: 100%;
}

/* Start button — outlined to twin the title's stamped look. Transparent
   fill keeps the timer bar as the lone solid-green block, and the blue
   Submit guess can own the "primary action" slot once a round is live. */
#startBtn {
  background: transparent;
  border: 2px solid #2f6b3a;
  color: #7ec070;
  border-radius: 10px;
  font-family: inherit;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
#startBtn:hover:not(:disabled) {
  background: rgba(83, 141, 78, 0.12);
  border-color: #538d4e;
  color: #b8e6a8;
}
#startBtn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Stats grid (streak / wins) */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 0.75rem 0;
}
.stats:empty { display: none; }
.stat {
  text-align: center;
  padding: 0.5rem 0.25rem;
  background: var(--surface-2);
  border-radius: 6px;
}
.stat .num {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.stat .lbl {
  font-size: 0.65rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.3rem;
}
.stat.streak .num { color: var(--streak-color); }

/* Guess history */
.guess-history {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.guess-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  background: var(--surface);
  border-left: 4px solid var(--gray);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
}

.guess-row.exact { border-left-color: var(--green); background: rgba(83, 141, 78, 0.15); }
.guess-row.close { border-left-color: var(--yellow); background: rgba(181, 159, 59, 0.12); }
.guess-row.far   { border-left-color: var(--gray); }

.guess-expr { color: var(--text-dim); flex: 1; overflow-x: auto; white-space: nowrap; }
.guess-result {
  font-weight: 700;
  color: var(--text);
  margin-left: 0.75rem;
  white-space: nowrap;
}

.guess-history:empty::before {
  content: "No guesses yet.";
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
}

/* Board — vertical stack of tiles / ops / results / submit, with a
 * consistent gap so each row has breathing room. */
.board {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Number tiles */
.numbers-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
}

.tile {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0;
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  transition: transform 0.08s, border-color 0.08s, background 0.08s;
  user-select: none;
  /* Warm cream in dark mode; darker caramel in light mode for contrast. */
  color: var(--tile-color);
  font-family: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.tile:hover:not(:disabled) { border-color: var(--accent); }
.tile:active:not(:disabled) { transform: scale(0.96); }
.tile.selected { border-color: var(--accent); background: rgba(79, 140, 255, 0.18); }
.tile.used { opacity: 0.3; cursor: not-allowed; text-decoration: line-through; }
.tile.derived { border-style: dashed; border-color: var(--accent); }
.tile.hidden-tile {
  color: var(--text-dim);
  background: var(--surface-2);
  border-style: dashed;
  opacity: 0.6;
}

/* Results box — sits between operators and submit. Wraps the in-progress
 * expression, the live computed "Yours" value, and inline edit controls
 * (Clear + ⌫). Reads as one "equation in progress" block. */
.results-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Equals row — Clear on the left, the big "=" divider centred,
 * ⌫ on the right. Uses a 3-column grid (1fr auto 1fr) so the divider
 * is dead-centred in the row regardless of the buttons' different
 * widths; each button is anchored to its outer edge via justify-self. */
.equals-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0 0.1rem;
}
.equals-row > .edit-btn:first-child { justify-self: start; }
.equals-row > .edit-btn:last-child  { justify-self: end; }
.equals-divider {
  width: 64px;
  height: 10px;
  border-top: 3px solid var(--text-dim);
  border-bottom: 3px solid var(--text-dim);
  user-select: none;
  pointer-events: none;
}

/* Result line — centred, sits below the equals-divider. The result
 * number now stands alone since the equals "label" became the divider. */
.results-equals {
  display: flex;
  align-items: baseline;
  justify-content: center;
  padding: 0.15rem 0;
}
.results-equals .current-number {
  font-size: 1.8rem;
  line-height: 1;
}

/* Edit buttons (Clear + ⌫). Shared styling regardless of which row they
 * live in. */
.edit-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-width: 2.4rem;
}
.edit-btn:hover:not(:disabled) { border-color: var(--accent); }
.edit-btn:active:not(:disabled) { transform: scale(0.96); }
.edit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Expression wrap — positioning context for the marquee hint that
 * overlays the empty input. */
.expr-wrap {
  position: relative;
}

/* Marquee-scrolling hint. Shown when #exprInput is empty (placeholder
 * is a single space so :placeholder-shown matches but the placeholder
 * itself is invisible). Hidden once the player taps the first tile. */
.expr-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  color: var(--text-dim);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.05rem;
  border-radius: 6px;
}
.expr-hint span {
  display: inline-block;
  /* Starts off-screen right, scrolls leftward across the visible area,
   * exits off-screen left, then loops. Slow enough to read comfortably. */
  animation: expr-hint-scroll 14s linear infinite;
  will-change: transform;
}
@keyframes expr-hint-scroll {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}
/* Hide the marquee once the expression has content. */
.expr-wrap:has(#exprInput:not(:placeholder-shown)) .expr-hint {
  display: none;
}

/* Accessibility-only helper — visible to screen readers, removed from
 * the visual layout. The marquee is aria-hidden, so this preserves the
 * instruction for assistive tech without showing it twice on screen. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.results-edit button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  min-width: 2.4rem;
}
.results-edit button:hover:not(:disabled) { border-color: var(--accent); }
.results-edit button:active:not(:disabled) { transform: scale(0.96); }
.results-edit button:disabled { opacity: 0.4; cursor: not-allowed; }

/* Builder area (legacy — wrapper still exists in older builds, keep
 * the class around so script.js doesn't choke on lookups elsewhere) */
.builder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem;
}

#exprInput {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 1.2rem;
  padding: 0.6rem 0.75rem;
  border-radius: 6px;
  outline: none;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  text-align: center;
}
#exprInput::placeholder { color: var(--text-dim); }

.builder-hint {
  color: var(--text-dim);
  font-size: 0.8rem;
  margin-top: 0.4rem;
}

/* Operators */
.operators {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.4rem;
}

.op-btn {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 1.5rem;
  padding: 0.6rem 0;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
}
.op-btn:hover:not(:disabled) { border-color: var(--accent); }
.op-btn:active:not(:disabled) { transform: scale(0.96); }
.op-btn.selected { background: var(--accent); border-color: var(--accent); color: white; }
.op-btn:disabled { opacity: 0.4; cursor: not-allowed; }
/* Math operators in a pale blue-white so they quietly echo the accent
   palette (target number, Submit) without competing. */
.op-btn[data-op="+"],
.op-btn[data-op="−"],
.op-btn[data-op="×"],
.op-btn[data-op="÷"] {
  color: var(--op-color);
}
/* Parentheses sit slightly darker with a hint of dusty rose — they're
   structural punctuation, so they recede behind the operators and tiles. */
.op-btn[data-op="("],
.op-btn[data-op=")"] {
  color: var(--paren-color);
}

/* Hint row sits between the results box and Submit. Secondary affordance
   that stays out of the way until the player wants it. */
.hint-row {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  align-items: stretch;
}
/* Setting display: flex above overrides the UA stylesheet's
   [hidden] { display: none }, so we have to re-assert it. Without this
   the hint button is visible in the idle phase before Start is pressed.
   Also accept a class-based hide for cases where a third-party rule
   might out-specify [hidden]. */
.hint-row[hidden],
.hint-row.is-hidden { display: none; }
.hint-btn {
  align-self: center;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hint-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.hint-btn:active:not(:disabled) { transform: scale(0.96); }
.hint-btn:disabled { opacity: 0.5; cursor: default; }
.hint-display {
  text-align: center;
  font-size: 0.9rem;
  color: var(--accent);
  font-style: italic;
  line-height: 1.4;
  /* Cumulative reveal stacks multiple lines of hint text; pre-line
     keeps the \n separators rendering as visual line breaks. */
  white-space: pre-line;
}

/* Controls — Submit guess alone now (Clear + ⌫ live inside .results-box). */
.controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.4rem;
}

.controls button {
  padding: 0.9rem 0.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  font-size: 1.05rem;
}
.controls button:hover:not(:disabled) { border-color: var(--accent); }
.controls button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.controls button.primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.controls button:disabled { opacity: 0.6; cursor: not-allowed; }
/* Muted = still clickable but signalled as 'not ready yet'. Tap fires a
   helper message instead of trying to evaluate an empty expression. */
.controls button.muted { opacity: 0.6; }

.status {
  text-align: center;
  min-height: 1.4em;
  color: var(--text-dim);
  font-size: 0.9rem;
}
.status.error { color: var(--error-text); }
.status.ok { color: var(--accent); }

/* End modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}
.modal[hidden] { display: none; }
.modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1.5rem;
  border-radius: 10px;
  max-width: 420px;
  width: calc(100% - 2rem);
  text-align: center;
}
.modal-content h2 { margin-top: 0; }
.modal-content p { white-space: pre-line; }
.modal-content button { padding: 0.7rem 1.5rem; font-family: inherit; font-size: 1rem; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 8px; cursor: pointer; font-weight: 600; }
.modal-content button.primary { background: var(--accent); border-color: var(--accent); color: white; }
.modal-content button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.modal-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.solution {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.9rem;
  color: var(--text-dim);
  margin: 0.5rem 0;
}
.solution:empty { display: none; }
.solution .lbl { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 0.2rem; }
.solution .expr { color: var(--text); }

.intro-list {
  text-align: left;
  margin: 0.75rem 0;
  padding-left: 1.25rem;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.5;
}
.intro-list li { margin-bottom: 0.4rem; }
.intro-list strong { color: var(--text); }

.intro-example {
  background: var(--surface-2);
  border-radius: 6px;
  padding: 0.55rem 0.75rem;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.9rem;
  color: var(--text-dim);
}
.intro-example code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  color: var(--text);
}

.share-bar {
  font-size: 1.4rem;
  letter-spacing: 0.04em;
  line-height: 1;
  margin: 0.75rem 0 0.25rem;
  text-align: center;
  white-space: nowrap;
}
.share-bar:empty { display: none; }

.share-legend {
  margin-top: 0.6rem;
  text-align: left;
  background: var(--surface-2);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}
.share-legend summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}
.share-legend summary::-webkit-details-marker { display: none; }
.share-legend summary::before {
  content: "▸";
  display: inline-block;
  width: 1em;
  color: var(--text-dim);
}
.share-legend[open] summary::before { content: "▾"; }
.share-legend ul {
  margin: 0.5rem 0 0.25rem;
  padding-left: 0;
  list-style: none;
}
.share-legend li {
  padding: 0.15rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.share-legend .sq { font-size: 1rem; line-height: 1; }
.share-legend .legend-foot {
  margin: 0.4rem 0 0;
  font-size: 0.8rem;
  font-style: italic;
}

@media (max-width: 420px) {
  .tile { font-size: 1.1rem; }
  .target-number, .current-number { font-size: 2.4rem; }
  header h1 { font-size: 2.1rem; letter-spacing: 0.1em; }
}
