:root {
  --ink: #19251f;
  --muted: #68746d;
  --paper: #f7f4ed;
  --white: #fffefa;
  --line: #d9ded7;
  --tomato: #d9472f;
  --tomato-dark: #b93220;
  --herb: #246747;
  --mustard: #e1ae35;
  --blush: #f4ddd5;
  --shadow: 0 18px 48px rgba(20, 35, 27, 0.12);
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  background: var(--paper);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
}

button,
input {
  font: inherit;
}

button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(217, 71, 47, 0.26);
  outline-offset: 3px;
}

.app-shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(360px, 0.84fr) minmax(520px, 1.16fr);
}

.visual-panel {
  position: sticky;
  top: 0;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px 38px;
  color: #fff;
  background-image: none;
  background-size: cover;
  background-position: 52% center;
}

.visual-shade {
  position: absolute;
  inset: 0;
  background: rgba(10, 24, 17, 0.48);
}

.visual-topline,
.visual-copy,
.photo-credit {
  position: relative;
  z-index: 1;
}

.visual-topline {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  color: var(--ink);
  background: var(--mustard);
  border-radius: 50%;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.3;
}

.visual-kicker {
  margin: 0 0 14px;
  color: var(--mustard);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.visual-quote {
  margin: 0;
  font-family: "STSong", "Songti SC", serif;
  font-size: 42px;
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: 0;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.2);
}

.cuisine-row {
  display: flex;
  gap: 9px;
  margin-top: 28px;
}

.cuisine-row span {
  width: 31px;
  height: 31px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.photo-credit {
  width: fit-content;
  color: rgba(255, 255, 255, 0.76);
  font-size: 10px;
  text-decoration: none;
}

.photo-credit:hover {
  color: #fff;
}

.app-main {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px clamp(36px, 6vw, 92px);
  background:
    linear-gradient(rgba(25, 37, 31, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 100% 38px;
}

.screen {
  width: min(100%, 680px);
  animation: screen-in 360ms ease both;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--tomato);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-family: "STSong", "Songti SC", serif;
  letter-spacing: 0;
}

.intro-title {
  max-width: 540px;
  margin: 0;
  font-size: 56px;
  line-height: 1.08;
}

.intro-subtitle {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.menu-rule {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 30px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.menu-rule::before,
.menu-rule::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.name-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.field-label input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  font-size: 16px;
  transition: border-color 180ms ease, box-shadow 180ms ease;
}

.field-label input:hover,
.field-label input:focus {
  border-color: var(--herb);
  box-shadow: 0 0 0 3px rgba(36, 103, 71, 0.1);
  outline: none;
}

.intro-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 20px;
}

.menu-count {
  color: var(--muted);
  font-size: 12px;
}

.primary-button,
.secondary-button,
.icon-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, opacity 160ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.icon-button:active {
  transform: translateY(0);
}

.primary-button {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  color: #fff;
  background: var(--tomato);
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(217, 71, 47, 0.2);
}

.primary-button:hover {
  background: var(--tomato-dark);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none;
  box-shadow: none;
}

.secondary-button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: var(--white);
  font-weight: 700;
}

.secondary-button:hover {
  border-color: var(--herb);
  color: var(--herb);
}

.primary-button svg,
.secondary-button svg,
.icon-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 2.2;
}

