:root {
  --bg: #0a0c0b;
  --card: #131715;
  --ink: #f1f4ef;
  --soft: #8c958d;
  --accent: #b9f06c;
}

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

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 12px;
}

.card {
  position: relative;
  width: min(392px, 100%);
  padding: 18px 16px 10px;
  border-radius: 28px;
  background: linear-gradient(180deg, #1a1f1c, var(--card) 50%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 30px 60px -30px rgba(0, 0, 0, 0.9);
  overflow: hidden;
  isolation: isolate;
}
.card__glow {
  position: absolute;
  right: -100px;
  top: -160px;
  width: 360px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent), transparent);
  opacity: 0;
  z-index: -1;
  transition: opacity 0.9s ease;
}
.card[data-view="after"] .card__glow { opacity: 0.16; }

.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding: 0 2px 12px; }
.head__kicker { font-size: 11.5px; font-weight: 560; color: var(--soft); letter-spacing: 0.02em; white-space: nowrap; }
.head__title { font-size: 19px; line-height: 24px; font-weight: 680; font-stretch: 106%; letter-spacing: -0.015em; white-space: nowrap; }

.seg { position: relative; flex: none; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.seg__pill { position: absolute; left: 0; top: 3px; bottom: 3px; width: 50%; border-radius: 99px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.1)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18); transition: background-color 0.4s ease; }
.card[data-view="after"] .seg__pill { background: var(--accent); }
.seg button { position: relative; height: 28px; padding: 0 11px; border: 0; border-radius: 99px; background: none; color: var(--soft); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: color 0.3s ease; }
.seg button[aria-pressed="true"] { color: var(--ink); }
.card[data-view="after"] .seg button[aria-pressed="true"] { color: #14200a; }
.seg button.is-hot { color: var(--ink); }
.seg button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ---- the three results ---- */
.rows { list-style: none; }
.row { position: relative; padding: 11px 8px 6px; border-top: 1px solid rgba(255, 255, 255, 0.07); border-radius: 12px; transition: background-color 0.25s ease; }
.row.is-hot { background: rgba(255, 255, 255, 0.04); }
@media (hover: hover) { .row:hover { background: rgba(255, 255, 255, 0.04); } }
.row__top { display: flex; align-items: center; gap: 8px; }
.row__name { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 560; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row__chip { flex: none; height: 22px; overflow: hidden; border-radius: 99px; }
.row__chip span { display: block; height: 22px; padding: 0 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 18%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); font-size: 12px; line-height: 22px; font-weight: 660; white-space: nowrap; opacity: 0; }
.row__value { flex: none; min-width: 62px; height: 28px; overflow: hidden; font-size: 22px; line-height: 28px; font-weight: 700; font-stretch: 104%; letter-spacing: -0.01em; text-align: right; }
.row__value span { display: block; }
.row__bar { position: relative; height: 8px; margin-top: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.07); }
.row__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: inherit; background: linear-gradient(90deg, #5a625c, #8a938c); transform-origin: 0 50%; transform: scaleX(0); transition: filter 0.5s ease; }
.row__fill::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 60%, #2c3d18), var(--accent)); opacity: 0; transition: opacity 0.5s ease; }
.card[data-view="after"] .row__fill::after { opacity: 1; }
/* a thin mark stays where the bar was before */
.row__mark { position: absolute; left: 0; top: -3px; width: 2px; height: 14px; margin-left: -1px; border-radius: 2px; background: #f1f4ef; opacity: 0; }
.row__was { height: 16px; margin-top: 4px; font-size: 11.5px; line-height: 16px; color: var(--soft); opacity: 0; transition: opacity 0.3s ease; }
.card[data-view="after"] .row.is-hot .row__was { opacity: 1; }
@media (hover: hover) { .card[data-view="after"] .row:hover .row__was { opacity: 1; } }

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

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #101116;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}

@media (max-width: 360px) {
  .card { padding: 14px 10px 6px; }
  .head__title { font-size: 16.5px; }
  .head__kicker { font-size: 10.5px; }
  .seg button { padding: 0 8px; font-size: 12px; }
}
@media (max-height: 420px) {
  .row { padding-top: 8px; padding-bottom: 3px; }
  .row__was { margin-top: 2px; }
}
@media (min-width: 900px) and (min-height: 680px) {
  .card { zoom: 1.3; }
}
