:root {
  --ground: #F3F5F7;
  --ink: #1F2D3D;
  --ink-soft: rgba(31, 45, 61, 0.70);
  --accent: #A9512F;
  --on-accent: #FFFFFF;
  --t1: #E4EBF2;
  --t2: #D6E1EC;
  --t3: #C8D7E6;
  --t4: #B9CCDF;
  --t5: #AFC4DA;
  --b1: #8FA6BE;
  --b2: #7D96B2;
  --b3: #6A86A5;
  --b4: #57759A;
  --slip-bg: #FBD9D6;
  --slip: #B3261E;
  --surface: #FFFFFF;
  --dot: rgba(31, 45, 61, 0.35);
  --ring: #FFFFFF;
  --card-bg: #1F2D3D;
  --card-fg: #F3F5F7;
  --card-ink: #1F2D3D;
  --hint: #E9A23B;
  --run: 48px;
  --letter: 40px;
  --letter-size: 38px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: light;
}

/* Dark theme: the same staircase at night. Set by Settings > Theme (auto follows the phone). */
:root[data-fs-theme="dark"] {
  --ground: #121A23; --ink: #E3EAF2; --ink-soft: rgba(227, 234, 242, 0.64); --accent: #D9774F; --on-accent: #121A23;
  --t1: #1C2836; --t2: #213042; --t3: #27384D; --t4: #2D4159; --t5: #344A64;
  --b1: #3B5270; --b2: #44608A; --b3: #4F6E9A; --b4: #5B7CAA;
  --slip-bg: #4A2228; --slip: #FF8F86; --surface: #24303D; --dot: rgba(227, 234, 242, 0.32);
  --ring: #121A23; --card-bg: #E3EAF2; --card-fg: #121A23; --card-ink: #1F2D3D; --hint: #F0B355;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-fs-theme="auto"] {
    --ground: #121A23; --ink: #E3EAF2; --ink-soft: rgba(227, 234, 242, 0.64); --accent: #D9774F; --on-accent: #121A23;
    --t1: #1C2836; --t2: #213042; --t3: #27384D; --t4: #2D4159; --t5: #344A64;
    --b1: #3B5270; --b2: #44608A; --b3: #4F6E9A; --b4: #5B7CAA;
    --slip-bg: #4A2228; --slip: #FF8F86; --surface: #24303D; --dot: rgba(227, 234, 242, 0.32);
    --ring: #121A23; --card-bg: #E3EAF2; --card-fg: #121A23; --card-ink: #1F2D3D; --hint: #F0B355;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Text only screen readers hear. */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

html, body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: 'Geist', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }

/* Header */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 24px;
}
.mark {
  font-weight: 800; font-size: 22px; letter-spacing: -0.02em;
  color: var(--ink); text-decoration: none; white-space: nowrap;
}
.pills { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.pill { padding: 6px 12px; border-radius: 999px; white-space: nowrap; }
.pill-step { background: var(--t3); transition: background-color .3s; }
.pill-slip { background: var(--slip-bg); color: var(--slip); font-weight: 500; }
.pill-slip.bump { animation: bump .45s var(--ease); }
.help-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink);
  background: transparent; font-weight: 700; font-size: 16px; padding: 0;
}

.account-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 0; padding: 0;
  background: var(--t3); font-weight: 800; font-size: 15px;
  display: grid; place-items: center;
}
.account-btn:empty::before {
  content: ""; width: 16px; height: 16px; background: var(--ink);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3 22c0-5 4-8 9-8s9 3 9 8z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='8' r='4.5'/%3E%3Cpath d='M3 22c0-5 4-8 9-8s9 3 9 8z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.account-btn.signed-in { background: var(--accent); color: var(--on-accent); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); padding: 0;
  background: transparent; display: grid; place-items: center;
}

