/* Тюлень-метатель — стиль страницы. Вся графика игры рисуется на canvas
   прямоугольниками; здесь только раскладка, шрифты HUD и оверлеев. */

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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a1626;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  font-family: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

.hidden { display: none !important; }

/* ---------- верхняя панель ---------- */

#hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: calc(10px + env(safe-area-inset-top)) 14px 0 14px;
  pointer-events: none;
  z-index: 5;
}

#stat-record {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #cfe6ff;
  text-transform: uppercase;
}

#stat-record span {
  color: #ffd76a;
  font-size: 18px;
  margin-left: 4px;
}

#stat-extra {
  margin-top: 3px;
  font-size: 11.5px;
  color: #7f9cbd;
  letter-spacing: 0.03em;
}

#save-status {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(10, 22, 38, 0.55);
  border: 1px solid rgba(127, 156, 189, 0.25);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  color: #9fb8d4;
}

#save-dot {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #7f9cbd;
}

#save-dot.saved   { background: #63d471; }
#save-dot.saving  { background: #ffd76a; }
#save-dot.retry   { background: #ffab5e; }
#save-dot.offline { background: #ff6a6a; }

/* ---------- текущая дистанция ---------- */

#live-dist {
  position: fixed;
  top: calc(12% + env(safe-area-inset-top));
  left: 0;
  right: 0;
  text-align: center;
  font-size: 40px;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(10, 30, 60, 0.8);
  pointer-events: none;
  z-index: 4;
  font-variant-numeric: tabular-nums;
}

#live-dist small {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #9fc4ea;
}

/* ---------- подсказка внизу ---------- */

#hint {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #b9d4ef;
  text-shadow: 0 1px 6px rgba(5, 15, 30, 0.9);
  pointer-events: none;
  z-index: 4;
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.95; }
  50%      { opacity: 0.55; }
}

/* ---------- экран результата ---------- */

#result {
  position: fixed;
  left: 50%;
  top: 34%;
  width: min(92vw, 600px);
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  z-index: 6;
  animation: pop 0.28s cubic-bezier(0.2, 1.6, 0.4, 1);
}

@keyframes pop {
  from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1);   opacity: 1; }
}

#result-record {
  display: inline-block;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 0.22em;
  color: #ffd76a;
  border: 2px solid #ffd76a;
  border-radius: 8px;
  padding: 4px 14px 4px 18px;
  margin-bottom: 10px;
  text-shadow: 0 0 18px rgba(255, 215, 106, 0.55);
  animation: shine 0.9s ease-in-out infinite alternate;
}

@keyframes shine {
  from { box-shadow: 0 0 6px rgba(255, 215, 106, 0.25); }
  to   { box-shadow: 0 0 22px rgba(255, 215, 106, 0.65); }
}

#result-dist {
  font-size: clamp(44px, 15vw, 64px);
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 3px 16px rgba(10, 30, 60, 0.9);
  font-variant-numeric: tabular-nums;
}

#result-details {
  margin-top: 6px;
  font-size: 13px;
  color: #9fc4ea;
  letter-spacing: 0.04em;
}

#result-next {
  margin-top: 22px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: #b9d4ef;
  text-transform: uppercase;
  animation: pulse 1.6s ease-in-out infinite;
}