.question-header {
  margin-bottom: 30px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.progress-track {
  height: 5px;
  margin-top: 12px;
  overflow: hidden;
  background: #dfe3de;
  border-radius: 3px;
}

.progress-fill {
  height: 100%;
  background: var(--tomato);
  border-radius: inherit;
  transition: width 300ms ease;
}

.question-kicker {
  margin: 0 0 10px;
  color: var(--herb);
  font-size: 13px;
  font-weight: 800;
}

.question-title {
  min-height: 82px;
  margin: 0 0 24px;
  font-size: 30px;
  line-height: 1.42;
}

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

.option-button {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 32px 1fr;
  align-items: center;
  gap: 13px;
  padding: 11px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: rgba(255, 254, 250, 0.82);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.option-button:hover {
  border-color: #94a59b;
  transform: translateX(2px);
}

.option-button.selected {
  border-color: var(--tomato);
  background: #fff5f1;
  box-shadow: inset 4px 0 0 var(--tomato);
}

.option-key {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.option-button.selected .option-key {
  border-color: var(--tomato);
  color: #fff;
  background: var(--tomato);
}

.option-text {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.question-nav {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
}

.back-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  padding: 10px 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.back-button:hover {
  color: var(--ink);
}

.back-button svg {
  width: 17px;
}

.back-button:disabled {
  visibility: hidden;
}

.handoff-screen {
  text-align: center;
}

.handoff-icon {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  margin: 0 auto 28px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--tomato);
  background: var(--mustard);
  box-shadow: 10px 10px 0 var(--ink);
}

.handoff-icon svg {
  width: 38px;
  height: 38px;
  stroke-width: 2;
}

.handoff-title {
  margin: 0;
  font-size: 42px;
}

.handoff-subtitle {
  margin: 12px 0 28px;
  color: var(--muted);
  font-size: 15px;
}

.cooking-screen {
  text-align: center;
}

.cooking-pan {
  position: relative;
  width: 132px;
  height: 88px;
  margin: 0 auto 32px;
  border: 5px solid var(--ink);
  border-top: 0;
  border-radius: 0 0 66px 66px;
  background: var(--tomato);
  animation: pan-bounce 800ms ease-in-out infinite alternate;
}

.cooking-pan::after {
  content: "";
  position: absolute;
  right: -70px;
  top: 18px;
  width: 72px;
  height: 13px;
  border: 5px solid var(--ink);
  border-left: 0;
  border-radius: 0 8px 8px 0;
  background: var(--mustard);
}

.steam {
  position: absolute;
  top: -48px;
  width: 3px;
  height: 34px;
  background: var(--herb);
  border-radius: 3px;
  animation: steam 900ms ease-in-out infinite;
}

.steam:nth-child(1) {
  left: 35px;
}

.steam:nth-child(2) {
  left: 64px;
  animation-delay: 160ms;
}

.steam:nth-child(3) {
  left: 92px;
  animation-delay: 320ms;
}

@keyframes pan-bounce {
  to { transform: rotate(-2deg) translateY(-4px); }
}

@keyframes steam {
  0% { opacity: 0; transform: translateY(8px) scaleY(0.6); }
  50% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-10px) scaleY(1.1); }
}

.result-screen {
  padding: 14px 0 40px;
}

.result-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.cuisine-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-bottom: 10px;
  padding: 0 10px;
  border: 1px solid currentColor;
  border-radius: 4px;
  color: var(--herb);
  font-size: 11px;
  font-weight: 800;
}

.result-title {
  margin: 0;
  font-size: 46px;
  line-height: 1.18;
}

.result-number {
  flex: 0 0 auto;
  color: var(--tomato);
  font-family: Georgia, serif;
  font-size: 14px;
  font-style: italic;
}

.result-tagline {
  max-width: 600px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.dish-stage {
  position: relative;
  min-height: 238px;
  display: grid;
  place-items: center;
  margin: 28px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--stage-color, #e8c663);
}

.dish-stage::before,
.dish-stage::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.dish-stage::before {
  width: 178px;
  height: 178px;
  left: -54px;
  top: -74px;
}

.dish-stage::after {
  width: 112px;
  height: 112px;
  right: -24px;
  bottom: -38px;
}

.plate {
  position: relative;
  z-index: 1;
  width: 190px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 10px solid #fff;
  border-radius: 50%;
  background: #fffdf7;
  box-shadow:
    0 0 0 2px rgba(25, 37, 31, 0.18),
    0 18px 30px rgba(25, 37, 31, 0.18);
}

.plate-inner {
  width: 138px;
  height: 138px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid #d9d4c8;
  border-radius: 50%;
  font-size: 48px;
}

.plate-plus {
  color: var(--tomato);
  font-family: Georgia, serif;
  font-size: 21px;
  font-weight: 700;
}

.dish-ticket {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 20px;
  max-width: 190px;
  padding: 12px 14px;
  border: 1px solid rgba(25, 37, 31, 0.3);
  border-radius: 4px;
  background: rgba(255, 254, 250, 0.9);
  transform: rotate(-2deg);
}

.dish-ticket span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.dish-ticket strong {
  display: block;
  margin-top: 4px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 15px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 36px 0 15px;
  font-size: 12px;
  font-weight: 800;
}

.section-label::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.role-card {
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
}

.role-name {
  margin: 0;
  color: var(--tomato);
  font-size: 12px;
  font-weight: 800;
}

.role-ingredient {
  margin: 8px 0 10px;
  font-family: "STSong", "Songti SC", serif;
  font-size: 24px;
  font-weight: 700;
}

.role-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.72;
}

