* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: #06121f;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: #fff;
}

canvas#game {
  display: block;
  width: 100%;
  height: 100%;
}

#hud {
  position: fixed;
  top: 16px;
  left: 16px;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .85);
  letter-spacing: .3px;
}

#hud div { font-size: 17px; line-height: 1.35; margin-bottom: 2px; }
#hud #hint { margin-top: 14px; font-size: 12px; opacity: .8; }

#warning {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(180, 30, 30, .85);
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
  animation: pulse 0.8s ease-in-out infinite alternate;
}
#warning.hidden { display: none; }
@keyframes pulse {
  from { opacity: .55; }
  to   { opacity: 1; }
}

#overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 12, 28, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity .25s ease;
}
#overlay.hidden { opacity: 0; pointer-events: none; }

.panel {
  background: linear-gradient(180deg, rgba(14, 28, 54, .95), rgba(8, 18, 40, .95));
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  padding: 36px 44px;
  text-align: center;
  max-width: 460px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}
.panel h1 {
  font-size: 30px;
  margin-bottom: 12px;
  letter-spacing: 2px;
  font-weight: 700;
}
.panel p {
  font-size: 15px;
  opacity: .85;
  margin-bottom: 22px;
  line-height: 1.5;
}
.panel .footnote {
  font-size: 12px;
  opacity: .55;
  margin-top: 18px;
  margin-bottom: 0;
}
.panel button {
  background: linear-gradient(180deg, #e7c179, #c89744);
  color: #1b1208;
  border: 0;
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  letter-spacing: .5px;
  box-shadow: 0 4px 14px rgba(212, 168, 90, .35);
  transition: transform .1s ease, box-shadow .15s ease;
}
.panel button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(212, 168, 90, .5);
}
.panel button:active { transform: translateY(0); }
