@font-face { font-family: 'Lunch LED'; src: url(fonts/led.woff2) format('woff2'); font-display: block; }
:root {
  --tile: #eef3f4; --grout: #d2dcdf;
  --steel-1: #9ea9ad; --steel-2: #dfe5e7; --steel-3: #bfc8cb; --steel-d: #6f7a7e;
  --enamel: #d8352a; --enamel-d: #9f2119;
  --led-bg: #171b19; --led: #ffae22;
  --paper: #fffdf5; --ink: #1f2326; --ink-2: #545c61; --stamp: #2348b3;
  --sign: 'Do Hyeon', 'Pretendard Variable', 'Apple SD Gothic Neo', sans-serif;
  --ui: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --led-f: 'Lunch LED', 'Pretendard Variable', monospace;
  --row: 96px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0; color: var(--ink); font: 16px/1.55 var(--ui); min-height: 100svh;
  background-color: var(--tile);
  background-image:
    linear-gradient(var(--grout) 2px, transparent 2px),
    linear-gradient(90deg, var(--grout) 2px, transparent 2px);
  background-size: 64px 32px, 64px 32px;
  background-position: 0 0, 0 0;
  overflow-x: clip;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--stamp); outline-offset: 3px; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; max-width: 1080px; margin: 0 auto; }
.logo { font: 400 22px/1 var(--sign); color: var(--ink); text-decoration: none; background: var(--paper); padding: 10px 12px 9px; border: 2px solid var(--ink); }
.chip { appearance: none; border: 2px solid var(--ink); background: var(--paper); padding: 6px 14px; min-height: 44px; font-weight: 700; font-size: 14px; cursor: pointer; border-radius: 999px; }
.chip[aria-pressed="false"] { background: transparent; }

.stage { max-width: 1080px; margin: 0 auto; padding: 0 16px 40px; display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); justify-items: center; }
@media (min-width: 960px) {
  .stage { grid-template-columns: 420px minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; align-content: start; justify-items: stretch; column-gap: 48px; }
  .machine, .ticketbox { grid-column: 1; }
  .menu { grid-column: 2; grid-row: 1 / span 2; }
}

