html, body {
  margin: 0;
  height: 100%;
  background: #05070d;
  overflow: hidden;
}

#stage {
  display: block;
  height: 100vh;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}

body.test #stage {
  margin: 0;
}

#test-panel {
  position: fixed;
  top: 12px;
  right: 12px;
  width: 300px;
  padding: 12px;
  border-radius: 10px;
  background: #171c28;
  color: #e8ecf5;
  font: 14px "Segoe UI", "Malgun Gothic", sans-serif;
}

#test-panel h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

#test-panel button,
#test-panel input {
  box-sizing: border-box;
  width: 100%;
  margin-bottom: 6px;
  padding: 7px;
  border: 1px solid #39435a;
  border-radius: 6px;
  background: #232a3a;
  color: inherit;
  font: inherit;
}

#test-panel button:hover {
  background: #2f3950;
}

#test-log {
  min-height: 64px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: #a9b4cc;
  font-size: 12px;
}

/* ---- Web version (play.html): the menu and result buttons sit on top of the canvas ---- */
body.play #frame {
  position: relative;
  width: min(100vw, 56.25vh);
  width: min(100vw, 56.25dvh);
  aspect-ratio: 9 / 16;
  margin: 0 auto;
}

body.play #stage {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  margin: 0;
}

body.play #ui {
  position: absolute;
  inset: 0;
  container-type: size;
  pointer-events: none;
  font-family: "Segoe UI", "Malgun Gothic", sans-serif;
}

.pp-menu[hidden],
.pp-after[hidden] {
  display: none;
}

.pp-menu {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 6, 14, 0.74);
  pointer-events: auto;
}

.pp-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.6cqh;
  box-sizing: border-box;
  width: 88cqw;
  max-height: 94cqh;
  padding: 3.4cqw;
  border-radius: 5cqw;
  background: #0a1120;
  box-shadow: 0 0 0 0.7cqw #19c9a8, 0 2cqw 6cqw rgba(0, 0, 0, 0.6);
  color: #fff;
  text-align: center;
}

.pp-card h1 {
  margin: 0;
  font: 400 10cqw/0.95 Impact, "Arial Black", sans-serif;
  color: #5ff0d0;
  letter-spacing: 0.2cqw;
  -webkit-text-stroke: 0.9cqw #06101c;
  paint-order: stroke fill;
}

.pp-sub {
  margin: 0;
  font-size: 3.4cqw;
  color: #a9b8d6;
}

.pp-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5cqw;
}

.pp-num {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 22cqw;
  line-height: 1;
}

.pp-num b {
  font: 400 12cqw/1 Impact, "Arial Black", sans-serif;
}

.pp-num span {
  font-size: 3cqw;
  color: #a9b8d6;
}

.pp-step {
  width: 13cqw;
  height: 13cqw;
  border: 0;
  border-radius: 50%;
  background: #f05cc0;
  color: #06101c;
  font: 900 8cqw/1 "Segoe UI", sans-serif;
  cursor: pointer;
}

.pp-step:disabled {
  background: #3a2a40;
  color: #6b5a72;
  cursor: default;
}

.pp-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4cqw;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  max-height: 44cqh;
  list-style: none;
}

.pp-list li {
  display: flex;
  align-items: center;
  gap: 1.2cqw;
  min-width: 0;
}

.pp-list span {
  width: 5cqw;
  font-size: 3cqw;
  color: #7f8fb0;
  text-align: right;
}

.pp-list input {
  box-sizing: border-box;
  flex: 1;
  min-width: 0;
  padding: 1.6cqw 2cqw;
  border: 1px solid #2b3a5a;
  border-radius: 2cqw;
  background: #131c32;
  color: #fff;
  font: 600 3.6cqw "Segoe UI", "Malgun Gothic", sans-serif;
}

.pp-start,
.pp-after button {
  border: 0;
  border-radius: 4cqw;
  background: #19c9a8;
  color: #06101c;
  font: 400 6cqw/1 Impact, "Arial Black", sans-serif;
  letter-spacing: 0.3cqw;
  cursor: pointer;
}

.pp-start {
  padding: 2.4cqh 0;
}

.pp-sound {
  align-self: center;
  border: 0;
  background: none;
  color: #7f8fb0;
  font-size: 3cqw;
  cursor: pointer;
}

.pp-after {
  position: absolute;
  left: 4cqw;
  right: 4cqw;
  top: 63.5cqh;
  display: flex;
  gap: 3cqw;
  pointer-events: auto;
}

.pp-after button {
  flex: 1;
  padding: 2cqh 0;
  font-size: 5cqw;
  box-shadow: 0 0.6cqw 0 #06101c, 0 1.4cqw 2.4cqw rgba(0, 0, 0, 0.45);
}

.pp-after button + button {
  background: #f05cc0;
}
