*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #12101a;
  background-image:
    radial-gradient(circle at 20% 10%, #2a2140 0%, transparent 55%),
    radial-gradient(circle at 80% 90%, #3a2036 0%, transparent 55%);
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-family: 'Press Start 2P', 'Courier New', monospace;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#stage {
  position: relative;
  line-height: 0;
  box-shadow: 0 0 0 2px #2b2440, 0 12px 40px rgba(0,0,0,.55);
  border-radius: 2px;
  overflow: hidden;
}

canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  background: #ffe4d0;
}

/* ---------- Overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3%;
  padding: 6% 7%;
  text-align: center;
  line-height: 1.6;
  color: #fff6ee;
  background: linear-gradient(180deg, rgba(24,16,34,.82), rgba(48,20,50,.88));
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 5;
}

.overlay.hidden, .hidden { display: none; }

.cats {
  font-size: 6.5vmin;
  line-height: 1;
  letter-spacing: .4vmin;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,.4));
}

.title {
  margin: 0;
  font-size: 6.2vmin;
  line-height: 1.5;
  color: #ffd166;
  text-shadow: 0.5vmin 0.5vmin 0 #b03a6e, 1vmin 1vmin 0 rgba(0,0,0,.35);
  letter-spacing: .2vmin;
}

.title.small { font-size: 4.6vmin; }
.title.win { color: #ffe27a; }

.sub {
  margin: 0;
  font-size: 2.5vmin;
  line-height: 1.9;
  color: #ffd7e8;
}

.hint {
  margin: 0;
  font-size: 2.1vmin;
  line-height: 2;
  color: #b9a7d8;
}

.hint b { color: #7fe3a0; }

.blink {
  margin: 2% 0 0;
  font-size: 3vmin;
  color: #7fe3a0;
  animation: blink 1.1s steps(2, end) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.btn {
  margin-top: 2%;
  font-family: inherit;
  font-size: 2.7vmin;
  line-height: 1.4;
  color: #2a1030;
  background: #ffd166;
  border: 0;
  border-bottom: 0.9vmin solid #c98b2a;
  border-radius: 1vmin;
  padding: 2.6vmin 3.6vmin;
  cursor: pointer;
  letter-spacing: .1vmin;
}

.btn:active {
  transform: translateY(0.5vmin);
  border-bottom-width: 0.4vmin;
}

/* ---------- HUD ---------- */
#hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
}

#muteBtn {
  position: absolute;
  top: 2.5%;
  right: 3%;
  pointer-events: auto;
  font-family: inherit;
  font-size: 2.4vmin;
  width: 7vmin;
  height: 7vmin;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff2df;
  background: rgba(30,18,40,.45);
  border: 0.4vmin solid rgba(255,255,255,.28);
  border-radius: 1vmin;
  cursor: pointer;
  padding: 0;
}

#muteBtn.off { color: #8c7f9c; }
