:root {
  --cream: #FFF4EC;
  --cream-2: #FFE9DC;
  --apricot: #FFB59E;
  --apricot-deep: #FF8C6B;
  --mint: #B7E4D4;
  --mint-deep: #6FCBA8;
  --lavender: #D9C9F2;
  --lavender-deep: #B79CE6;
  --ink: #5B4A48;
  --ink-soft: #9A8884;
  --white: #FFFDFB;
  --shadow: 0 18px 40px -16px rgba(199, 122, 96, 0.45);
  --shadow-soft: 0 8px 20px -8px rgba(199, 122, 96, 0.3);
  --r-lg: 32px;
  --r-md: 22px;
  --r-sm: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { min-height: 100%; }
html { background: var(--cream); }

body {
  font-family: 'Gowun Dodum', sans-serif;
  color: var(--ink);
  background-color: var(--cream);
  min-height: 100dvh;
  overflow-x: hidden;
  position: relative;
}
/* 스크롤·주소창 변화와 무관하게 화면 전체를 덮는 고정 그라데이션 */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(165deg, #FFF7F1 0%, #FFEFE6 45%, #FCEAF3 100%);
}

/* ---------- 배경 방울 ---------- */
.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(42px); opacity: 0.55; animation: float 14s ease-in-out infinite; }
.blob-1 { width: 280px; height: 280px; background: var(--apricot); top: -60px; left: -70px; }
.blob-2 { width: 240px; height: 240px; background: var(--mint); bottom: 6%; right: -60px; animation-delay: -3s; }
.blob-3 { width: 200px; height: 200px; background: var(--lavender); top: 38%; left: -50px; animation-delay: -6s; }
.blob-4 { width: 160px; height: 160px; background: #FFD9C2; top: 12%; right: 8%; animation-delay: -9s; }
@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -28px) scale(1.08); }
  66% { transform: translate(-16px, 18px) scale(0.95); }
}

/* ---------- 레이아웃 ---------- */
.app {
  position: relative; z-index: 1;
  max-width: 460px; margin: 0 auto;
  min-height: 100dvh;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; /* 콘텐츠를 한 덩어리로 세로 중앙 정렬 → 화면 길이와 무관하게 비율 유지 */
}

.topbar { width: 100%; display: flex; align-items: center; justify-content: space-between; }
.logo {
  font-family: 'Jua', sans-serif;
  font-size: 38px; letter-spacing: -1px;
  color: var(--apricot-deep);
  text-shadow: 2px 3px 0 rgba(255, 181, 158, 0.4);
}
.logo-dot { color: var(--mint-deep); }

.icon-btn {
  width: 44px; height: 44px; border: none; border-radius: 50%;
  background: var(--white); color: var(--ink-soft);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--shadow-soft); transition: transform .15s, color .15s;
}
.icon-btn:active { transform: scale(0.9); }
.icon-btn:hover { color: var(--apricot-deep); }

.tagline {
  font-family: 'Gaegu', sans-serif; font-weight: 700;
  font-size: 21px; margin: 4px 0 14px; text-align: center; line-height: 1.35;
}
.wink { color: var(--apricot-deep); display: inline-block; }

/* ---------- 카테고리 칩 (2줄 줄바꿈, 가운데 정렬) ---------- */
.chips {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  width: 100%; margin-bottom: 22px;
}
.chip {
  flex: 0 0 auto;
  border: 2px solid transparent; border-radius: 999px;
  padding: 8px 14px; font-family: 'Gaegu', sans-serif; font-weight: 700;
  font-size: 15px; color: var(--ink-soft); background: var(--white);
  cursor: pointer; box-shadow: var(--shadow-soft); white-space: nowrap;
  transition: transform .15s, background .2s, color .2s, border-color .2s;
}
.chip:active { transform: scale(0.92); }
.chip.active {
  background: var(--apricot-deep); color: #fff; border-color: #fff;
  box-shadow: 0 8px 18px -6px var(--apricot-deep);
}

