/* Statlas — mobile-first, dark-mode aware */
:root {
  --bg: #f7f7f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e2e2de;
  --accent: #2f6f4f;
  --accent-text: #ffffff;
  --hit: #d3efdd;
  --hit-line: #4caf7d;
  --near: #fdf3d0;
  --near-line: #d9a92c;
  --miss: #fbe2e0;
  --miss-line: #d96b62;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --card: #1d1d20;
    --text: #eceae6;
    --muted: #9a9a94;
    --line: #303034;
    --accent: #4caf7d;
    --accent-text: #10241a;
    --hit: #1d3a2b;
    --hit-line: #4caf7d;
    --near: #3a3315;
    --near-line: #d9a92c;
    --miss: #3d201e;
    --miss-line: #d96b62;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

.wrap { max-width: 30rem; margin: 0 auto; padding: 1.25rem 1rem 3rem; }

.top { text-align: center; margin-bottom: 1rem; }
h1 { font-size: 1.7rem; letter-spacing: 0.02em; }
.daynum { color: var(--muted); font-weight: 400; font-size: 1.1rem; }
.tagline { color: var(--muted); font-size: 0.9rem; }

.clues { list-style: none; display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.clue {
  display: flex; justify-content: space-between; gap: 0.75rem;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 0.6rem; padding: 0.55rem 0.8rem; font-size: 0.95rem;
}
.clue:not(.shown) { opacity: 0.55; }
.clue-label { color: var(--muted); }
.clue-value { font-weight: 600; text-align: right; }
.clue-value.locked { font-weight: 400; font-style: italic; color: var(--muted); font-size: 0.85rem; }

.input-row { display: flex; gap: 0.5rem; }
.input-wrap { position: relative; flex: 1; }
input[type="text"] {
  width: 100%; font-size: 1rem; padding: 0.65rem 0.8rem;
  border: 1px solid var(--line); border-radius: 0.6rem;
  background: var(--card); color: var(--text);
}
input[type="text"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
button {
  font-size: 1rem; padding: 0.65rem 1rem; border: none; border-radius: 0.6rem;
  background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer;
}
button:active { transform: translateY(1px); }

.suggestions {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 10;
  background: var(--card); border: 1px solid var(--line); border-radius: 0.6rem;
  overflow: hidden; box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}
.sug {
  display: block; width: 100%; text-align: left; background: none;
  color: var(--text); font-weight: 400; border-radius: 0;
  padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--line);
}
.sug:last-child { border-bottom: none; }
.sug:hover, .sug.active { background: var(--accent); color: var(--accent-text); }

.msg { min-height: 1.4rem; color: var(--miss-line); font-size: 0.9rem; margin-top: 0.35rem; }

.guesses { display: grid; gap: 0.4rem; margin-top: 0.25rem; }
.guess-row {
  display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
  border: 1px solid var(--line); border-radius: 0.6rem;
  padding: 0.55rem 0.8rem; min-height: 2.6rem; font-size: 0.95rem;
}
.guess-row.empty { border-style: dashed; opacity: 0.5; }
.guess-row.hit  { background: var(--hit);  border-color: var(--hit-line); }
.guess-row.near { background: var(--near); border-color: var(--near-line); }
.guess-row.miss { background: var(--miss); border-color: var(--miss-line); }
.guess-name { font-weight: 600; }
.guess-tag { font-size: 0.8rem; color: var(--muted); }

.endcard {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 0.8rem; padding: 1.25rem 1rem; margin-top: 0.5rem;
}
.endcard h2 { margin-bottom: 0.25rem; }
.share-grid {
  font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem;
  margin: 0.9rem auto; white-space: pre; line-height: 1.5;
}
.primary { padding: 0.65rem 2rem; }
.comeback { color: var(--muted); font-size: 0.85rem; margin-top: 0.8rem; }

.foot { margin-top: 2rem; color: var(--muted); font-size: 0.72rem; text-align: center; }
