:root {
  --primary: #d9a441;
  --primary-dark: #c28f34;
  --accent: #2f6a54;
  --accent-dark: #1f4a3d;
  --ink-on-gold: #4a3413;
  --success: #16a34a;
  --danger: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Karla', sans-serif;
  background: radial-gradient(circle at top, var(--accent) 0%, var(--accent-dark) 70%);
  color: #eef0ea;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.wrap { width: 100%; max-width: 460px; position: relative; }

.back-link { display: inline-block; margin-bottom: 20px; color: #eef0ea; text-decoration: none; font-size: 14px; opacity: 0.8; }
.back-link:hover { opacity: 1; }

.header-row { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.header-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(217, 164, 65, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.title { font-family: 'Bitter', serif; font-size: 21px; margin: 0 0 2px; color: #fff; }
.subtitle { font-size: 13px; opacity: 0.8; margin: 0; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.score-chip {
  font-size: 13px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(217, 164, 65, 0.3);
  border-radius: 999px;
  padding: 6px 12px;
}
.score-chip strong { color: var(--primary); font-family: 'JetBrains Mono', monospace; }

.target-card {
  background: rgba(0, 0, 0, 0.18);
  border-radius: 16px;
  padding: 24px 20px;
  text-align: center;
  margin-bottom: 10px;
}
.target-label, .total-label { font-size: 11px; letter-spacing: 0.08em; color: var(--primary); font-weight: 700; }
.target-value { font-family: 'JetBrains Mono', monospace; font-size: 34px; font-weight: 800; color: #fff; margin: 4px 0 16px; }
.total-value { font-family: 'JetBrains Mono', monospace; font-size: 26px; font-weight: 700; color: #fff; margin-top: 4px; }
.total-value.error { color: #ff9b9b; }

.tap-hint { text-align: center; font-size: 12px; opacity: 0.65; margin: 14px 0 10px; }

.denominations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}
.denom-btn {
  padding: 16px 6px;
  border-radius: 12px;
  border: 2px solid var(--primary);
  background: rgba(217, 164, 65, 0.12);
  color: var(--primary);
  font-family: 'JetBrains Mono', monospace;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.12s ease;
}
.denom-btn:hover { background: var(--primary); color: var(--ink-on-gold); }
.denom-btn:active { transform: translateY(2px); }

.restart-btn {
  display: block;
  margin: 0 auto;
  border: 1px solid rgba(217, 164, 65, 0.4);
  background: transparent;
  color: #eef0ea;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.restart-btn:hover { background: var(--primary); border-color: var(--primary); color: var(--ink-on-gold); }

.win-banner {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(22, 163, 74, 0.18);
  border: 1px solid var(--success);
  text-align: center;
  font-size: 14px;
}
.win-banner strong { color: var(--primary); font-family: 'JetBrains Mono', monospace; }
.hidden { display: none; }
