.wrap { max-width: 1040px; margin: 0 auto; padding-block: 24px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 20px; }
.wrap h1 { font-size: 26px; font-weight: 700; margin: 0; text-wrap: balance; }
.wrap h2 { font-size: 19px; font-weight: 700; margin: 0; text-wrap: balance; }
.wrap p { margin: 0; max-width: 68ch; }
.wrap .muted { color: var(--muted); }
.wrap .small { font-size: 13px; }
.wrap .label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--teal); }
.wrap .head { display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: flex-end; justify-content: space-between; }
.wrap .head > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wrap .games { display: flex; gap: 6px; flex-wrap: wrap; }
.wrap .balls { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.wrap .ball { width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; background: var(--teal); color: var(--on-teal); flex: none; }
.wrap .ball.ring { background: var(--surface); color: var(--ink); border: 2px solid var(--line); }
.wrap .ball.dup, .wrap .ball.bonus { background: var(--coral); }
.wrap .ball.sm { width: 28px; height: 28px; font-size: 12px; }
.wrap td .balls { flex-wrap: nowrap; }
.wrap nav { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.wrap nav a { padding: 8px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; border: 1px solid transparent; }
.wrap nav a[aria-current="page"] { background: var(--teal); color: var(--on-teal); }
.wrap nav a:not([aria-current="page"]):hover { border-color: var(--line); color: var(--ink); }
.wrap a:focus-visible, .wrap button:focus-visible, .wrap input:focus-visible, .wrap select:focus-visible, .wrap th:focus-visible, .wrap canvas:focus-visible {
  outline: 2px solid var(--teal); outline-offset: 2px; }
.wrap [hidden] { display: none !important; }
.wrap section { display: flex; flex-direction: column; gap: 16px; }
.wrap .panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px;
  display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wrap .row { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; }
.wrap button, .wrap select, .wrap input { font: inherit; color: var(--ink); }
.wrap button { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; cursor: pointer; font-weight: 600; }
.wrap button:hover { border-color: var(--teal); }
.wrap button[aria-pressed="true"] { background: var(--teal); color: var(--on-teal); border-color: var(--teal); }
.wrap input[type="number"], .wrap input[type="text"], .wrap select { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
.wrap .slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.wrap .slots.narrow { grid-template-columns: repeat(auto-fit, minmax(64px, 96px)); }
.wrap .slot { display: flex; flex-direction: column; gap: 6px; align-items: stretch; background: var(--bg); border-radius: 10px; padding: 10px 8px; min-width: 0; }
.wrap .slot label { font-size: 11px; color: var(--muted); display: flex; flex-direction: column; gap: 3px; }
.wrap .slot input { width: 100%; box-sizing: border-box; text-align: center; font-weight: 700; }
.wrap .slot .from { text-align: center; font-size: 12px; color: var(--muted); }
@media (max-width: 520px) {
.wrap .slots { gap: 5px; }
.wrap .slot { padding: 8px 4px; }
.wrap .slot input { padding: 6px 2px; }
}
.wrap .facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.wrap .fact { background: var(--bg); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wrap .fact b { font-size: 20px; }
.wrap .scroll { overflow-x: auto; }
.wrap table { border-collapse: collapse; width: 100%; font-size: 14px; }
.wrap th, .wrap td { padding: 7px 10px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.wrap th:first-child, .wrap td:first-child, .wrap th.l, .wrap td.l { text-align: left; }
.wrap td.wrapcell { white-space: normal; min-width: 180px; }
.wrap th { font-size: 12px; color: var(--muted); font-weight: 700; background: var(--surface); }
.wrap th[data-k] { cursor: pointer; user-select: none; }
.wrap th[data-k]:hover { color: var(--ink); }
.wrap th.sorted::after { content: " \25BE"; }
.wrap th.sorted.asc::after { content: " \25B4"; }
.wrap .heatcell { border-radius: 6px; padding: 2px 8px; display: inline-block; min-width: 44px; text-align: center; font-weight: 600; }
.wrap .bar { display: inline-block; height: 10px; border-radius: 3px; background: var(--teal); vertical-align: middle; }
.wrap .bar.neg { background: var(--coral); }
.wrap svg text { fill: var(--muted); font-family: var(--font); font-size: 11px; }
.wrap .note { border-left: 3px solid var(--coral); padding: 4px 0 4px 12px; }
.wrap canvas { max-width: 100%; touch-action: manipulation; cursor: crosshair; }
.wrap .warn { color: var(--coral); font-weight: 600; }
.wrap textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; box-sizing: border-box; min-height: 92px; resize: vertical; }
.wrap tr.pickable { cursor: pointer; }
.wrap tr.pickable:hover td { background: var(--bg); }
.wrap tr.chosen td { background: var(--teal-soft); }
.wrap .strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.wrap .strip span { border-radius: 6px; padding: 4px 0; text-align: center; font-size: 12px; font-weight: 600; }
.wrap .pill { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; border: 1px solid var(--line); }
.wrap .pill.high { background: var(--coral); color: var(--on-teal); border-color: var(--coral); }
.wrap .pill.low { background: var(--teal-soft); }
.wrap ul.plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }

/* Site build: square the tools up with the rest of the site. */
.wrap { max-width: 1120px; }
.wrap .panel, .wrap .fact, .wrap .slot { border-radius: 4px; }
.wrap .fact { box-shadow: none; }
.wrap .panel { border-top: 1px solid var(--line); }
.wrap button, .wrap input, .wrap select, .wrap textarea { border-radius: 6px; }
.wrap nav a { border-radius: 6px; }
/* Drawn numbers are white balls, as on the results pages; the visitor's own numbers and matches are filled. */
.wrap .ball { font-family: var(--mono); color: var(--accent-ink); background: var(--accent); border: 1px solid var(--accent); }
.wrap .ball.ring { color: #0B1F33; background: radial-gradient(circle at 32% 28%, #FFFFFF 0, #F1F4F8 55%, #D6DDE6 100%); border: 1px solid #B9C4D0; }
.wrap .ball.bonus { color: #FFFFFF; background: radial-gradient(circle at 32% 28%, #F25A6A 0, #C8102E 55%, #8F0C1F 100%); border-color: #7A0A1A; }
.wrap .ball.dup { color: #FFFFFF; background: var(--coral); border-color: var(--coral); }
.wrap .label { font-family: var(--mono); color: var(--muted); }
.wrap table, .wrap .heatcell { font-variant-numeric: tabular-nums; }
/* The tools sit under the lattice on Pick & test, which chooses the game. */
.wrap #games { display: none; }
.wrap { padding: 0; max-width: none; min-width: 0; width: 100%; }
.wrap > * { min-width: 0; max-width: 100%; }
.wrap .tools-title { margin: 0; font-size: 24px; }
