/* ==========================================
   먹을건 먹어야지 — Apple Music Dark Style
   ========================================== */

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

:root {
  --bg:     #000000;
  --s1:     rgba(28,28,30,0.75);
  --s2:     rgba(44,44,46,0.6);
  --s3:     rgba(58,58,60,0.5);
  --border: rgba(255,255,255,0.09);
  --border2:rgba(255,255,255,0.15);
  --accent: #ff375f;
  --accent2:#ff6b88;
  --gold:   #ffd60a;
  --t1:     #ffffff;
  --t2:     rgba(255,255,255,0.62);
  --t3:     rgba(255,255,255,0.3);
  --radius: 14px;
  --radius-lg: 22px;
  --blur:   saturate(180%) blur(24px);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease:   cubic-bezier(0.4, 0, 0.2, 1);
  --font:   'Inter', 'Noto Sans KR', -apple-system, system-ui, sans-serif;
}

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--t1);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

/* ── Ambient Background ── */
.bg-blobs {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none; overflow: hidden;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.18;
  animation: drift 18s ease-in-out infinite;
}
.blob-1 {
  width: 560px; height: 560px;
  background: radial-gradient(circle, #ff375f, transparent);
  top: -140px; left: -140px;
  animation-delay: 0s;
}
.blob-2 {
  width: 480px; height: 480px;
  background: radial-gradient(circle, #7c3aed, transparent);
  bottom: -100px; right: -100px;
  animation-delay: -6s;
}
.blob-3 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, #0ea5e9, transparent);
  top: 50%; left: 50%; transform: translate(-50%,-50%);
  animation-delay: -12s;
}
@keyframes drift {
  0%,100% { transform: translate(0,0) scale(1); }
  33%      { transform: translate(30px,-20px) scale(1.05); }
  66%      { transform: translate(-20px,30px) scale(0.95); }
}

/* ── Screens ── */
.screen {
  position: fixed; inset: 0; z-index: 10;
  display: flex; flex-direction: column;
  opacity: 0; pointer-events: none;
  transform: scale(0.97);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
  overflow: hidden;
}
.screen.active {
  opacity: 1; pointer-events: all;
  transform: scale(1);
}

/* ════════════════════════════════════════
   INTRO
════════════════════════════════════════ */
#introScreen {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.intro-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 36px;
  position: relative;
  z-index: 2;
}

.intro-logo-area {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.intro-icon {
  font-size: 3.5rem;
  line-height: 1;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}

.intro-title {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--t1);
  line-height: 1.15;
}

.intro-sub {
  font-size: 0.9rem;
  color: var(--t3);
  line-height: 1.6;
  letter-spacing: 0.01em;
  font-family: 'Noto Sans KR', sans-serif;
}

.intro-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.form-label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--t3);
  text-transform: uppercase;
  padding-left: 2px;
  font-family: 'Noto Sans KR', sans-serif;
}

.form-row {
  display: flex;
  gap: 10px;
}

.glass-input {
  flex: 1;
  background: var(--s1);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 14px 16px;
  color: var(--t1);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  transition: border-color .2s, box-shadow .2s;
}
.glass-input::placeholder { color: var(--t3); }
.glass-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,55,95,.18);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 14px 24px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .15s var(--spring), box-shadow .2s;
}
.pill-btn:hover {
  background: var(--accent2);
  transform: scale(1.04);
  box-shadow: 0 4px 20px rgba(255,55,95,.35);
}
.pill-btn:active { transform: scale(0.98); }
.pill-btn.full { width: 100%; border-radius: var(--radius); padding: 16px; font-size: 1rem; }

.intro-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--t3);
  font-family: 'Noto Sans KR', sans-serif;
}

/* ════════════════════════════════════════
   TOP NAV
════════════════════════════════════════ */
.top-nav {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 30;
}

.nav-back {
  background: var(--s2);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  color: var(--t1);
  cursor: pointer;
  transition: background .2s;
  flex-shrink: 0;
}
.nav-back:hover { background: var(--s3); }
.nav-back.white { background: rgba(0,0,0,.35); border-color: rgba(255,255,255,.2); }

