* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #1b130c;
  color: #f3e6cf;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

#stage {
  position: fixed;
  inset: 0;
}

#stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

#hud {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(27, 19, 12, 0.78);
  border: 1px solid rgba(243, 230, 207, 0.18);
  border-radius: 999px;
  font-size: 15px;
  white-space: nowrap;
  max-width: calc(100vw - 20px);
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex: none;
}
.dot.red { background: #d8332a; }
.dot.black { background: #111; box-shadow: 0 0 0 1px #f3e6cf; }

#msg { font-weight: 600; color: #ffb4a8; }
#msg:empty { display: none; }

#toolbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(10px + env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 0 10px;
}

button {
  font: inherit;
  font-size: 14px;
  color: #f3e6cf;
  background: rgba(27, 19, 12, 0.82);
  border: 1px solid rgba(243, 230, 207, 0.28);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  cursor: pointer;
}
button:hover { background: rgba(60, 40, 22, 0.92); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.4; cursor: default; }

#banner {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 28px;
  background: rgba(27, 19, 12, 0.9);
  border: 1px solid rgba(243, 230, 207, 0.35);
  border-radius: 16px;
  text-align: center;
  max-width: calc(100vw - 32px);
}
#banner[hidden] { display: none; }
#bannerText { font-size: 22px; font-weight: 600; }

#loading {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: #1b130c;
  font-size: 16px;
  z-index: 10;
}
#loading[hidden] { display: none; }
