:root {
  --bg: #fff8f4;
  --surface: rgba(255, 255, 255, 0.82);
  --text: #332b29;
  --muted: #806f69;
  --rose: #c77985;
  --rose-dark: #99505e;
  --cream: #f2ddd2;
  --coffee: #68483e;
  --gold: #c49a67;
  --border: rgba(105, 72, 62, 0.12);
  --shadow: rgba(85, 55, 48, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  color: var(--text);
  font-family:
    Inter,
    Manrope,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 15% 10%, rgba(199, 121, 133, 0.17), transparent 34%),
    radial-gradient(circle at 90% 85%, rgba(196, 154, 103, 0.14), transparent 35%),
    #fff8f4;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body::-webkit-scrollbar,
.scene::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

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

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

[hidden] {
  display: none !important;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  isolation: isolate;
}

.scene {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    20px
    calc(18px + env(safe-area-inset-bottom, 0px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition:
    opacity 0.35s ease,
    transform 0.35s ease;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.scene.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.scene-inner {
  width: 100%;
  max-width: 440px;
  margin: auto 0;
  padding: 10px 0;
}

.welcome-layout,
.generator-layout,
.final-layout {
  text-align: center;
}

.eyebrow,
.result-label,
.footer-note,
.tiny-note,
.status-note,
.progress-line,
.author-hint {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  color: var(--rose-dark);
}

.hero-title,
.scene-title {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.hero-title {
  margin-top: 18px;
  font-size: 42px;
}

.scene-title {
  font-size: 31px;
}

.lead,
.sublead {
  margin: 16px auto 0;
  color: var(--coffee);
  font-size: 17px;
  line-height: 1.55;
  max-width: 35ch;
}

.sublead {
  font-size: 16px;
  color: var(--muted);
}

.small-title {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.22;
}

.button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 14px 18px;
  color: var(--text);
  font-weight: 750;
  text-align: center;
  text-decoration: none;
  line-height: 1.2;
  cursor: pointer;
  touch-action: manipulation;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.button:active {
  transform: scale(0.98);
}

.button:focus-visible,
.secret-cup:focus-visible {
  outline: 3px solid rgba(153, 80, 94, 0.35);
  outline-offset: 4px;
}

.primary-button {
  color: #fffdfb;
  background: linear-gradient(135deg, var(--rose-dark), var(--rose) 58%, #b88654);
  box-shadow: 0 16px 30px rgba(153, 80, 94, 0.24);
}

.primary-button:hover {
  box-shadow: 0 18px 34px rgba(153, 80, 94, 0.3);
}

.quiet-button {
  color: var(--coffee);
  background: rgba(255, 255, 255, 0.68);
  border-color: var(--border);
  box-shadow: 0 10px 24px rgba(85, 55, 48, 0.08);
}

.quiet-button:hover {
  border-color: rgba(153, 80, 94, 0.24);
  background: rgba(255, 255, 255, 0.88);
}

.glass-card,
.thought-card,
.fact-card {
  border: 1px solid var(--border);
  border-radius: 26px;
  background: var(--surface);
  box-shadow: 0 20px 52px var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.coffee-cup {
  position: relative;
  width: 108px;
  height: 112px;
  margin: 12px auto 0;
}

.coffee-cup-main {
  transition: transform 0.22s ease;
}

.coffee-cup-main.cup-nudge {
  animation: cup-nudge 0.42s ease;
}

.steam,
.cup-body,
.cup-handle,
.cup-saucer {
  position: absolute;
  display: block;
}

.steam {
  bottom: 68px;
  width: 11px;
  height: 30px;
  border-radius: 999px;
  border-left: 2px solid rgba(153, 80, 94, 0.35);
  transform: rotate(12deg);
}

.steam-one {
  left: 35px;
}

.steam-two {
  left: 51px;
  height: 36px;
  border-color: rgba(104, 72, 62, 0.3);
  transform: rotate(-6deg);
}

.steam-three {
  left: 68px;
  height: 27px;
  border-color: rgba(196, 154, 103, 0.42);
}

.cup-body {
  left: 20px;
  bottom: 25px;
  width: 62px;
  height: 48px;
  border-radius: 12px 12px 22px 22px;
  background: linear-gradient(145deg, #fffdfb, var(--cream));
  border: 2px solid rgba(104, 72, 62, 0.16);
  box-shadow: inset 0 -11px 18px rgba(196, 154, 103, 0.16);
}

.cup-body::before {
  content: "";
  position: absolute;
  inset: 8px 11px auto;
  height: 9px;
  border-radius: 999px;
  background: rgba(104, 72, 62, 0.18);
}

.cup-handle {
  right: 14px;
  bottom: 35px;
  width: 28px;
  height: 28px;
  border: 6px solid rgba(242, 221, 210, 0.9);
  border-left: 0;
  border-radius: 0 17px 17px 0;
  box-shadow: 0 0 0 2px rgba(104, 72, 62, 0.12);
}

.cup-saucer {
  left: 12px;
  right: 12px;
  bottom: 16px;
  height: 12px;
  border-radius: 999px;
  background: rgba(196, 154, 103, 0.23);
}

.welcome-layout .button {
  margin-top: 30px;
}

.welcome-layout .tiny-note {
  margin-top: 12px;
  font-size: 13px;
}

.footer-note {
  margin: 34px auto 0;
  max-width: 31ch;
  font-size: 12px;
  line-height: 1.45;
}

.scan-log {
  display: grid;
  gap: 10px;
  min-height: 220px;
  margin-top: 22px;
}

.scan-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  color: var(--coffee);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 10px 20px rgba(85, 55, 48, 0.06);
  animation: soft-in 0.28s ease both;
}

.scan-dot {
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--rose);
  box-shadow: 0 0 0 6px rgba(199, 121, 133, 0.1);
}

.scan-result {
  margin-top: 18px;
  padding: 22px;
  text-align: left;
  animation: soft-in 0.32s ease both;
}

.result-label {
  margin-bottom: 8px;
  color: var(--rose-dark);
  font-weight: 800;
}

.result-text {
  margin: 0 0 18px;
  color: var(--coffee);
}

.button-stack,
.reaction-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.doubt-zone {
  position: relative;
  min-height: 52px;
}

.shy-zone {
  position: relative;
  min-height: 92px;
  overflow: hidden;
}

.shy-button {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(calc(100% - 44px), 340px);
  transform: translate(-50%, -50%) translate(var(--run-x, 0), var(--run-y, 0));
  transition:
    transform 0.22s ease,
    background 0.18s ease,
    border-color 0.18s ease;
}

.doubt-button {
  border-color: rgba(153, 80, 94, 0.18);
}

.doubt-button.is-refusing {
  color: var(--rose-dark);
  background: rgba(242, 221, 210, 0.6);
  border-color: rgba(153, 80, 94, 0.28);
  animation: soft-refuse 0.32s ease;
}

.status-note {
  min-height: 24px;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.45;
}

.facts-layout {
  text-align: left;
}

.facts-layout .scene-title,
.facts-layout .sublead {
  text-align: left;
}

.progress-line {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-top: 16px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--rose-dark);
  font-size: 14px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--border);
}

.facts-grid {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.fact-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 13px;
  width: 100%;
  min-height: 88px;
  padding: 15px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

.fact-card:active {
  transform: scale(0.99);
}

.fact-card:focus-visible {
  outline: 3px solid rgba(153, 80, 94, 0.35);
  outline-offset: 4px;
}

.fact-card.is-open {
  border-color: rgba(153, 80, 94, 0.22);
  background: rgba(255, 255, 255, 0.9);
}

.fact-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 17px;
  background: linear-gradient(145deg, rgba(199, 121, 133, 0.2), rgba(196, 154, 103, 0.2));
  border: 1px solid rgba(104, 72, 62, 0.1);
}

.fact-icon::before,
.fact-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.icon-appearance::before {
  inset: 14px 10px;
  border: 2px solid var(--rose-dark);
  border-radius: 50%;
}

.icon-appearance::after {
  left: 19px;
  top: 19px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
}

.icon-character::before {
  left: 12px;
  top: 12px;
  width: 20px;
  height: 20px;
  border-radius: 7px;
  border: 2px solid var(--coffee);
  transform: rotate(45deg);
}

.icon-character::after {
  right: 10px;
  bottom: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--rose);
}

.icon-small::before {
  left: 13px;
  top: 13px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(153, 80, 94, 0.24);
}

.icon-small::after {
  left: 18px;
  top: 18px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coffee);
}

.icon-road::before {
  left: 21px;
  top: 9px;
  width: 2px;
  height: 27px;
  background: var(--coffee);
  transform: rotate(12deg);
}

.icon-road::after {
  left: 12px;
  top: 24px;
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--gold);
  transform: rotate(-12deg);
}

.icon-care::before {
  left: 11px;
  top: 13px;
  width: 22px;
  height: 18px;
  border-radius: 14px 14px 10px 10px;
  background: var(--rose);
  transform: rotate(-8deg);
}

.icon-care::after {
  left: 18px;
  top: 9px;
  width: 14px;
  height: 22px;
  border-radius: 14px 14px 10px 10px;
  background: var(--rose);
  transform: rotate(35deg);
}

.icon-beauty::before {
  left: 12px;
  top: 12px;
  width: 20px;
  height: 20px;
  border: 2px solid var(--rose-dark);
  border-radius: 50%;
}

.icon-beauty::after {
  left: 22px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: -13px 20px 0 rgba(104, 72, 62, 0.24);
}

.fact-content {
  min-width: 0;
}

.fact-title {
  display: block;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.2;
}

.fact-teaser {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

.fact-body {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  color: var(--coffee);
  animation: soft-in 0.24s ease both;
}

.fact-extra {
  color: var(--rose-dark);
  font-size: 14px;
}

.complete-card {
  margin-top: 14px;
  padding: 20px;
  animation: soft-in 0.28s ease both;
}

.complete-card .button {
  margin-top: 16px;
}

.thought-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 208px;
  margin-top: 26px;
  padding: 28px 22px;
}

.thought-card p {
  margin: 0;
  color: var(--coffee);
  font-size: 19px;
  line-height: 1.48;
}

.generator-layout .button {
  margin-top: 18px;
}

.author-hint {
  margin-top: 14px;
  font-size: 13px;
}

.final-reveal {
  display: grid;
  gap: 10px;
  min-height: 150px;
  align-content: center;
}

.final-reveal-line {
  margin: 0;
  color: var(--coffee);
  font-size: 19px;
  font-family: Georgia, "Times New Roman", serif;
  animation: soft-in 0.34s ease both;
}

.final-card {
  padding: 24px 20px;
  text-align: left;
  animation: soft-in 0.35s ease both;
}

.final-card .scene-title {
  text-align: left;
}

.final-body {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  color: var(--coffee);
}

.final-body p {
  margin: 0;
}

.signature {
  margin: 22px 0 0;
  color: var(--rose-dark);
  font-weight: 850;
}

.reaction-block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.reaction-actions {
  grid-template-columns: 1fr;
}

.mission-card {
  margin-top: 24px;
  padding: 18px;
  border-radius: 22px;
  background: rgba(242, 221, 210, 0.42);
  border: 1px solid rgba(196, 154, 103, 0.18);
  animation: soft-in 0.3s ease both;
}

.mission-card p {
  margin: 10px 0 0;
  color: var(--coffee);
}

.particles {
  position: fixed;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
}

.particle {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 9px;
  height: 9px;
  border-radius: 50%;
  color: var(--rose);
  background: var(--gold);
  opacity: 0;
  animation: particle-pop 900ms ease forwards;
}

.particle.heart {
  width: auto;
  height: auto;
  border-radius: 0;
  color: var(--rose);
  background: transparent;
  font-size: 17px;
  line-height: 1;
}

.secret-trigger-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 18px;
}

