:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(15, 28, 45, .86);
  --panel-strong: #101f33;
  --line: rgba(148, 163, 184, .14);
  --muted: #6f8298;
  --text: #f4f7fb;
  --blue: #38bdf8;
  --green: #4ade80;
  --gold: #fde68a;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 8% 3%, rgba(14, 165, 233, .16), transparent 26rem),
    radial-gradient(circle at 94% 20%, rgba(99, 102, 241, .13), transparent 25rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
}

.ambient {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.ambient-one {
  top: 14rem;
  right: -8rem;
  width: 22rem;
  height: 22rem;
  background: rgba(35, 178, 255, .1);
}

.ambient-two {
  top: 54rem;
  left: -10rem;
  width: 25rem;
  height: 25rem;
  background: rgba(124, 58, 237, .09);
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 2px;
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, .42);
  border-radius: 15px;
  color: #e0f6ff;
  background: linear-gradient(145deg, rgba(14, 165, 233, .3), rgba(30, 64, 175, .18));
  box-shadow: inset 0 0 18px rgba(56, 189, 248, .14);
  font-size: 22px;
  font-style: italic;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 18px;
  letter-spacing: .04em;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.live-status {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #718096;
  background: rgba(15, 23, 42, .72);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .14em;
}

.live-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #64748b;
}

.live-status.live {
  color: #86efac;
}

.live-status.live i {
  background: #22c55e;
  box-shadow: 0 0 12px #22c55e;
  animation: blink 1.1s infinite;
}

.hero {
  padding: 58px 0 28px;
  text-align: center;
}

.eyebrow,
.section-kicker,
.dialog-kicker {
  margin: 0;
  color: #6e849d;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .22em;
}

.hero h1 {
  margin: 10px 0 0;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.1;
  letter-spacing: -.055em;
  text-shadow: 0 0 36px rgba(56, 189, 248, .18);
}

.income-chip {
  display: inline-flex;
  margin-top: 16px;
  padding: 8px 14px;
  border: 1px solid rgba(34, 197, 94, .2);
  border-radius: 999px;
  color: #86efac;
  background: rgba(34, 197, 94, .08);
  font-size: 14px;
  transition: transform .2s, background .2s;
}

.income-chip.pulse {
  background: rgba(34, 197, 94, .14);
  transform: scale(1.025);
}

.income-note {
  margin: 10px 0 0;
  color: #52647a;
  font-size: 11px;
}

.timer-card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: min(720px, 100%);
  margin: 38px auto 0;
  padding: 24px 26px 29px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(21, 35, 54, .96), rgba(11, 23, 39, .96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, .17);
  text-align: left;
}

.timer-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.timer-card strong {
  display: block;
  margin-top: 6px;
  font-size: 35px;
  font-variant-numeric: tabular-nums;
}

.timer-goal {
  text-align: right;
}

.timer-goal strong {
  color: #7dd3fc;
  font-size: 17px;
}

.progress-track {
  position: absolute;
  right: 26px;
  bottom: 17px;
  left: 26px;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, .12);
}

.progress-track i {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0ea5e9, #6366f1);
  box-shadow: 0 0 16px rgba(56, 189, 248, .5);
  transition: width .1s linear;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 0 20px;
  border-top: 1px solid rgba(148, 163, 184, .1);
  border-bottom: 1px solid rgba(148, 163, 184, .1);
}

.stats > div {
  position: relative;
  padding: 20px 12px;
  text-align: center;
}

.stats > div + div::before {
  position: absolute;
  top: 17px;
  bottom: 17px;
  left: 0;
  width: 1px;
  content: "";
  background: rgba(148, 163, 184, .12);
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.stats strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.stats .green {
  color: var(--green);
}

.ticker {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 16px;
  border: 1px solid rgba(56, 189, 248, .12);
  border-radius: 14px;
  color: #9eb0c4;
  background: rgba(14, 165, 233, .055);
  font-size: 13px;
}

.ticker p {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  margin-top: 24px;
  padding: 24px;
  border: 1px solid rgba(250, 204, 21, .14);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(250, 204, 21, .07), transparent 34%),
    var(--panel);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
}

