:root {
  color-scheme: light;
  --ink: #20212a;
  --muted: #667184;
  --paper: #f3efe6;
  --panel: #fffdf8;
  --line: #d8d1c3;
  --shadow: rgba(28, 26, 21, 0.16);
  --blue: #2f6f9f;
  --red: #bd4b4a;
  --green: #33785c;
  --gold: #b7802f;
  --violet: #6956a5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(32, 33, 42, 0.05) 1px, transparent 1px) 0 0 / 34px 34px,
    radial-gradient(circle at 20% 15%, rgba(183, 128, 47, 0.22), transparent 28%),
    linear-gradient(160deg, #fbf6ec 0%, #e8f1ee 52%, #efeaf6 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
a {
  font: inherit;
}

.shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 32px;
}

.top-links {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-bottom: 18px;
}

.top-links a,
button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
}

.top-links a,
button.secondary {
  background: rgba(255, 253, 248, 0.9);
  color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.hero {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.35rem, 8vw, 5.2rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  font-size: 1.08rem;
}

.lede {
  max-width: 700px;
  color: #3e4859;
  font-size: 1.05rem;
  line-height: 1.5;
}

.panel {
  border: 1px solid rgba(216, 209, 195, 0.92);
  border-radius: 8px;
  background: rgba(255, 253, 248, 0.92);
  box-shadow: 0 18px 48px var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.scoreboard div {
  border-left: 4px solid var(--gold);
  border-radius: 6px;
  background: #f8f0df;
  padding: 10px;
}

.scoreboard strong {
  display: block;
  margin-top: 3px;
  font-size: 1.35rem;
}

.play-area {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(300px, 0.92fr);
  gap: 14px;
  align-items: start;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.boards {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 14px;
}

.board-label {
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 900;
}

.grid,
.mini-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.grid {
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9f5ec;
  padding: 8px;
}

.cell {
  border-radius: 6px;
  background: #ebe4d7;
  box-shadow: inset 0 0 0 1px rgba(32, 33, 42, 0.07);
}

.cell.on {
  background: #252631;
}

.cell.miss {
  background: #e7b7ad;
}

.cell.extra {
  background: #c7d7e4;
}

.cell.hit {
  background: #2f6f9f;
}

.strips {
  display: grid;
  gap: 12px;
}

.strip {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f0;
  padding: 12px;
}

.strip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.strip-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 900;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.mini-grid {
  width: 108px;
  gap: 3px;
  padding: 5px;
  border-radius: 6px;
  background: #ede6d9;
}

.mini-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: rgba(32, 33, 42, 0.08);
}

.mini-cell.on {
  background: currentColor;
}

.shift-controls {
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  gap: 8px;
  align-items: center;
}

.shift-value {
  min-height: 42px;
  border-radius: 8px;
  background: #f1ebdf;
  display: grid;
  place-items: center;
  color: #384253;
  font-weight: 900;
}

.message {
  min-height: 24px;
  margin-top: 12px;
  color: #384253;
  font-weight: 800;
  line-height: 1.4;
}

.message.bad {
  color: var(--red);
}

.message.good {
  color: var(--green);
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 18px, 620px);
    padding-top: 10px;
  }

  .top-links {
    justify-content: stretch;
  }

  .top-links a {
    flex: 1;
    text-align: center;
  }

  .scoreboard {
    grid-template-columns: repeat(2, 1fr);
  }

  .play-area,
  .boards {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
  }
}