.nav-title {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.nav-app-name {
  font-size: 0.95rem;
  font-weight: 700;
  font-family: 'Noto Sans KR', sans-serif;
  letter-spacing: -0.01em;
}
.nav-status {
  font-size: 0.65rem;
  color: var(--t3);
  letter-spacing: 0.05em;
}
.nav-user {
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: -0.01em;
  font-family: 'Noto Sans KR', sans-serif;
}

/* Progress */
.progress-track {
  height: 2px;
  background: rgba(255,255,255,.06);
  flex-shrink: 0;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width .6s var(--ease);
  box-shadow: 0 0 8px rgba(255,55,95,.5);
}

/* ════════════════════════════════════════
   CHAT AREA
════════════════════════════════════════ */
.chat-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
}
.chat-scroll::-webkit-scrollbar { width: 0; }

.chat-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 16px;
}

/* Messages */
.msg {
  display: flex;
  gap: 10px;
  animation: msgIn .4s var(--ease) forwards;
  opacity: 0;
  transform: translateY(10px);
}
@keyframes msgIn {
  to { opacity:1; transform:translateY(0); }
}
.msg.bot  { align-items: flex-end; }
.msg.user { justify-content: flex-end; }

.bot-avi {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
  box-shadow: 0 0 14px rgba(255,55,95,.25);
}

.bubble {
  max-width: 72%;
  padding: 12px 16px;
  font-size: 0.93rem;
  line-height: 1.6;
  font-family: 'Noto Sans KR', sans-serif;
}
.msg.bot .bubble {
  background: var(--s1);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--border);
  border-radius: 18px 18px 18px 4px;
}
.msg.user .bubble {
  background: var(--accent);
  border-radius: 18px 18px 4px 18px;
  color: #fff;
}

/* Typing */
.typing-dots {
  display: flex; gap: 5px;
  padding: 14px 18px;
  align-items: center;
}
.dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--t3);
  animation: bop 1.2s ease-in-out infinite;
}
.dot:nth-child(2) { animation-delay:.2s; }
.dot:nth-child(3) { animation-delay:.4s; }
@keyframes bop {
  0%,100% { transform:translateY(0); opacity:.4; }
  50%      { transform:translateY(-6px); opacity:1; }
}

/* ── Chat Bottom ── */
.chat-bottom {
  flex-shrink: 0;
  background: rgba(0,0,0,.6);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border-top: 1px solid var(--border);
  padding: 12px 16px 20px;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-width: 640px;
  margin: 0 auto 10px;
  min-height: 0;
  transition: min-height .3s;
}
.chips-row:empty { margin-bottom: 0; }

.chip {
  background: var(--s2);
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--t2);
  cursor: pointer;
  transition: all .2s;
  animation: chipIn .3s var(--ease) forwards;
  opacity: 0;
  transform: translateY(4px) scale(0.95);
}
@keyframes chipIn {
  to { opacity:1; transform:translateY(0) scale(1); }
}
.chip:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-1px);
}

.input-row {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin: 0 auto;
}

.chat-input {
  flex: 1;
  background: var(--s1);
  border: 1px solid var(--border2);
  border-radius: 100px;
  padding: 12px 20px;
  font-size: 0.92rem;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--t1);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.chat-input::placeholder { color: var(--t3); }
.chat-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,55,95,.15);
}

.send-btn {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform .15s var(--spring), background .2s;
}
.send-btn:hover { transform: scale(1.1); background: var(--accent2); }
.send-btn:active { transform: scale(0.95); }

/* ════════════════════════════════════════
   RESULT — Apple Music "Now Playing"
════════════════════════════════════════ */
.result-hero {
  position: relative;
  flex-shrink: 0;
  height: min(46vh, 320px);
  overflow: hidden;
}
.hero-img-wrap {
  position: absolute; inset: 0;
}
.hero-img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(.65);
  transition: opacity .5s;
}
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.1) 0%,
    rgba(0,0,0,.0) 30%,
    rgba(0,0,0,.7) 80%,
    #000 100%
  );
}
.hero-overlay {
  position: absolute; inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 20px 20px;
  z-index: 2;
}
.hero-text {
  margin-top: auto;
}
.hero-eyebrow {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent2);
  margin-bottom: 6px;
  font-family: 'Inter', sans-serif;
}
.hero-food-name {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  font-family: 'Noto Sans KR', sans-serif;
  text-shadow: 0 2px 20px rgba(0,0,0,.5);
}
.hero-category {
  font-size: 0.85rem;
  color: rgba(255,255,255,.55);
  margin-top: 4px;
  font-family: 'Noto Sans KR', sans-serif;
}
.hero-actions {
  position: absolute;
  top: 14px; right: 20px;
}
.icon-btn {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.2);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  color: #fff;
  font-size: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
}
.icon-btn:hover { background: rgba(255,55,95,.4); border-color: var(--accent); }
.icon-btn.active { color: var(--accent); }

