/* Leapy Hue site theme (ported from the approved home and comparison page designs) */

:root {
  --bg: #ffffff;
  --ink: #111111;
  --muted: #52525b;
  --subtle: #71717a;
  --line: #e7e9ee;
  --surface: #f4f5f7;
  --surface-hover: #e9ecf1;
  --radius: 6px;
  --shell: 820px;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  overflow-x: hidden;
}

img {
  display: block;
  max-width: 100%;
}

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

[hidden] {
  display: none !important;
}

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}

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

/* Phones (360 to 479px): logo (36px tall, 149px wide) and the three links stay on one row: 13px labels, tight
   padding, and "Rules" for How to play. From 480px the full label and roomier links. */
.header-inner {
  gap: 6px;
}

.site-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.site-nav .nav-long {
  display: none;
}

/* round 21 fix: "Unlimited" shows from 560px. Under 480px the logo (149px) and Daily, Rules, Archive take about 313px
   of a 375px phone's 343px, so a fourth link (about 75px) would overflow; from 480px the roomier links with "How to
   play" and Unlimited take about 483px, which fits from 515px; 560px leaves about 45px to spare. */
.site-nav .nav-wide {
  display: none;
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 7px;
  border-radius: var(--radius);
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.site-nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

@media (min-width: 480px) {
  .header-inner {
    gap: 12px;
  }

  .site-nav {
    gap: 6px;
  }

  .site-nav a {
    padding: 6px 10px;
    font-size: 14px;
  }

  .site-nav .nav-short {
    display: none;
  }

  .site-nav .nav-long {
    display: inline;
  }
}

@media (min-width: 560px) {
  .site-nav .nav-wide {
    display: inline-flex;
  }
}

/* Soft pastel waves behind the hero (title and game card): pink and lavender rising on the left, light blue on
   the right, fading out before the text below. They sit behind everything, and the game box and buttons are opaque. */
.play-top {
  position: relative;
  isolation: isolate;
  padding-top: 16px;
}

.play-top::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 100vw;
  margin-left: -50vw;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 600' preserveAspectRatio='none'%3E%3Cdefs%3E%3ClinearGradient id='p' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23f7d9ec' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%23f7d9ec' stop-opacity='0'/%3E%3C/linearGradient%3E%3ClinearGradient id='l' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23e9defb' stop-opacity='.55'/%3E%3Cstop offset='1' stop-color='%23e9defb' stop-opacity='0'/%3E%3C/linearGradient%3E%3ClinearGradient id='b' x1='0' y1='0' x2='0' y2='1'%3E%3Cstop offset='0' stop-color='%23d6e9fb' stop-opacity='.65'/%3E%3Cstop offset='1' stop-color='%23d6e9fb' stop-opacity='0'/%3E%3C/linearGradient%3E%3C/defs%3E%3Cpath d='M0 170C170 90 330 120 470 230S700 470 820 600H0Z' fill='url(%23l)'/%3E%3Cpath d='M0 300C150 230 300 250 430 340S640 540 700 600H0Z' fill='url(%23p)'/%3E%3Cpath d='M1440 110C1290 130 1150 230 1040 360S880 560 800 600H1440Z' fill='url(%23b)'/%3E%3C/svg%3E") left bottom / 100% 78% no-repeat;
  pointer-events: none;
}

/* Player: one white card holding the game box and, under it, a slim toolbar (the page's H1 on the left; Like, Share,
   Fullscreen as icon buttons on the right; a thin line above it, between the game and the bar; round 20, owner's
   option B: the card starts with the game and ends with the bar). The toolbar is outside the box, so it stays while
   the game loads and is played.
   The box has one height for cover, loading and game. The cover (partials/player.html) is the game's own first
   screen at the start of a board, laid out with the game's own CSS (game/embed.html: body padding 10px 10px 18px, a
   column at most 370px wide, the same chips, lines, board and tray), so the cover is as tall as the game at every
   width, and the Play button sits over the middle of the board. The board and tray are a sample board drawn from
   core.js (tools/make_cover.mjs). script.js measures the cover and keeps that height as the box's minimum
   (--player-height) while the game loads and runs; the box only grows when the game is taller (a finished board's
   result or the open leaderboard), so nothing jumps when Play is pressed. The box keeps a 1px border (transparent
   now) because script.js adds those 2px. The calc() is a fallback for the moment before script.js runs: about
   1.43 W + 188px with W the game's column width (617px in the desktop layout from 900px). Round 19: in a short window
   script.js also sets --k on the box (and sends the same k to the game), so the cover's and the game's board and tray
   shrink alike and the whole card fits the window (see leapyFitScale in script.js). */
