:root {
  --blue: #1768d5;
  --blue-soft: rgba(23, 104, 213, 0.16);
  --red: #d23235;
  --red-soft: rgba(210, 50, 53, 0.15);
  --ink: #1d2430;
  --muted: #677386;
  --panel: #f7f8fb;
  --field: #fffdf8;
  --line: #d7c8ea;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: #eef1f5;
}

button,
select,
input {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(250px, 300px) minmax(0, 1fr);
  gap: 20px;
  padding: 20px;
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
  padding: 18px;
  background: var(--panel);
  border: 1px solid #dfe4ec;
  border-radius: 8px;
  box-shadow: 0 10px 32px rgba(29, 36, 48, 0.08);
}

.brand h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1;
}

.brand p {
  margin: 6px 0 0;
  color: var(--muted);
}

.controls {
  display: grid;
  gap: 16px;
}

fieldset {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  border: 0;
}

legend,
.select-label {
  margin-bottom: 3px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #344054;
  text-transform: uppercase;
  letter-spacing: 0;
}

label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  cursor: pointer;
}

input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #344054;
}

.select-label {
  display: grid;
  gap: 8px;
}

select {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cdd5df;
  border-radius: 6px;
}

.primary-button {
  min-height: 42px;
  color: #fff;
  background: #253246;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.primary-button:hover {
  background: #172132;
}

.status {
  display: grid;
  gap: 10px;
  margin: 0;
  padding-top: 2px;
}

.status div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid #e2e7ef;
}

dt {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

dd {
  margin: 0;
  font-weight: 800;
}

.swatch {
  width: 11px;
  height: 11px;
  display: inline-block;
  border-radius: 50%;
}

.swatch.blue {
  background: var(--blue);
}

.swatch.red {
  background: var(--red);
}

.board-wrap {
  min-width: 0;
  display: grid;
  place-items: start center;
  overflow: auto;
  padding: 2px;
}

#board {
  width: min(100%, 624px);
  aspect-ratio: 624 / 775;
  max-height: calc(100vh - 44px);
  background: var(--field);
  border: 1px solid #b8abc9;
  border-radius: 4px;
  box-shadow: 0 12px 34px rgba(29, 36, 48, 0.12);
  cursor: crosshair;
}

#board.busy {
  cursor: wait;
}

@media (max-width: 850px) {
  .app {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .side-panel {
    order: 2;
  }

  .board-wrap {
    order: 1;
    place-items: center;
  }

  #board {
    max-height: none;
  }
}
