.game-page {
  min-height: 100svh;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  background: #05070c;
  color: #ffffff;
}

.game-page .site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 8;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(5, 7, 12, 0.62);
  color: #ffffff;
}

.game-page .brand,
.game-page nav a {
  color: #ffffff;
}

.game-shell {
  width: 100vw;
  min-height: 100svh;
  margin: 0;
  padding: 0;
  background: #05070c;
}

.game-stage {
  position: relative;
  width: 100vw;
  height: 100svh;
  overflow: hidden;
  isolation: isolate;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  background: #05070c;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.game-hud {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr;
  pointer-events: none;
  padding: 92px 24px 24px;
}

.hud-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, 100%);
  margin: 0 auto;
}

.hud-topline > div,
.hud-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(5, 7, 12, 0.56);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(18px);
}

.hud-topline > div:first-child {
  min-width: 220px;
  padding: 12px 14px;
}

.hud-kicker,
.hud-card p:first-child {
  margin: 0 0 4px;
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hud-topline strong {
  display: block;
  color: #ffffff;
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.05;
}

.hud-progress {
  display: grid;
  gap: 8px;
  min-width: 210px;
  padding: 12px 14px;
}

.hud-progress span {
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-align: right;
}

.hud-progress-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
}

.hud-progress-track i {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f4bf45, #e65f3f, #8bd3ff);
  transition: width 260ms ease;
}

.hud-card {
  align-self: end;
  width: min(460px, 100%);
  margin: 0 auto 0 0;
  padding: clamp(16px, 2.8vw, 24px);
}

.hud-card h1 {
  max-width: none;
  margin-bottom: 10px;
  color: #ffffff;
  font-size: clamp(2rem, 5.4vw, 4rem);
  line-height: 0.92;
}

.hud-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-weight: 650;
  line-height: 1.45;
}

.hud-card ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.hud-card li {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.82rem;
  font-weight: 850;
  padding: 0.42rem 0.62rem;
}

.touch-controls {
  position: absolute;
  right: 16px;
  bottom: 16px;
  left: 16px;
  z-index: 3;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}

.touch-cluster {
  display: flex;
  gap: 0.55rem;
}

.action-controls {
  justify-content: flex-end;
}

.touch-button {
  display: grid;
  place-items: center;
  min-width: 4.8rem;
  min-height: 3.35rem;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.38), transparent 28%),
    rgba(255, 255, 255, 0.16);
  color: #ffffff;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  font: 900 1.05rem/1 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  touch-action: none;
  backdrop-filter: blur(16px);
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.touch-button:active,
.touch-button.is-pressed {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.jump-button,
.dpad-button {
  min-width: 4.9rem;
  min-height: 4.9rem;
  font-size: 2rem;
}

.jump-button {
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.52), transparent 28%),
    rgba(244, 191, 69, 0.52);
}

.start-button {
  min-width: 5.2rem;
  background:
    radial-gradient(circle at 34% 24%, rgba(255, 255, 255, 0.5), transparent 28%),
    rgba(109, 78, 162, 0.52);
  font-size: 0.78rem;
}

:fullscreen .game-page .site-header,
:fullscreen .site-header {
  display: none;
}

:fullscreen .game-hud {
  padding-top: 24px;
}

@media (max-width: 760px), (pointer: coarse) {
  html:has(.game-page),
  body.game-page {
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
  }

  .game-page {
    position: fixed;
    inset: 0;
    overflow: hidden;
  }

  .game-page .site-header {
    display: none;
  }

  .game-stage,
  .game-shell {
    width: 100vw;
    height: 100dvh;
    min-height: 100dvh;
  }

  .game-hud {
    padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) calc(96px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  }

  .hud-topline {
    align-items: stretch;
  }

  .hud-topline > div:first-child {
    min-width: 0;
  }

  .hud-progress {
    min-width: 112px;
  }

  .hud-card {
    width: min(100%, 390px);
    margin-right: auto;
  }

  .hud-card h1 {
    font-size: clamp(1.8rem, 9vw, 3rem);
  }

  .touch-controls {
    display: grid;
    bottom: max(12px, env(safe-area-inset-bottom));
  }

  :fullscreen .touch-controls {
    display: grid;
  }
}

@media (max-width: 420px) {
  .hud-topline {
    gap: 8px;
  }

  .hud-topline > div,
  .hud-card {
    border-radius: 7px;
  }

  .hud-progress {
    padding: 10px;
  }

  .hud-card {
    padding: 14px;
  }

  .hud-card li {
    font-size: 0.76rem;
  }

  .touch-controls {
    gap: 0.5rem;
  }

  .touch-cluster {
    gap: 0.45rem;
  }

  .touch-button {
    min-width: 3.9rem;
    min-height: 3.9rem;
  }

  .start-button {
    min-width: 4.6rem;
    min-height: 3.3rem;
    font-size: 0.7rem;
  }

  .jump-button,
  .dpad-button {
    font-size: 1.8rem;
  }
}
