@font-face {
  font-family: "PixelOperator";
  src: local("PixelOperator"), local("Pixel Operator");
  font-display: swap;
}

:root {
  --bg-1: #0e1420;
  --bg-2: #1a2436;
  --accent: #f4c95d;
  --ink: #f4f1e8;
  --shadow: #0a0f1a;
}

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

html,
body {
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 20% 10%, #25304a, var(--bg-1) 50%, #090d16 100%);
  color: var(--ink);
  font-family: "PixelOperator", "Press Start 2P", "VT323", monospace;
}

body {
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 100svh;
  min-height: 100dvh;
}

#app {
  position: relative;
  width: min(100vw, 56.25svh);
  width: min(100vw, 56.25dvh);
  height: min(100svh, 177.78vw);
  height: min(100dvh, 177.78vw);
  aspect-ratio: 9 / 16;
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 4px solid #2c3d5d;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
  margin: env(safe-area-inset-top) env(safe-area-inset-right)
    env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#game {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  background: linear-gradient(180deg, #202b41 0%, #111725 100%);
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  text-shadow: 0 2px 0 var(--shadow);
  letter-spacing: 1px;
}

.hud-score {
  font-size: 22px;
}

.hud-mute {
  pointer-events: auto;
  background: transparent;
  border: 1px solid transparent;
  color: rgba(244, 241, 232, 0.65);
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0.35;
  cursor: pointer;
  text-shadow: none;
}

.hud-mute:active {
  opacity: 0.6;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 40px 24px 24px;
  gap: 12px;
  background: linear-gradient(180deg, rgba(14, 20, 32, 0.9), rgba(14, 20, 32, 0.6));
}

.overlay.hidden {
  display: none;
}

.title {
  font-size: 28px;
  color: var(--accent);
  letter-spacing: 2px;
  text-shadow: 0 3px 0 var(--shadow);
}

.records {
  font-size: 16px;
  line-height: 1.4;
}

.prompt {
  font-size: 18px;
  color: #b9e37c;
}

.keys {
  font-size: 12px;
  opacity: 0.8;
}

@media (max-width: 480px) {
  .hud-score {
    font-size: 18px;
  }

  .title {
    font-size: 24px;
  }

  .prompt {
    font-size: 16px;
  }
}
