* { box-sizing: border-box; }

:root {
  --bg: #14161c;
  --card: #1e212a;
  --text: #f2efe6;
  --muted: #8b8f9c;
  --gold: #f5c542;
  --gold-dark: #c8961c;
}

html, body { height: 100%; margin: 0; }

body {
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at 50% 20%, #232736, var(--bg) 70%);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.card {
  width: min(360px, 100%);
  padding: 2rem 1.5rem 1.5rem;
  background: var(--card);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
  text-align: center;
}

h1 {
  margin: 0 0 1rem;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage {
  height: 84px;
  display: grid;
  place-items: center;
  perspective: 400px;
}

.coin {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #ffe590, var(--gold) 55%, var(--gold-dark));
  border: 3px solid var(--gold-dark);
  box-shadow: 0 6px 14px rgba(245, 197, 66, .25);
  color: #7a5608;
  font-weight: 800;
  font-size: 1.6rem;
}

.coin.tick { animation: tick .45s ease-out; }

@keyframes tick {
  0%   { transform: translateY(0) rotateY(0) scale(1); }
  40%  { transform: translateY(-18px) rotateY(180deg) scale(1.12); }
  100% { transform: translateY(0) rotateY(360deg) scale(1); }
}

.count {
  display: block;
  margin-top: .5rem;
  font-size: clamp(4rem, 22vw, 6rem);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.count.bump { animation: bump .25s ease-out; }

@keyframes bump {
  50% { transform: scale(1.08); }
}

.label {
  margin: .25rem 0 1.5rem;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: .6rem;
}

button {
  font: inherit;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .08s, filter .15s;
}

button:active { transform: scale(.96); }
button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.add {
  flex: 1;
  padding: .9rem;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--gold);
  color: #2a1e02;
}

.add:hover { filter: brightness(1.07); }

.reset {
  padding: .9rem 1rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid #343846;
}

.reset:hover { color: var(--text); border-color: var(--muted); }

.hint {
  margin: 1rem 0 0;
  font-size: .75rem;
  color: #5d6170;
}

@media (prefers-reduced-motion: reduce) {
  .coin.tick, .count.bump { animation: none; }
}
