/* ============================================================
   먹플릭스 styles.css
   베이스: 넷플릭스 다크 (#141414 + #E50914 + Pretendard)
   하이라이트: 당첨 순간 네온 스포트라이트 폭발
   풀 width 반응형 레이아웃
   ============================================================ */

/* ── Pretendard 폰트 CDN ── */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

/* ─────────────────────────────────────────
   1. CSS 변수 (팔레트 / 간격 / 타이밍)
───────────────────────────────────────── */
:root {
  /* ── 넷플릭스 베이스 배경 ── */
  --bg-base:        #141414;
  --bg-dark:        #0b0b0b;
  --bg-card:        #1a1a1a;
  --bg-overlay:     rgba(20, 20, 20, 0.85);

  /* ── 넷플릭스 레드 ── */
  --red:            #E50914;
  --red-hover:      #F40612;
  --red-dim:        rgba(229, 9, 20, 0.18);

  /* ── 네온 스포트라이트 전용 색상 ── */
  --neon-pink:      #ff2e88;
  --neon-cyan:      #00f0ff;
  --neon-gold:      #ffd23f;
  --neon-pink-dim:  rgba(255, 46, 136, 0.35);
  --neon-cyan-dim:  rgba(0, 240, 255, 0.35);
  --neon-gold-dim:  rgba(255, 210, 63, 0.25);

  /* ── 텍스트 ── */
  --text-white:     #ffffff;
  --text-primary:   #e5e5e5;
  --text-muted:     #b3b3b3;
  --text-dim:       #666666;

  /* ── 보더 ── */
  --border-subtle:  rgba(255, 255, 255, 0.08);
  --border-mid:     rgba(255, 255, 255, 0.14);

  /* ── 레이아웃 ── */
  --nav-h:          64px;
  --page-px:        4vw;
  --page-px-sm:     16px;

  /* ── 릴 높이 (JS와 반드시 일치) ── */
  --reel-h:         72px;

  /* ── 타이밍 ── */
  --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);
  --ease-bounce:    cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1); /* 스포트라이트 등장 */

  --dur-fast:  0.15s;
  --dur-mid:   0.28s;
  --dur-slow:  0.45s;
}

/* ─────────────────────────────────────────
   2. 리셋 & 기본
───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100dvh;
  background-color: var(--bg-base);
  color: var(--text-primary);
  font-family: 'Pretendard', 'Noto Sans KR', system-ui, -apple-system, sans-serif;
  line-height: 1.55;
  /* 한글 줄바꿈 최적화 */
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }

button {
  cursor: pointer;
  font-family: inherit;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}

a {
  text-decoration: none;
  color: inherit;
}

[hidden] { display: none !important; }

/* ─────────────────────────────────────────
   3. 키프레임
───────────────────────────────────────── */

/* 위로 페이드인 (결과 히어로 카드) */
@keyframes fade-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 로고 레터스페이싱 등장 */
@keyframes logo-in {
  from { opacity: 0; letter-spacing: 0.18em; }
  to   { opacity: 1; letter-spacing: 0.02em; }
}

/* 토스트 슬라이드업 */
@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* 스피너 */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 레버 버튼 레드 펄스 */
@keyframes btn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(229, 9, 20, 0.55); }
  50%       { box-shadow: 0 0 0 10px rgba(229, 9, 20, 0); }
}

