:root {
  color-scheme: dark;
  --night: #17132c;
  --night-deep: #0f1025;
  --void: #2a214b;
  --violet: #6e63b7;
  --lavender: #b7a8f2;
  --mist: #b7d8ee;
  --dawn: #d7e4dc;
  --sage: #9fbda7;
  --surface: rgba(246, 241, 255, 0.9);
  --surface-strong: #fbf8ff;
  --surface-dim: rgba(37, 31, 67, 0.78);
  --ink: #221b35;
  --ink-soft: #645b78;
  --text-on-dark: #f8f4ff;
  --line: rgba(248, 244, 255, 0.28);
  --line-dark: rgba(34, 27, 53, 0.16);
  --aura: #9de7db;
  --clue-peach: #ffb6a3;
  --clue-mint: #8fe4c0;
  --clue-mango: #f7d77a;
  --clue-berry: #d9a0ff;
  --plum: #594b91;
  --boba: #3f2d45;
  --milk-tea: #ead9bd;
  --matcha: #8fc99e;
  --button: #4d5f9f;
  --button-hover: #40528f;
  --shadow-soft: 0 26px 70px rgba(15, 16, 37, 0.34);
  --shadow-card: 0 16px 36px rgba(15, 16, 37, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 18% 12%, rgba(183, 168, 242, 0.35), transparent 26%),
    radial-gradient(circle at 82% 6%, rgba(157, 231, 219, 0.26), transparent 23%),
    radial-gradient(circle at 50% 100%, rgba(159, 189, 167, 0.42), transparent 34%),
    linear-gradient(180deg, var(--night-deep) 0%, var(--night) 38%, #2c3151 68%, #c7d9cf 100%);
  color: var(--ink);
  font-family: "Pretendard", "Avenir Next", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(248, 244, 255, 0.8) 0 1px, transparent 1.4px),
    radial-gradient(circle, rgba(157, 231, 219, 0.55) 0 1px, transparent 1.3px);
  background-position: 12px 22px, 78px 44px;
  background-size: 96px 96px, 132px 132px;
  opacity: 0.42;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  font: inherit;
  font-weight: 850;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid var(--aura);
  outline-offset: 3px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1060px, calc(100% - 28px));
  min-height: calc(100vh - 44px);
  margin: 22px auto;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(320px, 0.94fr) minmax(340px, 1fr);
  grid-template-rows: 1fr;
  gap: 0;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid rgba(248, 244, 255, 0.26);
  border-radius: 30px;
  background:
    linear-gradient(180deg, rgba(248, 244, 255, 0.9), rgba(226, 236, 240, 0.88));
  box-shadow: 0 28px 80px rgba(15, 16, 37, 0.34);
  backdrop-filter: blur(18px);
}

.top-bar {
  position: absolute;
  z-index: 10;
  top: 6px;
  left: 22px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
}

.app-state-loading .top-bar,
.app-state-question .top-bar,
.app-state-result .top-bar {
  display: none;
}

.eyebrow,
.panel-kicker,
.result-label,
.host-name {
  margin: 0 0 6px;
  color: var(--plum);
  font-size: 13px;
  font-weight: 950;
}

h1 {
  margin: 0;
  color: rgba(248, 244, 255, 0.92);
  font-size: 22px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 0 16px rgba(183, 168, 242, 0.72),
    0 2px 10px rgba(15, 16, 37, 0.52);
}

.character-stage,
.flow-panel {
  min-height: 610px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.character-stage {
  --field-core-opacity: 0.58;
  --field-core-scale: 0.9;
  --field-ring-opacity: 0.22;
  --field-glow: 0.24;
  --field-brightness: 0.92;
  --field-saturation: 0.9;
  position: relative;
  display: grid;
  grid-template-rows: 1fr auto;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(157, 231, 219, 0.18), transparent 22%),
    radial-gradient(circle at 38% 36%, rgba(217, 160, 255, 0.2), transparent 18%),
    linear-gradient(180deg, #1b1735 0%, #29264c 52%, #586a79 100%);
  border-right: 1px solid rgba(248, 244, 255, 0.16);
}

.character-stage::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  background:
    linear-gradient(180deg, transparent 0%, rgba(183, 216, 238, 0.16) 32%, rgba(199, 217, 207, 0.42) 100%);
  pointer-events: none;
}

