:root {
  color-scheme: dark;

  /* The game's palette (lib/src/ui/palette.dart) and the store artwork's indigo. */
  --bg: #12141c;
  --bg-indigo: #242548;
  --bg-indigo-light: #393773;
  --well: #1b1e2a;
  --panel: #242836;
  --line: rgb(255 255 255 / 0.1);
  --text: #f4f4f8;
  --muted: rgb(255 255 255 / 0.66);
  --gold: #ffd54f;

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --content: 1080px;
  --gutter: 16px;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--gold);
  text-underline-offset: 0.2em;
}

h1,
h2,
h3 {
  line-height: 1.15;
  text-wrap: balance;
}

.wrap {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 640px) {
  :root {
    --gutter: 24px;
  }
}

/* Header */

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  font-size: 18px;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.lang-switch {
  color: var(--muted);
  font-size: 15px;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
}

.lang-switch:hover {
  color: var(--text);
  border-color: rgb(255 255 255 / 0.3);
}

/* Hero */

.hero {
  background:
    radial-gradient(1200px 500px at 85% 0%, rgb(255 213 79 / 0.08), transparent 60%),
    linear-gradient(160deg, var(--bg-indigo-light), var(--bg-indigo) 55%, var(--bg));
  padding-bottom: 56px;
}

.hero-grid {
  display: grid;
  gap: 40px;
  align-items: center;
  padding-top: 24px;
}

@media (min-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr 440px;
    gap: 64px;
    padding-top: 48px;
  }
}

.hero h1 {
  font-size: clamp(44px, 9vw, 76px);
  font-weight: 900;
  letter-spacing: -0.02em;
  margin: 0;
}

.tagline {
  color: var(--gold);
  font-size: clamp(20px, 3.4vw, 26px);
  font-weight: 700;
  margin: 8px 0 20px;
}

.lead {
  font-size: 19px;
  color: rgb(255 255 255 / 0.85);
  max-width: 34em;
  margin: 0 0 28px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgb(0 0 0 / 0.3);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 700;
}

.status::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgb(255 213 79 / 0.2);
}

.text-link {
  color: var(--text);
  font-weight: 600;
}

/* The same height as the status beside it, in the gold of a scoring chain. */
.play-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  border: 1px solid var(--gold);
  border-radius: 14px;
  padding: 10px 14px 10px 18px;
  color: #2b1d00;
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 8px 24px rgb(255 213 79 / 0.25);
}

.play-button:hover {
  background: #ffe082;
}

.play-button:focus-visible {
  outline: 3px solid var(--text);
  outline-offset: 3px;
}

