/* Where You Land: sticker-on-paper look. Tokens first; dark mode redefines them. */
:root {
  --paper: #fff3df;
  --paper-2: #ffe9c7;
  --card: #fffaf1;
  --ink: #1b1424;
  --ink-2: #4a4054;
  --muted: #7a6f80;
  --line: #1b1424;
  --shadow: #1b1424;
  --accent: #ff4b2b;
  --accent-ink: #fffaf1;
  --you: #3326ff;
  --you-ink: #ffffff;
  --q-tl: #bff0d2;
  --q-tr: #ffe07a;
  --q-bl: #c9dcff;
  --q-br: #ffbfb2;
  --region: rgba(51, 38, 255, .16);
  --region-line: #3326ff;
  --focus: #3326ff;
  --r: 14px;
  --font: "Bricolage Grotesque", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #16121d;
    --paper-2: #211a2b;
    --card: #221b2d;
    --ink: #fff3df;
    --ink-2: #d9cfe0;
    --muted: #a397ad;
    --line: #fff3df;
    --shadow: #000000;
    --accent: #ff6a4d;
    --accent-ink: #16121d;
    --you: #8f86ff;
    --you-ink: #16121d;
    --q-tl: #1d4a37;
    --q-tr: #574713;
    --q-bl: #213660;
    --q-br: #5a2a24;
    --region: rgba(143, 134, 255, .22);
    --region-line: #8f86ff;
    --focus: #8f86ff;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  background-image: radial-gradient(color-mix(in srgb, var(--ink) 9%, transparent) 1px, transparent 1.2px);
  background-size: 18px 18px;
  color: var(--ink);
  font: 400 16px/1.45 var(--font);
  font-optical-sizing: auto;
  min-height: 100vh;
}
a { color: inherit; text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 8px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); border: 2px solid var(--line); padding: 8px 12px; border-radius: 10px; z-index: 10; }
.skip:focus { left: 16px; }

/* header */
.top { max-width: 640px; margin: 0 auto; padding: 14px 16px 6px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-stretch: 80%; font-size: 21px; letter-spacing: -.01em; }
.brand:hover { color: inherit; }
.mark { width: 30px; height: 30px; }
.mark rect { stroke: var(--line); stroke-width: 2; }
.mark .q1 { fill: var(--q-tl); } .mark .q2 { fill: var(--q-tr); } .mark .q3 { fill: var(--q-bl); } .mark .q4 { fill: var(--q-br); }
.mark .dot { fill: var(--you); stroke: var(--line); stroke-width: 2; }
.streak { font-weight: 800; font-size: 15px; background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 3px 11px; box-shadow: 2px 2px 0 var(--shadow); }

main { max-width: 640px; margin: 0 auto; padding: 4px 16px 24px; outline: none; }

/* title block */
.hero { margin: 10px 0 14px; }
.kicker { display: flex; align-items: center; gap: 10px; margin: 0 0 8px; font-size: 14px; color: var(--ink-2); font-weight: 600; }
.daytag { background: var(--accent); color: var(--accent-ink); border: 2px solid var(--line); border-radius: 8px; padding: 1px 8px; font-weight: 800; transform: rotate(-2deg); box-shadow: 2px 2px 0 var(--shadow); }
h1 { font-size: clamp(30px, 8.6vw, 46px); line-height: 1.02; margin: 0 0 8px; font-weight: 800; font-stretch: 82%; letter-spacing: -.02em; text-wrap: balance; }
.prompt { margin: 0; font-size: 17px; color: var(--ink-2); }
.banner { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin: 0 0 14px; box-shadow: 3px 3px 0 var(--shadow); font-weight: 600; }
.banner.muted { font-weight: 400; font-size: 15px; display: block; }
.banner a { font-weight: 700; }
.bem { font-size: 26px; }

