html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #0b1020;
  color: #eaf0ff;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game {
  display: block;
  width: 100vw;
  height: 100vh;
}

#hud {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(12px + env(safe-area-inset-top)) calc(12px + env(safe-area-inset-right)) 12px calc(12px + env(safe-area-inset-left));
  gap: 12px;
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.chip {
  pointer-events: none;
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-weight: 700;
}

.chip .k {
  font-size: 12px;
  opacity: 0.75;
  font-weight: 600;
}

.chip.clickable {
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.chip.clickable:active {
  transform: scale(0.95);
}

.btn {
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  color: #eaf0ff;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: rgba(64, 160, 255, 0.18);
  border-color: rgba(64, 160, 255, 0.35);
}

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 12;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
  white-space: nowrap;
}

#toast.show {
  opacity: 1;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), rgba(0,0,0,0.55));
  padding: 16px;
}

.panel {
  width: min(520px, 92vw);
  border-radius: 18px;
  padding: 18px 18px 16px;
  background: rgba(12, 18, 35, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.title {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.help {
  font-size: 13px;
  line-height: 1.6;
  opacity: 0.9;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

@media (max-width: 420px) {
  .btn { padding: 10px 10px; }
  .chip { padding: 7px 9px; }
}

