:root {
  --ink: #2f2942;
  --muted: #756f85;
  --soft: rgba(255, 255, 255, 0.68);
  --line: rgba(255, 255, 255, 0.74);
  --shadow: 0 22px 70px rgba(126, 93, 147, 0.18);
  --radius: 8px;
  --focus: #8a6bff;
  --coral: #f27072;
  --peach: #ffb6a8;
  --mint: #78cdb6;
  --sky: #6fb4e8;
  --sun: #f3bd4e;
  --rose: #ec7aa2;
  --violet: #a883e6;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #fff6f1;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 236, 190, 0.55) 0 12%, transparent 30%),
    radial-gradient(circle at 80% 8%, rgba(154, 127, 236, 0.28) 0 10%, transparent 28%),
    linear-gradient(180deg, #caa7ff 0%, #f8a6c2 20%, #ffc8a5 43%, #fff4ed 71%, #fffdf9 100%);
  overflow-x: hidden;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  content: "";
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(111, 180, 232, 0.34) 0 1px, transparent 1.6px);
  background-position:
    12px 18px,
    70px 80px;
  background-size:
    96px 96px,
    132px 132px;
  opacity: 0.38;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
  touch-action: manipulation;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(138, 107, 255, 0.24);
  outline-offset: 3px;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.62), transparent 33%),
    linear-gradient(180deg, transparent 0 64%, rgba(255, 255, 255, 0.64) 88%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 18px 0 10px;
  backdrop-filter: blur(16px);
}

.brand,
.topnav button,
.ghost-link,
.primary-action,
.product-band button,
.category-pill,
.style-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.52);
  box-shadow: 0 12px 38px rgba(103, 78, 138, 0.1);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 720;
}

.brand-mark {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(138, 107, 255, 0.5);
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.65), transparent),
    conic-gradient(from 110deg, #f27072, #f3bd4e, #78cdb6, #8a6bff, #f27072);
}

.topnav {
  display: flex;
  gap: 10px;
}

.topnav button,
.ghost-link {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
}

.topnav button:hover,
.ghost-link:hover,
.category-pill:hover,
.style-chip:hover {
  background: rgba(255, 255, 255, 0.76);
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 86px);
  margin: 0 auto;
  padding: 22px 0 104px;
}

.screen {
  display: none;
  min-height: calc(100vh - 148px);
}

.screen.active {
  display: block;
  animation: pageIn 360ms ease both;
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

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

.screen-home.active {
  display: grid;
}

.screen-home {
  grid-template-columns: minmax(310px, 0.86fr) minmax(420px, 1.14fr);
  gap: clamp(22px, 4vw, 70px);
  align-items: center;
}

.home-copy {
  padding: 16px 0;
}

.eyebrow {
  margin: 0 0 14px;
  color: rgba(80, 66, 103, 0.72);
  font-size: 13px;
  font-weight: 760;
}

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

h1 {
  max-width: 640px;
  margin-bottom: 20px;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.08;
  font-weight: 820;
}

h1 span {
  display: block;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(30px, 4.4vw, 56px);
  line-height: 1.08;
  font-weight: 800;
}

h3 {
  font-size: 20px;
  line-height: 1.2;
}

.lead {
  max-width: 560px;
  margin-bottom: 28px;
  color: rgba(50, 43, 68, 0.76);
  font-size: 18px;
  line-height: 1.75;
}

.lead.compact {
  max-width: 660px;
  font-size: 16px;
}

.category-strip,
.style-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-pill,
.style-chip {
  min-height: 36px;
  padding: 0 13px;
  border-radius: 999px;
  cursor: pointer;
  color: rgba(47, 41, 66, 0.86);
}

.category-pill {
  display: inline-flex;
  gap: 8px;
  align-items: center;
}

.category-pill::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pill-color);
  content: "";
}

.sphere-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 640px;
  perspective: 1300px;
}

.sphere-rim {
  position: absolute;
  width: min(78vw, 560px);
  aspect-ratio: 1;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 50%;
  box-shadow:
    inset 0 0 80px rgba(255, 255, 255, 0.38),
    inset 0 0 18px rgba(138, 107, 255, 0.16),
    0 38px 110px rgba(104, 77, 160, 0.16);
  transform: rotateX(64deg) rotateZ(-16deg);
}