.result-description {
  margin: 0;
  padding-left: 18px;
  border-left: 4px solid var(--mustard);
  font-family: "STSong", "Songti SC", serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.8;
}

.taste-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.taste-item {
  min-width: 0;
}

.taste-name,
.taste-value {
  display: block;
  font-size: 10px;
  font-weight: 700;
}

.taste-name {
  color: var(--muted);
}

.taste-value {
  margin-top: 5px;
  color: var(--ink);
}

.taste-track {
  height: 7px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: #dfe3de;
}

.taste-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--bar-color, var(--tomato));
}

.note-list {
  border-top: 1px solid var(--line);
}

.note-row {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 16px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.note-row dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.note-row dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.7;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.result-actions .primary-button {
  flex: 1 1 170px;
}

.result-actions .secondary-button {
  flex: 1 1 120px;
}

.result-footer {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.toast {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  padding: 11px 15px;
  border-radius: 5px;
  color: #fff;
  background: var(--ink);
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 220ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 6px); }
}

@media (max-width: 900px) {
  .app-shell {
    display: block;
  }

  .visual-panel {
    position: relative;
    height: 210px;
    padding: 22px 24px;
    background-position: center 58%;
  }

  .visual-copy {
    align-self: flex-end;
  }

  .visual-kicker,
  .cuisine-row,
  .photo-credit {
    display: none;
  }

  .visual-quote {
    font-size: 27px;
    text-align: right;
  }

  .app-main {
    min-height: calc(100dvh - 210px);
    padding: 42px 24px 56px;
  }
}

@media (max-width: 560px) {
  .visual-panel {
    height: 152px;
    padding: 18px 20px;
  }

  .visual-topline {
    font-size: 12px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .visual-quote {
    font-size: 21px;
  }

  .app-main {
    min-height: calc(100dvh - 152px);
    align-items: flex-start;
    padding: 34px 18px 48px;
  }

  .intro-title {
    font-size: 42px;
  }

  .intro-subtitle {
    font-size: 15px;
  }

  .name-grid,
  .role-grid {
    grid-template-columns: 1fr;
  }

  .intro-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .intro-actions .primary-button {
    width: 100%;
  }

  .menu-count {
    text-align: center;
  }

  .question-title {
    min-height: 0;
    font-size: 25px;
  }

  .option-button {
    min-height: 58px;
  }

  .handoff-title {
    font-size: 34px;
  }

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

  .dish-stage {
    min-height: 224px;
  }

  .plate {
    width: 154px;
  }

  .plate-inner {
    width: 112px;
    height: 112px;
    font-size: 38px;
  }

  .dish-ticket {
    right: 10px;
    bottom: 10px;
    max-width: 150px;
  }

  .taste-grid {
    grid-template-columns: repeat(3, 1fr);
    row-gap: 18px;
  }

  .note-row {
    grid-template-columns: 82px 1fr;
  }
}

/* Opening screen and standalone quiz flow */
body.is-splash {
  background: var(--tomato);
}

body.is-splash .app-shell {
  display: block;
}

body.is-splash .app-main {
  display: none;
}

body.is-splash .visual-panel {
  position: relative;
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 24px 5vw;
  padding: 34px 5vw;
  border: 0;
}

body.is-splash .visual-topline {
  grid-column: 1;
  grid-row: 1;
}

body.is-splash .pixel-kitchen-frame {
  grid-column: 2;
  grid-row: 1 / span 3;
}

body.is-splash #pixel-kitchen {
  width: min(100%, 500px);
  max-height: calc(100dvh - 68px);
}

