/* Pixel Eye · warm paper, soft cards, line doodles */
:root {
  --bg: #FFFFFF;
  --paper: #F6EDE4; /* the old page color, now used as a card and track color */
  --ink: #000000;
  --muted: #7B7268;
  --white: #FFFFFF;
  --soft: #FBF7F1;
  --beige: #EADFD3;
  --pink: #E8B9CE;
  --orange: #EC7C4E;
  --blue: #2F6BDD;
  --good: #1F9D55; /* correct answer */
  --bad: #D93636;  /* wrong pick */
  --hair: rgba(0, 0, 0, 0.14);
  --gap: rgba(0, 0, 0, 0.22); /* slider stretch between a guess and the real value */
  --radius: 14px;
  --shadow: 0 22px 44px -22px rgba(74, 48, 22, 0.28), 0 2px 6px rgba(74, 48, 22, 0.05);
  --font: 'Schibsted Grotesk', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }

/* the page is at least one window tall, so the footer can sit on the bottom edge of short pages */
#app { max-width: 1160px; margin: 0 auto; padding: 0 24px 28px; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1.5px solid var(--ink);
  font-weight: 600; font-size: 15px; letter-spacing: -0.005em;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  text-decoration: none; white-space: nowrap;
}
.btn.dark { background: var(--ink); color: #fff; }
.btn.line { background: transparent; color: var(--ink); }
.btn:hover { transform: translateY(-1px); }
.btn.line:hover { background: var(--ink); color: #fff; }
.btn:active { transform: translateY(0); }
.btn.small { min-height: 40px; padding: 0 18px; font-size: 14px; }

/* ---------- nav ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 26px 0; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 19px; letter-spacing: -0.02em; color: var(--ink); text-decoration: none; background: none; border: 0; padding: 0; }
.logo .pe-logo { height: 26px; width: 164px; display: block; color: var(--ink); }
.pe-pupil { transition: none; }

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 56px; align-items: center; padding: 28px 0 84px; }
.hero h1 { font-size: clamp(40px, 5.6vw, 68px); line-height: 1; letter-spacing: -0.035em; font-weight: 700; margin: 16px 0 20px; text-wrap: balance; }
.lede { font-size: 18px; color: #4B4640; max-width: 46ch; }
.name-field { display: flex; flex-direction: column; gap: 8px; margin: 30px 0 18px; max-width: 320px; }
.name-field input {
  height: 48px; padding: 0 16px; border-radius: 12px;
  border: 1.5px solid var(--ink); background: transparent; font-size: 16px; font-weight: 500;
}
.name-field input::placeholder { color: #A39A8F; }
.name-field input:focus { outline: none; background: #fff; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-art { position: relative; height: 500px; }
.hc {
  position: absolute; display: flex; flex-direction: column; justify-content: space-between;
  padding: 26px; border-radius: var(--radius); width: 47%;
}
.hc svg { width: 78px; height: 78px; }
.hc h3 { font-size: 22px; line-height: 1.18; letter-spacing: -0.02em; font-weight: 600; margin-bottom: 14px; }
.hc-line { left: 13%; top: 0; height: 58%; border: 1.5px solid var(--ink); justify-content: flex-start; gap: 0; }
.hc-line .hc-body { margin-top: auto; padding-bottom: 46%; }
.hc-blue { right: 0; top: 22%; height: 56%; background: var(--blue); color: #fff; box-shadow: var(--shadow); }
.hc-blue .label { color: rgba(255, 255, 255, 0.82); }
.hc-blue .big { font-size: 46px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; display: block; margin-bottom: 6px; }
.hc-white { left: 0; bottom: 0; height: 54%; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--hair); }
.mini-board { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.mini-board li { display: flex; justify-content: space-between; gap: 10px; }
.mini-board b { font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-board span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- tests grid ---------- */
.tests { width: 100%; }
.grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.tcard {
  display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  aspect-ratio: 1 / 1.12; padding: 18px; border-radius: var(--radius);
  border: 1.5px solid transparent; background: #fff;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.tcard:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.tcard svg { width: 62px; height: 62px; }
.tc-name { margin-top: auto; font-size: 17px; font-weight: 600; letter-spacing: -0.015em; line-height: 1.2; }
.tcard .label { margin-top: 6px; color: inherit; opacity: 0.66; font-size: 10px; }
.t-pink { background: var(--pink); }
.t-orange { background: var(--orange); }
.t-white { background: var(--paper); }
.t-soft { background: #fff; border-color: var(--hair); box-shadow: 0 10px 24px -16px rgba(74, 48, 22, 0.35); }
.t-beige { background: var(--beige); }
.t-line { background: transparent; border-color: var(--ink); }
.t-blue { background: var(--blue); color: #fff; }

/* ---------- leaderboard ---------- */
.board-sec { margin-top: 84px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; align-items: start; }
.board-sec h2 { font-size: 26px; letter-spacing: -0.025em; line-height: 1.15; margin: 10px 0; font-weight: 600; }
.board-sec p { color: #4B4640; font-size: 15px; }
.board { background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px 12px; }
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: #EFEFEF; margin-bottom: 12px; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tabs button[aria-selected='true'] { background: var(--ink); color: #fff; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 13px 0; border-top: 1px solid var(--hair); font-size: 16px; }
.rows li:first-child { border-top: 0; }
.rows .rank { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rows .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows .who small { font-weight: 500; color: var(--muted); font-size: 12px; margin-left: 8px; }
.rows .time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.rows .pts { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 56px; text-align: right; }
.rows li.me .who::after { content: 'you'; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 2px; }
.empty { padding: 26px 0 30px; color: var(--muted); font-size: 15px; }

/* leaderboard page */
.board-page { max-width: 780px; width: 100%; margin: 28px auto 0; }
.board-page h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1; letter-spacing: -0.035em; font-weight: 700; margin: 14px 0 16px; text-wrap: balance; }
.board-page .lede { margin-bottom: 32px; }
.board-page .board { padding: 24px 28px 14px; }
.board-page .rows li { padding: 16px 0; font-size: 17px; }
.see-all { color: var(--muted); text-decoration: none; }
.see-all:hover { color: var(--ink); text-decoration: underline; }
/* results rank card */
.rank-card { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; padding: 28px 30px; }
.rank-card .label { margin-bottom: 0 !important; }
/* big rank fills the open space between the heading and the message, so both cards read the same size */
.rank-big { margin-block: auto; font-size: clamp(96px, 11vw, 168px); font-weight: 700; letter-spacing: -0.05em; line-height: 0.9; font-variant-numeric: tabular-nums; }
.rank-big small { font-size: 22px; letter-spacing: 0; font-weight: 500; color: var(--muted); font-variant-numeric: normal; margin-left: 6px; }
.rank-card p { color: #4B4640; font-size: 16px; }

/* margin-top:auto pushes it to the bottom; the section above keeps at least 72px of space */
.tests, .board-page, .results { margin-bottom: 72px; }
.foot { margin-top: auto; padding-top: 22px; border-top: 1px solid var(--hair); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- play ---------- */
.play { max-width: 700px; margin: 0 auto; padding-top: 22px; }
.play-top { display: flex; align-items: center; gap: 14px; }
.icon-btn { width: 40px; height: 40px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; display: grid; place-items: center; font-size: 15px; line-height: 1; flex: none; }
.icon-btn:hover { background: var(--ink); color: #fff; }
.play-meta { display: flex; gap: 14px; flex: 1; min-width: 0; }
.play-meta .label:first-child { color: var(--ink); font-weight: 700; }
.play-total b { color: var(--ink); font-size: 14px; font-weight: 700; margin-left: 6px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.timer { height: 5px; border-radius: 99px; background: rgba(0, 0, 0, 0.1); margin: 16px 0 22px; overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--ink); border-radius: 99px; transform-origin: left center; }
/* the last quarter of the time: the bar turns red and pulses */
.timer i.low { background: #E5342B; animation: timer-low 0.7s ease-in-out infinite; }
.timer:has(i.low) { background: rgba(229, 52, 43, 0.16); }
@keyframes timer-low { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.play-title { display: flex; align-items: center; justify-content: center; gap: 10px; }
.p-icon { display: block; flex: none; width: 30px; height: 30px; }
.p-icon svg { display: block; width: 100%; height: 100%; stroke-width: 2.4; }
.play h2 { font-size: 20px; letter-spacing: -0.01em; line-height: 1.1; font-weight: 600; }
/* the rules are the headline. Two lines are always kept free, because a test may swap in a longer prompt after the test area has been sized. */
#p-prompt { display: grid; place-items: center; margin: 10px 0 12px; min-height: 2.4em; font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; color: var(--ink); text-align: center; text-wrap: balance; }
.play-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; margin-top: 18px; }
.auto-hint { color: var(--muted); font-size: 14px; }
.result { display: flex; align-items: center; gap: 16px; width: 100%; animation: rise 0.28s ease both; }
.result[hidden], [hidden] { display: none !important; }
.res-score { display: flex; align-items: baseline; gap: 3px; flex: none; }
.res-score b { font-size: 46px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.res-score span { color: var(--muted); font-size: 14px; }
.res-detail { flex: 1; min-width: 0; font-size: 15px; color: #4B4640; }
.res-detail strong { display: block; color: var(--ink); font-size: 16px; }
.res-actions { display: flex; gap: 10px; flex: none; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- stage (shared) ---------- */
/* play screen sits on plain white with no card around the test: elements live on the page */
body.playing { background: #fff; }
body.playing #app { padding-bottom: 0; }
/* the play screen fills the window; the test area takes whatever height is left so the
   header, test and Lock button always fit without scrolling */
.play { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; padding-bottom: 12px; }
.stage {
  position: relative; flex: 1 1 auto; min-height: 300px; max-height: 620px;
  overflow: hidden; user-select: none; -webkit-user-select: none;
  animation: rise 0.3s ease both;
}
.stage.locked .handle { cursor: default; }
.fill { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 16px; }
.abs { position: absolute; inset: 0; }
.cap { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.handle { cursor: grab; }
.handle.dragging { cursor: grabbing; }
.tag {
  position: absolute; white-space: nowrap; padding: 3px 8px; border-radius: 999px;
  background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em;
  animation: rise 0.25s ease both; /* no tabular figures here: this font's tabular period is a full digit wide ("1 . 4px") */
}
.ring { outline: 3px solid var(--good); outline-offset: 3px; }
.miss { outline: 3px solid var(--bad); outline-offset: 3px; }

.pips { position: absolute; top: 14px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; z-index: 2; }
.pips i { width: 22px; height: 5px; border-radius: 9px; background: rgba(0, 0, 0, 0.12); }
.pips i.now { background: var(--ink); }
.pips i.ok { background: var(--good); }
.pips i.miss { background: var(--bad); outline: 0; }
.fill.answered button { pointer-events: none; }

/* sliders */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 14px; border-radius: 99px; background: rgba(0, 0, 0, 0.1); margin: 0; cursor: pointer; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); cursor: grab; }
.slider::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18); cursor: grab; }
.slider-wrap { width: min(340px, 100%); }
.dial { display: grid; gap: 10px; width: min(300px, 100%); }
.dial-row { display: flex; align-items: center; justify-content: center; gap: 14px; }
.dial-num { font-size: 40px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; min-width: 108px; text-align: center; font-variant-numeric: tabular-nums; }
.dial-num small { font-size: 16px; font-weight: 600; color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.dial-btn { width: 34px; height: 34px; border-radius: 50%; border: 1.5px solid var(--ink); background: transparent; font-size: 18px; line-height: 1; display: grid; place-items: center; padding: 0 0 2px; }
.dial-btn:hover { background: var(--ink); color: #fff; }
.dial { --thumb: 32px; } /* matches the play-size slider thumb, so marks line up with it */
.dial-track { position: relative; display: grid; }
.slider:disabled { cursor: default; }
.slider:disabled::-webkit-slider-thumb { cursor: default; }
.dial-mark { position: absolute; top: 50%; width: 8px; height: 30px; margin: -15px 0 0 -4px; border-radius: 4px; box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, 0.2); pointer-events: none; animation: rise 0.3s ease both; }
.dial.revealed .dial-num { display: flex; justify-content: center; align-items: baseline; gap: 0.6em; font-size: 34px; }
.dial.revealed .dn-you { color: var(--muted); }

/* true center */
.frame { position: absolute; border: 1.5px solid var(--ink); border-radius: 6px; background: var(--soft); }
.frame.oval { border-radius: 50%; }
.frame.diamond, .frame.diamond i { clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.frame.diamond { border: 0; border-radius: 0; background: var(--ink); }
.frame.diamond i { position: absolute; inset: 2.5px; background: var(--soft); }
.dot { position: absolute; background: var(--blue); box-shadow: 0 4px 10px rgba(47, 107, 221, 0.35); }
.dot.circle { border-radius: 50%; }
.dot.square { border-radius: 5px; }
.dot.diamond { border-radius: 4px; transform: rotate(45deg) scale(0.78); }
.xh { position: absolute; background: var(--orange); pointer-events: none; }
.xh.v { width: 1px; margin-left: -0.5px; }
.xh.h { height: 1px; margin-top: -0.5px; }

/* split it */
.bar { position: absolute; border-radius: 10px; background: var(--beige); overflow: hidden; }
.bar-fill { height: 100%; background: var(--blue); }
.bar-knob { position: absolute; width: 18px; border-radius: 99px; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); }
.tick { position: absolute; width: 0; border-left: 2px dashed var(--orange); pointer-events: none; }
.tick .tag { top: -22px; left: 0; transform: translateX(-50%); }

/* even gaps */
.gap-block { position: absolute; border-radius: 8px; }
.gap-block.fixed { background: repeating-linear-gradient(135deg, var(--beige) 0 6px, #F3EAE0 6px 12px); border: 1.5px solid var(--ink); }
.gap-block.handle { background: var(--blue); box-shadow: 0 6px 14px rgba(47, 107, 221, 0.3); }
.gap-label { position: absolute; transform: translateX(-50%); }
.gap-rail { position: absolute; height: 1.5px; background: var(--ink); opacity: 0.25; }

/* spot the nudge */
.nudge-row { display: flex; align-items: flex-start; gap: 10px; }
.nudge-item { height: 68px; border: 0; border-radius: 9px; padding: 0; flex: none; }

/* aspect ratio */
.ratio-rect { position: absolute; background: var(--pink); border: 1.5px solid var(--ink); border-radius: 4px; }
.ratio-knob { position: absolute; width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); cursor: nwse-resize; }
.ghost { position: absolute; border: 2px dashed var(--orange); border-radius: 4px; pointer-events: none; }
.ghost .tag { right: 6px; bottom: 6px; }
/* aspect ratio reveal: your box fades back, the correct shape gets its own tint and labels sit in opposite corners */
.ratio-rect.done { background: #F7E6EE; border-color: rgba(0, 0, 0, 0.45); }
.ghost.target { background: rgba(236, 124, 78, 0.2); border-width: 2.5px; z-index: 2; }
.ghost.target .tag { right: auto; left: 6px; bottom: 6px; }
.tag.dark { background: var(--ink); }
.tag.yours { right: 6px; top: 6px; z-index: 3; }

/* hex match */
.sw-pair { display: flex; width: min(380px, 100%); height: 120px; border-radius: 14px; overflow: hidden; flex: none; }
.sw { flex: 1; display: flex; align-items: flex-end; padding: 10px 12px; font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); font-family: var(--mono); }
.sliders { display: grid; gap: 12px; width: min(380px, 100%); --thumb: 32px; }
.sliders label { display: grid; grid-template-columns: 18px 1fr; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; color: var(--muted); }
.slider.tint { border: 1px solid rgba(0, 0, 0, 0.08); }

/* odd shade */
.tiles { display: grid; gap: 6px; }
.tiles button { border: 0; border-radius: 8px; padding: 0; }

/* gradient sort */
.gs-row { position: relative; }
.gs-tile { position: absolute; top: 0; border-radius: 10px; transition: left 0.18s ease, transform 0.15s ease; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.gs-tile.dragging { transition: transform 0.15s ease; transform: scale(1.06); z-index: 3; box-shadow: 0 10px 22px rgba(0, 0, 0, 0.22); }
.gs-tile.fixed::after { content: ''; position: absolute; bottom: -14px; left: 50%; width: 6px; height: 6px; margin-left: -3px; border-radius: 50%; background: var(--ink); }
.gs-tile.wrong { outline: 3px solid var(--bad); outline-offset: 2px; }

/* color memory */
.mem-big { width: min(220px, 60%); height: 150px; border-radius: 16px; transition: background 0.2s; }
.mem-big.blank { background: repeating-linear-gradient(135deg, var(--beige) 0 6px, var(--soft) 6px 12px) !important; }
.mem-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: min(360px, 100%); }
.mem-opt { height: 96px; border: 0; border-radius: 12px; padding: 0; }

/* hex reader */
.hexcode { font-family: var(--mono); font-size: clamp(30px, 6vw, 44px); font-weight: 700; letter-spacing: 0.02em; }
.opt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; width: min(440px, 100%); }
.opt-sw { height: 110px; border: 0; border-radius: 12px; padding: 0; }

/* contrast call */
.cc-pair { display: flex; gap: 22px; flex-wrap: wrap; justify-content: center; }
.cc-cell { display: grid; justify-items: center; gap: 10px; }
.cc-btn { border: 0; border-radius: 12px; padding: 18px 30px; font-size: 18px; font-weight: 600; min-width: 170px; }
.cc-ratio { font-family: var(--mono); font-size: 13px; font-weight: 700; min-height: 18px; color: var(--muted); }
.cc-cell.best .cc-ratio { color: var(--good); }
.cc-cell.best .cc-btn { outline: 3px solid var(--good); outline-offset: 3px; }

/* opacity guess */
.op-scene {
  position: relative; width: min(300px, 100%); height: 120px; border-radius: 12px; overflow: hidden; flex: none; border: 1px solid var(--hair);
  background: #fff conic-gradient(#F1EAE1 25%, transparent 0 50%, #F1EAE1 0 75%, transparent 0) 0 0 / 20px 20px; /* the transparency checkerboard */
  --op-in: 16px; --op-edge: 36%; --op-full: 18%;
}
/* the word straddles the layer's left edge: "A" on bare paper, "a" under the layer */
.op-bg { position: absolute; top: 0; bottom: 0; left: var(--op-edge); transform: translateX(-50%); display: grid; place-items: center; font-size: 78px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); line-height: 1; }
.op-layer { position: absolute; top: var(--op-in); bottom: var(--op-in); left: var(--op-edge); right: calc(var(--op-in) + var(--op-full)); border-radius: 8px 0 0 8px; overflow: hidden; }
.op-band { position: absolute; left: 0; right: 0; }
.op-band.real { top: 0; bottom: 0; transition: top 0.35s ease; }
.op-band.you { top: 0; bottom: calc(50% + 1px); visibility: hidden; transition: opacity 0.8s ease 0.2s; }
.op-layer.split .op-band.real { top: calc(50% + 1px); }
.op-layer.split .op-band.you { visibility: visible; }
.op-tag {
  position: absolute; left: 8px; padding: 2px 7px; border-radius: 99px; background: #fff; color: var(--ink);
  font-size: 11px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); display: none;
}
.op-tag.you { top: 7px; }
.op-tag.real { bottom: 7px; }
.op-layer.split .op-tag { display: block; animation: rise 0.3s ease 0.35s both; }
/* the same color at full strength, flush against the layer: the 100% end of the scale */
.op-full { position: absolute; top: var(--op-in); bottom: var(--op-in); right: var(--op-in); width: var(--op-full); border-radius: 0 8px 8px 0; display: flex; align-items: flex-end; justify-content: flex-end; padding: 6px 7px; }
.op-full span { color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; opacity: 0.92; }
.chip { display: inline-block; width: 14px; height: 14px; border-radius: 4px; }

/* kern it */
.kern-line { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); font-weight: 700; letter-spacing: 0; line-height: 1; white-space: nowrap; font-kerning: normal; }
.kern-letter { position: absolute; top: 0; line-height: 1; }
.kern-letter.handle { color: var(--blue); padding: 10px 0; margin-top: -10px; }
.kern-letter.ghost-l { color: var(--orange); opacity: 0.55; pointer-events: none; }

/* type size + leading */
.ts-text { font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; white-space: nowrap; height: 86px; display: flex; align-items: center; }
.lead-box { width: min(420px, 100%); font-size: 15px; color: var(--ink); height: 190px; overflow: hidden; display: flex; align-items: center; }
.lead-box { position: relative; }
.lead-box p { margin: 0; }
.lead-ghost { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); color: var(--orange); mix-blend-mode: multiply; pointer-events: none; }

/* radius */
.rad-shape { position: relative; background: var(--orange); flex: none; }
.rad-shape i { position: absolute; inset: 0; border: 2px dashed var(--ink); }
.rad-shape b { position: absolute; inset: 0; border: 2.5px solid var(--orange); animation: rise 0.3s ease both; }

/* perfect circle */
.circle-pad { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.circle-pad svg { display: block; }
.circle-pad .ink { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.circle-pad .fitc { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 6 6; }
.pad-hint { position: absolute; left: 0; right: 0; top: 50%; justify-content: center; pointer-events: none; margin-top: -9px; }

/* angle */
.ang svg { display: block; }
.ang .ray, .ang .arm { stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; }
.ang .arm { stroke: var(--blue); stroke-width: 3; }
.ang .arc { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 4; }
.ang .ghostarm { stroke: var(--orange); stroke-width: 2; stroke-dasharray: 6 6; visibility: hidden; }
.ang .pivot { fill: var(--ink); }
.knob { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.18); }

/* size twin */
.twin svg { display: block; }
.twin .main { fill: var(--blue); }
.twin .sur { fill: var(--pink); }
.twin .truth { fill: none; stroke: var(--orange); stroke-width: 2; stroke-dasharray: 5 5; }
.twin text { font-size: 11px; letter-spacing: 0.13em; text-transform: uppercase; fill: var(--muted); text-anchor: middle; font-family: var(--font); font-weight: 500; }
.twin-slider { position: absolute; left: 50%; bottom: 24px; width: min(340px, calc(100% - 56px)); transform: translateX(-50%); }

/* bigger area */
.big-pair { display: flex; gap: 12px; }
.big-opt { display: grid; justify-items: center; gap: 4px; border: 0; background: transparent; border-radius: 14px; padding: 4px; }
.big-opt:hover { background: var(--soft); }
.big-opt span { min-height: 20px; font-size: 13px; font-weight: 700; font-family: var(--mono); }
.big-opt.ring { outline-offset: -3px; }

/* ---------- larger play UI (overrides the sizes above; phones scale back down below) ---------- */
.play { max-width: 1000px; width: 100%; padding-top: 30px; }
.play-top .label { font-size: 12px; }
.play-total b { font-size: 16px; }
.icon-btn { width: 46px; height: 46px; font-size: 17px; }
.timer { height: 6px; margin: 20px 0 28px; }
.play .btn { min-height: 56px; padding: 0 30px; font-size: 17px; }
.auto-hint { font-size: 16px; }
/* between rounds, while an answer is showing: centered under the test, and quieter than the other hints */
.auto-hint.waiting { flex: 1; text-align: center; color: #A69E95; }
/* with no Lock button beside it (tap-to-answer tests, memorizing), the hint sits in the middle */
.play-foot:has(#p-lock[hidden]) .auto-hint { flex: 1; text-align: center; }
.res-score b { font-size: 60px; }
.res-score span { font-size: 16px; }
.res-detail { font-size: 17px; }
.res-detail strong { font-size: 19px; }
.cap { font-size: 15px; }
.tag { font-size: 13px; padding: 4px 10px; }
.pips i { width: 30px; height: 6px; }
.slider { height: 16px; }
.slider::-webkit-slider-thumb { width: 32px; height: 32px; }
.slider::-moz-range-thumb { width: 28px; height: 28px; }
.slider-wrap { width: min(480px, 100%); }
.dial { width: min(420px, 100%); gap: 14px; }
.dial-num { font-size: 60px; min-width: 150px; }
.dial-num small { font-size: 20px; }
.dial-btn { width: 46px; height: 46px; font-size: 22px; }
.sw-pair { width: min(560px, 100%); height: 180px; border-radius: 18px; }
.sw { font-size: 13px; padding: 14px 16px; }
.sliders { width: min(560px, 100%); gap: 18px; }
.sliders label { grid-template-columns: 22px 1fr; font-size: 14px; }
.mem-big { width: min(320px, 70%); height: 210px; border-radius: 20px; }
.mem-grid { width: min(540px, 100%); gap: 16px; }
.mem-opt { height: 140px; border-radius: 16px; }
.hexcode { font-size: clamp(36px, 7vw, 64px); }
.opt-grid { width: min(660px, 100%); gap: 16px; }
.opt-sw { height: 160px; border-radius: 16px; }
.cc-pair { gap: 24px; }
.cc-btn { padding: 26px 30px; font-size: 22px; min-width: 210px; border-radius: 16px; }
.cc-ratio { font-size: 16px; }
.op-scene { width: min(440px, 100%); height: 180px; border-radius: 16px; --op-in: 22px; background-size: 24px 24px; }
.op-bg { font-size: 120px; }
.op-tag { font-size: 13px; padding: 3px 9px; left: 10px; }
.op-tag.you { top: 9px; }
.op-tag.real { bottom: 9px; }
.op-full span { font-size: 12px; }
.chip { width: 16px; height: 16px; }
.dial.revealed .dial-num { font-size: 48px; }
.ts-pair { display: flex; align-items: flex-end; justify-content: center; gap: clamp(28px, 8vw, 88px); }
.ts-group { display: grid; justify-items: center; gap: 22px; width: min(480px, 100%); }
.ts-group .dial { width: min(420px, 100%); }
.ts-col { display: grid; justify-items: center; gap: 10px; }
.ts-word { font-weight: 700; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; color: var(--ink); }
.ts-col .label { color: var(--ink); font-weight: 700; }
.ts-ref .label { color: var(--blue); }
.lead-box { width: min(560px, 100%); height: 240px; }
.gs-tile { font-size: 17px; border-radius: 12px; }
.big-opt span { font-size: 15px; }
.twin text { font-size: 13px; }

/* color recall picker: preview rectangle on top, square, hue strip, all one width */
.picker { display: flex; flex-direction: column; gap: 14px; max-width: 100%; }
.pick-preview { max-width: 100%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.pick-preview .sw { transition: flex 0.35s ease; white-space: nowrap; overflow: hidden; }
.pick-preview .pick-target { flex: 0 1 0; padding: 0; }
.pick-preview.revealed .pick-target { flex: 1 1 0; padding: 14px 16px; }
.sv { position: relative; max-width: 100%; border-radius: 14px; cursor: crosshair; flex: none; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.sv-thumb { position: absolute; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35), 0 3px 8px rgba(0, 0, 0, 0.3); pointer-events: none; }
.slider.hue { background: linear-gradient(90deg, #f00, #ff0 17%, #0f0 33%, #0ff 50%, #00f 67%, #f0f 83%, #f00); }

/* ================= second set of tests ================= */
/* optical center */
.oc-disc { position: absolute; border-radius: 50%; box-shadow: 0 26px 44px -22px rgba(0, 0, 0, 0.5); }
.oc-icon { position: absolute; overflow: visible; z-index: 2; }
.oc-icon polygon { fill: #fff; stroke: #fff; stroke-width: 6; stroke-linejoin: round; }
.oc-icon.handle { filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.22)); }
.oc-ghost { z-index: 1; pointer-events: none; opacity: 0.75; animation: rise 0.25s ease both; }
.oc-ghost polygon { fill: var(--orange); stroke: var(--orange); }
.oc-x { z-index: 3; }
.oc-cap { position: absolute; left: 0; right: 0; bottom: 8px; justify-content: center; pointer-events: none; }

/* odd font */
.of-grid { display: grid; gap: 12px; }
.of-tile { position: relative; display: grid; place-items: center; padding: 0 8px; border: 1.5px solid var(--hair); border-radius: 14px; background: var(--soft); color: var(--ink); transition: transform 0.15s ease, border-color 0.15s ease; }
.of-tile:hover { border-color: var(--ink); transform: translateY(-2px); }
.of-tile span { line-height: 1; white-space: nowrap; }
.of-tile small { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--muted); opacity: 0; transition: opacity 0.2s ease; }
.fill.answered .of-tile small { opacity: 1; }

/* guess the pixels: a box, a redline under it, and a ruler that wipes in on reveal */
.px-scene { position: relative; flex: none; padding-top: 38px; margin-bottom: 20px; }
.px-ref { position: absolute; left: 0; top: 0; display: flex; align-items: center; gap: 8px; }
.px-ref i { width: 24px; height: 24px; border-radius: 3px; border: 1.5px solid var(--blue); background: rgba(47, 107, 221, 0.14); }
.px-ref .label { color: var(--blue); font-weight: 700; }
.px-box { background: var(--pink); border: 1.5px solid var(--ink); border-radius: 4px; }
.px-dim { position: relative; height: 26px; margin-top: 8px; display: grid; place-items: center; }
.px-dim::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--ink); }
.px-dim::after { content: ''; position: absolute; left: 0; right: 0; top: 4px; bottom: 4px; border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); }
.px-dim b { position: relative; z-index: 1; padding: 2px 10px; border-radius: 99px; background: #fff; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; transition: background 0.25s ease, color 0.25s ease; }
.px-scene.measured .px-dim b { background: var(--orange); color: #fff; }
.px-ruler {
  position: absolute; left: 0; right: 0; top: 38px; height: 14px; pointer-events: none;
  background:
    repeating-linear-gradient(90deg, var(--ink) 0 1.5px, transparent 1.5px 50px) 0 0 / 100% 100% no-repeat,
    repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0 1px, transparent 1px 10px) 0 0 / 100% 55% no-repeat;
  clip-path: inset(0 100% -30px 0); transition: clip-path 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.px-scene.measured .px-ruler { clip-path: inset(0 -24px -30px 0); }
.px-ruler span { position: absolute; top: 17px; transform: translateX(-50%); font-family: var(--mono); font-size: 10px; font-weight: 700; }

/* stroke weight: the line weight is in screen pixels, whatever size the doodle is drawn at */
.sk-pair { display: flex; gap: 28px; align-items: flex-start; }
.sk-col { display: grid; justify-items: center; gap: 8px; }
.sk-art { position: relative; flex: none; border-radius: 18px; background: var(--soft); color: var(--ink); }
.sk-art.mine { color: var(--blue); }
.sk-art svg { display: block; width: 100%; height: 100%; padding: 13%; overflow: visible; }
.sk-art svg * { vector-effect: non-scaling-stroke; stroke-width: var(--sw); }
.sk-truth { position: absolute; inset: 0; color: var(--orange); pointer-events: none; clip-path: inset(0 0 0 50%); }
.sk-art.split > svg { clip-path: inset(0 50% 0 0); }
.sk-art.split::after { content: ''; position: absolute; left: 50%; top: 8%; bottom: 8%; border-left: 1.5px dashed rgba(0, 0, 0, 0.3); }
.sk-tag { position: absolute; padding: 2px 8px; border-radius: 99px; background: #fff; font-size: 12px; font-weight: 700; white-space: nowrap; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); animation: rise 0.3s ease both; }
.sk-tag.you { left: 8px; top: 8px; color: var(--blue); }
.sk-tag.real { right: 8px; bottom: 8px; color: var(--orange); }
.dial-num .dp { font-style: normal; font-variant-numeric: proportional-nums; margin: 0 0.02em; }

/* tracking */
.tk-box { display: grid; justify-items: center; gap: 24px; width: 100%; }
.tk-row { display: grid; justify-items: center; gap: 7px; max-width: 100%; }
.tk-text { font-weight: 600; line-height: 1.1; white-space: nowrap; color: var(--ink); }
.tk-text.mine { color: var(--blue); }
.tk-text.truth { color: var(--orange); }
.tk-hidden { visibility: hidden; }

/* font weight */
.fw-card { display: grid; place-items: center; flex: none; max-width: 100%; border-radius: 22px; background: var(--paper); overflow: hidden; } /* sized by the test, from the room it has */
.fw-word { letter-spacing: -0.03em; line-height: 1; white-space: nowrap; }
.fw-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: min(940px, 100%); }
.fw-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 20px; border-radius: 999px; border: 1.5px solid var(--ink); background: #fff; font-size: 17px; font-weight: 500; }
.fw-chip small { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--muted); }
.fw-chip:hover { background: var(--ink); color: #fff; }
.fw-chip:hover small { color: rgba(255, 255, 255, 0.7); }

/* baseline */
.bl-row { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); display: flex; align-items: flex-start; gap: 14px; white-space: nowrap; visibility: hidden; }
.bl-row.ready { visibility: visible; }
.bl-big { font-weight: 700; letter-spacing: -0.04em; line-height: 1; color: var(--ink); }
.bl-small { position: relative; font-weight: 600; line-height: 1; letter-spacing: 0.01em; color: var(--blue); }
.bl-small.handle::before { content: ''; position: absolute; inset: -16px -10px; } /* a bigger target for thumbs */
.bl-mark { display: inline-block; width: 0; height: 0; vertical-align: baseline; }
.bl-ghost { position: absolute; color: var(--orange); opacity: 0.6; pointer-events: none; }
.bl-line { position: absolute; left: -28px; right: -28px; height: 0; border-top: 2px dashed var(--orange); pointer-events: none; }

/* shadow match */
.sh-scene { display: flex; justify-content: center; gap: 52px; flex: none; max-width: 100%; padding: 34px 44px 90px; border-radius: 20px; background: var(--paper); overflow: hidden; }
.sh-card { display: grid; place-items: center; align-content: center; gap: 6px; flex: none; border-radius: 14px; background: #fff; }
.sh-card code { font-family: var(--mono); font-size: 13px; font-weight: 700; visibility: hidden; }
.sh-scene.revealed code { visibility: visible; }
.sliders.named label { grid-template-columns: 54px 1fr; }

/* missing step */
.rp-ramp { display: flex; }
.rp-step { display: grid; justify-items: center; gap: 5px; }
.rp-step i { display: grid; place-items: center; border-radius: 8px; font-style: normal; font-weight: 700; color: var(--muted); }
.rp-step i.hole { border: 2px dashed var(--ink); }
.rp-step i.hole.filled { border: 3px solid var(--good); animation: rise 0.25s ease both; }
.rp-step small { font-family: var(--mono); font-size: 10px; color: var(--muted); }
.rp-opts { display: flex; gap: 14px; margin-top: 12px; }
.rp-opt { border: 0; border-radius: 12px; padding: 0; transition: transform 0.15s ease; }
.rp-opt:hover { transform: translateY(-3px); }

/* squircle or not */
.sq-grid { display: grid; justify-content: center; gap: 10px 18px; }
.sq-opt { display: grid; justify-items: center; gap: 4px; border: 0; background: transparent; padding: 4px; border-radius: 18px; }
.sq-opt span { min-height: 20px; font-family: var(--mono); font-size: 14px; font-weight: 700; }
.sq-art { position: relative; }
.sq-art svg { display: block; }
.sq-glyph { position: absolute; inset: 25%; color: #fff; pointer-events: none; }
.sq-glyph svg { width: 100%; height: 100%; }
.sq-opt.ring, .sq-opt.miss { outline-offset: 0; }

/* ================= third set of tests: interface and motion ================= */
/* readable spot: a canvas "photo" with a caption dragged over it */
.rs-scene { position: relative; flex: none; overflow: hidden; border-radius: 18px; touch-action: none; box-shadow: 0 24px 40px -28px rgba(0, 0, 0, 0.55); }
.rs-photo { display: block; width: 100%; height: 100%; }
.rs-cap { position: absolute; left: 0; top: 0; padding: 6px 10px; color: #fff; font-weight: 700; letter-spacing: -0.01em; line-height: 1; white-space: nowrap; }
.rs-cap.dark { color: #000; }
.rs-best { position: absolute; border: 2px dashed #fff; outline: 1px solid rgba(0, 0, 0, 0.5); border-radius: 6px; pointer-events: none; }
.rs-best .tag { left: 0; }

/* equal columns */
.eq-box { position: absolute; }
.eq-col { position: absolute; top: 0; bottom: 0; border-radius: 10px; display: grid; place-items: end center; padding-bottom: 10px; }
.eq-knob { top: -10px; bottom: -10px; z-index: 2; }
.eq-label { padding: 2px 8px; border-radius: 99px; background: #fff; color: var(--ink); font-family: var(--mono); font-size: 13px; font-weight: 700; animation: rise 0.25s ease both; }
.eq-box .tick { z-index: 3; }

/* tap target */
.tt-box { position: relative; display: grid; place-items: center; flex: none; width: 100%; height: 170px; }
.tt-btn { display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: var(--blue); color: #fff; font-size: 16px; font-weight: 600; box-shadow: 0 10px 20px -10px rgba(47, 107, 221, 0.7); }
.tt-btn span { line-height: 1; white-space: nowrap; }
.tt-ghost { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 2px dashed var(--orange); border-radius: 14px; pointer-events: none; }

/* icon + label (the row itself reuses the baseline test's .bl-row) */
.ia-tile { position: relative; flex: none; border-radius: 24%; background: var(--blue); color: #fff; box-shadow: 0 6px 14px rgba(47, 107, 221, 0.3); }
.ia-tile::before { content: ''; position: absolute; inset: -12px; }
.ia-tile svg { display: block; width: 100%; height: 100%; padding: 16%; stroke-width: 2.4; }
.ia-label { font-weight: 700; letter-spacing: -0.03em; line-height: 1; color: var(--ink); }
.ia-ghost { position: absolute; border: 2px dashed var(--orange); border-radius: 24%; pointer-events: none; }
.bl-line.thin { border-top-width: 1px; opacity: 0.55; }

/* reading width */
.rw-box { position: relative; display: flex; justify-content: center; align-items: flex-start; flex: none; width: 100%; overflow: hidden; }
.rw-col { flex: none; max-width: 100%; height: 100%; background: var(--soft); box-shadow: -12px 0 0 var(--soft), 12px 0 0 var(--soft); }
.rw-col p { line-height: 1.5; color: var(--ink); }
.rw-ghost { position: absolute; top: 0; bottom: 0; left: 50%; transform: translateX(-50%); border-left: 2px dashed var(--orange); border-right: 2px dashed var(--orange); pointer-events: none; }

/* type scale */
.sc-list { display: grid; gap: 8px; justify-items: start; }
.sc-row { display: flex; align-items: baseline; gap: 16px; }
.sc-size { flex: none; width: 46px; text-align: right; font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--muted); }
.sc-word { font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; white-space: nowrap; color: var(--ink); }
.sc-row.mine .sc-word, .sc-row.mine .sc-size { color: var(--blue); }
.sc-row.solved .sc-word, .sc-row.solved .sc-size { color: var(--orange); }

/* label center */
.lc-btn { position: relative; flex: none; overflow: hidden; box-shadow: 0 18px 30px -18px rgba(0, 0, 0, 0.55); }
.lc-label { position: absolute; left: 0; right: 0; top: 0; text-align: center; color: #fff; font-weight: 600; line-height: 1; white-space: nowrap; visibility: hidden; }
.lc-btn.ready .lc-label { visibility: visible; }
.lc-label.lc-ghost { color: var(--orange); opacity: 0.8; pointer-events: none; }
.lc-mid { position: absolute; left: 0; right: 0; top: 50%; margin-top: -1px; border-top: 2px dashed var(--orange); pointer-events: none; }

/* contrast grade */
.cg-card { position: relative; display: grid; align-content: center; gap: 8px; flex: none; width: min(640px, 100%); min-height: 150px; padding: 26px 30px; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.cg-card strong { font-size: clamp(22px, 4.4vw, 40px); letter-spacing: -0.03em; line-height: 1.1; }
.cg-card > span:not(.cg-ratio) { font-size: 16px; }
.cg-ratio { position: absolute; right: 14px; top: 12px; padding: 2px 9px; border-radius: 99px; background: #fff; color: #000; font-family: var(--mono); font-size: 14px; font-weight: 700; }
.cg-ratio:empty { display: none; }

/* hover shade */
.hv-grid { display: grid; gap: 14px; justify-content: center; }
.hv-btn { display: grid; place-items: center; flex: none; border: 0; padding: 0; border-radius: 12px; color: #fff; font-size: 16px; font-weight: 600; }

/* gradient angle */
.ga-panel { position: relative; flex: none; border-radius: 18px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.ga-arrow { position: absolute; inset: 18%; pointer-events: none; }
.ga-arrow svg { display: block; width: 100%; height: 100%; stroke: #fff; stroke-width: 5; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.55)); }

/* nested radius */
.nr-outer { flex: none; }
.nr-inner { position: relative; width: 100%; height: 100%; background: var(--paper); }
.nr-inner i { position: absolute; inset: 0; border: 2.5px dashed var(--orange); pointer-events: none; }

/* elevation order */
.ev-panel { max-width: 100%; padding: 36px 38px 20px; border-radius: 20px; background: var(--paper); }
.ev-row { position: relative; margin-bottom: 46px; }
.ev-tile { position: absolute; top: 0; display: grid; place-items: center; border-radius: 12px; background: #fff; color: var(--ink); font-size: 18px; font-weight: 700; transition: left 0.18s ease, transform 0.15s ease; }
.ev-tile.dragging { transition: transform 0.15s ease; transform: scale(1.06); z-index: 3; }
.ev-tile.wrong { outline: 3px solid var(--bad); outline-offset: 2px; }
.ev-ends { display: flex; justify-content: space-between; }

/* blur match: hard edges and thin lines, the things a blur eats first */
.bm-scene { position: relative; flex: none; overflow: hidden; border-radius: 18px; background: var(--paper); }
.bm-art {
  position: absolute; inset: -26px; display: grid; place-items: center; font-weight: 800; letter-spacing: -0.04em; color: var(--ink);
  background:
    radial-gradient(circle at 27% 31%, var(--blue) 0 15%, transparent 15.5%),
    radial-gradient(circle at 73% 71%, var(--orange) 0 18%, transparent 18.5%),
    repeating-linear-gradient(90deg, transparent 0 30px, rgba(0, 0, 0, 0.85) 30px 32px),
    var(--paper);
}

/* easing match */
.em-fill { flex-direction: row; gap: 44px; }
.em-fill.stack { flex-direction: column; gap: 12px; }
.em-fill.stack .cap { display: none; }
.em-lanes { display: grid; gap: 14px; justify-items: start; }
.em-lane { display: grid; gap: 6px; }
.em-track { position: relative; height: 44px; border-radius: 99px; background: var(--paper); }
.em-track b { position: absolute; top: 50%; height: 0; border-top: 2px dashed rgba(0, 0, 0, 0.2); }
.em-dot { position: absolute; left: 0; top: 50%; width: 26px; height: 26px; margin-top: -13px; border-radius: 50%; background: var(--ink); will-change: transform; }
.em-dot.mine { background: var(--blue); }
.em-fill.stack .em-track { height: 34px; }
.em-editor { flex: none; overflow: visible; border-radius: 16px; background: var(--soft); touch-action: none; }
.em-unit { fill: #fff; stroke: var(--hair); stroke-width: 1.5; }
.em-curve { fill: none; stroke: var(--blue); stroke-width: 3.5; stroke-linecap: round; }
.em-arm { stroke: var(--blue); stroke-width: 1.5; opacity: 0.5; }
.em-grip { fill: #fff; stroke: var(--blue); stroke-width: 3; }
.em-truth { fill: none; stroke: var(--orange); stroke-width: 3; stroke-dasharray: 6 5; visibility: hidden; }
.em-editor.revealed .em-truth { visibility: visible; }
.em-truth-grip { fill: var(--orange); }

/* easing pick */
.ep-grid { display: grid; gap: 10px; justify-items: center; }
.ep-row { position: relative; max-width: 100%; border: 0; padding: 0; border-radius: 99px; background: var(--paper); }
.ep-row i { position: absolute; left: 0; border-radius: 50%; background: var(--ink); will-change: transform; }
.ep-row span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); z-index: 1; padding: 2px 9px; border-radius: 99px; background: #fff; font-family: var(--mono); font-size: 13px; font-weight: 700; }
.ep-row span:empty { display: none; }

/* quick runs by area, above the test grid */
.cat-runs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; margin-bottom: 22px; }
.cat-runs .label { margin-right: 6px; }

/* "New" pill on a test card */
.tcard { position: relative; }
.tc-new { position: absolute; top: 14px; right: 14px; padding: 3px 9px; border-radius: 99px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; }

/* ---------- results ---------- */
.results { padding-top: 12px; }
/* score centered, action buttons in a centered row beneath it */
.res-hero { display: grid; justify-items: center; text-align: center; gap: 28px; padding: 30px 0 44px; }
.res-hero h1 { font-size: clamp(72px, 13vw, 148px); line-height: 0.88; letter-spacing: -0.055em; font-weight: 700; margin: 14px 0 12px; font-variant-numeric: tabular-nums; }
.res-hero h1 small { font-size: 0.24em; letter-spacing: -0.01em; color: var(--muted); font-weight: 500; margin-left: 8px; }
/* role badge: colors climb with the tier, paper → pink → orange → blue → ink */
.badge {
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 26px; text-align: left;
  width: min(560px, 100%); padding: 22px 30px 22px 22px; border-radius: 22px; background: color-mix(in srgb, var(--paper) 50%, #fff); color: var(--ink);
  animation: badge-in 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.25) 0.15s both;
}
.badge.tier-4, .badge.tier-5 { background: color-mix(in srgb, var(--pink) 50%, #fff); }
.badge.tier-6, .badge.tier-7 { background: color-mix(in srgb, var(--orange) 50%, #fff); }
.badge.tier-8, .badge.tier-9 { background: color-mix(in srgb, var(--blue) 50%, #fff); }
.badge.tier-10 { background: color-mix(in srgb, var(--ink) 50%, #fff); }
/* the seal is a coin: it spins in on its vertical axis, tilts under the pointer and flips on a tap */
@property --g { syntax: '<percentage>'; inherits: true; initial-value: 0%; }
.badge-seal { --seal: 132px; width: var(--seal); height: var(--seal); perspective: 720px; cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; animation: seal-in 0.5s ease-out 0.3s both; }
.coin-tilt, .coin-flip, .coin-spin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.coin-tilt { transform: rotateX(var(--tx, 0deg)) rotateY(var(--ty, 0deg)); transition: transform 0.3s ease-out; }
.coin-flip { transform: rotateY(var(--flip, 0deg)); transition: transform 0.9s cubic-bezier(0.3, 1.25, 0.4, 1); }
.coin-spin { animation: coin-spin 2.6s cubic-bezier(0.12, 0.7, 0.2, 1) 0.35s both; }
.coin-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; transform: translateZ(calc(var(--seal) * 0.02)); }
.coin-face.back { transform: rotateY(180deg) translateZ(calc(var(--seal) * 0.02)); }
.coin-face img, .coin-face svg { display: block; width: 100%; height: 100%; }
/* the disc sits a little inside the picture; the metal layers match it */
.coin-edge, .coin-face::before, .coin-face::after { content: ''; position: absolute; left: 2.36%; top: 2.78%; width: 95.28%; height: 95.28%; border-radius: 50%; pointer-events: none; }
.coin-edge { background: linear-gradient(90deg, #7d7d7d, #f2f2f2 22%, #9b9b9b 45%, #ededed 68%, #777); transform: translateZ(calc(var(--z) * var(--seal) * 0.0062)); }
/* brushed metal: soft light and dark wedges round the disc, and a bright bevel at its edge */
.coin-face::before { background: conic-gradient(from 35deg, rgba(255,255,255,0.13), rgba(0,0,0,0.05) 14%, rgba(255,255,255,0.09) 27%, rgba(0,0,0,0.06) 42%, rgba(255,255,255,0.13) 55%, rgba(0,0,0,0.05) 68%, rgba(255,255,255,0.08) 82%, rgba(0,0,0,0.05) 92%, rgba(255,255,255,0.13)); box-shadow: inset 0 0 0 calc(var(--seal) * 0.009) rgba(255,255,255,0.32), inset 0 0 calc(var(--seal) * 0.05) rgba(0,0,0,0.1); }
/* the glint: a band of light that crosses the face as the coin turns */
.coin-face::after { background: linear-gradient(105deg, rgba(255,255,255,0) 4%, rgba(255,255,255,0.34) 13%, rgba(255,255,255,0.06) 19%, rgba(255,255,255,0) 26%) 0 0 / 200% 100% repeat-x; background-position: calc(var(--g) + var(--pg, 0%) + var(--fg, 0%)) 0; transition: background-position 0.6s ease-out; }
@keyframes coin-spin { from { transform: rotateY(-1260deg); --g: -700%; } to { transform: rotateY(0deg); --g: 0%; } }
.badge-body { display: grid; gap: 6px; justify-items: start; }
.badge-body .label { color: inherit; opacity: 0.7; }
.badge-role { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.05; }
.badge-quip { font-size: 16px; opacity: 0.8; text-wrap: balance; }
.badge-ladder { display: flex; gap: 4px; margin-top: 8px; }
.badge-ladder i { width: 18px; height: 6px; border-radius: 9px; background: currentColor; opacity: 0.18; }
.badge-ladder i.on { opacity: 0.55; }
.badge-ladder i.now { opacity: 1; width: 26px; }
.badge-next { font-size: 13px; font-weight: 600; opacity: 0.7; }
@keyframes badge-in { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
@keyframes seal-in { from { opacity: 0; scale: 0.6; } to { opacity: 1; scale: 1; } }
.res-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.res-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 28px; align-items: stretch; }
.panel { background: #fff; border: 1px solid var(--hair); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.panel > .label { display: block; margin-bottom: 10px; }
.breakdown { list-style: none; margin: 0; padding: 0; }
.breakdown li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 34px; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--hair); }
.breakdown li:first-child { border-top: 0; }
.breakdown .n { font-weight: 600; font-size: 15px; }
.breakdown .n small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breakdown .meter { height: 8px; border-radius: 9px; background: #EFEFEF; overflow: hidden; }
.breakdown .meter i { display: block; height: 100%; border-radius: 9px; background: var(--blue); }
.breakdown .meter i.mid { background: var(--orange); }
.breakdown .meter i.low { background: var(--pink); }
.breakdown .s { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

/* footer credit */
.credit { font-size: 13px; color: var(--muted); display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.credit .sep { color: var(--muted); font-weight: 700; font-size: 15px; line-height: 1; }
.credit a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; transition: text-decoration-color 0.15s; }
.credit a:hover { text-decoration-color: var(--ink); }

/* name + site fields on home */
.fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; max-width: 540px; margin: 30px 0 14px; }
.fields .name-field { margin: 0; max-width: none; }
.name-field input[aria-invalid='true'] { border-color: var(--bad); }
.field-err { min-height: 18px; font-size: 13px; color: var(--bad); }
.opt { text-transform: none; letter-spacing: 0; }
/* designer link on the leaderboard */
.rows .site { margin-left: 10px; font-size: 13px; font-weight: 500; color: var(--blue); text-decoration: none; }
.rows .site:hover { text-decoration: underline; }

/* ---------- daily: home with the live rankings beside it ---------- */
.day-hero { align-items: start; padding-top: 44px; padding-bottom: 56px; }
.tests-head { display: grid; gap: 6px; margin-bottom: 22px; }
.tests-head h2 { font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; }
.tests-head p { max-width: 600px; font-size: 16px; color: #4B4640; }
.home-board { display: grid; gap: 12px; }
.board-status { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 0 4px; border-top: 1px solid var(--hair); min-height: 30px; }
.rows li.empty { display: block; color: var(--muted); } /* a plain line, not a four-column score row */
/* the player's own row is marked by its "you" tag only: every row is white, with just the line between people */
/* this player's own row when it sits further down than the card shows */
.rows li.pin { border-top: 1.5px dashed var(--gap); margin-top: 6px; }

/* a row's name, then the X username and role. The username is the last thing to give way when space runs out. */
.rows .who { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.who-name { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.who-meta { flex: 0 99 auto; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; }
.who-meta small { margin-left: 0 !important; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.rows .site { margin-left: 0; flex: none; }
.rows li.me .who::after { content: none; }
.rows li.me .who-name::after { content: 'you'; margin-left: 8px; padding: 2px 7px; border-radius: 999px; background: var(--blue); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; vertical-align: 2px; }

/* who moved since yesterday (This week and All time) */
/* the up/down marker sits in the third column, where Today shows the time, so names line up on the left in every view */
.move { font-size: 11px; font-weight: 700; letter-spacing: 0.01em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.move.up { color: var(--good); }
.move.down { color: var(--bad); }
.move.same { color: var(--muted); }
.move.new { color: var(--blue); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; }

/* today: the button, or the finished round */
.btn.big { min-height: 56px; padding: 0 30px; font-size: 17px; }
.play-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 30px; }
.play-row .note { font-size: 14px; color: var(--muted); }
.today-card { margin-top: 28px; max-width: 540px; padding: 22px 24px 24px; border-radius: var(--radius); background: var(--paper); display: grid; gap: 16px; }
.tcd-top { display: flex; justify-content: space-between; gap: 6px 12px; flex-wrap: wrap; }
.tcd-score { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 10px; }
.tcd-score b { font-size: 68px; font-weight: 700; letter-spacing: -0.05em; line-height: 0.86; font-variant-numeric: tabular-nums; }
.tcd-score span { font-size: 18px; font-weight: 500; color: var(--muted); }
.tcd-score em { font-style: normal; font-size: 13px; font-weight: 600; margin-left: 6px; padding: 5px 12px; border-radius: 999px; background: var(--ink); color: #fff; align-self: center; }
.tcd-tests { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tcd-tests li { display: grid; gap: 6px; min-width: 0; }
.tcd-tests b { font-size: 16px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.tcd-tests .tbar { height: 6px; border-radius: 9px; background: rgba(0, 0, 0, 0.1); overflow: hidden; }
.tcd-tests .tbar i { display: block; height: 100%; border-radius: 9px; background: var(--ink); }
.tcd-tests .nm { font-size: 11px; line-height: 1.25; color: #4B4640; }
.tcd-rank { font-size: 15px; color: #4B4640; }
.tcd-rank strong { color: var(--ink); }
.today-card .cta-row { align-items: center; gap: 10px 14px; }

/* you: four numbers, then who you're playing as */
.youbox { margin-top: 22px; max-width: 540px; display: grid; gap: 16px; }
.youbox:empty { display: none; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--hair); }
.stats > div { display: grid; gap: 5px; padding: 14px 0 13px; }
.stats > div + div { padding-left: 16px; border-left: 1px solid var(--hair); }
.stats b { display: flex; align-items: baseline; gap: 7px; font-size: 22px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats .move { letter-spacing: 0; }
.as { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; font-size: 14px; color: #4B4640; }
.as strong { color: var(--ink); font-weight: 600; }
.as .site { font-weight: 500; color: var(--blue); text-decoration: none; }
.as .site:hover { text-decoration: underline; }
.as .sep { color: var(--muted); }
.linkish { background: none; border: 0; padding: 0; font-size: inherit; font-weight: 600; color: var(--ink); text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: var(--ink); }

/* name + X username */
.join { display: grid; gap: 10px; width: 100%; }
.join h3 { font-size: 21px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; }
.join p { font-size: 14px; color: #4B4640; max-width: 52ch; }
.join .fine { font-size: 13px; color: var(--muted); }
.join-form .fields { margin: 6px 0 4px; max-width: none; }
.join-form .btn[disabled] { opacity: 0.6; pointer-events: none; }
.rank-card .join { margin-block: auto; gap: 12px; }
.rank-card .join h3 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -0.035em; line-height: 1.05; }
.rank-card .join p { font-size: 15px; }
.rank-card .fields { grid-template-columns: 1fr; gap: 6px; }

/* ---------- share sheet: the round as a picture ---------- */
dialog.share { border: 0; padding: 20px 24px 22px; border-radius: 22px; width: min(600px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); background: #fff; color: var(--ink); box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.5); }
dialog.share[open] { display: grid; gap: 16px; }
dialog.share::backdrop { background: rgba(0, 0, 0, 0.45); }
.share-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.share .icon-btn { width: 36px; height: 36px; font-size: 13px; }
.share-card { aspect-ratio: 1080 / 1350; height: min(600px, calc(100dvh - 250px)); justify-self: center; border-radius: 18px; border: 1px solid var(--hair); overflow: hidden; display: grid; place-items: center; background: #fff; }
.share-card canvas { display: block; width: 100%; height: 100%; }
.share .btn[disabled] { opacity: 0.45; pointer-events: none; }
.share-hint { font-size: 14px; color: #4B4640; min-height: 20px; text-align: center; }
dialog.share .cta-row { justify-content: center; }
/* the name step before a first round */
dialog.share.namestep { width: min(440px, calc(100vw - 32px)); padding: 22px 26px 26px; }
dialog.namestep .join { display: grid; gap: 10px; }
dialog.namestep .join h3 { font-size: 28px; letter-spacing: -0.035em; line-height: 1.05; }
dialog.namestep .join p { color: var(--muted); font-size: 15px; }
dialog.namestep .fields { grid-template-columns: 1fr; gap: 12px; margin: 8px 0 14px; }
dialog.namestep .cta-row { justify-content: stretch; }
dialog.namestep .cta-row .btn { width: 100%; }

/* ---------- featured: last week's top three ---------- */
.podium { width: 100%; margin-bottom: 72px; display: grid; gap: 22px; }
.pod-head { display: grid; gap: 8px; }
.pod-head h2 { font-size: 28px; letter-spacing: -0.03em; line-height: 1.1; }
.pod-head p { max-width: 660px; font-size: 16px; color: #4B4640; }
.pod-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pod { display: flex; flex-direction: column; gap: 4px; min-height: 250px; padding: 22px 24px 24px; border-radius: var(--radius); border: 1.5px solid transparent; }
.pod b { margin-bottom: auto; font-size: 68px; font-weight: 700; letter-spacing: -0.05em; line-height: 0.9; }
.pod strong { margin-top: 20px; font-size: 24px; font-weight: 700; letter-spacing: -0.025em; line-height: 1.15; overflow-wrap: anywhere; }
.pod span { font-size: 14px; opacity: 0.82; }
.pod-x { align-self: flex-start; display: inline-flex; align-items: center; min-height: 38px; margin-top: 14px; padding: 0 16px; border-radius: 999px; background: #fff; color: var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; transition: transform 0.15s ease; }
.pod-x:hover { transform: translateY(-1px); }
.pod.p1 { background: var(--blue); color: #fff; }
.pod.p2 { background: var(--orange); }
.pod.p3 { background: var(--pink); }
.pod.open { min-height: 170px; border: 1.5px dashed var(--gap); color: var(--muted); }
.pod.open strong { color: var(--ink); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-size: 14px; font-weight: 500; opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; max-width: calc(100vw - 32px); text-align: center; z-index: 20; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-bottom: 64px; }
  .board-sec { grid-template-columns: 1fr; gap: 24px; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .res-grid { grid-template-columns: 1fr; }
  .res-grid .rank-card { order: -1; } /* one column: where you landed (and the name form) comes before the breakdown */
}
@media (max-width: 640px) {
  .badge { grid-template-columns: 1fr; justify-items: center; text-align: center; gap: 12px; padding: 24px 20px; }
  .badge-body { justify-items: center; }
  .badge-seal { --seal: 112px; }
  .badge-role { font-size: 26px; }
  .fields { grid-template-columns: 1fr; gap: 8px; }
  #app { padding: 0 16px 24px; }
  .nav { padding: 18px 0; }
  .hero { padding-top: 10px; }
  .hero-art { height: auto; display: grid; gap: 12px; }
  .hc { position: static; width: auto; height: auto !important; min-height: 150px; padding: 20px; flex-direction: row; align-items: center; gap: 16px; justify-content: flex-start; }
  .hc svg { width: 56px; height: 56px; flex: none; }
  .hc-line .hc-body { padding-bottom: 0; margin-top: 0; }
  .hc h3 { font-size: 19px; margin-bottom: 8px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .tcard { padding: 14px; }
  .tcard svg { width: 52px; height: 52px; }
  .tc-name { font-size: 15px; }
  .cta-row .btn { flex: 1; padding: 0 16px; }
  .stage { min-height: 320px; max-height: 520px; }
  .play-foot { flex-wrap: wrap; min-height: 136px; align-content: flex-end; } /* room for the two-row result bar, so the test area is the same size before and after */
  .result { flex-wrap: wrap; gap: 10px 14px; }
  .res-actions { width: 100%; }
  .res-actions .btn { flex: 1; }
  .res-score b { font-size: 38px; }
  .res-hero { gap: 20px; }
  .res-cta .btn { flex: 1 1 auto; }
  .opt-grid { grid-template-columns: repeat(2, 1fr); }
  .opt-sw { height: 84px; }
  .cc-btn { min-width: 132px; padding: 16px 18px; font-size: 16px; }
  .cc-pair { gap: 12px; }
  .mem-opt { height: 76px; }
  .mem-big { height: 150px; }
  .sw-pair { height: 130px; }
  .op-scene { height: 130px; }
  .op-bg { font-size: 84px; }
  .op-scene { --op-in: 14px; }
  .op-tag { font-size: 11px; padding: 2px 7px; left: 7px; }
  .op-tag.you { top: 6px; }
  .op-tag.real { bottom: 6px; }
  .dial-num { font-size: 44px; min-width: 110px; }
  .dial.revealed .dial-num { font-size: 34px; }
  .play h2 { font-size: 17px; }
  .p-icon { width: 26px; height: 26px; }
  #p-prompt { font-size: 19px; line-height: 1.25; min-height: 3.75em; margin: 8px 0 8px; } /* three lines on a phone */
  .play .btn { min-height: 50px; padding: 0 22px; font-size: 16px; }
  .lead-box { height: 200px; }
  .rows li { grid-template-columns: 26px minmax(0, 1fr) auto; }
  .rows .time { display: none; }
  .ev-panel { padding: 26px 16px 14px; }
  .ev-row { margin-bottom: 34px; }
  .cg-card { padding: 20px; min-height: 130px; }
  .tt-box { height: 160px; }
  .fw-chip { min-height: 44px; padding: 0 14px; font-size: 15px; }
  .fw-row { gap: 8px; }
  .sk-pair { gap: 14px; }
  .sh-scene { gap: 26px; padding: 22px 20px 60px; }
  .tk-box { gap: 14px; }
  .rp-opts { gap: 10px; }
  .of-grid { gap: 8px; }
  .of-tile small { font-size: 10px; bottom: 5px; }
  .tc-new { top: 10px; right: 10px; }
  .board, .panel { padding: 18px 16px 10px; }
  .rows.moves li { grid-template-columns: 26px minmax(0, 1fr) auto auto; }
  dialog.share { padding: 16px 16px 18px; border-radius: 18px; }
  .share .cta-row .btn { padding: 0 12px; }
  .podium { margin-bottom: 56px; }
  .pod-row { grid-template-columns: 1fr; gap: 12px; }
  .pod { min-height: 0; padding: 18px 18px 20px; }
  .pod b { font-size: 48px; margin-bottom: 4px; }
  .pod strong { margin-top: 8px; }
  .pod.open { min-height: 0; flex-direction: row; align-items: baseline; gap: 12px; padding: 14px 18px; }
  .pod.open b { font-size: 28px; margin: 0; }
  .pod.open strong { margin: 0; font-size: 18px; }
  .rows .who { flex-direction: column; align-items: stretch; gap: 2px; }
  .rows li, .board-page .rows li { padding: 11px 0; }
  .day-hero { padding-top: 14px; padding-bottom: 48px; }
  .play-row { margin-top: 24px; }
  .play-row .btn { flex: 1 1 100%; }
  .today-card { padding: 18px 16px 20px; margin-top: 24px; }
  .tcd-score b { font-size: 56px; }
  .tcd-tests { gap: 8px; }
  .tcd-tests .nm { font-size: 10px; }
  .today-card .cta-row .btn { flex: 1; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
  .stats > div:nth-child(4) { border-top: 1px solid var(--hair); }
  .rank-card { padding: 22px 16px; }
}

/* short windows (laptops with toolbars, small browser windows): tighten the play header and shrink the tallest pieces */
@media (max-height: 760px) {
  .play { padding-top: 14px; }
  .timer { margin: 12px 0 14px; }
  .play-foot { min-height: 56px; margin-top: 8px; }
  .res-score b { font-size: 46px; }
  .sw-pair { height: 130px; }
  .mem-big { height: 150px; }
  .mem-opt { height: 96px; }
  .opt-sw { height: 116px; }
  .op-scene { height: 140px; }
  .op-bg { font-size: 92px; }
  .lead-box { height: 200px; }
  .dial-num { font-size: 48px; }
  .sh-scene { padding-bottom: 64px; }
}

/* short phones: keep the room for the two-row result bar */
@media (max-width: 640px) and (max-height: 760px) {
  .play-foot { min-height: 136px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- home, once today's round is done: one row of three matching cards (the round, the badge it earned,
   the player and the name form), with the rankings below ---------- */
.day-hero.done { grid-template-columns: 1fr; gap: 44px; }
.day-hero.done h1 { font-size: clamp(30px, 3.6vw, 44px); margin: 14px 0 0; }
.day-hero.done .lede { display: none; }
.day-hero.done .today { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 20px; align-items: stretch; margin-top: 26px; }
.day-hero.done .today > * { margin: 0; max-width: none; width: auto; border-radius: var(--radius); padding: 28px; }
.day-hero.done .today-card { gap: 20px; grid-template-rows: auto auto auto 1fr auto; background: #fff; border: 1px solid var(--hair); }
.day-hero.done .tcd-tests .tbar { background: rgba(0, 0, 0, 0.08); }
.day-hero.done .tcd-score b { font-size: clamp(64px, 7vw, 92px); }
.day-hero.done .tcd-score span { font-size: 20px; }
.day-hero.done .tcd-tests { gap: 10px; }
.day-hero.done .tcd-tests b { font-size: 18px; }
.day-hero.done .tcd-rank { font-size: 15px; }
/* the badge, upright and centered */
.day-hero.done .today > .badge { grid-template-columns: 1fr; justify-items: center; align-content: center; text-align: center; gap: 18px; }
.day-hero.done .today .badge-body { justify-items: center; }
.day-hero.done .today .badge-seal { --seal: 176px; }
.day-hero.done .today .badge-role { font-size: 26px; }
.day-hero.done .today .badge-quip { font-size: 15px; }
/* the player: running numbers, then the name form or who they are playing as */
.day-hero.done .today > .youbox { border: 1px solid var(--hair); background: #fff; align-content: start; gap: 20px; }
.day-hero.done .today .stats { border-top: 0; }
.day-hero.done .today .stats > div:nth-child(-n+2) { padding-top: 0; }
.day-hero.done .today .stats > div { padding-bottom: 16px; }
.day-hero.done .today .stats > div:nth-child(n+3) { padding-top: 16px; }
.day-hero.done .today .stats > div:nth-child(even) { padding-left: 20px; }
/* Share and Replay sit side by side as two equal buttons across the card */
.day-hero.done .today-card .cta-row { flex-wrap: nowrap; gap: 10px; align-items: stretch; }
.day-hero.done .today-card .cta-row .btn { flex: 1 1 0; min-width: 0; padding-inline: 12px; white-space: nowrap; }
.day-hero.done .today .join { padding: 0; border: 0; }
.day-hero.done .today .fields { grid-template-columns: 1fr; gap: 10px; }
.day-hero.done .today .join-form .btn { width: 100%; }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats > div:nth-child(3) { padding-left: 0; border-left: 0; border-top: 1px solid var(--hair); }
.stats > div:nth-child(4) { border-top: 1px solid var(--hair); }
.home-board .youbox { margin-top: 12px; max-width: none; }
.home-board .join { padding: 22px 24px 24px; border: 1px solid var(--hair); border-radius: var(--radius); }
.home-board .as { padding: 0 4px; }
@media (max-width: 1040px) {
  .day-hero.done .today { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .day-hero.done .today > .today-card { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .day-hero.done .today { grid-template-columns: 1fr; gap: 14px; }
  .day-hero.done .today > * { padding: 20px 18px; }
  .day-hero.done .tcd-tests { gap: 8px; }
  .day-hero.done .tcd-tests b { font-size: 16px; }
  .day-hero.done .today .badge-seal { --seal: 148px; }
  .home-board .join { padding: 18px 16px 20px; }
}

/* the rankings once they sit below the top three */
.home-board.below { width: 100%; margin-bottom: 72px; }
.day-hero.done { padding-bottom: 48px; }
.day-hero.done + .podium { margin-bottom: 48px; }

/* test cards that can't be played yet: shown, quieter, with a small lock */
.tcard.locked { cursor: default; opacity: 0.55; }
.tcard.locked:hover { transform: none; box-shadow: none; }
.tc-lock { position: absolute; top: 14px; right: 14px; display: block; opacity: 0.6; }
.tcard .tc-lock svg { width: 16px; height: 16px; display: block; }
.tests .grid + .tests-head { margin-top: 56px; }

/* an X username: a small grey pill with the X mark, in ink, wherever it appears */
.site, .rows .site, .as .site { display: inline-flex; align-items: center; gap: 5px; flex: none; padding: 3px 10px 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.06); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.3; text-decoration: none; transition: background 0.15s; }
.site:hover, .rows .site:hover, .as .site:hover { background: rgba(0, 0, 0, 0.12); text-decoration: none; }
.site i, .pod-x i { display: block; width: 11px; height: 11px; flex: none; }
.site i svg, .pod-x i svg { display: block; width: 100%; height: 100%; }
.pod-x { gap: 7px; }
.pod-x i { width: 13px; height: 13px; }
@media (min-width: 641px) { .rows .who { align-items: center; } }
.who-meta { align-items: center; }
@media (max-width: 640px) { .rows .who { align-items: flex-start; } }

/* ---------- privacy and terms pages ---------- */
.legal { max-width: 680px; padding: 56px 0 72px; flex: 1; }
.legal h1 { font-size: clamp(36px, 5vw, 56px); line-height: 1; letter-spacing: -0.035em; font-weight: 700; margin: 14px 0 22px; }
.legal .lede { max-width: none; }
.legal h2 { font-size: 21px; letter-spacing: -0.02em; font-weight: 700; margin: 40px 0 10px; }
.legal p, .legal li { font-size: 16px; line-height: 1.6; color: #2B2825; }
.legal p + p { margin-top: 12px; }
.legal ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.legal ul + p { margin-top: 12px; }
.legal a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--hair); text-underline-offset: 3px; }
.legal a:hover { text-decoration-color: var(--ink); }
@media (max-width: 640px) { .legal { padding: 32px 0 48px; } }

/* ---------- top bar actions, the pixel arrow, badges on the top three, test cards beside Play ---------- */
.nav-actions { display: flex; align-items: center; gap: 8px; }
.btn i:has(.px-arrow) { display: inline-flex; margin-left: 14px; }
.px-arrow { display: block; width: 21px; height: 15px; transition: transform 0.2s steps(2); }
.btn:hover .px-arrow { transform: translateX(6px); }
.pod { position: relative; }
.pod-badge { position: absolute; top: 18px; right: 18px; width: 96px; height: 96px; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.22)); }
.day-hero { align-items: center; }
.day-hero.done { align-items: start; }
.day-hero.done .hero-art { display: none; }
.day-hero .hero-art { height: 460px; }
.day-hero .hc h3 { margin-bottom: 8px; }
.day-hero .hc-blue .label { color: rgba(255, 255, 255, 0.82); }
.day-hero:not(.done) .today > .youbox { margin-top: 30px; max-width: 480px; }
.day-hero:not(.done) .today > .youbox:empty { display: none; }
@media (max-width: 860px) {
  .day-hero .hero-art { height: auto; }
  .pod-badge { width: 64px; height: 64px; top: 14px; right: 14px; }
}
@media (max-width: 640px) {
  /* phones: the top bar has to fit the logo and two buttons, and the decorative test cards make way for the top three */
  .nav-actions { gap: 6px; }
  .nav-actions .btn.small { min-height: 36px; padding: 0 12px; font-size: 13px; }
  .nav .logo .pe-logo { width: 139px; height: 22px; }
  .day-hero .hero-art { display: none; }
}

/* the Rankings button sits at the right of the top-three heading */
.pod-head { grid-template-columns: minmax(0, 1fr) auto; align-items: start; column-gap: 16px; }
.pod-head .pod-all { grid-column: 2; grid-row: 1 / span 2; }
.pod-head p { grid-column: 1; }

/* Optical Size: two big letters on one baseline, a slider under them, and the answer drawn over */
.osz { display: grid; place-items: center; padding-bottom: 70px; }
.osz-row { position: relative; display: flex; align-items: baseline; gap: 0.12em; color: var(--ink); letter-spacing: 0; user-select: none; }
.osz-row span { display: block; }
.osz-line { position: absolute; left: -45%; right: -45%; height: 0; border-top: 2px dashed var(--orange); pointer-events: none; }
.osz-ghost { position: absolute; color: var(--orange); opacity: 0.6; mix-blend-mode: multiply; pointer-events: none; }

/* ---------- the top three, restyled: each card takes its player's role color at half strength, like the badge card,
   with the role's coin at the top right, the place as a large numeral, and the week's points beside the X link ---------- */
.pod, .pod.p1, .pod.p2, .pod.p3 { background: color-mix(in srgb, var(--paper) 50%, #fff); color: var(--ink); min-height: 264px; padding: 24px 26px 24px; gap: 2px; }
.pod.tier-4, .pod.tier-5 { background: color-mix(in srgb, var(--pink) 50%, #fff); }
.pod.tier-6, .pod.tier-7 { background: color-mix(in srgb, var(--orange) 50%, #fff); }
.pod.tier-8, .pod.tier-9 { background: color-mix(in srgb, var(--blue) 50%, #fff); }
.pod.tier-10 { background: color-mix(in srgb, var(--ink) 50%, #fff); }
.pod b { font-size: 76px; }
.pod strong { margin-top: 24px; font-size: 26px; }
.pod .pod-role { font-size: 15px; opacity: 0.75; }
/* the coin: the badge on a silver disc, whose edge shows as a thin metal rim */
.pod-coin { position: absolute; top: 20px; right: 20px; width: 120px; height: 120px; border-radius: 50%; background: linear-gradient(135deg, #8a8a8a, #f4f4f4 22%, #a3a3a3 45%, #efefef 68%, #7c7c7c); }
.pod-coin img { display: block; width: 100%; height: 100%; }
.pod-foot { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 14px; margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(0, 0, 0, 0.12); }
.pod-pts { font-size: 14px; opacity: 1; }
.pod-pts em { font-style: normal; font-weight: 700; font-size: 22px; letter-spacing: -0.02em; margin-right: 5px; font-variant-numeric: tabular-nums; }
.pod-foot .pod-x { margin-top: 0; min-height: 36px; padding: 0 14px; font-size: 13px; }
.pod.open { background: transparent; min-height: 264px; }
.pod.open .pod-coin { background: none; border: 1.5px dashed var(--gap); }
.pod-badge { display: none; }
@media (max-width: 860px) {
  .pod, .pod.open { min-height: 0; }
  .pod b { font-size: 52px; }
  .pod strong { margin-top: 14px; font-size: 22px; }
  .pod-coin { width: 84px; height: 84px; top: 16px; right: 16px; }
  .pod.open .pod-coin { display: none; }
}

/* the three test cards beside Play drift slowly, each on its own rhythm, so they never move in step */
.day-hero .hc { animation: hc-in 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both, hc-drift 8s ease-in-out infinite alternate; will-change: translate, rotate; }
.day-hero .hc-line { --dx: 4px; --dy: -9px; --dr: -0.6deg; animation-duration: 0.7s, 9s; animation-delay: 0.05s, 0.75s; }
.day-hero .hc-blue { --dx: -5px; --dy: 8px; --dr: 0.7deg; animation-duration: 0.7s, 7.5s; animation-delay: 0.15s, 0.85s; }
.day-hero .hc-white { --dx: 5px; --dy: 7px; --dr: -0.5deg; animation-duration: 0.7s, 10.5s; animation-delay: 0.25s, 0.95s; }
@keyframes hc-in { from { opacity: 0; scale: 0.96; } to { opacity: 1; scale: 1; } }
@keyframes hc-drift { from { translate: 0 0; rotate: 0deg; } to { translate: var(--dx) var(--dy); rotate: var(--dr); } }
@media (prefers-reduced-motion: reduce) { .day-hero .hc { animation: none; } }
