/* Concrete BAGS Clicker — black + yellow */

:root {
  --bg: #070707;
  --panel: #111111;
  --yellow: #f5cc00;
  --yellow-dim: #c9a800;
  --yellow-glow: rgba(245, 204, 0, 0.5);
  --border: rgba(245, 204, 0, 0.25);
  --text: #f5f5f5;
  --muted: #9a9a9e;
  --font: "Outfit", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  padding-bottom: calc(1rem + var(--safe-bottom));
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(245, 204, 0, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 204, 0, 0.035) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 70% 50% at 50% 30%, black, transparent);
}

/* Header */
.header {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #0f0f0f, var(--bg));
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-mark {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 14px var(--yellow-glow);
}

.brand-kicker {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
}

.brand-title {
  margin: 0.1rem 0 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--yellow);
}

.balance {
  text-align: right;
}

.balance-label {
  margin: 0;
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
}

.balance-value {
  margin: 0.2rem 0 0;
  font-family: var(--mono);
  font-size: clamp(1.4rem, 5vw, 1.9rem);
  font-weight: 700;
  color: var(--yellow);
  text-shadow: 0 0 20px var(--yellow-glow);
}

.balance-value.pop {
  animation: pop 0.2s ease;
}

@keyframes pop {
  50% {
    transform: scale(1.06);
  }
}

.balance-unit {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Main */
.main {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
  padding: 1rem 1rem 0;
}

.stats {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.stat-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: rgba(245, 204, 0, 0.05);
}

.stat-pill span {
  color: var(--yellow);
  font-weight: 700;
}

/* Moai */
.moai {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  margin: 1rem 0;
  padding: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.moai::before {
  content: "";
  position: absolute;
  width: min(70vw, 260px);
  height: min(70vw, 260px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 204, 0, 0.2) 0%, transparent 70%);
  z-index: -1;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.08);
  }
}

.moai-emoji {
  font-size: clamp(6rem, 28vw, 9rem);
  line-height: 1;
  filter: drop-shadow(0 0 24px var(--yellow-glow)) drop-shadow(0 8px 24px rgba(0, 0, 0, 0.6));
  transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.moai:active .moai-emoji,
.moai.tap .moai-emoji {
  transform: scale(0.9) translateY(6px);
}

.moai-label {
  font-size: 0.65rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
}

.floats {
  position: relative;
  width: 100%;
  height: 0;
  pointer-events: none;
}

.float {
  position: absolute;
  left: 50%;
  top: -120px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  color: var(--yellow);
  text-shadow: 0 0 12px var(--yellow-glow);
  animation: rise 0.8s ease-out forwards;
}

@keyframes rise {
  to {
    opacity: 0;
    transform: translateX(-50%) translateY(-60px);
  }
}

/* Upgrades */
.upgrades {
  width: 100%;
  margin-top: auto;
  padding-bottom: 1rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  text-align: center;
}

.upgrade {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  margin-bottom: 0.6rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--panel);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.12s;
}

.upgrade:hover,
.upgrade:focus-visible {
  border-color: rgba(245, 204, 0, 0.5);
  box-shadow: 0 0 0 1px rgba(245, 204, 0, 0.15);
}

.upgrade:active {
  transform: scale(0.98);
}

.upgrade:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.upgrade-icon {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(245, 204, 0, 0.1);
  border: 1px solid var(--border);
  font-size: 1.2rem;
}

.upgrade-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.upgrade-name {
  font-weight: 700;
  font-size: 0.95rem;
}

.upgrade-desc {
  font-size: 0.78rem;
  color: var(--muted);
}

.upgrade-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--muted);
}

.upgrade-price {
  font-family: var(--mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--yellow);
  white-space: nowrap;
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 0.85rem;
  border-top: 1px solid rgba(245, 204, 0, 0.1);
}

.footer-note {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.btn-reset {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.7rem;
  cursor: pointer;
}

.btn-reset:hover {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.4);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
