:root {
  color-scheme: dark;
  --panel: rgba(7, 11, 24, 0.72);
  --panel-strong: rgba(7, 11, 24, 0.9);
  --line: rgba(255, 255, 255, 0.16);
  --text: #eef5ff;
  --muted: #a9bad6;
  --accent: #6cf0ff;
  --accent-2: #ffdd6c;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #14223f 0%, #070b18 58%, #02040b 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

canvas#game {
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

.overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  padding: max(20px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
}

.title-card {
  pointer-events: auto;
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(92vw, 640px);
  transform: translate(-50%, -50%);
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(150deg, rgba(11, 18, 38, 0.92), rgba(7, 11, 24, 0.78));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.title-card[hidden] {
  display: none;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  margin: 10px 0 16px;
  font-size: clamp(2.7rem, 8vw, 5.7rem);
  line-height: 0.86;
  letter-spacing: -0.08em;
}

.title-card p:not(.eyebrow) {
  color: var(--muted);
  font-size: clamp(1rem, 2.2vw, 1.16rem);
  line-height: 1.7;
}

button {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  margin-top: 14px;
  padding: 0 24px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #846cff 55%, #ff6cd6);
  color: #06101e;
  font-size: 1rem;
  font-weight: 900;
  box-shadow: 0 18px 42px rgba(108, 240, 255, 0.22);
}

.controls {
  margin-bottom: 0;
  font-size: 0.88rem !important;
}

.hud {
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(4, minmax(88px, auto));
  gap: 10px;
  width: fit-content;
  max-width: calc(100vw - 32px);
}

.hud[hidden],
.tips[hidden] {
  display: none;
}

.hud > div,
.tips {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
}

.hud > div {
  min-width: 118px;
  padding: 10px 14px;
}

.hud strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 1.08rem;
}

.tips {
  position: absolute;
  right: max(20px, env(safe-area-inset-right));
  bottom: max(20px, env(safe-area-inset-bottom));
  width: min(420px, calc(100vw - 40px));
  padding: 12px 16px;
  color: var(--muted);
}

.tips p {
  margin: 0;
  line-height: 1.55;
}

@media (max-width: 620px) {
  .hud {
    grid-template-columns: repeat(2, minmax(118px, 1fr));
    width: calc(100vw - 40px);
  }

  .hud > div {
    min-width: 0;
  }
}
