:root {
  --bg: #f6f5f1;
  --fg: #18212b;
  --muted: #5f6b77;
  --line: #d3dce4;
  --ice: #ffffff;
  --ice2: #eaf2f7;
  --wall: #22303e;
  --gold: #c98a06;
  --gold-soft: #fbe7b5;
  --grey: #5b7187;
  --sel: #1d4ed8;
  --ok: #15803d;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141820;
    --fg: #e8eef3;
    --muted: #9aa5b0;
    --line: #2a3540;
    --ice: #1a232c;
    --ice2: #202c37;
    --wall: #d5e0ea;
    --gold: #f2b632;
    --gold-soft: #4a3a12;
    --grey: #8aa0b5;
    --sel: #7aa2ff;
    --ok: #4ade80;
  }
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
main {
  max-width: 440px;
  margin: 0 auto;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px;
}
header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding-bottom: 6px;
}
h1 {
  font-size: 22px;
  margin: 0;
}
h2 {
  font-size: 18px;
  margin: 14px 0 6px;
}
p {
  margin: 8px 0;
}
.muted {
  color: var(--muted);
  font-size: 14px;
}
.small {
  font-size: 12px;
}
[hidden] {
  display: none !important;
}
button {
  font: inherit;
  padding: 10px 0;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--ice);
  color: var(--fg);
  cursor: pointer;
}
button:active {
  background: var(--ice2);
}
button.primary {
  background: var(--gold);
  border-color: var(--gold);
  color: #1b1300;
  font-weight: 600;
  padding: 10px 18px;
}
#play {
  width: 100%;
  margin-top: 6px;
}

/* The worked example on the first screen. */
.example {
  margin: 10px 0;
}
.strip {
  display: grid;
  grid-template-columns: repeat(5, 40px);
  border: 3px solid var(--wall);
  border-radius: 4px;
  width: max-content;
  margin-bottom: 6px;
  background: var(--ice);
}
.sq {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--muted);
}
.sq:nth-child(even) {
  background: var(--ice2);
}
.sq.spot {
  background: radial-gradient(circle, var(--gold-soft) 0 34%, transparent 36%);
  outline: 2px dashed var(--gold);
  outline-offset: -9px;
  border-radius: 50%;
}
.pk {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grey);
}
.pk.gold {
  background: var(--gold);
}
.example figcaption {
  font-size: 14px;
  color: var(--muted);
}

/* The rink. */
.stats {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 8px 2px 6px;
}
.stats b {
  font-variant-numeric: tabular-nums;
}
#mode {
  font-size: 13px;
  color: var(--muted);
}
#mode.practice {
  color: var(--sel);
  font-weight: 600;
}
#rink {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: var(--ice);
  border: 5px solid var(--wall);
  border-radius: 6px;
  touch-action: none;
  user-select: none;
  overflow: hidden;
}
.cell {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
}
.cell.alt {
  background: var(--ice2);
}
.wall {
  position: absolute;
  background: var(--wall);
  border-radius: 3px;
}
.ring {
  position: absolute;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
}
.ring::after {
  content: "";
  width: 62%;
  height: 62%;
  border-radius: 50%;
  border: 3px dashed var(--gold);
  background: var(--gold-soft);
}
.puck {
  position: absolute;
  top: 0;
  left: 0;
  width: 12.5%;
  height: 12.5%;
  display: grid;
  place-items: center;
  transition: transform 160ms cubic-bezier(0.3, 0.7, 0.4, 1);
}
.puck::after {
  content: "";
  width: 72%;
  height: 72%;
  border-radius: 50%;
  background: var(--grey);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.25);
}
.puck.gold::after {
  background: var(--gold);
}
.puck.sel::after {
  outline: 3px solid var(--sel);
  outline-offset: 2px;
}
#rink.solved .ring::after {
  border-style: solid;
  border-color: var(--ok);
}
#rink.solved .puck.gold::after {
  box-shadow: 0 0 0 4px var(--ok), 0 0 14px 4px var(--gold);
}
.controls {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.5fr;
  gap: 6px;
  margin-top: 8px;
}
#done {
  margin-top: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--ice);
}
#done pre {
  font: 15px/1.4 ui-monospace, Menlo, Consolas, monospace;
  margin: 6px 0 10px;
  white-space: pre-wrap;
}
.row {
  display: flex;
  gap: 8px;
}
.row button {
  flex: 1;
}

/* The maker line under the game (game-kiln#144): small, the same on every sketch. */
.kiln-maker {
  margin: 0;
  padding: 12px 16px max(12px, env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.kiln-maker a {
  color: inherit;
}
