:root {
  --bg: #0e1621;
  --bar: rgba(14, 22, 33, 0.92);
  --bubble: #182533;
  --ink: #ffffff;
  --muted: #8b9aab;
  --line: rgba(255, 255, 255, 0.08);
  --blue: #2aabee;
  --key: #232e3c;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
  min-height: 100%;
  background:
    radial-gradient(1200px 480px at 50% -10%, rgba(42, 171, 238, 0.16), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

img { max-width: 100%; }

.top {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bar);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.top-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding: 12px 24px;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #17324a;
}

.brand strong { display: block; font-size: 16px; }
.brand small { color: var(--muted); font-size: 13px; }

nav {
  margin-left: auto;
  display: flex;
  gap: 8px;
}

nav a {
  color: var(--ink);
  text-decoration: none;
  background: var(--key);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 650;
}

nav a:hover { background: var(--blue); }

main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px 24px 48px;
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.stage {
  position: relative;
  overflow: hidden;
  min-height: 100%;
  border-radius: 28px;
  padding: 32px 22px 22px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 36%, #9be08a 0%, #46b35f 36%, #1d7a4d 70%, #14543a 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.28) 1.1px, transparent 1.3px);
  background-size: 22px 22px;
  mask-image: radial-gradient(circle at 50% 40%, #000 20%, transparent 75%);
  opacity: 0.45;
}

.stage > * { position: relative; }

.hero {
  width: min(180px, 46%);
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  filter: drop-shadow(0 16px 24px rgba(0, 0, 0, 0.28));
}

.kicker {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1 {
  margin: 2px 0 0;
  font-size: 36px;
  letter-spacing: -0.03em;
}

.wear {
  margin: 8px auto 0;
  max-width: 28ch;
  color: rgba(255, 255, 255, 0.9);
  font-size: 15px;
}

.pills {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.pills span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(8, 28, 20, 0.35);
  font-size: 14px;
}

.panel, .lead, .decide button {
  border-radius: 18px;
  background: var(--bubble);
}

.panel, .lead, .stage, .plot, .chart-head, .decide, .brand, nav {
  min-width: 0;
  max-width: 100%;
}

.panel { padding: 16px 16px 14px; min-width: 0; }
.lead { padding: 16px 18px; }
.lead p, .panel p { margin: 0; }

.ca {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin-top: 12px;
  min-width: 0;
}

.ca code {
  flex: 1 1 16rem;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.ca button,
.ca a {
  flex: none;
  border: 0;
  border-radius: 999px;
  background: var(--key);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  padding: 6px 12px;
  cursor: pointer;
}

.ca button:hover,
.ca a:hover { background: var(--blue); }

.chart-panel { min-height: 100%; }

.label {
  color: var(--blue);
  font-size: 13px;
  font-weight: 650;
}

.chart-head, .panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.big {
  margin-top: 2px;
  font-size: 32px;
  font-weight: 720;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.delta { margin-top: 2px; color: var(--muted); font-size: 13px; }
.delta.up { color: #5ee0a0; }
.delta.down { color: #ff8f8f; }

.ranges { display: flex; gap: 4px; flex: none; }

.ranges button, .decide button {
  border: 0;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}

.ranges button {
  min-width: 44px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--key);
  color: var(--muted);
  font-size: 13px;
}

.ranges button.on { background: var(--blue); color: #fff; }

.plot { position: relative; margin-top: 12px; min-width: 0; }

#chart { display: block; width: 100%; max-width: 100%; height: auto; }

.tip {
  position: absolute;
  top: 8px;
  left: 8px;
  margin: 0;
  padding: 4px 8px;
  border-radius: 8px;
  background: rgba(14, 22, 33, 0.88);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.note, .foot, .choice, .empty, .fees {
  color: var(--muted);
  font-size: 13px;
}

.fees { margin: 10px 0 0; }
.fees b { color: var(--ink); font-variant-numeric: tabular-nums; }

.goal {
  margin-top: 14px;
  width: min(220px, 100%);
  min-width: 0;
}
#goal-frog {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  background: #101820;
}
.goal-track {
  margin-top: 8px;
  height: 10px;
  border-radius: 999px;
  background: var(--key);
  overflow: hidden;
}
#goal-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--blue);
}
.goal-text {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.note { margin-top: 10px; }

.gifts-panel, .lead, .decide, .choice, .foot { grid-column: 1 / -1; }

.count {
  margin: 0;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--key);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.empty { margin-top: 10px; }

.held {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.held:empty { display: none; }

.held figure { margin: 0; min-width: 0; }

.held a {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 8px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.held a:hover { background: rgba(42, 171, 238, 0.16); }

.held img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 14px;
  background: #101820;
}

.held figcaption {
  margin-top: 8px;
  font-weight: 700;
}

.held p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 0;
}

.facts div {
  padding: 10px 10px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.facts dt { color: var(--muted); font-size: 12px; }
.facts dd {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.models {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.models figure { margin: 0; text-align: center; min-width: 0; }

.gift-anim {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: #101820;
}

.gift-anim img,
.gift-anim svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.models figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.3;
}

.decide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.decide button {
  min-width: 0;
  min-height: 92px;
  padding: 14px 14px 12px;
  text-align: left;
  background: var(--key);
}

.decide button strong { display: block; font-size: 16px; }
.decide button span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.decide button.on { background: var(--blue); }
.decide button.on span { color: rgba(255, 255, 255, 0.88); }

.choice { margin: 0; }

.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin: 0;
}

.foot a { color: var(--blue); text-decoration: none; }

@media (max-width: 800px) {
  .top-inner, main { padding-left: 14px; padding-right: 14px; }
  main {
    grid-template-columns: 1fr;
    padding-top: 14px;
  }
  .stage, .chart-panel, .gifts-panel, .lead, .decide, .choice, .foot { grid-column: auto; }
  .big { font-size: 26px; }
  h1 { font-size: 32px; }
  .decide { grid-template-columns: 1fr; }
}