.aura-sky {
  position: absolute;
  inset: 26px 26px auto;
  height: 190px;
  pointer-events: none;
}

.aura-sky span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(248, 244, 255, 0.88);
  box-shadow: 0 0 18px rgba(183, 168, 242, 0.8);
  animation: star-drift 5.8s ease-in-out infinite;
}

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

.aura-sky span:nth-child(2) {
  right: 18%;
  top: 30%;
  width: 10px;
  height: 10px;
  animation-delay: 0.8s;
}

.aura-sky span:nth-child(3) {
  left: 50%;
  top: 4%;
  width: 5px;
  height: 5px;
  animation-delay: 1.5s;
}

.taste-orbit {
  position: absolute;
  z-index: 2;
  top: 150px;
  left: 50%;
  width: 320px;
  height: 178px;
  transform: translateX(-50%);
  pointer-events: none;
}

.taste-orbit span,
.field-clue {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(248, 244, 255, 0.54);
  box-shadow: 0 0 22px currentColor;
}

.taste-orbit span:nth-child(1) {
  left: 18px;
  top: 70px;
  width: 22px;
  height: 22px;
  color: var(--clue-peach);
  background: var(--clue-peach);
}

.taste-orbit span:nth-child(2) {
  right: 28px;
  top: 44px;
  width: 18px;
  height: 18px;
  color: var(--clue-mango);
  background: var(--clue-mango);
}

.taste-orbit span:nth-child(3) {
  left: 58px;
  bottom: 22px;
  width: 16px;
  height: 16px;
  color: var(--clue-mint);
  background: var(--clue-mint);
}

.taste-orbit span:nth-child(4) {
  right: 72px;
  bottom: 12px;
  width: 20px;
  height: 20px;
  color: var(--clue-berry);
  background: var(--clue-berry);
}

.scent-field {
  position: absolute;
  z-index: 1;
  top: 112px;
  left: 50%;
  width: 240px;
  height: 180px;
  transform: translateX(-50%);
  pointer-events: none;
}

.scent-field span {
  position: absolute;
  bottom: 0;
  width: 52px;
  height: 96px;
  border: solid rgba(183, 168, 242, 0.3);
  border-width: 0 0 0 2px;
  border-radius: 50%;
  animation: scent-rise 4.8s ease-in-out infinite;
}

.scent-field span:nth-child(1) {
  left: 34px;
}

.scent-field span:nth-child(2) {
  left: 98px;
  border-color: rgba(157, 231, 219, 0.3);
  animation-delay: 0.7s;
}

.scent-field span:nth-child(3) {
  left: 160px;
  animation-delay: 1.4s;
}

.taste-field {
  position: relative;
  z-index: 3;
  width: 320px;
  height: 268px;
  margin-top: 70px;
  display: grid;
  place-items: center;
  filter: brightness(var(--field-brightness)) saturate(var(--field-saturation));
  animation: field-breathe 5.2s ease-in-out infinite;
  transition: filter 220ms ease;
}

