/* =====================================================================
   sunoku.app — site.css

   Phone first: everything below is the 375px layout, and the media
   queries at the end of each section widen it. The colours are the
   game's own tokens (css/styles.css in the game), so the board, the hint
   bar and the buttons in board.css look exactly as they do in the app.
   One theme: the game's dark one, which is what the screenshots show.
   ===================================================================== */

@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --bg: #0e1219;
  --bg-2: #151b26;
  --surface: #1a2231;
  --surface-2: #212b3d;
  --line: #2c3850;
  --text: #eef2f9;
  --text-dim: #97a3b8;
  --text-faint: #6b7789;
  --accent: #ffcb33;
  --accent-ink: #2a1f00;
  --sun: #ff7a15;
  --danger: #ff5a4d;
  --good: #38d39f;
  --ink-out: #ffffff;
  --ink-wrong: #ff4d43;
  --tile-radius: 24%;
  --shadow: 0 10px 34px rgba(0, 0, 0, 0.45);
  --display: 'Fredoka', ui-rounded, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --gutter: 16px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* The hint's glow bleeds well past a square (board.css), which must never
   widen the page: the cards that hold boards clip it, and so does the page. */
html {
  overflow-x: clip;
  background: var(--bg);
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background:
    radial-gradient(90% 520px at 50% -120px, rgba(255, 170, 60, 0.16), transparent 70%),
    radial-gradient(120% 80% at 50% 0%, var(--bg-2), var(--bg) 70%) no-repeat,
    var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

img,
svg {
  display: block;
}

a {
  color: var(--accent);
}

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0;
}

.wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
}

