* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  width: 100%;
  background: #0b0f1a;
  color: #d7e1ff;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, 'Noto Sans', 'Apple Color Emoji', 'Segoe UI Emoji';
  overflow: hidden;
  overscroll-behavior: none;
}

canvas#game {
  display: block;
  width: 100vw;
  height: 100vh;
  cursor: crosshair;
  touch-action: none;
  image-rendering: auto;
}

#hud {
  position: fixed;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 20;
  contain: layout paint;
}
#hud .left, #hud .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.badge {
  background: rgba(18, 28, 48, 0.7);
  border: 1px solid rgba(120, 150, 255, 0.3);
  backdrop-filter: blur(4px);
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.badges { display: flex; gap: 8px; flex-wrap: wrap; }
.pu {
  background: rgba(120, 150, 255, 0.14);
  border: 1px solid rgba(120,150,255,0.35);
  padding: 6px 10px;
  border-radius: 10px;
  font-weight: 700;
}
#hud button {
  pointer-events: auto;
  background: rgba(18, 28, 48, 0.75);
  border: 1px solid rgba(120, 150, 255, 0.35);
  color: #bcd1ff;
  font-size: 16px;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
}
#hud button:hover { transform: translateY(-1px); }

#overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(1200px 800px at 50% 50%, rgba(24,30,50,0.9), rgba(9,12,20,0.95));
  z-index: 10;
  contain: layout paint;
}
.center { text-align: left; padding: 24px; }
.card {
  width: min(920px, 92vw);
  background: linear-gradient(180deg, rgba(16,22,38,0.94), rgba(12,17,30,0.96));
  border: 1px solid rgba(120,150,255,0.25);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 10px 24px rgba(0,0,0,0.35);
}
.card h1 { font-size: clamp(28px, 4vw, 40px); margin: 0 0 8px 0; line-height: 1.1; }
.card h1 span { background: linear-gradient(90deg, #69f, #ff9d4d); -webkit-background-clip: text; background-clip: text; color: transparent; }
.subtitle { opacity: 0.85; margin-top: 0; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid h3 { margin: 8px 0; }
.grid ul { margin: 0; padding-left: 18px; line-height: 1.6; }

.primary {
  margin-top: 18px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .3px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(90deg, #5d7cff, #f86f2d);
  border: 0;
  color: white;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(93,124,255,0.35);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: rgba(21, 29, 50, 0.9);
  border: 1px solid rgba(120,150,255,0.3);
  color: #e6edff;
  padding: 10px 14px;
  border-radius: 10px;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
  pointer-events: none;
  white-space: pre-line;
  z-index: 30;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  #hud { left: 8px; right: 8px; align-items: flex-start; }
  #hud .left, #hud .right { gap: 6px; }
  .badge { padding: 6px 9px; font-size: 13px; }
  #hud button { padding: 6px 8px; }
  .card { padding: 20px; }
}
