:root {
  --bg: #f4efe4;
  --surface: #fffdf8;
  --surface-soft: #ece5d8;
  --ink: #201d19;
  --muted: #716a61;
  --line: #d7cdbf;
  --accent: #f0543b;
  --accent-dark: #c93b29;
  --accent-soft: #ffe1d8;
  --green: #1f6b56;
  --green-dark: #15503f;
  --green-soft: #dceddf;
  --yellow: #ffd84d;
  --blue: #3156d9;
  --radius-large: 28px;
  --radius-card: 24px;
  --radius-control: 16px;
  --shadow-pop: 7px 7px 0 rgba(32, 29, 25, 0.92);
  --shadow-soft: 0 18px 50px rgba(53, 43, 32, 0.14);
  --motion-fast: 170ms;
  --motion-card: 190ms;
  color: var(--ink);
  background: var(--bg);
  font-family: ui-rounded, "SF Pro Rounded", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }

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

body {
  min-width: 320px;
  min-height: 100svh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
}

button, textarea { font: inherit; }
button { color: inherit; }
button:disabled { cursor: not-allowed; opacity: 0.45; }
button:focus-visible, textarea:focus-visible, article:focus-visible, h1:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}
a { color: inherit; }
h1, h2, h3, p, figure { margin-top: 0; }

