/* Kdepak's whole look: clean, with a friendly face, as on the site's main page. The system's own typeface,
   warm neutral greys and thin lines; the game's own colour is the orange of a map pin: a soft wash at the
   top of the page, the pin itself, the main button, the dot of the way to play that is in use. The map is
   a sheet of pale paper land in a light sea, with thin borders and blue rivers; where a place really is
   is marked in green. The stars are amber, and a day told has an amber light at its top. The site's
   penguin sits by the title. A guess that was close is green, a fair one amber, a far one red; in the
   archive a day with a star is green, a day without is grey. What a finger presses or reads at a glance
   is set bold. No web font, nothing from another origin (server.mjs). */

:root {
  color-scheme: light dark;

  --bg: #faf9f7;
  --surface: #ffffff;
  --ink: #1b1a18;
  --muted: #6b6862;
  --line: #e9e6e0;
  --line-strong: #d3cfc7;
  /* what lies flat on the page: the track under the ways to play, a small button */
  --fill: #efede8;
  --thumb: #ffffff;
  --focus: #b8440f;
  /* the game's own colour: what reads on it, the wash at the top of the page (index.html's theme colour is
     the same), the light at the top of a day told */
  --accent: #c94d16;
  --on-accent: #ffffff;
  --wash: #fde6d6;
  --glow: rgb(242 182 50 / 0.2);
  --star: #f2b632;
  --green: #2fb574;
  --on-mark: #1b1a18;
  /* how close a guess was: close, fair, far */
  --close: #2fb574;
  --fair: #f2b632;
  --far: #e5484d;
  /* a day without stars */
  --absent: #dddad3;
  --on-absent: #5b5852;
  --shadow: 0 1px 2px rgb(27 26 24 / 0.06), 0 16px 40px -16px rgb(27 26 24 / 0.28);

  /* the map: its sea, its land and the land's edge, the countries around Czechia, its waters; the line
     between a guess and its place; where a place really is */
  --sea: #cfe7f3;
  --land: #fbf5e6;
  --land-edge: #b3a585;
  --around: #ebe5d5;
  --around-edge: #cdc3aa;
  --water: #62aedb;
  --map-rim: #c5d9e3;
  --gap: #1b1a18;
  --truth: #1f9d61;

  --font: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  /* The room between the page and the screen's edges: a little more on a larger phone, never none. */
  --pad-x: clamp(16px, 5vw, 22px);
  --pad-y: clamp(10px, 2.3dvh, 20px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121211;
    --surface: #1b1b19;
    --ink: #f2f0ec;
    --muted: #a5a29b;
    --line: #2a2927;
    --line-strong: #403e3a;
    --fill: #232321;
    --thumb: #3b3a36;
    --focus: #ffab7a;
    --accent: #ff9655;
    --on-accent: #2b1203;
    --wash: #2e1c12;
    --glow: rgb(242 201 76 / 0.13);
    --star: #f2c94c;
    --green: #3fbf7f;
    --on-mark: #121211;
    --close: #3fbf7f;
    --fair: #f2c94c;
    --far: #f0686c;
    --absent: #2b2a28;
    --on-absent: #96938c;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 16px 40px -16px rgb(0 0 0 / 0.8);

    /* the map at night: a dark sea, land that still reads as land */
    --sea: #152f3d;
    --land: #3b3a33;
    --land-edge: #8a8370;
    --around: #2a2a26;
    --around-edge: #4d4a40;
    --water: #4f9cc4;
    --map-rim: #25404d;
    --gap: #f2f0ec;
    --truth: #4fcf8f;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: linear-gradient(to bottom, var(--wash), var(--bg) 15rem) no-repeat var(--bg);
  color: var(--ink);
  font: 1rem/1.5 var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

/* A field the page copies from when the clipboard will not be written to directly. */
.offscreen {
  position: fixed;
  top: 0;
  left: -100vw;
  opacity: 0;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
  color: inherit;
}

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

.sheet {
  max-width: 34rem;
  min-height: 100dvh;
  margin: 0 auto;
  padding: var(--pad-y) max(var(--pad-x), env(safe-area-inset-right)) calc(var(--pad-y) + env(safe-area-inset-bottom))
    max(var(--pad-x), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

.small {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--muted);
}

.center {
  text-align: center;
}

/* --- the header ------------------------------------------------------------------------------------- */

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

/* The site's penguin, beside the game's name. The penguin is the way to the site's main page, the name the
   way to this game's own day. */
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.brand__home {
  flex: none;
  display: block;
  border-radius: 50%;
}

.title__mark {
  flex: none;
  display: block;
  width: 34px;
  height: 34px;
  transition: transform 160ms ease;
}

.brand__home:hover .title__mark,
.brand__home:focus-visible .title__mark {
  transform: rotate(-8deg) scale(1.06);
}
/* The name is a long one: on a narrow phone it is set a little smaller, so that the three buttons beside it
   keep the page's gutter. */
.title {
  margin: 0;
  min-width: 0;
  font-size: clamp(1.1875rem, 5.4vw, 1.625rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.title a {
  display: flex;
  align-items: center;
  gap: clamp(6px, 2vw, 9px);
  text-decoration: none;
}

.tools {
  display: flex;
  gap: 6px;
}

.tool {
  flex: none;
  min-height: 36px;
  padding: 0 clamp(8px, 2.8vw, 12px);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.tool--round {
  width: 36px;
  padding: 0;
  font-weight: 600;
}

/* Statistics: the word where there is room for it, three bars where there is not (a phone, now that the
   language stands beside it). The button's label says the word either way. */
.tool--stats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tool--stats svg {
  display: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}

@media (max-width: 27.99rem) {
  .tool--stats {
    width: 36px;
    padding: 0;
  }

  .tool--stats svg {
    display: block;
  }

  .tool--stats span {
    display: none;
  }
}

/* The other language, by its two letters (its whole name is its label): a link, which asks the server for
   this same page in it. */
.tool--lang {
  display: inline-grid;
  place-items: center;
  color: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
}

/* The account: a figure while nobody is signed in, the player's initial on the game's colour once someone is. */
.tool--account {
  display: inline-grid;
  place-items: center;
}

.tool--account svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.tool--account.is-in {
  border-color: var(--accent);
  background: var(--wash);
}

.tool--account.is-in svg,
.tool--account:not(.is-in) [data-initial] {
  display: none;
}

#account-body .actions {
  margin: 14px 0 12px;
}

.account__unsaved {
  color: var(--ink);
}

.tool:active,
.button:active {
  background: var(--fill);
}

/* The three ways to play (today on either map, the archive): one track, and the one in use lifted from it. */
.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  margin-top: 6px;
  padding: 3px;
  border-radius: 11px;
  background: var(--fill);
}

.modes a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.modes a[aria-current='page'] {
  background: var(--thumb);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.modes a[aria-current='page']::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

/* a map whose game of today is played */
.modes a.is-done::after {
  content: '✓';
  color: var(--green);
  font-weight: 700;
}

#main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.caption {
  margin: 0;
  padding: 10px 2px 8px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
}

/* --- a place asked for, and the map ------------------------------------------------------------------ */

.play {
  display: grid;
  gap: 10px;
  padding-bottom: 8px;
}

/* What is asked for: which of the five, its name, and what kind of thing it is. */
.ask {
  display: grid;
  justify-items: center;
  gap: 2px;
  text-align: center;
}

.ask p,
.ask h2 {
  margin: 0;
}

.ask__step {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.dots {
  display: inline-flex;
  gap: 5px;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line-strong);
}

.dot.is-now {
  background: none;
  box-shadow: inset 0 0 0 2.5px var(--accent);
}

.dot.is-close { background: var(--close); }
.dot.is-fair { background: var(--fair); }
.dot.is-far { background: var(--far); }
.dot.is-now.is-close,
.dot.is-now.is-fair,
.dot.is-now.is-far {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--line-strong);
}

.ask__lead {
  padding-top: 4px;
  font-size: 0.9375rem;
  color: var(--muted);
}

.ask__name {
  font-size: clamp(1.625rem, 8.4vw, 2.125rem);
  font-weight: 750;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.ask__kind {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  min-height: 1.75rem;
  padding-top: 5px;
}

.ask__kind span {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--fill);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

.ask__kind span + span {
  background: var(--wash);
  color: var(--ink);
}

/* The map: a sheet of 3 to 2, as wide as the page. map.js moves its window; a pin keeps its size. */
.mapbox {
  position: relative;
  aspect-ratio: 3 / 2;
  border-radius: 16px;
  overflow: hidden;
  background: var(--sea);
  box-shadow: 0 0 0 1px var(--map-rim), 0 0 0 5px color-mix(in oklab, var(--surface) 70%, transparent), 0 0 0 6px var(--line);
  margin: 6px;
}

.map {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  /* The whole sheet: a finger that moves up or down moves the page. Two fingers are the browser's own. */
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* Closer than the whole sheet: a finger moves the map. */
.map[data-close='yes'] {
  touch-action: pinch-zoom;
  cursor: grab;
}

.m-sea { fill: var(--sea); }

.m-layers path {
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.m-around { fill: var(--around); stroke: var(--around-edge); stroke-width: 1; }
.m-land { fill: var(--land); stroke: var(--land-edge); stroke-width: 1; }
/* On the map of Czechia the country's own edge carries the map. */
.play[data-set='cz'] .m-land { stroke-width: 2; }
.m-seam { fill: var(--land); stroke: none; }
.m-coast { fill: none; stroke: var(--land-edge); stroke-width: 1; }
.m-lakes { fill: var(--sea); stroke: var(--land-edge); stroke-width: 0.6; }
.play[data-set='cz'] .m-lakes { fill: var(--water); stroke: none; }
.m-rivers { fill: none; stroke: var(--water); stroke-width: 2.2; }
.m-streams { fill: none; stroke: var(--water); stroke-width: 1.2; }

/* the line between a guess and its place */
.m-gap {
  vector-effect: non-scaling-stroke;
  stroke: var(--gap);
  stroke-width: 2;
  stroke-dasharray: 2 6;
  stroke-linecap: round;
  opacity: 0.75;
}

/* A mark: the player's pin in the game's colour, the place itself a green ring. */
.mark {
  pointer-events: none;
}

/* one of five on the whole map: smaller, so that the map still shows */
.mark--small .mark__in {
  transform: scale(0.7);
}

.mark--guess .mark__body { fill: var(--accent); stroke: #fff; stroke-width: 1.5; }
.mark--guess .mark__eye { fill: #fff; }
.mark--truth .mark__halo { fill: var(--truth); opacity: 0.22; }
.mark--truth .mark__body { fill: var(--truth); stroke: #fff; stroke-width: 2; }
.mark--truth .mark__eye { fill: #fff; }

.mark__label {
  fill: #fff;
  font: 700 11px/1 var(--font);
}

/* a place with its number has no eye: the number stands there */
.mark--truth:has(.mark__label) .mark__eye { display: none; }
.mark--truth:has(.mark__label) .mark__body { r: 9.5px; }

.mark--truth.is-new .mark__in {
  animation: land 520ms cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards;
}

.mark--truth.is-new .mark__halo {
  animation: ring 900ms ease-out 200ms backwards;
}

@keyframes land {
  from { transform: scale(0); }
}

@keyframes ring {
  from { transform: scale(0.4); opacity: 0.6; }
}

.mark.is-dim,
.m-gap.is-dim {
  opacity: 0.18;
}

/* Closer and further: two round buttons side by side in the map's top left corner, where neither map has
   anything to look for: Saxony on the map of Czechia, the Arctic north of Canada on the world's. */
.mapbox__zoom {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
}

.mapbox__zoom button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.14);
}

.mapbox__zoom button:disabled {
  opacity: 0.45;
  cursor: default;
}

/* under the map: what to do now, or what the last guess was worth */
.under {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 6.5rem;
}

.under p {
  margin: 0;
}

.under__hint {
  padding-top: 2px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
  text-wrap: balance;
}

.told {
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-height: 2rem;
  font-size: 1.0625rem;
}

.told b {
  font-weight: 700;
}

.told__points {
  padding: 1px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--on-mark);
}

.told.is-close .told__points { background: var(--close); }
.told.is-fair .told__points { background: var(--fair); }
.told.is-far .told__points { background: var(--far); color: #fff; }

/* A day that is over: the map stays, the question makes room for what is told. */
.play.is-over .ask,
.play.is-over .under {
  display: none;
}

/* --- stars ------------------------------------------------------------------------------------------ */

.stars {
  display: inline-flex;
  gap: 2px;
  vertical-align: middle;
}

.star {
  --i: 0;
  width: 22px;
  height: 22px;
  flex: none;
  overflow: visible;
}

.star path {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.star.is-on path {
  fill: var(--star);
  stroke: var(--star);
}
.star:nth-child(2) { --i: 1; }
.star:nth-child(3) { --i: 2; }

.stars--big {
  gap: 4px;
}

.stars--big .star {
  width: clamp(36px, 11vw, 44px);
  height: clamp(36px, 11vw, 44px);
}

/* A run's stars come one after another: each keeps its bare look until its turn. app.js lets them
   finish within a second and a half. */
.stars.is-new .star.is-on {
  animation: pop 380ms cubic-bezier(0.2, 0.9, 0.3, 1.2) calc(var(--i) * 150ms + 120ms) backwards;
}

.stars.is-new .star.is-on path {
  animation: bare 150ms step-end calc(var(--i) * 150ms + 120ms) backwards;
}

@keyframes pop {
  0% { transform: none; }
  45% { transform: scale(1.25); }
  100% { transform: none; }
}

@keyframes bare {
  from {
    fill: none;
    stroke: var(--line-strong);
  }
}

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

.button {
  min-height: 44px;
  padding: 0 16px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.button--main,
.button--main:active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 600;
}

.button--main:active {
  opacity: 0.85;
}

.button--wide {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border-radius: 12px;
  font-size: 1.0625rem;
}

.button:disabled {
  opacity: 0.55;
  cursor: default;
}

/* --- an answer told ---------------------------------------------------------------------------------- */

.result {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 20px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: radial-gradient(120% 130px at 50% 0, var(--glow), transparent) var(--surface);
  text-align: center;
}

.result h2 {
  margin: 0;
  font-size: clamp(1.5rem, 7vw, 1.875rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.result h2:focus {
  outline: none;
}

.result p {
  margin: 0;
}

/* The day's five places: a press shows one of them close on the map. */
.places {
  display: grid;
  gap: 6px;
  width: 100%;
  padding: 4px 0 2px;
}

.place {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.place[aria-pressed='true'] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.place__n {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--truth);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 700;
}

.place__name {
  display: grid;
  min-width: 0;
  line-height: 1.2;
}

.place__name b {
  font-weight: 600;
  overflow-wrap: break-word;
}

.place__name small {
  font-size: 0.8125rem;
  color: var(--muted);
}

.place__km {
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.place__points {
  min-width: 2.6em;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--on-mark);
}

.place.is-close .place__points { background: var(--close); }
.place.is-fair .place__points { background: var(--fair); }
.place.is-far .place__points { background: var(--far); color: #fff; }

/* which mark is which */
.key {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-size: 0.875rem;
  color: var(--muted);
}

.key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.key svg {
  width: 18px;
  height: 20px;
  overflow: visible;
}

/* under a finished game: the way to the site's other games */
.more a {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 0.2em;
}

.more a:hover {
  color: var(--ink);
}

.verdict {
  font-weight: 600;
}

.next {
  font-size: 0.9375rem;
  color: var(--muted);
}

.next .clock {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding-top: 4px;
}

/* Which map, in the archive and in the statistics: one track, and the one in use lifted from it. */
.ways {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2px;
  width: 100%;
  max-width: 22rem;
  padding: 3px;
  border-radius: 11px;
  background: var(--fill);
}

.ways a,
.ways button {
  display: grid;
  place-items: center;
  text-decoration: none;
  min-height: 34px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
}

.ways a[aria-current],
.ways button[aria-pressed='true'] {
  background: var(--thumb);
  color: var(--ink);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.1);
}

.archive .ways,
#stats-body .ways {
  margin: 0 auto 12px;
}

/* What the game says: a label over the bottom of the page. */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 4;
  width: max-content;
  max-width: calc(100vw - 2 * var(--pad-x));
  margin: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg);
  font-size: 0.9375rem;
  font-weight: 500;
  text-align: center;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast:empty {
  display: none;
}

/* --- the archive ------------------------------------------------------------------------------------ */

.archive {
  padding: 4px 2px 16px;
}

.archive__sum {
  margin: 0 0 12px;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--muted);
}

.month {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  margin-bottom: 10px;
}

.month h2 {
  margin: 0;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.month a,
.month span {
  display: grid;
  place-items: center;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  font-size: 1.1rem;
  text-decoration: none;
}

.month span {
  border-color: var(--line);
  background: none;
  color: var(--line-strong);
}

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

.calendar .dow {
  padding-bottom: 2px;
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
}

.day {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-size: clamp(1rem, 4.4vw, 1.25rem);
  font-weight: 600;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  text-decoration: none;
}

/* a day with a star: the date, and under it the points it earned */
.day[data-state='some'] {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 3px;
  border-color: var(--green);
  background: var(--green);
  color: var(--on-mark);
  font-size: clamp(0.9375rem, 4.2vw, 1.125rem);
}

.day small {
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.day.is-off {
  border-color: transparent;
  background: none;
  color: var(--line-strong);
  font-weight: 400;
}

.day[data-state='none'] {
  border-color: var(--absent);
  background: var(--absent);
  color: var(--on-absent);
}

.day.is-today {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.day.is-today:focus-visible {
  outline-color: var(--focus);
}

.key-to {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
  color: var(--muted);
}

.key-to li {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-to .day {
  width: 18px;
  padding: 0;
  aspect-ratio: 1;
  border-radius: 5px;
}

/* --- trouble, dialogs ------------------------------------------------------------------------------- */

.trouble {
  margin: 24px auto;
  max-width: 24rem;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: center;
}

.trouble p {
  margin: 0 0 12px;
}

.dialog {
  width: min(30rem, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 20px 18px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.dialog::backdrop {
  background: rgb(18 18 17 / 0.5);
}

.dialog h2 {
  margin: 0 0 12px;
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.dialog p {
  margin: 0 0 10px;
  font-size: 0.9375rem;
}

/* In the rules, which a first visit opens: the way to the other language, for whoever cannot read them. */
.dialog__lang {
  margin: -6px 0 12px;
  font-size: 0.875rem;
}

.dialog__lang a {
  color: var(--muted);
  font-weight: 500;
}

.dialog__close {
  float: right;
  margin: -6px -4px 0 8px;
}

.dialog__close button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: var(--fill);
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
}

/* the rule: stars, and the points that earn them */
.rules {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
  font-size: 0.9375rem;
}

.rules li {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  line-height: 1.3;
}

.rules .rules__wide {
  display: block;
  color: var(--muted);
}

.how {
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  font-size: 0.9375rem;
}

.how dt {
  font-weight: 600;
}

.how dd {
  margin: 0;
}

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

.numbers div {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 2px;
  padding: 10px 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
}

.numbers b {
  font-size: clamp(1.3rem, 6vw, 1.75rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.numbers span {
  font-size: 0.875rem;
  line-height: 1.2;
  color: var(--muted);
}

.bars {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 4px 8px;
  margin: 0 0 10px;
  font-size: 0.9375rem;
}

.bars dt {
  text-align: right;
  color: var(--muted);
}

.bars dd {
  margin: 0;
}

.bar {
  min-width: 1.8em;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--fill);
  color: var(--ink);
  font-weight: 500;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar.is-some {
  background: var(--green);
  color: var(--on-mark);
}

.bar.is-lost {
  background: var(--ink);
  color: var(--bg);
}

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

/* A screen with room to spare: let the page breathe. */
@media (min-width: 40rem) and (min-height: 46rem) {
  .top {
    padding-top: 6px;
  }
  .modes a {
    min-height: 34px;
  }
  .play {
    gap: 14px;
  }
}