/* "전체"는 음식 분류가 아니라 필터 해제 성격 → 라벤더 계열로 차별화 */
/* 다른 칩과 동일하게, 색만 라벤더로 */
.chip-all { color: var(--lavender-deep); border-color: var(--lavender); }
.chip-all.active {
  background: var(--lavender-deep); color: #fff; border-color: #fff;
  box-shadow: 0 8px 18px -6px var(--lavender-deep);
}

/* ---------- 가챠 머신 ---------- */
.machine {
  position: relative; width: 280px; height: 356px;
  margin: 0 auto;
  --mscale: 1;                       /* 화면이 짧으면 미디어쿼리에서 축소값으로 덮어씀 */
  transform: scale(var(--mscale));
}
.machine.shake { animation: shake .45s ease; }
/* 흔들림 중에도 축소(--mscale) 유지 → 흔들 때 크기 튀는 현상 방지 */
@keyframes shake {
  0%, 100% { transform: translateX(0) rotate(0) scale(var(--mscale)); }
  15% { transform: translateX(-6px) rotate(-1.5deg) scale(var(--mscale)); }
  30% { transform: translateX(7px) rotate(1.5deg) scale(var(--mscale)); }
  45% { transform: translateX(-6px) rotate(-1deg) scale(var(--mscale)); }
  60% { transform: translateX(5px) rotate(1deg) scale(var(--mscale)); }
  80% { transform: translateX(-3px) rotate(-0.5deg) scale(var(--mscale)); }
}
.machine-glow {
  position: absolute; inset: 30px 20px; border-radius: 50% 50% 30% 30%;
  background: radial-gradient(circle at 50% 35%, rgba(255,200,170,.6), transparent 65%);
  filter: blur(20px); z-index: 0; animation: glowPulse 3s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100%{opacity:.5;} 50%{opacity:.9;} }

/* 유리 돔 */
.dome {
  position: absolute; top: 0; left: 20px; right: 20px; height: 210px;
  border-radius: 50% 50% 22% 22%;
  background: linear-gradient(160deg, rgba(255,255,255,.7), rgba(255,235,225,.5));
  border: 4px solid #fff;
  box-shadow: inset 0 -10px 24px rgba(255,180,150,.25), var(--shadow);
  overflow: hidden; z-index: 2;
}
.dome-shine {
  position: absolute; top: 14px; left: 26px; width: 70px; height: 110px;
  background: linear-gradient(180deg, rgba(255,255,255,.85), transparent);
  border-radius: 50%; transform: rotate(-18deg); filter: blur(3px);
}
.capsules { position: absolute; inset: 0; }
.cap {
  position: absolute; width: 34px; height: 34px; border-radius: 50%;
  box-shadow: inset -4px -5px 0 rgba(0,0,0,.06), inset 3px 3px 0 rgba(255,255,255,.5);
  animation: jiggle 3s ease-in-out infinite;
}
.cap::after {
  content: ""; position: absolute; top: 6px; left: 8px;
  width: 9px; height: 7px; border-radius: 50%; background: rgba(255,255,255,.7);
}
@keyframes jiggle {
  0%,100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(8deg); }
}
.machine.rumble .cap { animation: rumble .3s ease-in-out infinite; }
@keyframes rumble {
  0%,100% { transform: translate(0,0) rotate(0); }
  25% { transform: translate(-3px,2px) rotate(-10deg); }
  75% { transform: translate(3px,-2px) rotate(10deg); }
}

