:root {
  color-scheme: light;
  --ink: #263238;
  --muted: #667085;
  --paper: #fff8e7;
  --panel: rgba(255, 255, 255, 0.9);
  --line: #eadcc4;
  --sun: #ffbf3f;
  --mint: #20a67a;
  --mint-dark: #147a60;
  --berry: #df4c73;
  --sky: #77c9ff;
  --violet: #7d5cff;
  --shadow: 0 22px 70px rgba(44, 62, 80, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    ui-rounded, "Nunito", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 14%, rgba(255, 191, 63, 0.38), transparent 18rem),
    radial-gradient(circle at 88% 16%, rgba(125, 92, 255, 0.2), transparent 18rem),
    linear-gradient(160deg, #dff5ff 0%, #fff7dc 46%, #f5e9ff 100%);
}

button {
  font: inherit;
  cursor: pointer;
}

.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sky span {
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  clip-path: polygon(50% 0, 62% 34%, 98% 35%, 69% 57%, 79% 92%, 50% 72%, 21% 92%, 31% 57%, 2% 35%, 38% 34%);
  animation: float-star 8s ease-in-out infinite;
  opacity: 0.82;
}

.sky span:nth-child(1) {
  left: 8%;
  top: 14%;
}

.sky span:nth-child(2) {
  left: 28%;
  top: 78%;
  animation-delay: 1.2s;
}

.sky span:nth-child(3) {
  left: 58%;
  top: 10%;
  animation-delay: 2.1s;
}

.sky span:nth-child(4) {
  left: 78%;
  top: 68%;
  animation-delay: 0.7s;
}

.sky span:nth-child(5) {
  left: 92%;
  top: 34%;
  animation-delay: 3s;
}

.sky span:nth-child(6) {
  left: 42%;
  top: 42%;
  animation-delay: 4s;
}

.app-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(300px, 0.92fr) minmax(360px, 1.08fr);
  gap: 28px;
  align-items: center;
  padding: 38px 0;
}

.hero,
.dashboard {
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 26px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  min-height: 650px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08)),
    #1d7fc5;
  color: #fff;
}

.eyebrow,
.label {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.eyebrow {
  color: #ffe28a;
}

.hero-title,
h1,
h2,
p {
  margin-top: 0;
}

.hero-title {
  max-width: 540px;
  margin-bottom: 18px;
  font-size: clamp(46px, 8vw, 82px);
  line-height: 0.94;
  letter-spacing: 0;
}

.dashboard-title {
  margin: 0 0 14px;
  color: #243b6b;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.08;
  letter-spacing: 0;
}

.hero-copy p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.75;
}

.mascot-stage {
  position: relative;
  height: 360px;
}

