:root {
  --bg-deep: #050510;
  --bg-panel: rgba(10, 16, 36, 0.82);
  --c-ice: #e0f7ff;
  --c-ice-dim: rgba(224, 247, 255, 0.58);
  --c-teal: #00f5e1;
  --c-teal-soft: rgba(0, 245, 225, 0.18);
  --c-sky: #7ec8e3;
  --c-fish: #ffd600;
  --c-cracked: #ff7a18;
  --c-berg: #2a3b55;
  --c-water: #0b1228;
  --glow-teal: 0 0 18px rgba(0, 245, 225, 0.55), 0 0 42px rgba(0, 245, 225, 0.2);
  --glow-sky: 0 0 18px rgba(126, 200, 227, 0.5), 0 0 40px rgba(126, 200, 227, 0.18);
  --font-display: "Orbitron", monospace;
  --font-body: "Nunito", system-ui, sans-serif;
  --radius: 20px;
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--c-ice);
  font-family: var(--font-body);
  touch-action: none;
}

.game-stage {
  position: relative;
  width: 100vw;
  height: 100vh;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.frost,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.frost {
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: screen;
}

.vignette {
  background:
    radial-gradient(circle at 50% 35%, transparent 15%, rgba(5, 5, 16, 0.78) 100%),
    radial-gradient(circle at 20% 20%, rgba(0, 245, 225, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 80%, rgba(126, 200, 227, 0.05) 0%, transparent 40%);
}

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  padding: 26px 34px;
  gap: 22px;
  pointer-events: none;
}

.hud-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.hud-block--right {
  align-items: flex-end;
}

.hud-block--center {
  align-items: center;
}

.hud-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--c-ice-dim);
}

.hud-value {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-teal);
  text-shadow: var(--glow-teal);
}

.hud-value--small {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--c-sky);
  text-shadow: var(--glow-sky);
}

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--c-ice);
  text-shadow: 0 0 18px rgba(224, 247, 255, 0.35), 0 0 36px rgba(0, 245, 225, 0.18);
}

.hud-sub {
  position: absolute;
  top: 92px;
  right: 34px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 18px;
  pointer-events: auto;
}

.hud-sub__item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}

.hud-btn {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 10px 18px;
  border: 1px solid rgba(0, 245, 225, 0.35);
  border-radius: 8px;
  background: rgba(0, 245, 225, 0.08);
  color: var(--c-ice);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.hud-btn:hover {
  background: rgba(0, 245, 225, 0.16);
  box-shadow: 0 0 18px rgba(0, 245, 225, 0.18);
}

.hud-btn:active {
  transform: scale(0.96);
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(5, 10, 26, 0.62) 0%, rgba(5, 5, 16, 0.94) 100%);
  opacity: 0;
  visibility: hidden;
  transition: opacity 380ms ease, visibility 380ms ease;
  backdrop-filter: blur(5px);
}

.overlay--active {
  opacity: 1;
  visibility: visible;
}

.overlay__panel {
  width: min(500px, 90vw);
  padding: 46px 40px;
  border: 1px solid rgba(0, 245, 225, 0.3);
  border-radius: var(--radius);
  background: var(--bg-panel);
  box-shadow: var(--glow-teal), inset 0 0 50px rgba(0, 245, 225, 0.05);
  text-align: center;
  transform: translateY(16px) scale(0.98);
  transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.overlay--active .overlay__panel {
  transform: translateY(0) scale(1);
}

.overlay__kicker {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.32em;
  color: var(--c-teal);
  text-shadow: var(--glow-teal);
  margin-bottom: 14px;
}

.overlay__title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 18px;
  color: var(--c-ice);
  text-shadow: 0 0 22px rgba(224, 247, 255, 0.28);
}

.overlay__copy {
  font-size: 17px;
  line-height: 1.5;
  color: var(--c-ice-dim);
  margin-bottom: 26px;
}

.overlay__stat {
  color: var(--c-fish);
  font-weight: 800;
  text-shadow: 0 0 12px rgba(255, 214, 0, 0.4);
}

.overlay__controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 30px;
  font-size: 13px;
  color: var(--c-ice-dim);
}

.overlay__actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

kbd {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid rgba(0, 245, 225, 0.35);
  background: rgba(0, 245, 225, 0.08);
  color: var(--c-teal);
}

.ice-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 17px 42px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(0, 245, 225, 0.18), rgba(126, 200, 227, 0.18));
  box-shadow: 0 0 0 1px rgba(0, 245, 225, 0.4), var(--glow-teal);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.ice-btn--secondary {
  background: linear-gradient(135deg, rgba(255, 122, 24, 0.14), rgba(126, 200, 227, 0.14));
  box-shadow: 0 0 0 1px rgba(255, 122, 24, 0.4), 0 0 20px rgba(255, 122, 24, 0.18);
}

.ice-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 0 0 1px rgba(0, 245, 225, 0.65), 0 0 32px rgba(0, 245, 225, 0.35);
}

.ice-btn--secondary:hover {
  box-shadow: 0 0 0 1px rgba(255, 122, 24, 0.65), 0 0 32px rgba(255, 122, 24, 0.28);
}

.ice-btn__text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: var(--c-ice);
}

@media (max-width: 640px) {
  .hud {
    padding: 18px 20px;
  }
  .hud-value {
    font-size: 28px;
  }
  .hud-value--small {
    font-size: 18px;
  }
  .logo {
    font-size: 16px;
  }
  .hud-sub {
    top: 78px;
    right: 20px;
    gap: 12px;
  }
  .hud-btn {
    padding: 8px 14px;
  }
  .overlay__title {
    font-size: 32px;
  }
  .overlay__panel {
    padding: 34px 24px;
  }
}
