:root {
  --ink: #102119;
  --muted: #5d6a60;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --line: #ded8ca;
  --leaf: #4b815d;
  --leaf-strong: #2f7048;
  --sun: #d5a46b;
  --track: #e9e5da;
  --shadow: 0 18px 52px rgba(26, 38, 31, 0.1);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.quiz-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.quiz-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 clamp(22px, 6vw, 110px);
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(222, 216, 202, 0.72);
  box-shadow: 0 8px 26px rgba(22, 32, 25, 0.06);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  font-weight: 900;
}

.brand img {
  width: 46px;
  height: 46px;
  border-radius: 50%;
}

.brand {
  display: inline-flex;
}

.brand .quiz-full-logo {
  width: 150px;
  height: auto;
  max-height: 96px;
  object-fit: contain;
  background: transparent;
  padding: 0;
  border-radius: 0;
  mix-blend-mode: multiply;
  transition: transform 260ms ease, filter 260ms ease;
}

.brand .quiz-full-logo:hover {
  transform: scale(1.04);
}

.login-button,
.nav-button,
.text-link-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink);
  cursor: pointer;
  font-weight: 900;
}

.login-button {
  min-width: 116px;
  min-height: 52px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wallet-pill {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(47, 112, 72, 0.22);
  border-radius: 999px;
  background: #eef7ef;
  color: var(--leaf-strong);
  padding: 0 14px;
  font-size: 0.9rem;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(47, 112, 72, 0.1);
}

.wallet-pill strong {
  font-size: 1.15rem;
}

.wallet-icon {
  display: inline-block;
}

.wallet-pill.wallet-pop {
  animation: walletPop 700ms ease;
}

.text-link-button {
  min-height: 44px;
  padding: 0 16px;
  color: var(--muted);
}

.quiz-header {
  flex-shrink: 0;
}

.landing-screen,
.quiz-stage,
.reward-screen,
.login-screen,
.feedback-screen,
.results-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-y: auto;
  width: min(860px, calc(100% - 36px));
  margin: 0 auto;
  padding: clamp(6px, 1.5vh, 18px) 0;
  box-sizing: border-box;
}

.reward-screen::before, .reward-screen::after,
.login-screen::before, .login-screen::after,
.feedback-screen::before, .feedback-screen::after {
  content: "";
  flex: 1;
  flex-shrink: 0;
  min-height: 12px;
}

.landing-screen {
  width: min(1180px, calc(100% - 36px));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(6px, 1.5vh, 18px);
}

.landing-hero {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(330px, 0.8fr);
  gap: clamp(12px, 2.5vw, 36px);
  align-items: center;
}

.landing-copy p:not(.section-kicker) {
  max-width: 680px;
  margin: clamp(8px, 1.5vh, 16px) 0 0;
  color: var(--muted);
  font-size: clamp(1rem, min(1.8vw, 2.2vh), 1.25rem);
  line-height: 1.45;
}

.landing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: clamp(12px, 2vh, 24px);
}

.landing-actions a {
  text-decoration: none;
}

.mission-board {
  display: grid;
  gap: clamp(4px, 0.8vh, 8px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(238, 247, 239, 0.72), rgba(255, 255, 255, 0.94)),
    white;
  padding: clamp(8px, 1.5vh, 16px);
  box-shadow: var(--shadow);
}

.score-preview {
  width: min(360px, 100%);
  min-height: clamp(170px, 27vh, 240px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: clamp(10px, 2vh, 18px) 0 clamp(8px, 1.5vh, 14px);
  box-sizing: border-box;
  justify-self: center;
  margin-bottom: 4px;
  border: 1px solid rgba(47, 112, 72, 0.22);
  border-radius: 28px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.95), transparent 34%),
    linear-gradient(180deg, #fffdf7, #eef7ef);
  animation: scorePulse 2.8s ease-in-out infinite;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85), 0 18px 36px rgba(47, 112, 72, 0.13);
}

.score-preview::after {
  content: "";
  position: absolute;
  inset: -55%;
  background: linear-gradient(120deg, transparent 35%, rgba(255, 255, 255, 0.78) 50%, transparent 65%);
  transform: translateX(-65%) rotate(20deg);
  animation: scoreShine 3.4s ease-in-out infinite;
}