/* ★ 스포트라이트 카드 등장 — 스프링 스케일 */
@keyframes spotlight-pop {
  from {
    opacity: 0;
    transform: scale(0.55);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ★ 스포트라이트 배경 페이드인 */
@keyframes spotlight-bg-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ★ 네온 글로우 무한 펄스 (당첨 카드 테두리) */
@keyframes neon-pulse {
  0%, 100% {
    box-shadow:
      0 0 18px 4px  var(--neon-pink),
      0 0 40px 10px var(--neon-pink-dim),
      0 0 80px 20px var(--neon-cyan-dim),
      inset 0 0 20px rgba(255, 46, 136, 0.12);
  }
  33% {
    box-shadow:
      0 0 22px 6px  var(--neon-cyan),
      0 0 50px 14px var(--neon-cyan-dim),
      0 0 90px 28px var(--neon-pink-dim),
      inset 0 0 24px rgba(0, 240, 255, 0.14);
  }
  66% {
    box-shadow:
      0 0 20px 5px  var(--neon-gold),
      0 0 45px 12px var(--neon-gold-dim),
      0 0 85px 24px var(--neon-pink-dim),
      inset 0 0 22px rgba(255, 210, 63, 0.12);
  }
}

/* ★ 룰렛 진행 중 현재 카드 글로우 (is-rolling) */
@keyframes rolling-glow {
  0%, 100% {
    box-shadow:
      0 0 0 3px var(--red),
      0 0 18px 4px rgba(229, 9, 20, 0.7),
      0 0 36px 8px rgba(229, 9, 20, 0.35);
  }
  50% {
    box-shadow:
      0 0 0 3px #fff,
      0 0 22px 6px rgba(255, 255, 255, 0.6),
      0 0 44px 12px rgba(229, 9, 20, 0.4);
  }
}

/* ★ 최종 당첨 카드 네온 펄스 (is-winner) */
@keyframes winner-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 3px var(--neon-pink),
      0 0 20px 6px  var(--neon-pink),
      0 0 50px 16px var(--neon-pink-dim),
      0 0 80px 30px var(--neon-cyan-dim);
  }
  50% {
    box-shadow:
      0 0 0 3px var(--neon-cyan),
      0 0 24px 8px  var(--neon-cyan),
      0 0 60px 20px var(--neon-cyan-dim),
      0 0 90px 36px var(--neon-pink-dim);
  }
}

/* ─────────────────────────────────────────
   4. #app 래퍼
───────────────────────────────────────── */
#app {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ─────────────────────────────────────────
   5. 네비게이션 헤더 (header.nav)
───────────────────────────────────────── */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: var(--nav-h);
  /* 넷플릭스 상단 그라데이션 */
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.90) 0%,
    rgba(0, 0, 0, 0) 100%
  );
  transition: background var(--dur-mid) ease, backdrop-filter var(--dur-mid) ease;
}

/* 스크롤 후 어두운 배경 (JS에서 .scrolled 클래스 부착) */
.nav.scrolled {
  background: rgba(20, 20, 20, 0.97);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 var(--page-px);
}

/* 로고 */
.logo {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 900;
  letter-spacing: 0.02em;
  color: var(--red);
  text-shadow: 0 0 28px rgba(229, 9, 20, 0.5);
  line-height: 1;
  animation: logo-in 0.55s var(--ease-out-expo) both;
  user-select: none;
}

/* 로고 아래 태그라인 (p.nav-tag) */
.nav-tag {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-dim);
  letter-spacing: 0.04em;
  margin-top: 2px;
  line-height: 1;
}

/* 네비 우측 버튼/액션 */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid var(--border-mid);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-white);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.nav-btn:active {
  transform: scale(0.97);
}

/* ─────────────────────────────────────────
   6. 메인 (main.main)
───────────────────────────────────────── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-top: var(--nav-h);
}

/* ─────────────────────────────────────────
   7. 히어로 섹션 (section.hero) — 슬롯머신
───────────────────────────────────────── */
.hero {
  position: relative;
  min-height: clamp(420px, 55vh, 680px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: calc(var(--nav-h) + 40px) var(--page-px) 80px;
  background:
    linear-gradient(160deg, #0b0b0b 0%, #1a0a0a 35%, #141414 65%, #0b0b0b 100%);
  overflow: hidden;
}

/* 레드 방사형 광원 */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 70% 60% at 50% 30%,
    rgba(229, 9, 20, 0.09) 0%,
    transparent 70%
  );
  pointer-events: none;
}

/* 하단 페이드아웃 */
.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(to bottom, transparent, var(--bg-base));
  pointer-events: none;
}

.hero-kicker {
  position: relative;
  z-index: 1;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
}

.hero-title {
  position: relative;
  z-index: 1;
  font-size: clamp(1.5rem, 3.5vw, 2.8rem);
  font-weight: 800;
  color: var(--text-white);
  text-align: center;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.8);
}