/* 본체 */
.body {
  position: absolute; top: 188px; left: 6px; right: 6px; height: 166px;
  border-radius: 26px 26px 30px 30px;
  background: linear-gradient(165deg, var(--apricot) 0%, var(--apricot-deep) 100%);
  box-shadow: var(--shadow), inset 0 4px 0 rgba(255,255,255,.4);
  z-index: 1; display: flex; flex-direction: column; align-items: center;
  padding-top: 40px;
}
.body-label {
  font-family: 'Jua', sans-serif; color: #fff; font-size: 14px;
  letter-spacing: 4px; opacity: .9; text-shadow: 1px 1px 0 rgba(0,0,0,.1);
}
.knob {
  position: absolute; top: 64px; left: 50%; transform: translateX(-50%);
  width: 50px; height: 50px; border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff, #FFE2D5 70%);
  box-shadow: var(--shadow-soft), inset 0 -3px 6px rgba(255,160,130,.4);
  display: grid; place-items: center; transition: transform .3s cubic-bezier(.5,1.6,.4,1);
}
.knob-grip {
  width: 8px; height: 30px; border-radius: 6px;
  background: var(--apricot-deep); box-shadow: 0 0 0 8px rgba(255,140,107,.18);
}
.knob.turn { transform: translateX(-50%) rotate(450deg); }
.slot-mouth {
  position: absolute; bottom: 24px; width: 86px; height: 14px; border-radius: 8px;
  background: rgba(120,70,55,.4); box-shadow: inset 0 3px 5px rgba(0,0,0,.25);
}