.score-preview span {
  z-index: 1;
}

.score-preview small {
  z-index: 1;
}

.wallet-hero-art {
  position: relative;
  z-index: 1;
  width: min(300px, 90%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: scale(clamp(0.68, 9.5vh, 0.98));
  transform-origin: top center;
  margin-top: clamp(8px, 1.5vh, 16px);
  margin-bottom: calc(-190px * (1 - clamp(0.68, 9.5vh, 0.98)));
}

.wallet-graphic {
  position: relative;
  width: 180px;
  height: 118px;
}

.wallet-slideshow {
  position: relative;
  width: 220px;
  height: 160px;
  margin: 0 auto;
}

.wallet-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
  filter: brightness(1.05) contrast(1.1);
}

.wallet-slide.slide-1 {
  animation: flicker1 4s infinite;
}

.wallet-slide.slide-2 {
  animation: flicker2 4s infinite;
}

@keyframes flicker1 {
  0%, 20% { opacity: 1; transform: rotate(-2deg) scale(0.98); }
  21%, 40% { opacity: 1; transform: rotate(1deg) scale(1.02); }
  41%, 46% { opacity: 1; transform: rotate(-1deg) scale(1); }
  47% { opacity: 0; transform: rotate(4deg); }
  48% { opacity: 1; transform: rotate(-3deg); }
  49% { opacity: 0; }
  50%, 96% { opacity: 0; }
  97% { opacity: 1; transform: rotate(5deg); }
  98% { opacity: 0; }
  99%, 100% { opacity: 1; transform: rotate(-2deg); }
}

@keyframes flicker2 {
  0%, 46% { opacity: 0; }
  47% { opacity: 1; transform: rotate(4deg); }
  48% { opacity: 0; }
  49% { opacity: 1; transform: rotate(-2deg); }
  50%, 70% { opacity: 1; transform: rotate(2deg) scale(0.98); }
  71%, 90% { opacity: 1; transform: rotate(-1deg) scale(1.02); }
  91%, 96% { opacity: 1; transform: rotate(1deg) scale(1); }
  97% { opacity: 0; transform: rotate(-4deg); }
  98% { opacity: 1; transform: rotate(3deg); }
  99%, 100% { opacity: 0; }
}

.wallet-graphic::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 0;
  bottom: 0;
  height: 82px;
  border: 2px solid rgba(27, 94, 48, 0.46);
  border-radius: 18px 24px 24px 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.18) 0 22%, transparent 22%),
    linear-gradient(180deg, #2f8f47, #185f32);
  box-shadow: 0 18px 34px rgba(27, 94, 48, 0.26);
}

.wallet-graphic::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 29px;
  width: 42px;
  height: 28px;
  border-radius: 999px 0 0 999px;
  background: #1c6b38;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.wallet-slot {
  position: absolute;
  left: 24px;
  right: 48px;
  bottom: 74px;
  height: 18px;
  border-radius: 999px 999px 0 0;
  background: #164f2c;
}

