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

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at 20% 0%, #29304a 0, #060713 45%, #020309 100%);
  color: #fdfaf4;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.game-wrapper {
  width: 100%;
  max-width: 900px;
  padding: 16px;
}

.hud {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  color: #fdfaf4;
}

.hud-title {
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 13px;
}

.hud-controls {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.hud-bugs {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, #264124, #407235);
  border: 1px solid #72c96c;
  box-shadow: 0 0 0 1px rgba(2, 0, 0, 0.6), 0 0 6px rgba(0, 0, 0, 0.8);
}

.game-main {
  display: flex;
  justify-content: center;
}

canvas#game {
  border-radius: 8px;
  border: 2px solid #1b2434;
  box-shadow:
    0 0 0 1px #060713,
    0 18px 40px rgba(0, 0, 0, 0.7);
  background-color: #15182c;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  width: 100%;
  max-width: 640px;
  height: auto;
  display: block;
}

.dialogue {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  width: 100%;
  max-width: 640px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 2px solid #191321;
  background: linear-gradient(
    180deg,
    rgba(7, 6, 12, 0.98),
    rgba(9, 8, 14, 0.96)
  );
  color: #fdfaf4;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.8),
    0 14px 40px rgba(0, 0, 0, 0.9);
}

.dialogue-name {
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9ed7ff;
  margin-bottom: 4px;
}

.dialogue-text {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 4px;
}

.dialogue-hint {
  font-size: 10px;
  opacity: 0.7;
  text-align: right;
}

.message {
  position: fixed;
  left: 50%;
  top: 18px;
  transform: translateX(-50%);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.8);
  color: #fdfaf4;
  font-size: 11px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.8);
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .hud {
    flex-direction: column;
    gap: 2px;
  }

  .hud-bugs {
    align-self: flex-start;
    margin-top: 4px;
  }
}