.emotion-sphere {
  position: relative;
  z-index: 2;
  width: min(80vw, 600px);
  height: min(80vw, 600px);
  transform-style: preserve-3d;
}

.emotion-word {
  position: absolute;
  left: 50%;
  top: 50%;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--word-color);
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
  box-shadow:
    0 12px 32px rgba(74, 56, 111, 0.14),
    0 0 26px color-mix(in srgb, var(--word-color) 40%, transparent);
  backdrop-filter: blur(13px);
  will-change: transform, opacity, filter;
}

.emotion-word.is-selected {
  border-color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.72);
}

.sphere-caption {
  position: absolute;
  right: 4%;
  bottom: 10%;
  z-index: 3;
  display: grid;
  gap: 6px;
  min-width: 180px;
  pointer-events: none;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sphere-caption span {
  color: rgba(76, 67, 96, 0.7);
  font-size: 13px;
}

.sphere-caption strong {
  color: var(--focus);
  font-size: 22px;
}

.ghost-link {
  display: inline-flex;
  align-items: center;
  margin-bottom: 24px;
}

.emotion-layout,
.story-layout,
.generator-layout,
.result-layout,
.memory-layout {
  display: grid;
  gap: clamp(20px, 4vw, 48px);
  align-items: start;
}

.emotion-layout {
  grid-template-columns: minmax(280px, 0.72fr) minmax(420px, 1.28fr);
}

.emotion-intro,
.story-copy,
.generator-form,
.result-actions,
.memory-head {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.emotion-intro,
.story-copy,
.generator-form,
.result-actions,
.memory-head {
  padding: clamp(22px, 4vw, 38px);
}

.emotion-intro h2,
.story-copy h2,
.generator-form h2,
.result-actions h2,
.memory-head h2 {
  background: linear-gradient(92deg, #5b426f, #e36f93 48%, #7b6bee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-rail-wrap {
  min-width: 0;
}

.rail-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  color: rgba(54, 47, 74, 0.74);
}

.rail-heading span {
  font-weight: 760;
}

.rail-heading small {
  color: rgba(54, 47, 74, 0.52);
}

.card-rail {
  display: grid;
  grid-auto-columns: minmax(236px, 282px);
  grid-auto-flow: column;
  gap: 16px;
  overflow-x: auto;
  padding: 8px 4px 22px;
  scroll-snap-type: x mandatory;
  scrollbar-color: rgba(138, 107, 255, 0.32) transparent;
}

.metaphor-card {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 390px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background: var(--card-bg);
  box-shadow: 0 20px 62px rgba(92, 71, 126, 0.14);
  cursor: pointer;
  isolation: isolate;
  scroll-snap-align: start;
  text-align: left;
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.metaphor-card::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0) 38%, rgba(255, 253, 249, 0.62) 80%),
    linear-gradient(120deg, rgba(255, 255, 255, 0.32), transparent 36%);
}

.metaphor-card:hover,
.metaphor-card:focus-visible {
  transform: translateY(-3px);
}

.metaphor-card .visual {
  position: absolute;
  inset: 0;
  z-index: 0;
  height: 100%;
  border: 0;
  border-radius: inherit;
}

.metaphor-copy {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  width: calc(100% - 24px);
  margin: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 16px 44px rgba(68, 49, 92, 0.12);
  backdrop-filter: blur(16px);
}

.metaphor-card h3 {
  margin: 0;
  font-size: 24px;
}

.metaphor-card p {
  margin: 0;
  color: rgba(64, 56, 84, 0.72);
  font-size: 13px;
  line-height: 1.5;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.56);
  color: rgba(68, 58, 88, 0.72);
  font-size: 12px;
}

.visual,
.story-visual,
.card-art {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 30% 16%, rgba(255, 255, 255, 0.78), transparent 22%),
    linear-gradient(160deg, var(--art-a), var(--art-b) 54%, var(--art-c));
}

