:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft JhengHei", system-ui, sans-serif;
  background: #12151c;
  color: #f6f7fb;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(circle at 18% 12%, rgba(71, 166, 255, 0.22), transparent 30%),
    linear-gradient(135deg, #10131a 0%, #222531 55%, #151922 100%);
}

button {
  font: inherit;
}

.shell {
  width: min(100%, 980px);
  display: grid;
  gap: 12px;
}

.hud {
  display: grid;
  grid-template-columns: 1fr 1fr 48px;
  gap: 10px;
  align-items: stretch;
}

.hud > div,
.icon-button,
.control,
#start {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
  color: #f6f7fb;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
}

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

.label,
.value {
  margin: 0;
}

.label {
  font-size: 12px;
  color: #aeb7c7;
}

.value {
  margin-top: 2px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.icon-button,
.control,
#start {
  min-width: 44px;
  min-height: 44px;
  border-radius: 8px;
  cursor: pointer;
}

.icon-button:hover,
.control:hover,
#start:hover {
  background: rgba(255, 255, 255, 0.14);
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: #080b10;
  aspect-ratio: 16 / 9;
  min-height: 260px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 22px;
  text-align: center;
  background: rgba(8, 11, 16, 0.62);
  backdrop-filter: blur(4px);
}

.overlay[hidden] {
  display: none;
}

h1 {
  margin: 0;
  font-size: 40px;
  line-height: 1.05;
  letter-spacing: 0;
}

.overlay p {
  width: min(100%, 420px);
  margin: 0;
  color: #d9dee9;
  line-height: 1.5;
}

#start {
  justify-self: center;
  min-width: 116px;
  padding: 10px 18px;
  background: #2fbf71;
  color: #07130d;
  border-color: rgba(255, 255, 255, 0.24);
  font-weight: 800;
}

.controls {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.control {
  font-size: 24px;
  line-height: 1;
}

@media (max-width: 700px) {
  body {
    padding: 10px;
  }

  .hud {
    grid-template-columns: 1fr 1fr 46px;
  }

  .game-frame {
    min-height: auto;
  }

  h1 {
    font-size: 32px;
  }

  .controls {
    display: grid;
  }
}
