* {
  box-sizing: border-box;
}

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

:root {
  --sky-1: #2f66ad;
  --sky-2: #8ec0ff;
  --panel: rgba(12, 21, 44, 0.72);
  --line: rgba(255, 255, 255, 0.2);
  --text: #ecf5ff;
}

body {
  display: grid;
  place-items: center;
  color: var(--text);
  background: radial-gradient(120% 120% at 70% 0%, #2e6292, #05204d);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

.app {
  width: min(980px, 100vw);
  height: 100vh;
  padding: 10px;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 8px;
}

.top {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  text-align: center;
  padding: 8px 10px;
}

.top h1 {
  margin: 0;
  font-size: clamp(20px, 4vw, 34px);
}

.subtitle {
  margin: 4px 0 0;
  color: #d5e3ff;
  font-size: 12px;
}

.hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
}

.hud-item {
  text-align: center;
  font-size: clamp(12px, 2.5vw, 19px);
}

.game-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 280px;
  background: linear-gradient(180deg, var(--sky-1), var(--sky-2));
}

#gameSVG {
  width: 100%;
  height: 100%;
  display: block;
}

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 10px;
  text-align: center;
  background: rgba(7, 14, 30, 0.62);
  padding: 14px;
}

.overlay.show {
  display: flex;
}

.overlay h2,
.overlay p {
  margin: 0;
}

#actionBtn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  background: linear-gradient(180deg, #72e9ff, #28a3ef);
  color: #0d1730;
  font-weight: 700;
  font-size: 16px;
}

#actionBtn:active {
  transform: translateY(1px);
}

@media (min-width: 768px) {
  .app {
    padding: 14px;
    gap: 12px;
  }

  .hud {
    padding: 10px;
  }
}