.app-header {
  width: min(1120px, calc(100% - 40px));
  min-height: 64px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.wordmark {
  appearance: none;
  border: 0;
  padding: 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.wordmark-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  transform: rotate(-3deg);
}

.wordmark-copy { display: grid; gap: 1px; }
.wordmark-copy strong { font-size: 15px; font-weight: 950; letter-spacing: -0.04em; }
.wordmark-copy small { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: 0.04em; }

.exit-button {
  min-width: 72px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 850;
}
.exit-button span:first-child { color: var(--ink); font-size: 18px; line-height: 1; }
.exit-button:hover { border-color: var(--ink); color: var(--ink); }

.page {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

/* Intro: one promise, one action, one playful preview. */
.page-intro { padding: 8px 0 28px; }

.intro-app {
  min-height: calc(100svh - 100px);
  display: grid;
  grid-template-columns: minmax(0, 0.88fr) minmax(430px, 1.12fr);
  align-items: center;
  gap: clamp(44px, 8vw, 104px);
}

.intro-copy { max-width: 520px; }

.intro-kicker, .result-overline, .share-eyebrow {
  margin-bottom: 14px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.06em;
}

.intro-copy h1, .result-heading h1 {
  margin-bottom: 20px;
  font-size: clamp(48px, 6vw, 78px);
  font-weight: 950;
  line-height: 1.02;
  letter-spacing: -0.075em;
}

.intro-copy h1 span, .result-heading h1 span { color: var(--accent); }

.intro-lede {
  max-width: 470px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.primary-button, .secondary-button, .text-button, .choice-button, .undo-button {
  cursor: pointer;
  transition: transform var(--motion-fast) ease, background var(--motion-fast) ease, border-color var(--motion-fast) ease, box-shadow var(--motion-fast) ease;
}

.primary-button {
  min-height: 58px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-control);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  color: #fff;
  background: var(--accent);
  box-shadow: 5px 5px 0 var(--ink);
  font-weight: 900;
}

.primary-button > span:first-child { display: grid; gap: 2px; text-align: left; }
.primary-button strong { font-size: 16px; font-weight: 950; }
.primary-button small { color: rgba(255, 255, 255, 0.82); font-size: 10px; font-weight: 750; }
.primary-button:hover { background: var(--accent-dark); transform: translate(2px, 2px); box-shadow: 3px 3px 0 var(--ink); }
.primary-button:active { transform: translate(5px, 5px); box-shadow: none; }
.primary-button--hero { width: min(100%, 470px); min-height: 68px; padding: 13px 18px; }
.primary-button--hero strong { font-size: 18px; }
.button-arrow { font-size: 28px; font-weight: 650; line-height: 1; }

.swipe-legend {
  width: min(100%, 470px);
  margin-top: 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.swipe-legend > span { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.swipe-legend b {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: var(--surface);
  font-size: 14px;
}
.swipe-legend > span:last-child b { border-color: var(--green); color: #fff; background: var(--green); }
.swipe-legend strong { color: var(--ink); font-weight: 900; }
.swipe-legend i { font-size: 10px; font-style: normal; text-align: center; }

.intro-preview {
  min-width: 0;
  min-height: 520px;
  position: relative;
  display: grid;
  place-items: center;
}

.food-fan { width: min(100%, 520px); height: 390px; position: relative; }
.fan-card {
  width: 250px;
  height: 320px;
  overflow: hidden;
  position: absolute;
  top: 16px;
  left: 50%;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.fan-card img { width: 100%; height: 100%; display: block; object-fit: cover; }
.fan-card figcaption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--surface);
  background: rgba(32, 29, 25, 0.86);
  font-size: 13px;
  font-weight: 900;
}
.fan-card--1 { z-index: 1; transform: translateX(-94%) rotate(-10deg); }
.fan-card--2 { z-index: 3; transform: translateX(-50%) rotate(2deg); }
.fan-card--3 { z-index: 2; transform: translateX(-6%) rotate(10deg); }

.result-teaser {
  z-index: 5;
  width: min(360px, 88%);
  position: absolute;
  right: 2%;
  bottom: 8px;
  padding: 18px 20px;
  border: 2px solid var(--ink);
  border-radius: 18px 18px 6px 18px;
  color: #fff;
  background: var(--green);
  box-shadow: 5px 5px 0 var(--ink);
  transform: rotate(-2deg);
}
.result-teaser__label { display: block; margin-bottom: 7px; color: #d6efe6; font-size: 10px; font-weight: 900; letter-spacing: 0.06em; }
.result-teaser__identity { display: flex; align-items: baseline; gap: 10px; }
.result-teaser__identity strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 29px; letter-spacing: 0.08em; }
.result-teaser__identity span { font-size: 15px; font-weight: 950; }
.result-teaser p { margin: 7px 0 4px; font-size: 11px; font-weight: 800; }
.result-teaser small { color: #d6efe6; font-size: 9px; }

.intro-footnote {
  grid-column: 1 / -1;
  margin: -12px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

/* Quiz: a focused app screen, not a content page. */
.app-header--deck { width: min(560px, calc(100% - 32px)); }

.game-screen {
  width: min(520px, calc(100% - 32px));
  min-height: calc(100svh - 64px);
  margin: 0 auto;
  padding: 8px 0 calc(26px + env(safe-area-inset-bottom));
}

.game-progress { margin-bottom: 12px; }
.game-progress__copy { display: flex; align-items: baseline; gap: 4px; margin-bottom: 7px; font-variant-numeric: tabular-nums; }
.game-progress__copy strong { color: var(--accent); font-size: 23px; line-height: 1; }
.game-progress__copy span { color: var(--muted); font-size: 11px; }
.game-progress__copy small { margin-left: auto; color: var(--muted); font-size: 10px; font-weight: 750; }
.progress-track { height: 7px; overflow: hidden; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-soft); }
.progress-track span { height: 100%; display: block; border-radius: inherit; background: var(--accent); transition: width var(--motion-fast) ease; }

.deck-stage { min-width: 0; }
.game-prompt { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.game-prompt h1 { margin: 0; font-size: 22px; font-weight: 950; letter-spacing: -0.04em; }
.game-prompt p { margin: 0; color: var(--muted); font-size: 11px; }

.card-stack {
  width: 100%;
  height: clamp(410px, 58svh, 560px);
  position: relative;
}

.card-shadow, .food-card { position: absolute; inset: 0; border: 2px solid var(--ink); border-radius: var(--radius-card); }
.card-shadow--one { background: var(--yellow); transform: translate(7px, 8px) rotate(1deg); }
.card-shadow--two { background: var(--green-soft); transform: translate(3px, 4px) rotate(-0.5deg); }

.food-card {
  z-index: 2;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  transform-origin: 50% 88%;
  transition: transform var(--motion-card) ease, opacity var(--motion-card) ease;
}
.food-card.is-dragging { transition: none; cursor: grabbing; }
.food-card.is-exiting-right { transform: translate(130%, -5%) rotate(12deg); opacity: 0; }
.food-card.is-exiting-left { transform: translate(-130%, -5%) rotate(-12deg); opacity: 0; }
.food-card.is-exiting-avoid { transform: translateY(16%) scale(0.94); opacity: 0; }

.food-card__media { min-height: 0; position: relative; flex: 1 1 auto; overflow: hidden; background: var(--surface-soft); }
.food-card__photo, .result-atlas__photo > img { width: 100%; height: 100%; display: block; object-fit: cover; }
.food-card__photo { object-position: center; transition: opacity var(--motion-fast) ease; }
.food-card__media.is-loading, .result-atlas__photo.is-loading { background: var(--surface-soft); }
.food-card__media.is-loading::after, .result-atlas__photo.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(105deg, transparent 30%, rgba(255, 253, 248, 0.72) 48%, transparent 66%);
  transform: translateX(-100%);
  animation: image-shimmer 1.15s ease-in-out infinite;
  pointer-events: none;
}
.food-card__media.is-loading .food-card__photo, .result-atlas__photo.is-loading > img { opacity: 0; }
.food-card__media.is-image-error .food-card__photo, .result-atlas__photo.is-image-error > img { display: none; }

.food-photo-top {
  position: absolute;
  top: 13px;
  right: 14px;
  left: 14px;
  display: flex;
  justify-content: space-between;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

.photo-fallback {
  position: absolute;
  inset: 0;
  padding: 26px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: center;
}
.photo-fallback[hidden] { display: none; }
.photo-fallback span, .photo-fallback small { color: var(--muted); font-size: 11px; }
.photo-fallback strong { font-size: 30px; font-weight: 950; }

@keyframes image-shimmer { to { transform: translateX(100%); } }

.swipe-stamp {
  position: absolute;
  top: 18%;
  padding: 9px 13px;
  border: 3px solid currentColor;
  border-radius: 12px;
  opacity: 0;
  color: #fff;
  font-size: 17px;
  font-weight: 950;
  transition: opacity 80ms linear;
}
.swipe-stamp--like { right: 18px; background: var(--green); transform: rotate(10deg); }
.swipe-stamp--dislike { left: 18px; background: var(--accent); transform: rotate(-10deg); }

.food-card__sheet { flex: 0 0 auto; padding: 15px 18px 16px; background: var(--surface); }
.food-card__meta { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 7px; color: var(--muted); font-size: 9px; font-weight: 800; }
.food-card__meta a, .result-atlas__footer a { text-decoration: underline; text-underline-offset: 3px; }
.food-card__meta a:hover, .result-atlas__footer a:hover { color: var(--accent-dark); }
.food-card h2 { margin-bottom: 4px; font-size: clamp(29px, 5vw, 38px); font-weight: 950; line-height: 1.06; letter-spacing: -0.06em; }
.food-card p { max-width: 40em; margin-bottom: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-row span { padding: 3px 7px; border-radius: 999px; color: var(--green-dark); background: var(--green-soft); font-size: 9px; font-weight: 850; }

.choice-controls { margin-top: 14px; display: grid; grid-template-columns: 1fr 1.2fr; gap: 10px; }
.choice-button {
  min-height: 64px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  box-shadow: 4px 4px 0 var(--ink);
}
.choice-button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.choice-button:active { transform: translate(4px, 4px); box-shadow: none; }
.choice-button:disabled:hover, .choice-button:disabled:active { transform: none; box-shadow: 4px 4px 0 var(--ink); }
.choice-button--yes { color: #fff; background: var(--green); }
.choice-button--yes:hover { background: var(--green-dark); }
.choice-button__icon { min-width: 30px; font-size: 27px; font-weight: 700; line-height: 1; }
.choice-button__copy { display: grid; gap: 1px; text-align: left; }
.choice-button--yes .choice-button__copy { text-align: right; }
.choice-button__copy strong { font-size: 15px; font-weight: 950; }
.choice-button__copy small { color: var(--muted); font-size: 9px; font-weight: 700; }
.choice-button--yes .choice-button__copy small { color: rgba(255, 255, 255, 0.77); }

.game-footer { min-height: 36px; margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.undo-button { min-height: 36px; border: 0; padding: 6px 2px; color: var(--muted); background: transparent; font-size: 11px; font-weight: 850; }
.undo-button:not(:disabled):hover { color: var(--ink); }
.card-helper { margin: 0; color: var(--muted); font-size: 10px; text-align: right; }
.refusal-trigger {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent-dark);
  background: rgba(255, 253, 248, 0.88);
}
.refusal-trigger > span:first-child { font-size: 18px; line-height: 1; }
.refusal-trigger > span:last-child { display: grid; gap: 1px; text-align: left; }
.refusal-trigger strong { font-size: 11px; line-height: 1.1; }
.refusal-trigger small { color: var(--muted); font-size: 8px; line-height: 1.2; }
.refusal-trigger:hover { border-color: var(--accent-dark); background: var(--accent-soft); }

.refusal-backdrop {
  position: fixed;
  z-index: 50;
  inset: 0;
  padding: 18px;
  display: grid;
  place-items: end center;
  background: rgba(32, 29, 25, 0.48);
  backdrop-filter: blur(3px);
}
.refusal-dialog {
  position: relative;
  width: min(500px, 100%);
  max-height: min(650px, calc(100svh - 36px));
  overflow-y: auto;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
}
.dialog-close { position: absolute; top: 14px; right: 14px; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); font-size: 24px; line-height: 1; }
.dialog-eyebrow { margin-bottom: 8px; color: var(--accent-dark); font-size: 10px; font-weight: 950; letter-spacing: 0.07em; }
.refusal-dialog h2 { max-width: calc(100% - 54px); margin-bottom: 8px; font-size: 28px; font-weight: 950; letter-spacing: -0.05em; }
.refusal-dialog > p:not(.dialog-eyebrow, .refusal-trust) { margin-bottom: 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.refusal-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.refusal-option { min-height: 52px; border: 1px solid var(--line); border-radius: 14px; padding: 9px 12px; display: flex; align-items: center; gap: 9px; background: var(--surface); text-align: left; }
.refusal-option > span { width: 25px; height: 25px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-weight: 950; }
.refusal-option strong { font-size: 13px; }
.refusal-option.is-selected { border-color: var(--accent-dark); color: var(--accent-dark); background: var(--accent-soft); }
.refusal-option.is-selected > span { border-color: var(--accent-dark); color: #fff; background: var(--accent-dark); }
.refusal-trust { margin: 14px 0 0; padding: 10px 12px; border-radius: 11px; color: #5f5547; background: var(--surface-soft); font-size: 10px; line-height: 1.5; }
.dialog-actions { margin-top: 16px; display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 9px; }
.dialog-secondary, .dialog-primary { min-height: 50px; border: 2px solid var(--ink); border-radius: 14px; padding: 10px 14px; font-size: 13px; font-weight: 950; }
.dialog-secondary { background: var(--surface); }
.dialog-primary { color: #fff; background: var(--green); box-shadow: 3px 3px 0 var(--ink); }
.dialog-primary:not(:disabled):hover { background: var(--green-dark); transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }

.notice {
  max-width: 520px;
  margin: 14px auto 0;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: left;
}
.notice[hidden] { display: none; }
.notice > span { width: 23px; height: 23px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; font-weight: 950; }
.notice p { margin: 0; font-size: 11px; line-height: 1.45; }
.notice--error { border-color: var(--accent); background: var(--accent-soft); }
.notice--error > span { background: var(--accent); }

/* Result: personality first, evidence second. */
.page-result { padding: 34px 0 80px; }
.result-heading { margin-bottom: 24px; }
.result-heading h1 { margin: 0; font-size: clamp(42px, 6vw, 68px); }
.result-heading h1:focus { outline: none; }
.result-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); align-items: start; gap: clamp(24px, 5vw, 56px); }
.result-main { min-width: 0; display: grid; gap: 28px; }

.result-atlas {
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow-pop);
}
.result-atlas__top, .result-atlas__footer { padding: 13px 18px; display: flex; justify-content: space-between; gap: 14px; color: var(--muted); font-size: 9px; font-weight: 850; }
.result-atlas__top { border-bottom: 1px dashed var(--line); }
.result-atlas__footer { border-top: 1px dashed var(--line); }
.result-atlas__hero { display: grid; grid-template-columns: minmax(0, 1.02fr) minmax(300px, 0.98fr); align-items: stretch; }
.result-atlas__identity { padding: clamp(24px, 4vw, 42px); }
.result-atlas__photo { min-height: 340px; position: relative; overflow: hidden; border-left: 1px solid var(--line); background: var(--surface-soft); }
.result-atlas__photo--empty { display: grid; place-items: center; padding: 32px; background: repeating-linear-gradient(-45deg, #f0e8d9 0 18px, #f8f2e7 18px 36px); }
.result-atlas__photo--empty > div { width: min(100%, 280px); padding: 28px; border: 2px solid var(--ink); border-radius: 24px; background: rgba(255, 250, 240, 0.92); box-shadow: 8px 8px 0 var(--ink); }
.result-atlas__photo--empty span, .result-atlas__photo--empty small { display: block; color: var(--muted); }
.result-atlas__photo--empty strong { display: block; margin: 8px 0; font-size: clamp(1.55rem, 4vw, 2.2rem); line-height: 1.05; }
.result-photo-label { position: absolute; right: 12px; bottom: 12px; left: 12px; padding: 8px 10px; border-radius: 9px; color: #fff; background: rgba(32, 29, 25, 0.84); font-size: 9px; font-weight: 850; }

.result-badge { width: fit-content; margin-bottom: 18px; padding: 8px 11px; display: flex; align-items: baseline; gap: 8px; border-radius: 9px 3px 9px 3px; color: #fff; background: var(--accent); box-shadow: 3px 3px 0 var(--ink); transform: rotate(-2deg); }
.result-badge span, .result-badge small { font-size: 9px; font-weight: 850; }
.result-badge strong { font-size: 14px; font-weight: 950; }
.result-kicker { margin-bottom: 7px; color: var(--green-dark); font-size: 10px; font-weight: 900; }
.personality-code { margin: 0 0 8px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: clamp(52px, 7vw, 78px); font-weight: 950; line-height: 0.96; letter-spacing: 0.035em; }
.result-faction-label { width: fit-content; margin: 0 0 9px; display: flex; align-items: center; gap: 7px; color: var(--accent-dark); font-size: 10px; font-weight: 950; }
.result-faction-label strong { padding: 4px 7px; border: 1px solid currentColor; border-radius: 999px; background: var(--accent-soft); }
.result-faction-label span { color: var(--muted); font-size: 9px; }
.result-atlas__identity h2 { margin-bottom: 12px; color: var(--accent-dark); font-size: clamp(30px, 4vw, 43px); font-weight: 950; line-height: 1.06; letter-spacing: -0.06em; }
.result-judgement { margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.result-signature { margin: 15px 0 0; padding-top: 11px; border-top: 1px solid var(--line); color: var(--ink); font-size: 11px; font-weight: 850; }

.ability-panel {
  min-width: 0;
  min-height: 430px;
  padding: 24px 22px 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 2px solid var(--ink);
  background: var(--yellow);
  background-image: repeating-linear-gradient(145deg, transparent 0 23px, rgba(32, 29, 25, 0.035) 23px 25px);
}
.ability-panel__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.ability-panel__heading span { color: var(--accent-dark); font-size: 10px; font-weight: 950; letter-spacing: 0.08em; }
.ability-panel__heading strong { font-size: 14px; font-weight: 950; }
.ability-panel__note { margin: -4px 0 0; color: #5f5547; font-size: 9px; font-weight: 750; text-align: center; }

.personality-axis-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 2px solid var(--ink); border-bottom: 1px solid var(--line); }
.personality-axis { min-width: 0; padding: 14px 15px; display: flex; align-items: center; gap: 10px; border-right: 1px solid var(--line); background: #fff9ea; }
.personality-axis:last-child { border-right: 0; }
.personality-axis__code { min-width: 30px; color: var(--accent); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 28px; font-weight: 950; line-height: 1; }
.personality-axis__copy { min-width: 0; display: grid; gap: 2px; }
.personality-axis__copy strong { font-size: 11px; line-height: 1.25; }
.personality-axis__copy small { color: var(--muted); font-size: 8px; line-height: 1.3; }

.personality-snapshot { display: grid; grid-template-columns: 1.15fr 1.15fr 0.7fr; background: var(--surface); }
.personality-snapshot section { min-width: 0; padding: 16px 17px 18px; display: grid; align-content: start; gap: 6px; border-right: 1px solid var(--line); }
.personality-snapshot section:last-child { border-right: 0; background: var(--green-soft); }
.personality-snapshot span { color: var(--accent-dark); font-size: 9px; font-weight: 950; letter-spacing: 0.06em; }
.personality-snapshot strong { font-size: 11px; line-height: 1.5; }
.personality-snapshot small { color: #45695e; font-size: 8px; line-height: 1.45; }

.dining-guide-strip {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  border-top: 1px dashed var(--line);
  background: #fff8df;
}
.guide-column { min-width: 0; padding: 16px 17px 18px; border-right: 1px solid var(--line); }
.guide-column:last-child { border-right: 0; }
.guide-column > span { display: block; margin-bottom: 9px; color: var(--accent-dark); font-size: 9px; font-weight: 950; letter-spacing: 0.08em; }
.guide-column ol { margin: 0; padding: 0; display: grid; gap: 9px; list-style: none; }
.guide-column li { display: grid; gap: 2px; }
.guide-column li strong { font-size: 12px; line-height: 1.3; }
.guide-column li small { color: var(--muted); font-size: 8px; line-height: 1.45; }
.guide-column--restaurants { background: var(--green-soft); }
.guide-column--avoid { background: #fff1ec; }
.guide-column--caution { background: var(--accent-soft); }
.guide-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-tags span { padding: 5px 7px; border: 1px solid rgba(32, 29, 25, 0.15); border-radius: 999px; background: rgba(255, 255, 255, 0.72); font-size: 9px; font-weight: 850; line-height: 1.25; }
.guide-tags small { color: var(--muted); font-size: 9px; line-height: 1.45; }
.result-trust-note { margin: 0; padding: 10px 17px; border-top: 1px solid var(--line); color: #5f5547; background: var(--surface-soft); font-size: 9px; line-height: 1.5; }

.preference-signal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.preference-signal { min-width: 0; min-height: 76px; padding: 11px; display: grid; align-content: start; gap: 5px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.preference-signal strong { color: var(--green-dark); font-size: 11px; line-height: 1.35; }
.preference-signal span { color: var(--muted); font-size: 8px; line-height: 1.45; }

.result-actions {
  position: sticky;
  top: 18px;
  padding: 24px;
  border: 2px solid var(--ink);
  border-radius: 24px;
  background: var(--yellow);
  box-shadow: 5px 5px 0 var(--ink);
}
.share-eyebrow { margin-bottom: 8px; color: var(--ink); }
.result-actions h2 { margin-bottom: 10px; font-size: 25px; font-weight: 950; line-height: 1.18; letter-spacing: -0.045em; }
.share-intro { margin-bottom: 16px; color: #514b43; font-size: 12px; line-height: 1.55; }
.primary-button--share { width: 100%; min-height: 66px; }
.share-secondary-actions { margin-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.secondary-button { min-height: 46px; border: 1px solid var(--ink); border-radius: 12px; padding: 9px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; background: rgba(255, 253, 248, 0.8); font-size: 11px; font-weight: 900; }
.secondary-button:hover { color: #fff; background: var(--ink); transform: translateY(-1px); }
.secondary-button:active { transform: translateY(1px); }
.secondary-button:disabled { cursor: wait; opacity: 0.58; transform: none; }
.secondary-button:disabled:hover { color: inherit; background: rgba(255, 253, 248, 0.8); transform: none; }
.save-platform-note { margin: 10px 1px 0; color: #655f55; font-size: 9px; line-height: 1.55; }
.share-details { margin-top: 16px; border-top: 1px solid rgba(32, 29, 25, 0.2); padding-top: 12px; }
.share-details summary { cursor: pointer; color: #514b43; font-size: 10px; font-weight: 850; }
.share-copy-label { display: block; margin: 12px 0 6px; font-size: 10px; font-weight: 900; }
.share-copy { width: 100%; min-height: 150px; resize: vertical; padding: 10px; border: 1px solid var(--ink); border-radius: 10px; color: var(--ink); background: var(--surface); font-size: 10px; line-height: 1.55; }
.share-note { margin: 11px 0 0; color: #5a5248; font-size: 9px; line-height: 1.5; }
.result-actions .notice { margin-top: 13px; }

.save-preview-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  padding: 18px;
  display: grid;
  place-items: center;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgba(31, 29, 25, 0.76);
  backdrop-filter: blur(5px);
}

.save-preview-dialog {
  position: relative;
  width: min(430px, 100%);
  max-height: calc(100svh - 36px);
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-radius: 24px;
  padding: 22px;
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
  outline: none;
}

.save-preview-dialog h2 { max-width: calc(100% - 50px); margin: 0 0 7px; font-size: 25px; font-weight: 950; line-height: 1.15; letter-spacing: -0.045em; }
.save-preview-dialog > p:not(.dialog-eyebrow, .save-preview-help) { margin: 0 0 13px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.save-preview-frame { width: min(250px, 76%); margin: 13px auto; overflow: hidden; border: 2px solid var(--ink); border-radius: 15px; background: #fffaf0; box-shadow: 3px 3px 0 var(--ink); touch-action: manipulation; }
.save-preview-frame img { display: block; width: 100%; height: auto; max-height: 42svh; object-fit: contain; -webkit-touch-callout: default; user-select: auto; }
.save-preview-steps { margin: 15px 0 10px; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; counter-reset: save-step; }
.save-preview-steps li { min-height: 58px; padding: 9px 10px; display: grid; align-content: center; gap: 2px; border-radius: 12px; background: var(--surface-soft); counter-increment: save-step; }
.save-preview-steps li strong { font-size: 11px; line-height: 1.35; }
.save-preview-steps li strong::before { content: counter(save-step) ". "; color: var(--accent-dark); }
.save-preview-steps li span { color: var(--muted); font-size: 9px; line-height: 1.35; }
.save-preview-help { margin: 0 0 13px; color: #655f55; font-size: 9px; line-height: 1.5; }
.save-preview-done { width: 100%; }
.text-button { width: 100%; min-height: 44px; margin-top: 8px; border: 0; padding: 8px 0; color: #514b43; background: transparent; font-size: 10px; text-decoration: underline; text-underline-offset: 4px; }
.text-button:hover { color: var(--ink); }

.result-breakdown { overflow: hidden; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 253, 248, 0.68); }
.result-breakdown__heading { padding: 22px 24px 0; }
.result-breakdown__heading span { color: var(--accent-dark); font-size: 10px; font-weight: 900; }
.result-breakdown__heading h2 { margin: 5px 0 0; font-size: 27px; font-weight: 950; letter-spacing: -0.04em; }
.result-atlas__body { padding: 22px 24px 25px; display: grid; grid-template-columns: minmax(230px, 0.85fr) minmax(270px, 1.15fr); gap: 30px; }
.subheading-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.subheading-row h3 { margin: 0; font-size: 13px; }
.subheading-row span { color: var(--muted); font-size: 9px; }
.radar-wrap { width: min(100%, 300px); margin: 0 auto; }
.radar-chart { width: 100%; height: auto; display: block; overflow: visible; }
.radar-grid polygon { fill: none; stroke: var(--line); stroke-width: 1; }
.ability-panel .radar-grid polygon { stroke: rgba(32, 29, 25, 0.28); }
.radar-spokes line { stroke: rgba(32, 29, 25, 0.3); stroke-width: 1; }
.radar-data { fill: rgba(240, 84, 59, 0.38); stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.radar-points circle { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.radar-labels { fill: var(--ink); font-size: 12px; font-weight: 950; }
.radar-labels tspan { fill: var(--accent-dark); font-size: 10px; }
.radar-values { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px 10px; list-style: none; }
.radar-values li { display: flex; justify-content: space-between; gap: 5px; border-top: 1px solid var(--line); padding-top: 5px; font-size: 9px; }
.radar-values li span { color: var(--muted); }
.radar-values li strong { color: var(--accent-dark); font-size: 11px; font-variant-numeric: tabular-nums; }
.result-food-summary { min-width: 0; }
.cuisine-list { display: grid; gap: 7px; margin-bottom: 19px; }
.cuisine-row { min-height: 28px; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); padding-bottom: 6px; font-size: 10px; }
.cuisine-row > span:first-child { font-weight: 850; }
.cuisine-row strong { color: var(--muted); font-size: 9px; font-variant-numeric: tabular-nums; }
.cuisine-dots { display: inline-flex; gap: 3px; }
.cuisine-dots i { width: 6px; height: 6px; display: block; border: 1px solid var(--line); border-radius: 50%; }
.cuisine-dots i.is-on { border-color: var(--green); background: var(--green); }
.occasion-summary { margin: -5px 0 18px; padding: 11px 12px; display: grid; gap: 3px; border-radius: 11px; color: var(--green-dark); background: var(--green-soft); }
.occasion-summary strong { font-size: 9px; }
.occasion-summary span { font-size: 12px; font-weight: 900; }
.occasion-summary small { color: #45695e; font-size: 9px; line-height: 1.45; }
.liked-summary__heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.liked-summary__heading strong { font-size: 11px; }
.liked-summary__heading span { color: var(--muted); font-size: 9px; }
.liked-food-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.liked-food { min-height: 92px; overflow: hidden; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); }
.liked-food img { width: 100%; height: 64px; display: block; object-fit: cover; }
.liked-food strong { min-height: 28px; padding: 5px 3px; display: grid; place-items: center; font-size: 9px; text-align: center; }
.empty-liked { grid-column: 1 / -1; margin: 0; padding: 13px; color: var(--muted); background: var(--surface-soft); font-size: 11px; line-height: 1.55; }

.noscript-message { width: min(560px, calc(100% - 32px)); margin: 60px auto; padding: 24px; border: 2px solid var(--ink); border-radius: 20px; background: var(--surface); }

@media (max-width: 900px) {
  .intro-app { grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr); gap: 34px; }
  .intro-copy h1 { font-size: clamp(45px, 7vw, 62px); }
  .food-fan { transform: scale(0.9); }
  .result-layout { grid-template-columns: 1fr 290px; gap: 22px; }
  .result-atlas__hero { grid-template-columns: 1fr; }
  .ability-panel { min-height: 390px; border-top: 2px solid var(--ink); border-left: 0; }
  .personality-axis-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .personality-axis:nth-child(2) { border-right: 0; }
  .personality-axis:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
  .result-atlas__body { grid-template-columns: 1fr; }
}

@media (max-width: 820px) {
  .app-header { width: min(100% - 28px, 560px); min-height: 58px; }
  .wordmark-mark { width: 32px; height: 32px; border-radius: 10px; }
  .wordmark-copy strong { font-size: 14px; }
  .exit-button { min-width: 62px; min-height: 44px; font-size: 10px; }

  .page { width: min(100% - 28px, 560px); }
  .page-intro { padding: 8px 0 18px; }
  .intro-app { min-height: 0; display: flex; flex-direction: column; align-items: stretch; gap: 20px; }
  .intro-copy { max-width: none; }
  .intro-kicker { margin-bottom: 10px; font-size: 10px; }
  .intro-copy h1 { margin-bottom: 13px; font-size: clamp(42px, 13vw, 57px); line-height: 1.03; }
  .intro-lede { margin-bottom: 17px; font-size: 15px; line-height: 1.55; }
  .primary-button--hero { width: 100%; min-height: 64px; }
  .primary-button--hero strong { font-size: 17px; }
  .swipe-legend { width: 100%; margin-top: 14px; }
  .swipe-legend i { font-size: 9px; }
  .intro-preview { min-height: 275px; }
  .food-fan { width: 100%; height: 255px; transform: none; }
  .fan-card { width: 150px; height: 205px; top: 10px; border-radius: 17px; box-shadow: 4px 4px 0 var(--ink); }
  .fan-card figcaption { right: 7px; bottom: 7px; left: 7px; padding: 6px 7px; font-size: 10px; }
  .fan-card--1 { transform: translateX(-96%) rotate(-10deg); }
  .fan-card--2 { transform: translateX(-50%) rotate(2deg); }
  .fan-card--3 { transform: translateX(-4%) rotate(10deg); }
  .result-teaser { width: min(300px, 90%); right: 0; bottom: 0; padding: 13px 15px; border-radius: 15px 15px 5px 15px; }
  .result-teaser__identity strong { font-size: 24px; }
  .result-teaser__identity span { font-size: 13px; }
  .result-teaser p { font-size: 9px; }
  .intro-footnote { order: 3; margin: -3px 0 0; font-size: 9px; line-height: 1.5; }

  .app-header--deck { width: min(100% - 28px, 520px); }
  .game-screen { width: min(100% - 28px, 520px); min-height: calc(100svh - 58px); padding-top: 5px; }
  .game-progress { margin-bottom: 9px; }
  .game-progress__copy { margin-bottom: 5px; }
  .game-progress__copy strong { font-size: 20px; }
  .game-prompt { margin-bottom: 8px; }
  .game-prompt h1 { font-size: 20px; }
  .card-stack { height: clamp(335px, 51svh, 455px); }
  .food-card__sheet { padding: 13px 14px 14px; }
  .food-card h2 { font-size: 28px; }
  .food-card p { margin-bottom: 7px; font-size: 11px; line-height: 1.45; }
  .food-photo-top { top: 10px; right: 11px; left: 11px; font-size: 9px; }
  .choice-controls { margin-top: 11px; gap: 8px; }
  .choice-button { min-height: 60px; padding: 8px 11px; border-radius: 16px; box-shadow: 3px 3px 0 var(--ink); }
  .choice-button:disabled:hover, .choice-button:disabled:active { box-shadow: 3px 3px 0 var(--ink); }
  .choice-button__icon { min-width: 25px; font-size: 23px; }
  .choice-button__copy strong { font-size: 14px; }
  .choice-button__copy small { font-size: 8px; }
  .game-footer { margin-top: 8px; }
  .card-helper { font-size: 9px; }

  .page-result { padding: 24px 0 56px; }
  .result-heading { margin-bottom: 17px; }
  .result-overline { margin-bottom: 8px; font-size: 10px; }
  .result-heading h1 { font-size: clamp(40px, 12vw, 54px); }
  .result-layout { display: flex; flex-direction: column; gap: 21px; }
  .result-main { display: contents; }
  .result-atlas { order: 1; width: 100%; border-radius: 23px; box-shadow: 5px 5px 0 var(--ink); }
  .result-actions { order: 2; width: 100%; position: static; padding: 21px; border-radius: 21px; box-shadow: 4px 4px 0 var(--ink); }
  .result-breakdown { order: 3; width: 100%; }
  .result-atlas__hero { grid-template-columns: 1fr; }
  .result-atlas__identity { padding: 23px 19px; }
  .personality-code { font-size: clamp(50px, 16vw, 68px); }
  .result-atlas__identity h2 { font-size: clamp(29px, 8.5vw, 38px); }
  .result-judgement { font-size: 13px; line-height: 1.6; }
  .ability-panel { min-height: 345px; padding: 18px 15px 12px; border-top: 2px solid var(--ink); border-left: 0; }
  .radar-wrap { width: min(100%, 285px); }
  .result-atlas__top, .result-atlas__footer { padding: 11px 13px; font-size: 8px; }
  .personality-axis { padding: 12px 13px; }
  .personality-snapshot { grid-template-columns: 1fr; }
  .personality-snapshot section { border-right: 0; border-bottom: 1px solid var(--line); }
  .personality-snapshot section:last-child { border-bottom: 0; }
  .dining-guide-strip { grid-template-columns: 1fr; }
  .guide-column { border-right: 0; border-bottom: 1px solid var(--line); }
  .guide-column:last-child { border-bottom: 0; }
  .result-actions h2 { font-size: 23px; }
  .result-breakdown__heading { padding: 20px 18px 0; }
  .result-breakdown__heading h2 { font-size: 24px; }
  .result-atlas__body { padding: 19px 16px 22px; grid-template-columns: 1fr; gap: 24px; }
  .liked-food-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .wordmark-copy small { display: none; }
  .intro-copy h1 { font-size: 42px; }
  .intro-lede { font-size: 14px; }
  .swipe-legend i { max-width: 74px; line-height: 1.25; }
  .fan-card { width: 136px; height: 190px; }
  .result-teaser { width: 94%; }
  .card-stack { height: 330px; }
  .food-card p { max-height: 34px; overflow: hidden; }
  .tag-row { display: none; }
  .choice-controls { grid-template-columns: 0.9fr 1.1fr; }
  .choice-button { padding-inline: 9px; }
  .choice-button__copy small { display: none; }
  .personality-axis { gap: 7px; padding-inline: 10px; }
  .personality-axis__code { min-width: 25px; font-size: 24px; }
  .ability-panel { min-height: 320px; padding-inline: 9px; }
  .preference-signal-grid { grid-template-columns: 1fr; }
  .save-preview-backdrop { padding: 8px; place-items: start center; }
  .save-preview-dialog { max-height: calc(100svh - 16px); padding: 16px; border-radius: 18px; box-shadow: 4px 4px 0 var(--ink); }
  .save-preview-dialog .dialog-close { top: 9px; right: 9px; width: 40px; height: 40px; }
  .save-preview-dialog h2 { font-size: 21px; }
  .save-preview-frame { width: min(190px, 68%); margin-block: 9px; }
  .save-preview-frame img { max-height: 35svh; }
  .save-preview-steps { margin-block: 10px 8px; }
  .save-preview-steps li { min-height: 50px; padding: 7px 8px; }
  .save-preview-help { margin-bottom: 9px; }
  .save-preview-done { min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .food-card.is-exiting-right, .food-card.is-exiting-left, .food-card.is-exiting-avoid { transform: translateY(-18px); }
}
