/* 손님용 K11 태블릿 — 가로모드 기준 */
body { overflow: hidden; }

#app {
  position: relative;
  height: 100dvh;
  /* 첫 화면은 사라질 때 살짝 커진다(scale). 그 몇 픽셀이 화면 밖으로 삐져나가
     안드로이드에서 가로로 튕기는 일이 없도록 여기서 잘라 둔다.
     장바구니로 날아가는 잔상은 body 에 붙으므로 잘리지 않는다. */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--white);
}

/* ══════════ 시작 화면 ══════════
   손님이 자리에 앉아 처음 보는 화면이다. 팔 길이만큼 떨어져 있으므로
   '무엇을 눌러야 하는지'가 한눈에 들어와야 한다 — 그래서 주문 버튼이 가장 크다.
   테이블 번호는 확인용이지 할 일이 아니라서 구석 배지로 뺐다.
   간판과 벽돌은 매장 실물 간판에서 그대로 가져왔다. */
#screen-start {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--cream);
  overflow: hidden;
  cursor: pointer;
  transition: opacity .34s ease, transform .34s cubic-bezier(.4, 0, .2, 1);
}
#screen-start.hide {
  opacity: 0;
  transform: scale(1.03);
  pointer-events: none;
  visibility: hidden;
  transition: opacity .34s ease, transform .34s cubic-bezier(.4, 0, .2, 1), visibility 0s linear .34s;
}

/* 아래쪽 벽돌 — 1536x218 그림의 비율을 그대로 지켜야 벽돌이 찌그러지지 않는다 */
#screen-start::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(100vw * 218 / 1536);
  background: url('/img/bricks.png') center bottom / 100% 100% no-repeat;
  pointer-events: none;
}
@keyframes brickUp { from { transform: translateY(40%) } to { transform: none } }

.start-table {
  position: absolute;
  top: clamp(18px, 3vh, 34px);
  right: clamp(18px, 2.6vw, 40px);
  z-index: 2;
  background: var(--orange);
  color: #fff;
  font-size: clamp(20px, 2.4vw, 33px);
  font-weight: 800;
  letter-spacing: -.5px;
  padding: clamp(8px, 1.2vh, 14px) clamp(16px, 1.8vw, 26px);
  border-radius: 16px;
}
.start-table b { font-size: 1.5em; font-weight: 900; margin-right: 2px; }
@keyframes fadeDown { from { opacity: 0; transform: translateY(-12px) } to { opacity: 1; transform: none } }

.start-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(10px, 1.6vh, 22px);
  padding-bottom: calc(100vw * 218 / 1536 * .55);   /* 벽돌 위로 띄운다 */
}

.start-sign {
  width: clamp(320px, 47vw, 640px);
  height: auto;
}
@keyframes signIn { from { opacity: 0; transform: translateY(-14px) scale(.965) } to { opacity: 1; transform: none } }

.start-tag {
  margin: 0;
  font-size: clamp(18px, 2.3vw, 31px);
  font-weight: 800;
  letter-spacing: -.8px;
  color: var(--ink);
}
.start-tag b { color: var(--orange); font-weight: 900; }

/* 주문 버튼 — 간판과 같이 아래로 두께가 있는 형태.
   누르면 그 두께만큼 실제로 내려앉아 눌린 느낌이 난다. */
.start-cta {
  width: clamp(440px, 62vw, 800px);
  margin-top: clamp(6px, 1.4vh, 18px);
  padding: clamp(24px, 4.4vh, 48px) clamp(24px, 3vw, 46px) clamp(18px, 3.2vh, 36px);
  background: var(--yellow);
  border-radius: clamp(16px, 1.8vw, 26px);
  box-shadow: 0 clamp(7px, 1vh, 11px) 0 var(--yellow-dk);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: transform .12s ease, box-shadow .12s ease;
}
@keyframes ctaIn { from { opacity: 0; transform: translateY(20px) scale(.97) } to { opacity: 1; transform: none } }
.start-cta:active {
  transform: translateY(clamp(7px, 1vh, 11px));
  box-shadow: 0 0 0 var(--yellow-dk);
}
.cta-row {
  display: flex;
  align-items: center;
  gap: clamp(24px, 5vw, 76px);
  font-size: clamp(38px, 5.4vw, 76px);
  font-weight: 900;
  letter-spacing: -3px;
  line-height: 1.1;
  color: var(--black);
}
.cta-arrow {
  width: clamp(30px, 4vw, 58px); height: clamp(30px, 4vw, 58px);
  fill: none; stroke: var(--orange); stroke-width: 3.8;
  stroke-linecap: round; stroke-linejoin: round;
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge { 0%, 62%, 100% { transform: none } 74% { transform: translateX(7px) } 86% { transform: translateX(0) } }
.cta-sub {
  font-size: clamp(13px, 1.5vw, 20px);
  font-weight: 700;
  color: #6b5f00;
  letter-spacing: -.3px;
}

.start-call {
  margin-top: clamp(4px, 1vh, 14px);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: clamp(13px, 2.1vh, 22px) clamp(38px, 6vw, 92px);
  border: 2.5px solid var(--orange);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: clamp(17px, 2.1vw, 28px);
  font-weight: 800;
  letter-spacing: -.5px;
  transition: background .14s ease, transform .14s ease;
}
.start-call:active { background: #fdefdc; transform: scale(.97); }
.start-call .bell { width: clamp(21px, 2.4vw, 31px); height: clamp(21px, 2.4vw, 31px); }
.start-call .bell .f { fill: var(--orange); }
.start-call .bell .s { fill: none; stroke: var(--orange); stroke-width: 2.1; stroke-linecap: round; }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

#screen-start.play::after { animation: brickUp 700ms cubic-bezier(.16, 1, .3, 1) both; }
#screen-start.play .start-table { animation: fadeDown 520ms cubic-bezier(.16, 1, .3, 1) both; }
#screen-start.play .start-sign { animation: signIn 640ms cubic-bezier(.16, 1, .3, 1) both; }
#screen-start.play .start-tag { animation: riseIn 620ms cubic-bezier(.16, 1, .3, 1) both; animation-delay: 130ms; }
#screen-start.play .start-cta { animation: ctaIn 640ms cubic-bezier(.16, 1, .3, 1) both; animation-delay: 240ms; }
#screen-start.play .start-call { animation: riseIn 600ms cubic-bezier(.16, 1, .3, 1) both; animation-delay: 360ms; }

/* ── 첫 화면 효과 ──
   태블릿은 몇 시간이고 이 화면을 켜 둔 채 손님을 기다린다.
   가만히 멈춰 있으면 꺼진 화면처럼 보이고, 크게 움직이면 싸구려로 보인다.
   그래서 '천천히 한 번 지나가는 빛' 하나만 둔다.

   눌렀을 때의 반응은 장식이 아니다. 태블릿은 손가락이 닿고 화면이 바뀌기까지
   0.3초가 걸리는데, 그 사이 아무 일도 없으면 손님이 한 번 더 누른다. */

/* 주문 버튼 위를 지나가는 빛 */
.start-cta { position: relative; overflow: hidden; }
.start-cta::before {
  content: '';
  position: absolute;
  top: -60%; bottom: -60%; left: -40%;
  width: 26%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .62), transparent);
  transform: translateX(-220%) rotate(8deg);
  pointer-events: none;
}
#screen-start.play .start-cta::before { animation: sheen 5.6s ease-in-out 1.6s infinite; }
@keyframes sheen {
  0%   { transform: translateX(-220%) rotate(8deg); }
  22%  { transform: translateX(560%)  rotate(8deg); }
  100% { transform: translateX(560%)  rotate(8deg); }
}
.start-cta > * { position: relative; z-index: 1; }

