/* ============ Wordno — shared styles ============ */
:root {
  --bg: #121614;
  --bg-2: #171c19;
  --panel: rgba(22, 27, 24, 0.78);
  --panel-solid: #191e1b;
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.14);

  --ink: #f2efe6;
  --ink-2: #b9beb5;
  --ink-3: #80877e;

  --tile: #ece7d6;
  --tile-ink: #3a463c;
  --tile-shadow: #b8b097;
  --tile-used: #3b413c;
  --tile-used-ink: #5f675f;
  --tile-used-shadow: #2a2f2b;

  --gold: #e9c46a;
  --gold-deep: #b8913a;
  --sage: #bccbb2;
  --sage-deep: #8d9c84;
  --coral: #ff6b3d;
  --mint: #5fd391;
  --teal: #6fd8d6;
  --pink: #ff8fa3;
  --red: #ff6b6b;

  --radius: 16px;
  --font: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --mono: "DM Mono", ui-monospace, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
/* phones: no double-tap zoom (taps register instantly), no automatic text resizing */
html, body, * { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ============ Flower background ============ */
.flower-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(120% 60% at 50% 115%, rgba(120, 32, 12, 0.55), transparent 60%),
    radial-gradient(60% 40% at 85% 10%, rgba(233, 196, 106, 0.05), transparent 70%),
    var(--bg);
}
.flower {
  position: absolute;
  transform-style: preserve-3d;
  will-change: transform;
}
.flower svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  animation: spin var(--spin, 80s) linear infinite;
  animation-direction: var(--dir, normal);
}
.flower .bob {
  width: 100%;
  height: 100%;
  animation: bob var(--bob, 9s) ease-in-out infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bob {
  0%, 100% { transform: translateY(0) rotateX(var(--tilt, 18deg)); }
  50% { transform: translateY(-18px) rotateX(calc(var(--tilt, 18deg) + 6deg)); }
}
body.calm .flower-bg .flower { opacity: calc(var(--o, 1) * 0.45); }

.page { position: relative; z-index: 1; }

/* ============ Nav ============ */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px clamp(18px, 4vw, 56px);
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.02em;
}
.logo-tiles { position: relative; width: 46px; height: 36px; display: inline-block; }
.logo-tiles .lt {
  position: absolute;
  width: 26px; height: 30px;
  border-radius: 7px;
  display: grid; place-items: center;
  font-size: 15px; font-weight: 700;
  color: #2b2a1f;
  transition: rotate .25s ease, translate .25s ease;
}
.logo-tiles .lt.l { background: var(--gold); box-shadow: 0 3px 0 var(--gold-deep); left: 0; top: 0; rotate: -10deg; z-index: 1; }
.logo-tiles .lt.n { background: var(--sage); box-shadow: 0 3px 0 var(--sage-deep); left: 18px; top: 5px; rotate: 9deg; }
.logo:hover .lt.l { rotate: -16deg; translate: -2px -2px; }
.logo:hover .lt.n { rotate: 15deg; translate: 2px 0; }
.nav-links { display: flex; gap: 10px; align-items: center; }

/* ============ Buttons ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 600;
  transition: transform .12s ease, background .2s ease, opacity .2s ease, box-shadow .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-gold { background: var(--gold); color: #2a2617; box-shadow: 0 4px 0 var(--gold-deep); }
.btn-gold:hover:not(:disabled) { background: #f1d07e; }
.btn-ghost { background: rgba(255,255,255,0.06); color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.1); }
.btn-sm { padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn-icon {
  width: 40px; height: 40px; padding: 0;
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 18px;
}
.btn-icon:hover { background: rgba(255,255,255,0.12); }

/* ============ Tiles ============ */
.tiles {
  display: flex;
  gap: clamp(5px, 1.2vw, 10px);
  flex-wrap: wrap;
}
.tile {
  --w: clamp(36px, 9vw, 62px);
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 1.08);
  border-radius: 9px;
  background: var(--tile);
  color: var(--tile-ink);
  box-shadow: 0 4px 0 var(--tile-shadow), 0 10px 18px rgba(0,0,0,.25);
  display: grid;
  place-items: center;
  font-size: calc(var(--w) * 0.56);
  font-weight: 500;
  border: 0;
  user-select: none;
  transition: background .2s, color .2s, box-shadow .2s, transform .15s, opacity .2s;
  font-family: var(--font);
  padding: 0;
}
.tile .idx {
  position: absolute;
  right: 6px; bottom: 4px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  opacity: .6;
}
button.tile:hover:not(.used) { transform: translateY(-3px); }
.tile.used {
  background: var(--tile-used);
  color: var(--tile-used-ink);
  box-shadow: 0 4px 0 var(--tile-used-shadow);
  cursor: default;
}
.tile.used .idx { opacity: .4; }
.tile.selected {
  background: var(--gold);
  color: #2a2617;
  box-shadow: 0 4px 0 var(--gold-deep), 0 0 0 3px rgba(233,196,106,.25);
  transform: translateY(-3px);
}
.tile.made { background: var(--sage); box-shadow: 0 4px 0 var(--sage-deep), 0 10px 18px rgba(0,0,0,.25); }
.tile.made.selected { background: var(--gold); box-shadow: 0 4px 0 var(--gold-deep), 0 0 0 3px rgba(233,196,106,.25); }
.tile.made.used { background: var(--tile-used); box-shadow: 0 4px 0 var(--tile-used-shadow); }
.tile.pop { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); } 100% { transform: scale(1); opacity: 1; } }

