:root {
  --bg: #faf7f0; --surface: #fff; --ink: #1a1a1a; --muted: #6b6b6b;
  --line: #e6e0d4; --accent: #c8102e; --radius: 14px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#14140f; --surface:#1e1e18; --ink:#f2efe6; --muted:#a19b8c; --line:#2e2e26; --accent:#ff5a6e; }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; overscroll-behavior: none;
}
.app {
  max-width: 480px; margin: 0 auto; min-height: 100svh;
  padding: max(12px, env(safe-area-inset-top)) 16px max(12px, env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.header { text-align: center; }
.logo { font-size: clamp(28px, 8vw, 40px); font-weight: 800; letter-spacing: -.02em; margin: 0; }
.logo .q { color: var(--accent); }
.clue { color: var(--muted); margin: 6px 0 0; font-size: 1.05rem; }
.clue b { color: var(--ink); }

.board-wrap { position: relative; width: 100%; aspect-ratio: 1 / 1; }
.board {
  width: 100%; height: 100%; display: block; border-radius: var(--radius);
  border: 1px solid var(--line); touch-action: none; cursor: crosshair; background: #888;
}
.marker {
  position: absolute; width: 22px; height: 22px; margin: -11px 0 0 -11px;
  border: 3px solid #fff; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 1.5px rgba(0,0,0,.6), 0 1px 4px rgba(0,0,0,.4);
}

.controls { display: flex; flex-direction: column; gap: 12px; }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-label { font-size: .85rem; color: var(--muted); width: 78px; }
input[type=range] { flex: 1; accent-color: var(--accent); }

.swatches { display: flex; align-items: center; gap: 14px; }
.swatch-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.swatch-label { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.swatch { width: 44px; height: 44px; border-radius: 10px; border: 1px solid var(--line); background: #888; }
.swatch.pick { width: 88px; height: 88px; border-radius: 14px; }
.swatch.big { width: 88px; height: 64px; }

.submit {
  flex: 1; padding: 14px 16px; font-size: 1rem; font-weight: 700; color: #fff;
  background: var(--accent); border: none; border-radius: 12px; cursor: pointer;
}
.submit:disabled { opacity: .4; cursor: not-allowed; }

.result { display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.compare { display: flex; gap: 24px; }
.score-line { margin: 4px 0 0; font-size: 1.1rem; }
.target-hex { margin: 0; color: var(--muted); font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .9rem; }
.copied { color: var(--accent); font-size: .85rem; margin: 0; }
.foot { margin-top: auto; text-align: center; color: var(--muted); font-size: .78rem; }