/* 손가락이 닿은 자리에서 번지는 파문 — 화면이 바뀌기 전에 먼저 반응한다 */
.tap-ripple {
  position: absolute;
  z-index: 2;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  border-radius: 50%;
  /* 가운데가 진하고 가장자리가 옅어야 손가락이 닿은 지점이 읽힌다 */
  background: radial-gradient(circle, rgba(240, 90, 40, .34) 52%, rgba(240, 90, 40, .12) 100%);
  pointer-events: none;
  animation: ripple 680ms cubic-bezier(.22, .9, .3, 1) forwards;
}
@keyframes ripple {
  from { transform: scale(.3); opacity: 1; }
  to   { transform: scale(11); opacity: 0; }
}

/* 넘어갈 때 — 화면이 위로 살짝 빠지면서 메뉴가 드러난다 */
.start-stage { transition: transform .34s cubic-bezier(.4, 0, .2, 1); }
#screen-start.hide .start-stage { transform: translateY(-18px); }

/* 숨은 동안에는 애니메이션을 멈춘다. 태블릿을 하루 종일 켜 두는 화면이다. */
#screen-start.hide *, #screen-start.hide::after { animation-play-state: paused !important; }

/* 흔들림에 예민한 손님을 위한 설정 — 안드로이드 설정의 '애니메이션 제거' 를 따른다 */
@media (prefers-reduced-motion: reduce) {
  #screen-start *, #screen-start::after { animation: none !important; transition: none !important; }
  .tap-ripple { display: none; }
}

/* ══════════ 상단바 — 간판 + 벽돌 띠 ══════════
   첫 화면(크림 + 벽돌 + 노란 버튼)과 같은 옷을 입혀야 메뉴로 넘어와도
   같은 가게에 있다는 느낌이 이어진다. 예전 흰 상단바는 어느 가게나 똑같았다. */
.topbar {
  flex: none;
  height: clamp(72px, 11.5vh, 108px);
  display: flex;
  align-items: stretch;
  background: var(--cream);
  padding-left: clamp(10px, 1.4vw, 20px);
}
/* 간판을 누르면 처음 화면으로. 손님이 메뉴를 헤매다 처음으로 돌아가는 길이
   없으면 직원을 부른다. 로고는 어느 앱에서나 '홈' 이라 따로 배울 것도 없다. */
.tb-home {
  height: 100%;
  display: flex;
  align-items: center;
  gap: clamp(6px, .8vw, 12px);
  padding: 0 clamp(8px, 1vw, 14px) 0 0;
  border-radius: var(--r-md);
  transition: transform .13s ease, background .13s ease;
}
.tb-home:active { transform: scale(.96); background: rgba(0, 0, 0, .05); }
.tb-sign { height: 100%; width: auto; object-fit: contain; padding: 6px 0; }

/* '처음으로' 를 글자로 붙여 둔다.
   로고를 누르면 홈이라는 건 앱을 자주 쓰는 사람에게만 당연하다.
   손님은 이 태블릿을 처음 만지므로, 눌렀을 때만 보이는 안내는 없는 것과 같다. */
