:root {
  --bg: #0d0f14;
  --surface: #151922;
  --surface-2: #1c2230;
  --border: #262d3d;
  --text: #e8ebf2;
  --muted: #8b94a8;
  --accent: #6c8cff;
  --accent-soft: rgba(108, 140, 255, .15);
  --red: #e0434b;
  --black: #2b303b;
  --green: #22a85a;
  --error: #ff7b7b;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main { max-width: 860px; margin: 0 auto; padding: 48px 20px 64px; }
h1 { margin: 0 0 24px; font-size: 1.1rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { display: block; width: 52px; height: auto; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* search ------------------------------------------------------------------------------- */

.search-box { display: block; }
#number {
  width: 100%;
  padding: 18px 22px;
  font: 600 1.8rem/1.2 inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
#number::placeholder { color: var(--muted); font-weight: 400; }
#number:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.options { display: flex; flex-wrap: wrap; gap: 20px 32px; margin-top: 18px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip, .chip-input {
  height: 36px;
  padding: 0 14px;
  font: inherit;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.chip:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed="true"] { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }
.chip-input { width: 84px; padding: 0 12px; text-align: center; cursor: text; }
.chip-input::placeholder { color: var(--muted); }
.chip-input.active { color: var(--text); background: var(--accent-soft); border-color: var(--accent); }

select {
  height: 36px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#number:focus-visible { outline: none; }

.status { min-height: 1.5em; margin: 20px 0; color: var(--muted); }
.status.error { color: var(--error); }

/* results ------------------------------------------------------------------------------ */

.headline { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.headline p { margin: 0; color: var(--muted); }

.ball {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 56px; height: 56px; padding: 0 10px;
  border-radius: 999px;
  font-size: 1.4rem; font-weight: 700; color: #fff;
}
.ball.Red { background: var(--red); }
.ball.Black { background: var(--black); box-shadow: inset 0 0 0 1px #414858; }
.ball.Green { background: var(--green); }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.card {
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.card .name { font-size: .8rem; color: var(--muted); }
.card .big { margin: 6px 0 2px; font-size: 2.6rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.card .big.none { color: var(--border); }
.card .meta { font-size: .8rem; color: var(--muted); }

table { width: 100%; margin-top: 28px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { padding-bottom: 10px; text-align: left; font-size: .8rem; color: var(--muted); }
th, td { padding: 12px 14px; text-align: center; border-top: 1px solid var(--border); }
thead th { border-top: 0; font-size: .75rem; font-weight: 500; color: var(--muted); }
th:first-child, td:first-child { text-align: left; }
tbody th { font-weight: 600; }
td.zero { color: #4a5266; }
td.hit { font-weight: 700; color: var(--accent); }

.note { margin: 14px 0 0; font-size: .8rem; color: var(--muted); }

@media (max-width: 560px) {
  main { padding-top: 28px; }
  #number { font-size: 1.4rem; padding: 14px 16px; }
  th, td { padding: 10px 6px; font-size: .85rem; }
}
