:root {
  --cream: #fff2dc;
  --paper: #fff8eb;
  --green: #5a2b17;
  --green-soft: #c97744;
  --sage: #f2c98f;
  --sage-strong: #d99a5f;
  --yellow: #f5dc7a;
  --yellow-soft: #ffe7a6;
  --lilac: #e8a98f;
  --lilac-soft: #f7d4c1;
  --terracotta: #c86b37;
  --terracotta-dark: #8e4324;
  --ink-muted: rgba(90, 43, 23, .72);
  --line: rgba(90, 43, 23, .18);
  --shadow: 0 22px 70px rgba(90, 43, 23, .18);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--green);
  background:
    radial-gradient(circle at 0% 100%, rgba(200, 107, 55, .28) 0 92px, transparent 94px),
    radial-gradient(circle at 100% 0%, rgba(245, 220, 122, .42) 0 72px, transparent 74px),
    linear-gradient(180deg, #fff0d6 0%, #f4c99c 100%);
}

button {
  font: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app {
  position: relative;
  width: min(100%, 460px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--cream);
  box-shadow: 0 0 0 1px rgba(12, 70, 63, .06), 0 20px 80px rgba(0,0,0,.12);
}

.screen {
  display: none;
  position: relative;
  min-height: 100dvh;
  padding: calc(22px + var(--safe-top)) 22px calc(24px + var(--safe-bottom));
  isolation: isolate;
}

.screen.is-active {
  display: flex;
  flex-direction: column;
  animation: screenIn .34s ease both;
}

@keyframes screenIn {
  from { opacity: 0; transform: translateY(8px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.decor {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  opacity: .95;
}

.decor-yellow { background: var(--yellow); }
.decor-green { background: var(--green-soft); }
.decor-lilac { background: var(--lilac); }

.decor-a {
  width: 182px;
  height: 182px;
  border-bottom-right-radius: 82px;
  left: -82px;
  top: -64px;
}

.decor-b {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  right: 18px;
  top: 18px;
  opacity: .42;
}

.decor-c {
  width: 140px;
  height: 72px;
  border-radius: 40px 0 0 40px;
  right: -70px;
  top: 158px;
  opacity: .62;
}

.decor-d {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  right: -54px;
  bottom: 76px;
  opacity: .35;
}

.decor-e {
  width: 102px;
  height: 102px;
  border-radius: 42px;
  left: -42px;
  top: 120px;
  rotate: 18deg;
  opacity: .38;
}

.start-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1;
  padding-top: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: rgba(12, 70, 63, .55);
  font-weight: 800;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 12px;
  font-size: clamp(48px, 14vw, 72px);
  line-height: .92;
  letter-spacing: -.08em;
  max-width: 8ch;
}

h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -.055em;
}

h3 {
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -.045em;
}

.lead {
  margin-bottom: 24px;
  max-width: 340px;
  font-size: 18px;
  line-height: 1.28;
  color: var(--ink-muted);
}

.hero-photo {
  position: relative;
  min-height: 270px;
  margin: 8px 0 22px;
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--sage);
  box-shadow: var(--shadow);
}

.hero-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 83% 18%, rgba(12,70,63,.10) 0 44px, transparent 45px),
    radial-gradient(circle at 11% 84%, rgba(247,189,34,.35) 0 68px, transparent 70px),
    linear-gradient(135deg, rgba(255,255,255,.25), transparent);
  z-index: 1;
}

.hero-photo img,
.state-photo img,
.result-photo-wrap img,
.helper-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.hero-photo img {
  position: absolute;
  inset: 0;
  scale: 1.06;
}

.bubble {
  position: absolute;
  z-index: 2;
  border-radius: 50%;
  background: rgba(255, 248, 234, .84);
}

.bubble-one { width: 76px; height: 76px; right: 18px; top: 20px; }
.bubble-two { width: 52px; height: 52px; left: 22px; bottom: 22px; background: rgba(247, 189, 34, .72); }

