/* Ducklark Games — studio home. Same paper, pond and bill colours as the games. */

:root {
  color-scheme: light;
  --paper: #f6f1e7;
  --ink: #1e1a15;
  --muted: #6f665a;
  --line: #e2d9c8;
  --card: #ffffff;
  --card-edge: #d9cfbc;
  --card-shadow: #cdc2ad;
  --pond: #1f5f66;
  --pond-deep: #17494f;
  --bill: #f28b2b;
  --feather: #f6f1e7;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --paper: #171410;
    --ink: #f3ede2;
    --muted: #b3a996;
    --line: #322c23;
    --card: #262119;
    --card-edge: #3f382c;
    --card-shadow: #0d0b08;
    --pond: #1f5f66;
    --pond-deep: #123a3f;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 600 18px/1.5 Nunito, 'Segoe UI', Roboto, system-ui, sans-serif;
}

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

a:hover {
  color: var(--bill);
}

.wrap {
  width: min(100% - 32px, 960px);
  margin: 0 auto;
}

/* Header */

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: 44px;
  height: 44px;
  border-radius: 12px;
}

.brand b {
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.brand small {
  display: block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--bill);
}

nav {
  display: flex;
  gap: 6px;
}

nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

nav a:hover {
  background: var(--card);
  color: var(--pond);
}

/* Game-type bar, on every page. On the home page the links filter the games
   with :target and :has(), so it needs no script under the site's CSP; a
   browser without :has() simply shows every game. */

.cats {
  position: sticky;
  top: 8px;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 0 8px;
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.18);
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--pond);
  scrollbar-width: none;
}

.cats::-webkit-scrollbar {
  display: none;
}

/* With no scrollbar, a soft shadow on the right says there are more chips;
   it slides away once you reach the end (added 2026-10-22). */
.cats {
  background:
    linear-gradient(to left, var(--pond) 40%, transparent) right / 36px 100% no-repeat local,
    linear-gradient(to left, rgb(0 0 0 / 0.28), transparent) right / 18px 100% no-repeat scroll,
    var(--pond);
}

.cats a {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--feather);
  font-size: 0.95rem;
  white-space: nowrap;
}

.cats a:hover {
  background: var(--pond-deep);
  color: var(--feather);
}

/* The cards sit under a heading per kind of game; a heading spans the grid.
   While a type is chosen in the bar the headings go, so the matching cards
   from every group read as one list. */
.games .group-title {
  grid-column: 1 / -1;
  margin: 10px 0 -6px;
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--pond);
}

/* Each heading links to that kind of game's own page. */
.games .group-title a {
  color: inherit;
  text-decoration: none;
}

.games .group-title a:hover {
  color: var(--bill);
  text-decoration: underline;
}

body:has(.cat-anchor:target) .games .group-title {
  display: none;
}

.cat-anchor {
  display: block;
  /* Clears the pinned bar above it. */
  scroll-margin-top: 96px;
}

