@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap");

:root {
  --bg: #f4f3ef;
  --surface: #ffffff;
  --primary: #0f6cf5;
  --accent: #f3722c;
  --text: #1f1f1f;
  --muted: #6b6b6b;
  --shadow: rgba(15, 15, 15, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Poppins", "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fef6ec 0%, #f4f3ef 60%, #eef2f6 100%);
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: linear-gradient(90deg, #0b2a5b, #1f6feb);
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: none;
  color: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
}

.brand-currency {
  font-size: 1em;
  vertical-align: baseline;
  line-height: 1;
}

.brand-mark {
  width: 168px;
  height: 108px;
  border-radius: 10px;
  display: block;
  object-fit: contain;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.nav-links a {
  font-weight: 500;
  color: #eaf2ff;
  padding: 6px 10px;
  border-radius: 999px;
}

.nav-links a:hover {
  color: #fff;
}

.nav-links a.active {
  color: #0b2a5b;
  background: #eaf2ff;
}

.nav-links .cta {
  background: #fff;
  color: #0b2a5b;
  padding: 8px 16px;
  border-radius: 20px;
}

.nav-links .cta:hover {
  color: #0b2a5b;
  background: #eaf2ff;
}

.nav-links .cta.active {
  background: #eaf2ff;
  color: #0b2a5b;
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.hero-card {
  background: var(--surface);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 12px 30px var(--shadow);
  min-width: 260px;
}

.child-hero .hero-card {
  background: linear-gradient(135deg, #0f6cf5 0%, #17b897 100%);
  color: #fff;
}

.card {
  background: var(--surface);
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 12px 30px var(--shadow);
}

.card.narrow {
  max-width: 420px;
  margin: 60px auto;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.mini-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.subtitle {
  color: var(--muted);
  margin-top: 6px;
}

.balance {
  font-weight: 700;
  font-size: 20px;
}

.balance.large {
  font-size: 32px;
}

.pill {
  font-size: 12px;
  background: #eef2f6;
  padding: 4px 10px;
  border-radius: 12px;
  margin-left: 6px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.form-grid input,
.form-grid select {
  width: 100%;
}

.form-grid .full-width {
  width: 100%;
}

.form-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

input,
select,
button {
  font-family: inherit;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #d6d6d6;
}

label {
  display: grid;
  gap: 6px;
  font-size: 14px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  width: 100%;
}

.button.ghost {
  background: #eef2f6;
  color: var(--text);
}

.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
}

.list li:last-child {
  border-bottom: none;
}

.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table th,
.table td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid #f2f2f2;
}

.alert {
  background: #ffe4de;
  color: #a13b2b;
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 12px;
}

.alert.success {
  background: #def7e8;
  color: #1f6b48;
}

.muted {
  color: var(--muted);
}

.goal {
  margin-bottom: 12px;
}

.goal-header {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}

.progress {
  height: 10px;
  background: #edf0f4;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #17b897, #0f6cf5);
}

.positive {
  color: #1a936f;
}

.negative {
  color: #d64550;
}

.site-footer {
  text-align: center;
  padding: 28px 16px 36px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid rgba(15, 15, 15, 0.05);
}

.site-footer .footer-copy {
  font-weight: 500;
}

.site-footer .footer-links {
  display: flex;
  justify-content: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.site-footer .footer-links a {
  font-weight: 600;
  color: #5f6b78;
}

.site-footer .footer-links a:hover {
  color: var(--primary);
}

.giftcard-item {
  display: grid;
  gap: 16px;
  align-items: start;
}

.giftcard-actions {
  display: grid;
  gap: 12px;
}

.goal-card {
  display: grid;
  gap: 12px;
  align-items: start;
}

.affiliate-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.bucket {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.bucket-meter {
  display: grid;
  gap: 10px;
  margin: 12px 0;
}

.bucket-meter-row {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.bucket-label {
  font-weight: 600;
}

.bucket-value {
  color: var(--muted);
  font-size: 13px;
}

.bucket-why {
  margin-top: 10px;
}

.bucket-why p {
  margin: 4px 0;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f2f2f2;
}

.timeline-item:last-child {
  border-bottom: none;
}

.timeline-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.timeline-meta {
  font-size: 12px;
}

.timeline-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #cbd5e1;
  flex-shrink: 0;
}

.timeline-dot.tag-decision {
  background: #d64550;
  box-shadow: 0 0 0 4px rgba(214, 69, 80, 0.15);
}

.timeline-dot.tag-recovery {
  background: #1a936f;
  box-shadow: 0 0 0 4px rgba(26, 147, 111, 0.15);
}

.timeline-dot.tag-goal {
  background: #2b4da1;
  box-shadow: 0 0 0 4px rgba(43, 77, 161, 0.15);
}

.timeline-prompt {
  font-size: 12px;
  margin-top: 4px;
}

.timeline-links {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.save-status {
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.buddy {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 16px;
  align-items: center;
}

.buddy-face {
  width: 90px;
  height: 90px;
  border-radius: 30px;
  background: linear-gradient(135deg, #ffb703, #fb8500);
  position: relative;
  display: grid;
  place-items: center;
  box-shadow: 0 12px 20px rgba(251, 133, 0, 0.25);
}

.buddy-eye {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #1f1f1f;
  position: absolute;
  top: 30px;
}

.buddy-eye:first-child {
  left: 24px;
}

.buddy-eye:last-child {
  right: 24px;
}

.buddy-smile {
  width: 30px;
  height: 14px;
  border-bottom: 4px solid #1f1f1f;
  border-radius: 0 0 20px 20px;
  position: absolute;
  bottom: 22px;
}

.buddy-title {
  font-weight: 700;
  font-size: 18px;
}

.buddy-bar {
  margin-top: 8px;
}

.buddy-progress {
  font-size: 12px;
  color: var(--muted);
  margin-top: 6px;
}

.decision-form {
  margin-bottom: 10px;
}

.decision-preview {
  padding: 12px;
  border-radius: 16px;
  background: #f7f7fb;
  border: 1px solid #e7e9f0;
}

.decision-impact {
  font-weight: 700;
  font-size: 16px;
}

.decision-goal {
  margin-top: 6px;
}

.quest-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.quest-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f8ff;
  border: 1px dashed #c7d8f7;
  font-weight: 600;
}

.quest-check {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: #0f6cf5;
  box-shadow: inset 0 0 0 3px #fff;
}

.level-up-banner {
  position: fixed;
  top: 90px;
  right: 24px;
  background: #0f6cf5;
  color: #fff;
  padding: 12px 18px;
  border-radius: 14px;
  box-shadow: 0 16px 30px rgba(15, 108, 245, 0.25);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 30;
  font-weight: 700;
}

.level-up-banner.show {
  opacity: 1;
  transform: translateY(0);
}

.map-stage {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(180deg, #b7e4ff, #e9f7ff);
  height: 220px;
  overflow: hidden;
  padding: 20px;
  margin-top: 12px;
}

.map-wave {
  position: absolute;
  left: -10%;
  bottom: -20px;
  width: 120%;
  height: 60px;
  background: rgba(15, 108, 245, 0.15);
  border-radius: 50%;
  animation: waveFloat 6s ease-in-out infinite;
}

.map-wave-alt {
  bottom: -10px;
  background: rgba(23, 184, 151, 0.15);
  animation-duration: 8s;
}

.map-boat {
  position: absolute;
  bottom: 90px;
  width: 44px;
  height: 24px;
  background: #ffb703;
  border-radius: 0 0 20px 20px;
  box-shadow: 0 10px 20px rgba(251, 133, 0, 0.25);
  transition: left 0.6s ease;
}

.map-boat::before {
  content: "";
  position: absolute;
  top: -26px;
  left: 14px;
  width: 2px;
  height: 26px;
  background: #1f1f1f;
}

.map-boat::after {
  content: "";
  position: absolute;
  top: -20px;
  left: 16px;
  width: 18px;
  height: 10px;
  background: #f3722c;
  border-radius: 0 8px 8px 0;
}

.boat-flag {
  position: absolute;
  top: -40px;
  left: -8px;
  font-size: 10px;
  font-weight: 700;
  color: #1f1f1f;
  background: #fff;
  padding: 2px 6px;
  border-radius: 8px;
}

.map-island {
  position: absolute;
  bottom: 30px;
  width: 80px;
  height: 60px;
  background: #8ed081;
  border-radius: 30px;
  display: grid;
  place-items: center;
  text-align: center;
  box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-island.active {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 10px 20px rgba(15, 15, 15, 0.12);
}

.island-name {
  font-size: 10px;
  font-weight: 700;
  padding: 0 6px;
}

.island-progress {
  font-size: 12px;
  font-weight: 700;
  color: #1f1f1f;
}

@keyframes waveFloat {
  0% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-6px);
  }
  100% {
    transform: translateY(0);
  }
}

.badge-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  margin-top: 12px;
}

.badge {
  position: relative;
  background: #f4f6fa;
  border-radius: 16px;
  padding: 12px;
  border: 1px dashed #d8e0ea;
  overflow: hidden;
}

.badge-earned {
  background: #e8f7ef;
  border-color: #a9e0c5;
}

.badge-earned::after {
  content: "";
  position: absolute;
  inset: -40% 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.7) 0%, transparent 55%);
  opacity: 0;
  animation: sparkle 2.2s ease-in-out infinite;
}

.badge-top {
  display: flex;
  gap: 10px;
  align-items: center;
}

.badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, #0f6cf5, #17b897);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  flex-shrink: 0;
}

.badge-earned .badge-icon {
  animation: badgePop 0.6s ease;
}

.badge-title {
  font-weight: 700;
}

.badge-status {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.badge-progress {
  margin-top: 10px;
}

.badge-progress .progress {
  height: 8px;
}

.badge-progress-label {
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}

@keyframes badgePop {
  0% {
    transform: scale(0.92);
  }
  60% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes sparkle {
  0% {
    opacity: 0;
    transform: translateX(-60%);
  }
  40% {
    opacity: 0.7;
  }
  70% {
    opacity: 0.2;
    transform: translateX(60%);
  }
  100% {
    opacity: 0;
    transform: translateX(120%);
  }
}

.child-view .timeline-item {
  background: rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 6px 16px rgba(15, 15, 15, 0.06);
}

.child-view .timeline-item {
  border-bottom: none;
}

.child-view .timeline {
  gap: 12px;
}

.child-view .timeline-title {
  font-size: 16px;
  font-weight: 600;
}

.child-view .tag {
  font-size: 12px;
  padding: 4px 10px;
}

.child-view .tag-decision {
  font-size: 13px;
  padding: 5px 12px;
}

.child-view .decision-item .timeline-title {
  font-size: 18px;
}

.child-view .decision-item .negative {
  font-size: 18px;
}

.child-view .positive,
.child-view .negative {
  font-size: 16px;
  font-weight: 700;
}

.child-view .timeline-prompt {
  font-size: 11px;
  letter-spacing: 0.2px;
}

.tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2f6;
  color: #4c5a67;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.tag-decision {
  background: #ffe4de;
  color: #a13b2b;
}

.tag-recovery {
  background: #def7e8;
  color: #1f6b48;
}

.tag-goal {
  background: #e7efff;
  color: #2b4da1;
}

.divider {
  height: 1px;
  background: #f2f2f2;
  margin: 16px 0;
}

.link {
  color: var(--primary);
  font-weight: 600;
}

.charity-summary {
  margin-top: 12px;
}

.insights {
  margin-top: 12px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.modal {
  width: min(680px, 100%);
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  .bucket-meter-row {
    grid-template-columns: 1fr;
    align-items: start;
  }
}