.btn {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 850;
  font-size: 17px;
  letter-spacing: -.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn:active { transform: translateY(1px) scale(.99); }

.btn-primary {
  color: white;
  background: var(--green);
  box-shadow: 0 16px 38px rgba(12, 70, 63, .28);
}

.btn-secondary {
  margin-top: auto;
  color: white;
  background: var(--green);
  box-shadow: 0 16px 38px rgba(12, 70, 63, .24);
}

.btn-outline {
  color: var(--green);
  background: transparent;
  border: 1.5px solid rgba(12, 70, 63, .46);
}

.btn-ghost {
  color: rgba(12, 70, 63, .76);
  background: transparent;
  box-shadow: none;
}

.tiny {
  margin: 18px 0 0;
  text-align: center;
  color: rgba(12, 70, 63, .38);
  font-size: 14px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.icon-btn {
  width: 46px;
  min-width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255,255,255,.68);
  display: grid;
  place-items: center;
  cursor: pointer;
  font-weight: 900;
  font-size: 23px;
  box-shadow: 0 10px 30px rgba(12, 70, 63, .08);
}

.choose-lead {
  margin-bottom: 18px;
  color: var(--ink-muted);
  font-size: 17px;
  line-height: 1.35;
}

.state-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 18px;
}

.state-card {
  position: relative;
  min-height: 238px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--sage);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(12, 70, 63, .12);
}

.state-card:nth-child(2) { background: var(--lilac-soft); }
.state-card:nth-child(3) { background: var(--yellow-soft); }
.state-card:nth-child(4) { background: var(--sage); }

.state-photo {
  position: absolute;
  inset: 0;
}

.state-photo::after {
  content: "";
  position: absolute;
  inset: 38% 0 0;
  background: linear-gradient(180deg, transparent, rgba(255, 248, 234, .9) 56%, rgba(255, 248, 234, .98));
}

.state-info {
  position: absolute;
  left: 15px;
  right: 12px;
  bottom: 13px;
  z-index: 2;
}

.state-title {
  display: block;
  margin-bottom: 4px;
  font-size: 24px;
  line-height: .95;
  letter-spacing: -.055em;
  font-weight: 900;
}

.state-copy {
  display: block;
  font-size: 13px;
  color: rgba(12, 70, 63, .72);
  font-weight: 650;
}

.state-icon {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 253, 246, .86);
  font-size: 19px;
  box-shadow: 0 8px 20px rgba(12, 70, 63, .12);
}

.result-card,
.helper-card {
  background: rgba(255, 253, 246, .78);
  border: 1px solid rgba(12, 70, 63, .08);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow);
}

.result-photo-wrap {
  position: relative;
  height: 330px;
  overflow: hidden;
  border-radius: 26px;
  background: var(--sage);
}

.result-photo-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 54%, rgba(0, 0, 0, .08));
  pointer-events: none;
}

.result-badge {
  position: absolute;
  right: 16px;
  bottom: 16px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,253,246,.9);
  font-size: 26px;
  box-shadow: 0 12px 28px rgba(12, 70, 63, .15);
}

.result-text {
  margin: 18px 4px 14px;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.35;
}

.diagnosis-box,
.needs-box {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-radius: 22px;
  background: rgba(220, 230, 208, .76);
}

.needs-box { margin-top: 10px; background: rgba(255, 226, 160, .58); }

.diagnosis-box span,
.needs-box span {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(12, 70, 63, .55);
  font-weight: 850;
}

.diagnosis-box strong {
  font-size: 20px;
  line-height: 1.08;
  letter-spacing: -.035em;
}

.need-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  margin: 4px 4px 0 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(255, 253, 246, .78);
  font-size: 14px;
  font-weight: 780;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.helper-card {
  margin-top: auto;
  margin-bottom: auto;
  text-align: center;
}

.helper-photo {
  position: relative;
  height: 336px;
  overflow: hidden;
  margin-bottom: 18px;
  border-radius: 28px;
  background: linear-gradient(160deg, #fff, #f7eedc 44%, #e8f0de);
}

.helper-photo::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255,255,255,.9), transparent 62%);
  filter: blur(8px);
  z-index: 1;
}

.helper-photo img {
  position: relative;
  z-index: 2;
  scale: 1.04;
  filter: saturate(.72) brightness(1.12);
}

.spark {
  position: absolute;
  z-index: 3;
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(247,189,34,.55);
  font-size: 32px;
  animation: floaty 2.4s ease-in-out infinite;
}

.spark-one { left: 26px; top: 30px; }
.spark-two { right: 34px; top: 58px; animation-delay: -.4s; }
.spark-three { right: 60px; bottom: 48px; animation-delay: -.9s; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0); opacity: .78; }
  50% { transform: translateY(-8px) rotate(12deg); opacity: 1; }
}

#helper-text {
  margin: 0 auto;
  max-width: 330px;
  color: var(--ink-muted);
  font-size: 18px;
  line-height: 1.35;
}

@media (max-width: 380px) {
  .screen { padding-inline: 16px; }
  .state-grid { gap: 10px; }
  .state-card { min-height: 218px; border-radius: 22px; }
  .state-title { font-size: 21px; }
  .state-copy { font-size: 12px; }
  .result-photo-wrap, .helper-photo { height: 300px; }
  h2 { font-size: 30px; }
}

