:root {
  color-scheme: light dark;
  --bg: #f4f1ea;
  --ink: #1c1915;
  --muted: #5c564c;
  --panel: #fffdf8;
  --line: #e4ddd0;
  --light: #f0d9b5;
  --dark: #b58863;
  --selected: #f6f669;
  --target: #6a8f3a;
  --accent: #2f5d3a;
  --accent-ink: #f7fff4;
  font-family: 'Source Sans 3', system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.top {
  padding-left: 7.5rem;
}

h1 {
  margin: 0;
  font-family: Outfit, system-ui, sans-serif;
  font-size: 2rem;
  letter-spacing: -0.03em;
}

.lede,
.note,
.status,
.code {
  margin: 0.4rem 0 0;
  color: var(--muted);
  line-height: 1.4;
}

.panel {
  margin-top: 1rem;
  padding: 0.9rem;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.row,
.shared-tools,
.join-form,
.promo {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: end;
}

.setup-actions,
.shared-tools,
.join-form {
  margin-top: 0.75rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  color: var(--muted);
}

input {
  font: inherit;
  color: inherit;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.6rem;
  min-width: 8rem;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.5rem 0.8rem;
  background: var(--accent);
  color: var(--accent-ink);
}

button.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.status {
  min-height: 1.4em;
  margin-top: 0.9rem;
  color: var(--ink);
  font-weight: 600;
}

.code {
  font-family: ui-monospace, monospace;
  letter-spacing: 0.08em;
}

.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  width: min(100%, 34rem);
  margin-top: 0.6rem;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid #6b4a2a;
}

.square {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0;
  background: var(--light);
  color: #1c1915;
  font-size: clamp(1.4rem, 5vw, 2.4rem);
  line-height: 1;
}

.square-dark {
  background: var(--dark);
}

.square-selected {
  background: var(--selected);
}

.square-target {
  box-shadow: inset 0 0 0 4px var(--target);
}

.promo {
  margin-top: 0.6rem;
}

.tools {
  margin-top: 0.8rem;
}

@media (max-width: 640px) {
  .top {
    padding-left: 6.25rem;
  }
}
