/* Волк-яйцелов — адаптивная вёрстка */

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: #17233b;
  font-family: "Comic Sans MS", "Chalkboard SE", "Segoe Print", cursive;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
}

#game-wrap {
  position: relative;
}

#game {
  display: block;
  border-radius: 12px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}

/* Кнопки-чипы поверх канваса (пауза, звук) */
.chip {
  position: absolute;
  top: 10px;
  z-index: 6;
  min-width: 52px;
  min-height: 44px;
  border-radius: 12px;
  border: 3px solid #7a4a12;
  background: #f9b233;
  color: #4a2f18;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
}

.chip:active {
  transform: scale(0.93);
}

#btn-pause {
  right: 76px;
}

#btn-mute {
  right: 14px;
}

/* Оверлеи: меню, пауза, конец игры */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 22, 44, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  border-radius: 12px;
}

.hidden {
  display: none !important;
}

.panel {
  background: #fff8e7;
  border: 5px solid #7a4a12;
  border-radius: 22px;
  padding: 26px 38px;
  text-align: center;
  max-width: min(86%, 430px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.panel h1 {
  margin: 0 0 6px;
  color: #7a4a12;
  font-size: clamp(26px, 5vw, 40px);
}

.subtitle {
  margin: 0 0 18px;
  color: #a5713a;
  font-size: clamp(14px, 2.4vw, 18px);
}

.btn {
  display: block;
  width: 100%;
  margin: 10px 0;
  padding: 12px 20px;
  min-height: 52px;
  border-radius: 16px;
  border: 4px solid #7a4a12;
  background: #f9b233;
  color: #4a2f18;
  font-size: clamp(18px, 3vw, 24px);
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: transform 0.06s ease;
}

.btn:active {
  transform: scale(0.95);
}

.btn-secondary {
  background: #e8edf3;
  border-color: #6e7b8c;
  color: #3a4555;
}

.btn-note {
  display: block;
  font-size: 0.55em;
  font-weight: normal;
  opacity: 0.75;
}

.hint {
  margin: 16px 0 0;
  color: #6b7c93;
  font-size: clamp(12px, 2vw, 14px);
  line-height: 1.5;
}

.score-line {
  margin: 6px 0;
  color: #4a2f18;
  font-size: clamp(18px, 3vw, 24px);
}

.record {
  margin: 4px 0;
  color: #e84c3d;
  font-size: clamp(18px, 3vw, 26px);
  font-weight: bold;
  animation: pulse 0.8s ease-in-out infinite alternate;
}

@keyframes pulse {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.08);
  }
}

/* Подсказка для портретной ориентации телефона */
.portrait-hint {
  display: none;
}

@media (orientation: portrait) and (max-width: 700px) {
  .portrait-hint {
    display: block;
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    background: #f9b233;
    color: #4a2f18;
    border: 3px solid #7a4a12;
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 13px;
    text-align: center;
    max-width: 86vw;
    pointer-events: none;
  }
}