.visual {
  display: grid;
  place-items: center;
  height: 236px;
}

.has-art {
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--art-a) 34%, transparent),
      color-mix(in srgb, var(--art-b) 20%, transparent) 52%,
      color-mix(in srgb, var(--art-c) 24%, transparent)
    ),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(36, 26, 54, 0.2)),
    var(--card-image),
    linear-gradient(160deg, var(--art-a), var(--art-b) 54%, var(--art-c));
  background-blend-mode: soft-light, normal, normal, normal;
  background-position: center;
  background-size: cover;
}

.visual.has-art {
  box-shadow:
    inset 0 -48px 52px rgba(36, 26, 54, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.story-layout {
  grid-template-columns: minmax(320px, 0.94fr) minmax(320px, 1.06fr);
  align-items: stretch;
}

.story-visual {
  min-height: 560px;
  box-shadow: var(--shadow);
}

.story-visual.has-art {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(27, 22, 42, 0.18)),
    var(--card-image),
    linear-gradient(160deg, var(--art-a), var(--art-b) 54%, var(--art-c));
  background-position: center;
  background-size: cover;
}

.story-visual .motif-icon {
  width: min(44%, 230px);
  height: min(44%, 230px);
}

.source-line {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  margin-bottom: 18px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: rgba(57, 50, 76, 0.72);
}

.story-text {
  color: rgba(47, 41, 66, 0.78);
  font-size: 17px;
  line-height: 2;
}

.primary-action {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.44)),
    linear-gradient(135deg, rgba(138, 107, 255, 0.28), rgba(242, 112, 114, 0.24));
  cursor: pointer;
  font-weight: 760;
}

.generator-layout {
  grid-template-columns: minmax(320px, 0.82fr) minmax(320px, 1.18fr);
  align-items: center;
}

.live-card-wrap {
  order: 1;
}

.generator-form {
  order: 2;
}

.live-card-wrap,
.result-card-zone {
  display: grid;
  place-items: center;
  min-height: 590px;
}

.collectible-card {
  position: relative;
  display: block;
  width: min(360px, 88vw);
  height: 520px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.2)),
    linear-gradient(160deg, var(--art-a), var(--art-b) 55%, var(--art-c));
  box-shadow: 0 34px 90px rgba(82, 60, 118, 0.22);
}

.collectible-card::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 255, 255, 0.82) 0 3px, transparent 4px),
    linear-gradient(130deg, rgba(255, 255, 255, 0.44), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 25%, transparent 60%, rgba(245, 238, 255, 0.3) 100%);
}

.collectible-card.final {
  transform: translateY(-8px);
}

.collectible-card.final::before {
  background:
    radial-gradient(circle at 88% 6%, rgba(255, 255, 255, 0.82) 0 3px, transparent 4px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.56), rgba(255, 255, 255, 0.08) 26%, transparent 58%, rgba(255, 255, 255, 0.28) 100%);
}

.card-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  min-height: 0;
  border: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 -80px 72px rgba(34, 26, 52, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.44);
  z-index: 0;
}

.card-art .motif-icon,
.visual .motif-icon {
  width: 46%;
  height: 46%;
}

.motif-icon {
  color: rgba(255, 255, 255, 0.92);
  filter: drop-shadow(0 14px 24px rgba(77, 53, 111, 0.2));
}

.card-copy {
  position: absolute;
  z-index: 3;
  display: grid;
  gap: 4px;
  margin-top: 0;
  padding: 0;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.card-copy.is-preview {
  top: 26px;
  left: 22px;
  right: 22px;
  bottom: auto;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.3);
  box-shadow: 0 16px 44px rgba(70, 58, 100, 0.1);
  backdrop-filter: blur(14px);
  text-align: left;
}

.card-copy.is-preview strong {
  color: rgba(47, 41, 66, 0.9);
  font-size: 18px;
  font-weight: 720;
  line-height: 1.2;
}

.card-copy.is-preview p {
  margin: 0;
  color: rgba(47, 41, 66, 0.62);
  font-size: 11px;
  line-height: 1.4;
}

.card-copy.is-final {
  top: 42px;
  right: 34px;
  left: 34px;
  text-align: center;
}