body:not(:has(.cat-anchor:target)) .cats a[href='/#games'],
body:has(#cat-new:target) .cats a[href='/#cat-new'],
body:has(#cat-arcade:target) .cats a[href='/#cat-arcade'],
body:has(#cat-puzzle:target) .cats a[href='/#cat-puzzle'],
body:has(#cat-word:target) .cats a[href='/#cat-word'],
body:has(#cat-strategy:target) .cats a[href='/#cat-strategy'],
body:has(#cat-satire:target) .cats a[href='/#cat-satire'],
body:has(#cat-friend:target) .cats a[href='/#cat-friend'],
body:has(#cat-pets:target) .cats a[href='/#cat-pets'] {
  background: var(--bill);
  color: #1e1a15;
}

body:has(#cat-new:target) .game:not([data-cat~='new']),
body:has(#cat-arcade:target) .game:not([data-cat~='arcade']),
body:has(#cat-puzzle:target) .game:not([data-cat~='puzzle']),
body:has(#cat-word:target) .game:not([data-cat~='word']),
body:has(#cat-strategy:target) .game:not([data-cat~='strategy']),
body:has(#cat-satire:target) .game:not([data-cat~='satire']),
body:has(#cat-friend:target) .game:not([data-cat~='friend']),
body:has(#cat-pets:target) .game:not([data-cat~='pets']) {
  display: none;
}

/* Hero */

/* A real photo of Tiny behind the words, with the drawn Tiny standing on its
   bottom edge: the two halves of the brand in one picture. */
.hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: clamp(340px, 46vw, 460px);
  margin: 8px 0 48px;
  border-radius: 28px;
  background: var(--pond);
  color: var(--feather);
}

.hero .hero-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 70% 50%;
  border-radius: 28px;
  /* Mirrored so Tiny stands on the bright right-hand side, clear of the words. */
  transform: scaleX(-1);
}

/* Pond-coloured shade on the left so the words stay readable on any photo. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 28px;
  background: linear-gradient(90deg, rgb(23 73 79 / 0.92) 0%, rgb(23 73 79 / 0.7) 42%, rgb(23 73 79 / 0) 72%);
  z-index: 1;
}

.hero .hero-text {
  position: relative;
  z-index: 2;
  max-width: 30rem;
  padding: 36px;
}

.hero .hero-drawn {
  position: absolute;
  z-index: 3;
  right: 28px;
  bottom: -40px;
  width: clamp(110px, 14vw, 160px);
  height: auto;
  filter: drop-shadow(0 8px 12px rgb(0 0 0 / 0.3));
}

.hero h1 {
  margin: 0 0 12px;
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  font-size: clamp(2rem, 6vw, 3.2rem);
  font-weight: 800;
  line-height: 1.05;
}

.hero p {
  margin: 0 0 22px;
  max-width: 34ch;
  font-size: 1.1rem;
  opacity: 0.92;
}

.button {
  display: inline-block;
  min-height: 56px;
  padding: 14px 28px;
  border-radius: 28px;
  background: var(--bill);
  color: #1e1a15;
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 3px 0 #c96e1b;
}

.button:hover {
  color: #1e1a15;
  filter: brightness(1.06);
}

.button.quiet {
  background: var(--card);
  color: var(--muted);
  box-shadow: 0 3px 0 var(--card-shadow);
  cursor: default;
}

/* Games */

section {
  padding: 44px 0 8px;
}

h2 {
  margin: 0 0 18px;
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.games {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.game {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 2px solid var(--card-edge);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--card-shadow);
}

.game h3 {
  margin: 0;
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.game .shot {
  display: block;
  margin: -8px -8px 2px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid var(--card-edge);
  background: var(--paper);
  aspect-ratio: 4 / 3;
}

.game .shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: transform 0.25s ease;
}

.game:hover .shot img {
  transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
  .game .shot img {
    transition: none;
  }
  .game:hover .shot img {
    transform: none;
  }
}

.game .tiles {
  display: flex;
  gap: 6px;
}

.game .tile {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 2px solid var(--card-edge);
  border-radius: 9px;
  background: var(--paper);
  font-weight: 800;
  font-size: 1.2rem;
}

.game .tile.diff {
  background: #2f7a4f;
  border-color: #2f7a4f;
  color: #fff;
}

.game .tile.goal {
  background: #ffefc2;
  border-color: #d9ad48;
  color: #4a3300;
}

.game p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.game .button {
  align-self: flex-start;
}

.soon {
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* The three call ducks together, above their cards */
.trio {
  position: relative;
  margin: 0 0 18px;
  overflow: hidden;
  border-radius: 20px;
}

.trio img {
  display: block;
  width: 100%;
  height: auto;
}

.trio figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgb(246 241 231 / 0.92);
  color: #1e1a15;
  font-weight: 800;
}

/* The flock: each duck as a photo and as drawn */

.flock {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.duck {
  padding: 22px;
  border: 2px solid var(--card-edge);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 3px 0 var(--card-shadow);
}

.duck .pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
  min-height: 160px;
  padding: 12px;
  border-radius: 14px;
  background: var(--paper);
}

.duck .pair.wide {
  grid-template-columns: 1fr;
}

/* The drawn Tiny is cream, so on the card he sits on his pond-teal badge. */
.duck .pair img.badge {
  width: 100%;
  max-width: 120px;
  height: auto;
  justify-self: center;
  align-self: center;
  border-radius: 26px;
}

/* A full photo (not a cut-out) fills its frame. */
.duck .pair img.photo {
  height: 170px;
  object-fit: cover;
  border-radius: 10px;
}

.duck .pair img {
  width: 100%;
  height: auto;
  max-height: 170px;
  object-fit: contain;
}

.duck h3 {
  margin: 14px 0 6px;
  font-family: 'Baloo 2', 'Trebuchet MS', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
}

.duck p,
.note {
  margin: 0;
  color: var(--muted);
}

.note {
  margin-top: 12px;
  font-size: 0.9rem;
}

/* From our pond: real photos */

.pond {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.pond figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 16px;
  aspect-ratio: 4 / 3;
  background: var(--card);
}

.pond figure.big {
  grid-column: span 2;
  aspect-ratio: 8 / 3;
}

.pond img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pond figcaption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgb(246 241 231 / 0.92);
  color: #1e1a15;
  font-size: 0.85rem;
  font-weight: 800;
}

/* About */

.about {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}

.about img {
  height: 150px;
  width: auto;
  border-radius: 32px;
}

.about p {
  margin: 0 0 12px;
  color: var(--muted);
}

footer {
  margin-top: 44px;
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

@media (max-width: 640px) {
  /* On a phone the photo sits on top and the words below it, on pond colour. */
  .hero {
    display: block;
    min-height: 0;
    margin-bottom: 36px;
  }

  .hero .hero-photo {
    position: static;
    height: 220px;
    border-radius: 28px 28px 0 0;
  }

  .top nav a {
    padding: 8px 10px;
    white-space: nowrap;
  }

  .top nav a[href$='#flock'] {
    display: none;
  }

  .pond figure.big {
    aspect-ratio: 8 / 3;
  }

  .hero::before {
    display: none;
  }

  .hero .hero-text {
    padding: 22px 22px 70px;
    text-align: center;
    max-width: none;
  }

  .hero p {
    margin-inline: auto;
  }

  .hero .hero-drawn {
    right: 12px;
    bottom: -28px;
    width: 84px;
  }

  .pond {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .about {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about img {
    margin: 0 auto;
  }
}

/* Privacy page. Kept here rather than inline: the site's Content Security
   Policy refuses inline styles. */

.policy {
  max-width: 68ch;
}

.policy h2 {
  font-size: 1.4rem;
  margin-top: 28px;
}

.policy .policy-title {
  font-size: 2rem;
  margin-top: 8px;
}

.policy p,
.policy li {
  color: var(--muted);
}

.policy p.price {
  font-size: 1.15rem;
  color: var(--ink, inherit);
}

.policy p.price b {
  font-size: 1.6rem;
}

.policy p.updated {
  font-size: 0.9rem;
}

/* A command to type, on its own line so it never breaks mid-word (added 2026-10-22). */
.policy pre {
  margin: 4px 0 14px;
  padding: 10px 12px;
  overflow-x: auto;
  border-radius: 8px;
  background: rgba(31, 95, 102, 0.08);
  font-size: 0.85rem;
}

/* ---- How to play pages (site/how-to-play/) ---- */

.howto h1.policy-title {
  font-size: 2rem;
  margin: 8px 0 12px;
}

.howto h3 {
  font-size: 1.1rem;
  margin: 18px 0 4px;
}

.howto .crumbs {
  font-size: 0.9rem;
  margin: 0;
}

.howto .lede {
  font-size: 1.1rem;
}

.howto .play-now {
  margin: 18px 0;
}

.howto a.play-link {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  background: #1f5f66;
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.howto a.play-link:hover,
.howto a.play-link:focus-visible {
  background: #174a50;
}

.howto ul.hub-list {
  list-style: none;
  padding: 0;
}

.howto ul.hub-list li {
  margin: 0 0 12px;
}

/* ---- Topic, category and ladder pages (site/topics/, site/games/, dist/ladders/;
   written by scripts/seo/build-pages.mjs) ---- */

.howto .qa {
  margin: 14px 0;
  padding: 4px 16px;
  border-left: 4px solid var(--pond);
  background: var(--card);
  border-radius: 0 10px 10px 0;
}

.howto .qa p {
  margin: 8px 0;
}

.howto .qa .qa-q {
  color: var(--ink);
}

.howto .qa .qa-w,
.howto .qa .qa-src {
  font-size: 0.9rem;
}

.howto ul.facts {
  padding-left: 1.2em;
}

.howto ol.puzzle-list li {
  margin: 0 0 6px;
}

/* Small phones (added 2026-10-21): the site pages' header (duck, word mark,
   Games / The flock / About) is wider than a 360–410 px screen, and long web
   addresses in the policy text don't wrap. Compact the header and let long
   words break so no page scrolls sideways. */
.policy {
  overflow-wrap: anywhere;
}

@media (max-width: 440px) {
  .top {
    gap: 8px;
  }

  .top .brand {
    gap: 8px;
  }

  .top .brand img {
    width: 36px;
    height: 36px;
  }

  .top .brand b {
    font-size: 1.25rem;
  }

  .top nav {
    gap: 0;
  }

  .top nav a {
    padding: 8px 7px;
    font-size: 0.92rem;
  }
}


/* Remove ads: the checkout and "Already bought?" (site/remove-ads.js, added
   2026-10-24). Phone first: full-width buttons at least 52 px tall. */
.buy [hidden],
.buy[hidden] {
  display: none !important;
}

.buy {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.buy > div,
.buy > form {
  display: grid;
  gap: 12px;
}

.buy p {
  margin: 0;
}

.buy-main,
.buy-quiet {
  width: 100%;
  min-height: 52px;
  padding: 0 18px;
  border-radius: 26px;
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
}

.buy-main {
  border: 0;
  background: var(--pond);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--pond-deep);
}

.buy-quiet {
  border: 2px solid var(--card-edge);
  background: var(--card);
  color: var(--ink);
}

.buy-main:disabled {
  opacity: 0.6;
  cursor: progress;
}

.buy-note {
  font-size: 0.9rem;
  text-align: center;
}

.buy-field {
  display: grid;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.buy-field input {
  min-height: 52px;
  padding: 0 14px;
  border: 2px solid var(--card-edge);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 1.15rem;
  letter-spacing: normal;
  text-transform: none;
}

.buy-field input:focus {
  outline: 3px solid var(--pond);
  outline-offset: 1px;
}

.buy-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
}

.buy-link {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.buy-link:disabled {
  color: var(--muted);
  cursor: default;
}

.buy-message:empty {
  display: none;
}

.buy-message {
  font-weight: 800;
  color: var(--ink);
}
