:root { color-scheme: light; --paper: #f5f6fa; --ink: #000; --red: #e84118; --muted: #63656c; font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Segoe UI', sans-serif; color: var(--ink); background: var(--paper); }
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button { font: inherit; cursor: pointer; color: inherit; border: 0; background: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:disabled { cursor: default; opacity: .25; }
button:focus-visible { outline: 2px solid var(--red); outline-offset: 5px; border-radius: 4px; }
button:not(:disabled):hover { color: var(--red); }
button[hidden] { display: none; }
.game { width: min(100%, 760px); min-height: 100svh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 36px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 0 20px; border-bottom: 1px solid #00000012; }
h1 { font-size: 27px; font-weight: 400; letter-spacing: -.6px; margin: 0; } h1 span { color: var(--red); }
.icon-button { width: 44px; height: 44px; display: inline-grid; place-items: center; font-size: 30px; }
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.help-button { font-size: 21px; justify-self: end; }
.puzzles-button { display: inline-flex; align-items: center; gap: 7px; justify-self: start; min-height: 44px; padding: 0 5px; font-size: 14px; }
.puzzles-button svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.4; }
.puzzle { flex: 1; display: flex; flex-direction: column; }
.puzzle-top { display: flex; align-items: center; justify-content: space-between; padding: 21px 12px 0; min-height: 130px; }
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); margin: 0 0 10px; }
h2 { font-size: 22px; font-weight: 400; margin: 0; }
#moves { font-size: 14px; color: var(--muted); margin: 9px 0 0; font-variant-numeric: tabular-nums; }
.target { text-align: center; width: 114px; flex-shrink: 0; }
.target .eyebrow { display: block; margin-bottom: 0; font-size: 10px; }
#target { width: 104px; height: 104px; overflow: visible; }
#instruction { text-align: center; color: #55565d; font-size: 16px; margin: 12px 0 0; min-height: 22px; }
.board-wrap { width: min(100%, 480px, 50svh); aspect-ratio: 1; position: relative; margin: auto; flex: none; }
#board { width: 100%; height: 100%; display: block; overflow: visible; }
#gap-controls { position: absolute; inset: 0; pointer-events: none; }
.gap { position: absolute; width: 44px; height: 44px; transform: translate(-50%, -50%); border-radius: 50%; padding: 0; pointer-events: auto; display: grid; place-items: center; }
.gap::after { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 3px var(--paper); opacity: 0; transition: opacity .15s; }
.gap:focus-visible { outline: 1px solid var(--red); }
.gap:focus-visible::after { opacity: 1; }
@media (hover: hover) { .gap:not(:disabled):hover::after { opacity: 1; } }
.result { min-height: 57px; display: flex; align-items: center; justify-content: center; gap: 25px; flex-wrap: wrap; padding: 6px 0; }
.result-label { color: var(--muted); font-size: 17px; }
.text-button { font-size: 17px; min-height: 44px; border-bottom: 1px solid #00000024; padding: 5px 0; }
.text-button span { padding-left: 16px; }
.controls { display: flex; align-items: center; justify-content: space-between; width: min(100%, 350px); margin: 0 auto 25px; }
.labeled-button { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; padding: 4px; font-size: 12px; color: #55565d; }
.labeled-button span:first-child { color: var(--ink); font-size: 29px; line-height: 30px; font-family: system-ui, sans-serif; font-weight: 300; }
footer { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #00000012; font-size: 12px; color: var(--muted); padding-top: 6px; gap: 15px; }
.quiet-button { min-height: 40px; padding: 4px; }
.preferences { display: flex; gap: 14px; align-items: center; }
[data-view='minimal'] #level-name,
[data-view='minimal'] #moves,
[data-view='minimal'] #level-dialog .dialog-note,
[data-view='minimal'] .level-block-heading span,
[data-view='minimal'] .detailed-help,
[data-view='detailed'] .minimal-help { display: none; }
.minimal-help { position: relative; padding-right: 32px; }
.minimal-help .close { position: absolute; right: -12px; top: -14px; }
.minimal-help p { margin: 0; }
.result-label:empty { display: none; }
dialog { color: var(--ink); background: var(--paper); width: min(540px, calc(100% - 32px)); max-height: calc(100svh - 50px); padding: 27px; border: 1px solid #00000015; border-radius: 12px; box-shadow: 0 22px 90px #00000020; }
dialog::backdrop { background: #f5f6fac7; backdrop-filter: blur(7px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.dialog-heading h2 { font-size: 26px; }
dialog p { color: #55565d; line-height: 1.5; font-size: 16px; }
dialog h3 { font-size: 19px; font-weight: 400; }
dialog hr { border: 0; border-top: 1px solid #00000016; margin: 25px 0; }
.dialog-note { font-size: 13px; color: var(--muted); }
#level-grid { display: grid; gap: 25px; }
.level-block-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.level-block-heading h3 { margin: 0; font-size: 18px; }
.level-block-heading span { font-size: 12px; color: var(--muted); }
.level-block-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.level-tile { position: relative; border: 1px solid #00000018; border-radius: 7px; aspect-ratio: 1; padding: 8px; font-size: 14px; }
.level-tile svg { display: block; width: 100%; height: calc(100% - 18px); }
.level-tile.unsolved { display: grid; place-items: center; background: #e9eaee; color: #75777e; font-size: 21px; }
.level-tile.unsolved:hover { background: #e1e2e7; }
.level-tile[aria-current='true'] { border-color: var(--red); }
.level-tile .tick { position: absolute; right: 6px; top: 4px; color: var(--red); }
@media (max-width: 520px) {
  .game { padding-left: 20px; padding-right: 20px; }
  .header { padding-bottom: 10px; } h1 { font-size: 25px; }
  .puzzles-button { font-size: 13px; padding-left: 0; }
  .puzzles-button svg { display: none; }
  .puzzle-top { padding: 14px 5px 0; min-height: 116px; }
  h2 { font-size: 21px; } #instruction { font-size: 15px; margin-top: 4px; }
  .board-wrap { width: min(100%, 48svh); }
  .controls { margin-bottom: 19px; }
  .result { min-height: 58px; gap: 16px; }
  .result-label, .text-button { font-size: 16px; }
  footer { font-size: 11px; }
  dialog { padding: 20px; }
}
@media (max-height: 620px) and (min-width: 650px) {
  .game { display: grid; grid-template-columns: 1fr; padding-top: 8px; max-width: 850px; }
  .header { padding-bottom: 4px; }
  .puzzle { position: relative; padding-left: 170px; padding-right: 125px; }
  .puzzle-top { position: absolute; inset: 20px 0 auto; padding: 0; pointer-events: none; }
  .board-wrap { width: min(100%, 60svh); }
  #instruction { font-size: 13px; } .controls { margin-bottom: 8px; }
  .result { min-height: 44px; } footer { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
