* { box-sizing: border-box; }

body {
  margin: 0;
  background: #edd6ad;
  background-image:
    repeating-linear-gradient(92deg, #ad793010 0 1px, transparent 2px 6px, #fff5df4d 8px 10px, transparent 13px 20px),
    repeating-linear-gradient(89deg, #fff3d733 0 12px, #c9934320 28px, transparent 38px 67px);
  color: #222;
  font: 1rem/1.5 system-ui, sans-serif;
  text-align: center;
}

main {
  max-width: 44rem;
  margin: auto;
  padding: clamp(.5rem, 3vw, 2rem);
}

.board {
  position: relative;
  width: min(100%, 40rem);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: #303030;
  box-shadow: 0 .25rem 1.2rem #30251499;
  container-type: inline-size;
}

.pads {
  position: absolute;
  inset: 5%;
  display: grid;
  grid-template: repeat(2, 1fr) / repeat(2, 1fr);
  gap: 5cqw;
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:disabled, button[aria-disabled="true"] { cursor: default; }

.pad {
  padding: 0;
  border: 0;
}

.green { background: #00a74a; border-top-left-radius: 100%; }
.red { background: #9f1015; border-top-right-radius: 100%; }
.yellow { background: #cca300; border-bottom-left-radius: 100%; }
.blue { background: #0a4989; border-bottom-right-radius: 100%; }
.green.light { background: #13ff7c; }
.red.light { background: #ff4c4c; }
.yellow.light { background: #fed93f; }
.blue.light { background: #1c8cff; }

.controls {
  position: absolute;
  z-index: 1;
  inset: 24%;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 1.15cqw;
  border: 2.5cqw solid #303030;
  border-radius: 50%;
  background: #ebe5ed;
  font: 700 clamp(.625rem, 2.3cqw, .95rem)/1.15 system-ui, sans-serif;
  text-transform: uppercase;
}

.controls h1 {
  margin: 0;
  color: #222;
  font: 900 clamp(1.75rem, 11cqw, 5rem)/.95 Georgia, serif;
  letter-spacing: -.055em;
  text-transform: none;
}

.control-row {
  width: 78%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: .4cqw;
}

.counter, .action {
  display: grid;
  justify-items: center;
  align-content: end;
  gap: 1cqw;
}

#round {
  display: grid;
  place-items: center;
  min-width: 10cqw;
  height: 7.5cqw;
  border: .7cqw solid #242424;
  border-radius: 1.5cqw;
  background: #30080d;
  color: #ff6972;
  font: bold clamp(.8rem, 4.1cqw, 1.8rem)/1 monospace;
}

.action, #power {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #222;
  text-transform: inherit;
}

.action::before {
  content: "";
  width: 5.7cqw;
  aspect-ratio: 1;
  border: .75cqw solid #444;
  border-radius: 50%;
  background: #ff1616;
  box-shadow: 0 .35cqw .65cqw #0008;
}

#strict { position: relative; }
#strict::before { background: #ffed00; }
.action:disabled::before { filter: brightness(.73); }

#strict::after {
  content: "";
  position: absolute;
  left: 50%;
  top: -2.25cqw;
  transform: translateX(-50%);
  width: 1.4cqw;
  aspect-ratio: 1;
  border: .4cqw solid #242424;
  border-radius: 50%;
  background: #38070e;
}

#strict[aria-pressed="true"] { text-decoration: underline; }
#strict[aria-pressed="true"]::after { background: #ff3143; }

#power {
  display: flex;
  align-items: center;
  gap: 1cqw;
}

.track {
  position: relative;
  width: 8.5cqw;
  height: 4.2cqw;
  border-radius: .45cqw;
  background: #222;
}

.track::before {
  content: "";
  position: absolute;
  inset: .4cqw auto .4cqw .4cqw;
  width: 3.4cqw;
  border-radius: .35cqw;
  background: #3193de;
}

#power[aria-pressed="true"] .track::before { left: 4.7cqw; }
#power[aria-pressed="true"] span:last-child,
#power[aria-pressed="false"] span:first-child { text-decoration: underline; }

button:focus-visible {
  outline: 2px solid white;
  box-shadow: 0 0 0 4px #111;
}

.pad.light {
  box-shadow: inset 0 0 0 3px white;
}

.pad:focus-visible {
  outline-offset: -5px;
  box-shadow: inset 0 0 0 7px #111;
}

#status { min-height: 1.5em; font-weight: bold; }
.credit { font-size: .875rem; }

.scores {
  max-width: 32rem;
  margin: 1rem auto;
  padding: 1rem;
  border: 1px solid #9b754e;
  border-radius: .75rem;
  background: #fff8ec;
}

.scores h2 { margin: 0; font-size: 1.25rem; }

.scores dl, .score-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .5rem 1rem;
}

.scores dl > div { min-width: 6rem; }
.scores dd { margin: 0; font-size: 1.5rem; font-weight: bold; }
.scores p { margin: .5rem 0; }
#score-status:empty { display: none; }

.score-actions button, .score-actions select {
  min-height: 44px;
  padding: .4rem .65rem;
  border: 1px solid #634826;
  border-radius: .35rem;
  background: #fff;
  color: #222;
  font: inherit;
}

.score-actions button:disabled { background: #eee6da; color: #5c554c; }
.score-actions select:focus-visible { outline: 2px solid #222; outline-offset: 2px; }