/* ---------- 기계 ---------- */
.machine {
  position: relative; width: min(100%, 420px); padding: 16px 18px 26px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.18) 0 1px, transparent 1px 3px),
    linear-gradient(100deg, var(--steel-1), var(--steel-2) 38%, var(--steel-3) 62%, var(--steel-2) 80%, var(--steel-1));
  border: 3px solid var(--ink); border-radius: 18px 18px 10px 10px;
  box-shadow: 0 10px 0 var(--steel-d), 0 10px 0 3px var(--ink), 0 26px 30px rgba(31,35,38,.22);
}
.plate { background: var(--enamel); border: 3px solid var(--ink); border-radius: 10px; padding: 10px 12px 8px; text-align: center; box-shadow: inset 0 -4px 0 var(--enamel-d); }
.plate h1 { margin: 0; font: 400 clamp(30px, 8.6vw, 40px)/1.05 var(--sign); color: #fff; letter-spacing: -.01em; text-shadow: 0 3px 0 var(--enamel-d); }
.led { margin: 12px 0 10px; background: var(--led-bg); border: 3px solid var(--ink); border-radius: 6px; padding: 9px 12px 7px; overflow: hidden; white-space: nowrap; }
.led span { display: inline-block; will-change: transform; font: 400 22px/1.15 var(--led-f); color: var(--led); text-shadow: 0 0 6px rgba(255,174,34,.7); letter-spacing: .02em; }
.led.scroll span { animation: ledscroll var(--dur, 6s) ease-in-out infinite alternate; }
@keyframes ledscroll { 0%, 18% { transform: translateX(0); } 82%, 100% { transform: translateX(var(--over, 0)); } }

.window { position: relative; margin-right: 34px; height: calc(var(--row) * 3); overflow: hidden; background: #fbfbf8; border: 3px solid var(--ink); border-radius: 8px; box-shadow: inset 0 0 0 6px #e9ecec; }
.reel { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.cell { height: var(--row); display: grid; grid-template-columns: 84px 1fr; align-items: center; gap: 10px; padding: 0 16px 0 14px; }
.cell img { width: 80px; height: 80px; display: block; }
img.ph { object-fit: cover; border-radius: 10px; border: 2px solid var(--ink); }
.ph-txt { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: inset 0 0 0 6px #f3efe2; font: 400 28px/1 var(--sign); font-style: normal; color: var(--ink); }
.ph-txt.big { width: 80px; height: 80px; font-size: 34px; }
.cell.q { color: var(--ink-2); }
.cell .qm { display: grid; place-items: center; width: 80px; height: 80px; border-radius: 10px; border: 2px dashed var(--ink-2); font: 400 48px/1 var(--sign); font-style: normal; color: var(--enamel); background: #fff; }
.window.idle .cell:not(.q) { opacity: .45; }
.cell b { font: 400 26px/1.1 var(--sign); }
.window .glass { position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(#fbfbf8 0%, rgba(251,251,248,.0) 30%, rgba(251,251,248,0) 70%, #fbfbf8 100%), linear-gradient(transparent calc(var(--row) - 2px), rgba(31,35,38,.55) calc(var(--row) - 2px), rgba(31,35,38,.55) var(--row), transparent var(--row), transparent calc(var(--row) * 2), rgba(31,35,38,.55) calc(var(--row) * 2), rgba(31,35,38,.55) calc(var(--row) * 2 + 2px), transparent calc(var(--row) * 2 + 2px)); }
.mark { position: absolute; top: calc(var(--row) * 1.5 - 12px); width: 0; height: 0; border: 12px solid transparent; }
.mark.l { left: -3px; border-left: 16px solid var(--enamel); }
.mark.r { right: -3px; border-right: 16px solid var(--enamel); }
.window.blur .cell img { filter: blur(1.5px); }

.panel { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 16px; padding-right: 50px; }
.count { margin: 0; font-size: 15px; color: var(--ink); word-break: keep-all; }
.count b { font: 400 28px/1 var(--sign); }
.pull { appearance: none; cursor: pointer; flex: none; touch-action: manipulation; width: clamp(88px, 28vw, 108px); height: clamp(88px, 28vw, 108px); border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 38% 32%, #ff7b62, var(--enamel) 46%, var(--enamel-d)); box-shadow: 0 8px 0 var(--ink); color: #fff; font: 400 30px/1 var(--sign); transition: transform .08s, box-shadow .08s; }
.pull:active, .pull.down { transform: translateY(6px); box-shadow: 0 2px 0 var(--ink); }
.pull:disabled { cursor: not-allowed; filter: grayscale(.6); opacity: .55; }
.machine[aria-busy="true"] .pull:disabled { cursor: progress; opacity: 1; filter: saturate(.7); }
.lever { position: absolute; right: -10px; top: -176px; width: 40px; height: 190px; touch-action: none; cursor: grab; }
.lever .rod { position: absolute; left: 16px; top: 24px; width: 9px; height: 150px; background: linear-gradient(90deg, #8d979b, #eef2f3, #8d979b); border: 2px solid var(--ink); border-radius: 6px; transform-origin: 50% 100%; transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.lever .knob { position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--ink); background: radial-gradient(circle at 35% 30%, #ff8a72, var(--enamel) 50%, var(--enamel-d)); transition: transform .35s cubic-bezier(.3,1.6,.5,1); }
.lever.down .rod { transform: scaleY(.45); }
.lever.down .knob { transform: translateY(84px); }
.lever.down .rod, .lever.down .knob { transition-duration: .12s; }
.lever.drag .rod, .lever.drag .knob { transition: none; }
.kbd { display: none; margin: 10px 0 0; text-align: center; font-size: 13px; color: var(--ink-2); }
@media (hover: hover) and (pointer: fine) { .kbd { display: block; } }
.slot { margin: 18px auto 0; width: 90%; height: 18px; background: #2a2f31; border: 3px solid var(--ink); border-radius: 4px; box-shadow: inset 0 4px 0 #0e1112; }

/* ---------- 식권 ---------- */
.ticketbox { position: relative; z-index: 2; width: min(100%, 420px); margin-top: -44px; overflow-x: clip; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.ticketbox[hidden], .from[hidden] { display: none; }
.ticket { position: relative; width: 86%; background: var(--paper); border: 2px solid var(--ink); padding: 16px 18px 18px; text-align: center; box-shadow: 0 8px 0 rgba(31,35,38,.18);
  -webkit-mask: radial-gradient(circle 6px at 50% 0, transparent 98%, #000) 0 0 / 18px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 0, transparent 98%, #000) 0 0 / 18px 100% repeat-x; transform-origin: 50% 0; }
.ticket.out { animation: print 1.1s steps(11) both; }
@keyframes print { from { clip-path: inset(0 0 100% 0); transform: translateY(-14px); } to { clip-path: inset(0 0 0 0); transform: translateY(0); } }
.t-head { display: flex; justify-content: space-between; margin: 4px 0 6px; font: 400 15px/1 var(--led-f); color: var(--ink-2); border-bottom: 2px dashed #c9cfd1; padding-bottom: 10px; }
.ticket img { display: block; margin: 6px auto 10px; width: 132px; height: 132px; }
.t-plate { display: grid; place-items: center; margin: 6px auto 10px; width: 132px; height: 132px; border-radius: 50%; background: #fff; border: 2px solid var(--ink); box-shadow: inset 0 0 0 10px #f3efe2; font: 400 60px/1 var(--sign); font-style: normal; }
.t-plate[hidden], .ticket img[hidden] { display: none; }
.ticket h2 { margin: 2px 0 4px; font: 400 clamp(38px, 11vw, 48px)/1.05 var(--sign); text-wrap: balance; }
.t-desc { margin: 0 auto 10px; max-width: 30ch; color: var(--ink-2); font-size: 15px; text-wrap: balance; word-break: keep-all; }
.t-credit { margin: 8px 0 0; font-size: 11px; color: #6b7378; }
.t-meta { margin: 0; font: 400 14px/1.2 var(--led-f); color: var(--ink-2); }
.stamp { position: absolute; right: 18px; top: 54px; width: 76px; height: 76px; border: 3px solid var(--stamp); border-radius: 50%; color: var(--stamp); font: 400 24px/70px var(--sign); transform: rotate(-14deg); opacity: .85; }
.ticket.out .stamp { animation: stamp .3s 1.15s cubic-bezier(.2,1.8,.4,1) both; }
@keyframes stamp { from { transform: rotate(-14deg) scale(1.5); opacity: 0; } to { transform: rotate(-14deg) scale(1); opacity: .85; } }
.from { margin: 0; font-weight: 700; text-align: center; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.btn { appearance: none; touch-action: manipulation; min-height: 48px; border: 2px solid var(--ink); background: var(--paper); font-weight: 700; font-size: 15px; cursor: pointer; border-radius: 10px; box-shadow: 0 3px 0 var(--ink); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.btn.main { background: #fee500; font-size: 16px; }
.acts.friend { grid-template-columns: 1fr 1fr; }
.acts.friend #again { grid-column: 1 / -1; order: -1; background: var(--enamel); color: #fff; font-size: 17px; min-height: 54px; }
.copybox { margin: 0; width: 100%; font-size: 14px; font-weight: 600; }
.copybox input { display: block; width: 100%; margin-top: 6px; min-height: 44px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 8px; font: inherit; background: #fff; }
.copybox[hidden] { display: none; }
.maps { display: flex; gap: 8px 18px; margin: 0; font-size: 15px; flex-wrap: wrap; justify-content: center; }
.maps a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; text-underline-offset: 3px; }

/* ---------- 메뉴판 ---------- */
.menu { width: 100%; max-width: 560px; background: var(--paper); border: 3px solid var(--ink); border-radius: 6px; padding: 16px; box-shadow: 0 6px 0 rgba(31,35,38,.15); }
.menu-head h2 { margin: 0; font: 400 28px/1 var(--sign); }
.menu-head p { margin: 6px 0 12px; color: var(--ink-2); font-size: 15px; word-break: keep-all; }
.frow { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 6px; margin-bottom: 8px; }
.flab { font: 400 15px/1 var(--sign); color: var(--ink-2); writing-mode: horizontal-tb; }
.filters { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin: 0 -2px; }
.filters::-webkit-scrollbar { display: none; }
.filters button { appearance: none; flex: none; min-height: 44px; padding: 6px 10px; border: 2px solid var(--ink); background: #fff; border-radius: 4px; font-weight: 700; font-size: 14px; cursor: pointer; box-shadow: 0 2px 0 var(--ink); white-space: nowrap; }
.filters button small { font: 400 12px/1 var(--led-f); color: var(--ink-2); margin-left: 2px; }
.filters .on, .filters [aria-pressed="true"] { background: var(--ink); color: var(--paper); box-shadow: none; transform: translateY(2px); }
.filters .on small, .filters [aria-pressed="true"] small { color: var(--led); }
.filters .zero { opacity: .4; }
.filters [hidden] { display: none; }
.grid { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.grid li { position: relative; }
.grid .del { position: absolute; top: 0; right: 0; width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 50%; background: #fff; font: 700 16px/1 var(--ui); cursor: pointer; padding: 0; }
.grid button.pick { appearance: none; width: 100%; border: 2px solid transparent; background: transparent; padding: 6px 2px 8px; border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 14px; font-weight: 600; word-break: keep-all; }
.grid img { width: 64px; height: 64px; }
.grid button.pick:hover { border-color: var(--grout); }
.grid .ph-txt { margin: 0 auto; }
.grid button[aria-pressed="false"] img, .grid button[aria-pressed="false"] .ph-txt { filter: grayscale(1); opacity: .35; }
.grid button[aria-pressed="false"] span { text-decoration: line-through; color: #8a9296; }
.grid li.hide { display: none; }
.menu-foot { margin: 10px 0 0; text-align: right; }
.link:disabled { text-decoration: none; cursor: default; opacity: .6; }
.empty { margin: 10px 0 0; padding: 14px; border: 2px dashed var(--ink); border-radius: 8px; background: #fff8e1; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.empty p { margin: 0 0 4px; width: 100%; font-weight: 700; }
.empty[hidden], .empty [hidden] { display: none; }
.empty .btn { padding: 0 14px; }
.add { margin: 14px 0 0; padding-top: 14px; border-top: 2px dashed #c9cfd1; }
.add label { display: block; font: 400 20px/1.2 var(--sign); margin-bottom: 8px; }
.add label small { font: 500 13px/1 var(--ui); color: var(--ink-2); margin-left: 6px; }
.add-row { display: flex; gap: 8px; }
.add input { flex: 1; min-width: 0; min-height: 48px; padding: 8px 12px; border: 2px solid var(--ink); border-radius: 8px; font: inherit; font-size: 16px; background: #fff; }
.add .btn { padding: 0 18px; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50; display: flex; align-items: center; gap: 12px; width: max-content; max-width: calc(100vw - 32px); margin: 0; padding: 12px 16px; background: #1f2326; color: #fff; border-radius: 10px; font-weight: 700; text-align: center; word-break: keep-all; box-shadow: 0 6px 18px rgba(0,0,0,.25); }
.toast[hidden] { display: none; }
.toast button { appearance: none; flex: none; border: 2px solid #fee500; background: none; color: #fee500; font-weight: 700; min-height: 36px; padding: 0 10px; border-radius: 6px; cursor: pointer; }
.link { appearance: none; border: 0; background: none; padding: 12px 0; min-height: 44px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 14px; }

/* ---------- 본문 ---------- */
.guide { max-width: 760px; margin: 24px auto 0; padding: 28px 20px 40px; background: var(--paper); border-top: 3px solid var(--ink); content-visibility: auto; contain-intrinsic-size: auto 1800px; }
.guide h2 { font: 400 26px/1.25 var(--sign); margin: 28px 0 10px; text-wrap: balance; word-break: keep-all; }
.menulist { padding-left: 1.1em; }
.menulist b { margin-right: 4px; }
.guide section:first-of-type h2 { margin-top: 8px; }
.guide p, .guide li, .guide dd { word-break: keep-all; }
.guide ol { padding-left: 1.3em; }
.faq dl { margin: 0; }
.faq dt { font-weight: 700; margin-top: 14px; }
.faq dd { margin: 4px 0 0; color: var(--ink-2); }
.others { padding-left: 1.1em; }
.others a { font-weight: 700; color: var(--ink); display: inline-block; padding: 8px 0; }
.credits p, .credits li { font-size: 13px; color: var(--ink-2); }
.credits summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
.credits ul { padding-left: 1.1em; margin: 6px 0 0; }
.credits a { color: inherit; overflow-wrap: anywhere; }
.site-foot { margin-top: 32px; font-size: 14px; display: flex; gap: 8px; }
.site-foot a { color: var(--ink-2); display: inline-block; padding: 12px 0; }
.ad-slot { --ad-bg: #f4f6f6; }

@media (max-height: 700px) {
  .machine { padding-top: 12px; padding-bottom: 18px; }
  .led { margin: 8px 0 8px; }
  .panel { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .ticket.out, .ticket.out .stamp, .led.scroll span { animation: none; }
  .lever .rod, .lever .knob { transition: none; }
}