.planet {
  position: absolute;
  left: 50%;
  bottom: 16px;
  width: min(330px, 74vw);
  aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background:
    radial-gradient(circle at 34% 24%, #fff4bf 0 14%, transparent 15%),
    radial-gradient(circle at 70% 58%, #96e3b9 0 11%, transparent 12%),
    linear-gradient(145deg, #ffc145, #ff7d57);
  box-shadow:
    inset -26px -34px 0 rgba(154, 72, 64, 0.16),
    0 24px 70px rgba(0, 0, 0, 0.2);
  animation: planet-bob 4.6s ease-in-out infinite;
}

.planet::after {
  content: "";
  position: absolute;
  left: -16%;
  top: 48%;
  width: 132%;
  height: 40px;
  border-radius: 999px;
  border: 11px solid rgba(255, 255, 255, 0.55);
  transform: rotate(-13deg);
}

.rocket {
  position: absolute;
  left: 50%;
  top: -48px;
  width: 86px;
  height: 138px;
  transform: translateX(-50%) rotate(12deg);
  border-radius: 48px 48px 18px 18px;
  background: linear-gradient(90deg, #fff 0 46%, #e9f5ff 47% 100%);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.18);
  animation: rocket-wiggle 1.5s ease-in-out infinite;
}

.rocket::before,
.rocket::after {
  content: "";
  position: absolute;
  bottom: 10px;
  width: 30px;
  height: 44px;
  background: var(--berry);
}

.rocket::before {
  left: -18px;
  border-radius: 22px 0 16px 16px;
}

.rocket::after {
  right: -18px;
  border-radius: 0 22px 16px 16px;
}

.window {
  position: absolute;
  left: 50%;
  top: 32px;
  width: 34px;
  height: 34px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--sky);
  border: 6px solid #34495e;
}

.flame {
  position: absolute;
  left: 50%;
  bottom: -44px;
  width: 34px;
  height: 54px;
  transform: translateX(-50%);
  border-radius: 50% 50% 45% 45%;
  background: linear-gradient(#ffe066, #ff6b35);
  animation: flame 0.46s ease-in-out infinite alternate;
}

.orbit-star {
  position: absolute;
  color: #ffe066;
  font-size: 42px;
  text-shadow: 0 5px 0 rgba(0, 0, 0, 0.1);
  animation: twinkle 1.8s ease-in-out infinite;
}

.orbit-star.one {
  left: 8%;
  top: 22%;
}

.orbit-star.two {
  right: 12%;
  top: 38%;
  animation-delay: 0.3s;
}

.orbit-star.three {
  left: 22%;
  bottom: 22%;
  animation-delay: 0.8s;
}

.dashboard {
  padding: 24px;
  background: var(--panel);
}

.dashboard-head,
.status-card,
.progress-top,
.section-title,
.record-main {
  display: flex;
  align-items: center;
}

.dashboard-head {
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-head h2 {
  margin: 0;
  font-size: clamp(48px, 8vw, 76px);
  line-height: 0.95;
  color: var(--mint-dark);
}

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

.refresh-button {
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #243b6b;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(36, 59, 107, 0.2);
}

.refresh-button span {
  display: inline-block;
}

.refresh-button.loading span {
  animation: spin 0.7s linear infinite;
}

.status-card {
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background: #fff7d6;
  border: 1px solid #f3dda4;
}

.level-badge {
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  display: grid;
  place-items: center;
  border-radius: 22px;
  background: #fff;
  font-size: 38px;
  animation: badge-pop 2.4s ease-in-out infinite;
}

.plant-emoji {
  display: inline-block;
  transform-origin: center bottom;
  filter: drop-shadow(0 7px 5px rgba(32, 166, 122, 0.18));
  transition:
    transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 400ms ease;
}

.plant-sprout {
  font-size: 38px;
}

.plant-small {
  font-size: 42px;
  transform: rotate(-3deg);
}

.plant-medium {
  font-size: 46px;
  transform: rotate(2deg);
}

.plant-lush {
  position: relative;
  font-size: 50px;
  filter: drop-shadow(0 9px 7px rgba(20, 122, 96, 0.26));
}

.plant-lush::before,
.plant-lush::after {
  content: "✦";
  position: absolute;
  top: -8px;
  color: #20a67a;
  font-size: 15px;
  animation: twinkle 1.8s ease-in-out infinite;
}

.plant-lush::before {
  left: -12px;
}

.plant-lush::after {
  right: -12px;
  animation-delay: 0.4s;
}

.status-card strong {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
}

.status-card p:last-child {
  margin: 0;
  color: #705f23;
  line-height: 1.55;
}

.progress-zone {
  margin-top: 18px;
  padding: 18px;
  border-radius: 22px;
  background: #eefaff;
  border: 1px solid #caeaff;
}

.progress-top {
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-weight: 900;
}

.progress-track {
  position: relative;
  height: 24px;
  border-radius: 999px;
  background: #cdeaf9;
  overflow: visible;
}

.progress-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--mint), var(--sun), var(--berry));
  transition: width 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.runner {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translate(-14px, -58%);
  font-size: 34px;
  transition: left 800ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.reward-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(64px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.reward-stamp {
  aspect-ratio: 1;
  min-width: 0;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: #fff;
  color: #c7d4de;
  border: 1px dashed #abcadd;
  font-size: clamp(30px, 5vw, 44px);
}

.reward-stamp.done {
  color: #fff;
  border-style: solid;
  background: linear-gradient(145deg, var(--sun), #ff8d4d);
  animation: stamp-bounce 0.52s ease both;
}

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

.summary-grid article {
  min-height: 104px;
  padding: 15px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.summary-grid span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-weight: 850;
}

.summary-grid strong {
  font-size: clamp(24px, 5vw, 34px);
  color: #243b6b;
}

.timeline-panel {
  padding: 18px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.section-title {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.section-title h2 {
  margin: 0;
  font-size: 28px;
}

#syncStatus {
  padding: 7px 10px;
  border-radius: 999px;
  background: #eef4ff;
  color: #3452a3;
  font-size: 13px;
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 10px;
  max-height: 360px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.record {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 13px;
  border-radius: 18px;
  background: #fbfcff;
  border: 1px solid #e4e9f5;
  animation: slide-up 0.45s ease both;
}

.record-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #eefaf2;
  font-size: 23px;
}

.record.minus .record-icon {
  background: #fff1f5;
}

.record strong {
  display: block;
  margin-bottom: 4px;
}

.record time {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.delta {
  min-width: 58px;
  text-align: center;
  padding: 8px 10px;
  border-radius: 999px;
  background: #e8fff4;
  color: #08784f;
  font-weight: 1000;
}

.record.minus .delta {
  background: #fff1f5;
  color: #b4234e;
}

.empty-state {
  padding: 26px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
}

@keyframes float-star {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }

  50% {
    transform: translateY(-18px) rotate(12deg);
  }
}

@keyframes planet-bob {
  0%,
  100% {
    transform: translateX(-50%) translateY(0);
  }

  50% {
    transform: translateX(-50%) translateY(-12px);
  }
}

@keyframes rocket-wiggle {
  0%,
  100% {
    transform: translateX(-50%) rotate(10deg);
  }

  50% {
    transform: translateX(-50%) rotate(16deg);
  }
}

@keyframes flame {
  from {
    height: 42px;
    opacity: 0.76;
  }

  to {
    height: 62px;
    opacity: 1;
  }
}

@keyframes twinkle {
  0%,
  100% {
    transform: scale(1) rotate(0);
  }

  50% {
    transform: scale(1.22) rotate(12deg);
  }
}

@keyframes badge-pop {
  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.07) rotate(-3deg);
  }
}

@keyframes stamp-bounce {
  0% {
    transform: scale(0.74);
  }

  70% {
    transform: scale(1.12);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes slide-up {
  from {
    transform: translateY(12px);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 920px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 24px 0;
    align-items: start;
  }

  .dashboard {
    order: 1;
  }

  .hero {
    order: 2;
    min-height: auto;
  }

  .mascot-stage {
    height: 300px;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1180px);
    gap: 14px;
    padding: 10px 0 18px;
  }

  .hero,
  .dashboard {
    border-radius: 22px;
    padding: 14px;
  }

  .dashboard-head {
    align-items: center;
    flex-direction: row;
    margin-bottom: 12px;
  }

  .dashboard-head h2 {
    font-size: clamp(44px, 15vw, 62px);
  }

  .refresh-button {
    width: auto;
    min-height: 42px;
    padding: 0 14px;
    justify-content: center;
  }

  .status-card {
    padding: 12px;
    gap: 12px;
  }

  .level-badge {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
    border-radius: 18px;
    font-size: 30px;
  }

  .status-card strong {
    font-size: 20px;
  }

  .status-card p:last-child {
    font-size: 14px;
    line-height: 1.4;
  }

  .progress-zone {
    margin-top: 12px;
    padding: 12px;
  }

  .reward-row {
    grid-template-columns: repeat(5, minmax(54px, 1fr));
    gap: 9px;
    margin-top: 12px;
  }

  .reward-stamp {
    border-radius: 18px;
    font-size: clamp(30px, 10vw, 42px);
  }

  .hero {
    padding-top: 18px;
  }

  .hero-copy p:not(.eyebrow) {
    font-size: 15px;
    line-height: 1.55;
  }

  .hero-title {
    font-size: clamp(38px, 13vw, 54px);
    margin-bottom: 12px;
  }

  .dashboard-title {
    margin-bottom: 10px;
    font-size: clamp(28px, 9vw, 38px);
  }

  .mascot-stage {
    height: 210px;
  }

  .planet {
    width: min(230px, 68vw);
  }

  .rocket {
    width: 64px;
    height: 104px;
  }

  .window {
    top: 24px;
    width: 27px;
    height: 27px;
    border-width: 5px;
  }

  .flame {
    bottom: -36px;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .record {
    grid-template-columns: auto 1fr;
  }

  .delta {
    grid-column: 2;
    width: fit-content;
  }
}