.shake { animation: shake .35s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ============ Common text ============ */
.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; color: var(--gold); }
.muted { color: var(--ink-2); }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
}

/* ============ Panels ============ */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
}

/* ============ Landing ============ */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  align-items: center;
  gap: 40px;
  min-height: calc(100vh - 90px);
  padding: 20px clamp(18px, 6vw, 96px) 60px;
}
.hero h1 {
  font-size: clamp(44px, 7vw, 96px);
  line-height: .98;
  letter-spacing: -0.04em;
  font-weight: 700;
  margin: 18px 0 24px;
}
.hero h1 .serif { font-size: 1.1em; letter-spacing: -0.01em; }
.hero p.lead { font-size: 18px; line-height: 1.55; color: var(--ink-2); max-width: 460px; margin: 0 0 32px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-art { position: relative; height: 440px; }
.htile {
  --s: 1;
  position: absolute;
  left: var(--x); top: var(--y);
  width: calc(170px * var(--s)); height: calc(200px * var(--s));
  border-radius: calc(22px * var(--s));
  display: grid; place-items: center;
  font-size: calc(92px * var(--s)); font-weight: 500;
  color: #2f3a31;
  background: var(--tile);
  box-shadow: 0 calc(12px * var(--s)) 0 rgba(0,0,0,.2), 0 30px 60px rgba(0,0,0,.45);
  translate: var(--px, 0px) var(--py, 0px);
  rotate: var(--r);
  animation: drift 7s ease-in-out var(--d, 0s) infinite;
  transition: translate .4s ease-out, scale .2s ease;
  user-select: none;
}
.htile:hover { scale: 1.08; }
.htile small {
  position: absolute; right: calc(16px * var(--s)); bottom: calc(12px * var(--s));
  font-family: var(--mono); font-size: calc(13px * var(--s)); opacity: .55;
}
.htile.gold { background: var(--gold); }
.htile.sage { background: var(--sage); }
.htile.coral { background: #ff8a5c; color: #3a140a; }
.htile.cream { background: var(--tile); }
@keyframes drift { 50% { transform: translateY(-14px) rotate(3deg); } }
.sparkle { position: absolute; right: 4%; top: 36%; font-size: 54px; color: var(--sage); animation: twinkle 4s ease-in-out infinite; }
@keyframes twinkle { 50% { transform: rotate(45deg) scale(.85); opacity: .6; } }

/* ===== Landing: one vertical card, no scrolling ===== */
html:has(body.no-scroll), body.no-scroll { height: 100%; overflow: hidden; }
.nav-float { position: fixed; top: 0; left: 0; right: 0; z-index: 5; }
.land {
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  padding: 70px 16px 20px;
}
.land-card {
  width: min(460px, 100%);
  padding: clamp(18px, 3.2vh, 34px) clamp(20px, 4vw, 36px);
  text-align: center;
  background: rgba(20, 25, 22, .72);
}
.land-tiles {
  --base: clamp(62px, 13vh, 112px);
  position: relative;
  height: calc(var(--base) * 1.9);
  margin: 0 auto clamp(10px, 2.4vh, 22px);
  max-width: 360px;
}
.land-tiles .htile {
  width: calc(var(--base) * var(--s));
  height: calc(var(--base) * 1.18 * var(--s));
  font-size: calc(var(--base) * .55 * var(--s));
  border-radius: calc(var(--base) * .13 * var(--s));
  box-shadow: 0 calc(var(--base) * .07 * var(--s)) 0 rgba(0,0,0,.2), 0 18px 36px rgba(0,0,0,.4);
}
.land-tiles .htile small {
  right: calc(var(--base) * .09 * var(--s)); bottom: calc(var(--base) * .07 * var(--s));
  font-size: calc(var(--base) * .08 * var(--s));
}
.land-card h1 {
  font-size: clamp(34px, 7vh, 60px);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: clamp(8px, 1.6vh, 14px) 0 clamp(10px, 1.8vh, 16px);
}
/* "fast." matches "big." — the serif font draws smaller letters, so it needs a slightly larger size to look the same */
.land-card h1 .serif { font-size: 1.15em; line-height: .95; }
.land-card h1 .big-word { font-size: 1.22em; letter-spacing: -0.045em; line-height: .95; }
.land-card .lead { color: var(--ink-2); font-size: clamp(14px, 2.1vh, 17px); line-height: 1.5; margin: 0 auto clamp(14px, 2.8vh, 26px); max-width: 340px; }
.land-actions { display: flex; gap: 10px; }
/* keep the card inside narrow phones: let it shrink, and let long button labels wrap instead of pushing it wider */
.land { grid-template-columns: minmax(0, 1fr); }
.land-card { min-width: 0; justify-self: center; }
.land-actions .btn { min-width: 0; white-space: nowrap; text-align: center; line-height: 1.2; padding: 12px 16px; font-size: 15px; }
@media (max-width: 420px) {
  .land-actions { gap: 8px; }
  .land-actions .btn { padding: 11px 10px; font-size: 14px; }
  .land-actions .btn span { display: none; }      /* hide the → so labels stay on one line */
  .land-card .eyebrow { font-size: 11px; letter-spacing: .1em; }
}
@media (max-width: 350px) {
  .land-actions .btn { padding: 10px 8px; font-size: 13px; }
}
/* short phones (e.g. iPhone SE): shrink the landing card so it still fits without scrolling */
@media (max-height: 640px) {
  .land { padding-top: 60px; padding-bottom: 12px; }
  .land-tiles { --base: clamp(46px, 11dvh, 112px); }
  .land-card h1 { font-size: clamp(30px, 6.4dvh, 60px); }
  .land-card .lead { font-size: 14px; }
}
.daily-line { margin-top: clamp(10px, 2dvh, 16px); font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); }
.land-actions .btn { flex: 1; }
.land-actions .btn-gold { flex: 1.3; }

/* how-to modal */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6,8,7,.6); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s; }
.modal-box {
  position: relative;
  width: min(1100px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: clamp(22px, 4vw, 40px);
  border-radius: 24px;
  background: rgba(20, 25, 22, .94);
  border: 1px solid var(--line-2);
  box-shadow: 0 40px 100px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(16px) scale(.98);
  transition: opacity .2s, transform .2s;
}
.modal.open .modal-backdrop { opacity: 1; }
.modal.open .modal-box { opacity: 1; transform: none; }
.modal-box h2 { font-size: clamp(26px, 3.6vw, 42px); letter-spacing: -0.03em; margin: 10px 0 26px; padding-right: 40px; }
.modal-x { position: absolute; top: 18px; right: 18px; }
.modal .card { background: rgba(255,255,255,.03); backdrop-filter: none; box-shadow: none; }

/* WebGL flowers take over from the SVG fallback */
#flowerCanvas { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; pointer-events: none; }
body.gl-on .flower-bg { display: none; }

.section { padding: 40px clamp(18px, 6vw, 96px) 80px; }
.section h2 { font-size: clamp(30px, 4vw, 48px); letter-spacing: -0.03em; margin: 10px 0 34px; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.card { padding: 26px; }
.card h3 { font-size: 22px; margin: 14px 0 10px; letter-spacing: -0.02em; }
.card p { color: var(--ink-2); line-height: 1.6; margin: 0 0 18px; font-size: 15px; }
.card .tiles .tile { --w: 38px; }
.demo-target {
  font-size: 46px; font-weight: 700; color: var(--gold); letter-spacing: -0.03em; margin-bottom: 10px;
}
.demo-steps { font-family: var(--mono); font-size: 14px; color: var(--ink-2); line-height: 1.9; margin-top: 14px; }
.score-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.score-table td { padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.score-table td:last-child { text-align: right; color: var(--ink); font-weight: 600; font-family: var(--mono); }
.score-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.score-cols { align-items: start; }
/* compact two-column points lists in How to play */
.pts-title { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin: 12px 0 4px; }
.pts-cols { display: grid; grid-template-columns: 1fr 1.15fr; gap: 16px; align-items: start; }
.pts-list > div { display: flex; justify-content: space-between; gap: 6px; padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.3; color: var(--ink-2); white-space: nowrap; }
.pts-list b { font-family: var(--mono); font-weight: 600; color: var(--ink); }
@media (max-width: 400px) {
  .pts-cols { gap: 10px; }
  .pts-list > div { font-size: 11.5px; }
}
.score-cols .score-table td { padding: 4px 0; font-size: 12.5px; white-space: nowrap; }
.score-cols .score-table th { text-align: left; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); padding: 0 0 6px; border-bottom: 1px solid var(--line-2); }
.footer { padding: 30px clamp(18px, 6vw, 96px) 40px; color: var(--ink-3); font-size: 13px; display: flex; justify-content: space-between; border-top: 1px solid var(--line); }

/* ============ Game ============ */
.game-wrap { max-width: 820px; margin: 0 auto; padding: 6px 18px 60px; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.game-top .left, .game-top .right { display: flex; gap: 10px; align-items: center; }
.game-panel { padding: clamp(20px, 4vw, 38px); }
.game-panel h2 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -0.03em; margin: 8px 0 26px; line-height: 1.1; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin: 28px 0 10px; }
.word-row { display: flex; gap: 12px; }
.word-input {
  flex: 1;
  min-width: 0;
  background: #0f1311;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 22px;
  letter-spacing: .22em;
  padding: 14px 18px;
  text-transform: uppercase;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.word-input:focus { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(233,196,106,.12); }
.hint { color: var(--ink-3); font-size: 14px; margin-top: 10px; line-height: 1.5; }
.row-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.msg {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  line-height: 1.5;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
}
.msg.good { border-color: rgba(95,211,145,.35); background: rgba(95,211,145,.08); }
.msg.bad { border-color: rgba(255,107,107,.35); background: rgba(255,107,107,.08); }
.msg strong { font-weight: 700; }
.msg .def { display: block; color: var(--ink-2); font-size: 14px; margin-top: 6px; font-style: italic; }

/* numbers round */
.num-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.timer { position: relative; width: 74px; height: 74px; flex: none; }
.timer svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 6; }
.timer .track { stroke: rgba(255,255,255,.08); }
.timer .prog { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 1s linear, stroke .3s; }
.timer .t-label { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--mono); font-size: 17px; font-weight: 500; }
.timer.low .prog { stroke: var(--coral); }
.timer.low .t-label { color: var(--coral); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }

.target-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(233,196,106,.07);
  border: 1px solid rgba(233,196,106,.2);
  margin-bottom: 6px;
}
.target-box .tiles .tile { --w: clamp(48px, 11vw, 72px); background: var(--gold); color: #2a2617; box-shadow: 0 5px 0 var(--gold-deep), 0 10px 20px rgba(0,0,0,.25); font-weight: 600; }
.target-box .tlabel { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; color: var(--gold); text-transform: uppercase; }
.target-box .closest { font-size: 14px; color: var(--ink-2); margin-top: 4px; }
.target-box .target-tiles { flex-wrap: nowrap; justify-content: center; }
.num-tiles .tile { font-size: calc(var(--w) * 0.44); font-weight: 600; }
.num-tiles .tile.wide { --w: clamp(48px, 11vw, 70px); }
.ops { display: flex; gap: 10px; margin-top: 8px; }
.op {
  width: 58px; height: 52px;
  border-radius: 12px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: 26px;
  font-weight: 500;
  transition: background .15s, transform .12s;
}
.op:hover:not(:disabled) { background: rgba(255,255,255,.12); }
.op.active { background: var(--gold); color: #2a2617; border-color: var(--gold); }
.op:disabled { opacity: .35; cursor: not-allowed; }
.expr {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 18px;
  color: var(--ink-2);
  min-height: 28px;
}
.expr .slot { display: inline-block; min-width: 34px; padding: 2px 8px; margin-right: 6px; border-radius: 6px; background: rgba(255,255,255,.06); text-align: center; color: var(--ink); }
.expr .slot.empty { color: var(--ink-3); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.steps li {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--mono);
  font-size: 17px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
  animation: pop .3s ease;
}
.steps li .n { font-size: 11px; color: var(--ink-3); width: 18px; }
.steps li .r { color: var(--sage); font-weight: 500; }
.steps li.hit .r { color: var(--mint); }
.steps li .r.used { color: var(--ink-3); opacity: .55; }
.steps li.last .r { font-weight: 700; color: var(--ink); font-size: 1.12em; }
.steps li.last.hit .r { color: var(--mint); }
.steps li .tag { margin-left: auto; font-size: 11px; color: var(--ink-3); letter-spacing: .08em; text-transform: uppercase; }
.step-input { letter-spacing: .08em; text-transform: none; }
.ops { margin-top: 12px; }
.steps .empty-step { color: var(--ink-3); font-size: 14px; padding: 10px 0; }

.ready {
  text-align: center;
  padding: 30px 10px 10px;
}
.ready .big { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; }
.ready p { color: var(--ink-2); max-width: 440px; margin: 10px auto 26px; line-height: 1.6; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%) translateY(-20px);
  background: var(--panel-solid); border: 1px solid var(--line-2);
  padding: 12px 18px; border-radius: 12px; font-size: 14px; z-index: 50;
  opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.bullseye {
  position: fixed; inset: 0; display: grid; place-items: center; z-index: 40; pointer-events: none;
}
.bullseye span {
  font-size: clamp(48px, 10vw, 110px); font-weight: 700; letter-spacing: -0.04em;
  color: var(--mint); text-shadow: 0 10px 40px rgba(0,0,0,.5);
  animation: boom .9s ease forwards;
}
@keyframes boom { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 1; } }

/* ============ Results ============ */
.res-wrap { max-width: 760px; margin: 0 auto; padding: 6px 18px 60px; }
.res-panel { padding: clamp(20px, 4vw, 34px); }
.res-head { display: flex; justify-content: space-between; align-items: center; }
.res-hero { display: flex; align-items: center; justify-content: center; gap: 30px; margin: 22px 0 10px; flex-wrap: wrap; }
.rank-title { text-align: center; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-size: 15px; margin-top: 18px; }
.big-score { font-size: clamp(72px, 14vw, 116px); font-weight: 700; letter-spacing: -0.05em; color: var(--mint); line-height: 1; }
.big-score small { font-size: .3em; color: var(--ink-3); font-weight: 600; letter-spacing: 0; }
.badge {
  width: 118px; text-align: center;
}
.badge .art {
  width: 118px; height: 104px; border-radius: 12px;
  border: 2px solid var(--gold);
  background: radial-gradient(circle at 50% 60%, #3a1a10, #141816);
  display: grid; place-items: center; overflow: hidden;
  box-shadow: 0 0 0 4px rgba(233,196,106,.12);
}
.badge .art > svg { width: 90px; height: 90px; }
.badge .art.glow-once { animation: frameGlow 2.6s ease-out 1; }
@keyframes frameGlow {
  0% { box-shadow: 0 0 0 4px rgba(233,196,106,.12); }
  18% { box-shadow: 0 0 0 4px rgba(233,196,106,.4), 0 0 36px 8px rgba(255,140,70,.55); }
  100% { box-shadow: 0 0 0 4px rgba(233,196,106,.12); }
}
.badge-tiles { position: relative; width: 84px; height: 70px; }
.badge-tiles .bt {
  position: absolute; width: 46px; height: 54px; border-radius: 9px;
  display: grid; place-items: center; font-size: 28px; font-weight: 600; color: #2f3a31;
  box-shadow: 0 4px 0 rgba(0,0,0,.25), 0 10px 18px rgba(0,0,0,.35);
}
.badge-tiles .bt.l { background: var(--gold); left: 4px; top: 2px; rotate: -10deg; }
.badge-tiles .bt.n { background: var(--sage); right: 4px; top: 14px; rotate: 9deg; }
.badge .name { color: var(--gold); font-size: 13px; font-weight: 600; margin-top: 6px; }
.res-sub { text-align: center; color: var(--ink-2); font-size: 15px; font-weight: 500; }

.chart-card {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 8px;
  background: rgba(255,255,255,.02);
}
.chart-card .ctitle { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.chart-card h4 { margin: 0; font-size: 13px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); }
.chart-card .pct { font-size: 14px; color: var(--ink-2); }
.chart-card .pct strong { color: var(--ink); }
.chart { position: relative; margin-top: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .tip {
  position: absolute; top: 0; transform: translateX(-50%);
  background: #0e1210; border: 1px solid var(--line-2);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; line-height: 1.4;
  white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s;
}
.chart .tip b { font-size: 13px; }
.chart .tip span { color: var(--ink-2); }
.chart-note { font-size: 12px; color: var(--ink-3); margin: 4px 0 6px; }
details.table-view { font-size: 13px; color: var(--ink-2); margin: 6px 0 4px; }
details.table-view summary { cursor: pointer; color: var(--ink-3); }
details.table-view table { width: 100%; border-collapse: collapse; margin-top: 8px; }
details.table-view td, details.table-view th { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; }
details.table-view th { color: var(--ink-3); }

.round-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.rcard { border: 1px solid var(--line); border-radius: 14px; padding: 18px; background: rgba(255,255,255,.02); }
.rcard .rtop { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.rcard .pts { font-family: var(--mono); font-weight: 500; }
.rcard .pts b { font-size: 20px; color: var(--ink); }
.rcard .tiles .tile { --w: 32px; }
.rcard .line { font-size: 14px; color: var(--ink-2); margin-top: 12px; line-height: 1.5; }
.rcard .mono-steps { font-family: var(--mono); font-size: 13px; color: var(--ink-2); line-height: 1.8; margin-top: 6px; }
.rcard .mono-steps .r { color: var(--sage); }
.res-actions { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.stats-row { display: flex; justify-content: center; gap: 26px; margin-top: 18px; color: var(--ink-3); font-size: 13px; }
.stats-row b { color: var(--ink); font-size: 16px; display: block; text-align: center; }

/* =====================================================
   ONE-SCREEN APP SHELL — no page scrolling, phone-first
   ===================================================== */
html:has(body.app), body.app { height: 100%; overflow: hidden; overscroll-behavior: none; }
body.app { -webkit-tap-highlight-color: transparent; }
.shell {
  position: relative; z-index: 1;
  height: 100vh; height: 100dvh;
  max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 12px calc(12px + env(safe-area-inset-bottom));
}
.shell-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 2px; }
.shell-top .right { display: flex; gap: 8px; align-items: center; }
.shell-main { flex: 1; min-height: 0; display: flex; }
.shell-main > .panel {
  flex: 1; min-height: 0; min-width: 0;
  display: flex; flex-direction: column;
  padding: clamp(14px, 2.4dvh, 30px) clamp(14px, 4vw, 30px);
  overflow: hidden;
}
.g-title { font-size: clamp(22px, 3.6dvh, 34px); letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 0; }
.g-center { flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: center; gap: clamp(10px, 2.2dvh, 22px); }
/* word round: letters sit right under the title instead of floating in the middle */
#wordRound .g-center { justify-content: flex-start; padding-top: clamp(18px, 5dvh, 44px); }
/* bigger letter tiles */
#letterTiles.fit { gap: clamp(6px, 1.2vw, 12px); }
#letterTiles.fit .tile { max-width: min(84px, 11.5dvh); font-size: clamp(22px, min(5.6vw, 5.6dvh), 46px); border-radius: 11px; }
#letterTiles.fit .tile .idx { font-size: 9px; right: 6px; bottom: 4px; }
/* phones: 2 rows of 4 so each tile can be much larger */
@media (max-width: 480px) {
  #letterTiles.fit { display: grid; grid-template-columns: repeat(4, minmax(0, min(78px, 10.5dvh))); justify-content: center; gap: 10px; }
  #letterTiles.fit .tile { max-width: none; width: 100%; font-size: clamp(26px, min(9.5vw, 5.4dvh), 40px); }
}
/* …and the input + buttons sit at the bottom of the panel, easy to reach with a thumb */
#wordRound .word-bottom { margin-top: auto; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; }

/* tile rows that always fit the width */
.tiles.fit { flex-wrap: nowrap; justify-content: center; gap: clamp(4px, 1.2vw, 10px); }
.tiles.fit .tile {
  flex: 1 1 0; min-width: 0;
  max-width: min(64px, 9dvh);
  width: auto; height: auto; aspect-ratio: .92;
  font-size: clamp(18px, min(5.4vw, 4.4dvh), 34px);
}
.tiles.fit .tile .idx { font-size: 8px; right: 4px; bottom: 3px; }
/* number tiles: 6 per row; numbers you make wrap onto a second row in sage green */
.num-tiles.fit {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, min(64px, 8.5dvh)));
  justify-content: center;
  gap: clamp(5px, 1.2vw, 10px);
}
.num-tiles.fit .tile { max-width: none; width: 100%; font-size: clamp(16px, min(4.8vw, 3.4dvh), 26px); }
.num-tiles .tile.made { background: #8faa84; color: #1c2818; box-shadow: 0 4px 0 #66805c, 0 10px 18px rgba(0,0,0,.25); }
.num-tiles .tile.made.used { background: var(--tile-used); color: var(--tile-used-ink); box-shadow: 0 4px 0 var(--tile-used-shadow); }

/* ⌫ sits inside the word input, on the right */
.input-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.input-wrap .word-input { flex: 1; min-width: 0; padding-right: 52px; }
.input-wrap .in-back {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 40px; height: calc(100% - 12px); max-height: 40px;
  border: 0; border-radius: 8px;
  background: rgba(255,255,255,.08); color: var(--ink);
  font-size: 18px; display: grid; place-items: center;
  transition: background .15s, opacity .15s;
}
.input-wrap .in-back:hover { background: rgba(255,255,255,.16); }
.input-wrap .in-back.empty { opacity: .35; }
@media (max-width: 360px) {
  .input-wrap .word-input { padding-left: 10px; padding-right: 44px; letter-spacing: .12em; }
  .input-wrap .word-input::placeholder { letter-spacing: 0; }
  .input-wrap .in-back { width: 34px; right: 5px; }
}

/* undo sits on the step it undoes */
.steps li .undo-step {
  margin-left: auto;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,.07);
  color: var(--ink);
  border-radius: 8px;
  padding: 5px 10px;
  font-family: var(--font);
  font-size: 13px;
  font-weight: 600;
  flex: none;
}
.steps li .undo-step:hover:not(:disabled) { background: rgba(255,255,255,.14); }
.steps li .undo-step:disabled { opacity: .4; }

/* skip confirmation */
.confirm-box { width: min(380px, 100%); text-align: center; }
.confirm-box h3 { margin: 0 0 8px; font-size: 22px; letter-spacing: -0.02em; }
.confirm-box p { margin: 0 0 20px; color: var(--ink-2); font-size: 15px; line-height: 1.5; }
.confirm-actions { display: flex; gap: 10px; }
.confirm-actions .btn { flex: 1; }

.word-row { display: flex; gap: 10px; }
.word-row .word-input { font-size: clamp(17px, 2.6dvh, 22px); padding: clamp(10px, 1.6dvh, 14px) 14px; }
.word-row .btn { padding-left: 16px; padding-right: 16px; }
.msg-slot { min-height: clamp(44px, 8dvh, 70px); }
.msg-slot .msg { margin-top: 0; padding: 10px 14px; font-size: 14px; }
.msg-slot .msg .def { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.game-panel .row-actions { margin-top: 0; flex-wrap: nowrap; }
.word-input::placeholder { letter-spacing: .04em; text-transform: none; }
.game-panel .hint { margin-top: 0; font-size: 13px; }

/* numbers round */
.num-play { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: clamp(8px, 1.5dvh, 14px); }
.num-play .num-head { align-items: center; }
.timer { width: clamp(50px, 8dvh, 70px); height: clamp(50px, 8dvh, 70px); }
.timer .t-label { font-size: clamp(14px, 2.2dvh, 17px); }
.target-box { padding: clamp(8px, 1.4dvh, 16px) 14px; gap: clamp(4px, .8dvh, 8px); margin: 0; }
.target-box .tiles .tile { --w: clamp(38px, 7.2dvh, 64px); font-size: calc(var(--w) * .55); }
.target-box .closest { margin: 0; font-size: 13px; }
.num-play .steps { flex: 1; min-height: 44px; overflow-y: auto; align-content: start; gap: 6px; scrollbar-width: thin; }
.num-play .steps li { padding: clamp(5px, 1dvh, 9px) 12px; font-size: clamp(14px, 2.1dvh, 17px); }
.num-play .steps .r { cursor: pointer; }
.num-play .steps .r.used { cursor: default; }
.num-play .steps .empty-step { padding: 6px 0; }
.num-play .ops { margin-top: 0; gap: 8px; }
.num-play .op { flex: 1; width: auto; max-width: 72px; height: clamp(40px, 6.4dvh, 52px); font-size: 22px; }
.num-actions { display: flex; gap: 8px; align-items: center; }
.num-play .num-head { gap: 10px; }
.head-right { display: flex; align-items: center; gap: 10px; flex: none; }
.num-play .op-reset { font-size: 20px; color: var(--ink-2); }
/* short screens (laptops with small windows, landscape phones): tighten everything so nothing is cut off */
@media (max-height: 620px) {
  .shell-top { padding: 6px 2px; }
  .shell-main > .panel { padding-top: 10px; padding-bottom: 10px; }
  .num-play { gap: 6px; }
  .timer { width: 42px; height: 42px; }
  .timer .t-label { font-size: 12px; }
  .target-box { padding: 6px 12px; gap: 2px; }
  .target-box .tlabel { font-size: 10px; }
  .target-box .tiles .tile { --w: clamp(30px, 6.4dvh, 44px); }
  .target-box .closest { font-size: 12px; }
  .num-tiles.fit { grid-template-columns: repeat(6, minmax(0, min(56px, 7.6dvh))); gap: 6px; }
  .num-play .steps { min-height: 34px; }
  .num-play .steps li { padding: 4px 10px; font-size: 14px; }
  .num-play .word-row .word-input { padding-top: 8px; padding-bottom: 8px; }
  .num-play .word-row .btn { padding-top: 8px; padding-bottom: 8px; }
  .num-play .op { height: 36px; font-size: 18px; }
}
.ready { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 0; }
.ready .big { font-size: clamp(40px, 8dvh, 64px); }
.ready p { margin-bottom: clamp(12px, 2.4dvh, 20px); }
.gold-note { color: var(--gold); font-weight: 600; }
.callout {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  max-width: 440px; margin: 0 auto clamp(16px, 3dvh, 26px);
  padding: 12px 16px; border-radius: 14px;
  background: rgba(233,196,106,.1);
  border: 1px solid rgba(233,196,106,.35);
  color: var(--ink-2); font-size: 14px; line-height: 1.5;
}
.callout b { color: var(--gold); display: block; margin-bottom: 2px; font-size: 15px; }
.callout-icon { color: var(--gold); font-size: 18px; line-height: 1.3; flex: none; }

/* results */
.res-panel { gap: clamp(8px, 1.6dvh, 16px); }
.res-panel .rank-title { margin-top: 0; font-size: 13px; }
/* perfect score: the title waits for the count to reach 200, then pops in with a shimmer */
.rank-title.waiting { visibility: hidden; }
.rank-title.perfect-pop {
  color: var(--gold);
  animation: perfectPop .6s cubic-bezier(.2, 1.4, .4, 1) both, perfectShine 3s ease-in-out .6s infinite;
}
@keyframes perfectPop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes perfectShine { 50% { text-shadow: 0 0 14px rgba(233,196,106,.75); } }
.res-panel .big-score { text-align: center; font-size: clamp(56px, 11dvh, 104px); }
.res-panel .res-sub { font-size: 13px; line-height: 1.5; }
.res-panel .chart-card { margin-top: 0; flex: 1; min-height: 110px; display: flex; flex-direction: column; padding: 12px 14px 6px; }
.res-panel .chart { flex: 1; min-height: 0; margin-top: 4px; }
.res-panel .chart svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.chart-card h4 .est { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--ink-3); }
.seg { display: none; gap: 6px; padding: 4px; border-radius: 12px; background: rgba(255,255,255,.05); border: 1px solid var(--line); }
.seg button { flex: 1; border: 0; border-radius: 9px; padding: 8px; background: transparent; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.seg button b { color: var(--ink-3); font-weight: 500; margin-left: 4px; font-family: var(--mono); font-size: 12px; }
.seg button.active { background: rgba(255,255,255,.1); color: var(--ink); }
.res-panel .round-cards { margin-top: 0; flex: none; }
.rcard { padding: 14px; overflow: hidden; }
.rcard .rtop { margin-bottom: 10px; }
.rcard .line { margin-top: 8px; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .inline-steps { font-family: var(--mono); font-size: 12px; color: var(--ink-2); line-height: 1.6; margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rcard .inline-steps .r { color: var(--sage); }
.rcard .tiles.fit .tile { max-width: 34px; font-size: 16px; }
.res-panel .res-actions { margin-top: 0; flex: none; }
.res-panel .res-actions .btn { flex: 1; max-width: 240px; }
.res-panel .res-actions { align-items: stretch; }
.next-puzzle {
  flex: 1; max-width: 240px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 8px 14px; border-radius: 12px;
  background: rgba(233,196,106,.1); border: 1px solid rgba(233,196,106,.35);
}
.next-puzzle .np-label { font-family: var(--mono); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.next-puzzle .np-time { font-family: var(--mono); font-size: 20px; font-weight: 500; color: var(--gold); letter-spacing: .04em; }

/* how-to popup: 3 pages (Letters → Numbers → Scoring) with Back / Next, on every screen size */
.how-box { width: min(520px, 100%); overflow: hidden; padding: clamp(14px, 2.6dvh, 28px) clamp(16px, 3vw, 28px); }
.how-box > .eyebrow { margin-bottom: 4px; }
.how-box h2 { font-size: clamp(18px, 3.2dvh, 28px); margin: 0 0 clamp(10px, 2dvh, 18px); padding-right: 44px; line-height: 1.15; }
.how-box .cards { display: block; }
.how-box .card { display: none; padding: clamp(12px, 2.2dvh, 20px); }
.how-box .card.active { display: block; animation: pop .25s ease; }
.how-box .card h3 { font-size: clamp(17px, 2.6dvh, 22px); margin: 6px 0 8px; }
.how-box .card p { font-size: clamp(13px, 1.95dvh, 15px); line-height: 1.5; margin: 0 0 clamp(8px, 1.6dvh, 14px); }
.how-box .card .tiles .tile { --w: clamp(30px, 5.4dvh, 40px); }
.how-box .after-demo { margin: clamp(8px, 1.6dvh, 14px) 0 0 !important; }
.how-box .after-demo b { color: var(--ink); }
/* page 2 worked example: target on the left, the two steps beside it */
.how-box .demo-wrap { display: flex; align-items: center; gap: clamp(12px, 3vw, 22px); margin-bottom: clamp(8px, 1.6dvh, 12px); }
.how-box .demo-target { font-size: clamp(30px, 5.4dvh, 46px); line-height: 1; margin: 0; flex: none; }
.how-box .demo-target small { display: block; font-family: var(--mono); font-size: 10px; font-weight: 400; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.how-box .demo-steps { margin: 0; font-family: var(--mono); font-size: clamp(13px, 2dvh, 15px); line-height: 1.75; color: var(--ink-2); }
.how-box .demo-steps b { color: var(--gold); font-weight: 600; }
.how-box .ds-n { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-right: 8px; border-radius: 4px; background: rgba(255,255,255,.08); font-size: 10px; color: var(--ink-3); vertical-align: 1px; }
.how-box .scoring-card .pts-title { margin: 6px 0 2px; }
.how-box .scoring-card .pts-list > div { padding: clamp(2px, .6dvh, 5px) 0; }
.how-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: clamp(10px, 2dvh, 18px); }
.how-nav .dots { display: flex; gap: 6px; }
.how-nav .dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: background .2s, width .2s; }
.how-nav .dots span.on { background: var(--gold); width: 18px; border-radius: 4px; }
.modal-x { top: clamp(10px, 2dvh, 18px); right: clamp(10px, 2dvh, 18px); }

/* ============ Responsive ============ */
/* very short screens: hide the extra demo lines so each page still fits */
@media (max-height: 560px) {
  .how-box > .eyebrow { display: none; }
  .how-box #demoNums { display: none; }   /* keep the worked example; drop the small tile row instead */
}
/* phones & small screens: one card at a time on the results page */
@media (max-width: 640px), (max-height: 720px) {
  .seg { display: flex; }
  .res-panel .round-cards { grid-template-columns: 1fr; }
  .res-panel .round-cards .rcard { display: none; }
  .res-panel .round-cards .rcard.active { display: block; }
}
@media (max-width: 640px) {
  .shell-top .logo { font-size: 18px; }
  .game-panel .btn-sm { padding: 9px 11px; font-size: 13px; }
  .word-row .btn span { display: none; }
}
@media (max-height: 640px) {
  .game-panel .hint { display: none; }
  .g-title { font-size: 20px; }
  .res-panel .res-sub { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============ Privacy policy page ============ */
/* a legal text is long, so only the text area scrolls inside the panel — the page itself never scrolls */
.policy { gap: 0; }
.policy h1 { font-size: clamp(26px, 4.4dvh, 40px); letter-spacing: -0.03em; margin: 6px 0 2px; }
.policy-date { color: var(--ink-3); font-family: var(--mono); font-size: 12px; margin: 0 0 12px; }
.policy-body {
  flex: 1; min-height: 0; overflow-y: auto;
  padding-right: 8px; margin-right: -8px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  touch-action: pan-y;
}
.policy-body h2 { font-size: 17px; letter-spacing: -0.01em; margin: 22px 0 8px; color: var(--ink); }
.policy-body p, .policy-body li { color: var(--ink-2); font-size: 14.5px; line-height: 1.65; }
.policy-body p { margin: 0 0 10px; }
.policy-body ul { margin: 0 0 10px; padding-left: 20px; }
.policy-body li { margin-bottom: 4px; }
.policy-body b { color: var(--ink); font-weight: 600; }
.policy-body a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.policy-body code { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,.07); padding: 1px 5px; border-radius: 5px; }

/* small "Privacy" link on the landing and results pages */
.legal-link { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; color: var(--ink-3); text-decoration: underline; text-underline-offset: 2px; }
.legal-link:hover { color: var(--ink-2); }
.land-legal { position: fixed; left: 0; right: 0; bottom: calc(8px + env(safe-area-inset-bottom)); text-align: center; z-index: 5; }

/* ============ Analytics consent pop-up ============ */
.consent {
  position: fixed; z-index: 80;
  left: 50%; bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(520px, calc(100% - 24px));
  transform: translate(-50%, 20px); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: 16px;
  background: rgba(20, 25, 22, .97);
  border: 1px solid var(--line-2);
  box-shadow: 0 20px 60px rgba(0,0,0,.55);
}
.consent.show { transform: translate(-50%, 0); opacity: 1; }
.consent-text { flex: 1; font-size: 13px; line-height: 1.45; color: var(--ink-2); }
.consent-text b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.consent-text a { color: var(--gold); text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; gap: 8px; flex: none; }
.consent-actions .btn { min-width: 84px; }
@media (max-width: 520px) {
  .consent { flex-direction: column; align-items: stretch; gap: 10px; }
  .consent-actions .btn { flex: 1; }
}
.policy-body .btn-consent { margin: 4px 0 12px; }
