:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #171820;
  background: #f7f8fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --blue: #3949f5;
  --muted: #858ba0;
}

* { box-sizing: border-box; }
body { min-width: 320px; min-height: 100vh; margin: 0; background: #f7f8fc; }
a { color: inherit; text-decoration: none; }

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(50px, env(safe-area-inset-top)) 24px calc(100px + env(safe-area-inset-bottom));
}

.topbar { display: flex; min-height: 48px; align-items: center; justify-content: space-between; }
.brand { font-size: 20px; font-weight: 850; letter-spacing: -.7px; }
.brand span { color: var(--blue); }
.avatar { display: grid; width: 44px; height: 44px; padding: 11px; place-items: center; border-radius: 50%; color: #fff; background: #171820; }
.avatar svg { width: 22px; fill: currentColor; }

.page-heading { margin: 22px 0 20px; }
.page-heading h1 { margin: 0; font-size: 36px; line-height: 1.12; letter-spacing: -1.4px; }
.page-heading p { margin: 7px 0 0; color: var(--muted); font-size: 16px; }

.reward-summary {
  display: flex;
  min-height: 104px;
  align-items: center;
  justify-content: space-around;
  padding: 13px 10px;
  border: 1px solid #f0f1f6;
  border-radius: 20px;
  background: #fff;
}

.summary-stat { display: flex; min-width: 0; align-items: center; gap: 12px; }
.summary-icon { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; border-radius: 15px; background: #f0f1ff; }
.summary-icon svg { width: 25px; fill: var(--blue); }
.summary-stat div { display: grid; gap: 2px; }
.summary-stat strong { font-size: 28px; line-height: 1; }
.summary-stat div span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.summary-divider { width: 1px; height: 58px; background: #e6e7ef; }

.reward-list { display: grid; gap: 14px; margin-top: 18px; }
.reward-card {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 18px;
  border: 1px solid #eff0f5;
  border-radius: 20px;
  background: #fff;
}

.reward-card.is-primary {
  min-height: 194px;
  border: 0;
  color: #fff;
  background: linear-gradient(125deg, #3947f2 0%, #4e60ff 100%);
  box-shadow: 0 12px 24px rgb(54 69 227 / 14%);
}

.reward-icon { display: grid; width: 68px; height: 68px; place-items: center; border-radius: 17px; color: var(--blue); background: #f0f1ff; }
.reward-icon svg { width: 33px; fill: currentColor; }
.is-primary .reward-icon { color: #fff; background: rgb(255 255 255 / 22%); }
.reward-content { min-width: 0; }
.reward-kicker { margin: 2px 0 6px; color: #858ba0; font-size: 11px; font-weight: 700; letter-spacing: .55px; text-transform: uppercase; }
.is-primary .reward-kicker { color: rgb(255 255 255 / 83%); }
.reward-content h2 { margin: 0; font-size: 29px; line-height: 1.05; letter-spacing: -.8px; }
.reward-description { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.35; }
.is-primary .reward-description { color: rgb(255 255 255 / 89%); }
.reward-condition { margin: 5px 0 0; color: #9297aa; font-size: 12px; line-height: 1.35; }
.is-primary .reward-condition { color: rgb(255 255 255 / 82%); }
.reward-status {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 7px;
  margin-top: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #73788d;
  background: #f0f1f6;
  font-size: 13px;
  font-weight: 650;
}

.reward-status svg { width: 17px; height: 17px; fill: currentColor; }
.is-primary .reward-status { color: #656b80; background: #f0f1f6; }
.reward-status.is-claimable { color: #158746; background: #e2f8e9; }
.reward-status.is-claimed { color: #71778c; background: #e9ebf2; }
.reward-arrow { position: absolute; right: 17px; bottom: 17px; display: grid; width: 40px; height: 40px; place-items: center; border-radius: 50%; color: #65708c; background: #f0f1f6; font-size: 23px; }
.is-primary .reward-arrow { color: var(--blue); background: #fff; }

.history-section { margin-top: 24px; }
.history-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.history-heading h2 { margin: 0; font-size: 20px; letter-spacing: -.5px; }
.history-heading > span { color: #343746; font-size: 28px; line-height: 1; }
.reward-history { min-height: 64px; }
.history-empty, .history-item { display: flex; min-height: 64px; align-items: center; gap: 12px; padding: 10px 14px; border: 1px solid #eff0f5; border-radius: 16px; background: #fff; }
.history-empty { color: var(--muted); font-size: 13px; }
.history-item-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 13px; color: var(--blue); background: #f0f1ff; }
.history-item-icon svg { width: 22px; fill: currentColor; }
.history-item-copy { min-width: 0; flex: 1; }
.history-item-copy strong { display: block; font-size: 15px; }
.history-item-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.history-item-status { color: #71778c; font-size: 12px; white-space: nowrap; }
.reward-notice { margin: 10px 2px 0; color: #656b80; font-size: 13px; }
.reward-notice[hidden] { display: none; }

.bottom-nav {
  position: fixed;
  z-index: 5;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(100%, 520px);
  min-height: calc(82px + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid #f0f1f6;
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(12px);
}

.nav-item { display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 5px; color: #a2a5b8; font-size: 12px; font-weight: 500; }
.nav-item svg { width: 24px; height: 24px; fill: currentColor; }
.nav-item.is-active { color: var(--blue); }

@media (max-width: 370px) {
  .app-shell { padding-right: 18px; padding-left: 18px; }
  .reward-summary { padding-right: 6px; padding-left: 6px; }
  .summary-stat { gap: 8px; }
  .summary-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .summary-stat strong { font-size: 25px; }
  .reward-card { grid-template-columns: 58px minmax(0, 1fr); gap: 11px; padding: 15px; }
  .reward-icon { width: 58px; height: 58px; }
  .reward-content h2 { font-size: 26px; }
}

@media (min-width: 520px) {
  .app-shell { min-height: calc(100vh - 18px); margin-top: 9px; border-radius: 28px; background: #fafbfe; }
  .bottom-nav { border-right: 1px solid #f0f1f6; border-left: 1px solid #f0f1f6; border-radius: 18px 18px 0 0; }
}