.stage-section {
  container-type: inline-size;
  margin-bottom: 36px;
}

.game-card {
  position: relative;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(40, 44, 90, 0.07), 0 1px 3px rgba(40, 44, 90, 0.04);
  overflow: hidden;
}

.card-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 4px 14px;
  border-top: 1px solid var(--line);
}

/* the page's one H1: on phones it may take two lines next to the icons (balanced, so the lines are about as long) */
/* owner 2026-11-30 (option C): the card bar reads like a game window title, the site icon then the H1, lighter */
.card-title {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  font-weight: 650;
  color: #2b2f3a;
}

.card-title > span {
  text-wrap: balance;
}

.card-icon {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px #eceef3;
}

.card-tools {
  position: relative;
  display: flex;
  flex: none;
  align-items: center;
  gap: 2px;
  margin-left: auto;
}

/* the engine's share message ("Link copied"): a small note beside the icons, over the end of the title, so it never
   moves the title or the game; script.js clears it after a few seconds */
.card-status {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-right: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 4px 12px rgba(40, 44, 90, 0.08);
  white-space: nowrap;
  font-size: 13px;
  color: var(--muted);
}

.card-status:empty {
  display: none;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #3f4458;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.tool-btn:hover {
  background: #f1f2f6;
}

.tool-btn:active {
  background: #e7e9f0;
}

.tool-btn[aria-pressed="true"],
.tool-btn[data-gf-liked] {
  background: #ffedf1;
  color: #a73550;
}

.tool-btn[aria-pressed="true"]:hover,
.tool-btn[data-gf-liked]:hover {
  background: #ffe1e8;
}

.tool-btn[aria-pressed="true"] .icon-heart,
.tool-btn[data-gf-liked] .icon-heart {
  fill: #F25F7A;
  stroke: #F25F7A;
}

.like-count:empty {
  display: none;
}

.tool-divider {
  width: 1px;
  height: 22px;
  margin: 0 4px;
  background: var(--line);
}

/* Share (round 16): on a touch screen with the system share sheet, one tap on the icon opens that sheet (the engine's
   data-gf-share with no value); elsewhere the icon opens this small menu of the engine's share targets. The menu lies
   over the game (out of the flow), so the card never changes height; script.js opens and closes it. Round 20: the bar
   is under the game, so the menu opens upward (above the bar, right-aligned), over the game and inside the card;
   script.js scrolls the page a little when its top would be above the window. */
.share-tools {
  position: relative;
  display: flex;
}

.tool-btn[aria-expanded="true"],
.tool-btn[aria-expanded="true"]:hover {
  background: #efebfd;
  color: #4a36b8;
}

.share-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 12px 28px rgba(40, 44, 90, 0.14);
}

.share-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f4458;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.share-ico {
  flex: none;
}

.share-item:hover {
  background: #f1f2f6;
}

.share-item:active {
  background: #e7e9f0;
}

.share-copy {
  position: relative;
  margin-top: 5px;
}

.share-copy::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: -4px;
  height: 1px;
  background: var(--line);
}

.player-frame {
  --k: 1;
  position: relative;
  width: 100%;
  min-height: var(--player-height, calc(min(100cqw - 22px, 370px) * 1.4286 + 188px));
  border: 1px solid transparent;
  background: #fff;
  overflow: hidden;
}

.player-frame iframe {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--bg);
}

/* Cover: in the normal flow, so it gives the box its height; white like the game. It is a size container as wide as
   the game frame, so the cover's @container rules switch at the same widths as the game's @media rules. */