.field-core {
  position: absolute;
  width: 146px;
  height: 146px;
  border: 1px solid rgba(248, 244, 255, 0.36);
  border-radius: 999px;
  opacity: var(--field-core-opacity);
  transform: scale(var(--field-core-scale));
  background:
    radial-gradient(circle at 42% 35%, rgba(248, 244, 255, 0.56), transparent 20%),
    radial-gradient(circle at 54% 52%, rgba(157, 231, 219, 0.34), transparent 38%),
    radial-gradient(circle at 50% 50%, rgba(183, 168, 242, 0.32), rgba(42, 33, 75, 0.08) 68%, transparent 70%);
  box-shadow:
    inset 0 0 34px rgba(248, 244, 255, 0.18),
    0 0 52px rgba(157, 231, 219, var(--field-glow)),
    0 24px 62px rgba(15, 16, 37, 0.28);
  filter: blur(0.2px);
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.field-ring {
  position: absolute;
  border: 1px solid rgba(248, 244, 255, var(--field-ring-opacity));
  border-radius: 999px;
  box-shadow: 0 0 28px rgba(183, 168, 242, calc(var(--field-ring-opacity) * 0.7));
  transition: border-color 220ms ease, box-shadow 220ms ease, opacity 220ms ease;
}

.field-ring-one {
  width: 226px;
  height: 126px;
  transform: rotate(-14deg);
}

.field-ring-two {
  width: 248px;
  height: 150px;
  transform: rotate(17deg);
  border-color: rgba(157, 231, 219, var(--field-ring-opacity));
}

.field-clue {
  opacity: 0.42;
  transform: scale(0.82);
  transition: opacity 160ms ease, transform 160ms ease;
}

.field-clue.active {
  opacity: 1;
  transform: scale(1);
}

.field-clue-one {
  left: 66px;
  top: 112px;
  width: 14px;
  height: 14px;
  color: var(--clue-mango);
  background: var(--clue-mango);
}

.field-clue-two {
  left: 126px;
  top: 154px;
  width: 12px;
  height: 12px;
  color: var(--clue-mint);
  background: var(--clue-mint);
}

.field-clue-three {
  right: 72px;
  top: 102px;
  width: 13px;
  height: 13px;
  color: var(--clue-peach);
  background: var(--clue-peach);
}

.speech-card {
  position: relative;
  z-index: 4;
  width: min(410px, calc(100% - 32px));
  margin: 0 0 18px;
  padding: 16px 18px;
  border: 1px solid rgba(248, 244, 255, 0.34);
  border-radius: 16px;
  background: rgba(248, 244, 255, 0.82);
  box-shadow: 0 10px 24px rgba(15, 16, 37, 0.12);
  backdrop-filter: blur(16px);
}

.speech-card::before {
  content: none;
}

#host-message {
  min-height: 48px;
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 850;
  line-height: 1.38;
}

.character-stage[data-host-mood="thinking"] .field-core {
  animation-duration: 1.8s;
}

.character-stage[data-host-mood="thinking"] .scent-field span {
  animation-duration: 2.4s;
}

.character-stage[data-host-mood="result"] .taste-field {
  animation: field-reveal 0.58s ease-out, field-breathe 5.2s ease-in-out 0.58s infinite;
}

.character-stage[data-host-mood="result"] {
  --field-core-opacity: 1;
  --field-core-scale: 1.14;
  --field-ring-opacity: 0.76;
  --field-glow: 0.82;
  --field-brightness: 1.18;
  --field-saturation: 1.28;
}

.character-stage[data-host-mood="result"] .field-core {
  background:
    radial-gradient(circle at 42% 35%, rgba(248, 244, 255, 0.6), transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(247, 215, 122, 0.24), transparent 42%),
    radial-gradient(circle at 54% 54%, rgba(157, 231, 219, 0.32), transparent 62%);
}

.character-stage[data-host-mood="retry"] .taste-field {
  animation: field-shift 0.62s ease-out, field-breathe 5.2s ease-in-out 0.62s infinite;
}

.character-stage[data-host-mood="error"] .taste-field {
  opacity: 0.68;
}

.flow-panel {
  display: grid;
  align-content: start;
  padding: 26px;
  background:
    linear-gradient(180deg, rgba(248, 244, 255, 0.94), rgba(231, 238, 244, 0.9));
  backdrop-filter: blur(18px);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

#loading-view.active {
  display: grid;
  min-height: 360px;
  place-items: center;
  color: var(--ink-soft);
  font-weight: 850;
}