/* ─────────────────────────────────────────
   8. 슬롯 릴 (.reels / .reel / .reel-strip / .reel-item)
───────────────────────────────────────── */
.reels {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0;
  border-radius: 6px;
  overflow: hidden;
  border: 1.5px solid rgba(229, 9, 20, 0.38);
  background: var(--bg-dark);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04),
    0 8px 32px rgba(0, 0, 0, 0.6),
    inset 0 0 24px rgba(0, 0, 0, 0.4);
  max-width: min(560px, 90vw);
  width: 100%;
}

/* 릴 중앙 페이라인 */
.reels::after {
  content: '';
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(229, 9, 20, 0.6) 20%,
    rgba(229, 9, 20, 0.95) 50%,
    rgba(229, 9, 20, 0.6) 80%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 4;
}

/* 개별 릴 */
.reel {
  flex: 1;
  height: var(--reel-h);
  overflow: hidden;
  position: relative;
  z-index: 1;
  -webkit-mask-image: linear-gradient(
    to bottom,
    transparent 0%, rgba(0,0,0,.2) 18%,
    black 38%, black 62%,
    rgba(0,0,0,.2) 82%, transparent 100%
  );
  mask-image: linear-gradient(
    to bottom,
    transparent 0%, rgba(0,0,0,.2) 18%,
    black 38%, black 62%,
    rgba(0,0,0,.2) 82%, transparent 100%
  );
}

.reel + .reel {
  border-left: 1px solid rgba(255, 255, 255, 0.06);
}

/* 릴 스트립 — JS가 translateY로 굴림 */
.reel-strip {
  display: flex;
  flex-direction: column;
  transition: transform 0.1s var(--ease-bounce);
  will-change: transform;
}

.reel-item {
  height: var(--reel-h);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-white);
  text-align: center;
  padding: 0 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}

/* ─────────────────────────────────────────
   9. 3단계 스텝 레이아웃 (section.step)
   JS가 새 DOM으로 렌더할 때 사용
───────────────────────────────────────── */
.step {
  padding: 36px var(--page-px);
  background: var(--bg-base);
  border-bottom: 1px solid var(--border-subtle);
}

/* 짝수 step — 살짝 더 어둡게 */
.step:nth-of-type(even) {
  background: var(--bg-dark);
}

/* 스텝 제목 */
.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
}

/* 단계 번호 뱃지 */
.step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--red);
  color: var(--text-white);
  font-size: 0.8rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* ─────────────────────────────────────────
   10. 검색 바 (.search-bar)
───────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: stretch;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* 검색 인풋 — 넷플릭스풍 다크 */
.search-input {
  flex: 1;
  min-width: 180px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1.5px solid var(--border-mid);
  border-radius: 4px;
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  outline: none;
  transition:
    border-color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    box-shadow var(--dur-fast) ease;
}

.search-input::placeholder {
  color: var(--text-dim);
}

.search-input:focus {
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* 지도 안내문 */
.map-hint {
  margin-top: 10px;
  font-size: 0.78rem;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────
   11. 맛집 찾기 바 (.find-bar / .spin-bar)
───────────────────────────────────────── */
.find-bar,
.spin-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

/* ─────────────────────────────────────────
   12. 버튼 공통 (.btn)
───────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  user-select: none;
  border: none;
  transition:
    background var(--dur-fast) ease,
    opacity var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-bounce),
    box-shadow var(--dur-fast) ease;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--text-white);
  outline-offset: 3px;
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  transform: none !important;
  pointer-events: none;
}

/* ── btn-play: 넷플릭스 흰 재생 버튼 ── */
.btn-play {
  background: var(--text-white);
  color: #000000;
  font-weight: 800;
  font-size: 1.05rem;
  padding: 14px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.btn-play:hover {
  background: rgba(255, 255, 255, 0.87);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}

.btn-play:active {
  transform: translateY(1px) scale(0.98);
}

/* 히어로 레버 버튼에 레드 펄스 */
#lever-btn.btn-play {
  animation: btn-pulse 2.4s ease-in-out infinite;
}

#lever-btn.btn-play:hover {
  animation: none;
}

/* ── btn-search: 레드 (검색 버튼) ── */
.btn-search {
  background: var(--red);
  color: var(--text-white);
  font-weight: 700;
}

.btn-search:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(229, 9, 20, 0.45);
}

