@font-face {
  font-family: "Syne";
  src: url("./Syne.79bc839264c4.woff2") format("woff2");
  font-display: swap;
  font-weight: 700 800;
}

@font-face {
  font-family: "Manrope";
  src: url("./Manrope.ce093b341d9c.woff2") format("woff2");
  font-display: swap;
  font-weight: 400 800;
}

:root {
  --pine: #f0e3c2;
  --pine-deep: #e4d2a8;
  --card: #fbf5e4;
  --ink: #26211a;
  --ink-soft: #57503f;
  --chalk: #d2481f;
  --chalk-deep: #a83412;
  --layout-blue: #1e4d9b;
  --grain: #d9c491;
  --white: #fffdf6;
  --border: 3px solid var(--ink);
  color-scheme: light;
  font-family: "Manrope", system-ui, sans-serif;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--pine);
  background-image: repeating-linear-gradient(
    93deg,
    transparent 0 26px,
    rgba(122, 96, 52, 0.08) 26px 27px,
    transparent 27px 64px
  );
  line-height: 1.55;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.6rem 1rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 700;
  border-radius: 0 0 0.6rem 0.6rem;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 0;
  color: var(--white);
}

:focus-visible {
  outline: 3px solid var(--layout-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 70rem;
  margin: 0 auto;
  padding: 1rem 1.25rem 0.25rem;
}

.brand {
  font-family: "Syne", "Manrope", sans-serif;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--ink);
  font-weight: 700;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

main {
  max-width: 70rem;
  margin: 0 auto;
  padding: 0 1.25rem 3rem;
}

.eyebrow {
  font-family: "Syne", "Manrope", sans-serif;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--chalk-deep);
  margin: 0 0 0.5rem;
}

.game-hero {
  padding-top: 1rem;
}

.hero-copy {
  max-width: 44rem;
}

.hero-copy h1 {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 5.2vw + 1rem, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.01em;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.deck {
  font-size: 1.12rem;
  margin: 0 0 0.5rem;
  max-width: 38rem;
}

.trust {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
  max-width: 38rem;
}

.board-wrap {
  background: var(--card);
  border: var(--border);
  border-radius: 1rem;
  box-shadow: 7px 7px 0 rgba(38, 33, 26, 0.9);
  padding: clamp(0.6rem, 2vw, 1.25rem);
}

.board-frame {
  position: relative;
}

.board-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid var(--ink);
  border-radius: 0.55rem;
  background:
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(30, 77, 155, 0.07) 34px 35px),
    var(--pine);
  touch-action: none;
  cursor: crosshair;
}

.board-hint {
  margin: 0.7rem 0.2rem 0;
  font-weight: 700;
}

.board-status {
  min-height: 1.6em;
  margin: 0.15rem 0.2rem 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.board-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-top: 0.8rem;
}

.board-bar .spacer {
  flex: 1 1 auto;
}

button {
  font: inherit;
  font-weight: 800;
  color: var(--ink);
  background: var(--white);
  border: var(--border);
  border-radius: 0.7rem;
  padding: 0.65rem 1.1rem;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(38, 33, 26, 0.9);
}

button:hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 rgba(38, 33, 26, 0.9);
}

button:active {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 rgba(38, 33, 26, 0.9);
}

button.primary {
  background: var(--chalk);
  color: var(--white);
}

.keyboard-hint {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin: 0.7rem 0.2rem 0;
}

.result {
  margin-top: 1.25rem;
  border-top: 3px dashed var(--ink);
  padding-top: 1.25rem;
}

.result[hidden] {
  display: none;
}

.result-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-head h2 {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0;
}

.score-stamp {
  font-family: "Syne", "Manrope", sans-serif;
  font-weight: 700;
  font-size: 2.6rem;
  line-height: 1;
  color: var(--white);
  background: var(--chalk);
  border: var(--border);
  border-radius: 0.8rem;
  padding: 0.3rem 0.9rem;
  transform: rotate(-2deg);
  font-variant-numeric: tabular-nums;
}

.score-stamp small {
  font-size: 1.1rem;
}

.verdict {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.5rem;
  margin: 0.6rem 0 0.1rem;
}

.verdict-note {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}

.measure-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.7rem;
  margin: 0 0 1rem;
}

.measure-grid > div {
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 0.6rem;
  padding: 0.6rem 0.8rem;
}

.measure-grid dt {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.measure-grid dd {
  margin: 0.15rem 0 0;
  font-weight: 800;
  font-size: 1.15rem;
  font-variant-numeric: tabular-nums;
}

.best-line {
  font-weight: 700;
  margin: 0 0 1rem;
}

.best-line[hidden] {
  display: none;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.share-status {
  min-height: 1.6em;
  margin: 0.6rem 0 0;
  font-weight: 700;
}

.share-fallback {
  margin: 0.5rem 0 0;
  padding: 0.7rem 0.9rem;
  background: var(--white);
  border: 2px dashed var(--ink);
  border-radius: 0.6rem;
  font-size: 0.95rem;
}

.share-fallback[hidden] {
  display: none;
}

.method {
  margin-top: 2.5rem;
  max-width: 44rem;
}

.method h2 {
  font-family: "Manrope", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.4rem, 2.5vw + 0.8rem, 2rem);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  text-wrap: balance;
}

.method p {
  margin: 0 0 0.9rem;
}

footer {
  border-top: var(--border);
  margin-top: 2rem;
  padding-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

footer a {
  color: var(--ink);
  font-weight: 700;
}

.text-link {
  font-weight: 800;
}

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 2rem 1.25rem;
}

.error-page main {
  max-width: 34rem;
  background: var(--card);
  border: var(--border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: 7px 7px 0 rgba(38, 33, 26, 0.9);
}

[data-marker][hidden],
[data-pen][hidden] {
  display: none;
}

.stroke-line {
  fill: none;
  stroke: var(--layout-blue);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chalk-line {
  fill: none;
  stroke: var(--chalk);
  stroke-width: 4.5;
  stroke-linecap: round;
}

.chalk-line[data-drawn="true"] {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  animation: chalk-snap 0.45s ease-out forwards;
}

@keyframes chalk-snap {
  to {
    stroke-dashoffset: 0;
  }
}

.ribbon {
  stroke: none;
}

.marker-link {
  stroke: var(--ink);
  stroke-width: 2.5;
  stroke-dasharray: 7 6;
}

.marker-dot {
  fill: var(--chalk);
  stroke: var(--white);
  stroke-width: 3;
}

.peg-ring {
  fill: var(--pine-deep);
  stroke: var(--ink);
  stroke-width: 4;
}

.peg-core {
  fill: var(--chalk);
  stroke: var(--ink);
  stroke-width: 3;
}

.pen-cursor {
  fill: none;
  stroke: var(--layout-blue);
  stroke-width: 3;
}

@media (max-width: 40rem) {
  .score-stamp {
    font-size: 2rem;
  }

  .verdict {
    font-size: 1.25rem;
  }

  button {
    width: 100%;
  }

  .result-actions button {
    flex: 1 1 100%;
  }
}

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

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .chalk-line[data-drawn="true"] {
    animation: none;
    stroke-dasharray: none;
    stroke-dashoffset: 0;
  }

  button:hover,
  button:active {
    transform: none;
  }
}
