* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2b9fe0;
  overscroll-behavior: none;
  -ms-touch-action: none;
  font-family: "Chalkboard SE", "Comic Sans MS", "Baloo 2", "PingFang SC",
    "Microsoft YaHei", Arial, sans-serif;
}

#wrapper {
  position: fixed;
  inset: 0;
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#hud {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  display: flex;
  gap: 10px;
  z-index: 6;
}

.btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.22));
  color: #07577e;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(4, 60, 100, 0.3);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: transform 0.1s ease;
}

.btn:active {
  transform: scale(0.9);
}

#btn-sound.muted {
  color: #8fb6cc;
}

#pause-card {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  background: rgba(6, 40, 70, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 8;
}

#pause-card.show {
  display: grid;
}

.pause-box {
  width: min(320px, 82vw);
  text-align: center;
  background: linear-gradient(#ffffff, #f3f9ff);
  border-radius: 26px;
  padding: 30px 24px 26px;
  box-shadow: 0 18px 50px rgba(4, 40, 70, 0.45);
  border: 3px solid #bfe6ff;
}

.pause-box h2 {
  font-size: 34px;
  color: #0a5a86;
  margin-bottom: 22px;
  letter-spacing: 4px;
}

.pause-box button {
  display: block;
  width: 100%;
  margin: 12px 0;
  padding: 14px 0;
  font-size: 20px;
  font-weight: 800;
  font-family: inherit;
  color: #ffffff;
  border: none;
  border-radius: 60px;
  cursor: pointer;
  background: linear-gradient(#6fd3ff, #2a9ff0);
  box-shadow: 0 5px 0 #1a7cc0, 0 10px 20px rgba(20, 100, 160, 0.35);
  transition: transform 0.1s ease;
}

.pause-box button:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #1a7cc0;
}

.pause-box button.soft {
  background: linear-gradient(#ffe3b3, #ffc46b);
  box-shadow: 0 5px 0 #e59a2e, 0 10px 20px rgba(200, 130, 40, 0.3);
}

.pause-box button.plain {
  background: linear-gradient(#b9d9ee, #93bcd8);
  box-shadow: 0 5px 0 #6f9bb8;
}