@media (min-width: 720px) {
  body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--green);
  background:
    radial-gradient(circle at 0% 100%, rgba(200, 107, 55, .28) 0 92px, transparent 94px),
    radial-gradient(circle at 100% 0%, rgba(245, 220, 122, .42) 0 72px, transparent 74px),
    linear-gradient(180deg, #fff0d6 0%, #f4c99c 100%);
}


.screen-start {
  padding: 0;
  justify-content: flex-end;
  background: #c86b37;
}

.cover-art {
  position: absolute;
  inset: 0;
}

.cover-art::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .15) 0%, rgba(0, 0, 0, .16) 16%, rgba(0, 0, 0, .12) 28%, rgba(0, 0, 0, .07) 40%, rgba(0, 0, 0, 0) 58%, rgba(0, 0, 0, .30) 100%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
  z-index: 1;
}

.cover-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.start-card-cover {
  position: relative;
  z-index: 2;
  min-height: 100dvh;
  padding: calc(26px + var(--safe-top)) 22px calc(24px + var(--safe-bottom));
  justify-content: space-between;
}

.start-card-cover h1 {
  margin-top: 8px;
  margin-bottom: 14px;
  max-width: 9ch;
  color: #ffe8b7;
  font-size: clamp(44px, 12.6vw, 66px);
  line-height: .93;
  letter-spacing: -.07em;
  text-wrap: balance;
  text-shadow: 0 3px 18px rgba(77, 31, 10, .38);
}

.start-card-cover .lead {
  max-width: 338px;
  margin-bottom: 0;
  color: rgba(255, 251, 242, .99);
  font-size: 18px;
  line-height: 1.24;
  font-weight: 650;
  text-shadow:
    0 2px 2px rgba(72, 31, 9, .52),
    0 10px 28px rgba(72, 31, 9, .60);
}

.start-actions {
  margin-top: auto;
  padding-top: 18px;
}

.btn-cover {
  min-height: 68px;
  color: #2f6f2a;
  background: #f7df86;
  box-shadow: 0 16px 38px rgba(58, 27, 5, .28);
  font-size: 19px;
}

.start-card-cover .tiny {
  margin-top: 18px;
  color: rgba(255, 248, 239, .92);
  font-size: 14px;
  text-shadow: 0 2px 8px rgba(0,0,0,.12);
}

.start-card-cover::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 240px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.26) 100%);
  z-index: -1;
  pointer-events: none;
}

@media (max-width: 380px) {
  .start-card-cover {
    padding-inline: 16px;
  }

  .start-card-cover h1 {
    font-size: clamp(40px, 12vw, 60px);
  }

  .btn-cover {
    min-height: 62px;
    font-size: 18px;
  }
}


/* Warm editorial palette for inner screens */
.screen-choose,
.screen-result,
.screen-helper {
  background:
    radial-gradient(circle at 110% -8%, rgba(245, 220, 122, .48) 0 86px, transparent 88px),
    radial-gradient(circle at -12% 96%, rgba(200, 107, 55, .22) 0 104px, transparent 106px),
    linear-gradient(180deg, #fff1d8 0%, #ffe5bd 50%, #f7c995 100%);
}

.screen-choose::before,
.screen-result::before,
.screen-helper::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .52;
  background:
    linear-gradient(135deg, transparent 0 65%, rgba(255, 248, 235, .55) 65% 100%),
    radial-gradient(circle at 86% 22%, rgba(232, 169, 143, .26) 0 74px, transparent 76px);
}

.topbar {
  color: var(--green);
}

.icon-btn {
  background: rgba(255, 248, 235, .78);
  border-color: rgba(90, 43, 23, .22);
  color: var(--terracotta-dark);
  box-shadow: 0 10px 26px rgba(90, 43, 23, .13);
}

.eyebrow {
  color: rgba(90, 43, 23, .54);
}

.choose-lead {
  color: rgba(90, 43, 23, .72);
}

.state-card {
  box-shadow: 0 16px 38px rgba(90, 43, 23, .16);
  outline: 1px solid rgba(255, 248, 235, .45);
}