/* Header pills follow the screen */
body:not([data-view="play"]):not([data-view="results"]) .pill { display: none; }
body[data-view="results"] #timer-pill { display: none; }
.pill-timer {
  background: var(--ink); color: var(--ground); font-weight: 700;
  font-variant-numeric: tabular-nums; min-width: 58px; text-align: center;
  transition: background-color .3s;
}
.pill-timer.low { background: var(--accent); animation: tick 1s ease-in-out infinite; }

/* Home */
.home {
  flex-grow: 1; width: 100%; max-width: 520px; margin: 0 auto;
  padding: 24px 24px 48px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
}
.home > * { animation: fade-up .55s var(--ease) both; }
.home > *:nth-child(2) { animation-delay: .06s; }
.home > *:nth-child(3) { animation-delay: .12s; }
.home > *:nth-child(4) { animation-delay: .18s; }
.home > *:nth-child(n+5) { animation-delay: .24s; }
.home-stairs { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.home-stairs span {
  display: block; width: 92px; height: 16px; border-radius: 3px 3px 0 0;
  margin-left: calc(var(--n) * 26px);
  animation: step-in .5s var(--ease) both; animation-delay: calc(var(--n) * .07s);
}
.home-stairs span:nth-child(1) { --n: 0; background: var(--surface); border-bottom: 4px solid var(--ink); }
.home-stairs span:nth-child(2) { --n: 1; background: var(--t1); border-bottom: 4px solid var(--b1); }
.home-stairs span:nth-child(3) { --n: 2; background: var(--t2); border-bottom: 4px solid var(--b2); }
.home-stairs span:nth-child(4) { --n: 3; background: var(--accent); border-bottom: 4px solid #8E4227; }
.home-stairs span:nth-child(5) { --n: 4; background: var(--t4); border-bottom: 4px solid var(--b4); }
.home-stairs span:nth-child(6) { --n: 5; background: var(--t5); border-bottom: 8px solid var(--ink); }
.home-title { margin: 0; font-weight: 800; font-size: 64px; line-height: .95; letter-spacing: -0.04em; }
.home-tag { margin: 0; font-size: 18px; line-height: 1.45; max-width: 34ch; }
.home-today { width: 100%; display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.home-date { margin: 0; font-size: 15px; font-weight: 700; }
.btn-big { width: 100%; height: 56px; font-size: 18px; }
.home-note { margin: 0; font-size: 14px; color: var(--ink-soft); }
.home-stats { margin: 0; font-size: 15px; }
.home .link-btn { align-self: flex-start; padding-left: 0; }

/* Play */
.play {
  flex-grow: 1; width: 100%; max-width: 720px; margin: 0 auto;
  padding: 24px 24px 40px;
  display: flex; flex-direction: column; gap: 32px;
}

.stairs {
  list-style: none; margin: 0; padding: 0 0 0 40px;
  display: flex; flex-direction: column; gap: 10px;
}

.step {
  display: flex; align-items: flex-end; gap: 14px;
  margin-left: calc(var(--i) * var(--run));
  min-height: 62px;
}
.step.enter { animation: step-in .42s var(--ease) both; }

.word {
  display: flex; gap: 2px;
  padding: 8px 12px 6px;
  border-radius: 10px 10px 0 0;
  border-bottom: 7px solid var(--ink);
  background: var(--bg, var(--surface));
  border-bottom-color: var(--bar, var(--ink));
  transition: background-color .3s, border-color .3s, transform .35s var(--ease), opacity .3s;
  transform-origin: left bottom;
}

.l {
  width: var(--letter); text-align: center;
  font-weight: 800; font-size: var(--letter-size); line-height: 1.1;
  border-radius: 8px; border: 0; padding: 0; background: transparent;
  color: var(--ink);
  transition: background-color .2s, color .2s, box-shadow .2s, transform .2s var(--ease);
}
.l.chip { background: var(--accent); color: #fff; }
.l.chip.pop { animation: pop .38s var(--ease); }
.l.dot { color: var(--dot); }
.step.active .l.hinted:not(.chip) { background: var(--hint); color: #1F2D3D; }
.k.hinted { box-shadow: 0 0 0 3px var(--hint); }

/* The step you are on */
.step.active .word { box-shadow: 0 0 0 0 transparent; }
.step.active .l { cursor: pointer; }
.step.active .l:hover { background: color-mix(in srgb, var(--surface) 55%, transparent); }
.step.active .l.chip:hover { background: var(--accent); }
.step.active .l.sel { box-shadow: 0 0 0 3px var(--ring), 0 0 0 5px var(--ink); }
.step.active .l.chip.sel { box-shadow: 0 0 0 3px var(--ring); }
.step.active.nudge .word { animation: nudge .4s var(--ease); }

.step.future .word { opacity: .7; }

.step.goal .word { padding-bottom: 10px; border-bottom-width: 14px; }
.step.goal.landed .word { animation: land .7s var(--ease); }

/* A slip */
.step.slipped .word {
  background: var(--slip-bg);
  border-bottom: 7px dashed var(--slip);
  transform: rotate(-2deg);
  animation: slip .5s var(--ease);
}
.step.slipped .l { color: var(--slip); }
.step.slipped .l.chip { background: transparent; color: var(--slip); text-decoration: line-through; }
.step.slipped .l.sel { box-shadow: 0 0 0 3px var(--ring), 0 0 0 5px var(--slip); }

.n { font-size: 14px; padding-bottom: 4px; color: var(--ink); white-space: nowrap; }
.step.active .n { font-weight: 700; }
.step.slipped .n { color: var(--slip); font-weight: 700; }

/* Controls */
.controls { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.status {
  margin: 0; min-height: 22px; font-size: 16px; text-align: center;
  color: var(--ink); transition: opacity .25s;
}
.status.slip { color: var(--slip); font-weight: 700; }
.status.flash { animation: fade-up .3s var(--ease); }

.keys {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 680px;
}
.k {
  width: 44px; height: 44px; border-radius: 50%; border: 0; padding: 0;
  background: var(--bg); color: var(--ink);
  font-weight: 800; font-size: 18px;
  transition: transform .15s var(--ease), background-color .2s, opacity .2s;
}
.k:hover { filter: brightness(0.96); }
.k:active { transform: scale(0.9); }
.k.same { opacity: .4; }

.actions { display: flex; gap: 12px; margin-top: 4px; }
.btn {
  height: 48px; padding: 0 24px; border-radius: 999px;
  font-weight: 700; font-size: 16px;
  transition: transform .15s var(--ease), opacity .2s, background-color .2s;
}
.btn:active:not(:disabled) { transform: scale(0.96); }
.btn:disabled { opacity: .35; }
.btn-solid { border: 0; background: var(--ink); color: var(--ground); padding: 0 30px; }
.btn-ghost { border: 2px solid var(--ink); background: transparent; color: var(--ink); }
.hint { margin: 0; font-size: 14px; color: var(--ink-soft); text-align: center; }

/* Results */
.results {
  flex-grow: 1; width: 100%; max-width: 980px; margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 56px;
}
.results > * { animation: fade-up .6s var(--ease) both; }
.results > *:nth-child(2) { animation-delay: .15s; }
.results-text { flex: 1 1 340px; max-width: 420px; display: flex; flex-direction: column; gap: 22px; }
.results-title { margin: 0; font-weight: 800; font-size: 56px; line-height: .95; letter-spacing: -0.03em; }
.path { display: flex; flex-wrap: wrap; gap: 6px; font-weight: 800; font-size: 18px; letter-spacing: .04em; }
.path span { padding: 6px 10px; border-radius: 8px; }
.summary { margin: 0; font-size: 17px; line-height: 1.45; }
.actions-left { justify-content: flex-start; flex-wrap: wrap; }
.btn-next { align-self: flex-start; border: 0; background: var(--t3); color: var(--ink); padding: 0 26px; }
.points { margin: 0; font-size: 20px; font-weight: 700; }
.points span { font-size: 44px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); font-variant-numeric: tabular-nums; }
.link-btn.link-left { align-self: flex-start; padding-left: 0; }
.next { margin: 0; font-size: 15px; color: var(--ink-soft); }

.card {
  margin: 0; flex: 0 0 320px; max-width: 100%;
  background: var(--ink); color: var(--ground);
  border-radius: 6px; padding: 26px;
  display: flex; flex-direction: column; gap: 18px;
}
.card-head { display: flex; justify-content: space-between; align-items: baseline; }
.card-mark { font-weight: 800; font-size: 20px; }
.card-no { font-size: 14px; }
.card-pair { font-weight: 800; font-size: 26px; letter-spacing: .06em; }
.card-stairs { display: flex; flex-direction: column; gap: 6px; }
.sb {
  height: 34px; width: 96px; border-radius: 2px;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 800; font-size: 18px; color: var(--ink);
  margin-left: calc(var(--i) * 40px);
  animation: step-in .45s var(--ease) both;
  animation-delay: calc(.25s + var(--i) * .08s);
}
.sb.last { width: 108px; height: 42px; }
.sb.slip { box-shadow: inset 0 0 0 3px #F28B82; }
.sb small { font-size: 13px; color: var(--slip); font-weight: 700; }
.card-cap { font-size: 14px; line-height: 1.45; }

/* Help */
.help {
  border: 0; border-radius: 12px; padding: 0; max-width: 440px; width: calc(100% - 32px);
  background: var(--ground); color: var(--ink);
}
.help::backdrop { background: rgba(12, 18, 26, .45); }
.help[open] { animation: fade-up .35s var(--ease); }
.help-inner { padding: 28px; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.5; }
.help h2 { margin: 0; font-weight: 800; font-size: 30px; letter-spacing: -0.02em; }
.help p, .help ol { margin: 0; }
.help ol { padding-left: 20px; }
.help .btn { align-self: flex-start; margin-top: 6px; }
.help-small { font-size: 14px; color: var(--ink-soft); }
.slip-word { background: var(--slip-bg); color: var(--slip); font-weight: 700; padding: 1px 6px; border-radius: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--ink); color: var(--ground); padding: 10px 18px; border-radius: 999px;
  font-size: 15px; font-weight: 500; animation: fade-up .3s var(--ease);
}

/* More buttons */
.btn-soft { border: 0; background: var(--t3); color: var(--ink); }
.btn-small { height: 40px; padding: 0 16px; font-size: 15px; }
.rare { margin: -10px 0 0; font-size: 15px; font-weight: 600; color: var(--accent); }

/* Five-letter stairs are a little smaller so they fit */
.stairs.five { --letter: 34px; --letter-size: 32px; --run: 40px; }

/* Home links */
.home-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.home .home-nav .link-btn { padding: 6px 0; }

/* Pages: archive, stats, leaderboard, friends */
.page {
  flex-grow: 1; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 24px 24px 48px; display: flex; flex-direction: column; gap: 18px;
  animation: fade-up .45s var(--ease) both;
}
.page-title { margin: 0; font-weight: 800; font-size: 44px; letter-spacing: -0.03em; line-height: 1; }
.page-sub { margin: 8px 0 10px; font-size: 18px; font-weight: 800; }
.page-lede { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-soft); }

.seg { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--t2); align-self: flex-start; }
.seg-btn {
  border: 0; background: transparent; padding: 8px 16px; border-radius: 999px;
  font-size: 15px; font-weight: 600; color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.seg-btn[aria-selected="true"], .seg-btn:has(input:checked) { background: var(--ink); color: var(--ground); }
.seg-btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg-btn:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.archive-list, .board-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.arch-row {
  width: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 4px 14px;
  text-align: left; border: 0; border-radius: 10px 10px 0 0; padding: 12px 16px;
  background: var(--t1); border-bottom: 5px solid var(--b1); font-size: 16px;
  transition: transform .15s var(--ease);
}
.arch-row:active { transform: scale(.98); }
.arch-no { font-weight: 800; }
.arch-date { color: var(--ink-soft); }
.arch-status { font-weight: 700; font-size: 15px; }
.arch-status.won { color: var(--accent); }
.arch-status.lost { color: var(--slip); }
.arch-pair { grid-column: 1 / -1; font-weight: 700; letter-spacing: .05em; font-size: 14px; color: var(--ink-soft); }
.empty { color: var(--ink-soft); font-size: 15px; padding: 8px 0; }

.stat-rows { margin: 0; display: flex; flex-direction: column; }
.stat-row { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--t3); }
.stat-row dt { color: var(--ink-soft); }
.stat-row dd { margin: 0; font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 180px; align-items: end; }
.bar-col { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.bar { width: 100%; max-width: 40px; border-radius: 4px 4px 0 0; background: var(--t4); border-bottom: 4px solid var(--accent); transform-origin: bottom; animation: grow .6s var(--ease) both; }
.bar.none { background: var(--t1); border-bottom-color: var(--t3); }
.bar-val { font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bar-day { font-size: 12px; color: var(--ink-soft); }

.board-list li {
  display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 14px; border-radius: 10px; background: var(--t1); font-size: 16px;
}
.board-list li.me { background: var(--t3); font-weight: 700; }
.board-list .rank { font-weight: 800; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board-list .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board-list .score { font-weight: 800; font-variant-numeric: tabular-nums; }
.board-mini { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.board-mini h2 { margin: 0; font-size: 18px; font-weight: 800; }

.friend-code { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 10px; background: var(--t2); }
.friend-code strong { font-size: 24px; letter-spacing: .12em; flex-grow: 1; }
.friend-add { display: flex; flex-direction: column; gap: 6px; }
.friend-add label { font-weight: 700; font-size: 15px; }
.friend-row { display: flex; gap: 8px; }
.friend-row input {
  flex: 1 1 auto; min-width: 0; height: 44px; padding: 0 14px; border-radius: 10px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 18px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}

/* Profile */
.profile-head { display: flex; align-items: center; gap: 16px; }
.avatar {
  flex: 0 0 64px; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; background: var(--t3); color: var(--ink);
  font-weight: 800; font-size: 28px;
}
.avatar.signed-in { background: var(--accent); color: var(--on-accent); }
.profile-id { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.profile-id .page-title { font-size: 34px; overflow-wrap: anywhere; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.profile-section { display: flex; flex-direction: column; gap: 12px; padding-top: 18px; border-top: 2px solid var(--t2); }
.profile-section .page-sub { margin: 0; font-size: 22px; }
.mini-h { margin: 8px 0 0; font-size: 15px; font-weight: 700; color: var(--ink-soft); }

/* Settings */
.setting { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.setting legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-weight: 700; padding: 6px 0; }
.toggle input { order: 2; width: 22px; height: 22px; accent-color: var(--accent); }
.share-img { width: 100%; border-radius: 8px; }

/* Sign in */
.signin .help-inner { gap: 14px; }
.mini-stairs { display: flex; flex-direction: column; gap: 4px; margin-bottom: 4px; }
.mini-stairs span { display: block; width: 56px; height: 10px; border-radius: 2px; }
.mini-stairs span:nth-child(1) { background: var(--t1); margin-left: 0; }
.mini-stairs span:nth-child(2) { background: var(--t2); margin-left: 16px; }
.mini-stairs span:nth-child(3) { background: var(--accent); margin-left: 32px; }
.mini-stairs span:nth-child(4) { background: var(--t4); margin-left: 48px; }
.mini-stairs span:nth-child(5) { background: var(--ink); margin-left: 64px; }
.signin-buttons { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.provider {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; height: 50px; border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
}
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 14px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: currentColor; opacity: .4; }
.email-signin { display: flex; flex-direction: column; gap: 8px; }
.email-signin label { font-weight: 700; font-size: 15px; }
.email-step { display: flex; flex-direction: column; gap: 8px; }
#code-sent-to { display: block; font-weight: 500; word-break: break-all; }
.text-input.code-input { font-size: 26px; font-weight: 700; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.text-input.code-input::placeholder { letter-spacing: .3em; opacity: .45; }
.code-links { margin: 0; }
.text-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 10px;
  border: 2px solid var(--ink); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 17px;
}
.text-input::placeholder { color: var(--ink-soft); }
#rename-input { height: 44px; text-transform: none; letter-spacing: normal; font-weight: 500; }
#email-btn, #code-btn { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.signin-note { font-size: 14px; color: var(--ink-soft); margin: 0; }
.link-btn {
  align-self: center; border: 0; background: none; padding: 8px;
  font-size: 15px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px;
}
.help .actions .btn { margin-top: 0; }

/* Motion */
@keyframes step-in { from { opacity: 0; transform: translate(-14px, -6px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes bump { 0%, 100% { transform: scale(1); } 40% { transform: scale(1.15); } }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: translateY(-4px); } 60% { transform: translateY(1px); } }
@keyframes slip {
  0% { transform: none; }
  25% { transform: translateX(-6px) rotate(1deg); }
  50% { transform: translateX(5px) rotate(-3deg); }
  75% { transform: translateX(-2px) rotate(-1.5deg); }
  100% { transform: rotate(-2deg); }
}
@keyframes land { 0% { transform: none; } 30% { transform: translateY(-8px); } 60% { transform: translateY(2px); } 100% { transform: none; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: none; } }
@keyframes tick { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .step.slipped .word { transform: rotate(-2deg); }
}

/* Phones */
@media (max-width: 560px) {
  :root { --run: 26px; --letter: 34px; --letter-size: 32px; }
  .top { padding: 12px 16px; }
  .mark { font-size: 20px; }
  .pills { gap: 6px; font-size: 14px; }
  .pill { padding: 5px 10px; }
  #puzzle-no { display: none; }
  #step-pill { display: none; }
  .home { padding: 12px 16px 32px; }
  .home-title { font-size: 52px; }
  .play { padding: 8px 16px 28px; gap: 24px; }
  .stairs { padding-left: 0; gap: 8px; }
  .step { gap: 8px; min-height: 52px; }
  .word { padding: 6px 8px 4px; border-radius: 8px 8px 0 0; border-bottom-width: 6px; }
  .step.goal .word { padding-bottom: 8px; border-bottom-width: 12px; }
  .step.slipped .word { border-bottom-width: 6px; }
  .n { font-size: 13px; padding-bottom: 2px; }
  .keys { gap: 7px; }
  .k { width: 42px; height: 42px; font-size: 17px; }
  .actions { width: 100%; }
  .actions .btn-ghost { flex: 1 1 0; }
  .actions .btn-solid { flex: 1.4 1 0; }
  .actions-left .btn { flex: 1 1 0; }
  .btn-next { align-self: stretch; }
  .results { padding: 16px 16px 32px; gap: 32px; }
  .results-title { font-size: 44px; }
  .card { flex-basis: 100%; }
  .stairs.five { --letter: 28px; --letter-size: 26px; --run: 18px; }
  .page { padding: 12px 16px 32px; }
  .page-title { font-size: 36px; }
  .actions .btn { padding: 0 14px; white-space: nowrap; }
}
@media (max-width: 360px) {
  :root { --run: 20px; --letter: 30px; --letter-size: 28px; }
  .k { width: 38px; height: 38px; }
}

/* Privacy, account, blocking */
.account-rows { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.link-btn.inline { padding: 0 0 0 4px; font-size: inherit; }
.danger { color: #B3261E; border-color: #B3261E; }
.danger-solid { background: #B3261E; border-color: #B3261E; color: #fff; }
.fine { text-align: center; margin: 0; }
.help a, .profile-section a { color: inherit; text-underline-offset: 3px; }
.who-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; text-decoration: underline dotted; text-underline-offset: 3px; cursor: pointer; }
