:root {
  --pink-1: #f9b3cf;
  --pink-2: #ec6b9d;
  --pink-3: #c9477c;
  --ink: #2b2522;
  --ink-2: #6f655f;
  --ink-3: #a39890;
  --paper: #faf6f1;
  --card: #ffffff;
  --beige: #f4ede4;
  --beige-line: #e8ddcf;
  --accent: #a67c62;
  --accent-dark: #8a6450;
  --heart: #f5b93a;
  --radius: 16px;
  --shadow: 0 6px 20px rgba(60, 40, 30, .10);
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  word-break: keep-all;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; }
img { display: block; }
[hidden] { display: none !important; }

/* ── 상단 안내 띠 ─────────────────────────── */
.notice {
  background: #1f1a18;
  color: #efe6dd;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  padding: 7px 16px;
}
.notice b { color: #ffc2d8; font-weight: 600; }

/* ── 인트로 ─────────────────────────────── */
.intro {
  position: relative;
  min-height: calc(100svh - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px 64px;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(120% 90% at 20% 0%, var(--pink-1) 0%, var(--pink-2) 55%, var(--pink-3) 100%);
}
.intro-bg { position: absolute; inset: 0; pointer-events: none; }
.intro-bg svg { position: absolute; }
.intro-bg .ball { width: 360px; height: 360px; left: -110px; top: -90px; opacity: .22; }
.intro-bg .ball.small { width: 180px; height: 180px; left: auto; right: -50px; top: auto; bottom: 60px; opacity: .14; }
.intro-bg .veil { inset: 0; width: 100%; height: 100%; opacity: .5; }
.intro[data-motif="ball"] .veil, .intro[data-motif="veil"] .ball { display: none; }

.intro-inner { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.intro-eyebrow {
  font-size: 12px; letter-spacing: .12em; font-weight: 600;
  padding: 5px 12px; border-radius: 99px; background: rgba(255, 255, 255, .2);
  margin-bottom: 18px;
}
.intro h1 {
  margin: 0;
  font-size: clamp(34px, 10vw, 52px);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -.02em;
  text-shadow: 0 2px 18px rgba(120, 20, 60, .25);
}
.intro .sub { margin: 16px 0 0; font-size: 16px; font-weight: 500; opacity: .95; }
.intro .count { margin: 26px 0 0; font-size: 13px; opacity: .85; }
.btn-enter {
  margin-top: 22px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 16px 30px;
  border-radius: 16px;
  background: #fff;
  color: var(--pink-3);
  font-weight: 700; font-size: 17px;
  box-shadow: 0 10px 30px rgba(120, 20, 60, .28);
  transition: transform .15s;
}
.btn-enter:active { transform: scale(.97); }
.link-list { margin-top: 18px; font-size: 13px; opacity: .9; text-underline-offset: 3px; }
.intro-thumbs {
  display: flex; gap: 6px; margin-top: 34px;
}
.intro-thumbs img {
  width: 54px; height: 72px; object-fit: cover; border-radius: 10px;
  border: 2px solid rgba(255, 255, 255, .7);
  box-shadow: 0 4px 12px rgba(120, 20, 60, .25);
}

/* ── 공통 헤더 ─────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: 10px 8px 8px;
  background: rgba(250, 246, 241, .94);
  backdrop-filter: blur(8px);
}
.topbar .back { width: 44px; height: 44px; font-size: 22px; color: var(--ink-2); }
.topbar .back:disabled { opacity: .25; }
.topbar .title { text-align: center; }
.topbar .round { font-weight: 800; font-size: 18px; }
.topbar .progress-text { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.progress { height: 3px; background: var(--beige-line); margin: 0 16px; border-radius: 3px; overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }

/* ── 대결 ─────────────────────────────── */
.match {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 14px 10px 32px;
  max-width: 880px; margin: 0 auto;
}
.vs {
  position: absolute; left: 50%; top: 170px; transform: translate(-50%, -50%);
  z-index: 3;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--paper); color: var(--accent);
  font-weight: 900; font-size: 15px; letter-spacing: -.02em;
  box-shadow: 0 2px 10px rgba(60, 40, 30, .15);
}
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-align: left;
  display: flex; flex-direction: column;
  transition: transform .2s, box-shadow .2s, opacity .3s;
}
.card-hit { position: absolute; inset: 0; z-index: 1; border-radius: var(--radius); }
.card .photo { position: relative; aspect-ratio: 3 / 4; background: var(--beige); overflow: hidden; }
.card .photo img { width: 100%; height: 100%; object-fit: cover; }
.card .photo::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 45%;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
}
.pick-hint {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  font-size: 10px; font-weight: 600; color: #fff;
  padding: 4px 8px; border-radius: 99px; background: rgba(0, 0, 0, .45);
}
.badge {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  font-size: 10px; font-weight: 700; color: #6b4a00;
  padding: 4px 7px; border-radius: 6px; background: #ffe39a;
}
.card .name {
  position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 2;
  color: #fff; font-weight: 800; font-size: 16px; line-height: 1.25;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
}
.card .name .badge { position: static; display: table; margin-bottom: 5px; text-shadow: none; line-height: 1.3; }
.card .name small { display: block; font-size: 10px; font-weight: 500; opacity: .85; letter-spacing: .04em; }
.thumbs { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; padding: 6px 6px 0; }
.thumbs button { aspect-ratio: 3 / 4; border-radius: 6px; overflow: hidden; background: var(--beige); position: relative; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .more {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .45); color: #fff; font-size: 11px; font-weight: 700;
}
.card .body { padding: 8px 9px 12px; display: flex; flex-direction: column; gap: 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag {
  font-size: 10.5px; font-weight: 600; color: var(--accent-dark);
  padding: 3px 7px; border-radius: 99px; background: var(--beige);
}
.price {
  border-radius: 10px; background: #fbf5ec; border: 1px solid var(--beige-line);
  padding: 7px 9px; font-size: 11.5px; line-height: 1.55;
}
.price .row { display: flex; justify-content: space-between; gap: 6px; }
.price .row span { color: var(--ink-2); }
.price .row b { font-weight: 700; }
.price.none { color: var(--ink-3); font-weight: 600; text-align: center; }
.desc { margin: 0; padding: 0; list-style: none; font-size: 12px; line-height: 1.5; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.desc li { display: flex; gap: 4px; }
.desc li::before { content: attr(data-icon); flex: none; }

/* 선택 효과 */
.card.picked { transform: scale(1.02); box-shadow: 0 0 0 3px var(--heart), var(--shadow); z-index: 2; }
.card.lost { opacity: .35; transform: scale(.97); }
.pick-burst {
  position: absolute; left: 50%; top: 38%; z-index: 4;
  transform: translate(-50%, -50%) scale(.6);
  padding: 9px 16px; border-radius: 99px;
  background: rgba(255, 255, 255, .92); color: var(--ink);
  font-weight: 800; font-size: 15px; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
  opacity: 0; pointer-events: none;
}
.card.picked .pick-burst { animation: burst .7s ease forwards; }
@keyframes burst {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ── 모달 ─────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(40, 30, 25, .55);
  display: grid; place-items: center; padding: 16px;
}
.modal {
  width: 100%; max-width: 340px;
  background: #fff; border-radius: 18px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
  position: relative;
}
.modal .close { position: absolute; top: 8px; right: 8px; width: 36px; height: 36px; font-size: 22px; color: var(--ink-2); }
.modal-head { text-align: center; padding: 26px 20px 16px; }
.modal-head .icon { font-size: 34px; }
.modal-head h2 { margin: 8px 0 0; font-size: 18px; }
.modal-body { background: var(--paper); padding: 16px 20px; }
.modal-body label { font-size: 13px; color: var(--ink-2); }
.modal-body select {
  margin-top: 8px; width: 100%; padding: 12px; font: inherit; font-size: 15px;
  border: 1px solid var(--beige-line); border-radius: 10px; background: #fff; color: var(--ink);
}
.modal-body .hint { margin: 8px 0 0; font-size: 12px; color: var(--ink-3); }
.modal-foot { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 20px 20px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 14px; border-radius: 12px; font-weight: 700; font-size: 15px; text-decoration: none;
}
.btn-ghost { border: 1px solid var(--beige-line); background: #fff; }
.btn-main { background: var(--accent); color: #fff; }
.btn-main:active { background: var(--accent-dark); }
.btn-pink { background: var(--pink-2); color: #fff; }

/* ── 라이트박스 ─────────────────────────── */
.lightbox {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 10, 8, .94);
  display: flex; flex-direction: column;
}
.lightbox .lb-top { display: flex; justify-content: space-between; align-items: center; padding: 12px 12px 8px 18px; color: #fff; }
.lightbox .lb-top b { font-size: 15px; }
.lightbox .lb-top span { font-size: 12px; opacity: .7; margin-left: 6px; }
.lightbox .lb-close { width: 40px; height: 40px; color: #fff; font-size: 26px; }
.lightbox .lb-stage { flex: 1; position: relative; display: grid; place-items: center; min-height: 0; touch-action: pan-y; }
.lightbox .lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lightbox .lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; color: #fff; font-size: 30px; opacity: .8; }
.lightbox .lb-prev { left: 0; }
.lightbox .lb-next { right: 0; }
.lightbox .lb-foot { padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
.lightbox .lb-foot .btn { width: 100%; }

/* ── 결과 ─────────────────────────────── */
.result { max-width: 480px; margin: 0 auto; padding: 8px 16px 48px; }
.result-head { text-align: center; padding: 14px 0 16px; }
.result-head .trophy { font-size: 40px; }
.result-head h2 { margin: 6px 0 0; font-size: 22px; }
.result-head p { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.winner { background: var(--card); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.winner .photo { position: relative; aspect-ratio: 4 / 5; background: var(--beige); overflow: hidden; }
.winner .photo img { width: 100%; height: 100%; object-fit: cover; }
.winner .photo::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(transparent, rgba(0, 0, 0, .55)); }
.winner .name { position: absolute; left: 16px; bottom: 14px; z-index: 1; color: #fff; font-size: 24px; font-weight: 800; }
.winner .name small { display: block; font-size: 12px; font-weight: 500; opacity: .85; letter-spacing: .05em; }
.winner .badge { font-size: 12px; top: 12px; left: 12px; }
.winner .thumbs { grid-template-columns: repeat(4, 1fr); padding: 8px 8px 0; }
.winner .body { padding: 14px 16px 18px; gap: 10px; }
.winner .desc { font-size: 14px; }
.winner .tag { font-size: 12px; padding: 4px 9px; }
.winner .price { font-size: 13px; }

.taste { margin-top: 18px; background: var(--card); border-radius: 18px; padding: 18px 16px; box-shadow: var(--shadow); }
.taste h3 { margin: 0; font-size: 16px; }
.taste .headline { margin: 6px 0 14px; font-size: 20px; font-weight: 800; color: var(--pink-3); }
.taste-row { display: grid; grid-template-columns: 78px 1fr 40px; align-items: center; gap: 8px; font-size: 13px; margin-top: 8px; }
.taste-row .bar { height: 10px; background: var(--beige); border-radius: 99px; overflow: hidden; }
.taste-row .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--pink-1), var(--pink-2)); border-radius: 99px; }
.taste-row b { text-align: right; font-size: 12px; color: var(--ink-2); }
.taste .note { margin: 12px 0 0; font-size: 11px; color: var(--ink-3); }

.actions { display: grid; gap: 8px; margin-top: 18px; }
.actions .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); z-index: 70;
  background: rgba(30, 24, 20, .92); color: #fff; font-size: 13px;
  padding: 10px 16px; border-radius: 99px;
}

.finalists { margin-top: 22px; }
.finalists h3 { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.finalists ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.finalists a { text-decoration: none; display: block; }
.finalists img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: var(--beige); }
.finalists span { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; text-align: center; }

/* ── 리스트 ─────────────────────────────── */
.list-wrap { max-width: 880px; margin: 0 auto; padding: 0 16px 48px; }
.list-head { padding: 18px 0 6px; }
.list-head h1 { margin: 0; font-size: 22px; }
.list-head p { margin: 6px 0 0; font-size: 13px; color: var(--ink-2); }
.filters {
  position: sticky; top: 0; z-index: 5;
  display: flex; gap: 6px; overflow-x: auto; padding: 12px 0;
  background: var(--paper);
  scrollbar-width: none;
}
.filters::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 7px 12px; border-radius: 99px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--beige-line); background: #fff; color: var(--ink-2);
}
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 860px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.shop { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); text-decoration: none; display: flex; flex-direction: column; }
.shop .photo { position: relative; aspect-ratio: 3 / 4; background: var(--beige); overflow: hidden; }
.shop .photo img { width: 100%; height: 100%; object-fit: cover; }
.shop .info { padding: 9px 10px 12px; display: flex; flex-direction: column; gap: 6px; }
.shop .info b { font-size: 14px; }
.shop .info p { margin: 0; font-size: 12px; color: var(--ink-2); line-height: 1.45; }
.list-cta { text-align: center; margin-top: 24px; }

/* 데스크톱 */
@media (min-width: 720px) {
  .match { gap: 20px; padding-top: 20px; max-width: 660px; }
  .vs { top: 50%; width: 52px; height: 52px; font-size: 18px; }
  .card .name { font-size: 20px; }
  .card .body { padding: 12px 14px 16px; }
  .tag { font-size: 12px; }
  .price { font-size: 13px; }
  .desc { font-size: 13.5px; }
  .pick-hint { font-size: 12px; }
}