.btn-search:active {
  transform: translateY(1px) scale(0.98);
}

/* ── btn-find: 레드 + 큼직 + 풀폭 (맛집 불러오기) ── */
.btn-find {
  background: var(--red);
  color: var(--text-white);
  font-weight: 800;
  font-size: 1.05rem;
  padding: 16px 40px;
  width: 100%;
  max-width: 480px;
  box-shadow: 0 4px 20px rgba(229, 9, 20, 0.35);
  border-radius: 6px;
}

.btn-find:hover {
  background: var(--red-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(229, 9, 20, 0.5);
}

.btn-find:active {
  transform: translateY(1px) scale(0.99);
}

/* ── btn-ghost: 투명 보더 (현위치 보조) ── */
.btn-ghost {
  background: transparent;
  color: var(--text-primary);
  border: 1.5px solid var(--border-mid);
  font-weight: 600;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
  color: var(--text-white);
  transform: translateY(-1px);
}

.btn-ghost:active {
  transform: translateY(1px) scale(0.98);
}

/* ── btn-shuffle: 반투명 회색 (다시 돌리기) ── */
.btn-shuffle {
  background: rgba(109, 109, 110, 0.7);
  color: var(--text-white);
  font-weight: 700;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-shuffle:hover {
  background: rgba(109, 109, 110, 0.9);
  transform: translateY(-1px);
}

.btn-shuffle:active {
  transform: translateY(1px) scale(0.98);
}

/* ── btn-primary: 레드 범용 ── */
.btn-primary {
  background: var(--red);
  color: var(--text-white);
}

.btn-primary:hover {
  background: var(--red-hover);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.98);
}

/* ── btn-secondary: 반투명 회색 범용 ── */
.btn-secondary {
  background: rgba(109, 109, 110, 0.7);
  color: var(--text-white);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.btn-secondary:hover {
  background: rgba(109, 109, 110, 0.9);
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(1px) scale(0.98);
}

/* ─────────────────────────────────────────
   13. 결과 히어로 (section.featured / #result)
───────────────────────────────────────── */
#result.featured {
  min-height: 0;
}

/* 넷플릭스 히어로 배너 카드 */
.result-hero {
  position: relative;
  min-height: clamp(280px, 40vw, 520px);
  background-color: #1a0a0a;
  background-size: cover;
  background-position: center top;
  display: flex;
  align-items: flex-end;
  animation: fade-up var(--dur-slow) var(--ease-out-expo) both;
  overflow: hidden;
}

.result-hero.no-bg {
  background: linear-gradient(135deg, #1a0a0a 0%, #0f0f0f 100%);
  align-items: center;
}

/* 좌측→우측 어두운 그라데이션 오버레이 */
.result-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to right,
      rgba(0, 0, 0, 0.93) 0%,
      rgba(0, 0, 0, 0.65) 45%,
      rgba(0, 0, 0, 0.22) 75%,
      transparent 100%
    ),
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.7) 0%,
      transparent 50%
    );
  pointer-events: none;
  z-index: 1;
}

/* 텍스트 블록 */
.result-hero-inner {
  position: relative;
  z-index: 2;
  padding: clamp(24px, 4vw, 60px) var(--page-px);
  max-width: min(600px, 100%);
}

/* 당첨 뱃지 */
.result-badge {
  display: inline-block;
  background: var(--red);
  color: var(--text-white);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 2px;
  margin-bottom: 12px;
}

