:root {
  --paper: #f3f0e8;
  --card: #fbf9f4;
  --ink: #121212;
  --muted: #6a665d;
  --line: #d8d2c4;
  --accent: #ff4a1c;
  --accent-ink: #c8330c;
  --good: #1a7f4b;
  --font: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- 상단 ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; align-self: center; border-radius: 5px; background: var(--ink);
  background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-size: 5px 2.5px, 9px 2.5px, 13px 2.5px;
  background-position: 5px 6px, 5px 10px, 5px 14px;
}
.brand-name { font-size: 22px; font-weight: 900; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; font-weight: 600; letter-spacing: 0.22em; color: var(--muted); }
.top-nav { display: flex; align-items: center; gap: 18px; font-size: 14px; font-weight: 600; }
.top-nav a { text-decoration: none; }
.top-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }
.member-chip {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.member-chip:hover { border-color: var(--ink); }

main { flex: 1; width: 100%; max-width: 1240px; margin: 0 auto; padding: clamp(20px, 4vw, 48px) clamp(16px, 4vw, 48px); }

/* ---------- 드롭 화면 ---------- */
.drop { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.stage {
  position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 5 / 4;
  background: #e6e0d2; display: grid; place-items: center;
  transition: background-color .35s ease;
}
.stage[data-color="블랙"] { background: #e3ddce; }
.stage[data-color="크림"] { background: #23211e; }
.stage-no {
  position: absolute; left: 22px; top: 14px; font-size: clamp(64px, 11vw, 150px); font-weight: 900; line-height: 1;
  letter-spacing: -0.05em; color: rgba(18, 18, 18, .08); user-select: none;
}
.stage[data-color="크림"] .stage-no { color: rgba(255, 255, 255, .07); }
.stage-tag {
  position: absolute; right: 18px; top: 18px; font-size: 11px; font-weight: 700; letter-spacing: .18em;
  padding: 6px 10px; border-radius: 4px; background: var(--ink); color: #fff;
}
.stage[data-color="크림"] .stage-tag { background: var(--paper); color: var(--ink); }
.shoe { width: 88%; height: auto; position: relative; filter: drop-shadow(0 26px 22px rgba(0, 0, 0, .22)); transform: rotate(-7deg); transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.stage:hover .shoe { transform: rotate(-4deg) translateY(-6px); }

.info h1 { margin: 6px 0 2px; font-size: clamp(36px, 5vw, 60px); font-weight: 900; letter-spacing: -0.035em; line-height: 1.02; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .2em; color: var(--accent-ink); }
.subtitle { margin: 0; color: var(--muted); font-size: 17px; }
.price { margin: 18px 0 0; font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }

.status {
  margin: 22px 0; padding: 16px 18px; border-radius: 14px; background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.status-label { font-size: 13px; font-weight: 600; opacity: .75; }
.status-value { font-size: 30px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.status[data-state="open"] { background: var(--accent); }
.status[data-state="soldout"] { background: #8a857a; }
.live-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #fff; margin-right: 8px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

.field-label { margin: 20px 0 8px; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; }
.field-label span { font-weight: 500; color: var(--muted); }
.colors { display: flex; gap: 10px; }
.color {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: 14px;
}
.color i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .25); }
.color[aria-pressed="true"] { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }

.sizes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size {
  position: relative; padding: 14px 8px 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card);
  text-align: center; display: grid; gap: 2px;
}
.size b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.size small { font-size: 12px; color: var(--muted); font-weight: 500; }
.size:hover:not(:disabled) { border-color: var(--ink); }
.size[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.size[aria-pressed="true"] small { color: rgba(255, 255, 255, .7); }
.size[data-low] small { color: var(--accent-ink); font-weight: 700; }
.size[aria-pressed="true"][data-low] small { color: #ffb39e; }
.size:disabled { cursor: not-allowed; background: transparent; color: #a9a497; }
.size:disabled b { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.size:disabled small { color: #a9a497; }

.cta {
  margin-top: 22px; width: 100%; padding: 19px 20px; border: 0; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: -0.01em;
  transition: transform .12s ease, background-color .15s ease;
}
.cta:hover:not(:disabled) { background: var(--accent); }
.cta:active:not(:disabled) { transform: scale(.985); }
.cta:disabled { background: #c9c3b4; color: #f7f4ec; cursor: not-allowed; }
.cta.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.cta.secondary:hover:not(:disabled) { background: var(--ink); color: #fff; }
.hint { margin: 10px 0 0; font-size: 13px; color: var(--muted); min-height: 20px; }

.rules { margin: 28px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.rules li { display: flex; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.rules b { flex: 0 0 92px; font-weight: 700; }
.rules span { color: var(--muted); }

/* ---------- 주문·결제 ---------- */
.narrow { max-width: 620px; margin: 0 auto; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: clamp(20px, 3vw, 32px); }
.panel + .panel { margin-top: 16px; }
.page-title { margin: 0 0 18px; font-size: 30px; font-weight: 900; letter-spacing: -0.03em; }
.summary { display: flex; gap: 16px; align-items: center; }
.summary-art { flex: 0 0 112px; border-radius: 12px; background: #e3ddce; padding: 6px; }
.summary-art[data-color="크림"] { background: #23211e; }
.summary-art svg { display: block; width: 100%; height: auto; }
.summary h2 { margin: 0; font-size: 19px; font-weight: 800; }
.summary p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.summary .price { margin: 6px 0 0; font-size: 19px; }

.timer { text-align: center; padding: 6px 0 2px; }
.timer-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.timer-value { font-size: 64px; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.timer[data-urgent] .timer-value { color: var(--accent-ink); }
.timer-bar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 10px; }
.timer-bar i { display: block; height: 100%; background: var(--ink); transition: width 1s linear; }
.timer[data-urgent] .timer-bar i { background: var(--accent); }

.methods { display: grid; gap: 8px; margin: 4px 0 0; padding: 0; border: 0; }
.methods legend { font-size: 13px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.method { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; background: #fff; }
.method:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.method input { margin-top: 4px; accent-color: var(--ink); }
.method b { display: block; font-size: 15px; }
.method small { color: var(--muted); font-size: 13px; }

.result { text-align: center; padding: 10px 0; }
.result-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 30px; font-weight: 900; color: #fff; background: var(--ink); }
.result[data-kind="good"] .result-icon { background: var(--good); }
.result[data-kind="bad"] .result-icon { background: var(--accent-ink); }
.result[data-kind="wait"] .result-icon { background: transparent; border: 5px solid var(--line); border-top-color: var(--ink); animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result h2 { margin: 0 0 6px; font-size: 24px; font-weight: 900; letter-spacing: -0.02em; }
.result p { margin: 0 auto; max-width: 420px; color: var(--muted); font-size: 15px; }

.order-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.order-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; text-decoration: none; }
.order-row:hover { border-color: var(--ink); }
.order-row b { font-size: 16px; }
.order-row small { display: block; color: var(--muted); font-size: 13px; }
.badge { font-size: 12px; font-weight: 700; padding: 5px 10px; border-radius: 999px; background: #e9e4d7; white-space: nowrap; }
.badge[data-status="PAID"] { background: #d7ecdf; color: #135e37; }
.badge[data-status="PAYMENT_WAIT"], .badge[data-status="PAYING"] { background: var(--ink); color: #fff; }
.badge[data-status="FAILED"], .badge[data-status="EXPIRED"] { background: #f1d9d1; color: #8f2508; }
.empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- 하단·도구 ---------- */
.foot { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; padding: 22px 16px 84px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.tools-toggle { position: fixed; right: 18px; bottom: 18px; z-index: 20; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; box-shadow: 0 8px 24px rgba(0, 0, 0, .22); }
.tools { position: fixed; right: 18px; bottom: 72px; z-index: 20; width: min(330px, calc(100vw - 36px)); background: var(--ink); color: #fff; border-radius: 16px; padding: 18px; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); }
.tools h2 { margin: 0; font-size: 15px; }
.tools p { margin: 4px 0 12px; font-size: 12px; opacity: .65; }
.tools button { display: block; width: 100%; text-align: left; margin-top: 6px; padding: 11px 12px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .22); background: transparent; color: #fff; font-size: 13px; font-weight: 600; }
.tools button:hover { background: rgba(255, 255, 255, .1); }
.tools-log { list-style: none; margin: 12px 0 0; padding: 0; font-size: 12px; max-height: 150px; overflow: auto; font-variant-numeric: tabular-nums; }
.tools-log li { padding: 4px 0; border-top: 1px solid rgba(255, 255, 255, .12); opacity: .85; }

.toasts { position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 13px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: drop-in .25s ease; }
.toast[data-kind="bad"] { background: var(--accent-ink); }
.toast[data-kind="good"] { background: var(--good); }
@keyframes drop-in { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 860px) {
  .drop { grid-template-columns: 1fr; }
  .brand-sub { display: none; }
  .timer-value { font-size: 52px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
