/* =====================================================================
   오늘 뭐 먹지? - 공용 스타일
   ===================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Black+Han+Sans&family=Noto+Sans+KR:wght@400;500;700;900&display=swap');

:root {
  --ink:    #241a12;
  --paper:  #fdf8f2;
  --card:   #ffffff;
  --tomato: #e8552d;
  --chili:  #c4361b;
  --herb:   #2f7d52;
  --gold:   #f2a93b;
  --muted:  #8a7d70;
  --line:   #ece2d6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", -apple-system, "Malgun Gothic", sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 18%, rgba(242,169,59,.10), transparent 38%),
    radial-gradient(circle at 88% 82%, rgba(47,125,82,.08), transparent 42%),
    radial-gradient(rgba(36,26,18,.045) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
}

/* ---------- 네비게이션 ---------- */
.nav {
  display: flex; align-items: center; justify-content: space-between;
  max-width: 760px; margin: 0 auto; padding: 20px 24px;
}
.brand {
  font-family: "Black Han Sans", sans-serif;
  font-size: 22px; color: var(--ink); text-decoration: none; letter-spacing: -.02em;
}
.nav-links { display: flex; align-items: center; gap: 18px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--tomato); }
.nav-links a.cta {
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 999px;
}
.nav-links a.cta:hover { background: var(--chili); color: #fff; }
.hello { font-size: 14px; color: var(--ink); font-weight: 700; }

/* ---------- 공용 레이아웃 ---------- */
.wrap { max-width: 760px; margin: 0 auto; padding: 8px 24px 64px; }
.page-center {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 80px); padding: 0 20px 40px;
}

/* ---------- 추천 머신 (메인) ---------- */
.hero { text-align: center; margin: 8px 0 26px; }
.hero .eyebrow {
  color: var(--tomato); font-weight: 700; font-size: 14px; letter-spacing: .04em;
}
.hero h1 {
  font-family: "Black Han Sans", sans-serif; font-weight: 400;
  font-size: clamp(40px, 9vw, 68px); line-height: .98; margin: 6px 0 0;
  letter-spacing: -.01em;
}
.hero h1 .accent { color: var(--tomato); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 0 auto 26px; max-width: 560px; }
.chip {
  border: 1.5px solid var(--line); background: var(--card); color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all .15s ease; font-family: inherit;
}
.chip:hover { border-color: var(--gold); color: var(--ink); }
.chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }

/* 음식이 뽑히는 "식권 디스펜서" 카드 */
.machine {
  position: relative; background: var(--card); border-radius: 26px;
  padding: 40px 30px 34px; max-width: 460px; margin: 0 auto;
  box-shadow: 0 24px 60px -20px rgba(36,26,18,.28);
  border: 1px solid var(--line);
}
/* 티켓 느낌 좌우 노치 */
.machine::before, .machine::after {
  content: ""; position: absolute; top: 168px; width: 26px; height: 26px;
  background: var(--paper); border-radius: 50%;
}
.machine::before { left: -13px; }
.machine::after  { right: -13px; }

.window {
  height: 152px; display: flex; align-items: center; justify-content: center;
  border-radius: 18px; background:
    repeating-linear-gradient(45deg, #fff7ef, #fff7ef 12px, #fdf1e6 12px, #fdf1e6 24px);
  border: 1px solid var(--line); overflow: hidden;
}
.window .emoji { font-size: 96px; line-height: 1; transition: transform .08s; }
.window.spinning .emoji { animation: jiggle .12s linear infinite; }
@keyframes jiggle {
  0%,100% { transform: translateY(-6px) rotate(-4deg); }
  50%     { transform: translateY(6px)  rotate(4deg); }
}

.result { text-align: center; padding-top: 22px; min-height: 96px; }
.result .cat {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--herb);
  background: rgba(47,125,82,.10); padding: 4px 12px; border-radius: 999px;
}
.result .name {
  font-family: "Black Han Sans", sans-serif; font-size: 38px; margin: 10px 0 4px;
  letter-spacing: -.01em;
}
.result .desc { color: var(--muted); font-size: 14px; margin: 0; }
.result .placeholder { color: var(--muted); font-size: 15px; padding-top: 28px; }

.actions { display: flex; gap: 10px; margin-top: 24px; }
.btn-spin {
  flex: 1; border: none; cursor: pointer; font-family: "Black Han Sans", sans-serif;
  font-size: 20px; color: #fff; background: var(--tomato); padding: 16px;
  border-radius: 16px; box-shadow: 0 8px 0 0 var(--chili); transition: all .08s ease;
}
.btn-spin:hover { background: #f06037; }
.btn-spin:active { transform: translateY(6px); box-shadow: 0 2px 0 0 var(--chili); }
.btn-spin:disabled { opacity: .6; cursor: default; }

.btn-fav {
  width: 60px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer;
  border-radius: 16px; font-size: 24px; transition: all .15s ease;
}
.btn-fav:hover { border-color: var(--gold); }
.btn-fav.saved { background: #fff4e6; border-color: var(--gold); }
.btn-fav:disabled { opacity: .4; cursor: default; }

.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 10;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 인증 카드 (로그인/회원가입) ---------- */
.auth {
  background: var(--card); border: 1px solid var(--line); border-radius: 22px;
  padding: 38px 34px; width: 360px; box-shadow: 0 20px 50px -22px rgba(36,26,18,.25);
}
.auth h2 {
  font-family: "Black Han Sans", sans-serif; font-weight: 400; font-size: 30px;
  margin: 0 0 4px; text-align: center;
}
.auth .sub { text-align: center; color: var(--muted); font-size: 14px; margin: 0 0 24px; }
.auth label { display: block; font-size: 13px; font-weight: 700; margin: 16px 0 6px; }
.auth input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 15px; font-family: inherit; background: #fffdfb;
}
.auth input:focus { outline: none; border-color: var(--tomato); }
.auth button {
  width: 100%; margin-top: 24px; padding: 14px; border: none; cursor: pointer;
  background: var(--tomato); color: #fff; border-radius: 12px;
  font-family: "Black Han Sans", sans-serif; font-size: 18px;
}
.auth button:hover { background: #f06037; }
.auth .switch { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted); }
.auth .switch a { color: var(--tomato); font-weight: 700; text-decoration: none; }

/* ---------- 즐겨찾기 목록 ---------- */
.fav-head { margin: 6px 0 22px; }
.fav-head h1 {
  font-family: "Black Han Sans", sans-serif; font-weight: 400; font-size: 36px; margin: 0;
}
.fav-head p { color: var(--muted); margin: 4px 0 0; font-size: 14px; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.fav-item {
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 20px 16px; text-align: center; position: relative;
}
.fav-item .fe { font-size: 48px; line-height: 1; }
.fav-item .fn { font-weight: 700; margin-top: 8px; font-size: 16px; }
.fav-item .fc { color: var(--herb); font-size: 12px; font-weight: 700; margin-top: 2px; }
.fav-item .remove {
  position: absolute; top: 8px; right: 8px; border: none; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 18px; line-height: 1;
}
.fav-item .remove:hover { color: var(--chili); }
.empty {
  text-align: center; color: var(--muted); padding: 60px 20px;
  background: var(--card); border: 1px dashed var(--line); border-radius: 20px;
}
.empty a { color: var(--tomato); font-weight: 700; text-decoration: none; }

@media (prefers-reduced-motion: reduce) {
  .window.spinning .emoji { animation: none; }
  * { transition: none !important; }
}
