.quiz-screen {
  min-height: 300px;
  padding: 18px;
  line-height: 1.3;
  color: #27306a;
  background: #fff8fd;
}

.quiz-ov {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.quiz-ov[hidden],
.quiz-play[hidden] {
  display: none;
}

.quiz-ov h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 2px;
}

.quiz-ov p {
  max-width: 440px;
  margin: 0;
}

.quiz-play {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.quiz-prompt {
  display: grid;
  justify-items: center;
  gap: 10px;
  text-align: center;
  font-weight: 700;
}

.quiz-prompt p {
  margin: 0;
}

.qd {
  display: grid;
  grid-template-columns: repeat(4, 34px);
  gap: 0;
  padding: 4px;
  background: #fff;
  border: 4px solid #27306a;
}

.qd b {
  text-align: center;
  font-size: 13px;
  color: #3f5fd0;
}

.qd i {
  position: relative;
  height: 26px;
  border-right: 3px solid #27306a;
  border-bottom: 2px solid #aab6ef;
}

.qd i:nth-child(4n) {
  border-right: 3px solid transparent;
}

.qd i.dot::after {
  content: "";
  position: absolute;
  inset: 4px 8px;
  background: #5b82f5;
  border: 3px solid #27306a;
}

.qd i.dot.open::after {
  background: #ffc2dc;
  border-radius: 0;
}

.quiz-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

.quiz-choices .btn.right {
  background: #8fe08a;
}

.quiz-choices .btn.wrong {
  background: #ff9cc4;
  animation: qShake 0.3s steps(4);
}

@keyframes qShake {
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.quiz-msg {
  min-height: 20px;
  font-weight: 700;
}

#metroBtn.flash {
  background: #ffe3ef;
}

.piano-wrap {
  display: grid;
  gap: 16px;
}

.piano-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.piano-modes button {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  color: #27306a;
  background: #fff;
  border: 4px solid #27306a;
  box-shadow: 4px 4px 0 #27306a;
  padding: 6px 14px;
  cursor: pointer;
}

.piano-modes button.on {
  background: #ffc2dc;
}

.piano-modes button:active {
  box-shadow: 0 0 0 #27306a;
  translate: 4px 4px;
}

.piano-panel {
  display: grid;
  gap: 12px;
  padding: 14px;
  color: #27306a;
  background: #fff;
  border: 5px solid #27306a;
  box-shadow: 8px 8px 0 #27306a;
}

.piano-panel[hidden] {
  display: none;
}

.pp-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 14px;
}

.pp-row .ctl {
  min-width: 120px;
}

.pp-info {
  margin: 0;
  font-size: 15px;
  line-height: 1.35;
  color: #4a5499;
}

.pp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-weight: 700;
  letter-spacing: 1px;
}

.pp-stats b {
  color: #d04a7c;
}

.chord-pads {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chord-pads button,
.pp-btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  color: #27306a;
  background: #eaf0ff;
  border: 3px solid #27306a;
  box-shadow: 3px 3px 0 #27306a;
  padding: 6px 12px;
  cursor: pointer;
}

.chord-pads button:active,
.pp-btn:active {
  background: #ffc2dc;
  box-shadow: 0 0 0 #27306a;
  translate: 3px 3px;
}

.pp-btn.on {
  background: #ffc2dc;
}

.pp-btn.rec.on {
  background: #ff7aa8;
  color: #fff;
}

.piano-board {
  position: relative;
  height: 210px;
  padding: 8px 8px 0;
  background: #27306a;
  border: 5px solid #27306a;
  box-shadow: 8px 8px 0 #27306a;
  touch-action: none;
  user-select: none;
}

.pk-whites {
  position: relative;
  display: flex;
  height: 100%;
}

.pk {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  font-family: "Pixelify Sans", monospace;
  font-weight: 700;
  font-size: 13px;
  background: #ffffff;
  color: #5b6ac0;
  border: 3px solid #27306a;
  border-top: 0;
  cursor: pointer;
  transition: background 0.05s steps(2);
}

.pk small {
  position: absolute;
  bottom: 28px;
  font-size: 11px;
  color: #aab6ef;
}

.pk.black {
  position: absolute;
  top: 0;
  z-index: 2;
  flex: none;
  width: 5.4%;
  height: 62%;
  padding-bottom: 6px;
  margin-left: -2.7%;
  color: #cfd8ff;
  background: #27306a;
  border: 3px solid #0f1440;
  border-top: 0;
}

.pk.black small {
  bottom: 22px;
  color: #8da0ee;
}

.pk.down {
  background: #ffc2dc;
}

.pk.black.down {
  background: #5b82f5;
}

.pk.target {
  background: #fff3b8;
  animation: pkTarget 0.5s steps(2) infinite;
}

.pk.black.target {
  background: #d4a900;
}

.pk.wrong {
  animation: qShake 0.25s steps(4);
  background: #ff9cc4;
}

@keyframes pkTarget {
  50% { background: #ffe27a; }
}

.pk.ok {
  background: #8fe08a;
}

.rush-screen {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  border: 5px solid #27306a;
  box-shadow: 8px 8px 0 #27306a;
  background: #0f1440;
  line-height: 0;
}

.rush-screen canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: none;
}

.rush-ov {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  padding: 14px;
  text-align: center;
  line-height: 1.3;
  color: #fff;
  background: rgba(15, 20, 64, 0.88);
}

.rush-ov[hidden] {
  display: none;
}

.rush-ov h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: 2px;
}

.rush-ov p {
  margin: 0;
  max-width: 380px;
}

@media (max-width: 720px) {
  .piano-board {
    height: 170px;
    padding: 6px 6px 0;
  }

  .pk small {
    display: none;
  }

  .pk {
    font-size: 10px;
  }

  .quiz-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