.panel-kicker {
  color: var(--violet);
}

.hero-copy {
  margin: 0 0 22px;
  color: var(--ink-soft);
  font-size: 18px;
  font-weight: 760;
  line-height: 1.58;
}

.primary-button,
.secondary-button,
.ghost-button,
.answer-button {
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease, border-color 140ms ease;
}

.primary-button {
  width: 100%;
  border: 1px solid rgba(248, 244, 255, 0.32);
  background: var(--button);
  color: var(--text-on-dark);
  box-shadow: 0 14px 30px rgba(42, 33, 75, 0.24);
}

.primary-button:hover {
  background: var(--button-hover);
  transform: translateY(-2px);
  box-shadow: 0 18px 34px rgba(42, 33, 75, 0.3);
}

.secondary-button,
.ghost-button {
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
}

.secondary-button {
  width: 100%;
  margin-top: 14px;
}

.ghost-button {
  min-height: 40px;
  padding: 0 14px;
  color: var(--plum);
  font-size: 14px;
}

.progress-header,
.action-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.progress-header {
  margin-bottom: 8px;
}

.progress-header .panel-kicker {
  margin: 0;
}

.progress-track {
  position: relative;
  height: 16px;
  margin: 16px 0 28px;
  border: 1px solid rgba(248, 244, 255, 0.42);
  border-radius: 999px;
  background:
    radial-gradient(circle at 18% 45%, rgba(248, 244, 255, 0.68) 0 1px, transparent 1.6px),
    radial-gradient(circle at 63% 42%, rgba(157, 231, 219, 0.5) 0 1px, transparent 1.5px),
    linear-gradient(90deg, rgba(23, 19, 44, 0.82), rgba(42, 33, 75, 0.62));
  box-shadow:
    inset 0 0 16px rgba(15, 16, 37, 0.28),
    0 10px 24px rgba(42, 33, 75, 0.1);
  overflow: hidden;
}

.progress-track::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(248, 244, 255, 0.22), transparent);
  opacity: 0.5;
  pointer-events: none;
}

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 88% 50%, rgba(248, 244, 255, 0.92) 0 3px, transparent 4px),
    linear-gradient(90deg, rgba(183, 168, 242, 0.62), rgba(157, 231, 219, 0.86));
  box-shadow:
    0 0 20px rgba(157, 231, 219, 0.52),
    inset 0 0 10px rgba(248, 244, 255, 0.28);
  transition: width 180ms ease;
}

#question-text {
  min-height: 80px;
  margin: 0 0 16px;
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: 0;
}

.answer-list {
  display: grid;
  gap: 10px;
}

#question-view.active {
  min-height: 0;
}

.question-scroll-area {
  min-height: 0;
}

.answer-button {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  border: 1px solid var(--line-dark);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 10px 20px rgba(15, 16, 37, 0.07);
}

.answer-button:hover,
.answer-button:active {
  border-color: rgba(110, 99, 183, 0.42);
  background: rgba(255, 255, 255, 0.78);
  transform: translateY(-1px);
}

.answer-button::before {
  content: "";
  display: inline-block;
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  margin-right: 11px;
  border: 1px solid rgba(183, 168, 242, 0.72);
  border-radius: 999px;
  background: linear-gradient(145deg, rgba(183, 168, 242, 0.98), rgba(89, 75, 145, 0.98));
  box-shadow:
    0 0 0 4px rgba(183, 168, 242, 0.16),
    0 0 12px rgba(183, 168, 242, 0.42);
  vertical-align: -1px;
}

.result-menu-card {
  position: relative;
  padding: 22px;
  border: 1px solid rgba(248, 244, 255, 0.5);
  border-radius: 24px;
  background:
    radial-gradient(circle at 88% 12%, rgba(157, 231, 219, 0.32), transparent 26%),
    linear-gradient(180deg, rgba(45, 37, 82, 0.94), rgba(29, 26, 54, 0.94));
  color: var(--text-on-dark);
  box-shadow: 0 20px 46px rgba(15, 16, 37, 0.24);
  overflow: hidden;
}