.tb-home-hint {
  flex: none;
  display: flex; align-items: center; gap: 5px;
  padding: clamp(4px, .7vh, 7px) clamp(8px, 1vw, 13px);
  border-radius: 999px;
  background: var(--black);
  color: #fff;
  font-size: clamp(11px, 1.15vw, 14px);
  font-weight: 800;
  letter-spacing: -.3px;
  white-space: nowrap;
}
.tb-home-hint svg {
  width: 1.15em; height: 1.15em;
  fill: none; stroke: var(--yellow); stroke-width: 2.2;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 벽돌은 그림 파일 대신 패턴으로 그린다 — 폭이 얼마든 이음매가 없고 늘 또렷하다 */
.tb-brick {
  flex: 1;
  margin-left: clamp(10px, 1.4vw, 22px);
  /* 타일 하나가 두 단이다. 높이를 100% 로 두면 상단바가 얼마나 높든 두 단이 딱 맞는다 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%2780%27 height=%2760%27%3E%3Crect width=%2780%27 height=%2760%27 fill=%27%23f2ede1%27/%3E%3Cg fill=%27%23d8401b%27%3E%3Crect y=%272%27 width=%2778%27 height=%2726%27 rx=%272%27/%3E%3Crect x=%27-39%27 y=%2732%27 width=%2778%27 height=%2726%27 rx=%272%27/%3E%3Crect x=%2741%27 y=%2732%27 width=%2778%27 height=%2726%27 rx=%272%27/%3E%3C/g%3E%3C/svg%3E");
  background-size: auto 100%;
  background-position: left top;
}

/* ══════════ 본문: 카테고리 레일 + 메뉴 ══════════ */
.body { flex: 1; display: flex; min-height: 0; background: var(--cream); gap: clamp(8px, 1vw, 18px); padding: clamp(8px, 1.2vh, 16px) clamp(10px, 1.4vw, 20px) 0; }

.catrail {
  flex: none;
  justify-content: flex-start;
  width: clamp(150px, 15vw, 214px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}
.catlist {
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border: 1.5px solid #eae3d2;
  border-radius: var(--r-lg);
  padding: 8px;
}
.catlist button {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: clamp(9px, 1.5vh, 15px) 13px;
  border-radius: var(--r-md);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 800;
  letter-spacing: -.5px;
  color: var(--ink-2);
  text-align: left;
  transition: background .14s ease, color .14s ease;
}
/* 줄 사이 구분선 — 마지막 줄과 눌린 줄에는 긋지 않는다 */
.catlist button + button { box-shadow: inset 0 1px 0 #f0ece2; }
.catlist button .ic { font-size: clamp(19px, 1.9vw, 25px); flex: none; line-height: 1; }
.catlist button.on {
  background: var(--yellow);
  color: var(--black);
  box-shadow: none;
}
.catlist button.on + button { box-shadow: none; }
.catlist button:active { background: #fdf4d6; }

.railcall {
  flex: none;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: clamp(11px, 1.8vh, 17px) 10px;
  border: 2.5px solid var(--orange);
  border-radius: var(--r-lg);
  background: var(--white);
  font-size: clamp(15px, 1.5vw, 20px);
  font-weight: 800;
  letter-spacing: -.5px;
  transition: background .14s ease, transform .14s ease;
}
.railcall:active { background: #fdefdc; transform: scale(.97); }
.railcall .bell { width: 1.25em; height: 1.25em; flex: none; }
.railcall .bell .f { fill: var(--orange); }
.railcall .bell .s { fill: none; stroke: var(--orange); stroke-width: 2.1; stroke-linecap: round; }

.grid-wrap { flex: 1; min-width: 0; overflow-y: auto; overscroll-behavior: contain; }

.cat-head {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  padding: clamp(4px, 1vh, 12px) clamp(4px, .6vw, 10px) clamp(8px, 1.4vh, 16px);
}
.cat-head .ch-tx { flex: 1; min-width: 0; }
.cat-head h1 {
  margin: 0;
  font-size: clamp(21px, 2.3vw, 32px);
  font-weight: 900;
  letter-spacing: -1px;
}
.cat-head p {
  margin: 3px 0 0;
  font-size: clamp(12px, 1.2vw, 16px);
  font-weight: 600;
  color: var(--ink-3);
}
.ch-table {
  flex: none;
  font-size: clamp(12px, 1.2vw, 15px);
  font-weight: 800;
  letter-spacing: .5px;
  color: var(--ink-3);
  padding-bottom: 4px;
}
.ch-mine {
  flex: none;
  display: flex; align-items: center; gap: 8px;
  padding: clamp(8px, 1.3vh, 13px) clamp(13px, 1.4vw, 20px);
  border: 1.5px solid #e2dac6;
  border-radius: var(--r-md);
  background: var(--white);
  font-size: clamp(13px, 1.3vw, 17px);
  font-weight: 800;
  letter-spacing: -.4px;
}
.ch-mine svg { width: 1.15em; height: 1.15em; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linejoin: round; }
.ch-mine b { color: var(--orange); }
.ch-mine:active { background: #f7f3e8; }
/* display 를 준 요소는 hidden 속성이 안 먹는다. 첫 주문 전에는 숨겨야 한다. */
.ch-mine[hidden] { display: none; }

/* 카드 — 사진을 안쪽으로 넣고 이름·가격을 가운데로.
   손님이 훑을 때 가장 먼저 보는 것은 사진, 그다음이 가격이라 가격만 색을 준다. */
.grid {
  padding: 0 clamp(4px, .6vw, 10px) clamp(16px, 2.4vh, 28px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(198px, 1fr));
  gap: clamp(10px, 1.2vw, 18px);
}

.card {
  position: relative;
  background: var(--white);
  border: 1.5px solid #eae3d2;
  border-radius: var(--r-lg);
  padding: clamp(8px, .9vw, 12px);
  overflow: hidden;
  text-align: center;
  display: flex;
  flex-direction: column;
  transition: transform .13s ease, box-shadow .13s ease, border-color .13s ease;
}
.card:active { transform: scale(.975); border-color: var(--yellow-dk); }
.card .thumb, .card .thumb-ph {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  background: #faf7f0;
}
.card .thumb { object-fit: cover; }
.card .thumb-ph {
  background: linear-gradient(180deg, #fff8dd, #fdefc4);
  display: flex; align-items: center; justify-content: center;
  font-size: clamp(38px, 4vw, 56px);
}
.card .info { flex: 1; display: flex; flex-direction: column; padding: clamp(9px, 1.2vh, 14px) 4px clamp(4px, .6vh, 7px); }
/* 메뉴명은 2줄까지만. 카드 높이가 들쭉날쭉해지지 않게 최소 높이도 잡는다. */
.card .name {
  font-size: clamp(14px, 1.4vw, 19px);
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: -.5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .price {
  margin-top: auto;
  padding-top: 7px;
  font-size: clamp(15px, 1.55vw, 21px);
  font-weight: 900;
  letter-spacing: -.5px;
  color: var(--red);
}
.card .opt-hint {
  margin-top: 4px;
  font-size: clamp(11px, 1.05vw, 13px);
  color: var(--ink-3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tag-best {
  position: absolute; top: clamp(14px, 1.6vw, 20px); left: clamp(14px, 1.6vw, 20px);
  background: var(--yellow); color: var(--black);
  font-size: clamp(10px, 1vw, 12px); font-weight: 900;
  padding: 4px 9px; border-radius: 999px;
  letter-spacing: .5px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .16);
}

/* ══════════ 하단 장바구니 요약 ══════════
   노랑으로 띠 전체를 칠하면 정작 눌러야 할 버튼이 배경에 묻힌다.
   띠는 크림으로 두고 노랑은 버튼 하나에만 쓴다. */
.cartbar {
  flex: none;
  height: clamp(70px, 10vh, 100px);
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 20px);
  padding: 0 clamp(12px, 1.6vw, 24px);
  background: var(--cream);
  border-top: 1.5px solid #eae3d2;
}
.cb-ic { position: relative; flex: none; display: flex; }
.cb-ic svg {
  width: clamp(28px, 2.8vw, 38px); height: clamp(28px, 2.8vw, 38px);
  fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round;
}
.cartbar .txt { font-size: clamp(14px, 1.5vw, 20px); font-weight: 800; letter-spacing: -.5px; }
.cartbar .sum {
  flex: 1; text-align: right;
  font-size: clamp(20px, 2.3vw, 32px); font-weight: 900;
  letter-spacing: -1.2px; color: var(--red);
}
.btn-cartgo {
  flex: none;
  display: flex; align-items: center; gap: clamp(8px, 1vw, 16px);
  padding: clamp(12px, 1.9vh, 20px) clamp(18px, 2.2vw, 34px);
  background: var(--yellow);
  border-radius: var(--r-md);
  box-shadow: 0 clamp(4px, .6vh, 7px) 0 var(--yellow-dk);
  font-size: clamp(15px, 1.7vw, 23px);
  font-weight: 900;
  letter-spacing: -.8px;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-cartgo:active { transform: translateY(clamp(4px, .6vh, 7px)); box-shadow: 0 0 0 var(--yellow-dk); }
.btn-cartgo svg { width: 1em; height: 1em; fill: none; stroke: var(--orange); stroke-width: 3.4; stroke-linecap: round; stroke-linejoin: round; }

.badge {
  position: absolute;
  top: -6px; right: -8px;
  min-width: 22px; height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--red);
  color: var(--white);
  font-size: 12px; font-weight: 900;
  display: none; align-items: center; justify-content: center;
  border: 2px solid var(--cream);
}
.badge.on { display: flex; }


/* ── 처음 화면으로 돌아가기 전 안내 ──
   말없이 화면이 바뀌면 손님은 자기가 뭘 잘못 눌렀다고 생각한다.
   먼저 알려 주고, 화면을 누르면 없던 일이 된다. */
.idlebar {
  position: fixed;
  left: 50%;
  bottom: clamp(88px, 13vh, 128px);
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: clamp(12px, 1.8vh, 18px) clamp(22px, 3vw, 40px) clamp(10px, 1.4vh, 14px);
  background: var(--white);
  border: 2px solid var(--orange);
  border-radius: var(--r-lg);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16);
  animation: idleIn .28s cubic-bezier(.16, 1, .3, 1) both;
}
.idlebar[hidden] { display: none; }
@keyframes idleIn { from { opacity: 0; transform: translate(-50%, 14px) } to { opacity: 1; transform: translate(-50%, 0) } }
.idlebar .tx { font-size: clamp(15px, 1.6vw, 21px); font-weight: 900; letter-spacing: -.6px; }
.idlebar .sub { font-size: clamp(12px, 1.2vw, 15px); font-weight: 600; color: var(--ink-3); }
.idlebar .bar {
  margin-top: 8px;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: #f1ece0;
  overflow: hidden;
}
/* 남은 시간이 눈에 보여야 '누르면 되는구나' 가 전달된다 */
.idlebar .bar i { display: block; height: 100%; width: 100%; background: var(--orange); transform-origin: left; }
.idlebar.run .bar i { animation: idleDrain linear forwards; }
@keyframes idleDrain { from { transform: scaleX(1) } to { transform: scaleX(0) } }


/* ── 최종 주문 확인 · 주문 처리 중 ──
   주문은 되돌릴 수 없고, 전송에 몇 초가 걸릴 수 있다.
   확인 없이 보내면 잘못 눌러 놓고 직원을 부르게 되고,
   전송 중에 화면이 그대로면 손님이 한 번 더 누른다(중복 주문). */
.panel-ask, .panel-sending {
  width: min(92vw, 480px);
  max-height: 88vh;
  padding: clamp(24px, 4vh, 38px) clamp(20px, 3vw, 34px) clamp(18px, 2.6vh, 26px);
  background: var(--cream);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.panel-ask h2, .panel-sending h2 {
  margin: 0;
  font-size: clamp(19px, 2.2vw, 26px);
  font-weight: 900;
  letter-spacing: -1px;
}
.ask-ic, .send-ic {
  width: clamp(52px, 6vw, 68px); height: clamp(52px, 6vw, 68px);
  margin-bottom: clamp(12px, 1.8vh, 18px);
  border-radius: 50%;
  background: #fdeadd;
  display: grid; place-items: center;
}
.ask-ic svg, .send-ic svg {
  width: 52%; height: 52%;
  fill: none; stroke: var(--orange); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.ask-list {
  width: 100%;
  margin-top: clamp(14px, 2vh, 20px);
  padding: clamp(10px, 1.4vh, 14px) clamp(12px, 1.6vw, 18px);
  background: var(--white);
  border: 1.5px solid #eae3d2;
  border-radius: var(--r-md);
  overflow-y: auto;
  text-align: left;
}
.ask-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; }
.ask-row + .ask-row { border-top: 1px solid #f3efe4; }
.ask-row .nm {
  flex: 1; min-width: 0;
  font-size: clamp(14px, 1.4vw, 17px); font-weight: 800; letter-spacing: -.4px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ask-row .op { font-size: clamp(11px, 1.1vw, 13px); font-weight: 600; color: var(--ink-3); }
.ask-row .pr { flex: none; font-size: clamp(14px, 1.4vw, 17px); font-weight: 800; }

.ask-total {
  width: 100%;
  margin-top: clamp(10px, 1.4vh, 14px);
  padding: clamp(11px, 1.5vh, 15px) clamp(12px, 1.6vw, 18px);
  background: var(--white);
  border: 1.5px solid #eae3d2;
  border-radius: var(--r-md);
  display: flex; align-items: center; gap: 10px;
}
.ask-total .lb { font-size: clamp(14px, 1.4vw, 18px); font-weight: 800; }
.ask-total .vl {
  flex: 1; text-align: right;
  font-size: clamp(20px, 2.3vw, 29px); font-weight: 900;
  letter-spacing: -1.2px; color: var(--red);
}
.ask-foot { width: 100%; margin-top: clamp(14px, 2vh, 20px); display: flex; gap: 10px; }
.ask-foot .btn { flex: 1; }

/* 전송 중 — 장바구니가 살짝 흔들리고 점 세 개가 차례로 튄다 */
.panel-sending { padding-bottom: clamp(28px, 4vh, 40px); }
.panel-sending .send-ic { animation: sendNudge 1.5s ease-in-out infinite; }
@keyframes sendNudge { 0%, 100% { transform: translateX(0) } 50% { transform: translateX(5px) } }
.send-dots { display: flex; gap: 7px; margin: 4px 0 clamp(12px, 1.8vh, 18px); }
.send-dots i {
  width: 8px; height: 8px; border-radius: 50%; background: var(--orange);
  animation: sendDot 1.1s ease-in-out infinite;
}
.send-dots i:nth-child(2) { animation-delay: .16s; }
.send-dots i:nth-child(3) { animation-delay: .32s; }
@keyframes sendDot { 0%, 70%, 100% { opacity: .25; transform: translateY(0) } 35% { opacity: 1; transform: translateY(-6px) } }
.panel-sending p {
  margin: 6px 0 0;
  font-size: clamp(13px, 1.3vw, 16px); font-weight: 600; color: var(--ink-3);
}

/* ══════════ 모달 공통 ══════════ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 26px;
}
.modal.on { display: flex; }
.panel {
  background: var(--white);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  width: min(880px, 100%);
  max-height: 92dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 21px; font-weight: 900; flex: 1; }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.panel-foot {
  flex: none;
  display: flex;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid var(--line);
}
.panel-foot .btn { flex: 1; }
.close-x { font-size: 26px; width: 44px; height: 44px; border-radius: var(--r-sm); }

/* ══════════ 메뉴 상세 모달 ══════════ */
.d-hero { display: flex; gap: 22px; padding: 22px; }
.d-hero .pic, .d-hero .pic-ph {
  width: 260px; flex: none;
  aspect-ratio: 1 / 1;
  border-radius: var(--r-md);
  object-fit: cover;
  background: #f7f7f7;
}
.d-hero .pic-ph {
  display: flex; align-items: center; justify-content: center; font-size: 82px;
  background: linear-gradient(180deg, #fff8dd, #fdefc4);
}
.d-hero h3 { margin: 4px 0 0; font-size: 28px; font-weight: 900; line-height: 1.25; }
.d-hero .desc { margin: 10px 0 0; font-size: 15px; color: var(--ink-2); line-height: 1.6; }
.d-hero .price { margin-top: 16px; font-size: 26px; font-weight: 900; }

.ogroup { border-top: 9px solid var(--bg); padding: 18px 22px; }
.ogroup h4 {
  margin: 0 0 4px;
  font-size: 18px; font-weight: 900;
  display: flex; align-items: center; gap: 9px;
}
.ogroup .req {
  background: var(--orange); color: var(--white);
  font-size: 12px; font-weight: 800;
  padding: 3px 9px; border-radius: 999px;
}
.ogroup .hint { margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (max-width: 700px) { .opts { grid-template-columns: 1fr; } }

.opt {
  display: flex; align-items: center; gap: 11px;
  padding: 14px 14px;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 17px;
  text-align: left;
  background: var(--white);
}
.opt .box {
  flex: none; width: 22px; height: 22px;
  border: 2px solid #c7c7c7; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.opt.multi .box { border-radius: 5px; }
.opt.on { border-color: var(--orange); background: #fff6f2; }
.opt.on .box { border-color: var(--orange); }
.opt.on .box::after { content: ''; width: 11px; height: 11px; border-radius: inherit; background: var(--orange); }
.opt .lb { flex: 1; font-weight: 700; }
.opt .ex { font-weight: 800; color: var(--orange); font-size: 15px; }

.qty-row {
  border-top: 9px solid var(--bg);
  padding: 18px 22px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 19px; font-weight: 800;
}
.stepper { display: flex; align-items: center; gap: 20px; }
.stepper button {
  width: 50px; height: 50px;
  border: 2px solid var(--line); border-radius: 50%;
  font-size: 26px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.stepper button:disabled { opacity: .3; }
.stepper .n { min-width: 34px; text-align: center; font-size: 23px; font-weight: 900; }
.stepper.sm button { width: 36px; height: 36px; font-size: 20px; }
.stepper.sm { gap: 13px; }
.stepper.sm .n { min-width: 24px; font-size: 18px; }

/* ══════════ 장바구니 모달 ══════════ */
.crow { display: flex; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.crow .pic, .crow .pic-ph {
  width: 84px; height: 84px; flex: none;
  border-radius: var(--r-sm); object-fit: cover; background: #f7f7f7;
}
.crow .pic-ph {
  display: flex; align-items: center; justify-content: center; font-size: 38px;
  background: linear-gradient(180deg, #fff8dd, #fdefc4);
}
.crow .mid { flex: 1; min-width: 0; }
.crow .nm { font-size: 18px; font-weight: 800; }
.crow .op { margin-top: 5px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.crow .unit { margin-top: 3px; font-size: 13px; color: var(--ink-3); }
.crow .bot { margin-top: 11px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.crow .amt { font-size: 19px; font-weight: 900; }
.crow .del { font-size: 22px; color: var(--ink-3); width: 40px; height: 40px; border-radius: var(--r-sm); flex: none; }

.cart-total {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 18px 20px; border-top: 9px solid var(--bg);
}
.cart-total .lb { font-size: 17px; font-weight: 800; color: var(--ink-2); }
.cart-total .vl { font-size: 32px; font-weight: 900; }

.empty {
  padding: 70px 20px;
  text-align: center; color: var(--ink-3);
  font-size: 19px; font-weight: 700;
}
.empty .ic { font-size: 62px; margin-bottom: 14px; }

/* ══════════ 직원 호출 ══════════ */
/* 칸 수를 고정하지 않는다. 호출 종류가 3개면 3칸, 4개면 4칸으로 알아서 나뉜다 —
   2칸으로 못 박아 두면 3개일 때 아래 한 칸만 덩그러니 남는다. */
.call-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; padding: 22px; }
.call-grid .btn { height: 92px; font-size: 21px; flex-direction: column; gap: 6px; }
.call-grid .btn .ic { font-size: 28px; }

/* ══════════ 주문 완료 ══════════ */
#modal-done .panel { width: min(620px, 100%); }
/* 리뷰 안내가 붙으면서 내용이 창 높이를 넘을 수 있다.
   패널은 max-height 로 잘리므로, 이 안이 스스로 스크롤되게 한다.
   여백도 조금 줄여 대부분의 화면에서는 스크롤 없이 다 보이게 한다. */
/* flex 자식이 스스로 줄어들려면 min-height:0 이 있어야 한다.
   이게 없으면 내용이 늘어난 만큼 그대로 커져서 아래 버튼에 가린다. */
.done { flex: 1; min-height: 0; overflow-y: auto; text-align: center;
        padding: clamp(22px, 3.4vh, 36px) 30px clamp(18px, 2.6vh, 30px); }
.done .check {
  width: clamp(72px, 9vh, 108px); height: clamp(72px, 9vh, 108px); margin: 0 auto clamp(14px, 2.2vh, 26px);
  border-radius: 50%; background: var(--green); color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 58px; animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.done h3 { margin: 0 0 clamp(14px, 2.2vh, 26px); font-size: clamp(22px, 3vw, 30px); font-weight: 900; }
.done .kv { margin-bottom: clamp(10px, 1.5vh, 18px); }
.done .kv .k { font-size: 14px; color: var(--ink-3); font-weight: 700; }
.done .kv .v { font-size: 26px; font-weight: 900; margin-top: 3px; }
.done .kv .v.no { color: var(--red); letter-spacing: 1px; }
.done .kv .v.amt { font-size: 32px; }
.done .msg { margin-top: clamp(12px, 1.8vh, 22px); font-size: clamp(14px, 1.6vw, 17px); color: var(--ink-2); }
.done .state {
  display: inline-block; margin-top: 16px;
  padding: 9px 20px; border-radius: 999px;
  background: var(--bg); font-size: 15px; font-weight: 800;
}

/* ══════════ 토스트 / 네트워크 배너 ══════════ */
.toast {
  position: fixed; left: 50%; bottom: 110px;
  transform: translate(-50%, 16px);
  background: rgba(17, 17, 17, .93); color: var(--white);
  padding: 15px 26px; border-radius: 999px;
  font-size: 17px; font-weight: 700;
  opacity: 0; pointer-events: none;
  transition: opacity .18s, transform .18s;
  z-index: 60; max-width: 80vw; text-align: center;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

.netbar {
  position: fixed; top: 0; left: 0; right: 0;
  background: var(--red); color: var(--white);
  font-size: 15px; font-weight: 800; text-align: center;
  padding: 9px; z-index: 70;
  transform: translateY(-100%);
  transition: transform .28s cubic-bezier(.4, 0, .2, 1);
}
.netbar.on { transform: none; }

.spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(0, 0, 0, .18);
  border-top-color: var(--black);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg) } }

/* ══════════ 테이블 미설정 화면 ══════════ */
.setup { padding: 30px; display: grid; gap: 12px; }
.setup .btn { width: 100%; height: 72px; font-size: 22px; }

/* ═══════════════════════════════════════════════════════
   애니메이션
   손을 뗀 곳이 눈에 남도록 짧고 분명하게. 장식은 넣지 않는다.
   ═══════════════════════════════════════════════════════ */

/* 메뉴 카드 — 카테고리를 바꿀 때 순차 등장 (지연은 JS 에서 최대 11칸으로 제한) */
.card {
  animation: cardIn .34s cubic-bezier(.22, 1, .36, 1) both;
  animation-delay: calc(var(--i, 0) * 26ms);
  transition: transform .09s ease, box-shadow .18s ease;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(15px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
.card:active { transform: scale(.965); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* 카테고리 레일 */
.catrail button { transition: background .18s ease, color .18s ease, box-shadow .2s ease; }

/* 모달 — 열 때/닫을 때 각각 */
.modal.on { animation: fadeIn .2s ease both; }
.modal.on > .panel { animation: panelIn .32s cubic-bezier(.22, 1, .36, 1) both; }
.modal.closing { display: flex; animation: fadeOut .18s ease both; }
.modal.closing > .panel { animation: panelOut .18s ease both; }
@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes fadeOut { from { opacity: 1 } to { opacity: 0 } }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(22px) scale(.96); }
  to   { opacity: 1; transform: none; }
}
@keyframes panelOut {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translateY(10px) scale(.985); }
}

/* 옵션 선택 */
.opt { transition: border-color .16s ease, background .16s ease, transform .09s ease; }
.opt:active { transform: scale(.975); }
.opt.on .box::after { animation: dotIn .22s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes dotIn { from { transform: scale(0) } to { transform: scale(1) } }

/* 수량 숫자 */
.stepper .n { transition: transform .1s ease; }
.stepper .n.pop { animation: numPop .24s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes numPop { 0% { transform: scale(1) } 45% { transform: scale(1.3) } 100% { transform: scale(1) } }
.stepper button { transition: background .14s ease, transform .08s ease, border-color .14s ease; }
.stepper button:active:not(:disabled) { transform: scale(.9); background: var(--bg); }

/* 장바구니 배지 · 합계 */
.badge { transition: transform .12s ease; }
.badge.bump { animation: bump .42s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bump { 0% { transform: scale(1) } 35% { transform: scale(1.55) } 100% { transform: scale(1) } }


/* 장바구니 줄 추가 / 삭제 */
.crow { overflow: hidden; animation: rowIn .26s ease both; }
@keyframes rowIn { from { opacity: 0; transform: translateX(-12px) } to { opacity: 1; transform: none } }
.crow.out { animation: rowOut .26s cubic-bezier(.4, 0, 1, 1) forwards; }
@keyframes rowOut {
  0%   { opacity: 1; max-height: 220px; }
  40%  { opacity: 0; transform: translateX(46px); max-height: 220px; }
  100% { opacity: 0; transform: translateX(46px); max-height: 0;
         padding-top: 0; padding-bottom: 0; border-bottom-width: 0; }
}

/* 담을 때 이미지가 장바구니로 날아가는 효과 */
.fly {
  position: fixed;
  z-index: 90;
  border-radius: var(--r-sm);
  object-fit: cover;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}

/* 주문 완료 — 체크 아이콘 Scale/Fade 만 (.done .check 의 pop) */
.done .state { transition: background .3s ease; }

/* 버튼 눌림 */
.btn { transition: filter .12s ease, transform .08s ease, background .18s ease; }

/* 접근성 — 동작 최소화 설정을 켠 기기에서는 애니메이션을 끈다 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════
   좁은 화면(세로 폰 등)에서의 테스트용 대응
   운영 기준은 K11 가로모드이고, 아래는 그보다 좁을 때만 적용된다.
   ═══════════════════════════════════════════════════════ */
@media (max-width: 620px) {
  /* 세로로 세운 화면 — 폭이 기준이라 vw 값이 너무 작아진다. 세로 길이로 다시 잡는다 */
  #screen-start::after { height: calc(100vw * 218 / 1536 * 1.6); }
  .start-stage { gap: clamp(14px, 2.2vh, 32px); }
  .start-cta { padding: clamp(30px, 5vh, 58px) clamp(24px, 5vw, 46px) clamp(22px, 3.6vh, 42px); }
  .start-sign { width: min(78vw, 420px); }
  .start-tag { font-size: clamp(17px, 4.4vw, 26px); }
  .start-cta { width: min(88vw, 560px); }
  .cta-row { font-size: clamp(34px, 9vw, 58px); }
  .cta-sub { font-size: clamp(12px, 3vw, 17px); }
  .start-call { font-size: clamp(15px, 3.6vw, 21px); }
  .start-table { font-size: clamp(15px, 3.4vw, 20px); }

  .topbar { height: 56px; padding: 0 10px; gap: 7px; }
  .topbar .brandname { display: none; }
  .table-chip { font-size: 14px; padding: 6px 11px; }
  .icon-btn { width: 44px; height: 44px; font-size: 22px; }

  .catrail { width: 88px; }
  .catrail button { padding: 13px 4px; font-size: 12.5px; }
  .catrail button .ic { font-size: 19px; }

  .cat-head { padding: 14px 14px 4px; font-size: 19px; }
  .grid { grid-template-columns: 1fr; padding: 8px 12px 20px; gap: 12px; }
  .card .thumb, .card .thumb-ph { aspect-ratio: 16 / 9; }

  .cartbar { height: 66px; padding: 0 12px; gap: 9px; }
  .cartbar .ic { font-size: 21px; }
  .cartbar .txt { font-size: 14px; }
  .cartbar .sum { font-size: 18px; }
  .cartbar .btn { height: 46px; font-size: 15px; padding: 0 14px; }

  /* 모달은 전체 화면으로 */
  .modal { padding: 0; }
  .panel { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .modal.on > .panel { animation: sheetIn .3s cubic-bezier(.22, 1, .36, 1) both; }
  .modal.closing > .panel { animation: sheetOut .2s ease both; }
  @keyframes sheetIn  { from { transform: translateY(100%) } to { transform: none } }
  @keyframes sheetOut { from { transform: none } to { transform: translateY(100%) } }

  .d-hero { flex-direction: column; gap: 14px; padding: 16px; }
  .d-hero .pic, .d-hero .pic-ph { width: 100%; aspect-ratio: 16 / 10; }
  .d-hero h3 { font-size: 24px; }
  .d-hero .price { font-size: 23px; margin-top: 12px; }
  .ogroup { padding: 16px; }
  .qty-row { padding: 16px; }

  .crow { padding: 14px 16px; }
  .crow .pic, .crow .pic-ph { width: 68px; height: 68px; }
  .cart-total { padding: 15px 16px; }
  .cart-total .vl { font-size: 26px; }
  .panel-foot { padding: 12px 14px; }
  .panel-foot .btn { height: 56px; font-size: 18px; }
  .panel-foot .btn[data-close] { flex: 0 0 110px !important; font-size: 15px; }

  .call-grid { padding: 16px; gap: 10px; }
  .call-grid .btn { height: 84px; font-size: 18px; }

  .done { padding: 30px 22px 26px; }
  .done .check { width: 88px; height: 88px; font-size: 46px; margin-bottom: 20px; }
  .done h3 { font-size: 25px; margin-bottom: 20px; }
  .done .kv .v { font-size: 22px; }
  .done .kv .v.amt { font-size: 27px; }
}

/* ══════════ 누적 금액 칩 (상단바) ══════════
   손님이 "지금까지 얼마 나왔는지"를 언제든 확인할 수 있게 한다.
   결제는 카운터 POS 에서 하므로 여기서는 금액만 보여 준다. */
.sum-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  background: var(--white);
  border: 2px solid var(--black);
  border-radius: 999px;
  padding: 5px 15px;
  margin-right: 4px;
  cursor: pointer;
  line-height: 1.15;
}
.sum-chip:active { transform: scale(.97); }
.sum-chip[hidden] { display: none; }
.sum-chip .lb { font-size: 11px; font-weight: 800; color: var(--ink-3); letter-spacing: 0; }
.sum-chip .vl { font-size: 17px; font-weight: 900; color: var(--ink); }

/* 대기 중인 주문이 있을 때의 상단 띠 — 빨강(오류)이 아니라 주황(안내)으로 구분한다 */
.netbar.warn { background: var(--orange); }

/* ══════════ 내 주문 내역 ══════════ */
.mrow {
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: 12px;
  background: var(--white);
}
.mrow.pending { border-color: var(--orange); background: #fff8f3; }

.mrow .mh { display: flex; align-items: baseline; gap: 10px; margin-bottom: 9px; }
.mrow .mh .seq { font-size: 17px; font-weight: 900; }
.mrow .mh .tm { font-size: 14px; font-weight: 700; color: var(--ink-3); }
.mrow .mh .amt { margin-left: auto; font-size: 19px; font-weight: 900; }

.mrow .ml { display: flex; flex-direction: column; gap: 6px; }
.mrow .mi { display: flex; align-items: baseline; gap: 9px; flex-wrap: wrap; font-size: 16px; }
.mrow .mi .nm { font-weight: 800; }
.mrow .mi .qt { font-weight: 800; color: var(--ink-2); }
.mrow .mi .op { flex-basis: 100%; font-size: 14px; font-weight: 600; color: var(--ink-3); }

.mrow .ms {
  margin-top: 10px;
  font-size: 14px; font-weight: 800; color: var(--ink-2);
  background: var(--bg); border-radius: var(--r-sm);
  padding: 7px 11px; display: inline-block;
}
.mrow.pending .ms { background: #ffe8d8; color: #96450f; }

.mine-note {
  padding: 0 18px 14px;
  font-size: 14px; font-weight: 700; color: var(--ink-3); text-align: center;
}

@media (max-width: 900px) {
  .sum-chip { padding: 4px 11px; }
  .sum-chip .lb { font-size: 10px; }
  .sum-chip .vl { font-size: 15px; }
  .mrow .mh .seq { font-size: 15px; }
  .mrow .mi { font-size: 15px; }
}

/* ══════════ 접수되지 못한 주문 경고 ══════════
   손님이 넣었는데 서버가 거부한(=정산이 끝난 세션 등) 주문.
   조용히 사라지면 매출 사고가 되므로 직원이 '확인'을 누를 때까지 남는다. */
.queue-alert {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 75; max-width: min(720px, 94vw);
  display: flex; align-items: center; gap: 12px;
  background: #fff3e6; color: #7a3c05;
  border: 2px solid var(--orange); border-radius: var(--r-md);
  padding: 12px 14px; box-shadow: var(--shadow-lg);
  font-size: 15px; font-weight: 700; line-height: 1.45;
}
.queue-alert[hidden] { display: none; }
.queue-alert .ic { font-size: 22px; flex: none; }
.queue-alert .tx { flex: 1; }
.queue-alert .ack {
  flex: none; border: none; border-radius: var(--r-sm);
  background: var(--orange); color: #fff;
  font: inherit; font-weight: 800; padding: 8px 16px; cursor: pointer;
}
.queue-alert .ack:active { transform: scale(.96); }

.mrow.failed { border-color: var(--red); background: #fff6f4; }
.mrow.failed .ms { background: #ffe2dc; color: #8f2a12; }

/* ══════════ 주문 완료 모달 — 짧고 넓은 화면 대응 ══════════
   실기기(2.11:1 가로 화면)에서 완료 화면 내용이 패널 높이를 넘겨
   '추가 주문하기' 버튼이 화면 밖으로 밀려나 손님이 빠져나올 수 없었다.
   내용만 스크롤되게 하고 버튼은 항상 바닥에 고정한다. */
#modal-done .done {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#modal-done .panel-foot { flex: none; }

/* 세로가 짧은 화면에서는 여백과 글자를 줄여 한 화면에 들어오게 한다 */
@media (max-height: 560px) {
  .modal { padding: 12px; }
  .panel { max-height: 96dvh; }
  #modal-done .done { padding: 18px 24px 14px; }
  #modal-done .done .check { width: 64px; height: 64px; font-size: 34px; margin-bottom: 12px; }
  #modal-done .done h3 { font-size: 22px; margin-bottom: 14px; }
  #modal-done .done .kv { margin-bottom: 10px; }
  #modal-done .done .kv .v { font-size: 20px; }
  #modal-done .done .kv .v.amt { font-size: 24px; }
  #modal-done .done .msg { margin-top: 12px; font-size: 14px; }
  .panel-foot { padding: 10px 14px; }
  .panel-foot .btn { height: 52px; font-size: 16px; }
}

/* ───────────── 품절 ─────────────
   목록에서 빼지 않고 회색으로 둔다. 빼 버리면 손님이
   "어제 있던 메뉴가 왜 없냐"고 직원을 부른다. */
.card.sold { cursor: default; }
.card.sold .thumb,
.card.sold .thumb-ph { filter: grayscale(1); opacity: .38; }
.card.sold .name,
.card.sold .price { color: var(--ink-3); }
.card.sold:active { transform: none; }

.card .tag-sold {
  position: absolute; left: 12px; top: 12px; z-index: 2;
  padding: 6px 13px; border-radius: 999px;
  background: var(--red); color: #fff;
  font-size: 15px; font-weight: 900; letter-spacing: -.3px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .22);
}
.card .sold-hint { color: var(--red); font-weight: 700; }

/* 장바구니에 담긴 것이 품절로 바뀐 경우 */
.cart-item.sold .nm { color: var(--red); }
.cart-item .sold-mark {
  display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 6px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 800;
}

/* ── 리뷰 안내 ──
   주문이 막 끝난 이 순간이 손님 기분이 가장 좋을 때다.
   QR 은 서버가 직접 그린다 — 매장에 인터넷이 없어도 보여야 한다. */
.review {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 20px);
  margin-top: clamp(14px, 2.2vh, 22px);
  padding: clamp(12px, 1.8vh, 18px) clamp(14px, 2vw, 20px);
  background: var(--cream);
  border: 2px solid var(--yellow);
  border-radius: var(--r-md);
  text-align: left;
}
.review[hidden] { display: none; }
.rv-tx { flex: 1; min-width: 0; }
.rv-tx b {
  display: block;
  font-size: clamp(14px, 1.6vw, 19px);
  font-weight: 900;
  letter-spacing: -.5px;
  line-height: 1.4;
}
.rv-tx span {
  display: block;
  margin-top: 4px;
  font-size: clamp(12px, 1.3vw, 15px);
  color: var(--ink-2);
  font-weight: 600;
  line-height: 1.5;
}
.rv-tx span:empty { display: none; }
/* 손님 휴대폰 카메라가 잡을 만큼은 커야 한다.

   크기를 아무 값이나 주면 안 된다. QR 은 27칸짜리 격자라, 그림 안쪽 폭이
   27 의 배수로 떨어지지 않으면 칸마다 폭이 2px·3px 로 들쭉날쭉해진다
   (crispEdges 로 그려서 반올림된다). 화면에서 '깨진 QR' 로 보이고 인식률도 떨어진다.

   그래서 안쪽이 108px(27×4) 또는 135px(27×5) 로 떨어지게 잡는다.
   padding 6px 이 양쪽에서 빠지므로 바깥은 120px / 147px. */
.rv-qr {
  flex: none;
  width: clamp(120px, 12vw, 147px);
  height: clamp(120px, 12vw, 147px);
  border-radius: var(--r-sm);
  background: #fff;
  padding: 6px;
}

/* ── 완료 화면이 짧은 태블릿에 다 들어가게 ──
   리뷰 QR 이 붙으면서 800px 높이 화면에서는 QR 아래가 잘렸다.
   키오스크에서 스크롤해야 보이는 QR 은 없는 것과 같다 — 손님은 스크롤할
   생각을 하지 않는다. 화면이 낮으면 각 요소를 조금씩 줄여 한 눈에 담는다. */
@media (max-height: 900px) {
  .done .check { width: 62px; height: 62px; margin-bottom: 12px; font-size: 34px; }
  .done h3 { margin-bottom: 12px; font-size: 23px; }
  .done .kv { margin-bottom: 8px; }
  .done .kv .k { font-size: 12px; }
  .done .kv .v { font-size: 20px; }
  .done .kv .v.amt { font-size: 25px; }
  .done .msg { margin-top: 10px; font-size: 14px; }
  .done .state { margin-top: 9px; padding: 6px 15px; font-size: 13px; }
  .review { margin-top: 12px; padding: 11px 13px; }
  .rv-qr { width: 120px; height: 120px; }   /* 27×4 + 여백 — 위 설명 참고 */
}

/* ── 사장님이 쏜다 — 당첨 축하 ──
   당첨된 테이블에만 뜬다. 다른 테이블 화면에는 아무 일도 일어나지 않는다. */
.panel-win {
  width: min(88vw, 460px);
  padding: clamp(28px, 4.5vh, 44px) clamp(24px, 3vw, 36px) clamp(22px, 3vh, 32px);
  background: var(--cream);
  border-radius: var(--r-lg);
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.win-emoji { font-size: clamp(52px, 7vw, 76px); line-height: 1; animation: winPop .5s cubic-bezier(.34,1.56,.64,1); }
@keyframes winPop { 0% { transform: scale(.3) rotate(-18deg) } 100% { transform: scale(1) rotate(0) } }
.panel-win h2 {
  margin: clamp(12px, 2vh, 18px) 0 0;
  font-size: clamp(24px, 3.2vw, 34px); font-weight: 900; letter-spacing: -1.2px;
}
.win-prize {
  margin-top: clamp(10px, 1.6vh, 16px);
  padding: clamp(11px, 1.8vh, 16px) clamp(18px, 2.4vw, 28px);
  background: var(--yellow); border-radius: 999px;
  font-size: clamp(20px, 2.6vw, 30px); font-weight: 900; letter-spacing: -1px;
  box-shadow: 0 5px 0 var(--yellow-dk);
}
.panel-win p { margin: clamp(12px, 1.8vh, 18px) 0 0; font-size: clamp(13px, 1.5vw, 17px); color: var(--ink-2); font-weight: 600; }

/* ══════════ 사장님이 쏜다 — 룰렛 ══════════
   손님이 다 같이 쳐다보는 화면이다. 글자보다 원판이 커야 한다. */
#screen-spin {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 22px);
  padding: clamp(14px, 2.5vh, 28px);
  animation: spIn .3s ease both;
}
#screen-spin[hidden] { display: none; }
@keyframes spIn { from { opacity: 0 } to { opacity: 1 } }

.sp-top { text-align: center; }
.sp-badge {
  display: inline-block;
  padding: clamp(5px, .9vh, 9px) clamp(13px, 1.8vw, 20px);
  border-radius: 999px;
  background: var(--black);
  color: var(--yellow);
  font-size: clamp(12px, 1.5vw, 17px);
  font-weight: 800;
  letter-spacing: -.3px;
}
.sp-prize {
  display: block;
  margin-top: clamp(6px, 1vh, 12px);
  font-size: clamp(24px, 4vw, 44px);
  font-weight: 900;
  letter-spacing: -1.6px;
  color: var(--ink);
}

/* 원판은 남는 높이를 다 쓴다 — 폰이든 태블릿이든 화면을 꽉 채워야 눈이 간다 */
.sp-wheelbox {
  position: relative;
  flex: 1;
  min-height: 0;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
#sp-wheel { width: 100%; height: 100%; max-width: 100%; max-height: 100%; }

/* 위쪽 바늘 */
.sp-pin {
  position: absolute;
  top: -2px; left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: clamp(11px, 1.6vw, 17px) solid transparent;
  border-right: clamp(11px, 1.6vw, 17px) solid transparent;
  border-top: clamp(22px, 3.2vw, 34px) solid var(--black);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .3));
}

.sp-foot {
  font-size: clamp(15px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: -.6px;
  color: var(--ink-2);
  text-align: center;
  min-height: 1.4em;
}
.sp-foot.win { color: var(--red); font-size: clamp(20px, 3vw, 34px); font-weight: 900; }
.sp-foot.lose { color: var(--ink-3); }
#sp-close { width: min(88vw, 420px); }
#sp-close[hidden] { display: none; }