.state-card:nth-child(1) { background: #f4c98e; }
.state-card:nth-child(2) { background: #f7d4c1; }
.state-card:nth-child(3) { background: #f6d86a; }
.state-card:nth-child(4) { background: #f1b183; }

.state-photo::after {
  background: linear-gradient(180deg, transparent, rgba(255, 241, 216, .78) 56%, rgba(255, 241, 216, .98));
}

.state-icon,
.result-badge {
  background: rgba(255, 248, 235, .9);
  box-shadow: 0 8px 22px rgba(90, 43, 23, .16);
}

.result-card,
.helper-card {
  background: rgba(255, 248, 235, .80);
  border-color: rgba(90, 43, 23, .10);
  box-shadow: 0 22px 70px rgba(90, 43, 23, .16);
}

.diagnosis-box {
  background: rgba(245, 220, 122, .46);
}

.needs-box {
  background: rgba(200, 107, 55, .16);
}

.need-pill {
  background: rgba(255, 248, 235, .86);
  color: var(--green);
}

.helper-photo {
  background: linear-gradient(160deg, #fff8eb 0%, #f7df86 48%, #f7d4c1 100%);
}

.btn-primary,
.btn-secondary {
  background: var(--terracotta-dark);
  color: #fff8eb;
  box-shadow: 0 16px 38px rgba(90, 43, 23, .28);
}

.btn-outline {
  color: var(--terracotta-dark);
  border-color: rgba(142, 67, 36, .52);
  background: rgba(255, 248, 235, .38);
}

.btn-ghost {
  color: rgba(90, 43, 23, .72);
}

.btn-cover {
  color: #7a3d15;
}

/* Touch/click feedback */
.btn,
.state-card,
.icon-btn {
  will-change: transform;
  transition:
    transform .16s cubic-bezier(.2, .8, .2, 1),
    box-shadow .16s ease,
    background .16s ease,
    filter .16s ease;
}

.btn:active,
.state-card:active,
.icon-btn:active,
.is-pressing {
  transform: scale(.965);
  filter: brightness(.98);
}

.state-card:active {
  box-shadow: 0 10px 24px rgba(90, 43, 23, .14);
}

.btn:active {
  box-shadow: 0 10px 24px rgba(90, 43, 23, .22);
}

@media (hover: hover) {
  .btn:hover,
  .state-card:hover,
  .icon-btn:hover {
    transform: translateY(-1px);
  }

  .btn:hover:active,
  .state-card:hover:active,
  .icon-btn:hover:active {
    transform: scale(.965);
  }
}


/* Better card/photo harmony */
.state-photo {
  background: linear-gradient(180deg, rgba(242, 198, 136, .88), rgba(229, 150, 95, .58));
}

.state-photo::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 242, 216, .14) 0%, rgba(200, 107, 55, .18) 100%),
    radial-gradient(circle at 80% 16%, rgba(255, 233, 184, .22) 0 56px, transparent 58px);
  mix-blend-mode: multiply;
  z-index: 1;
  pointer-events: none;
}

.state-photo img {
  object-position: center 36%;
  filter: sepia(.12) saturate(.96) hue-rotate(-8deg) contrast(1.02) brightness(.99);
}

.result-photo-wrap {
  background: linear-gradient(180deg, #f4c98e, #e59b64);
}

.result-photo-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 242, 216, .12), rgba(200, 107, 55, .16));
  mix-blend-mode: multiply;
  z-index: 1;
  pointer-events: none;
}

.result-photo-wrap img {
  position: relative;
  z-index: 0;
  object-position: center 34%;
  filter: sepia(.12) saturate(.96) hue-rotate(-8deg) contrast(1.02) brightness(.99);
}

/* Daily raccoon card */
.daily-return {
  margin: 0 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 242, 216, .42);
  border-radius: 22px;
  color: #fff8eb;
  background: rgba(72, 31, 9, .22);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 14px 30px rgba(72, 31, 9, .18);
}

.daily-return span {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 850;
  opacity: .78;
}

.daily-return strong {
  display: block;
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.05;
  letter-spacing: -.04em;
}

.daily-buttons {
  display: flex;
  gap: 8px;
}

.daily-link {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 242, 216, .92);
  color: #7a3d15;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.daily-reset {
  background: rgba(255, 242, 216, .24);
  color: #fff8eb;
}

/* Result animations */
.screen-result.is-active .topbar {
  animation: fadeUp .34s ease both;
}

.screen-result.is-active .result-card {
  animation: cardRise .46s cubic-bezier(.2, .82, .2, 1) both;
}

.screen-result.is-active .result-photo-wrap {
  animation: photoPop .52s cubic-bezier(.2, .82, .2, 1) .08s both;
}

.screen-result.is-active .diagnosis-box,
.screen-result.is-active .metrics-box,
.screen-result.is-active .needs-box,
.screen-result.is-active .quote-box {
  animation: fadeUp .40s ease both;
}