/* 가게명 */
.result-name {
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  font-weight: 900;
  color: var(--text-white);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

/* 태그 그룹 */
.result-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* 메뉴 태그 강조 */
.tag.tag-menu {
  background: var(--red-dim);
  color: #ff6b6b;
  border-color: rgba(229, 9, 20, 0.3);
}

/* 주소 */
.result-addr {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  line-height: 1.4;
}

/* 액션 버튼 그룹 */
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

/* ─────────────────────────────────────────
   14. 콘텐츠 Row (.row)
───────────────────────────────────────── */
.row {
  padding: 32px var(--page-px);
  background: var(--bg-base);
}

.row:nth-child(even) {
  background: var(--bg-dark);
}

.row-title {
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 700;
  color: var(--text-white);
  letter-spacing: -0.01em;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
}

.row-sub {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ─────────────────────────────────────────
   15. 지도 (.map-wrap / .map)
───────────────────────────────────────── */
.map-wrap {
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

#map.map {
  width: 100%;
  height: clamp(240px, 28vw, 320px);
  display: block;
  /* 다크 지도 처리 */
  filter: invert(92%) hue-rotate(180deg) saturate(0.85) brightness(0.88);
}

/* ─────────────────────────────────────────
   16. 장르 필터 (.genre-block / .chip-row / .chip)
───────────────────────────────────────── */
.genre-block {
  margin-bottom: 20px;
}

.genre-block:last-child {
  margin-bottom: 0;
}

.genre-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* 가로 스크롤 칩 행 */
.chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

/* 개별 칩 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 2px;
  border: 1px solid var(--border-mid);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  transition:
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-bounce);
}

.chip-emoji {
  font-size: 1em;
  line-height: 1;
}

.chip:hover {
  border-color: rgba(255, 255, 255, 0.35);
  color: var(--text-white);
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.chip:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

/* 활성 칩 — 넷플릭스 레드 */
.chip.is-active,
.chip[aria-pressed="true"] {
  border-color: var(--red);
  background: var(--red-dim);
  color: var(--text-white);
  box-shadow: 0 0 0 1px rgba(229, 9, 20, 0.2);
}

.chip.is-active:hover,
.chip[aria-pressed="true"]:hover {
  background: rgba(229, 9, 20, 0.28);
}

/* ─────────────────────────────────────────
   17. 포스터 그리드 (.poster-grid) — step3 반응형
───────────────────────────────────────── */
.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

/* ─────────────────────────────────────────
   18. 포스터 가로 스크롤 row (.poster-row) — 기존 호환
───────────────────────────────────────── */
#candidates-row {
  background: var(--bg-dark);
}

.poster-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.poster-row::-webkit-scrollbar {
  display: none;
}

/* ─────────────────────────────────────────
   19. 포스터 카드 (.poster)
   poster-row와 poster-grid 양쪽에서 사용
───────────────────────────────────────── */
.poster {
  /* 가로 스크롤일 때 */
  flex-shrink: 0;
  width: clamp(140px, 15vw, 180px);
  /* 그리드일 때는 auto */
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  text-align: left;
  border-radius: 6px;
  position: relative;
  transition:
    transform var(--dur-mid) var(--ease-out-expo),
    box-shadow var(--dur-mid) ease;
}

/* poster-grid 안에서는 width 제어 없앰 */
.poster-grid .poster {
  width: auto;
}

.poster:hover {
  transform: scale(1.04) translateY(-3px);
  z-index: 2;
}

.poster:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 6px;
}

/* 포스터 이미지 영역 (2:3 비율) */
.poster-img {
  width: 100%;
  aspect-ratio: 2 / 3;
  background: var(--bg-card) center/cover no-repeat;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  transition: box-shadow var(--dur-mid) ease;
}

.poster:hover .poster-img {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.7);
}

/* 이미지 없을 때 이모지 중앙 */
.poster-img.no-img {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  background: linear-gradient(135deg, #1c1c1c, #2a2a2a);
}

/* 포스터 가게명 — 1줄 ellipsis */
.poster-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  transition: color var(--dur-fast) ease;
}

.poster:hover .poster-name {
  color: var(--text-white);
}

/* 포스터 평점 */
.poster-rating {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1;
}

/* ★★★ 룰렛 진행 중 — 현재 지나가는 카드 ★★★
   강한 레드/화이트 글로우 테두리, 눈에 확 띔 */
.poster.is-rolling {
  z-index: 3;
  border-radius: 6px;
  animation: rolling-glow 0.4s ease-in-out infinite;
  transform: scale(1.06);
}

.poster.is-rolling .poster-img {
  border-radius: 4px;
}

