:root {
  --bg: #0c1220;
  --panel: #162033;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --accent: #fbbf24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 0%, rgba(251, 191, 36, 0.18), transparent 50%),
    linear-gradient(180deg, #0c1220, #111827 60%, #1a1025);
  user-select: none;
  touch-action: manipulation;
}

.header {
  text-align: center;
  padding: 1.2rem 1rem 0.3rem;
}

.header h1 {
  margin: 0.3rem 0;
  color: var(--accent);
}

.header p {
  margin: 0;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.95rem;
}

.back {
  color: var(--muted);
  text-decoration: none;
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
}

.hud {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  font-family: system-ui, sans-serif;
  color: var(--muted);
  margin: 0.7rem 1rem 0.4rem;
  font-size: 0.9rem;
}

.hud strong {
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}

.stage {
  position: relative;
  width: min(720px, 96vw);
  margin: 0.4rem auto 0.75rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 0 0 2px #334155, 0 16px 36px rgba(0, 0, 0, 0.35);
  background: #14301a;
}

#game {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  touch-action: none;
}

.overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 1.2rem;
  text-align: center;
  background: rgba(8, 12, 24, 0.8);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.overlay.hidden {
  display: none;
}

#overlay-title {
  margin: 0;
  font-size: 1.5rem;
  color: var(--accent);
}

.hint {
  margin: 0;
  max-width: 28rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  line-height: 1.45;
}

.overlay-actions {
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
  justify-content: center;
}

button {
  font-family: system-ui, sans-serif;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: 0.65rem 1.2rem;
  cursor: pointer;
  background: var(--accent);
  color: #0f172a;
}

button.secondary {
  background: #334155;
  color: #e2e8f0;
}

button:hover {
  filter: brightness(1.06);
}

.controls {
  text-align: center;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.88rem;
  margin: 0 1rem 1.1rem;
}

.mobile-pad {
  display: none;
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
}

.stick {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.45);
  border: 2px solid rgba(226, 232, 240, 0.35);
  pointer-events: auto;
}

.stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(251, 191, 36, 0.85);
}

.fire-btn {
  position: absolute;
  right: 18px;
  bottom: 28px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 1.5rem;
  pointer-events: auto;
  padding: 0;
}

.ult-btn {
  position: absolute;
  right: 100px;
  bottom: 36px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  font-size: 1.25rem;
  pointer-events: auto;
  padding: 0;
  background: #a78bfa;
  color: #0f172a;
}

.ult-btn:disabled {
  opacity: 0.4;
  filter: grayscale(0.6);
}

@media (max-width: 820px), (pointer: coarse) {
  .mobile-pad {
    display: block;
  }
}

.shop {
  max-width: 720px;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
}

.shop h2 {
  text-align: center;
  margin: 0 0 0.35rem;
}

.shop-note {
  text-align: center;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  font-size: 0.9rem;
  margin: 0 0 1rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.85rem;
}

.brawler-card {
  background: var(--panel);
  border: 1px solid #334155;
  border-radius: 12px;
  padding: 0.85rem 0.7rem;
  text-align: center;
  font-family: system-ui, sans-serif;
}

.brawler-card.equipped {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.35);
}

.brawler-preview {
  width: 48px;
  height: 48px;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 12px currentColor;
}

.brawler-card h3 {
  margin: 0 0 0.2rem;
  font-size: 0.95rem;
}

.brawler-card .price,
.brawler-card .blurb,
.brawler-card .stats {
  margin: 0.12rem 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.brawler-card .price {
  color: #fbbf24;
}

.brawler-btn {
  margin-top: 0.5rem;
  width: 100%;
  padding: 0.45rem;
  font-size: 0.85rem;
}

.brawler-btn:disabled {
  opacity: 0.65;
  cursor: default;
}

.brawler-btn.owned {
  background: #38bdf8;
}

.brawler-btn.equipped-btn {
  background: #475569;
  color: #e2e8f0;
}
