:root {
  color-scheme: light;
  --ink: #1e3732;
  --muted: #4d6059;
  --paper: #f4efe5;
  --panel: #fffaf0;
  --line: #d1c9b8;
  --green: #22594f;
  --accent: #af6241;
  font: 1rem/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; text-underline-offset: .2em; }
button, select { font: inherit; color: inherit; }
button, select {
  min-height: 2.75rem;
  padding: .4rem .75rem;
  border: 1px solid #aea994;
  border-radius: .6rem;
  background: #fffdf7;
}
button { cursor: pointer; font-weight: 650; }
button:disabled { opacity: .48; cursor: default; }
button:not(:disabled):hover { background: #f0eadc; }
button.primary { color: #fff; background: var(--green); border-color: var(--green); }
button.primary:hover { background: #153f37; }
:focus-visible { outline: 3px solid #a24c2d; outline-offset: 3px; }
.skip { position: absolute; inset: 0 auto auto 1rem; translate: 0 -150%; padding: .5rem; background: #fff; z-index: 3; }
.skip:focus { translate: 0; }
.wrap { width: min(100% - 2rem, 72rem); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--panel); }
.top-inner, .foot { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .65rem 1.25rem; }
.top-inner { padding-block: .65rem; }
.brand { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 750; letter-spacing: .13em; text-decoration: none; }
.brand span { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: .65rem; background: var(--ink); color: #fff9e9; letter-spacing: 0; font-size: 1rem; }
.brand b { color: #995133; }
nav { display: flex; gap: clamp(.65rem, 3vw, 1.4rem); }
nav a { font-size: .9rem; display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
nav a:hover, nav a[aria-current] { text-decoration: underline; }
.intro { padding-block: clamp(1.6rem, 5vw, 4.2rem) 1.65rem; }
.intro h1 { font: 500 clamp(2.4rem, 7.4vw, 5rem)/.99 Georgia, serif; letter-spacing: -.045em; margin: .35rem 0 .7rem; }
.intro p { margin: 0; color: var(--muted); max-width: 43rem; }
.intro .eyebrow, .foot, .cover span { font-size: .72rem; font-weight: 760; letter-spacing: .13em; text-transform: uppercase; }
.intro .eyebrow { color: #8b452c; }
.game { max-width: 54rem; }
.game .intro { padding-block: clamp(1.4rem, 3vw, 2.4rem) 1rem; }
.game .intro h1 { font-size: clamp(2.35rem, 6vw, 4.2rem); }
.foot { margin-top: 2rem; padding-block: 1.2rem; border-top: 1px solid var(--line); color: var(--muted); }
.game-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); gap: 1.2rem; }
.game-card { display: flex; flex-direction: column; text-decoration: none; border: 1px solid var(--line); border-radius: 1rem; overflow: hidden; background: var(--panel); transition: box-shadow .15s; }
.game-card:hover { box-shadow: 0 8px 25px #342b2317; }
.cover { position: relative; min-height: 9.5rem; background-color: #143f36; background-position: center; background-size: cover; }
.cover span { position: absolute; top: .8rem; left: .85rem; border-radius: 2rem; background: #fdf7e7; color: var(--ink); padding: .3rem .65rem; letter-spacing: .085em; }
.cover.arrow { background-image: radial-gradient(#ffffff32 1.4px, transparent 1.4px), url("icon.svg"); background-size: 22px 22px, auto 95%; background-repeat: repeat, no-repeat; }
.cover.paint { background-color: #ba7453; background-image: url("harbour.svg"); background-position: center 46%; }
.cover.coin { background-color: #23384c; background-image:
  radial-gradient(circle at 35% 57%, #e0a353 0 8%, #9b6330 8.4% 9.7%, transparent 10%),
  radial-gradient(circle at 50% 68%, #d48974 0 8%, #a74d3a 8.4% 9.7%, transparent 10%),
  radial-gradient(circle at 65% 55%, #8abcb0 0 8%, #4b8e7e 8.4% 9.7%, transparent 10%),
  linear-gradient(135deg, #304a62, #172f3b); }
.cover.arcade-cover { background-image: repeating-linear-gradient(140deg, #24364a 0 15px, #2e5060 15px 29px, #42676a 29px 45px); }
.cover.junior-cover { background-image: repeating-conic-gradient(from 30deg at 62% 90%, #c99b56 0 30deg, #a8654f 30deg 60deg, #52786a 60deg 90deg); }
.card-body { display: flex; flex: 1; flex-direction: column; padding: 1.15rem; }
.card-body h2 { font: 500 1.75rem/1.12 Georgia, serif; margin: 0; }
.card-body p { color: var(--muted); margin: .55rem 0 1.2rem; }
.card-body b { margin-top: auto; color: var(--green); }
.card-body b span { padding-left: .25rem; }
.install-panel { margin-top: 1.4rem; padding: 1.15rem; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .7rem 1rem; border: 1px solid var(--line); border-radius: 1rem; background: var(--panel); }
.install-panel h2 { margin: 0; font: 500 1.7rem Georgia, serif; }
.install-panel p { margin: .3rem 0; color: var(--muted); }
.install-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.app-download { display: inline-flex; align-items: center; min-height: 2.75rem; padding: .4rem .75rem;
  border-radius: .6rem; background: var(--green); color: #fff; font-weight: 650; text-decoration: none; }
.app-download:hover { background: #153f37; }
.install-panel details { flex-basis: 100%; }
.install-panel summary { cursor: pointer; font-weight: 650; }
.play-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(.65rem, 2.5vw, 1.25rem); }
.play-panel.arrows, .play-panel.coins { max-width: 42rem; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: .45rem 1rem; margin-bottom: .7rem; }
.toolbar label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; font-weight: 700; }
.toolbar select { min-width: min(11rem, 58vw); max-width: 67vw; }
.count { font-size: .9rem; font-weight: 700; color: var(--green); }
.controls, .paint-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.controls { margin-top: .65rem; }
.status { min-height: 1.45rem; margin: .65rem 0 0; color: var(--muted); }
.arrow-board, .coin-board { width: min(100%, 31rem); display: block; margin-inline: auto; }
.arrow-board {
  overflow: hidden;
  border: 1px solid #d6cdb8;
  border-radius: .85rem;
  background: radial-gradient(#d9cfbb 1.15px, transparent 1.6px) center / 15px 15px #f5efdf;
  touch-action: manipulation;
}
.arrow-piece { cursor: pointer; outline: none; }
.arrow-hit { stroke: transparent; stroke-width: .89; fill: none; pointer-events: stroke; stroke-linecap: round; stroke-linejoin: round; }
.arrow-line { stroke: var(--ink); stroke-width: .15; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.arrow-head { fill: var(--ink); pointer-events: none; }
.arrow-piece:focus-visible .arrow-line, .arrow-piece.hinted .arrow-line { stroke-width: .23; stroke: #ae4b2b; }
.arrow-piece:focus-visible .arrow-head, .arrow-piece.hinted .arrow-head { fill: #ae4b2b; }
.coin-board {
  display: grid;
  overflow: hidden;
  grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
  gap: clamp(3px, 1vw, 8px);
  padding: clamp(5px, 1.2vw, 10px);
  border-radius: .85rem;
  background: #26433d;
  touch-action: manipulation;
}
.coin-board .cell {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1;
  min-height: 0; min-width: 0; padding: 0; border-radius: .5rem;
  border: 1px solid #618178; background: #375c51;
  position: relative;
}
.coin-board .cell:hover { background: #497164; }
.coin-board .cell.wall { background: repeating-linear-gradient(-45deg, #25423a 0 4px, #2c4c43 4px 8px); }
.coin-board .cell.destination { box-shadow: inset 0 0 0 2px #f0d69e; background: #51776a; }
.coin-board .cell.jumping { z-index: 2; }
.coin-board .cell:focus-visible { z-index: 3; outline: 3px solid #ffe3a1; outline-offset: 0; }
.token {
  width: 80%; aspect-ratio: 1; border-radius: 50%; position: relative;
  display: grid; place-items: center; line-height: 1;
  color: #242218; font-size: clamp(.82rem, 3.1vw, 1.45rem);
  border: 2px solid var(--rim); box-shadow: inset 0 0 0 2px #fff6d969, 0 2px 0 1px #182c25;
  background: radial-gradient(at 42% 31%, #fff7dc66, transparent 68%) var(--coin);
}
.cell[aria-pressed="true"] .token { outline: 3px solid #fff0c5; outline-offset: 2px; }
.token.colour-0 { --coin: #e59180; --rim: #a94c3c; }
.token.colour-1 { --coin: #87cabb; --rim: #326e62; }
.token.colour-2 { --coin: #eec168; --rim: #a67229; }
.token.colour-3 { --coin: #c6a8db; --rim: #775494; }
.zoom { margin: 0; }
.zoom button { min-width: 2.75rem; }
.zoom output { min-width: 3.3rem; text-align: center; font-variant-numeric: tabular-nums; }
.palette { display: grid; grid-template-columns: repeat(auto-fit, minmax(3.05rem, 1fr)); gap: .35rem; margin-block: .65rem; }
.palette button { display: grid; grid-template-columns: auto auto; align-items: center; justify-content: center; column-gap: .25rem; line-height: 1.15; padding: .28rem .2rem; }
.palette button[aria-pressed="true"] { outline: 2px solid var(--green); outline-offset: -2px; background: #e9efe2; }
.palette .left { grid-column: span 2; font-weight: 550; color: var(--muted); font-size: .67rem; }
.palette .done .left { color: var(--green); }
.colour-chip { background: var(--swatch); width: .8rem; height: .8rem; border-radius: 50%; border: 1px solid #2422184f; }
.viewport { border: 1px solid #bcb5a5; border-radius: .65rem; overflow: auto; max-height: min(68vh, 40rem); background: #fffcf1; overscroll-behavior: contain; }
#picture-svg { width: 100%; max-width: none; display: block; height: auto; }
.region { fill: #fffdf3; fill-rule: evenodd; stroke: #fffdf3; stroke-width: .5; cursor: pointer; }
.region.ready { fill: #e1e6cf; stroke: #e1e6cf; }
.region.target { fill: #ffce81; stroke: #ffce81; }
.region.painted { fill: var(--pigment); stroke: var(--pigment); cursor: default; }
.outlines { fill: none; stroke: #62594b; stroke-opacity: .55; stroke-width: .7; pointer-events: none; }
.numbers { fill: #514c3d; font: 8.5px system-ui, sans-serif; pointer-events: none; }
@media (max-width: 38rem) {
  .wrap { width: min(100% - 1.15rem, 72rem); }
  .game-list { grid-template-columns: 1fr; }
  .cover { min-height: 7.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; transition-duration: 0s !important; }
}