.card-copy.is-final strong {
  color: rgba(47, 41, 66, 0.86);
  font-size: 26px;
  font-weight: 680;
  line-height: 1.2;
  letter-spacing: 0;
}

.card-copy.is-final p {
  max-width: 280px;
  margin: 6px auto 0;
  color: rgba(47, 41, 66, 0.62);
  font-size: 13px;
  line-height: 1.65;
}

.card-emotion {
  color: rgba(69, 60, 92, 0.64);
  font-size: 11px;
  font-weight: 720;
  line-height: 1.3;
}

.card-details {
  position: absolute;
  right: 24px;
  bottom: 52px;
  left: 24px;
  z-index: 3;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.34);
  box-shadow: 0 16px 44px rgba(70, 58, 100, 0.12);
  backdrop-filter: blur(16px);
}

.card-details p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0;
  color: rgba(47, 41, 66, 0.76);
  font-size: 13px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-details div {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  color: rgba(47, 41, 66, 0.62);
  font-size: 12px;
  line-height: 1.3;
}

.card-details span {
  min-width: 0;
  overflow: hidden;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-details time {
  flex: 0 0 auto;
}

.card-mark {
  position: absolute;
  right: 0;
  bottom: 22px;
  left: 0;
  z-index: 3;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: 0 2px 10px rgba(70, 58, 100, 0.22);
}

.generator-form {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 16px;
}

.generator-form label {
  display: grid;
  gap: 8px;
  color: rgba(61, 53, 81, 0.72);
  font-size: 14px;
  font-weight: 720;
}

input,
textarea {
  position: relative;
  z-index: 2;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.58);
  color: var(--ink);
}

input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 88px;
  padding: 12px;
  resize: vertical;
}

.style-chip.is-active {
  border-color: rgba(138, 107, 255, 0.46);
  background: rgba(255, 255, 255, 0.82);
  color: #6b52d8;
}

.style-chip {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}

.style-chip::before {
  width: 18px;
  height: 18px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--chip-a), var(--chip-b));
  box-shadow: 0 6px 16px rgba(90, 67, 120, 0.14);
  content: "";
}

.result-layout {
  grid-template-columns: minmax(320px, 0.8fr) minmax(320px, 1.2fr);
  align-items: center;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(74px, 104px)) 1fr;
  gap: 12px;
  margin: 24px 0;
}

.icon-action {
  display: inline-grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 14px 42px rgba(98, 72, 132, 0.12);
  cursor: pointer;
}

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

.icon-action.wide {
  padding: 0 14px;
  font-weight: 760;
}

.product-band {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
}

.product-band div {
  display: grid;
  gap: 5px;
}

.product-band span {
  color: rgba(68, 58, 88, 0.62);
  font-size: 13px;
}

.product-band strong {
  color: rgba(47, 41, 66, 0.84);
  line-height: 1.4;
}

.product-band button {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
}

.status-line {
  min-height: 24px;
  color: rgba(82, 66, 108, 0.72);
}

.memory-layout {
  grid-template-columns: minmax(280px, 0.78fr) minmax(340px, 1.22fr);
}

.memory-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.memory-item {
  min-height: 220px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.54);
  box-shadow: 0 18px 52px rgba(91, 67, 122, 0.12);
}

.memory-item h3 {
  margin: 10px 0 6px;
}

.memory-item p {
  color: rgba(57, 50, 76, 0.7);
  line-height: 1.6;
}

.card-memory-item {
  display: grid;
  place-items: center;
}

.memory-card-preview.collectible-card {
  width: min(100%, 260px);
  height: 374px;
  border-radius: var(--radius);
  box-shadow: 0 18px 52px rgba(91, 67, 122, 0.14);
  transform: none;
}

.memory-card-preview .card-copy.is-final {
  top: 24px;
  right: 20px;
  left: 20px;
}

.memory-card-preview .card-copy.is-final strong {
  font-size: 20px;
}

.memory-card-preview .card-copy.is-final p,
.memory-card-preview .card-details p {
  font-size: 11px;
}