.screen-result.is-active .diagnosis-box { animation-delay: .12s; }
.screen-result.is-active .metrics-box { animation-delay: .18s; }
.screen-result.is-active .needs-box { animation-delay: .24s; }
.screen-result.is-active .quote-box { animation-delay: .30s; }
.screen-result.is-active .result-actions { animation: fadeUp .40s ease .36s both; }

@keyframes cardRise {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes photoPop {
  from { opacity: 0; transform: scale(.96); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Metrics and quote */
.metrics-box {
  display: grid;
  gap: 9px;
  margin-top: 10px;
  padding: 14px;
  border-radius: 22px;
  background: rgba(255, 248, 235, .58);
  border: 1px solid rgba(90, 43, 23, .08);
}

.metric-item div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.metric-item span {
  color: rgba(90, 43, 23, .62);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 850;
}

.metric-item strong {
  color: #5a2b17;
  font-size: 18px;
  line-height: 1;
  font-weight: 950;
}

.metric-item i {
  display: block;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(90, 43, 23, .12);
}

.metric-item i::after {
  content: "";
  display: block;
  width: var(--fill);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c86b37, #f5dc7a);
}

.quote-box {
  margin-top: 10px;
  padding: 16px;
  border-radius: 22px;
  color: #5a2b17;
  background: rgba(255, 248, 235, .62);
  border: 1px dashed rgba(142, 67, 36, .28);
}

.quote-box span {
  display: block;
  margin-bottom: 7px;
  color: rgba(90, 43, 23, .56);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 850;
}

.quote-box p {
  margin: 0;
  color: rgba(90, 43, 23, .82);
  font-size: 16px;
  line-height: 1.28;
  font-weight: 700;
}

/* Pet button */
.btn-soft {
  color: #7a3d15;
  background: #f5dc7a;
  box-shadow: 0 14px 30px rgba(90, 43, 23, .18);
}

.pet-note {
  min-height: 18px;
  margin: -2px 0 2px;
  text-align: center;
  color: rgba(90, 43, 23, .66);
  font-size: 14px;
  font-weight: 800;
}

.heart-pop {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  color: #fff8eb;
  text-shadow: 0 8px 22px rgba(90, 43, 23, .30);
  font-size: 25px;
  animation: heartPop 1.2s ease-out forwards;
}

@keyframes heartPop {
  0% { opacity: 0; transform: translate(-50%, 0) scale(.55) rotate(-8deg); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--drift)), -130px) scale(1.35) rotate(16deg); }
}

.result-badge { z-index: 3; }
.result-photo-wrap::after { z-index: 2; }

/* Magical helper */
.helper-loading {
  margin: auto 0;
  padding: 26px 20px;
  text-align: center;
  color: #5a2b17;
  border-radius: 30px;
  background: rgba(255, 248, 235, .66);
  box-shadow: 0 22px 70px rgba(90, 43, 23, .13);
}

.loader-paws {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}

.loader-paws span {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #f5dc7a;
  box-shadow: 0 0 22px rgba(245, 220, 122, .72);
  animation: pawPulse .78s ease-in-out infinite alternate;
}

.loader-paws span:nth-child(2) { animation-delay: .12s; }
.loader-paws span:nth-child(3) { animation-delay: .24s; }

.helper-loading p {
  margin: 0;
  color: rgba(90, 43, 23, .78);
  font-size: 17px;
  font-weight: 850;
}

@keyframes pawPulse {
  from { transform: translateY(0) scale(.82); opacity: .55; }
  to { transform: translateY(-8px) scale(1); opacity: 1; }
}

.helper-card {
  opacity: 0;
  transform: translateY(14px) scale(.98);
  transition: opacity .38s ease, transform .38s ease;
}

.helper-card.is-arrived {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.helper-card.is-arrived .helper-photo::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255,255,255,.70) 0 20%, transparent 58%);
  animation: helperGlow 1.4s ease-out both;
}

@keyframes helperGlow {
  from { opacity: 0; transform: scale(.82); }
  45% { opacity: 1; }
  to { opacity: 0; transform: scale(1.12); }
}

/* Chat */
.screen-chat {
  background:
    radial-gradient(circle at 110% -8%, rgba(245, 220, 122, .48) 0 86px, transparent 88px),
    radial-gradient(circle at -12% 96%, rgba(200, 107, 55, .22) 0 104px, transparent 106px),
    linear-gradient(180deg, #fff1d8 0%, #ffe5bd 50%, #f7c995 100%);
}

.screen-chat::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .52;
  background:
    linear-gradient(135deg, transparent 0 65%, rgba(255, 248, 235, .55) 65% 100%),
    radial-gradient(circle at 86% 22%, rgba(232, 169, 143, .26) 0 74px, transparent 76px);
}

