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

:root {
  --ct-shade: #1f2a31; /* darker charcoal for the hard arcade shadow */
}

/* ── Layout ── */

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

/* ── Coin stage ── */

.ct-stage {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 320px;
  padding: 2rem 1rem 1rem;
  border: 1px solid var(--border);
  border-radius: 3px;
}

.ct-coin-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  perspective: 600px;
}

.ct-coin {
  position: relative;
  width: 140px;
  height: 140px;
  transform-style: preserve-3d;
  transition-property: transform;
  transition-timing-function: ease-out;
}

.ct-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 3rem;
  font-weight: 700;
  backface-visibility: hidden;
}

.ct-face-h {
  background: var(--text);
  color: var(--bg);
  border: 6px solid var(--ct-shade);
  box-shadow: 0 6px 0 var(--ct-shade);
}

.ct-face-t {
  background: var(--bg);
  color: var(--text);
  border: 6px solid var(--text);
  box-shadow: 0 6px 0 var(--ct-shade);
  transform: rotateY(180deg);
}

.ct-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 46px;
  align-content: flex-start;
}

.ct-chip {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-family: var(--ff-mono);
  font-size: 0.65rem;
  font-weight: 600;
}

.ct-chip-h {
  background: var(--text);
  color: var(--bg);
}

.ct-chip-t {
  background: var(--bg);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--text);
}

/* ── Sidebar ── */

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

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

/* ── Controls ── */

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

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

.ct-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;
}

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

.ct-btn-primary {
  flex: 1;
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
}

.ct-btn-primary:hover {
  background: var(--muted);
  border-color: var(--muted);
}

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

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

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

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

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

/* ── Statistics ── */

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

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

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

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

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

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

/* ── Methodology panels ── */

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

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

.ct-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;
}

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

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

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

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

.ct-play {
  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(--ct-shade);
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 6px 0 var(--ct-shade);
  cursor: pointer;
  transition:
    transform 0.06s,
    box-shadow 0.06s;
}

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

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

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

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

.ct-play:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ct-btn-grow {
  flex: 1;
}

.ct-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.ct-select {
  font-family: var(--ff);
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.4rem 0.5rem;
}

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

.ct-stat-trio {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem 0.75rem;
}

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

/* ── Charts ── */

.ct-charts {
  margin: 0 0 1.5rem;
}

.ct-chart {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0.75rem;
}

.ct-chart-title {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.ct-chart-title span {
  font-weight: 400;
  color: var(--muted);
}

.ct-chart-wrap {
  position: relative;
  height: 280px;
}

.ct-chart-wrap canvas {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── Responsive ── */

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

  .ct-stage {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-coin {
    transition: none;
  }
}

/* Wada 192: Vandyke Brown, Deep Violet / Plumbeous, Cream Yellow. */
:root { --accent: #3e301e; --secondary: #686b72; --tertiary: #f4ba69; }
.ct-face-h, .ct-chip-h { background: var(--tertiary); color: var(--accent); }
.ct-face-h { border-color: var(--accent); }
.ct-face-t { color: var(--secondary); border-color: var(--secondary); }
.ct-chip-t { color: var(--secondary); box-shadow: inset 0 0 0 1px var(--secondary); }
.ct-play { background: var(--accent); }
input[type="range"]::-webkit-slider-thumb { background: var(--secondary); }
input[type="range"]::-moz-range-thumb { background: var(--secondary); }
