:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #9ed8e3;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, #9ed8e3 0%, #beeaf1 42%, #f6fbff 100%);
  overflow: hidden;
  touch-action: none;
}

.game-shell {
  position: relative;
  width: min(100vw, 520px);
  height: min(100vh, 920px);
  background: #b9e5ed;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(36, 82, 94, 0.28);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: auto;
  background: #9ed8e3;
}

.hud {
  position: absolute;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.game-shell.menu-mode .hud,
.game-shell.gameover-mode .bottom {
  opacity: 0;
  pointer-events: none;
}

.top {
  top: 14px;
}

.bottom {
  bottom: 16px;
  justify-content: center;
  gap: 12px;
}

.hud div,
.hud button,
.toast {
  border: 2px solid rgba(20, 45, 57, 0.2);
  background: rgba(255, 255, 255, 0.82);
  color: #17313b;
  box-shadow: 0 8px 18px rgba(34, 78, 92, 0.14);
  backdrop-filter: blur(12px);
}

.hud div {
  min-width: 86px;
  padding: 8px 10px;
  border-radius: 8px;
}

.label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  color: #587783;
}

strong {
  display: block;
  margin-top: 1px;
  font-size: 22px;
  line-height: 1;
}

button {
  pointer-events: auto;
  min-width: 58px;
  min-height: 48px;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

#restart {
  padding: 0 14px;
}

#jump {
  min-width: 96px;
}

.toast {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  min-width: 210px;
  padding: 12px 16px;
  border-radius: 8px;
  text-align: center;
  font-weight: 900;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.hidden {
  opacity: 0;
  transform: translate(-50%, -44%);
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 24px 18px 42px;
  pointer-events: auto;
  transition: opacity 180ms ease, transform 180ms ease;
}

.overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
}

.menu-actions {
  width: min(100%, 320px);
  display: grid;
  gap: 12px;
  justify-items: center;
}

.menu-actions h1 {
  margin: 0;
  color: #17313b;
  font-size: clamp(34px, 9vw, 52px);
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.75), 0 14px 32px rgba(30, 70, 82, 0.26);
}

.menu-actions p {
  margin: 0;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  color: #17313b;
  font-weight: 900;
  border: 2px solid rgba(20, 45, 57, 0.18);
}

.menu-actions button {
  min-width: 168px;
  border: 2px solid rgba(20, 45, 57, 0.2);
  background: #ffffff;
  color: #17313b;
  box-shadow: 0 12px 26px rgba(34, 78, 92, 0.18);
}
