:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --surface: #fff;
  --ink: #182d25;
  --muted: #4c6056;
  --border: #d7dfd7;
  --forest: #174b36;
  --forest-dark: #103c2a;
  --lime: #dcf28c;
  --pale-green: #eff4e9;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1rem/1.55 var(--sans); }
a { color: var(--forest); text-underline-offset: .2em; }
button { font: inherit; }
button:enabled { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #36795a; outline-offset: 3px; }
.site-width { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }

.skip-link {
  position: absolute;
  z-index: 2;
  inset: 10px auto auto 10px;
  padding: 10px 14px;
  background: var(--surface);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.site-header { border-bottom: 1px solid var(--border); }
.header-inner { min-height: 68px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  text-decoration: none;
  font: bold 1.35rem/1 var(--serif);
  letter-spacing: -.035em;
}
.brand img { display: block; }
.nav { display: flex; align-items: center; gap: 5px; }
.nav a {
  white-space: nowrap;
  padding: 8px 13px;
  border-radius: 6px;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
}
.nav a:hover { color: var(--forest); text-decoration: underline; }
.nav a[aria-current] { background: #e4eddd; color: var(--forest-dark); text-decoration: none; }

.intro { padding-block: 38px 26px; }
.intro h1 {
  margin: 0;
  font: 400 clamp(2.5rem, 5.2vw, 4.45rem)/1.02 var(--serif);
  letter-spacing: -.057em;
  text-wrap: balance;
}
.intro p { margin: 12px 0 0; color: var(--muted); font-size: 1.05rem; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1fr) 302px; align-items: start; gap: 20px; }
.game-card, .side-card, .guide-card { border: 1px solid var(--border); background: var(--surface); border-radius: 16px; }
.game-card { overflow: hidden; box-shadow: 0 14px 35px -29px #143e2e80; }
.puzzle-header, .game-footer, .side-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.puzzle-header { min-height: 64px; padding: 12px 20px; }
.puzzle-header h2, .side-card h2 { margin: 0; line-height: 1.25; }
.puzzle-header h2 { font: 400 1.55rem/1.15 var(--serif); letter-spacing: -.035em; }
.edge-count {
  flex-shrink: 0;
  border-radius: 999px;
  background: #edf3e9;
  color: var(--forest-dark);
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 700;

  font-variant-numeric: tabular-nums;
}
.edge-count[data-solved] { background: var(--lime); }

.board {
  position: relative;
  height: clamp(315px, 36vw, 410px);
  overflow: hidden;
  isolation: isolate;
  border-block: 1px solid var(--border);
  background: radial-gradient(circle at 1px 1px, #cbd7cb 1px, transparent 1.2px) center / 19px 19px, #f2f5ee;
  touch-action: none;
  user-select: none;
}
.board canvas, .nodes { position: absolute; inset: 0; width: 100%; height: 100%; }
.board canvas, .nodes { pointer-events: none; }
.node {
  position: absolute;
  display: grid;
  place-content: center;
  width: var(--hit-size, 40px);
  height: var(--hit-size, 40px);
  padding: 0;
  border: 0;
  background: transparent;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.node::before {
  content: "";
  display: block;
  width: var(--dot-size, 16px);
  height: var(--dot-size, 16px);
  border: 3px solid #375747;
  border-radius: 50%;
  background: #fff;
}
.node:hover::before, .node:focus-visible::before { background: var(--pale-green); }
.node.is-visited::before { background: #c5df9b; border-color: var(--forest); }
.node.is-suggested::before {
  background: var(--lime);
  box-shadow: 0 0 0 4px #65885066;
}
.node.is-current::before {
  background: var(--lime);
  border-color: var(--forest-dark);
  box-shadow: 0 0 0 4px #2b69492e;
}
.node:focus-visible { z-index: 1; outline-offset: -2px; }
.noscript { margin: 20px; }

.game-footer { min-height: 74px; padding: 12px 20px; }
.feedback { margin: 0; color: var(--muted); font-size: .875rem; }
.feedback[data-kind="error"] { color: #8b352b; }
.feedback[data-kind="success"] { color: var(--forest-dark); font-weight: 700; }
.controls { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; flex-shrink: 0; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  font: 650 .85rem/1.25 var(--sans);
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
}
.button span { font-size: 1.1rem; line-height: 1; }
.button-outline { border-color: #c9d5cb; background: var(--surface); color: var(--forest-dark); }
.button-outline:hover:enabled { background: var(--pale-green); }
.button-solid { background: var(--forest); color: #fff; }
.button-solid:hover:enabled, a.button-solid:hover { background: var(--forest-dark); }
.button:disabled { background: #f7f8f5; color: #59645c; border-color: #e2e7df; }

.game-sidebar { display: grid; gap: 15px; }
.side-card { padding: 18px; }
.side-card h2 { font-size: 1rem; font-weight: 700; }
.side-card p { margin: 8px 0 0; color: var(--muted); font-size: .875rem; }
.completion { white-space: nowrap; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }

.level-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; margin-top: 15px; }
.level-button {
  min-width: 0;
  min-height: 38px;
  border: 1px solid #dbe3d8;
  border-radius: 7px;
  background: #f5f7f2;
  color: var(--ink);
  font-size: .875rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.level-button:hover { border-color: #879d8d; }
.level-button[data-complete] { background: var(--lime); border-color: #bdce85; }
.level-button[aria-current] { background: var(--forest); border-color: var(--forest); color: #fff; }
.hint-card { background: var(--pale-green); }
.hint-card .button { margin-top: 12px; }
.date-label time { margin-left: 5px; color: var(--forest-dark); font-weight: 700; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 22px; padding-bottom: 25px; }
.site-footer a { font-size: .875rem; font-weight: 650; }
.guide-card { max-width: 790px; padding: clamp(22px, 4vw, 46px); }
.guide-card h2 { margin: 26px 0 7px; font: 400 1.65rem/1.15 var(--serif); letter-spacing: -.02em; }
.guide-card h2:first-child { margin-top: 0; }
.guide-card p, .guide-card li { color: var(--muted); }
.guide-card p { margin: 0 0 10px; }
.guide-card ul { padding-left: 20px; }
.guide-card li { padding-bottom: 4px; }

@media (max-width: 980px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .game-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 560px) {
  .site-width { width: calc(100% - 28px); }
  .header-inner { min-height: 57px; }
  .brand { font-size: 1.125rem; gap: 6px; }
  .brand img { width: 27px; height: 27px; }
  .nav { gap: 1px; }
  .nav a { font-size: .8rem; padding-inline: 7px; }
  .intro { padding-block: 24px 18px; }
  .intro h1 { font-size: clamp(2.1rem, 10vw, 3.2rem); }
  .intro p { margin-top: 8px; font-size: .95rem; }
  .game-layout { gap: 14px; }
  .board { height: clamp(268px, 74vw, 350px); background-size: 16px 16px; }
  .puzzle-header { min-height: 50px; padding: 9px 12px; }
  .puzzle-header h2 { font-size: 1.3rem; }
  .game-footer { align-items: flex-start; flex-direction: column; gap: 8px; padding: 10px 12px 11px; }
  .game-sidebar { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .side-card { padding: 14px; }
  .level-button { min-height: 42px; }
}

.release-privacy { padding-block: 0 28px; }
.release-privacy summary { cursor: pointer; }
.release-privacy [hidden] { display: none; }