.result-menu-card .result-label {
  color: rgba(248, 244, 255, 0.72);
}

.result-menu-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(248, 244, 255, 0.18);
  border-radius: 18px;
  pointer-events: none;
}

#result-name {
  position: relative;
  margin: 0 0 12px;
  font-size: 52px;
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.result-reason {
  position: relative;
  min-height: 42px;
  margin: 0 0 14px;
  color: rgba(248, 244, 255, 0.76);
  font-size: 17px;
  font-weight: 760;
  line-height: 1.48;
}

.result-chips {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.result-chip {
  padding: 8px 10px;
  border: 1px solid rgba(248, 244, 255, 0.26);
  border-radius: 10px;
  background: rgba(157, 231, 219, 0.16);
  color: var(--text-on-dark);
  font-size: 14px;
  font-weight: 850;
}

.alternative-tray {
  margin: 16px 0 18px;
  padding: 12px;
  border: 1px solid var(--line-dark);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(231, 238, 244, 0.54));
}

.alternatives {
  display: grid;
  gap: 9px;
}

.alternative-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 14px;
  border: 1px solid rgba(34, 27, 53, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.6);
  font-weight: 850;
}

.alternative-card span:first-child {
  overflow-wrap: anywhere;
}

.alternative-card span:last-child {
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-weight: 760;
}

.action-row .secondary-button,
.action-row .primary-button {
  margin: 0;
}

.app-state-home .app-shell {
  width: min(520px, calc(100% - 24px));
  min-height: calc(100vh - 32px);
  grid-template-columns: 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  background:
    radial-gradient(circle at 50% 39%, rgba(157, 231, 219, 0.18), transparent 21%),
    radial-gradient(circle at 28% 21%, rgba(183, 168, 242, 0.32), transparent 27%),
    radial-gradient(circle at 76% 24%, rgba(217, 160, 255, 0.16), transparent 22%),
    radial-gradient(circle at 50% 112%, rgba(199, 217, 207, 0.28), transparent 34%),
    linear-gradient(180deg, rgba(13, 14, 32, 0.98) 0%, rgba(25, 21, 52, 0.98) 50%, rgba(38, 44, 76, 0.96) 100%);
  box-shadow:
    0 28px 80px rgba(15, 16, 37, 0.42),
    inset 0 0 0 1px rgba(248, 244, 255, 0.1);
}

.app-state-home .app-shell::before,
.app-state-home .app-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.app-state-home .app-shell::before {
  z-index: 0;
  background-image:
    radial-gradient(circle, rgba(248, 244, 255, 0.9) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(157, 231, 219, 0.55) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(183, 168, 242, 0.48) 0 1px, transparent 1.4px);
  background-position: 18px 28px, 92px 74px, 156px 122px;
  background-size: 118px 118px, 154px 154px, 196px 196px;
  opacity: 0.42;
}

.app-state-home .app-shell::after {
  z-index: 0;
  background:
    linear-gradient(180deg, transparent 0%, transparent 58%, rgba(183, 216, 238, 0.11) 74%, rgba(199, 217, 207, 0.18) 100%),
    radial-gradient(ellipse at 50% 45%, transparent 0 24%, rgba(15, 16, 37, 0.24) 74%);
}

.app-state-home .top-bar {
  position: relative;
  top: auto;
  left: auto;
  z-index: 6;
  width: 100%;
  min-height: auto;
  margin: 42px auto 8px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
  justify-content: center;
  text-align: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: home-fade-up 520ms ease-out both;
}