.skip:focus {
  top: 12px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.nojs {
  padding: 24px;
  color: var(--text-dim);
  text-align: center;
}

.note {
  font-size: 13.5px;
  color: var(--text-faint);
}

/* --------------------------------------------------------------- the bar */

.bar {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s;
}

.bar.scrolled {
  border-bottom-color: var(--line);
}

.bar-in {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 1140px;
  height: 56px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.bar-brand {
  display: inline-flex;
  text-decoration: none;
}

.mini-word {
  display: inline-flex;
  gap: 3px;
}

.mini-word i {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 6px;
  background: var(--c);
  color: #fff;
  font: 700 13.5px/1 -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-style: normal;
}

.mini-word i.ink {
  color: #161c26;
}

.mini-word i.sun svg {
  width: 18px;
  height: 18px;
}

.bar-nav {
  display: none;
  gap: 4px;
  margin-left: auto;
}

.bar-nav a {
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14.5px;
  font-weight: 550;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.bar-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.bar .cta-small {
  margin-left: auto;
}

@media (min-width: 900px) {
  .bar-nav {
    display: flex;
  }
  .bar .cta-small {
    margin-left: 4px;
  }
}

/* -------------------------------------------------------------- buttons */

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 22px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  touch-action: manipulation;
  box-shadow: 0 8px 24px rgba(255, 190, 50, 0.22);
  transition: transform 0.12s, box-shadow 0.2s, filter 0.2s;
}

.cta:hover {
  filter: brightness(1.05);
  box-shadow: 0 10px 30px rgba(255, 190, 50, 0.32);
}

.cta:active {
  transform: scale(0.97);
}

.cta-small {
  min-height: 38px;
  padding: 7px 15px;
  border-radius: 12px;
  font-size: 15.5px;
  box-shadow: none;
}

.cta-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}

.cta-ghost:hover {
  background: var(--surface);
  box-shadow: none;
}

/* "Coming soon to the App Store": a quiet two-line pill, not a button that
   pretends to download anything. */
.cta-soon {
  flex-direction: column;
  gap: 0;
  padding: 8px 20px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 650;
  line-height: 1.25;
  box-shadow: none;
}

.cta-soon:hover {
  background: var(--surface-2);
  box-shadow: none;
  filter: none;
}

.cta-soon .soon-k {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.cta-soon.is-static {
  cursor: default;
}

.cta-soon.is-static:active {
  transform: none;
}

/* ----------------------------------------------------------------- hero */

.hero {
  padding: 22px 0 40px;
}

.hero-in {
  display: grid;
  gap: 36px;
}

.word {
  width: min(100%, 360px);
  height: auto;
  margin: 0 0 2px -10px;
  overflow: visible;
}

.word .lt {
  animation: drop 0.62s cubic-bezier(0.2, 1.3, 0.4, 1) both;
  animation-delay: calc(var(--i) * 70ms + 80ms);
}

.word .sun-spin {
  transform-origin: 240px 40px;
  transform-box: view-box;
  animation: spin 46s linear infinite;
}

@keyframes drop {
  from {
    opacity: 0;
    transform: translateY(-34px);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.tagline {
  margin: 2px 0 18px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.01em;
}

.hero h1 {
  font-size: clamp(30px, 8.2vw, 54px);
  line-height: 1.08;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.lead {
  margin-top: 16px;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  text-wrap: pretty;
}

.lead.narrow {
  max-width: 40rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.hero-ctas.center {
  justify-content: center;
}

.hero-ctas .cta {
  flex: 1 1 200px;
}

.facts {
  display: flex;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.facts li {
  flex: 1;
  padding: 12px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  text-align: center;
}

.facts b {
  display: block;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}

.facts span {
  font-size: 12.5px;
  color: var(--text-dim);
}

/* ---- phones: a plain frame around a real screenshot */

.phone {
  --w: 260px;
  position: relative;
  width: var(--w);
  aspect-ratio: 780 / 1688;
  margin: 0;
  padding: calc(var(--w) * 0.032);
  border-radius: calc(var(--w) * 0.15);
  background: linear-gradient(160deg, #2a3242, #0b0e14 40%, #05070b);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 30px 70px rgba(0, 0, 0, 0.55),
    0 10px 24px rgba(0, 0, 0, 0.35);
}

.phone img {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--w) * 0.12);
  object-fit: cover;
  background: var(--bg);
}

.hero-art {
  position: relative;
  display: grid;
  place-items: center;
  padding: 8px 0 0;
}

.phone-hero {
  --w: min(270px, 72vw);
  z-index: 2;
}

.phone-behind {
  display: none;
}

@media (min-width: 960px) {
  .hero {
    padding: 56px 0 72px;
  }
  .hero-in {
    grid-template-columns: 1.05fr 0.95fr;
    align-items: center;
    gap: 48px;
  }
  .word {
    width: 400px;
  }
  .lead {
    font-size: 18px;
  }
  .hero-ctas .cta {
    flex: 0 0 auto;
  }
  .facts {
    max-width: 30rem;
  }
  .hero-art {
    min-height: 600px;
  }
  .phone-hero {
    --w: 290px;
    transform: translateX(-46px) rotate(-3deg);
  }
  .phone-behind {
    display: block;
    position: absolute;
    --w: 262px;
    z-index: 1;
    transform: translate(150px, 34px) rotate(5deg);
    opacity: 0.92;
  }
}

/* ------------------------------------------------------------- sections */

.sec {
  padding: 64px 0;
}

.eyebrow {
  margin-bottom: 10px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.sec h2 {
  font-size: clamp(27px, 6.6vw, 44px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  max-width: 22ch;
}

.h3 {
  font-size: 22px;
  line-height: 1.25;
  margin-bottom: 10px;
}

.card {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

@media (min-width: 960px) {
  .sec {
    padding: 104px 0;
  }
}

/* ------------------------------------------------------------ the rules */

.rules {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.rule {
  overflow: clip;
  display: grid;
  grid-template-columns: 104px 1fr;
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.rule .mini {
  grid-row: span 2;
}

.rule h3 {
  font-size: 18px;
  margin: 2px 0 4px;
}

.rule p {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-dim);
}

/* The little boards that draw each rule: real board markup, no input. */
.mini .board {
  border-radius: 12px;
  padding: 3px;
  box-shadow: none;
  pointer-events: none;
}

.rule-stack {
  grid-template-columns: 1fr;
}

.rule-stack .mini {
  grid-row: auto;
  width: min(100%, 15rem);
  margin-bottom: 12px;
}

.mini .cell.dim .tile {
  filter: saturate(0.25) opacity(0.45);
}

.mini .cell.lit .tile {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 70%, transparent);
}

.mark-legend {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}

.mark-legend .board {
  --n: 1;
  width: 100%;
  border-radius: 10px;
  padding: 2px;
}

.mark-legend small {
  display: block;
  margin-top: 4px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--text-faint);
}

@media (min-width: 600px) {
  .rules {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1040px) {
  .rules {
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }
  .rule {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    padding: 18px;
  }
  .rule .mini {
    grid-row: auto;
    display: flex;
    align-items: center;
    width: 150px;
    height: 150px;
    margin-bottom: 14px;
  }
  .rule .mini > * {
    width: 100%;
  }
  .rule h3 {
    font-size: 19px;
  }
}

/* ----------------------------------------------------------- the lesson */

.lesson-row {
  display: grid;
  gap: 22px;
  margin-top: 44px;
}

.lesson-copy p {
  color: var(--text-dim);
}

.lesson-copy .note {
  margin-top: 12px;
}

.lesson {
  overflow: clip;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 26rem;
  padding: 16px 16px 16px;
}

.lesson-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-head h3 {
  font-size: 18px;
}

.lesson-board-wrap {
  display: grid;
  place-items: center;
}

.lesson-board {
  width: min(64vw, 15rem);
}

.lesson-text {
  min-height: 6.4em;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text-dim);
}

.lesson-text b {
  color: var(--text);
  font-weight: 650;
}

.lesson-text i {
  color: var(--accent);
  font-style: normal;
  font-weight: 650;
}

.lesson-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lesson-actions .btn-primary {
  margin-left: auto;
  min-width: 7.5rem;
}

@media (min-width: 860px) {
  .lesson-row {
    grid-template-columns: 1fr 26rem;
    align-items: center;
    gap: 56px;
  }
}

/* ---------------------------------------------------------- free play */

.sec-play {
  background: linear-gradient(to bottom, transparent, color-mix(in srgb, var(--bg-2) 80%, transparent) 18%, color-mix(in srgb, var(--bg-2) 80%, transparent) 82%, transparent);
}

.play-in {
  display: grid;
  grid-template-areas: 'head' 'stage' 'notes';
  gap: 24px;
}

.play-head {
  grid-area: head;
}

.play-stage {
  grid-area: stage;
  display: grid;
  justify-items: center;
}

.play-notes {
  grid-area: notes;
}

.controls {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.controls li {
  display: grid;
  grid-template-columns: 8.2rem 1fr;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 60%, transparent);
  font-size: 14.5px;
}

.controls b {
  color: var(--text);
}

.controls span {
  color: var(--text-dim);
}

/* The game screen, in a card: the app's header, board, hint and toolbar. */
.play-panel {
  overflow: clip;
  position: relative;
  width: 100%;
  max-width: 430px;
  padding: 14px 12px 12px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: radial-gradient(120% 70% at 50% 0%, var(--bg-2), var(--bg) 75%);
  box-shadow: var(--shadow), 0 0 0 6px color-mix(in srgb, var(--surface) 55%, transparent);
  -webkit-user-select: none;
  user-select: none;
}

.pp-head {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.pp-crest svg {
  width: 28px;
  height: 28px;
}

.pp-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.pp-chips {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.pp-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  padding: 6px 0 5px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.15;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s, transform 0.1s;
}

.pp-chip b {
  font-size: 15px;
}

.pp-chip small {
  font-size: 10.5px;
  color: var(--text-faint);
}

.pp-chip:active {
  transform: scale(0.95);
}

.pp-chip.on {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
}

.pp-chip.done::after {
  content: '';
  position: absolute;
  top: -5px;
  right: -5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--good) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5' fill='none' stroke='%230e1219' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: 0 0 0 2px var(--bg);
}

.pp-chip.locked {
  border-style: dashed;
  background: transparent;
  opacity: 0.55;
  cursor: default;
}

.play-panel .statusbar {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 10px 0 10px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}

.stat b {
  color: var(--text);
  font-weight: 650;
}

.stat-dim {
  color: var(--text-faint);
}

.stat-bad b {
  color: var(--ink-wrong);
}

.board-wrap {
  position: relative;
}

.pp-msg {
  min-height: 92px;
  margin: 10px 0 10px;
}

.pp-help {
  padding: 10px 6px 0;
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
  color: var(--text-faint);
}

.pp-help b {
  color: var(--text-dim);
  font-weight: 600;
}

.pp-autox {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-faint);
  cursor: pointer;
}

.pp-autox b {
  color: var(--text-dim);
}

.pp-autox input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

@media (min-width: 900px) {
  .play-in {
    grid-template-columns: 1fr 430px;
    grid-template-areas: 'head stage' 'notes stage';
    grid-template-rows: auto 1fr;
    column-gap: 64px;
    row-gap: 26px;
    align-items: start;
  }
  .play-stage {
    position: sticky;
    top: 76px;
  }
}

/* ---------------------------------------------------------- the river */

.river-wrap {
  margin: 34px 0 6px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 9%, #000 91%, transparent);
}

.river {
  display: block;
  width: 100%;
  height: 188px;
}

@media (min-width: 960px) {
  .river {
    height: 252px;
  }
}

/* ---------------------------------------------------------- the worlds */

.worlds {
  display: grid;
  gap: 14px;
  margin-top: 30px;
}

.world {
  display: grid;
  grid-template-columns: 112px 1fr;
  grid-template-areas: 'reel title' 'reel sets' 'reel label' 'text text';
  grid-template-rows: auto auto 1fr auto;
  column-gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.reel {
  grid-area: reel;
  aspect-ratio: 1;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
}

.reel canvas {
  width: 100%;
  height: 100%;
}

.reel-label {
  grid-area: label;
  align-self: end;
  font-size: 11.5px;
  line-height: 1.35;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.reel-label b {
  color: var(--text-dim);
  font-weight: 650;
}

/* the card's words sit in the card's own grid: name and sets beside the
   reel, the description across the whole card underneath */
.world-text {
  display: contents;
}

.world h3 {
  grid-area: title;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 21px;
}

.crest {
  width: 24px;
  height: 24px;
  flex: none;
}

.crest-line {
  color: var(--crest);
}

.world .sets {
  grid-area: sets;
  margin: 2px 0 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--crest);
}

.world-text > p:last-child {
  grid-area: text;
  margin-top: 14px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-dim);
}

@media (min-width: 760px) {
  .worlds {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .world {
    grid-template-columns: 136px 1fr;
    padding: 18px;
  }
}

.daily {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-top: 16px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line));
  border-radius: 22px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), color-mix(in srgb, var(--surface) 62%, transparent));
}

.daily-ico {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--accent);
}

.daily h3 {
  font-size: 19px;
  margin-bottom: 4px;
}

.daily p {
  font-size: 14.5px;
  color: var(--text-dim);
}

/* ----------------------------------------------------------- difficulty */

.pillars {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.pillar {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.pillar h3 {
  font-size: 19px;
  margin-bottom: 6px;
}

.pillar p {
  font-size: 15px;
  color: var(--text-dim);
}

@media (min-width: 900px) {
  .pillars {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
}

.ladder-row {
  display: grid;
  gap: 18px;
  margin-top: 48px;
}

.ladder-copy p {
  color: var(--text-dim);
}

.ladder {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rung;
}

.ladder li {
  --rung: #93c83d;
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 12px;
  align-items: center;
  padding: 9px 12px 9px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  counter-increment: rung;
}

.ladder li::before {
  content: counter(rung);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--rung);
  color: #10141c;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 600;
}

/* the rungs warm from lime to red as the ideas get harder */
.ladder li:nth-child(2) { --rung: #a9cb3b; }
.ladder li:nth-child(3) { --rung: #c3cd3f; }
.ladder li:nth-child(4) { --rung: #dccd45; }
.ladder li:nth-child(5) { --rung: #efc345; }
.ladder li:nth-child(6) { --rung: #f5ad31; }
.ladder li:nth-child(7) { --rung: #f59a2d; }
.ladder li:nth-child(8) { --rung: #f2862f; }
.ladder li:nth-child(9) { --rung: #ec7134; }
.ladder li:nth-child(10) { --rung: #e65f39; }
.ladder li:nth-child(11) { --rung: #e4573d; }

.ladder b {
  font-size: 15px;
}

.ladder span {
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-dim);
}

.ladder em {
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  vertical-align: 2px;
  white-space: nowrap;
}

.ladder li.fish {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

@media (min-width: 900px) {
  .ladder-row {
    grid-template-columns: 0.8fr 1.2fr;
    gap: 56px;
    align-items: start;
  }
  .ladder-copy {
    position: sticky;
    top: 90px;
  }
  .ladder {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

.model {
  display: grid;
  gap: 22px;
  margin-top: 48px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(80% 120% at 100% 0%, rgba(255, 190, 60, 0.08), transparent 60%),
    color-mix(in srgb, var(--surface) 62%, transparent);
}

.model-copy p {
  color: var(--text-dim);
}

.model-copy p + p {
  margin-top: 12px;
}

.stats {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stats li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
}

.stats b {
  flex: none;
  min-width: 5.6rem;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.1;
}

.stats span {
  font-size: 14px;
  color: var(--text-dim);
}

@media (min-width: 900px) {
  .model {
    grid-template-columns: 1.3fr 1fr;
    align-items: center;
    gap: 48px;
    padding: 36px;
  }
}

/* --------------------------------------------------------- hints, coach */

.hints-row {
  display: grid;
  gap: 24px;
  margin-top: 28px;
}

.hints-copy p {
  color: var(--text-dim);
}

.hints-copy p + p {
  margin-top: 12px;
}

.showcase {
  overflow: clip;
  position: relative;
  width: 100%;
  max-width: 26rem;
  padding: 14px 14px 16px;
}

.sc-top {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.sc-set {
  font-weight: 700;
  color: var(--text-dim);
}

.sc-board {
  cursor: pointer;
}

.sc-bar {
  margin-top: 12px;
  min-height: 7.6em;
  cursor: default;
}

.sc-pause {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  opacity: 0;
  cursor: pointer;
}

.showcase.paused .sc-top::after {
  content: 'Paused · tap to play';
}

.showcase.paused .sc-count {
  display: none;
}

@media (min-width: 860px) {
  .hints-row {
    grid-template-columns: 26rem 1fr;
    align-items: center;
    gap: 56px;
  }
}

.coach {
  display: grid;
  gap: 28px;
  justify-items: center;
  margin-top: 56px;
  padding: 24px 18px;
  border: 1px solid color-mix(in srgb, var(--good) 30%, var(--line));
  border-radius: 24px;
  background:
    radial-gradient(70% 90% at 0% 0%, rgba(56, 211, 159, 0.1), transparent 60%),
    color-mix(in srgb, var(--surface) 62%, transparent);
}

.coach-copy {
  justify-self: stretch;
}

.coach-copy .h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.coach-ico {
  width: 28px;
  height: 28px;
  color: var(--good);
}

.unlock {
  margin-bottom: 12px;
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--good);
}

.coach-copy > p {
  color: var(--text-dim);
}

.coach-modes {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.coach-modes dt {
  display: inline;
  font-weight: 700;
  color: var(--text);
}

.coach-modes dd {
  margin: -6px 0 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text-dim);
}

.coach-modes dd:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.phone-coach {
  --w: min(250px, 66vw);
}

@media (min-width: 860px) {
  .coach {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 56px;
    padding: 40px 48px;
  }
  .phone-coach {
    --w: 260px;
  }
}

/* ------------------------------------------------------------- gallery */

.gallery {
  /* starts on the page's own left edge, however wide the window */
  --edge: max(var(--gutter), calc((100% - 1140px) / 2 + var(--gutter)));
  display: flex;
  gap: 18px;
  margin-top: 30px;
  padding: 10px var(--edge) 26px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--edge);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.shot {
  flex: none;
  margin: 0;
  scroll-snap-align: start;
}

.shot .phone {
  --w: 210px;
}

.shot figcaption {
  margin-top: 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
}

@media (min-width: 1140px) {
  .gallery {
    justify-content: safe center;
  }
  .shot .phone {
    --w: 230px;
  }
}

/* ------------------------------------------------------------- rewards */

.badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.badges li {
  --ring: #ffcb33;
  display: grid;
  grid-template-columns: 44px 1fr;
  column-gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.badges li.t2 {
  --ring: #ff8a3d;
}

.badges li.t3 {
  --ring: #c58bff;
}

.badges li.secret {
  --ring: var(--line);
}

.badges i {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--surface-2), var(--bg-2));
  box-shadow: inset 0 0 0 2.5px var(--ring), 0 0 14px color-mix(in srgb, var(--ring) 25%, transparent);
  font-size: 21px;
  font-style: normal;
  line-height: 1;
}

.badges li.secret i {
  font-family: var(--display);
  font-weight: 600;
  color: var(--text-faint);
}

.badges b {
  font-size: 13.5px;
  line-height: 1.25;
}

.badges span {
  font-size: 12px;
  line-height: 1.3;
  color: var(--text-faint);
}

@media (min-width: 760px) {
  .badges {
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
  }
}

.rewards {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.reward-card {
  overflow: clip;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.reward-card h3 {
  font-size: 19px;
  margin-bottom: 12px;
}

.reward-card > p {
  margin-top: 12px;
  font-size: 13.5px;
  color: var(--text-dim);
}

.faces {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.face-tile {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 24%;
  background: var(--tile);
}

.face-tile svg {
  width: 82%;
  height: 82%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
}

.marks {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.marks .board {
  --n: 1;
  border-radius: 12px;
  padding: 3px;
  box-shadow: none;
  pointer-events: none;
}

.marks small {
  display: block;
  margin-top: 5px;
  font-size: 11.5px;
  text-align: center;
  color: var(--text-faint);
}

/* The ✕ skins, ported from the game. Each restyles only the player's own
   mark, never the red ✕ of a wrong guess. */
.cell[data-skin='pebble'] .x::before {
  width: 30%;
  height: 30%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cell[data-skin='tally'] .x::before {
  width: 52%;
  height: 12.5%;
  transform: translate(-50%, -50%);
}
.cell[data-skin='hairline'] .x::before {
  width: 66%;
  height: 9%;
  min-height: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.cell[data-skin='hatch'] .x::before {
  width: 66%;
  height: 7%;
  min-height: 2px;
  transform: translate(-50%, -50%) rotate(45deg);
}
.cell[data-skin='pebble'] .x::after,
.cell[data-skin='tally'] .x::after,
.cell[data-skin='hairline'] .x::after {
  display: none;
}
.cell[data-skin='hatch'] .x::after {
  width: 48%;
  height: 40%;
  min-height: 0;
  border-radius: 0;
  background: linear-gradient(to bottom, var(--ink-out) 0 17.5%, transparent 17.5% 82.5%, var(--ink-out) 82.5% 100%);
  transform: translate(-50%, -50%) rotate(45deg);
}

.skies {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sky {
  position: relative;
  display: flex;
  align-items: flex-end;
  height: 64px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  overflow: hidden;
}

.sky b {
  position: relative;
  font-size: 12px;
  font-weight: 650;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.sky-dawn {
  background: linear-gradient(to bottom, #121a3a 0%, #6b3c4e 34%, #e79a54 62%, #9a5a52 80%, #141826 100%);
}

.sky-night {
  background:
    radial-gradient(1.2px 1.2px at 18% 30%, #fff 50%, transparent 100%),
    radial-gradient(1px 1px at 62% 18%, #e2ecff 50%, transparent 100%),
    radial-gradient(1.3px 1.3px at 82% 52%, #fff4d6 50%, transparent 100%),
    radial-gradient(1px 1px at 38% 66%, #e2ecff 50%, transparent 100%),
    radial-gradient(0.9px 0.9px at 90% 20%, #e2ecff 50%, transparent 100%),
    radial-gradient(42% 60% at 24% 40%, rgba(139, 92, 240, 0.3), transparent 70%),
    linear-gradient(to bottom, #04070f, #0b1020);
}

.sky-aurora {
  background:
    linear-gradient(100deg, transparent 10%, rgba(56, 211, 159, 0.45) 30%, rgba(110, 130, 230, 0.35) 55%, rgba(139, 92, 240, 0.4) 72%, transparent 90%),
    linear-gradient(to bottom, #03060e, #0a1b28);
}

.sky-nova {
  background:
    radial-gradient(circle at 62% 38%, #fff3c4 0%, #ffb347 9%, rgba(255, 90, 77, 0.55) 22%, rgba(139, 92, 240, 0.35) 42%, transparent 62%),
    linear-gradient(to bottom, #07040f, #140a1e);
}

.palettes {
  display: grid;
  gap: 8px;
}

.pal {
  display: grid;
  grid-template-columns: 4.4rem 1fr;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 650;
  color: var(--text-dim);
}

.pal-strip {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
}

.pal-strip i {
  aspect-ratio: 1;
  border-radius: 24%;
  background: var(--c);
}

@media (min-width: 640px) {
  .rewards {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (min-width: 1100px) {
  .rewards {
    grid-template-columns: repeat(4, 1fr);
  }
}

.unlocks {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.unlock-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: color-mix(in srgb, var(--surface) 62%, transparent);
}

.unlock-card svg {
  width: 30px;
  height: 30px;
  flex: none;
  color: var(--good);
}

.unlock-card:last-child svg {
  color: var(--accent);
}

.unlock-card h3 {
  font-size: 19px;
  margin-bottom: 4px;
}

.unlock-card small {
  margin-left: 6px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 11.5px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
}

.unlock-card p {
  font-size: 14.5px;
  color: var(--text-dim);
}

@media (min-width: 760px) {
  .unlocks {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

/* -------------------------------------------------------------- get it */

.sec-get {
  text-align: center;
  background: radial-gradient(60% 70% at 50% 100%, rgba(255, 170, 60, 0.14), transparent 70%);
}

.get-in {
  display: grid;
  justify-items: center;
}

.get-sun {
  width: 88px;
  height: 88px;
  margin-bottom: 18px;
  filter: drop-shadow(0 6px 22px rgba(255, 150, 30, 0.45));
  animation: spin 60s linear infinite;
}

.sec-get h2 {
  max-width: none;
  font-size: clamp(32px, 8vw, 54px);
}

.sec-get .lead {
  margin-top: 10px;
}

.sec-get .hero-ctas {
  width: 100%;
  max-width: 30rem;
}

/* -------------------------------------------------------------- footer */

.foot {
  padding: 34px 0 calc(34px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg-2) 60%, var(--bg));
}

.foot-in {
  display: grid;
  justify-items: center;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.foot-nav {
  display: flex;
  gap: 6px;
}

.foot-nav a {
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
}

.foot-nav a:hover {
  color: var(--text);
  background: var(--surface);
}

.foot-small {
  font-size: 13px;
  color: var(--text-faint);
}

@media (min-width: 760px) {
  .foot-in {
    grid-template-columns: auto 1fr auto;
    justify-items: start;
    text-align: left;
  }
  .foot-nav {
    justify-self: center;
  }
}

/* ------------------------------------------------------- less motion */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .word .lt,
  .word .sun-spin,
  .get-sun {
    animation: none;
  }
}