.player-cover {
  position: relative;
  container: leapy-cover / inline-size;
  background: #fff;
  cursor: pointer;
}

/* the engine hides cover and loader with the hidden attribute and marks the box with data-gf-state */
[data-gf-cover][hidden],
[data-gf-loading][hidden],
[data-gf-state] [data-gf-cover] {
  display: none;
}

.player-frame:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.player-frame:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
}

/* The game's first screen, copied from game/embed.html (keep the sizes in step with it; test/cover.test.mjs compares
   them). The game's title is visually hidden, so the first row is the mode chips and the sound button. */
.cover-game {
  display: flex;
  justify-content: center;
  padding: 10px 10px 12px;
  background: #fff;
  color: #111;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  text-align: left;
  user-select: none;
}

.cg-wrap {
  width: min(100%, 370px);
}

.cg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 2px;
}

.cg-modes {
  display: flex;
  align-items: center;
  gap: 2px;
}

.cg-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: #f4f5f7;
  color: #3f4458;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  cursor: inherit;
}

.cg-tools {
  display: flex;
  align-items: center;
}

.cg-modes .cg-chip {
  padding: 0 8px;
  background: transparent;
  color: #52525b;
}

.cg-modes .cg-chip.on {
  background: #efebfd;
  color: #4a36b8;
}

.cg-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #3f4458;
  cursor: inherit;
}

.cg-tool svg {
  display: block;
}

/* the game's line here is short ("Daily #3"), always one line; the cover's line is held to one line as well */
.cg-line {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  min-height: 40px;
  line-height: 40px;
  font-size: 14px;
  font-weight: 600;
  color: #3f4458;
}

.cg-stats {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #52525b;
  margin: 0 2px 6px;
  font-variant-numeric: tabular-nums;
}

/* round 19: in a short window script.js sets --k (1 or less) on the box, and the board, the counters and the tray take
   that share of their width, centered, and the board's and tray's gaps and the tray's padding that share of their
   size, exactly like the game (game/embed.html #stats, #board, #supply, .board, .tray) */
.cg-stats {
  width: calc(100% * var(--k) - 4px);
  margin-inline: auto;
}

.cg-boardwrap {
  position: relative;
  width: calc(100% * var(--k));
  margin-inline: auto;
}

.cg-supply {
  width: calc(100% * var(--k));
  margin-inline: auto;
}

/* the whole board softly blurred behind Play (owner 2026-11-30), so the pill stands out */
.cg-board-pic {
  filter: blur(2.5px);
}

.cg-boardwrap .play-btn {
  z-index: 1;
}

.cg-board-pic {
  display: block;
}

.cg-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: calc(3px * var(--k));
  width: 100%;
  aspect-ratio: 1;
}

.cg-slot,
.cg-cell {
  position: relative;
  display: block;
  border-radius: 6px;
}

.cg-slot {
  background: #f3f4f6;
  box-shadow: inset 0 0 0 1.5px #e3e5e9;
}

.cg-tile {
  position: absolute;
  inset: 0;
  display: block;
  border-radius: 6px;
}

.cg-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 1.5px rgba(0, 0, 0, 0.35);
}

.cg-trayhead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: #52525b;
  margin: 8px 2px 4px;
}

.cg-tray {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-content: start;
  gap: calc(6px * var(--k));
  min-height: 60px;
  padding: calc(8px * var(--k));
  border-radius: 8px;
  background: #f6f7f9;
}

.cg-cell {
  aspect-ratio: 1;
}

/* round 21 fix 2 (owner): the Unlimited line ends with the game's small down chevron (game/embed.html #options .chev:
   14px, the muted color, 4px after the text, the flex row's gap); it sits in the 40px line, so the height stays */
.cg-chev {
  margin-left: 4px;
  vertical-align: middle;
  color: #52525b;
}

/* narrow frames and the desktop layout: the same switches as the game's @media rules (game/embed.html) */
@container leapy-cover (max-width: 349px) {
  .cg-modes .cg-chip {
    padding: 0 5px;
    font-size: 13px;
  }
}

