* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #07101e;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
}

#app {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background: radial-gradient(circle at center, #183057 0%, #07101e 72%);
}

#gameCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.dom-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.system-message {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(720px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 16px;
  background: rgba(5, 10, 18, 0.78);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.35);
  text-align: center;
  font-weight: 900;
  font-size: clamp(14px, 2vw, 22px);
  letter-spacing: 0.3px;
}

.hidden {
  display: none !important;
}

.help-panel {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 5;
  display: none;
  pointer-events: none;
}

.help-title {
  margin: 0 0 5px 3px;
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(10px, 1.3vw, 13px);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.help-card {
  min-height: 46px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  text-align: center;
}

.help-card strong {
  display: block;
  color: #ffffff;
  font-size: clamp(10px, 1.6vw, 16px);
  line-height: 1.1;
}

.help-card span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.74);
  font-size: clamp(9px, 1.1vw, 12px);
  line-height: 1.1;
}

.help-card small {
  position: absolute;
  opacity: 0.28;
  font-size: 9px;
}

.help-card.pulse {
  animation: pulseCard 0.18s ease-out;
}

@keyframes pulseCard {
  from {
    transform: translateY(-5px) scale(1.03);
    background: rgba(255, 216, 88, 0.9);
    color: #111111;
  }
  to {
    transform: translateY(0) scale(1);
    background: rgba(0, 0, 0, 0.48);
    color: #ffffff;
  }
}

@media (max-width: 760px) {
  .help-grid {
    gap: 4px;
  }

  .help-card {
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 9px;
  }
}