.splash-content {
  position: relative;
  z-index: 3;
  grid-column: 1;
  grid-row: 2;
  align-self: center;
}

.splash-kicker {
  width: fit-content;
  margin: 0 0 16px;
  padding: 6px 9px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--blue);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.splash-title {
  margin: 0;
  font-family: var(--pixel-font);
  font-size: 60px;
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 5px 5px 0 var(--mustard);
}

.splash-subtitle {
  max-width: 420px;
  margin: 18px 0 26px;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.7;
}

.splash-button {
  min-width: 176px;
  min-height: 56px;
  background: #ff91c8;
  font-size: 16px;
}

.splash-button:hover {
  background: #ffb1d9;
}

body.is-splash .visual-copy {
  grid-column: 1;
  grid-row: 3;
}

body:not(.is-splash) .visual-panel {
  display: none;
}

body:not(.is-splash) .app-shell {
  display: block;
  background: var(--paper);
}

body:not(.is-splash) .app-main {
  min-height: 100dvh;
  padding: 58px clamp(24px, 7vw, 100px);
  box-shadow:
    inset 0 8px 0 #38d6a2,
    inset 0 -8px 0 var(--blue);
}

body:not(.is-splash) .app-main::before,
body:not(.is-splash) .app-main::after {
  content: "";
  position: fixed;
  z-index: 0;
  width: 9px;
  height: 9px;
  pointer-events: none;
}

body:not(.is-splash) .app-main::before {
  top: 30px;
  left: 34px;
  background: var(--tomato);
  box-shadow:
    18px 0 0 var(--mustard),
    0 18px 0 var(--blue),
    36px 18px 0 #38d6a2;
}

body:not(.is-splash) .app-main::after {
  right: 38px;
  bottom: 34px;
  background: var(--blue);
  box-shadow:
    -18px 0 0 var(--tomato),
    0 -18px 0 var(--mustard),
    -36px -18px 0 #38d6a2;
}

body:not(.is-splash) .screen {
  position: relative;
  z-index: 1;
}

.nickname-hint,
.mode-note {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 3px solid var(--ink);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.5;
}

.nickname-hint {
  width: fit-content;
  margin: 22px 0 28px;
  padding: 9px 11px;
  background: var(--mustard);
  box-shadow: 4px 4px 0 var(--ink);
}

.mode-note {
  margin: 20px 0 0;
  padding: 10px 12px;
  background: #66e5bd;
}

.nickname-hint svg,
.mode-note svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 3;
}

@media (max-width: 720px) {
  body.is-splash .visual-panel {
    min-height: 100dvh;
    height: auto;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(250px, 1fr) auto;
    gap: 16px;
    padding: 18px;
  }

  body.is-splash .visual-topline {
    grid-column: 1;
    grid-row: 1;
  }

  body.is-splash .pixel-kitchen-frame {
    grid-column: 1;
    grid-row: 2;
  }

  body.is-splash #pixel-kitchen {
    width: min(100%, 232px);
    max-height: 44dvh;
  }

  body.is-splash .splash-content {
    grid-column: 1;
    grid-row: 3;
    text-align: center;
  }

  .splash-kicker {
    margin-right: auto;
    margin-left: auto;
  }

  .splash-title {
    font-size: 42px;
  }

  .splash-subtitle {
    margin: 12px auto 18px;
    font-size: 13px;
  }

  .splash-button {
    min-width: 180px;
  }

  body.is-splash .visual-copy {
    display: none;
  }

  body:not(.is-splash) .app-main {
    padding: 54px 18px 60px;
    box-shadow:
      inset 0 7px 0 #38d6a2,
      inset 0 -7px 0 var(--blue);
  }

  body:not(.is-splash) .app-main::before,
  body:not(.is-splash) .app-main::after {
    display: none;
  }

  .nickname-hint,
  .mode-note {
    width: 100%;
  }
}

@media (max-width: 360px) {
  body.is-splash .visual-panel {
    grid-template-rows: auto minmax(220px, 1fr) auto;
    padding: 14px;
  }

  body.is-splash #pixel-kitchen {
    width: 200px;
    max-height: 40dvh;
  }

  .splash-title {
    font-size: 36px;
  }

  .splash-subtitle {
    margin-bottom: 14px;
  }

  .intro-title {
    font-size: 36px;
  }
}

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