.chat-panel {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  padding: 14px;
  border-radius: 30px;
  background: rgba(255, 248, 235, .76);
  border: 1px solid rgba(90, 43, 23, .10);
  box-shadow: 0 22px 70px rgba(90, 43, 23, .15);
}

.chat-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-bottom: 12px;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(90, 43, 23, .72);
  background: rgba(245, 220, 122, .34);
  font-size: 13px;
  font-weight: 850;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #8bbf55;
  box-shadow: 0 0 0 5px rgba(139, 191, 85, .16);
}

.chat-messages {
  display: flex;
  flex: 1;
  min-height: 330px;
  overflow-y: auto;
  flex-direction: column;
  gap: 10px;
  padding: 8px 2px 14px;
  overscroll-behavior: contain;
}

.chat-message {
  max-width: 84%;
  padding: 12px 14px;
  border-radius: 20px;
  font-size: 16px;
  line-height: 1.28;
  box-shadow: 0 8px 20px rgba(90, 43, 23, .08);
  animation: fadeUp .24s ease both;
}

.chat-bot {
  align-self: flex-start;
  color: #5a2b17;
  background: #fff8eb;
  border-bottom-left-radius: 7px;
}

.chat-user {
  align-self: flex-end;
  color: #fff8eb;
  background: #8e4324;
  border-bottom-right-radius: 7px;
}

.chat-typing {
  opacity: .68;
  font-style: italic;
}

.chat-quick {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.chat-quick button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 0;
  border-radius: 999px;
  color: #7a3d15;
  background: rgba(245, 220, 122, .48);
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
}

.chat-form {
  display: flex;
  gap: 8px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .50);
  border: 1px solid rgba(90, 43, 23, .12);
}

.chat-form input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #5a2b17;
  background: transparent;
  padding: 0 10px;
  font: inherit;
  font-size: 15px;
}

.chat-form input::placeholder {
  color: rgba(90, 43, 23, .44);
}

.chat-form button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  color: #fff8eb;
  background: #8e4324;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

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


/* v8: keep first cover clean - no saved-state plaque over the raccoon photo */
.screen-start .daily-return {
  display: none !important;
}

/* v8: animated result bars */
.metric-item i::after {
  width: 0;
}

.screen-result.is-active .metric-item i::after {
  animation: metricFill .92s cubic-bezier(.2, .8, .2, 1) forwards;
}

.screen-result.is-active .metric-item:nth-child(1) i::after { animation-delay: .30s; }
.screen-result.is-active .metric-item:nth-child(2) i::after { animation-delay: .42s; }
.screen-result.is-active .metric-item:nth-child(3) i::after { animation-delay: .54s; }
.screen-result.is-active .metric-item:nth-child(4) i::after { animation-delay: .66s; }

@keyframes metricFill {
  from { width: 0; }
  to { width: var(--fill); }
}

/* v8: notification from white raccoon */
.helper-toast {
  width: 100%;
  min-height: 74px;
  margin: -2px 0 14px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 248, 235, .78);
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff8eb;
  text-align: left;
  background: linear-gradient(135deg, rgba(142, 67, 36, .96), rgba(200, 107, 55, .92));
  box-shadow: 0 18px 42px rgba(90, 43, 23, .22);
  cursor: pointer;
  animation: toastIn .38s cubic-bezier(.2, .82, .2, 1) both;
}

.helper-toast[hidden] {
  display: none !important;
}

.toast-dot {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #7a3d15;
  background: #f5dc7a;
  font-weight: 950;
  box-shadow: 0 0 0 6px rgba(245, 220, 122, .20);
}

.toast-copy {
  display: grid;
  gap: 3px;
  flex: 1;
}

.toast-copy b {
  font-size: 15px;
  line-height: 1.05;
  letter-spacing: -.02em;
}

.toast-copy small {
  font-size: 13px;
  color: rgba(255, 248, 235, .78);
  font-weight: 750;
}