.app-state-home h1 {
  color: rgba(248, 244, 255, 0.96);
  font-size: 72px;
  font-weight: 950;
  line-height: 1;
  text-align: center;
  text-shadow:
    0 0 18px rgba(183, 168, 242, 0.74),
    0 0 42px rgba(157, 231, 219, 0.18),
    0 4px 22px rgba(15, 16, 37, 0.58);
}

.app-state-home .character-stage {
  z-index: 2;
  min-height: 324px;
  max-height: 324px;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  animation: home-fade-up 620ms ease-out 70ms both;
}

.app-state-home .character-stage::after {
  height: 100%;
  background:
    radial-gradient(circle at 50% 58%, rgba(157, 231, 219, 0.16), transparent 34%),
    radial-gradient(circle at 50% 86%, rgba(199, 217, 207, 0.1), transparent 30%);
}

.app-state-home .speech-card {
  display: none;
}

.app-state-home .flow-panel {
  position: relative;
  z-index: 3;
  min-height: 0;
  padding: 0 28px 36px;
  align-content: start;
  background: transparent;
}

.app-state-home #home-view.active {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  align-items: center;
}

.app-state-home #home-view .panel-kicker {
  display: none;
}

.app-state-home .hero-copy {
  width: min(360px, 100%);
  margin: -20px 0 34px;
  padding: 14px 18px;
  border: 1px solid rgba(248, 244, 255, 0.24);
  border-radius: 14px;
  background:
    radial-gradient(circle at 20% 8%, rgba(183, 168, 242, 0.18), transparent 36%),
    rgba(20, 18, 43, 0.54);
  color: rgba(248, 244, 255, 0.96);
  font-size: 23px;
  font-weight: 780;
  line-height: 1.36;
  text-align: center;
  text-shadow: 0 2px 16px rgba(15, 16, 37, 0.42);
  box-shadow:
    0 18px 38px rgba(15, 16, 37, 0.2),
    inset 0 0 0 1px rgba(248, 244, 255, 0.06);
  backdrop-filter: blur(12px);
  animation: home-fade-up 620ms ease-out 150ms both;
}

.app-state-home #start-button {
  width: min(300px, 100%);
  min-height: 62px;
  margin-top: auto;
  margin-bottom: 22px;
  border-color: rgba(248, 244, 255, 0.32);
  background: var(--button);
  color: var(--text-on-dark);
  font-size: 28px;
  font-weight: 850;
  box-shadow:
    0 18px 36px rgba(42, 33, 75, 0.24),
    inset 0 0 0 1px rgba(248, 244, 255, 0.16);
  animation: home-fade-up 620ms ease-out 230ms both;
}

.app-state-home #start-button:hover {
  background: var(--button-hover);
  box-shadow:
    0 22px 40px rgba(42, 33, 75, 0.3),
    inset 0 0 0 1px rgba(248, 244, 255, 0.2);
}

@keyframes field-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes scent-rise {
  0% {
    opacity: 0;
    transform: translateY(44px) scaleY(0.72);
  }
  40% {
    opacity: 0.85;
  }
  100% {
    opacity: 0;
    transform: translateY(-44px) scaleY(1.18);
  }
}

