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

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #060908;
  color: #a4f59f;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

#gameCanvas {
  display: block;
  width: min(100vw, calc(100vh * 2752 / 1536));
  height: min(100vh, calc(100vw * 1536 / 2752));
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  box-shadow: 0 0 48px rgba(118, 185, 0, 0.14);
}

.top-hud {
  position: fixed;
  top: 16px;
  left: 18px;
  right: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
  z-index: 10;
}

.hud-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(6, 12, 9, 0.82);
  border: 2px solid rgba(118, 185, 0, 0.56);
  border-radius: 6px;
  color: #c5f7b4;
  font-family: inherit;
  font-size: clamp(15px, 1.8vw, 24px);
  line-height: 1;
  letter-spacing: 0.04em;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.52);
  transition: border-color 0.14s ease, background-color 0.14s ease, color 0.14s ease, transform 0.1s ease;
}

.hud-pill:hover {
  background: rgba(14, 28, 18, 0.92);
  border-color: rgba(168, 255, 72, 0.92);
  color: #e8ffda;
}

.hud-pill:active {
  transform: translateY(1px);
}

.ca-pill {
  cursor: pointer;
  max-width: min(60vw, 680px);
}

.ca-label {
  color: #8ee63f;
  font-weight: 800;
  flex-shrink: 0;
}

.ca-value {
  color: #e8ffda;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ca-copy-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  margin-left: 4px;
  background: rgba(118, 185, 0, 0.22);
  border: 1px solid rgba(118, 185, 0, 0.55);
  border-radius: 4px;
  color: #b7ff75;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 800;
  flex-shrink: 0;
}

.ca-pill.copied {
  border-color: #9cff3b;
}

.ca-pill.copied .ca-copy-badge {
  background: rgba(118, 255, 3, 0.28);
  border-color: #9cff3b;
  color: #efffdf;
}

.social-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.social-pill {
  font-weight: 800;
}

.buy-pill {
  background: rgba(84, 152, 0, 0.28);
  border-color: rgba(142, 230, 63, 0.8);
  color: #e9ffd8;
}

.sound-btn {
  position: fixed;
  bottom: 12px;
  right: 16px;
  z-index: 10;
  padding: 6px 10px;
  background: rgba(6, 12, 9, 0.76);
  border: 1px solid rgba(118, 185, 0, 0.42);
  border-radius: 4px;
  color: #9ed892;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
}

.sound-btn.active {
  border-color: #9cff3b;
  color: #d9ffb5;
  background: rgba(16, 34, 20, 0.88);
}

.hud-bar {
  position: fixed;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 16px;
  padding: 5px 12px;
  background: rgba(6, 12, 9, 0.72);
  border: 1px solid rgba(118, 185, 0, 0.35);
  border-radius: 4px;
  font-size: 12px;
  letter-spacing: 0.03em;
  color: #b7e4b0;
  pointer-events: none;
  opacity: 0.86;
  white-space: nowrap;
}

.hud-bar kbd {
  display: inline-block;
  padding: 1px 5px;
  margin-right: 2px;
  background: rgba(118, 185, 0, 0.18);
  border: 1px solid rgba(118, 185, 0, 0.5);
  border-radius: 2px;
  color: #d4ff9e;
  font-family: inherit;
  font-size: 11px;
}

.touch-controls {
  display: none;
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  justify-content: space-between;
  align-items: center;
  pointer-events: none;
  z-index: 12;
}

.touch-group {
  display: flex;
  gap: 12px;
}

.touch-btn {
  pointer-events: auto;
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 14, 9, 0.68);
  border: 2px solid rgba(118, 185, 0, 0.6);
  border-radius: 8px;
  color: #d4ff9e;
  font-family: inherit;
  font-size: 22px;
  touch-action: none;
}

.touch-btn.pressed {
  background: rgba(118, 185, 0, 0.35);
  border-color: #a6ff4d;
}

@media (pointer: coarse) {
  .touch-controls {
    display: flex;
  }

  .hud-bar {
    display: none;
  }

  .sound-btn {
    bottom: auto;
    top: 74px;
    right: 10px;
  }
}

body.has-touch .touch-controls {
  display: flex;
}

body.has-touch .hud-bar {
  display: none;
}

@media (max-width: 720px) {
  .top-hud {
    top: 10px;
    left: 10px;
    right: 10px;
    gap: 8px;
  }

  .hud-pill {
    padding: 8px 12px;
    font-size: 14px;
    gap: 7px;
  }

  .hud-pill svg {
    width: 18px;
    height: 18px;
  }

  .ca-pill {
    max-width: 54vw;
  }

  .ca-copy-badge {
    padding: 3px 6px;
    font-size: 11px;
  }

  .social-links {
    gap: 7px;
  }

  .hud-bar {
    font-size: 10px;
    gap: 10px;
    padding: 4px 8px;
  }
}
