:root {
  --ink: #192238;
  --cream: #fffaf1;
  --orange: #ff7859;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: radial-gradient(circle at top, #d7f0ee, #fff7e8 60%);
  font-family: Arial, sans-serif;
  color: var(--ink);
}
.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px 16px;
}
.back {
  position: fixed;
  top: 22px;
  left: 24px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.panel {
  width: min(440px, 100%);
  padding: 22px 24px 24px;
  background: var(--cream);
  border-radius: 26px;
  text-align: center;
  box-shadow: 0 20px 60px #19223824;
}
.eyebrow {
  margin: 0;
  color: var(--orange);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
}
.panel h1 {
  margin: 6px 0;
  font-size: 30px;
}
.help {
  margin: 0 0 14px;
  color: #788096;
  font-size: 13px;
  line-height: 1.7;
}
kbd {
  display: inline-block;
  padding: 0 6px;
  border: 1px solid #c9cedb;
  border-bottom-width: 2px;
  border-radius: 5px;
  background: #fff;
  font: 700 12px Arial, sans-serif;
  color: var(--ink);
}

/* Màn chơi: giữ đúng tỉ lệ 288×512 của bản gốc */
.stage {
  width: min(100%, 340px, max(220px, calc((100vh - 230px) * 0.5625)));
  width: min(100%, 340px, max(220px, calc((100dvh - 230px) * 0.5625)));
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #4ec0ca;
  box-shadow:
    0 0 0 3px var(--ink),
    0 14px 30px #19223833;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.stage canvas {
  display: block;
  width: 100%;
  aspect-ratio: 288 / 512;
  image-rendering: pixelated;
  cursor: pointer;
  touch-action: none;
}

.controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}
.controls button {
  border: 0;
  border-radius: 10px;
  height: 40px;
  padding: 0 18px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}
.controls button[aria-pressed="false"] {
  background: #788096;
}
@media (max-width: 560px) {
  .back {
    position: static;
    display: inline-block;
    margin-bottom: 12px;
  }
  .panel {
    padding: 18px 12px;
  }
}
