/* Общее оформление небольших игр платформы: башня, кликер, гонки, космо-раннер */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #070b16;
  color: #e8ecff;
  font-family: 'Segoe UI', Arial, sans-serif;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@supports (height: 100dvh) { html, body { height: 100dvh; } }

button { font-family: inherit; color: inherit; cursor: pointer; border: none; background: none; }
.hidden { display: none !important; }

#wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas { display: block; touch-action: none; }

/* Полоска сверху: счёт, рекорд и выход */
.bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  pointer-events: none;
}

.chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  background: rgba(10, 14, 26, .75);
  border: 1px solid #2a3350;
}

.chip.gold { color: #ffd93b; border-color: rgba(255, 217, 59, .35); }
.chip.acc { color: #4fc3ff; }
.bar .spacer { margin-left: auto; }

/* Бак космо-раннера: краснеет и мигает, когда бензин на исходе */
.chip.fuel { color: #5fe08a; border-color: rgba(95, 224, 138, .4); }
.chip.fuel.low { color: #ff8f8f; border-color: rgba(255, 107, 107, .6); animation: fuel-blink .6s infinite alternate; }

@keyframes fuel-blink { to { background: rgba(255, 60, 60, .28); } }

/* Переключатель «один / вдвоём» — единственная нажимаемая плашка в полоске */
.chip.mode { pointer-events: auto; }
.chip.mode:hover { filter: brightness(1.3); }
.chip.mode.duo { color: #7dff5e; border-color: rgba(125, 255, 94, .5); }

.exit {
  pointer-events: auto;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  color: #ffb4b4;
  background: rgba(255, 107, 107, .14);
  border: 1px solid rgba(255, 107, 107, .5);
}

.exit:hover { background: rgba(255, 107, 107, .26); }

/* Экран поражения / победы */
.over {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 20px;
  background: rgba(4, 7, 16, .8);
}

.over h1 {
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 4px;
  text-shadow: 0 0 24px rgba(79, 195, 255, .7);
}

.over .big { font-size: 58px; font-weight: 900; color: #4fc3ff; }
.over p { color: #8b93ad; font-size: 14px; text-align: center; }

.btn {
  height: 46px;
  padding: 0 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  background: #1b2338;
  border: 1px solid #2a3350;
}

.btn:hover { filter: brightness(1.2); }
.btn.go { color: #04121b; background: linear-gradient(135deg, #5fe08a, #41e05e); border-color: transparent; }

.hint {
  position: fixed;
  bottom: 14px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 12px;
  color: #b7c0d8;
  background: rgba(10, 14, 26, .6);
  text-align: center;
}

.combo {
  position: fixed;
  top: 54px; left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  font-weight: 900;
  color: #ffd93b;
  text-shadow: 0 0 12px rgba(0, 0, 0, .8);
}

@media (max-width: 640px) {
  .over h1 { font-size: 27px; }
  .over .big { font-size: 42px; }
}