/* ★★★ 최종 당첨 카드 — 네온(핑크+시안) 글로우 펄스 ★★★ */
.poster.is-winner {
  z-index: 4;
  border-radius: 6px;
  transform: scale(1.08);
  animation: winner-pulse 1.6s ease-in-out infinite;
}

.poster.is-winner .poster-name {
  color: var(--neon-pink);
  text-shadow: 0 0 8px var(--neon-pink);
}

/* ─────────────────────────────────────────
   20. 빈 상태 (.empty-state)
───────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 24px;
  text-align: center;
  grid-column: 1 / -1; /* poster-grid 안에서 풀폭 */
}

.empty-emoji {
  font-size: 3rem;
  line-height: 1;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ─────────────────────────────────────────
   21. 기존 result-card 호환 (.result-card)
───────────────────────────────────────── */
.result-card {
  border-radius: 6px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  animation: fade-up var(--dur-slow) var(--ease-out-expo) both;
  margin: 0 var(--page-px);
}

.result-photo {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bg-dark) center/cover no-repeat;
  overflow: hidden;
}

.result-photo.no-photo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  background: linear-gradient(135deg, #1a0a0a, #1a1a1a);
}

.result-photo .result-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  margin-bottom: 0;
}

.result-body {
  padding: 20px 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.result-menu {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--red);
}

.result-card .result-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-white);
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-shadow: none;
  margin-bottom: 0;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 2px;
}

.result-rating {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f5c518;
}

.result-count,
.result-dist {
  color: var(--text-muted);
  font-size: 0.8rem;
}

.result-dist {
  font-weight: 600;
}

.result-card .result-addr {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 0;
}

.result-card .result-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.result-card .result-actions .btn {
  flex: 1;
  min-width: 120px;
}

.ph-emoji {
  font-size: 3.5rem;
  line-height: 1;
}

/* ─────────────────────────────────────────
   22. ★★★ 스포트라이트 오버레이 (#spotlight) ★★★
   당첨 순간 — 풀스크린, 가운데 확대 등장, 네온 뿜뿜
───────────────────────────────────────── */

/* 풀스크린 고정 오버레이 — 기본 hidden */
.spotlight {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  /* 기본 숨김 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity var(--dur-mid) ease,
    visibility var(--dur-mid) ease;
}

/* 어두운 블러 배경 */
.spotlight::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: -1;
}

/* .show 시 표시 */
.spotlight.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  animation: spotlight-bg-in 0.35s ease both;
}

/* 내부 래퍼 */
.spotlight-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
  max-width: 720px;
  max-height: 90dvh;
  overflow-y: auto;
  scrollbar-width: none;
}

.spotlight-inner::-webkit-scrollbar {
  display: none;
}

/* ★ 당첨 카드 — 화면 중앙에 크게, 스프링 등장 + 네온 폭발 ★ */
.spotlight-card {
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  /* 스프링 등장 애니메이션 */
  animation: spotlight-pop 0.55s var(--ease-spring) both;
  /* 네온 다중 박스쉐도우 글로우 — 등장 직후 최대치 */
  box-shadow:
    0 0 0 2px var(--neon-pink),
    0 0 24px 6px  var(--neon-pink),
    0 0 60px 18px var(--neon-pink-dim),
    0 0 100px 36px var(--neon-cyan-dim),
    0 0 160px 60px var(--neon-gold-dim),
    0 40px 80px rgba(0, 0, 0, 0.7);
}

/* 등장 후 은은한 무한 펄스 */
.spotlight.show .spotlight-card {
  animation:
    spotlight-pop 0.55s var(--ease-spring) both,
    neon-pulse 2.8s ease-in-out 0.6s infinite;
}

/* 스포트라이트 안의 .result-hero — 히어로 이미지 크게 */
.spotlight-card .result-hero {
  min-height: clamp(320px, 45vw, 540px);
  animation: none; /* 부모 애니로 대신함 */
}

/* 스포트라이트 안의 result-name — 네온 text-shadow */
.spotlight-card .result-name {
  text-shadow:
    0 0 16px var(--neon-pink),
    0 0 32px rgba(255, 46, 136, 0.5),
    0 2px 12px rgba(0, 0, 0, 0.8);
}