.section-head h2 {
  margin: 5px 0 0;
  font-size: 25px;
}

.section-head small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.my-rank,
.item-total {
  padding: 7px 11px;
  border-radius: 999px;
  color: var(--gold);
  background: rgba(234, 179, 8, .11);
  font-size: 12px;
  font-weight: 800;
}

.hidden {
  display: none !important;
}

.leaderboard-rows {
  margin-top: 16px;
}

.rank-empty {
  padding: 28px 0 14px;
  color: var(--muted);
  text-align: center;
}

.rank-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto auto;
  gap: 13px;
  align-items: center;
  padding: 13px 2px;
  border-top: 1px solid rgba(148, 163, 184, .08);
}

.rank-number {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  color: #71839a;
  background: rgba(100, 116, 139, .1);
  font-size: 12px;
  font-weight: 900;
}

.rank-row:nth-child(1) .rank-number {
  color: #422006;
  background: linear-gradient(145deg, #fde68a, #eab308);
}

.rank-row:nth-child(2) .rank-number {
  color: #253244;
  background: linear-gradient(145deg, #e2e8f0, #94a3b8);
}

.rank-row:nth-child(3) .rank-number {
  color: #431407;
  background: linear-gradient(145deg, #fdba74, #c2410c);
}

.rank-name {
  overflow: hidden;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-items {
  color: var(--muted);
  font-size: 12px;
}

.rank-score {
  color: #7dd3fc;
  font-weight: 850;
}

.shop {
  padding-top: 48px;
}

.shop-heading {
  margin-bottom: 28px;
}

.item-total {
  color: #8294a9;
  background: rgba(100, 116, 139, .08);
}

.category-group {
  margin-bottom: 38px;
}

.category-head {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.category-icon {
  display: grid;
  width: 44px;
  height: 44px;
  flex: none;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, .13);
  border-radius: 14px;
  background: rgba(14, 165, 233, .07);
  font-size: 22px;
}

.category-copy {
  min-width: 0;
  flex: 1;
}

.category-copy h3 {
  margin: 0;
  font-size: 18px;
}

.category-copy p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.category-count {
  color: #71849a;
  font-size: 12px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(21, 35, 54, .9), rgba(11, 23, 39, .94));
  box-shadow: 0 14px 38px rgba(0, 0, 0, .13);
  transition: transform .16s, border-color .16s, opacity .16s;
}

.product-card:hover {
  border-color: rgba(125, 211, 252, .25);
  transform: translateY(-2px);
}

.product-card.unaffordable {
  opacity: .5;
}

.product-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.product-emoji {
  display: grid;
  width: 57px;
  height: 57px;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, .11);
  border-radius: 17px;
  background: rgba(255, 255, 255, .035);
  font-size: 30px;
}

.product-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-end;
}

.owned,
.stock {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.owned {
  color: #bae6fd;
  background: rgba(14, 165, 233, .14);
}

.stock {
  color: #71859b;
  background: rgba(100, 116, 139, .09);
}

.stock.sold-out {
  color: #fda4af;
  background: rgba(225, 29, 72, .1);
}

.product-card h4 {
  margin: 16px 0 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-note {
  height: 36px;
  margin: 5px 0 0;
  overflow: hidden;
  color: #627388;
  font-size: 12px;
  line-height: 18px;
}

.product-bottom {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 15px;
}

.price {
  min-width: 0;
}

.price strong {
  display: block;
  overflow: hidden;
  color: #7dd3fc;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price small {
  display: inline-block;
  margin-top: 4px;
  padding: 3px 6px;
  border-radius: 6px;
  color: #60758d;
  background: rgba(100, 116, 139, .08);
  font-size: 9px;
}

.stepper {
  display: flex;
  gap: 6px;
}

.step-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #dbeafe;
  background: rgba(56, 189, 248, .14);
  font-size: 19px;
  font-weight: 800;
}

.step-button.minus {
  color: #7e90a5;
  background: rgba(148, 163, 184, .08);
}

.step-button:disabled {
  color: #465466;
  background: rgba(71, 85, 105, .08);
  cursor: not-allowed;
  opacity: .55;
}

footer {
  padding: 14px 0 42px;
  color: #506178;
  font-size: 11px;
  text-align: center;
}

.game-dialog {
  width: 540px;
  max-width: calc(100vw - 32px);
  margin: auto;
  padding: 42px 36px 34px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, .2);
  border-radius: 30px;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(14, 165, 233, .18), transparent 38%),
    linear-gradient(150deg, #142238, #091422 70%);
  box-shadow: 0 40px 110px rgba(0, 0, 0, .58);
  text-align: center;
}

.game-dialog::backdrop {
  background: rgba(3, 9, 17, .84);
  backdrop-filter: blur(14px);
}

.dialog-glow {
  position: absolute;
  top: -80px;
  left: 50%;
  width: 260px;
  height: 160px;
  border-radius: 50%;
  background: rgba(14, 165, 233, .12);
  filter: blur(55px);
  transform: translateX(-50%);
}

.dialog-icon {
  position: relative;
  display: grid;
  width: 82px;
  height: 82px;
  margin: 0 auto 20px;
  place-items: center;
  border: 1px solid rgba(125, 211, 252, .22);
  border-radius: 24px;
  background: rgba(14, 165, 233, .1);
  font-size: 42px;
}

.game-dialog h2 {
  margin: 12px 0 0;
  font-size: clamp(34px, 7vw, 48px);
  letter-spacing: -.045em;
}

.dialog-callout {
  display: block;
  margin-top: 8px;
  color: #7dd3fc;
  font-size: 23px;
}

.game-dialog > p:not(.dialog-kicker) {
  margin: 18px 0 22px;
  color: #91a3b8;
  font-size: 14px;
  line-height: 1.7;
}

.nickname-field {
  display: block;
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(3, 10, 20, .28);
  text-align: left;
}

.nickname-field span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.nickname-field input {
  width: 100%;
  margin-top: 5px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 17px;
  font-weight: 700;
}

.primary-button {
  display: flex;
  width: 100%;
  height: 58px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(120deg, #0284c7, #4f46e5);
  box-shadow: 0 18px 34px rgba(37, 99, 235, .2);
  font-weight: 850;
}

.ghost-button {
  margin-top: 10px;
  padding: 10px 16px;
  color: var(--muted);
  background: transparent;
}

.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid rgba(148, 163, 184, .1);
  border-radius: 16px;
  background: rgba(255, 255, 255, .025);
}

.result-stats > div + div {
  border-left: 1px solid rgba(148, 163, 184, .12);
}

.result-stats span,
.result-stats strong {
  display: block;
}

.result-stats span {
  color: var(--muted);
  font-size: 11px;
}

.result-stats strong {
  margin-top: 5px;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}

@media (max-width: 900px) {
  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-shell {
    width: min(100% - 20px, 540px);
  }

  .site-header {
    padding-top: max(18px, env(safe-area-inset-top));
  }

  .brand strong {
    font-size: 16px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero h1 {
    font-size: clamp(34px, 10.4vw, 54px);
    word-break: break-all;
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-card {
    padding: 14px;
    border-radius: 17px;
  }

  .product-emoji {
    width: 50px;
    height: 50px;
    font-size: 26px;
  }

  .product-card h4 {
    font-size: 15px;
  }

  .step-button {
    width: 34px;
    height: 34px;
  }

  .panel {
    padding: 20px 16px 14px;
  }

  .rank-row {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .rank-items {
    display: none;
  }

  .game-dialog {
    padding: 34px 24px 28px;
    border-radius: 26px;
  }
}

@media (max-width: 390px) {
  .brand small,
  .live-status span {
    display: none;
  }

  .timer-card {
    padding-right: 18px;
    padding-left: 18px;
  }

  .progress-track {
    right: 18px;
    left: 18px;
  }

  .timer-card strong {
    font-size: 30px;
  }

  .timer-goal strong {
    font-size: 14px;
  }

  .product-card {
    padding: 12px;
  }

  .product-bottom {
    align-items: center;
  }

  .price small {
    display: none;
  }
}
