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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #c9d9ee;
  font-family: "Outfit", system-ui, sans-serif;
  user-select: none;
  touch-action: none;
}

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

#stage {
  position: relative;
  line-height: 0;
  border-radius: 18px;
  overflow: hidden;
  box-shadow:
    0 18px 50px rgba(22, 32, 58, 0.28),
    0 0 0 6px #1b2437;
}

#game {
  display: block;
  background: #eaf2ff;
}

#hud {
  position: absolute;
  inset: 0 0 auto 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 0;
  pointer-events: none;
  z-index: 3;
}

#hud-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#hud-level {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: #1b2437;
}

#hud-title {
  font-size: 15px;
  font-weight: 800;
  color: #1b2437;
  line-height: 1.1;
}

#hud-mid {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 18px;
}

#hud-deaths {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #ff3b30;
  background: rgba(255, 255, 255, 0.72);
  padding: 6px 12px;
  border-radius: 999px;
}

#btn-restart,
#btn-start,
#btn-again {
  pointer-events: auto;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  letter-spacing: 0.08em;
}

#btn-restart {
  background: #1b2437;
  color: #f4f7ff;
  font-size: 11px;
  padding: 8px 12px;
  border-radius: 999px;
}

#btn-restart:hover {
  background: #ff3b30;
}

#menu, #end {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(234, 242, 255, 0.92);
  text-align: center;
  line-height: 1.2;
}

.menu-mark {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #ff3b30;
  color: #fff;
  font-size: 48px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  box-shadow: 0 10px 0 #c81f16;
}

h1 {
  font-size: 84px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #1b2437;
  line-height: 0.9;
}

.tag {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  color: #ff3b30;
}

.hint {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: #5b6780;
  letter-spacing: 0.02em;
}

#btn-start, #btn-again {
  margin-top: 28px;
  background: #1b2437;
  color: #fff;
  font-size: 16px;
  padding: 14px 36px;
  border-radius: 14px;
  box-shadow: 0 6px 0 #0f1522;
}

#btn-start:hover, #btn-again:hover {
  transform: translateY(2px);
  box-shadow: 0 4px 0 #0f1522;
  background: #ff3b30;
}

#end h1 {
  font-size: 64px;
}

#touch {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 12px;
  display: flex;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 4;
  pointer-events: none;
}

#touch button {
  pointer-events: auto;
  width: 74px;
  height: 74px;
  border: 0;
  border-radius: 50%;
  background: rgba(27, 36, 55, 0.28);
  color: #1b2437;
  font-size: 22px;
  font-weight: 800;
  font-family: inherit;
}

#t-jump {
  width: 96px;
  border-radius: 28px;
  font-size: 14px;
  letter-spacing: 0.12em;
}

.hidden {
  display: none !important;
}

@media (max-width: 700px) {
  h1 { font-size: 56px; }
  #end h1 { font-size: 40px; }
}