/* 스포트라이트 안의 result-badge — 핑크 강조 */
.spotlight-card .result-badge {
  background: var(--neon-pink);
  box-shadow: 0 0 12px var(--neon-pink), 0 0 24px var(--neon-pink-dim);
  text-shadow: 0 0 8px rgba(255, 46, 136, 0.8);
}

/* 스포트라이트 안의 태그 — 시안 강조 */
.spotlight-card .tag {
  border-color: rgba(0, 240, 255, 0.25);
  color: var(--neon-cyan);
}

.spotlight-card .tag.tag-menu {
  background: rgba(255, 46, 136, 0.2);
  border-color: var(--neon-pink-dim);
  color: var(--neon-pink);
  text-shadow: 0 0 6px var(--neon-pink);
}

/* 닫기 버튼 */
.spotlight-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-white);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1.5px solid rgba(255, 255, 255, 0.22);
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition:
    background var(--dur-fast) ease,
    border-color var(--dur-fast) ease,
    transform var(--dur-fast) var(--ease-bounce);
  flex-shrink: 0;
}

.spotlight-close:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.spotlight-close:focus-visible {
  outline: 2px solid var(--neon-cyan);
  outline-offset: 3px;
}

.spotlight-close:active {
  transform: scale(0.97);
}

/* ─────────────────────────────────────────
   23. 푸터 (footer.foot)
───────────────────────────────────────── */
.foot {
  padding: 28px var(--page-px);
  background: var(--bg-dark);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-dim);
  font-size: 0.8rem;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ─────────────────────────────────────────
   24. 토스트 (#toast)
───────────────────────────────────────── */
#toast.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  max-width: calc(100vw - 32px);
  width: max-content;
  padding: 12px 22px;
  border-radius: 4px;
  background: rgba(40, 40, 40, 0.96);
  border: 1px solid var(--border-mid);
  color: var(--text-white);
  font-size: 0.88rem;
  font-weight: 600;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  z-index: 10500;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur-mid) ease, visibility var(--dur-mid) ease;
}

#toast.toast.show {
  opacity: 1;
  visibility: visible;
  animation: toast-in 0.28s var(--ease-bounce) both;
}

/* ─────────────────────────────────────────
   25. 로딩 오버레이 (#loading)
───────────────────────────────────────── */
#loading.loading {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(20, 20, 20, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 8500;
}

#loading.loading span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* 스피너 */
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

/* ─────────────────────────────────────────
   26. 컨페티 캔버스
───────────────────────────────────────── */
canvas#confetti.confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 10000;
}

/* ─────────────────────────────────────────
   27. 전역 스크롤바
───────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ─────────────────────────────────────────
   28. 반응형 — 태블릿 (768px 이상)
───────────────────────────────────────── */
@media (min-width: 768px) {
  :root {
    --page-px: 5vw;
  }

  .hero {
    min-height: clamp(480px, 58vh, 700px);
    gap: 24px;
  }

  .chip {
    padding: 7px 16px;
    font-size: 0.88rem;
  }

  /* 가로 스크롤 포스터 — 태블릿에서 조금 넓게 */
  .poster-row .poster {
    width: clamp(160px, 14vw, 200px);
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }

  .result-hero-inner {
    padding: clamp(32px, 5vw, 72px) var(--page-px);
  }

  .spotlight-card .result-hero {
    min-height: clamp(360px, 48vw, 580px);
  }
}

/* ─────────────────────────────────────────
   29. 반응형 — 데스크탑 와이드 (1200px 이상)
───────────────────────────────────────── */
@media (min-width: 1200px) {
  :root {
    --page-px: 4vw;
    --nav-h:   68px;
  }

  .hero {
    min-height: clamp(520px, 60vh, 760px);
    gap: 28px;
  }

  .row, .step {
    padding: 40px var(--page-px);
  }

  .poster-row .poster {
    width: clamp(160px, 12vw, 210px);
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
    gap: 18px;
  }

  .result-hero {
    min-height: clamp(360px, 44vw, 580px);
  }

  .spotlight-card {
    max-width: 760px;
  }

  /* 장르 필터 두 블록 나란히 */
  .row:has(.genre-block + .genre-block),
  .step:has(.genre-block + .genre-block) {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    align-items: start;
    column-gap: 32px;
  }

  .row:has(.genre-block + .genre-block) .row-title,
  .step:has(.genre-block + .genre-block) .step-title {
    grid-column: 1 / -1;
  }
}