.play-button svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.early-access {
  max-width: 34em;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* Game pieces, drawn as the game draws them: tiles (lib/src/ui/tile_painter.dart), the traced path
   (layers/chain_layer.dart), the chain bar (chain_preview.dart) and the stats above it (game_hud.dart). Each tile is an
   SVG in a tile's own units, built from the symbols at the top of the page. */

.tile-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.tile-row .tile {
  width: 44px;
  height: 44px;
  flex: none;
}

/* The dark outline of a tile's shape. A shape's symbol is used by reference, which does not inherit from where the
   symbol is defined, so the outline is set on each shape rather than on a group around them. */
.outline {
  stroke: #000;
  stroke-opacity: 0.25;
  stroke-width: 0.025;
  stroke-linejoin: round;
}

/* A joker's question mark, 70% of the tile's height, in its color. */
.joker {
  font-family: var(--font);
  font-size: 0.7px;
  font-weight: 800;
  text-anchor: middle;
  dominant-baseline: central;
}

.c0 { fill: #e5484d; }
.c1 { fill: #f5b83d; }
.c2 { fill: #30a46c; }
.c3 { fill: #3e8fea; }
.c4 { fill: #a35bd9; }
.c5 { fill: #e9ecf4; }

/* The chain bar: the chain's tiles in small, the bonuses under them, and the points, all in gold once it scores. */

.chain-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 10px 16px;
  border-radius: 16px;
  border: 2px solid transparent;
  background: var(--panel);
}

.chain-bar.match {
  border-color: var(--gold);
}

.chain-left {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.chain-tiles {
  display: flex;
  gap: 4px;
}

.bar-tile {
  width: 24px;
  height: 24px;
  flex: none;
}

/* The bar separates its bonuses with two spaces on each side of a dot. */
.chain-tags {
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  white-space: pre;
}

.chain-points {
  flex: none;
  color: var(--gold);
  font-size: 24px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

/* The stats above the chain bar */

.hud {
  display: flex;
  align-items: center;
  gap: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat.large {
  flex: 1;
  align-items: flex-start;
}

.stat-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.3;
}

/* The clock's label when a chain has just added time. */
.stat-label.refill {
  color: #7cf2a4;
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.stat.large .stat-value {
  font-size: 30px;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -12px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: rgb(255 255 255 / 0.7);
}

.icon-button svg {
  width: 24px;
  height: 24px;
}

/* The board in the hero, cropped from the game's own drawing of its screen. */

.hero-board {
  display: block;
  width: 100%;
  max-width: 400px;
  height: auto;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.35);
}

/* Sections */

section {
  padding: 64px 0;
}

section h2 {
  font-size: clamp(28px, 5vw, 38px);
  margin: 0 0 8px;
}

.section-lead {
  color: var(--muted);
  margin: 0 0 32px;
  max-width: 40em;
}

/* Screenshots */

.shots {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px var(--gutter) 16px;
  margin: 0 calc(-1 * var(--gutter));
  scrollbar-width: thin;
}

.shots figure {
  flex: 0 0 auto;
  width: min(62vw, 230px);
  margin: 0;
  scroll-snap-align: center;
}

@media (min-width: 1080px) {
  .shots {
    justify-content: space-between;
    overflow: visible;
  }

  .shots figure {
    width: 196px;
  }
}

.shots img {
  display: block;
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--bg);
}

.shots figcaption {
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
}

/* Features */

.features {
  background: var(--well);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.feature-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.feature {
  background: var(--panel);
  border-radius: 18px;
  padding: 12px 12px 22px;
}

/* A piece of the game screen that the card is about, on the screen's own background. */
.screen {
  display: grid;
  place-items: center;
  min-height: 152px;
  padding: 16px;
  background: var(--bg);
  border-radius: 12px;
}

.screen > * {
  width: 100%;
  max-width: 300px;
}

.screen-part {
  margin: 16px 10px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.feature h3 {
  font-size: 20px;
  margin: 4px 10px 8px;
}

.feature p,
.feature .points {
  margin-left: 10px;
  margin-right: 10px;
}

.feature p {
  margin-top: 0;
  margin-bottom: 0;
  color: rgb(255 255 255 / 0.78);
  font-size: 16px;
}

.mini-board {
  display: block;
  max-width: 220px;
}

.mini-board .well {
  fill: var(--well);
}

.mini-board .trace-glow,
.mini-board .trace-path {
  fill: none;
  stroke: var(--gold);
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-board .trace-glow {
  stroke-width: 0.3;
  stroke-opacity: 0.22;
}

.mini-board .trace-path {
  stroke-width: 0.13;
  stroke-opacity: 0.95;
}

.points {
  display: grid;
  grid-template-columns: repeat(5, auto);
  justify-content: start;
  gap: 2px 16px;
  margin: 14px 0 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.points dt {
  color: var(--muted);
  grid-row: 1;
}

.points dd {
  margin: 0;
  font-weight: 700;
  grid-row: 2;
}

/* Icons, drawn from symbols defined once per page. */
.symbols {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* Privacy policy */

.hero-slim {
  padding-bottom: 0;
}

.policy {
  max-width: 760px;
  padding-top: 40px;
  padding-bottom: 24px;
}

.policy h1 {
  font-size: clamp(34px, 7vw, 48px);
  margin: 0 0 6px;
}

.policy h2 {
  font-size: 24px;
  margin: 40px 0 10px;
}

.policy .effective {
  color: var(--muted);
  margin: 0 0 32px;
}

.policy p,
.policy ul {
  margin: 0 0 16px;
}

.policy li + li {
  margin-top: 6px;
}

/* Footer */

.site-footer {
  padding: 32px 0 48px;
  color: var(--muted);
  font-size: 15px;
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}

.site-footer a {
  color: var(--text);
}
