* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #2f5e20;
  font-family: "Segoe UI", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

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

#game canvas {
  display: block;
}

/* Кнопка звука */
#btn-mute {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 20;
  width: 52px;
  height: 52px;
  border: none;
  border-radius: 50%;
  background: rgba(20, 11, 43, 0.7);
  color: #fff;
  font-size: 24px;
  cursor: pointer;
  transition: transform 0.1s ease, background 0.2s ease;
}
#btn-mute:hover { background: rgba(143, 107, 255, 0.7); transform: scale(1.08); }
#btn-mute:active { transform: scale(0.94); }

/* Оверлеи */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(59, 42, 120, 0.45), rgba(10, 6, 26, 0.85));
  backdrop-filter: blur(3px);
}
.overlay.hidden { display: none; }

.panel {
  text-align: center;
  padding: 40px 48px;
  border-radius: 24px;
  background: linear-gradient(160deg, #4a3290, #2a1c52);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(143, 107, 255, 0.4);
  color: #fff;
  max-width: 90vw;
  animation: pop-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  from { transform: scale(0.7); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

.panel h1 {
  font-size: clamp(32px, 6vw, 56px);
  margin-bottom: 12px;
  background: linear-gradient(90deg, #7CFFB2, #6bd6ff, #ff6b9d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 1px;
}

.lead { font-size: clamp(15px, 2.5vw, 20px); margin-bottom: 20px; color: #e6dcff; }

.rules {
  list-style: none;
  text-align: left;
  display: inline-block;
  margin: 0 auto 26px;
  line-height: 2;
  font-size: clamp(14px, 2.3vw, 18px);
  color: #f0ebff;
}

.score-line { font-size: clamp(22px, 4vw, 34px); margin-bottom: 8px; }
.best-line { font-size: clamp(16px, 2.8vw, 22px); margin-bottom: 26px; color: #d7c9ff; }
.score-line span, .best-line span { font-weight: 900; color: #7CFFB2; }

/* Выбор набора персонажей */
.set-select { margin: 0 auto 22px; }
.set-label {
  display: block;
  font-size: clamp(13px, 2.2vw, 16px);
  color: #d7c9ff;
  margin-bottom: 10px;
}
.set-options {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(10, 6, 26, 0.4);
}
.set-btn {
  border: none;
  cursor: pointer;
  font-size: clamp(13px, 2.2vw, 16px);
  font-weight: 700;
  color: #e6dcff;
  padding: 10px 18px;
  border-radius: 999px;
  background: transparent;
  transition: background 0.15s ease, color 0.15s ease;
}
.set-btn:hover { background: rgba(143, 107, 255, 0.25); }
.set-btn.active {
  background: linear-gradient(180deg, #9affc6, #36d98a);
  color: #1b0f33;
}

.btn {
  display: block;
  margin: 0 auto;
  border: none;
  cursor: pointer;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 800;
  color: #1b0f33;
  padding: 14px 44px;
  border-radius: 999px;
  background: linear-gradient(180deg, #9affc6, #36d98a);
  box-shadow: 0 8px 0 #1f9e63, 0 12px 24px rgba(0, 0, 0, 0.4);
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(4px); box-shadow: 0 4px 0 #1f9e63, 0 6px 12px rgba(0, 0, 0, 0.4); }