/* ─────────────────────────────────────────
   30. 반응형 — 모바일 (480px 이하)
───────────────────────────────────────── */
@media (max-width: 480px) {
  :root {
    --page-px: var(--page-px-sm);
    --nav-h:   56px;
    --reel-h:  64px;
  }

  .logo {
    font-size: 1.5rem;
  }

  .hero {
    min-height: clamp(360px, 70vw, 480px);
    padding: 40px var(--page-px-sm) 60px;
    gap: 16px;
  }

  .hero-title {
    font-size: clamp(1.3rem, 5vw, 1.8rem);
  }

  .btn-play {
    padding: 12px 24px;
    font-size: 0.95rem;
  }

  .btn-find {
    padding: 14px 24px;
    font-size: 0.95rem;
  }

  .row, .step {
    padding: 24px var(--page-px-sm);
  }

  .result-hero-inner {
    padding: 20px var(--page-px-sm);
  }

  .result-name {
    font-size: clamp(1.5rem, 6vw, 2rem);
  }

  .result-actions {
    flex-direction: column;
  }

  .result-actions .btn {
    width: 100%;
  }

  .poster-row .poster {
    width: 130px;
  }

  .poster-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }

  #map.map {
    height: 220px;
  }

  .nav-btn {
    padding: 7px 12px;
    font-size: 0.8rem;
  }

  /* 스포트라이트 — 모바일 풀폭 */
  .spotlight {
    padding: 12px;
    align-items: flex-end;
  }

  .spotlight-inner {
    max-height: 95dvh;
    gap: 14px;
  }

  .spotlight-card .result-hero {
    min-height: clamp(260px, 55vw, 400px);
  }

  .spotlight-card .result-name {
    font-size: clamp(1.4rem, 5vw, 1.9rem);
  }

  .search-bar {
    flex-direction: column;
  }

  .search-input {
    min-width: unset;
    width: 100%;
  }
}

/* ─────────────────────────────────────────
   31. 접근성 — 모션 감소 선호
───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .logo {
    animation: none;
  }

  .result-hero,
  .result-card,
  .spotlight-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reel-strip {
    transition: none;
  }

  #lever-btn.btn-play {
    animation: none;
  }

  .poster:hover {
    transform: none;
  }

  /* 룰렛/당첨 글로우는 정적 보더로 대체 */
  .poster.is-rolling {
    animation: none;
    box-shadow: 0 0 0 3px var(--red);
    transform: scale(1.04);
  }

  .poster.is-winner {
    animation: none;
    box-shadow: 0 0 0 3px var(--neon-pink);
    transform: scale(1.06);
  }

  .spotlight.show .spotlight-card {
    animation: none;
    opacity: 1;
    transform: scale(1);
    box-shadow:
      0 0 0 2px var(--neon-pink),
      0 0 24px 6px var(--neon-pink),
      0 40px 80px rgba(0, 0, 0, 0.7);
  }
}

/* ─────────────────────────────────────────
   32. 고대비 모드 보정
───────────────────────────────────────── */
@media (forced-colors: active) {
  .btn-play,
  .btn-search,
  .btn-find,
  .btn-ghost,
  .btn-shuffle,
  .btn-primary,
  .btn-secondary {
    forced-color-adjust: none;
    border: 2px solid ButtonText;
  }

  .chip.is-active,
  .chip[aria-pressed="true"] {
    outline: 2px solid Highlight;
    forced-color-adjust: none;
  }

  .spinner {
    border-top-color: Highlight;
  }

  .poster.is-rolling,
  .poster.is-winner {
    outline: 3px solid Highlight;
    forced-color-adjust: none;
  }

  .spotlight-card {
    forced-color-adjust: none;
    outline: 3px solid Highlight;
  }
}
