:root {
  --bg: #05070e;
  --hud: #f5f9ff;
  --accent: #61d4ff;
  --accent-2: #ff4fd8;
  --danger: #ff5a5f;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(97, 212, 255, 0.08), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(255, 79, 216, 0.07), transparent 24%),
    linear-gradient(160deg, #060a14 0%, #04060d 40%, #020308 100%);
  color: var(--hud);
  font-family: "Trebuchet MS", "Trebuchet", "Arial", sans-serif;
}

.frame {
  width: min(980px, 94vw);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.titleBar {
  text-align: center;
}

.titleBar h1 {
  margin: 0;
  letter-spacing: 0.12em;
  color: #ffffff;
}

.titleBar p {
  margin: 2px 0 0;
  color: #a4b4d6;
}

.gameWrap {
  position: relative;
  width: 960px;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border: 2px solid rgba(97, 212, 255, 0.35);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 20%),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.02) 0,
      rgba(255, 255, 255, 0.02) 1px,
      transparent 1px,
      transparent 14px
    );
}

#gameCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hud {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  font-size: 14px;
  letter-spacing: 0.03em;
  color: #d8ecff;
  pointer-events: none;
}

.hud span:first-child,
.hud span:nth-child(2),
.hud span:nth-child(3) {
  background: rgba(3, 9, 16, 0.75);
  border: 1px solid rgba(97, 212, 255, 0.35);
  padding: 6px 10px;
  border-radius: 999px;
  min-width: 120px;
  text-align: center;
}

.overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 28px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(3, 5, 14, 0.35),
    rgba(3, 5, 14, 0.75)
  );
}

.overlay h2 {
  margin: 0;
  color: #f8fbff;
  font-size: 36px;
  text-shadow: 0 0 14px rgba(97, 212, 255, 0.6);
}

.overlay p {
  max-width: 70%;
  color: #d2e6ff;
  margin-top: 12px;
  margin-bottom: 12px;
  line-height: 1.4;
}

.overlay strong {
  color: #ffd15f;
}

.overlay.hidden {
  display: none;
}

.hintText {
  text-align: center;
  max-width: 960px;
  color: #9ab0cc;
  font-size: 13px;
}

@media (max-width: 640px) {
  .frame {
    gap: 8px;
  }

  .titleBar h1 {
    font-size: 1.4rem;
  }

  .titleBar p,
  .hintText {
    font-size: 11px;
  }

  .hud {
    gap: 8px;
    font-size: 11px;
  }

  .hud span {
    min-width: auto;
    padding: 4px 6px;
  }

  .overlay h2 {
    font-size: 26px;
  }

  .overlay p {
    max-width: 95%;
    font-size: 13px;
  }
}
