:root {
  --bg: #f2ede4;
  --bg-alt: #e7edf1;
  --panel: rgba(255, 251, 245, 0.7);
  --panel-strong: rgba(255, 251, 245, 0.88);
  --ink: #18212c;
  --muted: #5b6774;
  --line: rgba(24, 33, 44, 0.14);
  --line-strong: rgba(24, 33, 44, 0.24);
  --tour: #7892a8;
  --route: #e1a33c;
  --snake: #1d8c69;
  --apple: #df5a48;
  --reserve: #d7bd84;
  --button-bg: rgba(24, 33, 44, 0.04);
  --shadow: 0 24px 60px rgba(72, 78, 92, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at top left, rgba(225, 163, 60, 0.2), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(29, 140, 105, 0.16), transparent 28%),
    linear-gradient(135deg, var(--bg) 0%, var(--bg-alt) 100%);
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", sans-serif;
}

button,
input,
output {
  font: inherit;
}

.shell {
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 36px;
}

.shell-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.shell-copy-block {
  min-width: 0;
}

.shell-copy {
  margin: 0;
  max-width: 38rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.repo-link {
  display: grid;
  flex-shrink: 0;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding-left: 18px;
  border-left: 1px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  transition:
    border-color 0.18s ease,
    color 0.18s ease;
}

.repo-link:hover {
  border-color: var(--line-strong);
  color: var(--ink);
}

.repo-link-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.repo-link-value {
  font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
  font-size: 0.82rem;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, serif;
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

h2 {
  font-size: 1.45rem;
}

.board-caption {
  color: var(--muted);
  line-height: 1.55;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 18px;
  align-items: start;
}

.rail,
.board-stage {
  min-width: 0;
}

.section-block,
.board-stage {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.section-block {
  padding: 18px 18px 20px;
}

.rail {
  display: grid;
  gap: 18px;
}

.section-head {
  margin-bottom: 16px;
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.field span {
  font-weight: 600;
}

.field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.66);
  color: var(--ink);
  padding: 12px 14px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--snake);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.button {
  flex: 1 1 120px;
  border: 1px solid var(--line);
  background: var(--button-bg);
  color: var(--ink);
  padding: 11px 14px;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(24, 33, 44, 0.38);
  background: rgba(255, 255, 255, 0.7);
}

.button:disabled {
  cursor: default;
  opacity: 0.45;
}

.button-primary {
  background: var(--ink);
  color: #f9f6ef;
}

.button-primary:hover:not(:disabled) {
  background: #101720;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
  margin: 0;
}

.stats-grid div {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.stats-grid dt {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.stats-grid dd {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
}

.board-stage {
  padding: 18px;
  animation: rise-in 0.8s ease both;
  grid-column: 1;
  grid-row: 1 / span 2;
}

.board-meta {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 16px;
}

.board-caption {
  max-width: 22rem;
  margin: 0;
}

.board-frame {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.44)),
    radial-gradient(circle at top left, rgba(120, 146, 168, 0.08), transparent 40%);
  border: 1px solid var(--line);
  overflow: hidden;
  aspect-ratio: 7 / 5;
}

.board-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.93rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend-swatch {
  width: 26px;
  height: 10px;
  border-radius: 999px;
}

.legend-swatch-tour {
  background: var(--tour);
}

.legend-swatch-route {
  background: var(--route);
}

.legend-swatch-snake {
  background: var(--snake);
}

.legend-swatch-apple {
  background: var(--apple);
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .board-stage {
    grid-row: auto;
  }
}

@media (max-width: 640px) {
  .shell {
    width: min(100% - 24px, 1440px);
    padding-top: 18px;
  }

  .shell-bar {
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
  }

  .repo-link {
    flex-shrink: 1;
    width: 100%;
    padding-left: 0;
    padding-top: 14px;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .board-stage,
  .section-block {
    padding: 16px;
  }

  .board-meta {
    flex-direction: column;
    align-items: start;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