@keyframes star-drift {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes field-reveal {
  0% {
    opacity: 0.72;
    transform: translateY(8px) scale(0.94);
  }
  68% {
    opacity: 1;
    transform: translateY(-4px) scale(1.03);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes field-shift {
  0% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(-8px);
  }
  70% {
    transform: translateX(8px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes home-fade-up {
  0% {
    opacity: 0;
    transform: translateY(14px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .app-shell {
    width: min(100% - 20px, 520px);
    height: calc(100dvh - 30px);
    min-height: 0;
    margin: 10px auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0;
    padding: 0;
  }

  .app-state-home .app-shell {
    width: min(100% - 16px, 520px);
    height: calc(100dvh - 16px);
    margin: 8px auto;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .app-state-home .top-bar {
    width: 100%;
    min-height: auto;
    margin: 34px auto 4px;
    padding: 0 22px;
  }

  .top-bar {
    top: 0;
    left: 16px;
  }

  h1 {
    font-size: 22px;
  }

  .app-state-home h1 {
    font-size: 64px;
  }

  .character-stage {
    height: 280px;
    min-height: 280px;
    max-height: 280px;
  }

  .aura-sky {
    inset: 16px 18px auto;
    height: 126px;
  }

  .taste-orbit {
    top: 72px;
    width: 284px;
    height: 112px;
  }

  .scent-field {
    top: 42px;
    transform: translateX(-50%) scale(0.66);
  }

  .taste-field {
    width: 230px;
    height: 164px;
    margin-top: 8px;
  }

  .field-core {
    width: 100px;
    height: 100px;
  }

  .field-ring-one {
    width: 164px;
    height: 88px;
  }

  .field-ring-two {
    width: 182px;
    height: 104px;
  }

  .field-clue-one {
    left: 48px;
    top: 82px;
  }

  .field-clue-two {
    left: 104px;
    top: 112px;
  }

  .field-clue-three {
    right: 52px;
    top: 78px;
  }

  .speech-card {
    width: min(350px, calc(100% - 28px));
    margin-bottom: 12px;
    padding: 11px 14px;
    border-radius: 16px;
  }

  #host-message {
    min-height: 38px;
    font-size: 14px;
  }

  .flow-panel {
    min-height: auto;
    padding: 14px 16px 16px;
    overflow: hidden;
  }

  .app-state-home .flow-panel {
    padding: 0 22px 28px;
    overflow: visible;
  }

  .app-state-home .hero-copy {
    width: min(350px, 100%);
    margin: -20px 0 30px;
    font-size: 23px;
  }

  .app-state-home #start-button {
    margin-bottom: 18px;
    font-size: 28px;
  }

  #question-view.active {
    display: grid;
    height: 100%;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }

  .question-scroll-area {
    min-height: 0;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  #result-view.active {
    height: 100%;
    min-height: 0;
    padding-right: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
  }

  .hero-copy {
    font-size: 17px;
  }

  .progress-header {
    min-height: 34px;
    margin-bottom: 6px;
  }

  .ghost-button {
    min-height: 34px;
    padding: 0 12px;
  }

  .progress-track {
    height: 14px;
    margin: 8px 0 10px;
  }

  #question-text {
    min-height: 0;
    margin-bottom: 6px;
    font-size: 22px;
    line-height: 1.24;
  }

  .answer-list {
    min-height: 0;
    gap: 8px;
    padding: 1px 0 6px;
    overflow: visible;
  }

  .answer-button {
    min-height: 52px;
    padding: 10px 14px;
  }

  .secondary-button {
    margin-top: 10px;
    margin-bottom: 0;
  }

  #result-name {
    font-size: 40px;
  }

  .action-row {
    flex-direction: column;
  }

  .action-row .secondary-button,
  .action-row .primary-button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .app-shell {
    width: calc(100% - 14px);
  }

  .app-state-home .app-shell {
    width: calc(100% - 12px);
  }

  h1 {
    font-size: 21px;
  }

  .app-state-home h1 {
    font-size: 58px;
  }

  .top-bar {
    left: 15px;
  }

  .app-state-home .top-bar {
    width: 100%;
    min-height: auto;
    margin-top: 30px;
    margin-bottom: 4px;
    padding: 0 18px;
  }

  .character-stage {
    min-height: 280px;
  }

  .app-state-home .character-stage {
    height: 304px;
    min-height: 304px;
    max-height: 304px;
  }

  .flow-panel {
    padding: 12px 14px 14px;
  }

  .app-state-home .flow-panel {
    padding: 0 18px 22px;
  }

  .app-state-home .hero-copy {
    margin-bottom: 28px;
    font-size: 21px;
  }

  .app-state-home #start-button {
    width: min(280px, 100%);
    min-height: 58px;
    font-size: 27px;
  }

  #question-text {
    font-size: 22px;
  }
}

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