.secret-cup {
  position: relative;
  width: 56px;
  height: 56px;
  border: 1px solid rgba(104, 72, 62, 0.14);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(242, 221, 210, 0.58));
  box-shadow:
    0 12px 24px rgba(85, 55, 48, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
  opacity: 0.82;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease,
    transform 0.2s ease;
  animation: cup-arrive 0.42s ease both;
}

.secret-cup:hover,
.secret-cup:focus-visible {
  opacity: 1;
  border-color: rgba(153, 80, 94, 0.24);
  box-shadow:
    0 16px 28px rgba(85, 55, 48, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.88);
}

.secret-cup:active {
  transform: scale(0.94);
}

.secret-cup.is-open {
  opacity: 1;
  border-color: rgba(196, 154, 103, 0.42);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(242, 221, 210, 0.76));
}

.secret-cup::before {
  content: "";
  position: absolute;
  left: 22px;
  top: 10px;
  width: 16px;
  height: 15px;
  border-left: 2px solid rgba(153, 80, 94, 0.36);
  border-right: 2px solid rgba(196, 154, 103, 0.34);
  border-radius: 50%;
  transform: rotate(10deg);
}

.mini-cup {
  position: absolute;
  left: 15px;
  top: 27px;
  width: 25px;
  height: 16px;
  border: 1px solid rgba(104, 72, 62, 0.24);
  border-radius: 6px 6px 10px 10px;
  background: linear-gradient(145deg, #fffdfb, var(--cream));
  box-shadow: inset 0 -6px 10px rgba(196, 154, 103, 0.18);
}

.mini-cup::before {
  content: "";
  position: absolute;
  right: -9px;
  top: 3px;
  width: 10px;
  height: 9px;
  border: 2px solid rgba(104, 72, 62, 0.42);
  border-left: 0;
  border-radius: 0 8px 8px 0;
}

.mini-cup::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -6px;
  bottom: -6px;
  height: 4px;
  border-radius: 999px;
  background: rgba(196, 154, 103, 0.28);
}

.secret-card {
  margin-top: 16px;
  padding: 20px;
  text-align: left;
  animation: soft-in 0.3s ease both;
}

.secret-card p {
  margin: 12px 0 0;
  color: var(--coffee);
}

.secret-card .button {
  margin-top: 16px;
}

@keyframes soft-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

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

@keyframes cup-nudge {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  35% {
    transform: translateY(-5px) rotate(-3deg);
  }

  70% {
    transform: translateY(2px) rotate(2deg);
  }
}

@keyframes particle-pop {
  0% {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.6);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform: translate3d(var(--dx), var(--dy), 0) scale(1.12);
  }
}

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

  45% {
    transform: scale(0.985);
  }
}

@keyframes cup-arrive {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.92);
  }

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

@media (max-width: 370px) {
  .scene {
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-title {
    font-size: 38px;
  }

  .scene-title {
    font-size: 28px;
  }

  .thought-card p {
    font-size: 18px;
  }
}

@media (min-width: 431px) {
  .scene {
    padding-left: 22px;
    padding-right: 22px;
  }

  .hero-title {
    font-size: 44px;
  }
}

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