:root {
  --rewards-primary: #9875fb;
  --rewards-primary-deep: #7f5be7;
  --rewards-ink: #30333a;
  --rewards-muted: #858b99;
  --rewards-bg: #f5f6f8;
  --rewards-card: #fff;
  --rewards-tag: #f5f1ff;
  --rewards-line: #ececf1;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--rewards-bg); }
body {
  min-width: 320px;
  margin: 0;
  padding-bottom: calc(68px + env(safe-area-inset-bottom));
  color: var(--rewards-ink);
  background: var(--rewards-bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF UI Text", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.rewards-page {
  position: relative;
  width: min(750px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--rewards-bg);
}

.rewards-cover {
  position: absolute;
  z-index: 0;
  top: 0;
  right: 0;
  left: 0;
  height: 205px;
  background: url("assets/rewards/home-bg.webp") center top / 100% 205px no-repeat;
  pointer-events: none;
}

.rewards-main {
  position: relative;
  z-index: 1;
  padding: max(14.56px, calc(env(safe-area-inset-top) + 0px)) 10.4px 28px;
}

.wallet-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 24.96px;
  padding: 0 10.4px;
}

.wallet-strip h1 {
  margin: 0;
  color: #555a64;
  font-size: 12.48px;
  font-weight: 500;
  line-height: 18.72px;
}

.wallet-total {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  color: #555a64;
  font-size: 12px;
}

.wallet-total img { width: 24.96px; height: 24.96px; object-fit: contain; }
.wallet-total strong { color: #282c33; font-size: 16.64px; font-weight: 800; line-height: 24.96px; }
.wallet-total span { margin-left: 0; }

.reward-card {
  width: 100%;
  border-radius: 8px;
  background: var(--rewards-card);
  box-shadow: 0 1px 1px rgba(36, 39, 48, .01);
}

.checkin-card {
  margin-top: 12.48px;
  padding: 16.64px 10.4px 16.64px;
}

.reward-card h2 {
  margin: 0;
  color: var(--rewards-ink);
  font-size: 18.72px;
  font-weight: 800;
  line-height: 28.08px;
}

.checkin-status {
  margin: 0;
  color: var(--rewards-muted);
  font-size: 12.48px;
  line-height: 18.72px;
}

.checkin-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  margin-top: 15.6px;
  padding: 0 4.16px;
}

.reward-day {
  min-width: 0;
  color: #7d8490;
  font-size: 10.4px;
  line-height: 24.96px;
  text-align: center;
}

.reward-day:not(:first-child) { margin-left: 8.32px; }

.reward-day-box {
  height: 60.3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 10.4px 0 6.24px;
  border-radius: 5px;
  background: var(--rewards-tag);
}

.reward-day-box img {
  width: 24.96px;
  height: 24.96px;
  display: block;
  object-fit: contain;
}

.reward-day-box-final img { width: 29.12px; height: 26px; margin-top: -1px; }
.reward-day-box span { margin-top: 3.12px; color: #383b44; font-size: 10.4px; line-height: 15.6px; }
.reward-day > span { display: flex; justify-content: center; height: 23.92px; margin-top: 0; line-height: 23.92px; white-space: nowrap; }

.reward-day.claimed .reward-day-box { background: #eee8ff; box-shadow: inset 0 0 0 1px rgba(152, 117, 251, .16); }
.reward-day.claimed > span { color: var(--rewards-primary-deep); font-weight: 700; }

.checkin-button {
  width: min(207.98px, 75%);
  height: 37.44px;
  display: block;
  margin: 16.64px auto 0;
  border-radius: 999px;
  color: #fff;
  background: var(--rewards-primary);
  font-size: 15.6px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(152, 117, 251, .14);
}

.checkin-button:hover { background: var(--rewards-primary-deep); }
.checkin-button:focus-visible, .task-action:focus-visible { outline: 2px solid var(--rewards-primary-deep); outline-offset: 2px; }
.checkin-button.is-checked { color: #7661b8; background: #eeeaff; box-shadow: none; }
.checkin-button:disabled { cursor: default; }
.checkin-button:disabled:not(.is-checked) { opacity: .65; }
.checkin-reset { margin: 8px 0 0; color: var(--rewards-muted); font-size: 10px; line-height: 1.5; text-align: center; }

.tasks-card { margin-top: 10.4px; padding: 16.64px 10.4px 16.64px; }
.task-row {
  height: 81.08px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16.64px 12.48px;
  border-bottom: 0;
}

.task-copy { min-width: 0; padding-top: 1px; }
.task-copy > strong { display: block; color: #363940; font-size: 16.64px; font-weight: 500; line-height: 24.96px; }
.task-reward { display: inline-flex; align-items: center; gap: 4.16px; margin-top: 4.16px; color: var(--rewards-primary); font-size: 12.48px; line-height: 18.72px; }
.task-reward img { width: 14.56px; height: 14.56px; object-fit: contain; }

.task-action {
  width: 62.4px;
  height: 27.04px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--rewards-primary);
  background: #f6f3fb;
  font-size: 12.48px;
  font-weight: 400;
  line-height: 18.72px;
}

.task-action:hover { color: #fff; background: var(--rewards-primary); }
.task-action.is-done { color: #7d8490; background: #f1f1f4; }

.rewards-bottom-nav {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(750px, 100%);
  height: calc(68px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 auto;
  padding: 7px 8px env(safe-area-inset-bottom);
  border-top: 1px solid #e9eaee;
  background: rgba(255, 255, 255, .98);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.rewards-nav-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding-top: 1px;
  color: #777d8b;
  font-size: 11px;
  line-height: 1;
}

.rewards-nav-item img { width: 24px; height: 24px; display: block; object-fit: contain; }
.rewards-nav-item.active { color: var(--rewards-primary); font-weight: 700; }

.rewards-toast {
  position: fixed;
  z-index: 50;
  right: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  max-width: calc(100% - 40px);
  padding: 10px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(35, 34, 44, .9);
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transform: translate(50%, 8px);
  transition: opacity .18s ease, transform .18s ease;
}

.rewards-toast.visible { opacity: 1; transform: translate(50%, 0); }

@media (max-width: 360px) {
  .rewards-main { padding-inline: 8px; }
  .checkin-card { padding-inline: 9px; }
  .checkin-days { padding-inline: 2px; }
  .reward-day:not(:first-child) { margin-left: 4px; }
  .reward-day-box { padding-inline: 0; }
  .reward-day > span { font-size: 9px; }
}