.toast-arrow {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 248, 235, .16);
  font-weight: 900;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(-10px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-notice {
  align-self: center;
  max-width: 92%;
  padding: 10px 13px;
  border-radius: 999px;
  color: rgba(90, 43, 23, .78);
  background: rgba(245, 220, 122, .42);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  box-shadow: none;
}


/* v9: more visible notification in chat */
.chat-notice {
  align-self: stretch;
  max-width: none;
  margin: 8px 0 6px;
  padding: 16px 16px 16px 54px;
  border-radius: 24px;
  position: relative;
  color: #5a2b17;
  background:
    radial-gradient(circle at 18px 20px, #fff8eb 0 8px, transparent 9px),
    linear-gradient(135deg, #f5dc7a 0%, #ffe8a8 48%, #f2c98e 100%);
  border: 1.5px solid rgba(142, 67, 36, .22);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 950;
  text-align: left;
  white-space: pre-line;
  box-shadow:
    0 16px 38px rgba(90, 43, 23, .20),
    inset 0 1px 0 rgba(255, 255, 255, .58);
  animation: noticePop .46s cubic-bezier(.2, .82, .2, 1) both, noticePulse 1.8s ease-in-out .7s 2;
}

.chat-notice::before {
  content: "!";
  position: absolute;
  left: 15px;
  top: 17px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff8eb;
  background: #9b4a2b;
  box-shadow: 0 0 0 6px rgba(155, 74, 43, .10);
  font-size: 16px;
  font-weight: 950;
}

.chat-notice::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 18px;
  border: 1px dashed rgba(142, 67, 36, .20);
  pointer-events: none;
}

@keyframes noticePop {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes noticePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 16px 38px rgba(90, 43, 23, .20), inset 0 1px 0 rgba(255, 255, 255, .58); }
  50% { transform: scale(1.018); box-shadow: 0 20px 48px rgba(90, 43, 23, .28), inset 0 1px 0 rgba(255, 255, 255, .72); }
}

/* v9: helper-page notification should feel tappable */
.helper-toast {
  position: relative;
  overflow: hidden;
  box-shadow:
    0 18px 42px rgba(90, 43, 23, .26),
    0 0 0 6px rgba(245, 220, 122, .12);
}

.helper-toast::after {
  content: "";
  position: absolute;
  inset: -60% auto -60% -30%;
  width: 46%;
  transform: rotate(16deg);
  background: linear-gradient(90deg, transparent, rgba(255, 248, 235, .22), transparent);
  animation: toastShine 2.4s ease-in-out infinite;
}

@keyframes toastShine {
  0% { left: -55%; }
  55%, 100% { left: 115%; }
}

@media (max-width: 380px) {
  .chat-notice {
    padding-left: 50px;
    font-size: 14px;
  }
}


/* v10: calmer chat notification + old quick chips */
.chat-notice {
  align-self: flex-start !important;
  max-width: 94% !important;
  margin: 8px 0 8px !important;
  padding: 12px 14px 12px 44px !important;
  border-radius: 18px !important;
  position: relative !important;
  color: rgba(90, 43, 23, .88) !important;
  background: rgba(245, 220, 122, .42) !important;
  border: 1px solid rgba(142, 67, 36, .12) !important;
  font-size: 14px !important;
  line-height: 1.28 !important;
  font-weight: 850 !important;
  text-align: left !important;
  white-space: normal !important;
  box-shadow: 0 8px 22px rgba(90, 43, 23, .08) !important;
  animation: chatBubbleIn .28s ease both !important;
}

.chat-notice::before {
  content: "🔔" !important;
  position: absolute !important;
  left: 14px !important;
  top: 12px !important;
  width: auto !important;
  height: auto !important;
  display: block !important;
  border-radius: 0 !important;
  color: inherit !important;
  background: transparent !important;
  box-shadow: none !important;
  font-size: 18px !important;
  line-height: 1 !important;
}

.chat-notice::after {
  display: none !important;
}

.chat-bot {
  box-shadow: 0 8px 22px rgba(90, 43, 23, .06);
}

.chat-quick {
  gap: 8px;
}

.chat-quick button {
  background: rgba(245, 220, 122, .58);
  color: rgba(90, 43, 23, .90);
}


/* v11: real messenger scrolling + calmer notification */
.screen-chat.is-active {
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
}

.screen-chat .topbar {
  flex: 0 0 auto;
}

.screen-chat .chat-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.screen-chat .chat-messages {
  flex: 1 1 auto;
  min-height: 0 !important;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 16px;
}

.screen-chat .chat-quick,
.screen-chat .chat-form,
.screen-chat .chat-status {
  flex: 0 0 auto;
}

.chat-notice {
  align-self: flex-start !important;
  max-width: 92% !important;
  margin: 8px 0 8px !important;
  padding: 11px 14px 11px 42px !important;
  border-radius: 18px !important;
  color: rgba(90, 43, 23, .88) !important;
  background: rgba(255, 248, 235, .72) !important;
  border: 1px solid rgba(245, 220, 122, .56) !important;
  box-shadow: 0 8px 22px rgba(90, 43, 23, .06) !important;
  font-size: 14px !important;
  font-weight: 850 !important;
}

.chat-notice::before {
  content: "🔔" !important;
  left: 14px !important;
  top: 11px !important;
  font-size: 17px !important;
}

.chat-notice::after {
  display: none !important;
}

.chat-quick button {
  white-space: nowrap;
}


/* Password gate */
.locked .app {
  display: none;
}

.password-gate {
  width: min(100%, 460px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(26px + var(--safe-top)) 22px calc(24px + var(--safe-bottom));
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  color: #fff2dc;
  background:
    linear-gradient(180deg, rgba(72, 31, 9, .16), rgba(72, 31, 9, .42)),
    url("splash-cover.webp") center / cover no-repeat,
    #c86b37;
  box-shadow: 0 0 0 1px rgba(90, 43, 23, .08), 0 20px 80px rgba(0,0,0,.12);
}

.password-gate::before {
  content: "ЕНОТ";
  position: absolute;
  left: -20px;
  top: 22%;
  font-size: 132px;
  line-height: .8;
  font-weight: 950;
  letter-spacing: -.08em;
  color: rgba(255, 232, 183, .10);
  transform: rotate(-8deg);
  pointer-events: none;
}

.gate-card {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 24px;
  border-radius: 34px;
  background: rgba(72, 31, 9, .34);
  border: 1px solid rgba(255, 242, 216, .24);
  box-shadow: 0 24px 80px rgba(72, 31, 9, .34);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.gate-eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  letter-spacing: .13em;
  text-transform: uppercase;
  font-weight: 900;
  color: rgba(255, 232, 183, .78);
}

.gate-card h1 {
  margin: 0 0 12px;
  max-width: 8ch;
  font-size: clamp(44px, 12vw, 62px);
  line-height: .92;
  letter-spacing: -.07em;
  color: #ffe8b7;
  text-shadow: 0 4px 22px rgba(72, 31, 9, .38);
}

.gate-lead {
  margin: 0 0 22px;
  max-width: 310px;
  color: rgba(255, 251, 242, .92);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 650;
}

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

.gate-form input {
  width: 100%;
  min-height: 58px;
  padding: 0 18px;
  border: 1px solid rgba(255, 242, 216, .40);
  border-radius: 999px;
  color: #5a2b17;
  background: rgba(255, 248, 235, .94);
  font: inherit;
  font-weight: 750;
  outline: none;
}

.gate-form input::placeholder {
  color: rgba(90, 43, 23, .45);
}

.gate-form input:focus {
  border-color: rgba(245, 220, 122, .94);
  box-shadow: 0 0 0 4px rgba(245, 220, 122, .18);
}

.gate-error {
  margin: 12px 0 0;
  color: #ffe8b7;
  font-size: 14px;
  font-weight: 750;
}

.gate-hint {
  margin: 14px 0 0;
  color: rgba(255, 251, 242, .62);
  font-size: 13px;
  text-align: center;
}

@media (min-width: 720px) {
  .password-gate {
    min-height: calc(100dvh - 52px);
    border-radius: 34px;
  }
}


.password-gate.shake .gate-card {
  animation: gateShake .36s ease both;
}

@keyframes gateShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  50% { transform: translateX(7px); }
  75% { transform: translateX(-4px); }
}


/* v13 fixes */
.password-gate[hidden] {
  display: none !important;
}

body:not(.locked) {
  overflow-x: hidden;
}

.gate-card {
  margin-top: 0;
}

.chat-quick {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
  overflow: visible !important;
  padding: 0 0 8px !important;
}

.chat-quick button {
  width: 100% !important;
  min-width: 0 !important;
  white-space: normal !important;
  text-align: center !important;
  line-height: 1.08 !important;
  padding: 11px 8px !important;
}

.chat-panel {
  overflow: hidden !important;
}

.chat-messages {
  overscroll-behavior: contain;
}

.gate-eyebrow {
  display: none !important;
}


/* v14: password gate must be an overlay, not a stacked page */
.password-gate {
  position: fixed !important;
  inset: 0 !important;
  z-index: 1000 !important;
  margin: 0 auto !important;
}

body.locked {
  overflow: hidden;
}

body.locked .app {
  display: none !important;
}


/* v15 mobile optimization */
.state-photo img, .result-photo-wrap img, .helper-photo img, .cover-art img { transform: translateZ(0); }