.memory-card-preview .card-details {
  right: 16px;
  bottom: 42px;
  left: 16px;
  padding: 10px;
}

.empty-state {
  min-height: 260px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
  color: rgba(68, 58, 88, 0.72);
}

.mobile-nav {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 40;
  display: none;
  width: min(420px, calc(100vw - 32px));
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 18px 52px rgba(90, 67, 120, 0.16);
  backdrop-filter: blur(18px);
  transform: translateX(-50%);
}

.mobile-nav button {
  display: grid;
  gap: 4px;
  place-items: center;
  min-height: 48px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: rgba(61, 52, 82, 0.68);
  cursor: pointer;
}

.mobile-nav button.is-active {
  background: rgba(255, 255, 255, 0.62);
  color: var(--focus);
}

.nav-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

@media (max-width: 900px) {
  .topnav {
    display: none;
  }

  .mobile-nav {
    display: grid;
  }

  .screen-home,
  .emotion-layout,
  .story-layout,
  .generator-layout,
  .result-layout,
  .memory-layout {
    grid-template-columns: 1fr;
  }

  .screen-home.active {
    align-content: start;
    gap: 18px;
  }

  .sphere-stage {
    min-height: 460px;
  }

  .emotion-sphere {
    width: min(92vw, 440px);
    height: min(92vw, 440px);
  }

  .sphere-rim {
    width: min(88vw, 410px);
  }

  h1 {
    font-size: 46px;
  }

  .lead {
    font-size: 16px;
  }

  .story-visual {
    min-height: 420px;
  }

  .live-card-wrap,
  .result-card-zone {
    min-height: 540px;
  }

  .action-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .icon-action.wide {
    grid-column: 1 / -1;
  }

  .product-band {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  html,
  body {
    min-height: 100dvh;
  }

  .topbar,
  .app-shell {
    width: min(100vw - 20px, 1180px);
  }

  .topbar {
    padding: 10px 0 6px;
    backdrop-filter: none;
  }

  .brand {
    min-height: 38px;
    padding: 0 12px;
  }

  .app-shell {
    min-height: auto;
    padding-top: 4px;
    padding-bottom: 96px;
  }

  .screen {
    min-height: auto;
  }

  .screen-home.active {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .sphere-stage {
    order: -1;
    min-height: 362px;
    margin: -4px 0 0;
    overflow: hidden;
  }

  .emotion-sphere {
    width: min(91vw, 356px);
    height: min(91vw, 356px);
  }

  .sphere-rim {
    width: min(84vw, 326px);
    box-shadow:
      inset 0 0 56px rgba(255, 255, 255, 0.36),
      inset 0 0 14px rgba(138, 107, 255, 0.14),
      0 30px 82px rgba(104, 77, 160, 0.14);
  }

  .home-copy {
    position: relative;
    z-index: 5;
    padding: 0 0 8px;
  }

  .eyebrow {
    margin-bottom: 9px;
    font-size: 12px;
  }

  h1 {
    max-width: 350px;
    margin-bottom: 12px;
    font-size: 32px;
    line-height: 1.12;
  }

  h2 {
    font-size: 28px;
    line-height: 1.14;
  }

  .lead {
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.65;
  }

  .lead.compact {
    font-size: 14px;
    line-height: 1.75;
  }

  .category-strip {
    flex-wrap: nowrap;
    gap: 8px;
    width: calc(100vw - 20px);
    margin-left: 0;
    padding: 2px 0 8px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .category-strip::-webkit-scrollbar,
  .card-rail::-webkit-scrollbar {
    display: none;
  }

  .category-pill {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 0 12px;
    font-size: 13px;
  }

  .emotion-word {
    min-height: 28px;
    padding: 4px 8px;
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.5);
    font-size: 12px;
  }

  .sphere-caption {
    right: auto;
    bottom: 10px;
    left: 50%;
    min-width: 152px;
    padding: 10px 12px;
    transform: translateX(-50%);
  }

  .sphere-caption span {
    font-size: 11px;
  }

  .sphere-caption strong {
    font-size: 18px;
  }

  .ghost-link {
    min-height: 34px;
    margin-bottom: 12px;
    padding: 0 12px;
    font-size: 13px;
  }

  .emotion-layout,
  .story-layout,
  .generator-layout,
  .result-layout,
  .memory-layout {
    gap: 16px;
  }

  .emotion-intro,
  .story-copy,
  .generator-form,
  .result-actions,
  .memory-head {
    padding: 18px;
  }

  .emotion-intro h2,
  .story-copy h2,
  .generator-form h2,
  .result-actions h2,
  .memory-head h2 {
    margin-bottom: 10px;
  }

  .rail-heading {
    margin-bottom: 10px;
    font-size: 14px;
  }

  .card-rail {
    grid-auto-columns: minmax(268px, 86vw);
    gap: 14px;
    width: calc(100vw - 10px);
    margin-left: -4px;
    padding: 6px 4px 18px;
    scroll-padding-left: 4px;
  }

  .metaphor-card {
    min-height: 408px;
  }

  .metaphor-copy {
    width: calc(100% - 22px);
    margin: 11px;
    padding: 12px;
  }

  .metaphor-card h3 {
    font-size: 22px;
  }

  .metaphor-card p {
    font-size: 12px;
  }

  .story-visual {
    min-height: 360px;
    aspect-ratio: 0.78;
  }

  .source-line {
    display: block;
    padding: 8px 11px;
    border-radius: var(--radius);
    line-height: 1.55;
  }

  .story-text {
    font-size: 15px;
    line-height: 1.85;
  }

  .generator-layout {
    display: flex;
    flex-direction: column;
  }

  .generator-form {
    order: 1;
    width: 100%;
    gap: 12px;
  }

  .live-card-wrap {
    order: 2;
    width: 100%;
  }

  .generator-form label {
    gap: 6px;
    font-size: 13px;
  }

  input {
    min-height: 40px;
  }

  textarea {
    min-height: 76px;
  }

  .collectible-card {
    width: min(324px, 88vw);
    height: 456px;
  }

  .collectible-card.final {
    width: min(326px, 88vw);
    height: 462px;
  }

  .live-card-wrap,
  .result-card-zone {
    min-height: 476px;
  }

  .card-copy.is-preview {
    top: 22px;
    right: 18px;
    bottom: auto;
    left: 18px;
    padding: 10px 12px;
  }

  .card-copy.is-preview strong {
    font-size: 15px;
  }

  .card-copy.is-final {
    top: 34px;
    right: 28px;
    left: 28px;
  }

  .card-copy.is-final strong {
    font-size: 24px;
  }

  .card-copy.is-final p {
    max-width: 270px;
    font-size: 12px;
  }

  .card-details {
    right: 18px;
    bottom: 46px;
    left: 18px;
    padding: 10px 12px;
  }

  .card-details p {
    font-size: 12px;
  }

  .card-details div {
    font-size: 11px;
  }

  .card-mark {
    bottom: 18px;
  }

  .action-grid {
    gap: 9px;
    margin: 18px 0;
  }

  .icon-action {
    min-height: 48px;
  }

  .product-band {
    padding: 14px;
  }

  .mobile-nav {
    bottom: 10px;
    width: min(360px, calc(100vw - 20px));
    padding: 7px;
  }

  .mobile-nav button {
    min-height: 44px;
    font-size: 13px;
  }

  body[data-route="emotion"] .mobile-nav,
  body[data-route="story"] .mobile-nav,
  body[data-route="generator"] .mobile-nav,
  body[data-route="result"] .mobile-nav {
    display: none;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 29px;
  }

  h2 {
    font-size: 25px;
  }

  .sphere-stage {
    min-height: 336px;
  }

  .emotion-sphere {
    width: min(90vw, 326px);
    height: min(90vw, 326px);
  }

  .sphere-rim {
    width: min(82vw, 300px);
  }

  .card-rail {
    grid-auto-columns: minmax(250px, 86vw);
  }

  .collectible-card,
  .collectible-card.final {
    width: min(304px, 88vw);
    height: 430px;
  }

  .live-card-wrap,
  .result-card-zone {
    min-height: 444px;
  }
}

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