/* chart */
.frame { margin: 0 0 12px; display: grid; grid-template-columns: 22px minmax(0, 1fr) 22px; grid-template-rows: auto auto auto; gap: 6px 4px; }
.ax { font-size: 13px; font-weight: 700; color: var(--ink-2); line-height: 1.1; }
.ax.top { grid-column: 2; text-align: center; }
.ax.bottom { grid-column: 2; grid-row: 3; text-align: center; }
.ax.left, .ax.right { grid-row: 2; display: flex; align-items: center; justify-content: center; }
.ax.left span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; }
.ax.right span { writing-mode: vertical-rl; white-space: nowrap; }
.plot {
  grid-column: 2; grid-row: 2; position: relative; aspect-ratio: 1; width: 100%;
  border: 2.5px solid var(--line); border-radius: var(--r); overflow: hidden;
  display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr;
  box-shadow: 5px 5px 0 var(--shadow); background: var(--card);
}
.quad { position: relative; }
.quad span { position: absolute; font-size: 12px; font-weight: 700; font-style: italic; color: var(--ink); opacity: .55; max-width: 70%; line-height: 1.1; }
.quad.tl { background: var(--q-tl); border-right: 1.5px dashed var(--line); border-bottom: 1.5px dashed var(--line); }
.quad.tr { background: var(--q-tr); border-bottom: 1.5px dashed var(--line); }
.quad.bl { background: var(--q-bl); border-right: 1.5px dashed var(--line); }
.quad.br { background: var(--q-br); }
.quad.tl span { top: 8px; left: 9px; } .quad.tr span { top: 8px; right: 9px; text-align: right; }
.quad.bl span { bottom: 8px; left: 9px; } .quad.br span { bottom: 8px; right: 9px; text-align: right; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.region { fill: var(--region); stroke: var(--region-line); stroke-width: 2px; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; }

.sticker {
  position: absolute; transform: translate(-50%, -50%); width: 36px; height: 36px; padding: 0;
  border-radius: 50%; border: 2px solid var(--line); background: var(--card); cursor: pointer;
  display: grid; place-items: center; font-size: 19px; line-height: 1; z-index: 2;
  box-shadow: 1.5px 1.5px 0 var(--shadow); transition: transform .15s ease, background-color .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.sticker span { transform: translateY(1px); }
.sticker:hover { transform: translate(-50%, -50%) scale(1.08); }
.sticker.on { background: var(--accent); transform: translate(-50%, -50%) scale(1.14) rotate(-6deg); box-shadow: 2.5px 2.5px 0 var(--shadow); z-index: 3; }
.plot.locked .sticker:not(.on) { opacity: .45; }

.you {
  position: absolute; left: 50%; top: 50%; z-index: 4; transform: translate(-50%, -50%) scale(0);
  width: 22px; height: 22px; border-radius: 50%; background: var(--you); border: 3px solid var(--card);
  outline: 2.5px solid var(--line); pointer-events: none;
  transition: left .35s cubic-bezier(.3, 1.4, .5, 1), top .35s cubic-bezier(.3, 1.4, .5, 1), transform .25s ease;
}
.you.show { transform: translate(-50%, -50%) scale(.75); opacity: .8; }
.you.final { transform: translate(-50%, -50%) scale(1); opacity: 1; animation: land .5s ease; }
.you span {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); background: var(--you); color: var(--you-ink);
  font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 1px 7px; border-radius: 6px;
  border: 2px solid var(--line); white-space: nowrap;
}
@keyframes land { 0% { transform: translate(-50%, -50%) scale(1.8); } 60% { transform: translate(-50%, -50%) scale(.9); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* action bar: sticks to the bottom of the screen while picking */
.bar {
  position: sticky; bottom: 10px; z-index: 6; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--card); border: 2px solid var(--line); border-radius: 999px; padding: 6px 6px 6px 16px;
  box-shadow: 3px 3px 0 var(--shadow); margin: 0 0 14px;
}
.bar.hide { display: none; }
.count { font-size: 14px; font-weight: 600; color: var(--ink-2); }

.btn {
  font: 700 15px/1 var(--font); padding: 11px 16px; border-radius: 999px; border: 2px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 2px 2px 0 var(--shadow); transition: transform .1s ease, box-shadow .1s ease; min-height: 44px;
}
.btn:hover { color: var(--ink); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--shadow); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--shadow); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { color: var(--accent-ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--shadow); }

/* item list: the accessible way to pick */
.chips { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chips li { display: flex; }
.chip {
  font: 600 14.5px/1.15 var(--font); color: var(--ink); background: var(--card); border: 2px solid var(--line); border-radius: 12px;
  padding: 7px 10px 7px 8px; width: 100%; display: flex; align-items: center; gap: 7px; cursor: pointer; min-height: 42px; text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.chip .ce { font-size: 18px; flex: none; }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); box-shadow: 2px 2px 0 var(--shadow); }

/* result */
.result { background: var(--card); border: 2.5px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; margin: 4px 0 18px; box-shadow: 6px 6px 0 var(--shadow); outline: none; scroll-margin-top: 12px; }
.rk { margin: 0 0 6px; font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.rmain { display: flex; align-items: center; gap: 14px; }
.rem { font-size: 56px; line-height: 1; filter: drop-shadow(2px 2px 0 var(--shadow)); }
.rl { margin: 0; font-size: 30px; font-weight: 800; font-stretch: 82%; line-height: 1.02; letter-spacing: -.01em; }
.rs { margin: 2px 0 0; font-size: 17px; color: var(--ink-2); }
.rs b { color: var(--accent); font-size: 22px; }
.rline { margin: 12px 0 4px; font-size: 17px; }
.rq { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.copied { display: block; min-height: 1.3em; font-size: 14px; color: var(--ink-2); margin: 6px 0 0; }
.preview { margin: 6px 0 10px; padding: 10px 12px; background: var(--paper); border: 1.5px dashed var(--line); border-radius: 10px; font: 13px/1.35 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-all; color: var(--ink-2); }
.rfoot, .rstreak, .rnext { margin: 6px 0 0; font-size: 15px; }
.rstreak { font-weight: 700; }
.rnext b { font-variant-numeric: tabular-nums; }
.link { font: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; cursor: pointer; }
.link:hover { color: var(--accent); }
.note { font-size: 13px; color: var(--muted); margin: 0 0 8px; }

/* before launch / locked */
.soon h1 { font-size: clamp(32px, 9vw, 52px); }
.soon .prompt b { font-variant-numeric: tabular-nums; color: var(--accent); }
.bigmark { margin: 28px auto 8px; width: min(260px, 70vw); aspect-ratio: 1; border: 2.5px solid var(--line); border-radius: 20px; box-shadow: 6px 6px 0 var(--shadow);
  background: conic-gradient(var(--q-tr) 0 25%, var(--q-br) 0 50%, var(--q-bl) 0 75%, var(--q-tl) 0); display: grid; place-items: center; }
.bigmark span { font-size: 64px; background: var(--card); border: 2.5px solid var(--line); border-radius: 50%; width: 104px; height: 104px; display: grid; place-items: center; animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-4deg); } }

/* archive */
.archive { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.archive a { display: flex; align-items: center; gap: 14px; text-decoration: none; background: var(--card); border: 2px solid var(--line); border-radius: var(--r); padding: 12px 14px; box-shadow: 3px 3px 0 var(--shadow); }
.archive a:hover { color: inherit; transform: translate(-1px, -1px); }
.ae { font-size: 30px; }
.at { display: grid; }
.at b { font-size: 18px; line-height: 1.15; }
.at small { color: var(--muted); font-size: 14px; }
.archive .empty { color: var(--muted); }

/* footer */
.foot { max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; color: var(--ink-2); font-size: 14px; }
.foot nav { display: flex; gap: 16px; font-weight: 700; margin: 6px 0; }
.next { font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; }
.small { margin: 0; color: var(--muted); font-size: 13px; }

@media (max-width: 380px) {
  .sticker { width: 32px; height: 32px; font-size: 17px; }
  .quad span { font-size: 11px; }
}
@media (min-width: 700px) {
  .sticker { width: 44px; height: 44px; font-size: 23px; }
  .frame { grid-template-columns: 26px minmax(0, 1fr) 26px; }
  .ax { font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
