:root {
  --fondo: #000000;          /* the page */
  --carta: #0f1012;          /* the spending card */
  --bordo: rgba(255, 255, 255, 0.08); /* hairlines */
  --pillola: #16171a;        /* the button */
  --pillola-alta: #202227;   /* the top of the button, a touch lighter */
  --testo: #f3f3f5;          /* main text */
  --spento: #85868d;         /* secondary text */
  --menta: #7ef0c1;          /* the accent: round-ups, coins, the pot */
  --menta-scura: #1f7a5b;    /* the deep mint at the bottom of the pot */
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--fondo);
  color: var(--testo);
  font-family: "Mona Sans Variable", system-ui, sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.stage {
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
}
.fit { transform-origin: 50% 50%; }
.col {
  position: relative;
  width: 320px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 16px;
}

/* ---- the spending card ---- */
.card {
  background: linear-gradient(180deg, #131417, var(--carta));
  border: 1px solid var(--bordo);
  border-radius: 22px;
  padding: 16px 16px 8px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 24px 40px -24px rgba(0, 0, 0, 0.9);
}
.card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 2px 10px;
}
.card__title { font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.card__when { font-size: 12px; color: var(--spento); }
.rows { list-style: none; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 2px;
  border-top: 1px solid var(--bordo);
  transition: background-color 0.25s ease;
  border-radius: 10px;
}
.row:first-child { border-top: 0; }
.row__icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #1c1d21;
  border: 1px solid var(--bordo);
  display: grid;
  place-items: center;
}
.row__icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #c9cad0;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.row__icon circle { fill: #c9cad0; stroke: none; }
.row__text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row__name { font-size: 13.5px; font-weight: 560; }
.row__cat { font-size: 11.5px; color: var(--spento); margin-top: 1px; }
.row__money {
  display: flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}
.row__amount { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.row__cents { transition: color 0.3s ease; }
.row.is-lit .row__cents { color: var(--menta); }
.row__chip {
  font-size: 11px;
  font-weight: 650;
  color: #06120d;
  background: var(--menta);
  border-radius: 999px;
  padding: 3px 7px 3px;
  opacity: 0;
  transform-origin: 100% 50%;
  box-shadow: 0 0 0 1px rgba(126, 240, 193, 0.25), 0 6px 14px -6px rgba(126, 240, 193, 0.55);
}
@media (hover: hover) {
  .row:hover { background: rgba(255, 255, 255, 0.025); }
}

/* ---- the button ---- */
.btn {
  position: relative;
  appearance: none;
  border: 0;
  font: inherit;
  color: var(--testo);
  height: 60px;
  border-radius: 999px;
  padding: 0 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--pillola-alta), var(--pillola));
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.09) inset,
    0 -1px 0 rgba(0, 0, 0, 0.6) inset,
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 30px -16px rgba(0, 0, 0, 0.95);
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.4s ease;
}
.btn.is-on {
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.09) inset,
    0 -1px 0 rgba(0, 0, 0, 0.6) inset,
    0 0 0 1px rgba(126, 240, 193, 0.28),
    0 18px 34px -14px rgba(126, 240, 193, 0.22);
}
.btn:focus-visible { outline: 2px solid var(--menta); outline-offset: 3px; }
.btn__light {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(140px 70px at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.07), transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
@media (hover: hover) {
  .btn:hover .btn__light { opacity: 1; }
}

.pot {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
}
.pot svg { width: 40px; height: 40px; display: block; overflow: visible; }
.pot__ring { fill: #0b0c0e; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1.4; }
.btn.is-on .pot__ring { stroke: rgba(126, 240, 193, 0.55); }
.pot__level { fill: var(--menta-scura); }
.pot__wave { fill: var(--menta); opacity: 0.92; }
.pot__slot { stroke: #2b2d32; stroke-width: 2.2; stroke-linecap: round; }
.pot__ripple {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid var(--menta);
  opacity: 0;
  pointer-events: none;
}

.label { flex: 1; position: relative; height: 22px; overflow: hidden; text-align: left; }
.label__win { display: flex; flex-direction: column; }
.label__a, .label__b {
  height: 22px;
  line-height: 22px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  white-space: nowrap;
}
.label__b { color: var(--menta); }

.total {
  position: relative;
  height: 22px;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
  font-weight: 650;
  color: var(--testo);
  min-width: 52px;
  text-align: right;
  opacity: 0;
}
.total__win { display: block; position: relative; height: 22px; }
.total__now, .total__next {
  position: absolute;
  right: 0;
  top: 0;
  line-height: 22px;
}

/* ---- the hint ---- */
.hint {
  position: relative;
  height: 18px;
  font-size: 12.5px;
  color: var(--spento);
  text-align: center;
}
.hint__a, .hint__b { position: absolute; left: 0; right: 0; top: 0; }
.hint__b { opacity: 0; }
.hint__b b { color: var(--menta); font-weight: 650; font-variant-numeric: tabular-nums; }

/* ---- the flying coins ---- */
.coin {
  position: absolute;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #e9fff5 0 18%, var(--menta) 45%, #2fb385 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25) inset, 0 4px 10px -2px rgba(126, 240, 193, 0.55);
  pointer-events: none;
  z-index: 5;
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.cursor {
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  fill: #ffffff;
  stroke: #000000;
  stroke-width: 1.3;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
  pointer-events: none;
  opacity: 0;
  z-index: 10;
}