/* Pixel restaurant theme */
:root {
  --ink: #20233d;
  --muted: #586077;
  --paper: #effff8;
  --white: #fffefa;
  --line: #20233d;
  --tomato: #ff4f67;
  --tomato-dark: #e93c58;
  --herb: #08a884;
  --mustard: #ffd84d;
  --blush: #ffdff0;
  --blue: #4da8ff;
  --orange: #ff914d;
  --pixel-font: "Courier New", "Microsoft YaHei", "Noto Sans CJK SC", monospace;
  --shadow: 6px 6px 0 var(--ink);
  font-family: var(--pixel-font);
  background: var(--paper);
}

body {
  background: #8ee8ff;
}

.app-shell {
  grid-template-columns: minmax(390px, 0.9fr) minmax(520px, 1.1fr);
}

.visual-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 28px 32px;
  color: var(--ink);
  background: var(--tomato);
  background-image: none;
  border-right: 6px solid var(--ink);
}

.visual-panel::before,
.visual-panel::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--mustard);
  box-shadow:
    24px 16px 0 var(--blue),
    52px -2px 0 var(--white),
    80px 24px 0 var(--orange);
}

.visual-panel::before {
  top: 96px;
  left: 18px;
}

.visual-panel::after {
  right: 92px;
  bottom: 52px;
  transform: rotate(90deg);
}

.visual-topline {
  z-index: 3;
  width: fit-content;
  min-height: 44px;
  gap: 10px;
  padding: 6px 12px 6px 7px;
  border: 3px solid var(--ink);
  color: var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--pixel-font);
  font-size: 13px;
  font-weight: 900;
}

.brand-mark {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--tomato);
  background: var(--mustard);
  font-size: 18px;
  line-height: 1;
}

.pixel-kitchen-frame {
  position: relative;
  z-index: 2;
  min-height: 0;
  display: grid;
  place-items: center;
}

#pixel-kitchen {
  width: min(100%, 430px);
  max-height: 100%;
  display: block;
  object-fit: contain;
  border: 4px solid var(--ink);
  background: #8ee8ff;
  box-shadow: 8px 8px 0 var(--blue);
  image-rendering: pixelated;
  animation: counter-idle 1.8s steps(2, end) infinite;
}

@keyframes counter-idle {
  50% { transform: translateY(-2px); }
}

.visual-copy {
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
}

.visual-kicker {
  margin: 0;
  padding: 6px 8px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--mustard);
  font-family: var(--pixel-font);
  font-size: 10px;
  font-weight: 900;
}

.visual-quote {
  margin: 0;
  padding: 7px 9px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--white);
  font-family: var(--pixel-font);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: none;
}

.cuisine-row {
  gap: 6px;
  margin: 0;
}

.cuisine-row span {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.cuisine-row span:nth-child(2n) {
  background: var(--mustard);
}

.app-main {
  position: relative;
  border-left: 0;
  background: var(--paper);
  background-image: none;
  box-shadow: inset 10px 0 0 #38d6a2;
}

.screen {
  animation: pixel-in 280ms steps(4, end) both;
}

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

h1,
h2,
h3,
.dish-ticket strong,
.result-description {
  font-family: var(--pixel-font);
  font-weight: 900;
}

.eyebrow {
  width: fit-content;
  margin-bottom: 16px;
  padding: 7px 9px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--mustard);
  box-shadow: 3px 3px 0 var(--ink);
  font-size: 10px;
  font-weight: 900;
}

.intro-title {
  font-size: 52px;
  font-weight: 900;
  line-height: 1.12;
  text-shadow: 4px 4px 0 #b8f0dd;
}

.intro-subtitle {
  color: var(--ink);
  font-size: 15px;
  font-weight: 700;
}

.menu-rule {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.menu-rule::before,
.menu-rule::after {
  height: 3px;
  background: var(--ink);
}

.field-label {
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.field-label input {
  height: 54px;
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--pixel-font);
  font-weight: 900;
}

.field-label input:hover,
.field-label input:focus {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--blue);
}