/* 트레이 + 떨어진 캡슐 */
.tray {
  position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
  width: 110px; height: 30px; border-radius: 0 0 18px 18px;
  z-index: 5; /* 본체(1)·돔(2)보다 앞에서 캡슐이 떨어지도록 */
}
.dropped-capsule {
  position: absolute; left: 50%; top: -150px; transform: translateX(-50%) scale(0);
  width: 70px; height: 70px; opacity: 0;
}
.cap-top, .cap-bottom {
  position: absolute; left: 0; width: 70px; height: 35px; overflow: hidden;
}
.cap-top {
  top: 0; border-radius: 35px 35px 0 0;
  background: linear-gradient(160deg, var(--mint), var(--mint-deep));
  box-shadow: inset 3px 4px 0 rgba(255,255,255,.45);
}
.cap-bottom {
  bottom: 0; border-radius: 0 0 35px 35px;
  background: linear-gradient(160deg, #FFF3CF, #FFD98A);
  box-shadow: inset -3px -4px 0 rgba(0,0,0,.06);
}
.cap-shine {
  position: absolute; top: 9px; left: 14px; width: 16px; height: 12px;
  border-radius: 50%; background: rgba(255,255,255,.75); z-index: 3;
}
.dropped-capsule.drop { animation: dropIn 1.1s cubic-bezier(.5,.05,.5,1.4) forwards; }
@keyframes dropIn {
  0% { top: -150px; opacity: 0; transform: translateX(-50%) scale(.4) rotate(0); }
  30% { opacity: 1; }
  55% { top: -34px; transform: translateX(-50%) scale(1) rotate(220deg); }
  70% { top: -20px; transform: translateX(-50%) scale(1) rotate(360deg); }
  82% { top: -34px; transform: translateX(-58%) scale(1) rotate(370deg); }
  100% { top: -28px; opacity: 1; transform: translateX(-50%) scale(1) rotate(360deg); }
}
.dropped-capsule.open .cap-top { animation: lidOff .5s ease forwards; }
.dropped-capsule.open .cap-bottom { animation: baseDrop .5s ease forwards; }
@keyframes lidOff {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  100% { transform: translateY(-40px) rotate(-40deg) translateX(-30px); opacity: 0; }
}
@keyframes baseDrop {
  0% { transform: translateY(0); opacity: 1; }
  100% { transform: translateY(20px); opacity: 0; }
}

/* ---------- 뽑기 버튼 ---------- */
.pull-btn {
  margin-top: 22px; border: none; cursor: pointer;
  font-family: 'Jua', sans-serif; font-size: 24px; color: #fff;
  padding: 15px 50px; border-radius: 999px;
  background: linear-gradient(135deg, var(--apricot-deep), #FF6F4D);
  box-shadow: 0 12px 24px -8px var(--apricot-deep), inset 0 3px 0 rgba(255,255,255,.35);
  display: flex; align-items: center; gap: 10px;
  transition: transform .15s;
  animation: breathe 2.4s ease-in-out infinite;
}
@keyframes breathe { 0%,100%{transform:scale(1);} 50%{transform:scale(1.04);} }
.pull-btn:active { transform: scale(0.94); }
.pull-btn:disabled { opacity: .55; animation: none; cursor: default; }
.pull-btn-emoji { display: inline-block; animation: bob 1.8s ease-in-out infinite; }
@keyframes bob { 0%,100%{transform:translateY(0) rotate(0);} 50%{transform:translateY(-3px) rotate(-12deg);} }

.hint {
  margin-top: 12px;
  font-family: 'Gaegu', sans-serif; font-weight: 700;
  font-size: 16px; color: var(--ink-soft); text-align: center;
}

/* ---------- 결과 모달 ---------- */
.modal-overlay, .drawer-overlay {
  position: fixed; inset: 0; z-index: 30;
  background: rgba(91, 74, 72, 0.32); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: opacity .3s, visibility .3s;
}
.modal-overlay.show, .drawer-overlay.show { opacity: 1; visibility: visible; }

.result-card {
  position: relative; width: min(340px, 86vw);
  background: var(--white); border-radius: var(--r-lg);
  padding: 40px 28px 28px; text-align: center;
  box-shadow: var(--shadow); transform: scale(.7) translateY(20px);
  transition: transform .4s cubic-bezier(.34,1.56,.64,1);
  border: 4px solid #fff;
}
.modal-overlay.show .result-card { transform: scale(1) translateY(0); }
.result-ribbon {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%);
  background: var(--mint-deep); color: #fff; font-family: 'Jua', sans-serif;
  font-size: 15px; padding: 7px 22px; border-radius: 999px;
  box-shadow: 0 6px 14px -6px var(--mint-deep); white-space: nowrap;
}
.result-emoji {
  font-size: 84px; line-height: 1; margin: 6px 0 4px;
  animation: pop 0.6s cubic-bezier(.34,1.56,.64,1) both, sway 3s ease-in-out 0.6s infinite;
}
@keyframes pop { 0%{transform:scale(0) rotate(-30deg);} 100%{transform:scale(1) rotate(0);} }
@keyframes sway { 0%,100%{transform:rotate(-5deg);} 50%{transform:rotate(5deg);} }
.result-cat {
  display: inline-block; font-family: 'Gaegu', sans-serif; font-weight: 700;
  font-size: 14px; color: var(--apricot-deep); background: var(--cream-2);
  padding: 4px 14px; border-radius: 999px; margin-bottom: 6px;
}
.result-name {
  font-family: 'Jua', sans-serif; font-size: 32px; color: var(--ink);
  margin-bottom: 4px; word-break: keep-all;
}
.result-sub { font-family: 'Gaegu', sans-serif; font-weight: 700; color: var(--ink-soft); font-size: 17px; margin-bottom: 22px; }
.result-actions { display: flex; flex-direction: column; gap: 10px; }
.btn-story, .btn-find, .btn-again {
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 18px;
  padding: 14px; border-radius: var(--r-md); border: none; cursor: pointer;
  text-decoration: none; transition: transform .15s; text-align: center;
}
.btn-story {
  color: #fff;
  background: linear-gradient(105deg, #FEDA77 0%, #F58529 22%, #DD2A7B 58%, #8134AF 100%);
  box-shadow: 0 8px 18px -7px rgba(221, 42, 123, .6);
}
.btn-story:disabled { opacity: .7; cursor: default; }
.btn-find { background: var(--mint-deep); color: #fff; box-shadow: 0 8px 16px -6px var(--mint-deep); }
.btn-again { background: var(--cream-2); color: var(--apricot-deep); }
.btn-story:active, .btn-find:active, .btn-again:active { transform: scale(0.95); }
.result-close {
  position: absolute; top: 14px; right: 16px; border: none; background: none;
  font-size: 18px; color: var(--ink-soft); cursor: pointer;
}

/* ---------- 메뉴 관리 드로어 ---------- */
.drawer-overlay { justify-content: flex-end; }
.drawer {
  width: min(380px, 90vw); height: 100%; background: var(--cream);
  padding: 22px; overflow-y: auto;
  transform: translateX(100%); transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: -10px 0 30px -10px rgba(199,122,96,.4);
}
.drawer-overlay.show .drawer { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.drawer-head h2 { font-family: 'Jua', sans-serif; font-size: 24px; color: var(--apricot-deep); }

/* 탭 */
.drawer-tabs { display: flex; gap: 8px; margin-bottom: 18px; }
.dtab {
  flex: 1; padding: 11px; border-radius: var(--r-sm); cursor: pointer;
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 17px;
  color: var(--ink-soft); background: var(--white);
  border: 2px solid var(--cream-2); transition: background .2s, color .2s, border-color .2s, transform .15s;
}
.dtab:active { transform: scale(0.96); }
.dtab.active { background: var(--apricot-deep); color: #fff; border-color: #fff; box-shadow: 0 8px 16px -8px var(--apricot-deep); }
.tab-panel[hidden] { display: none; }

/* 카테고리 관리 */
.add-btn-inline {
  flex: 0 0 auto; width: 52px;
  font-family: 'Jua', sans-serif; font-size: 24px; line-height: 1;
  background: var(--apricot-deep); color: #fff; border: none;
  border-radius: var(--r-sm); cursor: pointer; transition: transform .15s;
}
.add-btn-inline:active { transform: scale(0.92); }
.cat-list { display: flex; flex-direction: column; gap: 8px; }
.cat-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--white); border-radius: var(--r-sm); padding: 10px 12px;
  box-shadow: var(--shadow-soft); animation: itemIn .3s ease both;
}
.cat-item-name { flex: 1; font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 18px; }
.edit-btn {
  border: none; background: none; font-size: 16px; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; transition: background .2s, transform .15s;
}
.edit-btn:hover { background: var(--cream-2); }
.edit-btn:active { transform: scale(0.85); }

/* 초기화 (드로어 하단 · 낮은 강조) */
.drawer-foot { margin-top: 24px; padding-top: 16px; border-top: 2px dashed var(--cream-2); }
.reset-btn {
  width: 100%; padding: 12px; border-radius: var(--r-sm); cursor: pointer;
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 16px;
  color: var(--ink-soft); background: transparent; border: 2px solid var(--cream-2);
  transition: color .2s, border-color .2s, background .2s, transform .15s;
}
.reset-btn:hover { color: #E07A5F; border-color: #F3C4B8; background: #FFF3EF; }
.reset-btn:active { transform: scale(0.97); }

.add-form {
  background: var(--white); border-radius: var(--r-md); padding: 14px;
  box-shadow: var(--shadow-soft); margin-bottom: 20px;
}
.add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.add-row:last-child { margin-bottom: 0; }
.name-input, .cat-select {
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 18px; color: var(--ink);
  border: 2px solid var(--cream-2); border-radius: var(--r-sm);
  padding: 9px 12px; outline: none; transition: border-color .2s; background: #fff;
  min-width: 0; max-width: 100%;
}
.name-input { flex: 1 1 auto; }
.cat-select { flex: 1 1 auto; }
.name-input::placeholder { color: #C9B8B2; font-weight: 700; }
.name-input:focus, .cat-select:focus { border-color: var(--apricot); }

/* 이모지 피커 (접기/펼치기) */
.emoji-toggle {
  display: flex; align-items: center; gap: 7px; flex: 0 0 auto;
  padding: 9px 14px; cursor: pointer;
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 17px; color: var(--ink);
  background: #fff; border: 2px solid var(--cream-2); border-radius: var(--r-sm);
  transition: border-color .2s;
}
.emoji-toggle:active { border-color: var(--apricot); }
.emoji-toggle-current { font-size: 22px; line-height: 1; }
.emoji-toggle-arrow {
  color: var(--ink-soft); font-size: 13px;
  transition: transform .25s ease;
}
.emoji-toggle[aria-expanded="true"] .emoji-toggle-arrow { transform: rotate(180deg); }

.emoji-picker {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  max-height: 0; overflow: hidden; opacity: 0; padding: 0 10px;
  background: var(--cream); border-radius: var(--r-sm);
  transition: max-height .3s ease, opacity .25s ease, margin-top .3s ease, padding .3s ease;
}
.emoji-picker.open {
  max-height: 320px; opacity: 1; margin-top: 8px; padding: 10px;
}
.emoji-chip {
  width: 100%; aspect-ratio: 1; border: 2px solid transparent;
  border-radius: 12px; background: #fff; font-size: 21px; line-height: 1;
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: transform .12s, background .2s, border-color .2s;
}
.emoji-chip:active { transform: scale(0.88); }
.emoji-chip.selected {
  background: #fff; border-color: var(--apricot-deep);
  box-shadow: 0 4px 10px -4px var(--apricot-deep); transform: scale(1.08);
}
.add-btn {
  width: 100%; margin-top: 10px;
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 18px;
  background: var(--apricot-deep); color: #fff; border: none;
  border-radius: var(--r-sm); padding: 12px; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 16px -8px var(--apricot-deep); transition: transform .15s;
}
.add-btn:active { transform: scale(0.94); }

.menu-list { display: flex; flex-direction: column; gap: 8px; }
.menu-cat-title {
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 15px;
  color: var(--ink-soft); margin: 14px 0 2px 4px;
}
.menu-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--white); border-radius: var(--r-sm); padding: 10px 12px;
  box-shadow: var(--shadow-soft); animation: itemIn .3s ease both;
}
@keyframes itemIn { from{opacity:0; transform:translateY(8px);} to{opacity:1; transform:translateY(0);} }
.menu-item-emoji { font-size: 24px; }
.menu-item-name { flex: 1; font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 18px; }
.menu-item .badge {
  font-family: 'Gaegu', sans-serif; font-weight: 700; font-size: 12px;
  color: var(--mint-deep); background: #E9F7F1; padding: 3px 9px; border-radius: 999px;
}
.del-btn {
  border: none; background: none; font-size: 18px; color: #E89B8A; cursor: pointer;
  width: 30px; height: 30px; border-radius: 50%; transition: background .2s, transform .15s;
}
.del-btn:hover { background: #FFE5DE; }
.del-btn:active { transform: scale(0.85); }
.empty-note { text-align: center; font-family: 'Gaegu', sans-serif; font-weight: 700; color: var(--ink-soft); font-size: 16px; padding: 20px; }

/* ---------- 꽃가루 ---------- */
.confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; }

@media (max-width: 360px) {
  .drawer { width: 100vw; padding: 18px 16px; }
  .add-form { padding: 12px; }
  .add-row { gap: 6px; }
}
/* 세로가 짧아 중앙 정렬 시 잘릴 수 있는 화면: 위 정렬 + 머신 축소 */
@media (max-height: 680px) {
  .app { justify-content: flex-start; }
  /* 위 기준으로 축소하므로 위 간격은 유지, 줄어든 공간은 아래에서만 회수 */
  .machine { --mscale: 0.84; transform-origin: center top; margin: 0 auto -56px; }
  .tagline { font-size: 19px; margin: 2px 0 8px; }
  .pull-btn { padding: 12px 44px; font-size: 22px; }
}
/* ---------- PC / 태블릿: 콘텐츠를 감싼 글래스 카드를 상단 바이어스로 ---------- */
@media (min-width: 600px) {
  /* 가로 중앙 + 세로는 위쪽으로 살짝(상단 바이어스). 여백은 화면 높이에 비례 */
  body { display: flex; align-items: flex-start; justify-content: center;
         padding: clamp(28px, 7vh, 80px) 24px 40px; }
  .app {
    min-height: 0;          /* 화면 전체 높이를 강제하지 않고 콘텐츠에 맞춰 카드가 잡힘 */
    justify-content: flex-start;
    max-width: 410px; width: 100%;
    padding: 34px 30px 38px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border: 1.5px solid rgba(255, 255, 255, 0.75);
    border-radius: 44px;
    box-shadow: 0 30px 80px -34px rgba(199, 122, 96, 0.5);
  }
  /* 메뉴 관리 드로어도 카드 폭에 맞춰 단정하게 */
  .drawer { border-radius: 28px 0 0 28px; }
  /* 결과 모달도 카드처럼 위쪽으로 살짝 올려 배치 */
  .modal-overlay { align-items: flex-start; padding: clamp(40px, 11vh, 120px) 24px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; }
}
