/* VntyPl8 look: a clean page, near-black type, and the plate as the one colorful object. */
:root {
  --bg: #ffffff;
  --ink: #121212;
  --muted: #6e6e73;
  --rule: #e3e3e6;
  --surface: #f5f5f6;
  --key: #e7e7ea;
  --key-ink: #16264a;
  --btn: #121212;
  --btn-ink: #ffffff;
  --off: #d8d8dc;

  --plate: #f7f5ee;
  --plate-edge: #1d3b6e;
  --plate-ink: #16264a;
  --plate-red: #b8282e;

  --green: #2f9e5a;
  --red: #d64539;
  --yellow: #e3ad1f;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121213; --ink: #f2f2f3; --muted: #9b9ba1; --rule: #2c2c2f; --surface: #1d1d20;
    --key: #3a3a3e; --key-ink: #f2f2f3; --btn: #f2f2f3; --btn-ink: #121212; --off: #3a3a3e;
    color-scheme: dark;
  }
}
/* Chosen in Your stats > Appearance. */
:root[data-theme="dark"] {
  --bg: #121213; --ink: #f2f2f3; --muted: #9b9ba1; --rule: #2c2c2f; --surface: #1d1d20;
  --key: #3a3a3e; --key-ink: #f2f2f3; --btn: #f2f2f3; --btn-ink: #121212; --off: #3a3a3e;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
  min-height: 100vh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
a { color: inherit; }

.app { max-width: 480px; margin: 0 auto; padding: 0 16px 48px; }

/* ---------- header ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; border-bottom: 1px solid var(--rule); margin: 0 -16px; padding: 0 16px;
}
.logo { margin: 0; line-height: 1; }
.logo-plate {
  display: inline-block; padding: 6px 9px 4px; border-radius: 6px;
  background: var(--plate); border: 2px solid var(--plate-edge);
  box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge);
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; font-size: 18px;
  letter-spacing: .08em; color: var(--plate-ink);
}
.logo-plate .y { color: var(--plate-red); }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent;
  cursor: pointer; display: grid; place-items: center; color: var(--ink);
}
.icon-btn:hover { background: var(--surface); }
.icon-spacer { width: 36px; height: 36px; }

main { text-align: center; }

.demo-bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 8px;
  margin: 12px 0 0; padding: 8px 10px; border-radius: 10px; background: #fff4d1; color: #5a4300;
  font-size: 13px; font-weight: 600;
}
.demo-bar button {
  height: 30px; padding: 0 12px; border-radius: 999px; border: 1px solid #c9a43a; background: transparent;
  color: #5a4300; font-size: 13px; font-weight: 600; cursor: pointer;
}

.theme-label { margin: 28px 0 4px; color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; }
.theme { margin: 0 0 22px; font-size: 28px; font-weight: 800; letter-spacing: -.01em; }

/* ---------- the plate ---------- */
.plate {
  position: relative; margin: 0 auto; width: 100%; max-width: 440px;
  background: var(--plate); border-radius: var(--radius); border: 3px solid var(--plate-edge);
  box-shadow: inset 0 0 0 4px var(--plate), inset 0 0 0 5.5px var(--plate-edge), 0 1px 2px rgba(0,0,0,.08), 0 8px 24px rgba(0,0,0,.08);
  padding: 12px 14px 10px; overflow: hidden;
}
.plate-top { color: var(--plate-red); font-weight: 700; font-size: 12px; letter-spacing: .4em; }
.plate-bottom { color: var(--plate-edge); font-weight: 600; font-size: 10px; letter-spacing: .3em; margin-top: 8px; }
.bolt { position: absolute; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #fff, #a3a8af 60%, #777c84); }
.b1 { left: 22%; } .b2 { right: 22%; }

.slots { display: flex; justify-content: center; align-items: flex-start; gap: 4px; margin: 8px 0 2px; }
.slot {
  position: relative; flex: 1 1 0; max-width: 54px; height: 70px; border: 0; background: transparent;
  border-radius: 0; padding: 0; cursor: pointer; overflow: visible; display: block; vertical-align: top;
}
.slot::before { content: ""; position: absolute; left: 5px; right: 5px; bottom: 9px; height: 3px; border-radius: 2px; background: #d6d2c4; }
.slot.next::before { background: var(--plate-edge); animation: blink 1.1s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .3; } }
.slot.filled::before { display: none; }
.slot:disabled { cursor: default; }
.slot .ch {
  display: block; position: relative; z-index: 1; height: 70px;
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-feature-settings: "zero" 1;
  font-weight: 700; font-size: clamp(30px, 10vw, 46px); line-height: 70px; color: var(--plate-ink);
  text-shadow: 0 1px 0 #fff, 0 2px 2px rgba(0,0,0,.18);
}
.slot.locked .ch { color: #146b39; }
.slot.hinted .ch { color: #8c6400; }
.slot.reveal .ch { color: var(--plate-ink); }
/* After a loss: the spots you never got show the answer in red, with a red line to match the red lights */
.slot.reveal.missed .ch { color: var(--plate-red); }
.slot.reveal.missed::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -2px; height: 3px; border-radius: 2px; background: var(--red); }
.slot.locked::after, .slot.hinted::after {
  content: ""; position: absolute; left: 22%; right: 22%; bottom: -2px; height: 3px; border-radius: 2px; background: var(--green);
}
.slot.hinted::after { background: var(--yellow); }
.slot.hinted.filled::before {
  display: block; content: "HINT"; left: 0; right: 0; top: 2px; bottom: auto; height: auto; background: none;
  font: 700 9px/1 "Libre Franklin", system-ui, sans-serif; letter-spacing: .08em; color: #8c6400; text-align: center;
}
#helpTitle:focus { outline: none; }

.slot .skid {
  position: absolute; left: -10px; right: -10px; bottom: 16px; height: 22px; z-index: 0;
  background: linear-gradient(180deg, transparent 0 2px, rgba(28,28,28,.7) 2px 7px, transparent 7px 14px, rgba(28,28,28,.7) 14px 19px, transparent 19px);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 25%, #000 80%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 25%, #000 80%, transparent);
  filter: blur(.6px); transform: rotate(-7deg); transform-origin: left center;
  animation: skid .35s ease-out both;
}
@keyframes skid { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
/* A dark tire scuff under each wrong spot, where the green line goes for right ones */
.slot .skid.scuff {
  left: 12%; right: 12%; bottom: -6px; height: 12px; background: none; filter: none; transform: none;
  -webkit-mask-image: none; mask-image: none; animation: skid .3s ease-out both;
}
.slot .skid.scuff svg { display: block; width: 100%; height: 100%; }
.slot .skid.scuff path { fill: none; stroke: #3a3530; stroke-width: 3.5; stroke-linecap: round; opacity: .85; }
.slot.filled .skid.scuff { display: none; }
.slot.falling .ch { animation: fall .6s .2s ease-in both; }
@keyframes fall { 0% { transform: none; } 30% { transform: translateX(6px) rotate(8deg); } 100% { transform: translateY(160px) rotate(25deg); opacity: 0; } }

.plate.rumble { animation: rumble .12s linear infinite; }
@keyframes rumble { 0%,100% { transform: translate(0,0); } 25% { transform: translate(1px,-1px); } 75% { transform: translate(-1px,1px); } }

.ch.drive-off { animation: driveoff 1.3s cubic-bezier(.5,0,.5,1) both; }
@keyframes driveoff {
  0% { transform: none; }
  40% { transform: translateX(110vw); opacity: 1; }
  41% { transform: translateX(110vw); opacity: 0; }
  42% { transform: translateX(-110vw); opacity: 0; }
  43% { opacity: 1; }
  100% { transform: none; }
}
.slot.pop .ch { animation: pop .4s ease-out; }
@keyframes pop { 50% { transform: scale(1.25); } }

/* ---------- status and lights ---------- */
.status-row { margin: 18px 0 8px; }
.attempts { color: var(--muted); font-size: 14px; font-weight: 500; }
/* One dot per plate spot, lined up under its spot: same width, padding and gaps as the slots */
.lights { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 440px; margin: 0 auto; padding: 0 17px; box-sizing: border-box; }
.light-row { display: flex; justify-content: center; gap: 4px; }
.light-cell { flex: 1 1 0; max-width: 54px; display: flex; justify-content: center; }
.light { position: relative; display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: var(--off); }
.light.g { background: var(--green); }
.light.r { background: var(--red); }
.light.y { background: var(--yellow); }
/* Shapes inside the lights, so they work without telling red from green. */
.light.r::after { content: ""; position: absolute; left: 3px; right: 3px; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px; background: rgba(255,255,255,.9); }
.light.y::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255,255,255,.9); }
/* decoy mode: yellow means on the plate in another spot; a hint is a gray-blue light */
.light.w { background: var(--yellow); }
.light.h { background: #5b7a99; }
.light.h::after { content: ""; position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 50%; background: rgba(255,255,255,.9); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- tray ---------- */
.tray { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 26px 0 8px; }
.tile {
  width: 42px; height: 54px; border-radius: 6px; border: 0; cursor: pointer;
  background: var(--key); color: var(--key-ink);
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-feature-settings: "zero" 1; font-weight: 700; font-size: 26px;
  transition: transform .08s, background .15s;
}
.tile:hover { filter: brightness(.96); }
.tile:active { transform: scale(.94); }
.tile.used { visibility: hidden; }
/* decoy mode: ruled-out decoys stay visible but faded with a dashed edge (no strike line,
   which would make the letter O look like a slashed zero); known characters get a yellow bar */
.tile.out { background: transparent; color: var(--muted); opacity: .6; cursor: default;
  outline: 2px dashed var(--muted); outline-offset: -2px; }
.tile.out:active { transform: none; }
.tile.in { box-shadow: inset 0 -5px 0 var(--yellow); }
/* How to play shows only the rules for the mode being played (normal until the game loads) */
.rules-hard, .rules-decoy { display: none; }
.mode-hard .rules-normal, .mode-decoy .rules-normal { display: none; }
.mode-hard .rules-hard, .mode-decoy .rules-decoy { display: block; }
.tip { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

/* ---------- controls ---------- */
.controls { display: flex; gap: 10px; justify-content: center; align-items: center; margin-top: 22px; }
.hint-btn {
  height: 48px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--ink);
  background: transparent; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 600;
}
.hint-btn svg { width: 22px; height: 18px; }
.gauge text { font-family: "Libre Franklin", system-ui, sans-serif; }
.gauge .needle { transform-origin: 12px 16px; transition: transform .6s cubic-bezier(.3,1.6,.5,1); }
.hint-count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: var(--bg);
  font-size: 12px; font-weight: 700; line-height: 20px;
}
.hint-btn:disabled { border-color: var(--rule); color: var(--muted); cursor: default; }
.hint-btn:disabled .hint-count { background: var(--off); color: var(--muted); }
.drive-btn {
  flex: 1; max-width: 240px; height: 48px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--btn); color: var(--btn-ink); font-size: 16px; font-weight: 700; letter-spacing: .02em;
}
.drive-btn:disabled { background: var(--off); color: var(--muted); cursor: default; }
.drive-btn:not(:disabled):active { transform: scale(.98); }

/* ---------- end ---------- */
.end { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); }
.end-title { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.01em; }
.end-sub { margin: 6px 0 12px; color: var(--muted); }
.end-means { margin: 0 0 22px; font-size: 17px; }
.end-by { margin: -12px 0 22px; color: var(--muted); font-size: 14px; }
.mono { font-family: "Roboto Mono", ui-monospace, Menlo, monospace; letter-spacing: .04em; }
.stats { display: flex; justify-content: center; gap: 40px; margin: 0 0 24px; }
.stats div { display: flex; flex-direction: column; align-items: center; }
.stats b { font-size: 32px; font-weight: 700; line-height: 1.1; }
.stats span { color: var(--ink); font-size: 12px; margin-top: 2px; }
.share-row { display: flex; gap: 10px; justify-content: center; }
.share-btn, .text-btn {
  height: 48px; padding: 0 26px; border-radius: 999px; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
}
.share-btn { background: var(--btn); color: var(--btn-ink); border: 0; }
.text-btn { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.countdown { margin: 18px 0 0; color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.problem { padding: 60px 0; text-align: center; }
.problem p { font-size: 18px; margin: 0 0 18px; }
.problem h2 { font-size: 30px; font-weight: 800; margin: 18px 0 6px; }
.problem .mini-plate { font-size: 30px; }
a.primary-btn { display: inline-flex; align-items: center; text-decoration: none; }
.suggest { display: inline-block; margin-top: 22px; color: var(--muted); font-size: 14px; text-underline-offset: 3px; }

.toast {
  position: fixed; left: 50%; top: 72px; transform: translate(-50%, -8px); opacity: 0; pointer-events: none;
  background: var(--btn); color: var(--btn-ink); padding: 10px 16px; border-radius: 8px; font-weight: 600; font-size: 14px; transition: all .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- help ---------- */
dialog {
  max-width: 420px; width: calc(100% - 32px); border: 0; border-radius: 14px;
  background: var(--bg); color: var(--ink); padding: 24px 22px 20px; text-align: left;
  box-shadow: 0 12px 40px rgba(0,0,0,.22);
}
dialog::backdrop { background: rgba(0,0,0,.35); }
dialog h3 { margin: 0 0 6px; font-size: 24px; font-weight: 800; }
dialog p { margin: 0 0 10px; }
dialog ol { padding-left: 20px; line-height: 1.55; margin: 0 0 14px; }
dialog .small { color: var(--muted); font-size: 13px; }
dialog form { display: flex; justify-content: center; margin-top: 14px; }
dialog .drive-btn { width: 100%; max-width: none; }
#help .tagline { font-weight: 700; font-size: 17px; margin: 4px 0 8px; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 14px; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition: none !important; }
}

/* ---------- forms (suggest a plate, admin) ---------- */
.page { text-align: left; }
.page h2 { font-size: 28px; font-weight: 800; letter-spacing: -.01em; margin: 28px 0 6px; }
.page .lede { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.back { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink); }
.field { display: block; margin: 0 0 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field small { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.4; }
.field input {
  width: 100%; height: 46px; padding: 0 12px; border-radius: 8px; border: 1px solid #c9c9cf;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 16px;
}
.field input.mono-input { font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.field input:focus { border-color: var(--ink); outline: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
form.edit input:disabled { background: var(--surface); color: var(--muted); border-style: dashed; cursor: not-allowed; }
.form-note { font-size: 14px; color: var(--muted); margin: 0 0 12px; line-height: 1.4; }
.form-error { color: var(--red); font-size: 14px; font-weight: 600; min-height: 20px; margin: 0 0 10px; }
.primary-btn {
  height: 48px; padding: 0 26px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--btn); color: var(--btn-ink); font-size: 16px; font-weight: 700;
}
.primary-btn:disabled { background: var(--off); color: var(--muted); cursor: default; }
.ghost-btn {
  height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--rule); background: transparent;
  cursor: pointer; font-size: 14px; font-weight: 600;
}
.ghost-btn:hover { border-color: var(--ink); }
a.ghost-btn { display: inline-flex; align-items: center; text-decoration: none; color: var(--ink); }
.ghost-btn.danger { color: var(--red); }
.move-group { display: inline-flex; gap: 4px; align-items: center; }
.move-input { width: 64px; height: 36px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink); text-align: center; font: inherit; font-size: 14px; }
.mini-plate {
  display: inline-block; min-width: 150px; padding: 8px 14px 6px; border-radius: 8px; background: var(--plate);
  border: 2px solid var(--plate-edge); box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge);
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; font-size: 26px; letter-spacing: .14em;
  color: var(--plate-ink); text-align: center; min-height: 48px;
}
.preview { text-align: center; margin: 4px 0 22px; }
.done { text-align: center; padding: 30px 0; }
.done h2 { margin-top: 0; }

/* admin */
.field textarea {
  width: 100%; padding: 10px 12px; border-radius: 8px; border: 1px solid #c9c9cf; background: var(--bg); color: var(--ink);
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-size: 14px; line-height: 1.5; resize: vertical;
}
.field textarea:focus { border-color: var(--ink); outline: none; }
.bulk-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.bulk-results { margin-bottom: 8px; }
.bulk-row { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14px; }
.bulk-row .plate-text { font-size: 15px; }
.bulk-row.bad { color: var(--muted); }
.bulk-error { color: var(--red); font-weight: 600; width: 100%; }
.bulk-done { color: var(--green); font-weight: 600; }
.admin-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 20px 0 4px; }
.summary { color: var(--muted); margin: 0 0 8px; }
.section-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 32px 0 10px; }
.rows { border-top: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: 1fr; gap: 10px;  padding: 14px 0; border-bottom: 1px solid var(--rule); align-items: center; }
.row .meta { font-size: 13px; color: var(--muted); }
.row .plate-text { font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .1em; font-size: 18px; }
.row .theme-text { font-weight: 600; }
.row .acts { display: flex; gap: 6px; flex-wrap: wrap; }
@media (min-width: 560px) { .row { grid-template-columns: 1fr auto; } .row .acts { justify-content: flex-end; } }
.row.locked > div:first-child { opacity: .55; }
.row .edit { grid-column: 1 / -1; }
.empty { color: var(--muted); padding: 14px 0; border-bottom: 1px solid var(--rule); }
.card { border: 1px solid var(--rule); border-radius: 12px; padding: 18px 16px 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media (max-width: 420px) { .two { grid-template-columns: 1fr; } }
.page h2.flush { margin: 0; }
.bulk-row .plate-text { font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: .1em; }

/* ---------- stats screen ---------- */
.link-btn { background: none; border: 0; padding: 0; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; margin: -8px 0 18px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dlg-head h3 { margin: 0; }
.dlg-head form { margin: 0; }
.dlg-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 20px 0 8px; }
.my-plate-wrap { text-align: center; padding: 6px 0 4px; }
.my-plate { font-size: 30px; min-width: 190px; }
.mini-plate.placeholder { color: #6f7789; }
.frame-note { color: var(--muted); font-size: 13px; margin: 8px 0 12px; }
.my-plate-form { display: flex; gap: 8px; align-items: flex-end; text-align: left; }
.my-plate-form .field { flex: 1; margin: 0; }
.my-plate-form .ghost-btn { height: 46px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.stat-grid b { display: block; font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-grid span { font-size: 12px; line-height: 1.2; display: block; margin-top: 2px; }
.dist { display: flex; flex-direction: column; gap: 6px; }
.dist-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 8px; font-size: 14px; }
.dist-bar { display: block; background: var(--off); color: var(--ink); font-weight: 700; font-size: 13px; text-align: right; padding: 2px 8px; border-radius: 3px; min-width: 24px; }
.dist-bar.today { background: var(--green); color: #fff; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 7px 16px; border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); }

/* Plate frames earned by your best streak */
.frame-bronze { --plate-edge: #9a5a2a; }
.frame-silver { --plate-edge: #75808f; }
.frame-gold { --plate-edge: #b3841a; }
.mini-plate.frame-bronze, .mini-plate.frame-silver, .mini-plate.frame-gold { border-color: var(--plate-edge); box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge); }

/* Tap the logo three times */
.honk { position: fixed; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 50; visibility: hidden; }
.honk span {
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; font-size: 44px; letter-spacing: .12em;
  background: var(--plate); color: var(--plate-red); border: 3px solid var(--plate-edge); border-radius: 12px; padding: 14px 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.honk.go { visibility: visible; animation: honk-fade 1.4s ease-out both; }
.honk.go span { animation: honk-pop 1.4s cubic-bezier(.2,1.4,.4,1) both; }
@keyframes honk-pop { 0% { transform: scale(.4) rotate(-6deg); } 20% { transform: scale(1.08) rotate(2deg); } 35%, 100% { transform: scale(1) rotate(0); } }
@keyframes honk-fade { 0%, 75% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
.field input.mono-input::placeholder { font-family: "Libre Franklin", system-ui, sans-serif; font-weight: 400; text-transform: none; letter-spacing: normal; }

/* ---------- delights ---------- */
.banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: #fde7f0; color: #7a1d47; font-weight: 600; font-size: 14px; text-align: center; }

/* Paw prints instead of skid marks for Georgie fans */
.slot .skid.paws {
  background:
    radial-gradient(circle at 20% 60%, rgba(40,30,20,.65) 0 3px, transparent 3.5px),
    radial-gradient(circle at 26% 38%, rgba(40,30,20,.65) 0 1.6px, transparent 2px),
    radial-gradient(circle at 14% 38%, rgba(40,30,20,.65) 0 1.6px, transparent 2px),
    radial-gradient(circle at 62% 40%, rgba(40,30,20,.65) 0 3px, transparent 3.5px),
    radial-gradient(circle at 68% 18%, rgba(40,30,20,.65) 0 1.6px, transparent 2px),
    radial-gradient(circle at 56% 18%, rgba(40,30,20,.65) 0 1.6px, transparent 2px);
  filter: none; -webkit-mask-image: none; mask-image: none;
}

/* Special days */
.plate.day-birthday { --plate-edge: #c2185b; background: linear-gradient(180deg, #fff, #fff4f8); }
.plate.day-birthday::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background:
    radial-gradient(circle at 8% 20%, #f4b400 0 2px, transparent 2.5px), radial-gradient(circle at 92% 28%, #1e88e5 0 2px, transparent 2.5px),
    radial-gradient(circle at 15% 82%, #43a047 0 2px, transparent 2.5px), radial-gradient(circle at 86% 80%, #e53935 0 2px, transparent 2.5px),
    radial-gradient(circle at 70% 90%, #8e24aa 0 1.5px, transparent 2px);
}
.plate.day-xmas { --plate-edge: #1b6e3a; }
.plate.day-xmas .plate-top { color: #b8282e; }
.plate.day-newyear { --plate-edge: #b3841a; background: linear-gradient(115deg, var(--plate) 40%, #fff6d8 50%, var(--plate) 60%); background-size: 300% 100%; animation: shimmer 3s linear infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* BHAC siren */
.plate.siren { animation: siren .4s steps(1) 6; }
@keyframes siren { 0% { box-shadow: inset 0 0 0 4px var(--plate), inset 0 0 0 5.5px var(--plate-edge), 0 0 0 6px #e53935, 0 0 28px #e53935; } 50% { box-shadow: inset 0 0 0 4px var(--plate), inset 0 0 0 5.5px var(--plate-edge), 0 0 0 6px #1e63e5, 0 0 28px #1e63e5; } }

/* First-win license */
.license { margin: 0 auto 22px; max-width: 300px; }
.license-head { font-weight: 800; font-size: 18px; margin: 0 0 8px; }
.license-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 12px 12px; border-radius: 12px;
  background: linear-gradient(135deg, #e8f1fb, #f6f9fd); border: 1px solid #c7d6ea; color: #16264a;
}
.license-title { font-size: 11px; font-weight: 800; letter-spacing: .25em; color: #1d3b6e; }
.license-plate { font-size: 24px; min-width: 150px; }
.license-meta { font-size: 13px; color: #3d4b66; }
.license .link-btn { margin: 10px 0 0; }

/* Odometer */
.odometer { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--rule); }
.odo-digits { display: inline-flex; gap: 2px; background: #1b1b1d; padding: 4px; border-radius: 6px; }
.odo-digit {
  display: inline-block; width: 22px; text-align: center; font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; font-size: 20px;
  color: #f5f5f5; background: linear-gradient(180deg, #2a2a2d, #3a3a3e 50%, #2a2a2d); border-radius: 3px; animation: roll .5s ease-out both;
}
.odo-digit:last-child { background: linear-gradient(180deg, #e9e9ea, #fff 50%, #e9e9ea); color: #121212; }
@keyframes roll { from { transform: translateY(-60%); opacity: 0; } to { transform: none; opacity: 1; } }
.odo-label { font-size: 12px; color: var(--muted); }
.stat-grid { border-top: 0; padding-top: 6px; }
.credit { font-weight: 600; color: var(--ink) !important; }

/* Saving Kat's special plates */
.my-plate-wrap { position: relative; }
.plate-msg { min-height: 20px; margin: 8px 0 0; font-size: 14px; font-weight: 600; text-align: left; }
.paw-trail { position: absolute; left: 0; right: 0; top: 0; height: 70px; pointer-events: none; }
.paw {
  position: absolute; top: 8px; width: 18px; height: 18px; opacity: 0;
  background:
    radial-gradient(ellipse at 50% 72%, #6d4c32 0 5px, transparent 5.5px),
    radial-gradient(circle at 18% 34%, #6d4c32 0 2.3px, transparent 2.8px),
    radial-gradient(circle at 40% 16%, #6d4c32 0 2.3px, transparent 2.8px),
    radial-gradient(circle at 62% 16%, #6d4c32 0 2.3px, transparent 2.8px),
    radial-gradient(circle at 84% 34%, #6d4c32 0 2.3px, transparent 2.8px);
  transform: rotate(80deg); animation: paw-step 2.2s ease-out both;
}
.paw.paw-low { top: 34px; }
@keyframes paw-step { 0% { opacity: 0; transform: rotate(80deg) scale(.4); } 12% { opacity: 1; transform: rotate(80deg) scale(1.1); } 20% { transform: rotate(80deg) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }
.mini-plate.wag { animation: wag .5s ease-in-out 3; }
@keyframes wag { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
.mini-plate.siren-mini { animation: siren-mini .3s steps(1) 8; }
@keyframes siren-mini { 0% { box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge), 0 0 0 5px #e53935, 0 0 24px #e53935; } 50% { box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge), 0 0 0 5px #1e63e5, 0 0 24px #1e63e5; } }

/* STUFFNG: the plate puffs up and leaves fall */
.mini-plate.stuffed { animation: stuffed 1.4s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes stuffed { 0% { transform: scale(1); } 30% { transform: scale(1.18, 1.1); } 45% { transform: scale(1.12, 1.16); } 60%, 100% { transform: scale(1.04); } }
.leaf {
  position: absolute; top: -6px; width: 12px; height: 12px; opacity: 0;
  border-radius: 0 80% 0 80%; animation: leaf-fall 2.4s ease-in both;
}
@keyframes leaf-fall {
  0% { opacity: 0; transform: translate(0, 0) rotate(0); }
  10% { opacity: 1; }
  50% { transform: translate(14px, 40px) rotate(160deg); }
  100% { opacity: 0; transform: translate(-6px, 90px) rotate(320deg); }
}

/* Peppers: shades drop onto the plate, which glows green. Eggroll: a roll and golden crumbs. */
.mini-plate.cool { animation: cool-glow 2.6s ease-out both; }
@keyframes cool-glow { 0%, 100% { box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge); }
  30%, 75% { box-shadow: inset 0 0 0 1.5px var(--plate), inset 0 0 0 2.5px var(--plate-edge), 0 0 0 5px #2e8b3a, 0 0 22px #2e8b3a; } }
.shades {
  position: absolute; left: 50%; top: -4px; width: 96px; height: 24px; margin-left: -48px; opacity: 0; z-index: 2;
  background:
    radial-gradient(ellipse 19px 11px at 22px 12px, #111 96%, transparent 100%),
    radial-gradient(ellipse 19px 11px at 74px 12px, #111 96%, transparent 100%),
    linear-gradient(#111, #111) 38px 6px / 20px 4px no-repeat;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.25));
  animation: shades-drop 2.6s cubic-bezier(.3,1.4,.6,1) both;
}
@keyframes shades-drop { 0% { opacity: 0; transform: translateY(-40px) rotate(-8deg); } 25% { opacity: 1; transform: translateY(14px) rotate(0); } 85% { opacity: 1; transform: translateY(14px); } 100% { opacity: 0; transform: translateY(14px); } }
.mini-plate.rolling { animation: roll 1s cubic-bezier(.4,.1,.3,1) both; }
@keyframes roll { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }
.mini-plate.cool.rolling { animation: roll 1s cubic-bezier(.4,.1,.3,1) both, cool-glow 2.6s ease-out both; }
.crumb {
  position: absolute; top: -6px; width: 7px; height: 7px; border-radius: 50% 40% 55% 45%; opacity: 0;
  background: #e0a63a; box-shadow: inset -1px -1px 0 #b9781c; animation: leaf-fall 2.2s ease-in both;
}
@media (prefers-reduced-motion: reduce) {
  .mini-plate.rolling, .mini-plate.cool.rolling { animation: none; }
  .shades { animation-duration: .01s; }
}

/* Thanksgiving Day (fourth Thursday of November) */
.plate.day-thanksgiving { --plate-edge: #9a4a17; background: linear-gradient(180deg, #fffaf2, #fbefdc); }
.plate.day-thanksgiving .plate-top { color: #b4531a; }

/* License card: name your plate */
.license-card { position: relative; overflow: hidden; }
.license-form { display: flex; gap: 8px; align-items: flex-end; text-align: left; margin-top: 12px; }
.license-form .field { flex: 1; margin: 0; }
.license-form .primary-btn { height: 46px; padding: 0 20px; }
#licenseMsg { text-align: center; }
#myTier { display: block; margin-bottom: 8px; }

/* Bumper stickers */
.stickers { display: flex; flex-wrap: wrap; gap: 6px; }
.sticker {
  display: inline-flex; align-items: center; justify-content: center; min-width: 46px; height: 26px; padding: 0 10px;
  border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase;
  border: 1.5px dashed var(--rule); color: var(--muted);
}
.sticker.on { border: 0; color: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.15); transform: rotate(-1.5deg); }
.sticker.on:nth-child(even) { transform: rotate(1.2deg); }
.sticker.on.dark-text { color: #1a1a1a; }

/* Footer links, feedback and privacy pages */
.end-links { display: flex; justify-content: center; gap: 22px; margin: 22px 0 0; font-size: 14px; }
.end-links a, .help-links a { color: var(--muted); text-underline-offset: 3px; }
.help-links { display: flex; gap: 18px; }
.small-print { color: var(--muted); font-size: 13px; margin-top: 16px; }
.small-print a { color: var(--muted); }
.page .field textarea { font-family: "Libre Franklin", system-ui, sans-serif; font-size: 16px; }
.prose h3 { font-size: 17px; margin: 22px 0 6px; }
.prose p { line-height: 1.55; margin: 0 0 10px; }

/* Admin report */
.report-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 10px; }
.report { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
.report th, .report td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--rule); }
.report th:first-child, .report td:first-child { text-align: left; position: sticky; left: 0; background: var(--bg); }
.report th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.report .plate-text { font-size: 14px; }
.report-key { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.report-key summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.report-key ul { padding-left: 18px; line-height: 1.5; }
.fb-text { white-space: pre-wrap; line-height: 1.45; }

/* Harder mode */
.mode-badge { display: inline-block; margin: -14px 0 18px; padding: 3px 10px; border-radius: 999px; background: var(--btn); color: var(--btn-ink); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.hard-hints { list-style: none; padding: 0; margin: 14px auto 0; max-width: 360px; text-align: left; }
.hard-hints li { padding: 8px 12px; border-left: 3px solid var(--yellow); background: var(--surface); border-radius: 0 8px 8px 0; margin-bottom: 6px; font-size: 15px; }
.keyboard { display: flex; flex-direction: column; gap: 6px; margin: 22px 0 8px; }
.kb-row { display: flex; justify-content: center; gap: 5px; }
.key {
  flex: 0 1 32px; height: 50px; border: 0; border-radius: 6px; background: var(--key); color: var(--key-ink);
  font-family: "Roboto Mono", ui-monospace, Menlo, monospace; font-weight: 700; font-size: 17px; cursor: pointer; padding: 0;
}
.key.wide { flex-basis: 54px; font-family: "Libre Franklin", system-ui, sans-serif; font-size: 13px; }
.key:active { transform: scale(.94); }
/* Harder mode keys remember what you learned, using the same marks as decoy tiles. */
.key.got { box-shadow: inset 0 -5px 0 var(--green); }
.key.in { box-shadow: inset 0 -5px 0 var(--yellow); }
.key.out { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--off); }

.mode-card { display: flex; gap: 14px; align-items: center; justify-content: space-between; margin-top: 18px; padding: 16px; }
.mode-title { margin: 0 0 4px; font-weight: 800; font-size: 17px; }
.mode-card .summary { margin: 0; font-size: 14px; }
.mode-card .primary-btn { flex: none; }
.pin-tag { display: inline-block; margin: 2px 0 4px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--surface); border: 1px solid var(--rule); }
.row.special { border-left: 3px solid var(--plate-red); padding-left: 10px; }
.small-plate { font-size: 15px; }
.admin-links { display: flex; gap: 8px; align-items: center; }
.admin-links a.ghost-btn { display: inline-flex; align-items: center; text-decoration: none; color: inherit; }
.mode-pick { display: flex; gap: 6px; margin: 8px 0 10px; flex-wrap: wrap; }
.mode-btn { font: 700 15px "Libre Franklin", system-ui, sans-serif; padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--ink); background: transparent; color: var(--ink); }
.mode-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