.menu-count,
.progress-meta,
.handoff-subtitle,
.result-tagline,
.role-copy,
.note-row dd,
.result-footer {
  color: var(--muted);
}

.primary-button,
.secondary-button,
.icon-button {
  border: 3px solid var(--ink);
  border-radius: 0;
  font-family: var(--pixel-font);
  font-weight: 900;
}

.primary-button {
  color: var(--ink);
  background: var(--tomato);
  box-shadow: 6px 6px 0 var(--mustard), 8px 8px 0 var(--ink);
}

.primary-button:hover {
  color: var(--ink);
  background: #ff6b7b;
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--mustard), 10px 10px 0 var(--ink);
}

.primary-button:disabled {
  color: #72778b;
  border-color: #9297aa;
  background: #d8dbe4;
  box-shadow: 4px 4px 0 #9297aa;
  opacity: 1;
}

.secondary-button {
  color: var(--ink);
  background: #66e5bd;
  box-shadow: 4px 4px 0 var(--ink);
}

.secondary-button:hover {
  border-color: var(--ink);
  color: var(--ink);
  background: var(--mustard);
}

.primary-button svg,
.secondary-button svg,
.icon-button svg {
  stroke-width: 3;
}

.question-header {
  margin-bottom: 28px;
}

.progress-meta {
  color: var(--ink);
  font-family: var(--pixel-font);
  font-size: 11px;
  font-weight: 900;
}

.progress-track {
  height: 14px;
  margin-top: 10px;
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--white);
}

.progress-fill {
  border-radius: 0;
  background: var(--blue);
}

.question-kicker {
  width: fit-content;
  margin-bottom: 14px;
  padding: 5px 8px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: #66e5bd;
  font-size: 11px;
  font-weight: 900;
}

.question-title {
  font-size: 27px;
  font-weight: 900;
  line-height: 1.45;
}

.option-list {
  gap: 12px;
}

.option-button {
  min-height: 64px;
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--pixel-font);
}

.option-button:hover {
  border-color: var(--ink);
  background: #dff8ff;
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--blue);
}

.option-button.selected {
  border-color: var(--ink);
  background: var(--mustard);
  box-shadow: 5px 5px 0 var(--tomato);
}

.option-key {
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #dff8ff;
  font-family: var(--pixel-font);
  font-weight: 900;
}

.option-button.selected .option-key {
  border-color: var(--ink);
  color: var(--white);
  background: var(--ink);
}

.option-text,
.back-button {
  font-family: var(--pixel-font);
  font-weight: 900;
}

.back-button {
  color: var(--ink);
}

.handoff-icon {
  border: 4px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--blue);
  box-shadow: 10px 10px 0 var(--mustard), 14px 14px 0 var(--ink);
}

.handoff-title {
  font-weight: 900;
  text-shadow: 3px 3px 0 #b8f0dd;
}

.cooking-pan {
  border: 5px solid var(--ink);
  border-top: 0;
  border-radius: 0;
  background: var(--tomato);
  box-shadow: inset 0 -14px 0 var(--tomato-dark);
  clip-path: polygon(0 0, 100% 0, 100% 60%, 90% 60%, 90% 78%, 75% 78%, 75% 92%, 25% 92%, 25% 78%, 10% 78%, 10% 60%, 0 60%);
  animation-timing-function: steps(2, end);
}

.cooking-pan::after {
  border-radius: 0;
  background: var(--mustard);
}

.steam {
  width: 5px;
  background: var(--blue);
  border-radius: 0;
  animation-timing-function: steps(3, end);
}

.cuisine-tag {
  border: 2px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: #66e5bd;
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 900;
}

.result-title {
  font-weight: 900;
  text-shadow: 3px 3px 0 #b8f0dd;
}

.result-number {
  padding: 5px 7px;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--mustard);
  font-family: var(--pixel-font);
  font-style: normal;
  font-weight: 900;
}

.result-tagline {
  color: var(--ink);
  font-weight: 700;
}

.dish-stage {
  border: 4px solid var(--ink);
  border-radius: 0;
  box-shadow: 7px 7px 0 var(--ink);
}

