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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b0b16;
  color: #fff;
  font-family: "Courier New", Courier, monospace;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(ellipse at 50% 20%, #1d2a6b 0%, #0b0b16 62%);
}

#cabinet {
  width: min(96vw, 920px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo {
  font-size: clamp(18px, 4vw, 28px);
  letter-spacing: 6px;
  color: #ffd84a;
  text-shadow: 3px 3px 0 #c02020, 0 0 18px rgba(255, 216, 74, 0.4);
}

.logo-sub {
  margin-top: -6px;
  font-size: 14px;
  letter-spacing: 8px;
  color: #f4f4f4;
}

#stage {
  position: relative;
  width: 100%;
  aspect-ratio: 768 / 432;
  background: #5c94fc;
  border: 6px solid #1a1a28;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), inset 0 0 0 2px #ffd84a;
  overflow: hidden;
}

#game {
  display: block;
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

#hud {
  position: absolute;
  top: 8px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  font-size: clamp(10px, 2vw, 14px);
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #000;
}

.hud-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 72px;
}

.hud-label {
  color: #fff;
  font-weight: 700;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 10, 28, 0.55);
}

.overlay.hidden {
  display: none;
}

.overlay-inner {
  text-align: center;
  padding: 20px 28px;
  background: rgba(12, 16, 40, 0.86);
  border: 3px solid #ffd84a;
}

.overlay-title {
  font-size: clamp(20px, 4vw, 32px);
  color: #ffd84a;
  margin-bottom: 12px;
  letter-spacing: 3px;
}

.overlay-msg {
  line-height: 1.7;
  font-size: clamp(12px, 2.2vw, 16px);
  margin-bottom: 16px;
}

.overlay-hint {
  color: #9dff9d;
  animation: blink 1s steps(2, end) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

#touch {
  width: 100%;
  display: none;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 0;
  gap: 12px;
}

.touch-left {
  display: flex;
  gap: 10px;
}

#touch button {
  min-width: 72px;
  height: 56px;
  border: 3px solid #ffd84a;
  background: #1d2348;
  color: #fff;
  font-size: 18px;
  font-family: inherit;
  touch-action: none;
  user-select: none;
}

#touch button.jump {
  min-width: 96px;
  background: #c02020;
}

@media (pointer: coarse), (max-width: 820px) {
  #touch {
    display: flex;
  }
}