@container leapy-cover (min-width: 700px) {
  .cg-wrap {
    width: min(100%, 750px);
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    column-gap: 12px;
    align-items: start;
  }

  .cg-top,
  .cg-head {
    display: contents;
  }

  .cg-modes {
    grid-area: 1 / 1;
  }

  .cg-line {
    grid-area: 1 / 2;
    justify-self: end;
  }

  .cg-tools {
    grid-area: 1 / 3;
  }

  .cg-stats {
    grid-area: 2 / 1 / 3 / 4;
    justify-self: center;
    width: calc(332px * var(--k) - 4px);
  }

  .cg-boardwrap {
    grid-area: 3 / 1 / 4 / 4;
    justify-self: center;
    width: calc(332px * var(--k));
  }

  .cg-supply {
    grid-area: 4 / 1 / 5 / 4;
  }

  .cg-tray {
    grid-template-columns: repeat(11, 1fr);
  }
}

/* Play: a pill over the middle of the board (the sample board's middle row is empty), option A of
   docs/design-r10/play-button-options.html: pink to violet to blue from the logo, a soft violet shadow. */
.play-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: calc(100% - 16px);
  min-width: 148px;
  min-height: 52px;
  padding: 0 28px 0 32px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #F25F7A, #9B5DE5 55%, #5B6CF0);
  color: #fff;
  font-family: inherit;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgba(155, 93, 229, 0.3);
  cursor: pointer;
  transition: filter 0.14s ease, transform 0.14s ease;
}

.play-btn svg {
  flex: none;
}

.play-btn:hover {
  filter: brightness(1.06) saturate(1.05);
}

.play-btn:active {
  transform: translate(-50%, -50%) scale(0.98);
}

/* round 21 fix: "Play Unlimited" with the icon and the sides is about 221px at 19px (CoreText, system font, bold), and
   the pill may take the board's width less 16px: 224px at the 240px floor, so 3px to spare. On the Unlimited cover the
   label shrinks with the board below about 252px wide (7.6px of pill per px of font: the label's 7.0 plus room for a
   system font up to 9% wider), never above 19px: at the floor 17.4px, a pill of about 210px. 100cqw is the board's
   width (its box is an inline-size container; its width is set, so its layout does not change). Daily and Archive
   keep their pill as it is. */
.cg-boardwrap:has(> .play-long) {
  container-type: inline-size;
}

.play-btn.play-long {
  font-size: min(19px, calc((100cqw - 108px) / 7.6));
}

/* Loading: the same box, white like the cover and the game, with four tiles leaping into a 2x2 grid */
.player-loading {
  position: absolute;
  inset: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  z-index: 3;
}

.leap-loader {
  position: relative;
  width: 72px;
  height: 72px;
}

.ll-slot,
.ll-tile {
  position: absolute;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
}

.ll-slot {
  background: #f3f4f6;
  box-shadow: inset 0 0 0 1.5px #e3e5e9;
}

.ll-s1, .ll-t1 { left: 0; top: 0; }
.ll-s2, .ll-t2 { left: 40px; top: 0; }
.ll-s3, .ll-t3 { left: 0; top: 40px; }
.ll-s4, .ll-t4 { left: 40px; top: 40px; }