.dish-stage::before,
.dish-stage::after {
  border-radius: 0;
  background: var(--blue);
  box-shadow: 18px 18px 0 var(--tomato);
}

.dish-stage::before {
  width: 64px;
  height: 64px;
  left: 16px;
  top: 16px;
}

.dish-stage::after {
  width: 34px;
  height: 34px;
  right: 24px;
  bottom: 22px;
}

.dish-image-frame {
  position: relative;
  z-index: 1;
  width: min(74%, 560px);
  aspect-ratio: 3 / 2;
  display: grid;
  place-items: center;
  margin: 0;
  overflow: hidden;
  border: 8px solid var(--ink);
  background: #171827;
  box-shadow: 8px 8px 0 rgba(32, 35, 61, 0.32);
}

.dish-photo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: auto;
}

.plate {
  border: 8px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  box-shadow: 8px 8px 0 rgba(32, 35, 61, 0.3);
}

.plate-inner {
  border: 3px dashed var(--blue);
  border-radius: 0;
}

.dish-ticket {
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  transform: none;
}

@media (max-width: 560px) {
  .dish-image-frame {
    width: min(82%, 340px);
    border-width: 6px;
    box-shadow: 6px 6px 0 rgba(32, 35, 61, 0.32);
  }
}

.section-label {
  color: var(--ink);
  font-weight: 900;
}

.section-label::after {
  height: 3px;
  background: var(--ink);
}

.role-card {
  border: 3px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  box-shadow: 5px 5px 0 var(--blue);
}

.role-card:nth-child(2) {
  box-shadow: 5px 5px 0 var(--tomato);
}

.role-name {
  color: var(--tomato-dark);
  font-weight: 900;
}

.role-ingredient {
  font-family: var(--pixel-font);
  font-weight: 900;
}

.result-description {
  padding: 16px;
  border: 3px solid var(--ink);
  border-left: 9px solid var(--tomato);
  color: var(--ink);
  background: var(--mustard);
  box-shadow: 4px 4px 0 var(--ink);
}

.taste-name,
.taste-value {
  color: var(--ink);
  font-family: var(--pixel-font);
  font-weight: 900;
}

.taste-track {
  height: 12px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--white);
}

.taste-fill {
  border-radius: 0;
}

.note-list {
  border-top: 3px solid var(--ink);
}

.note-row {
  border-bottom: 3px solid var(--ink);
}

.note-row dt {
  color: var(--ink);
  font-weight: 900;
}

.toast {
  border: 3px solid var(--ink);
  border-radius: 0;
  color: var(--ink);
  background: var(--mustard);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--pixel-font);
  font-weight: 900;
}

@media (max-width: 900px) {
  .visual-panel {
    height: 270px;
    display: grid;
    grid-template-columns: minmax(160px, 0.9fr) minmax(210px, 1.1fr);
    grid-template-rows: auto 1fr;
    gap: 12px 20px;
    padding: 20px 24px;
    border-right: 0;
    border-bottom: 6px solid var(--ink);
  }

  .visual-topline {
    grid-column: 1;
    grid-row: 1;
  }

  .pixel-kitchen-frame {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  #pixel-kitchen {
    width: min(100%, 180px);
    box-shadow: 5px 5px 0 var(--blue);
  }

  .visual-copy {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
  }

  .visual-quote {
    text-align: left;
  }

  .app-main {
    min-height: calc(100dvh - 270px);
    padding: 42px 28px 60px;
    box-shadow: inset 0 8px 0 #38d6a2;
  }
}

@media (max-width: 560px) {
  .visual-panel {
    height: 230px;
    grid-template-columns: minmax(100px, 1fr) 128px;
    gap: 8px 10px;
    padding: 14px 16px;
  }

  .visual-topline {
    min-height: 38px;
    padding: 4px 7px 4px 4px;
    font-size: 10px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
    font-size: 15px;
  }

  #pixel-kitchen {
    width: 128px;
    border-width: 3px;
    box-shadow: 4px 4px 0 var(--blue);
  }

  .visual-kicker,
  .cuisine-row {
    display: none;
  }

  .visual-quote {
    padding: 5px 6px;
    font-size: 12px;
  }

  .app-main {
    min-height: calc(100dvh - 230px);
    padding: 36px 18px 52px;
  }

  .intro-title {
    font-size: 40px;
  }

  .question-title {
    font-size: 23px;
  }

  .option-button {
    min-height: 60px;
  }

  .result-title {
    font-size: 34px;
  }

  .dish-stage {
    margin-right: 5px;
  }
}

