/* Rootle — mobile-first, dark-mode aware. Palette/layout rail reused from
   foundry/game (Statlas); accent shifted to a bookish indigo. */
:root {
  --bg: #f7f6f3;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e2e0da;
  --accent: #4f46a0;
  --accent-text: #ffffff;
  --hit: #d3efdd;
  --hit-line: #4caf7d;
  --miss: #fbe2e0;
  --miss-line: #d96b62;
  --reveal: #e4e1f7;
  --reveal-line: #4f46a0;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131315;
    --card: #1d1d20;
    --text: #eceae6;
    --muted: #9a9a94;
    --line: #303034;
    --accent: #8d84e0;
    --accent-text: #14122b;
    --hit: #1d3a2b;
    --hit-line: #4caf7d;
    --miss: #3d201e;
    --miss-line: #d96b62;
    --reveal: #262347;
    --reveal-line: #8d84e0;
  }
}

* { 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; }

.wordcard {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 0.8rem; padding: 1rem; margin-bottom: 1.1rem;
}
.wordlabel { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.the-word { font-size: 2.1rem; font-weight: 700; letter-spacing: 0.01em; }

.round-title { font-size: 1rem; margin: 0.9rem 0 0.5rem; }

.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.45rem; }
.choices.eras { grid-template-columns: 1fr; }
.choice {
  font-size: 0.95rem; padding: 0.6rem 0.6rem; border: 1px solid var(--line);
  border-radius: 0.6rem; background: var(--card); color: var(--text);
  font-weight: 600; cursor: pointer; text-align: center;
}
.choice:active { transform: translateY(1px); }
.choice:disabled { cursor: default; opacity: 0.9; }
.choice.hit  { background: var(--hit);  border-color: var(--hit-line); }
.choice.miss { background: var(--miss); border-color: var(--miss-line); text-decoration: line-through; }
.choice.reveal { background: var(--reveal); border-color: var(--reveal-line); }

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

.endcard {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: 0.8rem; padding: 1.25rem 1rem; margin-top: 1rem;
}
.endcard h2 { margin-bottom: 0.6rem; }

.chain-label { color: var(--muted); font-size: 0.85rem; margin-bottom: 0.4rem; }
.chain { list-style: none; text-align: left; display: grid; gap: 0.35rem; margin-bottom: 0.8rem; }
.step {
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: 0.5rem; padding: 0.45rem 0.7rem; font-size: 0.92rem;
}
.step-lang { display: block; color: var(--muted); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; }
.step-form { font-weight: 700; font-style: italic; margin-right: 0.4rem; }
.step-gloss { color: var(--muted); }

.shift { font-size: 0.92rem; text-align: left; margin-bottom: 0.6rem; }
.fact {
  font-size: 0.92rem; text-align: left; background: var(--reveal);
  border: 1px solid var(--reveal-line); border-radius: 0.5rem; padding: 0.55rem 0.7rem;
  margin-bottom: 0.6rem;
}
.source { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.4rem; }
.source a { color: var(--accent); }

.share-grid {
  font-family: ui-monospace, Menlo, monospace; font-size: 1.05rem;
  margin: 0.9rem auto; white-space: pre; line-height: 1.5;
}
button.primary {
  font-size: 1rem; padding: 0.65rem 2rem; border: none; border-radius: 0.6rem;
  background: var(--accent); color: var(--accent-text); font-weight: 600; cursor: pointer;
}
button.primary:active { transform: translateY(1px); }
.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; }
.foot a { color: var(--muted); }