.ll-t1 { background: #F25F7A; animation: tile-leap 1.6s cubic-bezier(0.3, 0.7, 0.4, 1) infinite 0s; }
.ll-t2 { background: #F59F00; animation: tile-leap 1.6s cubic-bezier(0.3, 0.7, 0.4, 1) infinite 0.18s; }
.ll-t3 { background: #3FBF8F; animation: tile-leap 1.6s cubic-bezier(0.3, 0.7, 0.4, 1) infinite 0.36s; }
.ll-t4 { background: #1C9BD6; animation: tile-leap 1.6s cubic-bezier(0.3, 0.7, 0.4, 1) infinite 0.54s; }

@keyframes tile-leap {
  0% {
    opacity: 0;
    transform: translate(-10px, 28px) scale(0.8);
  }
  20% {
    opacity: 1;
    transform: translate(-3px, -14px) scale(1.04);
  }
  36% {
    opacity: 1;
    transform: translate(0, 0) scale(1.06, 0.92);
  }
  44%, 76% {
    opacity: 1;
    transform: translate(0, 0) scale(1);
  }
  92%, 100% {
    opacity: 0;
    transform: translate(0, 6px) scale(0.92);
  }
}

/* Owner 2026-11-30: no blank white card with four bright tiles while the game loads. The cover stays (it is the
   game's own first screen, so nothing jumps), and the Play pill itself turns into a shimmering "Loading" pill.
   The loader text stays for screen readers only. */
.player-frame[data-gf-state="loading"] > [data-gf-cover][hidden] {
  display: block !important; /* the engine's base style has [hidden] { display: none !important } */
  pointer-events: none;
}

.player-frame[data-gf-state="loading"] iframe {
  visibility: hidden;
}

.player-frame[data-gf-state="loading"] .player-loading {
  background: transparent;
  pointer-events: none;
}

.player-frame[data-gf-state="loading"] .leap-loader {
  display: none;
}

.player-frame[data-gf-state="loading"] .loading-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.player-frame[data-gf-state="loading"] .play-btn > * {
  display: none;
}

.player-frame[data-gf-state="loading"] .play-btn::after {
  content: "Loading";
}

.player-frame[data-gf-state="loading"] .play-btn {
  background: linear-gradient(90deg, #F25F7A, #9B5DE5 25%, #5B6CF0 50%, #9B5DE5 75%, #F25F7A);
  background-size: 200% 100%;
  animation: pill-shimmer 1.4s linear infinite;
}

@keyframes pill-shimmer {
  from { background-position: 0 0; }
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .player-frame[data-gf-state="loading"] .play-btn { animation: none; }
}

.loading-label {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

/* Pages with the game are stacked at every width: the game card (with the page's H1 in its toolbar) centered, the
   text below. From 520px the card is 460px at most (close to the game's 370px column); from 900px it takes the full
   content width (772px), so the game frame is 770px wide and the game switches to its desktop layout (round 16: the
   board centered, the tray under it as two wide rows), short enough for the whole card to show under the site header
   on a 1280x800 screen. */
@media (min-width: 520px) {
  .stage-section {
    max-width: 460px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 900px) {
  .stage-section {
    max-width: none;
  }

  .player-frame {
    min-height: var(--player-height, 617px);
  }
}

/* Guide sections */
.guide-section {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.guide-section h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.hue-mark {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--h, #111111);
  flex-shrink: 0;
}

.guide-section p {
  margin: 0 0 12px;
  color: #27272a;
  max-width: 68ch;
}

.guide-section p:last-child {
  margin-bottom: 0;
}

/* Tile bullet list */
.tile-list {
  list-style: none;
  margin: 12px 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 68ch;
}

.tile-list li {
  position: relative;
  padding-left: 20px;
  color: #27272a;
}

.tile-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
}

.tile-list li:nth-child(4n+1)::before { background: #F25F7A; }
.tile-list li:nth-child(4n+2)::before { background: #F59F00; }
.tile-list li:nth-child(4n+3)::before { background: #3FBF8F; }
.tile-list li:nth-child(4n+4)::before { background: #1C9BD6; }

/* Clean hairline tables */
.table-wrap {
  margin: 14px 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  text-align: left;
}

.spec-table th,
.spec-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.spec-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
  font-weight: 600;
}

.spec-table td {
  color: #27272a;
}

/* Quick answers grid */
.qa-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 14px 0 0;
}

.qa-item dt {
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 4px;
}

.qa-item dd {
  margin: 0;
  font-size: 15px;
  color: #27272a;
}

/* FAQ accordion */
.faq-list {
  display: grid;
  border-top: 1px solid var(--line);
  margin-top: 14px;
}

.faq-item {
  border-bottom: 1px solid var(--line);
}

.faq-item summary {
  position: relative;
  list-style: none;
  padding: 14px 28px 14px 0;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 400;
  color: var(--subtle);
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  padding: 0 0 16px;
  margin: 0;
  font-size: 15px;
  color: #27272a;
  max-width: 68ch;
}

/* Comments */
.comments-list {
  margin: 12px 0 20px;
}

.comments-list[data-gf-empty]::before {
  content: "No comments yet. Share a tip or let other players know how today's board went.";
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.comment-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.comment-name {
  font-size: 14px;
  font-weight: 650;
}

.comment-time {
  font-size: 12px;
  color: var(--subtle);
}

.comment-text {
  margin: 0 0 8px;
  font-size: 15px;
  color: #27272a;
  white-space: pre-wrap;
}

.reply-btn {
  border: 0;
  border-radius: var(--radius);
  padding: 5px 10px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.reply-btn:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.comment-replies {
  margin-left: 18px;
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.comment-form {
  display: grid;
  gap: 12px;
  max-width: 560px;
}

.form-row {
  display: grid;
  gap: 5px;
}

.form-row label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.form-row input,
.form-row textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d4d7de;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
}

.form-row input:focus,
.form-row textarea:focus {
  outline: 2px solid #1C9BD6;
  outline-offset: 1px;
  border-color: #1C9BD6;
}

.form-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.submit-btn {
  min-height: 44px;
  padding: 10px 18px;
  border: 0;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.14s ease;
}

.submit-btn:hover {
  background: #27272a;
}

.form-msg {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

/* Footer: a thin strip of the 8 logo colors as its top edge, brand block, two link columns (side by side on
   phones, right of the brand from 720px), bottom bar */
.site-footer {
  margin-top: 24px;
  background: var(--bg);
}

.footer-hue-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  height: 4px;
}

.footer-hue-strip span {
  display: block;
  height: 100%;
}

.footer-hue-strip span:nth-child(1) { background: #F25F7A; }
.footer-hue-strip span:nth-child(2) { background: #FF7A59; }
.footer-hue-strip span:nth-child(3) { background: #F59F00; }
.footer-hue-strip span:nth-child(4) { background: #74B816; }
.footer-hue-strip span:nth-child(5) { background: #3FBF8F; }
.footer-hue-strip span:nth-child(6) { background: #1C9BD6; }
.footer-hue-strip span:nth-child(7) { background: #5B6CF0; }
.footer-hue-strip span:nth-child(8) { background: #9B5DE5; }

.footer-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 32px 0 28px;
}

.footer-logo {
  display: inline-flex;
  text-decoration: none;
  color: var(--ink);
}

.footer-logo img {
  height: 32px;
  width: auto;
}

.footer-tagline {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.footer-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
}

.footer-heading {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--subtle);
}

.footer-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-col a {
  display: flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 0;
  font-size: 14px;
  line-height: 1.35;
  color: var(--muted);
  text-decoration: none;
}

.footer-col a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #22A6B3;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 16px 0 24px;
}

.footer-bottom p {
  margin: 0;
  font-size: 13px;
  color: var(--subtle);
}

@media (min-width: 720px) {
  .footer-main {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    padding: 40px 0 32px;
  }

  .footer-cols {
    grid-template-columns: repeat(2, max-content);
    gap: 64px;
  }

  .footer-col a {
    min-height: 30px;
  }
}

/* How to play at a glance (partials/howto-figure.html): the board and tray in a card, then the four steps; from
   720px the steps sit to the right of the card. Round 16: the section is #rules, where the header's and the footer's
   How to play links land (/how-to-play#rules), 16px under the top of the screen (the site header is not sticky);
   html's scroll-behavior makes it smooth, and auto under reduced motion. */
.howto {
  display: grid;
  gap: 18px;
  margin: 4px 0 36px;
  scroll-margin-top: 16px;
}

.howto-board {
  justify-self: center;
  width: 100%;
  max-width: 380px;
  padding: 14px 8px 12px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(40, 44, 90, 0.05);
}

.howto-svg {
  display: block;
  width: 100%;
  height: auto;
}

.howto-steps {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  align-content: center;
}

.howto-step {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.howto-icon {
  display: grid;
  place-items: center;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #f6f7f9;
}

.howto-icon svg {
  display: block;
}

.howto-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
}

.howto-text strong {
  display: block;
  margin-bottom: 2px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

@media (min-width: 720px) {
  .howto {
    grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
    gap: 22px;
    align-items: center;
  }
}

/* Accessible keyboard focus without hover borders */
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid #1C9BD6;
  outline-offset: 2px;
}

/* Desktop refinements */
@media (min-width: 680px) {
  .shell {
    padding: 0 24px;
  }

  .brand img {
    height: 40px;
  }

  .play-top {
    padding-top: 24px;
  }

  .card-title {
    font-size: 17px;
  }

  .qa-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px 28px;
  }

}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .ll-tile {
    animation: tile-fade 1.4s ease-in-out infinite;
  }

  @keyframes tile-fade {
    0%, 100% { opacity: 0.35; }
    50% { opacity: 1; }
  }
}
/* Comparison page: compact comparison table and list of other color games */

/* Compact comparison table: fits 390px without horizontal scroll */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 13.5px;
  line-height: 1.45;
  text-align: left;
  margin: 14px 0 16px;
}

.compare-table th,
.compare-table td {
  padding: 10px 8px 10px 0;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  overflow-wrap: break-word;
}

.compare-table th:last-child,
.compare-table td:last-child {
  padding-right: 0;
}

.compare-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--subtle);
  font-weight: 600;
}

.compare-table th.col-feature {
  width: 25%;
}

.compare-table th.col-other {
  width: 35%;
}

.compare-table th.col-leapy {
  width: 40%;
  color: var(--ink);
}

.compare-table td {
  color: #27272a;
}

.compare-table td:first-child {
  font-weight: 600;
  color: var(--ink);
}

/* Curated list of other color games */
.game-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}

.game-row {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 0 12px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.game-marker {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 3px;
  background: var(--g, #111111);
}

.game-body {
  min-width: 0;
}

.game-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  margin-bottom: 6px;
}

.game-head h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--ink);
}

.game-maker {
  font-size: 13px;
  color: var(--subtle);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 8px;
}

.meta-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.game-desc {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.55;
  color: #27272a;
  max-width: 64ch;
}

.game-fit {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  max-width: 64ch;
}

.game-fit strong {
  color: var(--ink);
  font-weight: 600;
}

/* Optional companion box: daily guess-the-color games */
.alt-box {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 8px;
  background: var(--surface);
}

.alt-box h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--ink);
}

.alt-box > p {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
}

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

.alt-list li {
  font-size: 14px;
  line-height: 1.5;
  color: #27272a;
}

.alt-list strong {
  color: var(--ink);
}

/* Independence statement */
.independence-note {
  margin: 22px 0 0;
  padding: 6px 0 6px 14px;
  border-left: 3px solid var(--line);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
  max-width: 64ch;
}

@media (min-width: 680px) {
  .compare-table {
    font-size: 14px;
  }

  .compare-table th,
  .compare-table td {
    padding: 11px 16px 11px 0;
  }

  .game-row {
    grid-template-columns: 16px 1fr;
    gap: 0 16px;
    padding: 20px 0;
  }

  .game-head {
    justify-content: flex-start;
  }
}

[data-gf-cover][hidden],[data-gf-loading][hidden] {display:none}
[data-gf-like][aria-pressed="true"],[data-gf-like][data-gf-liked] {color:#a73550;background:#ffedf1}
.reply-context,[data-gf-c-owner] {display:none}
[data-gf-replying] .reply-context,[data-gf-owner] [data-gf-c-owner] {display:inline}
[data-gf-comments][data-gf-off]::before {content:"Comments are closed."}
[data-gf-comments][data-gf-off] ~ form {display:none}
.guide h2::before {content:"";display:inline-block;width:.48em;height:.48em;border-radius:2px;margin-right:.45em;background:#3fbf8f}
.guide h2:has(.hue-mark)::before {display:none}
.guide {overflow-wrap:break-word}
.guide table {width:100%;font-size:.92em}

/* Current page in the header: a soft lavender chip, no outline */
.site-nav a[aria-current="page"],
.site-nav a[aria-current="page"]:hover {
  background: #efebfd;
  color: #4a36b8;
}

/* Page body written in Markdown: plain h2 / p / ul / table get the same look as the designed sections */
.guide > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.guide > h2:not(:first-child) {
  margin-top: 28px;
}

.guide > h2::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 3px;
  background: var(--h, #111111);
  flex-shrink: 0;
}

.guide > h2:nth-of-type(6n+1) { --h: #F25F7A; }
.guide > h2:nth-of-type(6n+2) { --h: #FF7A59; }
.guide > h2:nth-of-type(6n+3) { --h: #F59F00; }
.guide > h2:nth-of-type(6n+4) { --h: #74B816; }
.guide > h2:nth-of-type(6n+5) { --h: #3FBF8F; }
.guide > h2:nth-of-type(6n+6) { --h: #1C9BD6; }

.guide > h3 {
  margin: 20px 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

.guide > p {
  margin: 0 0 12px;
  color: #27272a;
  max-width: 68ch;
}

.guide > ul,
.guide > ol {
  list-style: none;
  margin: 12px 0 14px;
  padding: 0;
  display: grid;
  gap: 10px;
  max-width: 68ch;
}

.guide > ul > li,
.guide > ol > li {
  position: relative;
  padding-left: 20px;
  color: #27272a;
}

.guide > ul > li::before,
.guide > ol > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
}

.guide > ol {
  counter-reset: step;
}

.guide > ol > li {
  counter-increment: step;
  padding-left: 28px;
}

.guide > ol > li::before {
  content: counter(step);
  top: 2px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 12px;
  font-weight: 650;
  line-height: 20px;
  text-align: center;
}

.guide > ul > li:nth-child(4n+1)::before { background: #F25F7A; }
.guide > ul > li:nth-child(4n+2)::before { background: #F59F00; }
.guide > ul > li:nth-child(4n+3)::before { background: #3FBF8F; }
.guide > ul > li:nth-child(4n+4)::before { background: #1C9BD6; }

.guide a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: #1C9BD6;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.guide a:hover {
  text-decoration-color: var(--ink);
}

.guide .table-wrap {
  max-width: 100%;
}

.updated {
  margin: 24px 0 0;
  font-size: 13px;
  color: var(--subtle);
}

/* FAQ and comments that follow the body keep the designed section look */
.guide + .guide-section,
.faq-section {
  margin-top: 0;
}

/* Comments: engine states */
.comment-owner {
  display: none;
  padding: 1px 6px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

[data-gf-owner] > .comment-meta .comment-owner {
  display: inline-block;
}

.comment-to {
  font-size: 12px;
  color: var(--subtle);
}

.comment-to:empty {
  display: none;
}

.reply-context {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

[data-gf-replying] .reply-context {
  display: flex;
}

.comments-list[data-gf-off]::before {
  content: "Comments are closed on this page.";
  display: block;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}

.comments-section:has([data-gf-off]) .comment-form {
  display: none;
}

/* Plain pages (about, contact, privacy, terms) and the not-found page */
.page-body {
  padding: 18px 0 8px;
}

.page-body h1 {
  margin: 0 0 16px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 750;
}

.page-body > h2 {
  margin: 28px 0 10px;
  font-size: 19px;
  line-height: 1.3;
}

.page-body > p,
.page-body > ul > li {
  color: #27272a;
  max-width: 68ch;
}

.page-body > ul {
  padding-left: 20px;
}

.page-body a {
  color: var(--ink);
  text-decoration-color: #1C9BD6;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* Article pages (the solving guide): call to action, generated board figures, FAQ after the body */
.page-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin: 18px 0 8px;
}

.page-body .cta-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
}

.page-body .cta-btn:hover {
  background: #2a2a2e;
}

.tip-figure {
  margin: 18px 0 22px;
}

.tip-figure img {
  display: block;
  margin: 0 auto;
  width: 100%;
  max-width: 360px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tip-figure figcaption {
  margin: 8px auto 0;
  max-width: 360px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.page-faq {
  margin-top: 12px;
}

@media (min-width: 680px) {
  .page-body h1 {
    font-size: 32px;
  }
}