.primary-button.splash-button {
  background: #ff91c8;
}

.primary-button.splash-button:hover {
  background: #ffb1d9;
}

.name-grid.single-field {
  grid-template-columns: minmax(0, 460px);
}

.invite-waiting-screen {
  max-width: 720px;
  margin: 0 auto;
}

.invite-link-label {
  display: block;
  margin: 30px 0 9px;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  text-align: left;
}

.invite-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
}

.invite-link-row input {
  width: 100%;
  min-width: 0;
  height: 58px;
  border: 3px solid var(--ink);
  border-radius: 0;
  padding: 0 14px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 800;
}

.invite-link-row input:focus {
  outline: 0;
  box-shadow: 4px 4px 0 var(--blue);
}

.invite-link-row .icon-button {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--mustard);
  box-shadow: 4px 4px 0 var(--ink);
}

.invite-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 26px;
}

.waiting-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.waiting-dot {
  width: 10px;
  height: 10px;
  border: 2px solid var(--ink);
  background: #38d6a2;
  animation: waiting-blink 1.2s steps(2, end) infinite;
}

@keyframes waiting-blink {
  50% { opacity: 0.35; }
}

@media (max-width: 560px) {
  .invite-waiting-screen .handoff-title {
    font-size: 30px;
  }

  .invite-actions {
    flex-direction: column;
  }

  .invite-actions .primary-button,
  .invite-actions .secondary-button {
    width: 100%;
  }
}

/* Mobile-first opening composition */
body.is-splash .visual-panel {
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}

body.is-splash .pixel-kitchen-frame {
  grid-row: 1 / span 4;
}

body.is-splash .splash-content {
  grid-row: 2;
}

body.is-splash .splash-button {
  z-index: 3;
  grid-column: 1;
  grid-row: 3;
  width: fit-content;
  justify-self: start;
}

body.is-splash .visual-copy {
  grid-row: 4;
}

@media (max-width: 720px) {
  body.is-splash .visual-panel {
    width: 100%;
    min-height: 100svh;
    height: 100dvh;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 12px;
    overflow: hidden;
    padding:
      max(16px, env(safe-area-inset-top))
      18px
      max(16px, env(safe-area-inset-bottom));
  }

  body.is-splash .visual-topline {
    grid-column: 1;
    grid-row: 1;
  }

  body.is-splash .splash-content {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    text-align: left;
  }

  body.is-splash .splash-kicker {
    margin: 0 0 10px;
  }

  body.is-splash .splash-title {
    font-size: 38px;
    line-height: 1.06;
    text-shadow: 4px 4px 0 var(--mustard);
  }

  body.is-splash .splash-subtitle {
    margin: 10px 0 0;
    font-size: 12px;
    line-height: 1.5;
  }

  body.is-splash .pixel-kitchen-frame {
    grid-column: 1;
    grid-row: 3;
    min-height: 0;
    align-self: start;
  }

  body.is-splash #pixel-kitchen {
    width: min(100%, 244px);
    max-height: 100%;
  }

  body.is-splash .splash-button {
    grid-column: 1;
    grid-row: 4;
    width: min(100%, 360px);
    min-height: 58px;
    justify-self: center;
    margin-top: 2px;
  }

  body.is-splash .visual-copy {
    display: none;
  }
}

@media (max-width: 360px), (max-height: 720px) and (max-width: 720px) {
  body.is-splash .visual-panel {
    gap: 9px;
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }

  body.is-splash .splash-title {
    font-size: 34px;
  }

  body.is-splash .splash-kicker {
    display: none;
  }

  body.is-splash .splash-subtitle {
    margin-top: 7px;
  }

  body.is-splash #pixel-kitchen {
    width: min(100%, 210px);
  }

  body.is-splash .splash-button {
    min-height: 54px;
  }
}