/* Result scroll body */
.result-scroll {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.result-scroll::-webkit-scrollbar { width: 0; }

.reason-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 18px 20px 0;
  max-width: 680px;
  margin: 0 auto;
}
.reason-pill {
  background: rgba(255,55,95,.12);
  border: 1px solid rgba(255,55,95,.25);
  border-radius: 100px;
  padding: 5px 13px;
  font-size: 0.78rem;
  color: var(--accent2);
  font-family: 'Noto Sans KR', sans-serif;
  animation: chipIn .3s ease forwards;
  opacity: 0;
}

.result-desc {
  padding: 14px 20px;
  font-size: 0.9rem;
  color: var(--t2);
  line-height: 1.65;
  font-family: 'Noto Sans KR', sans-serif;
  max-width: 680px;
  margin: 0 auto;
}

.section-header {
  padding: 8px 20px 12px;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: 'Noto Sans KR', sans-serif;
  letter-spacing: -0.01em;
}

/* Alternate food cards — horizontal list */
.alt-cards {
  display: flex;
  gap: 14px;
  padding: 0 20px 4px;
  overflow-x: auto;
  max-width: 100%;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.alt-cards::-webkit-scrollbar { display: none; }

.alt-card {
  flex-shrink: 0;
  width: 200px;
  background: var(--s1);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  cursor: pointer;
  scroll-snap-align: start;
  transition: transform .2s var(--spring), border-color .2s;
  animation: cardIn .4s ease forwards;
  opacity: 0;
  transform: translateY(12px);
  position: relative;
}
@keyframes cardIn {
  to { opacity:1; transform:translateY(0); }
}
.alt-card:hover {
  transform: scale(1.03) translateY(-2px);
  border-color: var(--border2);
}
.alt-card-img {
  width: 100%; height: 130px;
  object-fit: cover;
  display: block;
}
.alt-card-emoji {
  width: 100%; height: 130px;
  display: flex; align-items: center; justify-content: center;
  font-size: 3rem;
  background: var(--s2);
}
.alt-card-body {
  padding: 12px;
}
.alt-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  font-family: 'Noto Sans KR', sans-serif;
  letter-spacing: -0.01em;
  margin-bottom: 2px;
}
.alt-card-cat {
  font-size: 0.72rem;
  color: var(--t3);
  font-family: 'Noto Sans KR', sans-serif;
}
.alt-card-fav {
  position: absolute;
  top: 8px; right: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,.5);
  border: none;
  color: var(--t2);
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all .2s;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.alt-card-fav:hover { color: var(--accent); }
.alt-card-fav.active { color: var(--accent); }

/* Result action buttons */
.result-btns {
  padding: 20px 20px 0;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.result-row-btns {
  display: flex;
  gap: 10px;
}
.ghost-btn {
  flex: 1;
  background: var(--s1);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  font-family: 'Noto Sans KR', sans-serif;
  color: var(--t1);
  cursor: pointer;
  transition: all .2s;
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
}
.ghost-btn:hover { background: var(--s2); transform: translateY(-1px); }
.ghost-btn.gold { color: var(--gold); border-color: rgba(255,214,10,.25); }
.ghost-btn.gold:hover { background: rgba(255,214,10,.08); }

/* Favorites empty */
.fav-empty {
  text-align: center;
  padding: 80px 20px;
  color: var(--t2);
  font-family: 'Noto Sans KR', sans-serif;
}

/* Responsive */
@media (max-width: 480px) {
  .hero-food-name { font-size: 1.9rem; }
  .alt-card { width: 165px; }
}
