.main {
  max-width: var(--content-width-wide);
}

/* ── Board layout ── */

.gb-layout {
  display: grid;
  grid-template-columns: 1fr 272px;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.5rem;
}

/* ── Canvas ── */

.gb-stage {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.gb-play {
  --gb-shade: #1f2a31;
  appearance: none;
  align-self: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 4px solid var(--gb-shade);
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 6px 0 var(--gb-shade);
  cursor: pointer;
  transition:
    transform 0.06s,
    box-shadow 0.06s;
}

.gb-play svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.gb-play[data-state="play"] .gb-icon-pause,
.gb-play[data-state="pause"] .gb-icon-play {
  display: none;
}

.gb-play:active {
  transform: translateY(6px);
  box-shadow: 0 0 0 var(--gb-shade);
}

.gb-play:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.gb-canvas-wrap {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 320px;
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
}

#gb-canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Sidebar ── */

.gb-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gb-card {
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1rem;
}

/* ── Controls ── */

.gb-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.gb-btn-row {
  display: flex;
  gap: 0.5rem;
}

.gb-btn {
  appearance: none;
  font-family: var(--ff);
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 3px;
  padding: 0.5rem 0.875rem;
  cursor: pointer;
  line-height: 1;
  transition:
    background 0.1s,
    color 0.1s,
    border-color 0.1s;
}

.gb-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.gb-btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.gb-btn-outline:hover {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.gb-slider-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.gb-slider-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gb-slider-val {
  font-family: var(--ff-mono);
  font-size: 0.8rem;
  color: var(--muted);
  white-space: nowrap;
}

.gb-checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.gb-checkbox-label input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  accent-color: var(--text);
  cursor: pointer;
}

/* ── Statistics ── */

.gb-stats {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.gb-stat-full {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gb-stat-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.75rem;
}

.gb-stat-pair > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gb-stat-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.gb-stat-value {
  font-family: var(--ff-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* ── Methodology panels ── */

.gb-methodology {
  border-top: 1px solid var(--border);
}

.gb-details {
  border-bottom: 1px solid var(--border);
}

.gb-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.875rem 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.gb-details > summary::-webkit-details-marker {
  display: none;
}

.gb-details > summary::after {
  content: "+";
  font-size: 1rem;
  line-height: 1;
  color: var(--muted);
  flex-shrink: 0;
}

.gb-details[open] > summary::after {
  content: "\2212";
}

.gb-details-body {
  padding-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--muted);
}

/* ── Responsive ── */

@media (max-width: 680px) {
  .gb-layout {
    grid-template-columns: 1fr;
  }

  .gb-canvas-wrap {
    min-height: 280px;
  }
}
