:root {
  --ink: #1c140e;
  --paper: #efe6d6;
  --line: #d4c6b0;
  --stamp: #8d1f1f;
  --deep: #14352c;
  --muted: #6e6256;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: "Iowan Old Style", Palatino, "Palatino Linotype", Georgia, serif;
  min-height: 100%;
}

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.kicker, .label, .clock, button, .stamps span, .depth-note {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker {
  margin: 0;
  font-size: 11px;
  color: var(--stamp);
}

h1 {
  margin: 6px 0 0;
  font-weight: 500;
  font-size: clamp(52px, 14vw, 84px);
  letter-spacing: -0.045em;
  line-height: 0.9;
}

.dek {
  margin: 10px 0 0;
  font-size: 20px;
}

.depth {
  margin: 28px 0 0;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  font-size: clamp(72px, 18vw, 112px);
  letter-spacing: -0.06em;
  line-height: 0.85;
  font-variant-numeric: tabular-nums;
}

.depth span {
  font-size: 0.35em;
  letter-spacing: 0;
  margin-left: 4px;
}

.depth.rare { color: var(--deep); }

.depth-note, .albania, .rule, .end-line, .rarest {
  color: var(--muted);
}

.depth-note { margin: 8px 0 28px; font-size: 11px; }

.definition {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: bit;
  border-top: 1px solid var(--ink);
}

.definition li {
  counter-increment: bit;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
}

.definition li::before {
  content: counter(bit, decimal-leading-zero);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-right: 12px;
  color: var(--stamp);
}

.albania, .rule { font-size: 17px; line-height: 1.4; }

button, input {
  font: inherit;
  color: inherit;
}

button {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  padding: 14px 18px;
  font-size: 12px;
  cursor: pointer;
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}

button:disabled { opacity: 0.45; cursor: default; }

.go, .end-actions button { width: 100%; }

form {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

input {
  flex: 1;
  min-width: 0;
  font-size: 18px;
  padding: 12px 0;
  border: 0;
  border-bottom: 2px solid var(--ink);
  background: transparent;
  border-radius: 0;
}

input:focus { outline: none; border-bottom-color: var(--stamp); }

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.turn-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.turn-row p, .label { margin: 0; font-size: 11px; }

.clock { font-variant-numeric: tabular-nums; }

.timebar {
  height: 2px;
  background: var(--line);
  margin: 10px 0 18px;
}

.timebar span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--stamp);
  transform-origin: left center;
}

.prompt {
  margin: 0;
  font-size: clamp(26px, 6vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.ask { margin: 12px 0 0; }

.options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.options button { width: auto; }

.card {
  margin-top: 14px;
  padding: 12px 0 4px;
  border-top: 1px solid var(--line);
}

.card strong {
  display: block;
  font-size: 22px;
  font-weight: 500;
}

.card .metres {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-size: 28px;
}

.card p { margin: 6px 0; line-height: 1.35; }

.card .note { color: var(--muted); font-size: 15px; }

.stamps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.stamps span {
  font-size: 10px;
  border: 1px solid var(--line);
  padding: 4px 6px;
  color: var(--muted);
}

.card.miss strong, .card.reject strong, .card.pass strong, .card.duplicate strong {
  font-size: 16px;
  color: var(--muted);
}

.end-line { font-size: 22px; color: var(--ink); margin-bottom: 0; }

.rarest { margin-top: 6px; }

.end-actions { display: grid; gap: 8px; margin-top: 18px; }

.copied { min-height: 1.2em; }

#board { margin: 8px 0 0; padding: 0; list-style: none; }

#board li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 8px 0;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 560px) {
  form { flex-direction: column; }
  form button { width: 100%; }
}