.coin {
  position: absolute;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 2.5px solid #4a9c5e;
  background: radial-gradient(circle at 35% 28%, #8fd46a, #3a8c2e 50%, #1b5e20 90%);
  color: #d4edda;
  font-size: 1.2rem;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(27, 94, 32, 0.26);
  animation: coinRise 2.6s ease-in-out infinite;
}

.coin-one {
  left: 30px;
  top: 8px;
}

.coin-two {
  left: 70px;
  top: 0;
  animation-delay: 180ms;
}

.coin-three {
  left: 104px;
  top: 16px;
  animation-delay: 360ms;
}

.leaf-card {
  position: absolute;
  left: 58px;
  bottom: 24px;
  width: 42px;
  height: 22px;
  border-radius: 100% 0 100% 0;
  background: linear-gradient(135deg, #a5d873, #4b9b46);
  transform: rotate(-18deg);
  box-shadow: 0 6px 12px rgba(16, 33, 25, 0.16);
}

.tree-growth {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: clamp(50px, 9vh, 80px);
  padding: 0 8px;
}

.tree-stage {
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 3px 6px rgba(16, 33, 25, 0.15));
  animation: treeAppear 0.5s ease-out both;
}

.tree-stage:nth-child(1) {
  height: clamp(20px, 3.2vh, 28px);
  width: clamp(20px, 3.2vh, 28px);
  animation-delay: 0ms;
}

.tree-stage:nth-child(2) {
  height: clamp(28px, 4.6vh, 40px);
  width: clamp(22px, 3.6vh, 32px);
  animation-delay: 100ms;
}

.tree-stage:nth-child(3) {
  height: clamp(36px, 6vh, 52px);
  width: clamp(26px, 4.2vh, 36px);
  animation-delay: 200ms;
}

.tree-stage:nth-child(4) {
  height: clamp(44px, 7.4vh, 64px);
  width: clamp(28px, 4.6vh, 40px);
  animation-delay: 300ms;
}

.tree-stage:nth-child(5) {
  height: clamp(54px, 9vh, 78px);
  width: clamp(32px, 5.4vh, 46px);
  animation-delay: 400ms;
}

@keyframes treeAppear {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.75);
  }

  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.earning-copy {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.earning-copy span {
  color: var(--leaf-strong);
  font-size: clamp(1.8rem, min(4.5vw, 5.5vh), 2.8rem);
  font-weight: 900;
  line-height: 0.88;
}

.flicker-val-container {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

.flicker-val {
  display: inline-block;
  white-space: nowrap;
}

.f-brown {
  position: absolute;
  animation: textFlicker1 4s infinite;
}

.f-green {
  animation: textFlicker2 4s infinite;
}

@keyframes textFlicker1 {
  0%, 49% { opacity: 1; }
  50%, 99% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes textFlicker2 {
  0%, 49% { opacity: 0; }
  50%, 99% { opacity: 1; }
  100% { opacity: 0; }
}

.earning-copy small {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
}

.earning-copy strong {
  max-width: 260px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.3;
}

.wallet-stats {
  position: relative;
  z-index: 1;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid rgba(222, 216, 202, 0.9);
  margin-top: 4px;
  padding-top: 10px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.wallet-stats span {
  display: grid;
  gap: 2px;
}

.wallet-stats strong {
  color: var(--leaf-strong);
  font-size: 1rem;
}

.journey-preview article {
  display: grid;
  gap: clamp(3px, 0.6vh, 6px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 254, 249, 0.92);
  padding: clamp(8px, 1.4vh, 14px);
}

.mission-tiles-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(6px, 1vw, 10px);
  width: 100%;
}

.mission-tile {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  gap: clamp(2px, 0.4vh, 4px);
  border: 1px solid var(--line);
  border-radius: clamp(10px, 1.5vh, 16px);
  background: rgba(255, 254, 249, 0.92);
  padding: clamp(6px, 1.2vh, 12px) clamp(4px, 0.8vw, 8px);
}

.mission-tile.active {
  border-color: rgba(47, 112, 72, 0.35);
  background: #eef7ef;
}

.mission-tile strong {
  font-size: clamp(0.78rem, min(1.1vw, 1.4vh), 0.9rem);
  white-space: nowrap;
}

.mission-tile span {
  color: var(--muted);
  line-height: 1.2;
  font-size: clamp(0.64rem, min(0.9vw, 1.2vh), 0.76rem);
}

.journey-preview strong {
  font-size: clamp(0.9rem, min(1.4vw, 1.8vh), 1.05rem);
}

.journey-preview small {
  color: var(--muted);
  line-height: 1.25;
  font-size: clamp(0.72rem, min(1.1vw, 1.4vh), 0.85rem);
}

.journey-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: clamp(8px, 1.5vh, 18px);
}

.journey-preview article span {
  width: clamp(24px, 3.8vh, 32px);
  height: clamp(24px, 3.8vh, 32px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #eef7ef;
  color: var(--leaf-strong);
  font-weight: 900;
  font-size: clamp(0.78rem, 1.5vh, 0.92rem);
}

.quiz-progress {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.quiz-progress span,
.section-kicker {
  color: var(--leaf-strong);
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--leaf-strong), #7eb35c, var(--sun));
  transition: width 220ms ease;
}

.quiz-stage {
  justify-content: space-between;
}

.question-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section-kicker {
  margin: 0 0 10px;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, min(4.5vw, 6.5vh), 3.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

#questionHelp {
  max-width: 680px;
  margin: clamp(6px, 1vh, 12px) 0 clamp(8px, 1.5vh, 18px);
  color: var(--muted);
  font-size: clamp(1rem, min(1.8vw, 2.2vh), 1.25rem);
  line-height: 1.4;
}

#resultCopy {
  max-width: 800px;
  margin: clamp(4px, 0.8vh, 8px) auto clamp(6px, 1vh, 12px);
  color: var(--muted);
  font-size: clamp(0.9rem, min(1.6vw, 1.9vh), 1.15rem);
  line-height: 1.4;
}

.answer-area {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(8px, 1.2vh, 12px);
  overflow-y: auto;
  max-height: clamp(190px, 42vh, 380px);
  padding: 4px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.answer-area::-webkit-scrollbar {
  width: 6px;
}
.answer-area::-webkit-scrollbar-track {
  background: transparent;
}
.answer-area::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border-radius: 999px;
}

.answer-option {
  min-height: clamp(54px, 8.5vh, 82px);
  display: grid;
  grid-template-columns: clamp(30px, 4vh, 42px) 1fr 26px;
  align-items: center;
  gap: clamp(8px, 1.2vh, 12px);
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  cursor: pointer;
  padding: clamp(8px, 1.2vh, 14px) clamp(10px, 1.8vh, 16px);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.answer-option:hover {
  transform: translateY(-1px);
  border-color: rgba(75, 129, 93, 0.55);
  box-shadow: var(--shadow);
}

.answer-option.selected {
  border-color: var(--leaf-strong);
  background: #eef7ef;
}

.answer-icon {
  font-size: clamp(1.2rem, 3vh, 1.6rem);
}

.answer-copy {
  display: grid;
  gap: 3px;
}

.answer-copy strong {
  font-size: clamp(0.95rem, min(1.8vw, 2.2vh), 1.25rem);
}

.answer-copy small {
  color: var(--muted);
  font-size: clamp(0.75rem, 1.5vh, 0.84rem);
  line-height: 1.25;
}

.answer-check {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: transparent;
  font-weight: 900;
}

.answer-option.selected .answer-check {
  border-color: var(--leaf-strong);
  background: var(--leaf-strong);
  color: white;
}

.range-answer,
.select-answer {
  grid-column: 1 / -1;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: white;
  padding: clamp(12px, 2.2vh, 20px);
}

.range-readout {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: clamp(10px, 2vh, 24px);
  color: var(--muted);
  font-weight: 900;
}

.range-readout strong {
  color: var(--ink);
  font-size: 1.6rem;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--leaf-strong);
}

.tick-row {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.select-answer select {
  width: 100%;
  min-height: clamp(44px, 6vh, 58px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffef9;
  color: var(--ink);
  padding: 0 16px;
  font-weight: 800;
}

.quiz-actions,
.result-actions,
.reward-actions,
.login-actions {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: clamp(10px, 2vh, 18px);
  flex-shrink: 0;
}

.reward-actions,
.login-actions {
  flex-wrap: wrap;
  justify-content: center;
}

.icon-group {
  display: flex;
  gap: clamp(8px, 1.5vw, 14px);
  align-items: center;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(44px, 6vh, 54px);
  height: clamp(44px, 6vh, 54px);
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.icon-button:hover {
  background: var(--paper);
  border-color: var(--leaf);
  color: var(--leaf);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(47, 112, 72, 0.1);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.icon-button {
  position: relative;
}

.icon-button::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--leaf);
  color: white;
  padding: 6px 12px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 14px 14px 14px 2px;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(47, 112, 72, 0.2);
  z-index: 20;
}

.icon-button:hover::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-button {
  min-width: clamp(120px, 15vw, 154px);
  min-height: clamp(44px, 6vh, 54px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 clamp(16px, 2vw, 26px);
  font-size: clamp(0.95rem, 1.8vh, 1.08rem);
  text-decoration: none;
}

.next-button {
  border-color: var(--leaf);
  background: var(--leaf);
  color: white;
  box-shadow: 0 15px 34px rgba(75, 129, 93, 0.24);
}

.next-button:disabled {
  border-color: #c8c8bd;
  background: #c8c8bd;
  color: white;
  cursor: not-allowed;
  box-shadow: none;
}

.back-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.result-hero {
  text-align: center;
}

.reward-card {
  position: relative;
  z-index: 6;
  display: grid;
  justify-items: center;
  gap: clamp(8px, 1.5vh, 14px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  padding: clamp(24px, 4vh, 40px);
  text-align: center;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.reward-card .section-kicker {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  margin: 0;
  color: var(--leaf-strong);
}

.reward-card h1 {
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  color: var(--ink);
  margin: 0;
}

.reward-screen {
  position: relative;
}

.reward-rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.piggy-jar-container {
  position: absolute;
  bottom: clamp(-20px, -2vh, -10px);
  left: 50%;
  transform: translateX(-50%);
  transform-origin: bottom center;
  width: clamp(210px, 38vw, 320px);
  height: clamp(165px, 30vw, 240px);
  z-index: 2;
  pointer-events: none;
  animation: floatPiggy 3.5s ease-in-out infinite;
}

.piggy-image-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  position: relative;
  z-index: 2;
}

.coin-fill-overlay {
  position: absolute;
  bottom: 12%;
  left: 15%;
  right: 15%;
  height: 0%;
  background: linear-gradient(
    to top,
    rgba(58, 140, 46, 0.55) 0%,
    rgba(110, 201, 88, 0.45) 40%,
    rgba(143, 212, 106, 0.30) 70%,
    rgba(165, 216, 115, 0.10) 100%
  );
  border-radius: 40% 40% 45% 45%;
  z-index: 1;
  transition: height 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}


.piggy-jar-container.piggy-bounce {
  animation: piggyBounce 0.3s ease-out;
}

@keyframes piggyBounce {
  0% { transform: translateX(-50%) scale(1); }
  40% { transform: translateX(-50%) scale(1.04) translateY(-3px); }
  70% { transform: translateX(-50%) scale(0.98) translateY(1px); }
  100% { transform: translateX(-50%) scale(1) translateY(0); }
}

@keyframes floatPiggy {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

.reward-card > *:not(.close-card-button) {
  position: relative;
  z-index: 1;
}

.close-card-button {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  font-size: 1.4rem;
  font-weight: 300;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  z-index: 10;
  line-height: 1;
  padding: 0;
}

.close-card-button:hover {
  background: #fbfaf5;
  color: var(--ink);
  border-color: var(--muted);
}

.reward-metrics-grid {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1vh, 12px);
  perspective: 1000px;
}

.flip-card {
  background-color: transparent;
  width: 100%;
  height: clamp(80px, 14vh, 110px);
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner,
.flip-card:focus-within .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  inset: 0;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  border-radius: 20px;
  padding: 8px;
  border: 1px solid rgba(27, 94, 48, 0.15);
}

.flip-card-front {
  background: #eef7ef;
  color: var(--leaf-strong);
  justify-content: space-between;
  padding: 14px 8px 10px;
}

.flip-card-back {
  background: #fffef9;
  color: var(--leaf-strong);
  transform: rotateY(180deg);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.02);
}

.reward-tile span {
  font-size: clamp(1.1rem, 2.8vw, 1.6rem);
  font-weight: 900;
  line-height: 1.1;
}

.reward-tile .front-label {
  font-size: clamp(0.9rem, 2.2vw, 1.2rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
  text-align: center;
  margin-bottom: 0;
}

.reward-tile small {
  color: var(--muted);
  font-weight: 900;
  font-size: clamp(0.6rem, 1vw, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.tile-icon {
  font-size: 1.1em;
  font-style: normal;
  display: inline-block;
}

.tile-icon.large {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-top: 6px;
}

.login-card {
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2vh, 20px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  padding: clamp(16px, 3vh, 32px);
  text-align: center;
  box-shadow: var(--shadow);
}

.celebration-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(16, 33, 25, 0.58);
  backdrop-filter: blur(8px);
}

.celebration-modal[hidden] {
  display: none;
}

.celebration-card {
  width: min(560px, 100%);
  display: grid;
  justify-items: center;
  gap: clamp(12px, 2vh, 20px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: white;
  padding: clamp(20px, 4vh, 40px);
  text-align: center;
  box-shadow: 0 24px 80px rgba(16, 33, 25, 0.28);
}

.celebration-card h1 {
  font-size: clamp(2.4rem, 5vw, 4rem);
}

.celebration-card p:not(.section-kicker) {
  margin: 0;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1.45;
}

.celebration-score {
  width: clamp(120px, 20vh, 170px);
  height: clamp(120px, 20vh, 170px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, white 0 58%, transparent 59%),
    conic-gradient(var(--leaf-strong) 78%, var(--track) 0);
}

.celebration-score span {
  display: block;
  color: var(--leaf-strong);
  font-size: clamp(2.4rem, 5vh, 3.4rem);
  font-weight: 900;
  line-height: 0.9;
}

.celebration-score small {
  width: 96px;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.18;
}

.celebration-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.login-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, min(1.8vw, 2.2vh), 1.15rem);
  line-height: 1.4;
}

.provider-stack {
  width: min(460px, 100%);
  display: grid;
  gap: 12px;
}

.provider-button {
  min-height: clamp(44px, 6vh, 58px);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: #2d2d2f;
  color: white;
  cursor: pointer;
  padding: 0 22px;
  font-weight: 900;
  box-shadow: 0 12px 26px rgba(23, 33, 28, 0.12);
}

.provider-logo {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
}

.microsoft-logo {
  width: 22px;
  height: 22px;
}

.rating-answer {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.rating-leaf {
  width: 74px;
  height: 74px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: white;
  color: #9aa694;
  cursor: pointer;
  font-size: 2rem;
  font-weight: 900;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.rating-leaf.selected {
  border-color: var(--leaf-strong);
  background: #eef7ef;
  color: var(--leaf-strong);
}

.rating-leaf:hover {
  transform: translateY(-1px);
}

.text-answer textarea {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 20px;
  background: white;
  color: var(--ink);
  padding: 18px;
  line-height: 1.45;
  resize: vertical;
}

.feedback-card {
  width: min(680px, 100%);
  margin: 0 auto;
}

.feedback-text {
  width: min(560px, 100%);
  display: grid;
  gap: 10px;
  text-align: left;
}

.feedback-text span {
  color: var(--ink);
  font-weight: 900;
}

@keyframes walletPop {
  0% {
    transform: scale(1);
  }

  35% {
    transform: scale(1.12);
    box-shadow: 0 18px 34px rgba(47, 112, 72, 0.26);
  }

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

@keyframes scorePulse {

  0%,
  100% {
    transform: translateY(0) scale(1);
  }

  50% {
    transform: translateY(-4px) scale(1.025);
  }
}

@keyframes earningFloat {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

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

@keyframes walletInvite {

  0%,
  100% {
    transform: translateY(0);
  }

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

@keyframes coinRise {

  0%,
  100% {
    transform: translateY(0) rotate(-4deg);
  }

  50% {
    transform: translateY(-9px) rotate(5deg);
  }
}

@keyframes stackGrow {

  0%,
  100% {
    transform: scaleY(0.74);
  }

  50% {
    transform: scaleY(1);
  }
}

@keyframes earningFill {
  0% {
    transform: scaleX(0.28);
  }

  55% {
    transform: scaleX(1);
  }

  100% {
    transform: scaleX(0.28);
  }
}

@keyframes rewardStackGrow {
  0% {
    transform: scaleY(0.15);
    opacity: 0.45;
  }

  100% {
    transform: scaleY(1);
    opacity: 1;
  }
}

@keyframes coinDropIn {
  0% {
    transform: translateY(-22px) scale(0.72);
    opacity: 0;
  }

  68% {
    transform: translateY(4px) scale(1.04);
    opacity: 1;
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes scoreShine {

  0%,
  42% {
    transform: translateX(-70%) rotate(20deg);
  }

  68%,
  100% {
    transform: translateX(70%) rotate(20deg);
  }
}

@keyframes leafDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -16px) scale(0.75) rotate(-25deg);
  }

  18% {
    opacity: 1;
  }

  72% {
    opacity: 1;
    transform: translate(-50%, 54px) scale(1) rotate(24deg);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, 66px) scale(0.42) rotate(70deg);
  }
}

@keyframes coinDrop {
  0% {
    opacity: 0;
    transform: translate(-50%, -8px) scale(0.48);
  }

  20% {
    opacity: 1;
  }

  82% {
    opacity: 1;
    transform: translate(-50%, 74px) scale(0.95);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, 86px) scale(0.35);
  }
}

@keyframes walletCatch {

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

  36% {
    transform: scale(1.08) translateY(-3px);
  }

  64% {
    transform: scale(0.98) translateY(1px);
  }
}

.result-hero h1 {
  font-size: clamp(1.5rem, min(3.5vw, 4vh), 2.4rem);
  margin: 0 0 clamp(2px, 0.8vh, 6px);
}

.score-orbit {
  width: clamp(120px, 18vh, 160px);
  height: clamp(120px, 18vh, 160px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: clamp(6px, 1vh, 16px) auto clamp(4px, 0.8vh, 8px);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--paper) 0 62%, transparent 63%),
    conic-gradient(var(--leaf-strong) var(--score-angle), var(--track) 0);
}

.score-orbit span {
  display: block;
  font-size: clamp(2rem, 4.5vh, 2.8rem);
  font-weight: 900;
  line-height: 1;
}

.score-orbit small {
  width: 110px;
  color: var(--muted);
  line-height: 1.2;
  font-size: clamp(0.75rem, 1.5vh, 0.88rem);
  margin-top: 4px;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(8px, 1.2vh, 14px);
  margin-top: clamp(6px, 1.2vh, 16px);
}

.result-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  padding: clamp(8px, 1.2vh, 16px);
  box-shadow: var(--shadow);
}

.result-grid h2 {
  margin: 0 0 clamp(4px, 0.8vh, 10px);
  font-size: clamp(1rem, min(1.6vw, 1.8vh), 1.25rem);
}

.breakdown-item {
  display: grid;
  gap: clamp(2px, 0.5vh, 6px);
  margin: clamp(4px, 0.8vh, 10px) 0;
}

.breakdown-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-weight: 900;
}

.mini-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--track);
}

.mini-track span {
  display: block;
  height: 100%;
  background: var(--bar-color);
}

ol {
  display: grid;
  gap: clamp(6px, 1vh, 12px);
  margin: 0;
  padding-left: 22px;
  color: var(--muted);
  line-height: 1.35;
  font-size: clamp(0.85rem, min(1.4vw, 1.8vh), 0.95rem);
}

li strong {
  color: var(--ink);
}

@media (max-height: 780px) {
  .quiz-header {
    height: 62px;
  }

  .landing-screen {
    gap: clamp(2px, 0.8vh, 8px);
  }

  .score-preview {
    min-height: clamp(140px, 22vh, 200px);
  }

  .wallet-hero-art {
    transform: scale(clamp(0.55, 7.5vh, 0.85));
    margin-bottom: calc(-190px * (1 - clamp(0.55, 7.5vh, 0.85)));
  }

  .earning-copy span {
    font-size: clamp(1.4rem, 3.5vh, 2.2rem);
  }

  .earning-copy small {
    font-size: 0.85rem;
  }

  .earning-copy strong {
    font-size: 0.78rem;
  }

  .tree-growth {
    height: clamp(36px, 6vh, 60px);
  }

  .journey-preview {
    margin-top: clamp(2px, 0.8vh, 8px);
    gap: 6px;
  }

  .journey-preview article {
    padding: clamp(5px, 1vh, 10px);
    border-radius: 14px;
  }

  .journey-preview article span {
    width: clamp(20px, 3vh, 28px);
    height: clamp(20px, 3vh, 28px);
    font-size: clamp(0.68rem, 1.2vh, 0.82rem);
  }

  .journey-preview strong {
    font-size: clamp(0.78rem, 1.3vh, 0.9rem);
  }

  .journey-preview small {
    font-size: clamp(0.64rem, 1vh, 0.76rem);
  }

  .mission-board {
    padding: clamp(4px, 0.8vh, 10px);
    gap: clamp(2px, 0.5vh, 6px);
  }

  .mission-tile {
    padding: clamp(4px, 0.8vh, 8px) clamp(2px, 0.5vw, 6px);
  }

  .wallet-stats {
    margin-top: 2px;
    padding-top: 6px;
    font-size: 0.65rem;
  }

  h1 {
    font-size: clamp(1.5rem, min(3.8vw, 5vh), 2.6rem);
  }

  .landing-copy p:not(.section-kicker) {
    font-size: clamp(0.88rem, min(1.5vw, 1.8vh), 1.05rem);
    margin: clamp(4px, 0.8vh, 10px) 0 0;
  }

  .landing-actions {
    margin-top: clamp(6px, 1vh, 14px);
  }
}

@media (max-width: 760px) {
  .quiz-header {
    height: 66px;
    padding: 0 16px;
  }

  .brand {
    font-size: 1rem;
  }

  .brand img {
    width: 38px;
    height: 38px;
  }

  .brand .quiz-full-logo {
    width: 78px;
    height: 50px;
  }

  .login-button {
    min-width: 86px;
    min-height: 38px;
  }

  .wallet-pill {
    min-height: 38px;
    padding: 0 10px;
    font-size: 0.74rem;
  }

  .wallet-pill span:last-child {
    display: none;
  }

  .reward-wallet-visual {
    position: relative;
    top: auto;
    right: auto;
    width: 176px;
    height: 118px;
    margin-bottom: 0;
  }

  .quiz-stage,
  .landing-screen,
  .reward-screen,
  .login-screen,
  .feedback-screen,
  .results-screen {
    width: min(100% - 24px, 860px);
    margin: 14px auto;
  }

  .landing-hero {
    grid-template-columns: 1fr;
  }

  .mission-board {
    order: 0;
  }

  .score-preview {
    width: 100%;
    min-height: 286px;
  }

  .wallet-hero-art {
    width: min(280px, 96%);
    grid-template-columns: 1fr 0.72fr;
    gap: 8px;
    transform: scale(0.9);
    transform-origin: center bottom;
    margin-bottom: -12px;
  }

  .earning-copy span {
    font-size: 2.35rem;
  }

  .wallet-stats {
    font-size: 0.68rem;
  }

  .journey-preview {
    display: none;
  }

  .reward-card {
    padding-top: 18px;
  }

  .reward-stack {
    grid-template-columns: 1fr;
  }

  .question-card {
    min-height: auto;
  }

  h1 {
    font-size: 2.1rem;
  }

  #questionHelp,
  #resultCopy {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .answer-option {
    min-height: 72px;
    grid-template-columns: 36px 1fr 24px;
    gap: 10px;
    border-radius: 14px;
    padding: 12px;
  }

  .answer-icon {
    font-size: 1.42rem;
  }

  .answer-copy small {
    font-size: 0.78rem;
  }

  .quiz-actions,
  .result-actions {
    position: sticky;
    bottom: 0;
    margin: 14px -12px -14px;
    padding: 10px 12px;
    background: rgba(251, 250, 245, 0.92);
    backdrop-filter: blur(10px);
  }

  .header-actions {
    gap: 8px;
  }

  .text-link-button {
    display: none;
  }

  .nav-button {
    min-width: 0;
    min-height: 48px;
    flex: 1;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }
}
/* Nested Flights Question Styles */
.nested-flights-container { display: flex; flex-direction: column; gap: 16px; }
.nested-flight-card { background: var(--surface, #fcfbf7); border: 1.5px solid var(--line, #d0cfc7); border-radius: 12px; padding: 16px; }
.flight-top-label, .flight-sub-label { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; user-select: none; }
.flight-top-label input, .flight-sub-label input { position: absolute; opacity: 0; cursor: pointer; height: 0; width: 0; }
.flight-checkmark { display: inline-block; width: 24px; height: 24px; min-width: 24px; background-color: white; border: 2px solid var(--line, #d0cfc7); border-radius: 6px; position: relative; transition: all 0.2s ease; margin-top: 2px; }
.flight-top-label input:checked ~ .flight-checkmark, .flight-sub-label input:checked ~ .flight-checkmark { background-color: var(--primary, #1f3d2c); border-color: var(--primary, #1f3d2c); }
.flight-checkmark:after { content: ""; position: absolute; display: none; left: 8px; top: 4px; width: 5px; height: 10px; border: solid white; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.flight-top-label input:checked ~ .flight-checkmark:after, .flight-sub-label input:checked ~ .flight-checkmark:after { display: block; }
.flight-top-text strong { display: block; font-size: 1rem; color: var(--text, #111111); margin-bottom: 2px; }
.flight-top-text small { display: block; font-size: 0.85rem; color: var(--muted, #8a9a8d); }
.flight-sub-options { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line, #d0cfc7); }
.flight-slider-wrap { margin-top: 16px; padding: 16px; background: white; border: 1px solid var(--line, #d0cfc7); border-radius: 12px; }
