:root {
  --bg: #11151c;
  --panel: #1b212b;
  --ink: #e8edf2;
  --muted: #9aa7b4;
  --accent: #ffb454;
  --good: #4caf50;
  --bad: #e5534b;
  --line: #2c3543;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}
header { text-align: center; padding: 1.5rem 1rem 0.5rem; }
h1 { margin: 0; letter-spacing: 0.04em; font-size: 2rem; }
.tagline { color: var(--muted); margin: 0.35rem 0 0; font-size: 0.95rem; }
main { width: min(560px, 94vw); padding: 1rem; }

.stage { margin: 0 0 1rem; }
.img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
}
#photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* blur is set inline by JS; transition makes the reveal feel good */
  transition: filter 0.6s ease;
  filter: blur(22px);
}
.credit {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(0, 0, 0, 0.45);
  padding: 1px 6px;
  border-radius: 6px;
}
.pips { display: flex; gap: 6px; justify-content: center; margin-top: 0.6rem; }
.pip {
  width: 26px; height: 8px; border-radius: 4px;
  background: var(--line);
}
.pip.used { background: var(--bad); }
.pip.win { background: var(--good); }

#guess-form { display: flex; gap: 8px; }
#guess-input {
  flex: 1;
  padding: 0.7rem 0.8rem;
  font-size: 1rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
#guess-input:focus { outline: 2px solid var(--accent); }
#guess-btn {
  padding: 0 1.1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #1a1206;
  cursor: pointer;
}
#guess-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.history { list-style: none; padding: 0; margin: 0.9rem 0 0; }
.history li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.55rem 0.75rem;
  margin-bottom: 6px;
  border-radius: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
}
.history li .mark { font-weight: 700; }
.history li.miss .mark { color: var(--bad); }
.history li.hit .mark { color: var(--good); }

.result { margin-top: 1.2rem; text-align: center; }
.result h2 { margin: 0 0 0.3rem; }
#result-answer { color: var(--muted); margin: 0 0 0.8rem; }
#share-btn {
  padding: 0.6rem 1.2rem; font-weight: 600; border: none; border-radius: 10px;
  background: var(--good); color: #06210a; cursor: pointer;
}
.stats { margin-top: 1rem; display: grid; gap: 4px; text-align: left; }
.bar-row { display: grid; grid-template-columns: 1.5rem 1fr; gap: 8px; align-items: center; font-size: 0.85rem; }
.bar { background: var(--accent); color: #1a1206; padding: 1px 6px; border-radius: 4px; min-width: 1.4rem; text-align: right; }
.bar.zero { background: var(--line); color: var(--muted); }

.board { margin-top: 1.5rem; border-top: 1px solid var(--line); padding-top: 0.8rem; }
.board summary { cursor: pointer; font-weight: 600; }
.name-row { display: flex; gap: 8px; align-items: center; margin: 0.7rem 0; font-size: 0.9rem; color: var(--muted); }
.name-row input { flex: 1; padding: 0.4rem 0.6rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); }
#leaderboard { margin: 0; padding-left: 1.4rem; color: var(--ink); }
#leaderboard li { margin-bottom: 4px; }
#leaderboard .streak { color: var(--accent); font-weight: 600; }

footer { color: var(--muted); font-size: 0.8rem; padding: 1.5rem; text-align: center; }
.hidden { display: none; }
