* { box-sizing: border-box; }

:root {
  --red: #e50914;
  --bg: #0b0b0f;
  --panel: #16161c;
  --line: rgba(255, 255, 255, 0.08);
  --muted: #9e9ea8;
  --pad: 44px;
  --card-w: 176px;
}

html, body { margin: 0; background: var(--bg); color: #fff; }
body {
  font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }

/* ---------- 헤더 ---------- */
.header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 0 var(--pad);
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent);
  transition: background 0.25s, border-color 0.25s;
  border-bottom: 1px solid transparent;
}
.header.solid, body.is-filtered .header {
  background: rgba(11, 11, 15, 0.9);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom-color: var(--line);
}
.logo { font-size: 26px; font-weight: 900; color: var(--red); letter-spacing: -0.05em; flex-shrink: 0; }

.chips {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 90%, transparent);
  mask-image: linear-gradient(to right, #000 90%, transparent);
  padding-right: 30px;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 0;
  border-radius: 99px;
  background: transparent;
  color: #cfcfd6;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.chip:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.chip.active { background: #fff; color: #111; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.search-box { position: relative; display: block; }
.search-box input {
  width: 210px;
  height: 38px;
  padding: 0 34px 0 36px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23999' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E") no-repeat 13px center;
  color: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: width 0.25s, border-color 0.15s, background-color 0.15s;
}
.search-box input:focus { width: 260px; border-color: rgba(255, 255, 255, 0.35); background-color: rgba(255, 255, 255, 0.1); }
.search-box kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  padding: 1px 6px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #888; font-size: 11px; font-family: inherit;
  pointer-events: none;
}
.search-box input:focus + kbd, .search-box input:not(:placeholder-shown) + kbd { display: none; }
.hbtn {
  display: inline-flex; align-items: center; height: 38px; padding: 0 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  font-size: 14px; font-weight: 600;
  transition: background 0.15s;
}
.hbtn:hover { background: rgba(255, 255, 255, 0.16); }
.hbtn.map { background: rgba(229, 9, 20, 0.16); color: #ff9aa0; border-color: rgba(229, 9, 20, 0.3); }
.hbtn.map:hover { background: var(--red); color: #fff; }

/* ---------- 추천 배너 ---------- */
.spotlight {
  position: relative;
  height: min(82vh, 760px);
  min-height: 520px;
  overflow: hidden;
}
.spot {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0.9s;
}
.spot.on { opacity: 1; visibility: visible; }
.spot-bg { position: absolute; inset: -40px; }
.spot-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: blur(26px) brightness(0.45) saturate(1.35);
  transform: scale(1.12);
}
.spot.on .spot-bg img { animation: kenburns 9s ease-out both; }
@keyframes kenburns { from { transform: scale(1.22); } to { transform: scale(1.1); } }
.spot::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 15, 0.2) 45%, rgba(11, 11, 15, 0.45) 100%),
    linear-gradient(to right, rgba(11, 11, 15, 0.85) 0%, transparent 65%);
}
.spot-inner {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 44px;
  padding: 90px var(--pad) 70px;
  max-width: 1300px;
}
.spot-poster {
  flex: 0 0 auto;
  width: min(22vw, 270px);
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  overflow: hidden;
  background: #1c1c22;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.spot-poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.spot-poster:hover img { transform: scale(1.04); }
.spot-text { min-width: 0; max-width: 620px; }
.spot.on .spot-poster, .spot.on .spot-text > * { animation: rise 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.spot.on .spot-text > *:nth-child(2) { animation-delay: 0.06s; }
.spot.on .spot-text > *:nth-child(3) { animation-delay: 0.12s; }
.spot.on .spot-text > *:nth-child(4) { animation-delay: 0.18s; }
.spot.on .spot-text > *:nth-child(5) { animation-delay: 0.24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.spot-kicker { display: inline-block; margin-bottom: 14px; color: #ff8a90; font-size: 13px; font-weight: 800; letter-spacing: 0.04em; }
.spot h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.045em;
  word-break: keep-all;
}
.spot-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; color: #d4d4da; font-size: 15px; }
.spot-meta b { color: #fff; }
.stars { position: relative; display: inline-block; letter-spacing: 2px; font-size: 18px; line-height: 1; }
.stars span:first-child { color: rgba(255, 255, 255, 0.2); }
.stars span:last-child { position: absolute; left: 0; top: 0; width: var(--r); overflow: hidden; white-space: nowrap; color: #f5b301; }
.spot-text p { margin: 0 0 22px; color: #e1e1e6; font-size: 16px; line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.spot-text p.tags { color: #ffb3b7; }
.spot-actions { display: flex; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; height: 46px; padding: 0 22px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 15px; font-weight: 700;
  backdrop-filter: blur(6px);
  transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.24); transform: translateY(-1px); }
.btn.primary { background: #fff; color: #111; border-color: #fff; }
.btn.primary:hover { background: #e7e7ea; }

/* 썸네일 스트립 + 진행 막대 */
.spot-thumbs {
  position: absolute; z-index: 4;
  right: var(--pad); bottom: 44px;
  display: flex; gap: 8px;
  max-width: 50vw;
  overflow-x: auto; scrollbar-width: none;
  padding: 10px 4px 4px;
}
.spot-thumbs::-webkit-scrollbar { display: none; }
.spot-thumbs button {
  position: relative;
  flex: 0 0 auto;
  width: 54px; height: 78px;
  padding: 0; border: 0; border-radius: 9px;
  overflow: hidden;
  background: #222;
  cursor: pointer;
  opacity: 0.5;
  transform: translateY(0) scale(0.94);
  filter: grayscale(0.4);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  transition: opacity 0.35s ease, transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1), filter 0.35s ease, box-shadow 0.35s;
}
.spot-thumbs button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.spot-thumbs button:hover { opacity: 0.9; filter: none; transform: translateY(-6px) scale(1); }
.spot-thumbs button.on { opacity: 1; filter: none; transform: translateY(-8px) scale(1.06); box-shadow: 0 0 0 2px #fff, 0 12px 26px rgba(0, 0, 0, 0.55); }
.spot-thumbs button i { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--red); }
.spot-thumbs button.on i { animation: progress 7s linear forwards; }
.spotlight.paused .spot-thumbs button.on i { animation-play-state: paused; }
@keyframes progress { to { width: 100%; } }

.spot-count {
  position: absolute; z-index: 4;
  left: var(--pad); bottom: 48px;
  color: #aaa; font-size: 13px; font-weight: 600; letter-spacing: 0.08em;
}
.spot-count b { color: #fff; font-size: 18px; }

.spot-nav {
  position: absolute; z-index: 4; top: 50%;
  width: 48px; height: 48px; margin-top: -24px;
  border: 1px solid rgba(255, 255, 255, 0.18); border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  color: #fff; font-size: 26px; line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.25s;
}
.spot-nav.prev { left: 16px; }
.spot-nav.next { right: 16px; }
.spotlight:hover .spot-nav { opacity: 1; transform: scale(1); }
.spot-nav:hover { background: rgba(255, 255, 255, 0.22); transform: scale(1.08) !important; }

/* 슬라이드 전환: 진행 방향으로 밀려나고 들어옴 */
.spotlight { --dir: 1; --drag: 0px; touch-action: pan-y; user-select: none; }
.spot { transition: opacity 0.9s ease, visibility 0.9s; }
.spot .spot-inner { transition: transform 0.9s cubic-bezier(0.22, 0.61, 0.36, 1); }
.spot.leaving .spot-inner { transform: translateX(calc(var(--dir) * -60px)); }
.spot.entering .spot-poster { animation: posterIn 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) backwards; }
.spot.entering .spot-text > * { animation: textIn 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) backwards; }
.spot.entering .spot-text > *:nth-child(2) { animation-delay: 0.05s; }
.spot.entering .spot-text > *:nth-child(3) { animation-delay: 0.1s; }
.spot.entering .spot-text > *:nth-child(4) { animation-delay: 0.15s; }
.spot.entering .spot-text > *:nth-child(5) { animation-delay: 0.2s; }
@keyframes posterIn { from { opacity: 0; transform: translateX(calc(var(--dir) * 70px)) rotateY(calc(var(--dir) * -14deg)) scale(0.94); } }
@keyframes textIn { from { opacity: 0; transform: translateX(calc(var(--dir) * 40px)); } }

/* 드래그 중: 현재 슬라이드가 손을 따라옴 */
.spotlight.dragging .spot.on .spot-inner { transform: translateX(var(--drag)); transition: none; }
.spotlight.dragging { cursor: grabbing; }

/* 3D 틸트 + 빛 반사 + 배경 패럴랙스 */
.spot-inner { perspective: 1000px; }
.spot { --tx: 0; --ty: 0; }
.spot-poster {
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(calc(var(--tx) * 4deg)) rotateX(calc(var(--ty) * -3deg)) translateZ(0);
  transition: transform 1.1s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.8s ease;
  will-change: transform;
}
.spot-poster:hover { box-shadow: 0 40px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.14); }
.spot-poster .glare {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at calc(50% + var(--tx) * 45%) calc(40% + var(--ty) * 45%), rgba(255, 255, 255, 0.28), transparent 55%);
  opacity: 0;
  transition: opacity 0.5s ease;
  mix-blend-mode: soft-light;
}
.spotlight:hover .spot.on .glare { opacity: 1; }
.spot-bg img { transition: translate 1.4s cubic-bezier(0.22, 0.61, 0.36, 1); translate: calc(var(--tx) * -8px) calc(var(--ty) * -6px); }
.spot-text { transform: translate(calc(var(--tx) * 3px), calc(var(--ty) * 2px)); transition: transform 1.2s cubic-bezier(0.22, 0.61, 0.36, 1); }
/* ---------- 행 ---------- */
#homeView { position: relative; z-index: 2; margin-top: -40px; }
.row {
  padding: 14px var(--pad) 10px;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.row.in { opacity: 1; transform: none; }
.row-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.row-head h2 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -0.03em; }
.row-head h2 small { margin-left: 6px; color: var(--muted); font-size: 13px; font-weight: 600; }
.more {
  border: 0; background: none; padding: 4px 0;
  color: var(--muted); font-size: 13px; font-weight: 700;
  cursor: pointer;
  transition: color 0.15s;
}
.more:hover { color: #fff; }

.row { overflow: visible; }
.rail-wrap { position: relative; margin: 0 calc(-1 * var(--pad)); }
.rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 14px var(--pad) 22px;         /* 위 여백: 호버로 떠오르는 카드가 잘리지 않게 */
  scroll-padding-inline: var(--pad);
  scroll-snap-type: x proximity;          /* 손 떼면 카드 경계에 살짝 맞춤(강제 아님) */
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  cursor: grab;
}
.rail::-webkit-scrollbar { display: none; }
.rail.dragging { cursor: grabbing; scroll-snap-type: none; scroll-behavior: auto; user-select: none; }
.rail.dragging .card { pointer-events: none; }
.rail > .card { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.top10 .rail > .card { flex-basis: calc(var(--card-w) + 58px); }
.rail img { -webkit-user-drag: none; user-select: none; }

.rail-btn {
  position: absolute;
  z-index: 3;
  top: 14px;
  bottom: 22px;
  width: calc(var(--pad) + 8px);
  border: 0;
  padding: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 300;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.rail-btn.prev { left: 0; background: linear-gradient(to right, rgba(11, 11, 15, 0.92), rgba(11, 11, 15, 0)); }
.rail-btn.next { right: 0; background: linear-gradient(to left, rgba(11, 11, 15, 0.92), rgba(11, 11, 15, 0)); }
.row:hover .rail-btn:not(:disabled) { opacity: 1; }
.rail-btn:hover { font-size: 40px; }
.rail-btn:disabled { opacity: 0 !important; pointer-events: none; }

/* 가장자리 페이드: 더 있음을 암시 */
.rail-wrap::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 40px;
  pointer-events: none;
  background: linear-gradient(to left, var(--bg), transparent);
  transition: opacity 0.2s;
}
.rail-wrap.at-end::after { opacity: 0; }
/* ---------- 카드 ---------- */
.card { display: block; position: relative; }
.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a20;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transform: translateZ(0);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1), box-shadow 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1); }
.poster::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 55%);
  opacity: 0;
  transition: opacity 0.45s ease;
  pointer-events: none;
}
.noimg {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #2a2a33, #16161b);
  color: rgba(255, 255, 255, 0.7); font-size: 44px; font-weight: 800;
}
.t-hotel .noimg { background: linear-gradient(135deg, #4c2f8f, #16161b); }
.t-travel .noimg { background: linear-gradient(135deg, #1f4a8f, #16161b); }
.t-food .noimg { background: linear-gradient(135deg, #8a3f0e, #16161b); }
.t-cafe .noimg { background: linear-gradient(135deg, #6b4a1f, #16161b); }

.badge {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: 99px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  font-size: 11px; font-weight: 700;
}
.fav { position: absolute; top: 7px; right: 9px; color: #ff4d6d; font-size: 15px; text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6); }

.hover-info {
  position: absolute; inset: auto 0 0 0;
  padding: 40px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 35%, transparent);
  z-index: 1;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.hover-info strong { display: block; font-size: 14px; line-height: 1.3; margin-bottom: 4px; }
.hover-info span { display: block; font-size: 12px; color: #d0d0d6; }
.hover-info em { display: block; margin-top: 4px; font-style: normal; font-size: 11px; color: #ff9aa0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-cap { padding: 9px 2px 0; }
.card-cap strong { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-cap span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }

.card-cap { transition: opacity 0.35s ease; }
@media (hover: hover) {
  /* 마우스를 빠르게 훑고 지나갈 때 깜빡이지 않도록 살짝 늦게 반응 */
  .card:hover .poster { transform: translateY(-4px) scale(1.025); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5); transition-delay: 60ms; }
  .card:hover .poster img { transform: scale(1.05); transition-delay: 60ms; }
  .card:hover .poster::after { opacity: 1; transition-delay: 60ms; }
  .card:hover .hover-info { opacity: 1; transform: none; transition-delay: 90ms; }
  .card:hover .card-cap { opacity: 0.55; }
  .card:focus-visible .poster { outline: 2px solid #fff; outline-offset: 3px; }
  .rail .card:hover, .grid .card:hover { z-index: 2; }
}

/* TOP 10 */
.card.ranked { display: flex; align-items: flex-end; }
.rank {
  flex: 0 0 auto;
  width: 64px;
  margin-right: -8px;
  font-size: 118px;
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.08em;
  color: var(--bg);
  -webkit-text-stroke: 3px rgba(255, 255, 255, 0.7);
  text-align: right;
  user-select: none;
}
.card.ranked .poster { flex: 1; }
.card.ranked .card-cap { display: none; }

/* ---------- 그리드 ---------- */
.grid-view { padding: 96px var(--pad) 20px; min-height: 70vh; }
.grid-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.grid-head h2 { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.grid-head h2 small { color: var(--muted); font-size: 15px; font-weight: 600; margin-left: 4px; }
.grid-tools { display: flex; gap: 8px; }
.grid-tools select, .ghost {
  height: 38px; padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.grid-tools select option { background: #1a1a20; }
.ghost:hover { background: rgba(255, 255, 255, 0.12); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 22px 16px;
}
.grid .card { animation: rise 0.45s ease both; animation-delay: var(--d, 0ms); }
.empty { padding: 80px 0; text-align: center; color: var(--muted); font-size: 15px; }

/* ---------- 푸터 ---------- */
.footer { margin-top: 70px; padding: 40px var(--pad); background: #08080b; border-top: 1px solid var(--line); color: #8a8a94; }
.footer-inner { max-width: 1200px; }
.footer-logo { font-size: 24px; font-weight: 900; color: var(--red); margin-bottom: 14px; letter-spacing: -0.05em; }
.footer-info { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.footer-info p { margin: 0; font-size: 13px; line-height: 1.8; }
.footer-info strong { color: #cfcfd6; margin-right: 6px; font-weight: 600; }

/* ---------- 반응형 ---------- */
@media (max-width: 1100px) {
  .search-box input, .search-box input:focus { width: 170px; }
  .hbtn span { display: none; }
}
@media (max-width: 768px) {
  :root { --pad: 16px; --card-w: 128px; }
  .header {
    height: auto;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px var(--pad);
    background: rgba(11, 11, 15, 0.92);
    backdrop-filter: blur(12px);
  }
  .logo { font-size: 22px; }
  .header-actions { margin-left: auto; }
  .search-box input, .search-box input:focus { width: 150px; height: 34px; }
  .search-box kbd { display: none; }
  .hbtn { height: 34px; padding: 0 11px; }
  .chips { order: 3; flex-basis: 100%; -webkit-mask-image: none; mask-image: none; padding-right: 0; }
  .chip { padding: 6px 11px; font-size: 13px; }

  .spotlight { height: auto; min-height: 0; }
  .spot { position: relative; display: none; }
  .spot.on { display: block; }
  .spot-inner { flex-direction: column; align-items: center; text-align: center; gap: 18px; padding: 120px var(--pad) 56px; }
  .spot-poster { width: 46vw; max-width: 200px; }
  .spot-meta, .spot-actions { justify-content: center; }
  .spot h1 { font-size: 30px; }
  .spot-text p { font-size: 14px; }
  .btn { height: 42px; padding: 0 18px; font-size: 14px; }
  .spot-thumbs { right: 50%; transform: translateX(50%); bottom: 16px; max-width: 92vw; gap: 6px; }
  .spot-thumbs button { width: 34px; height: 48px; border-radius: 6px; }
  .spot-count, .spot-nav { display: none; }
  .spot-inner { padding-bottom: 86px; }
  .spot-poster { transform: none; }

  #homeView { margin-top: 0; }
  .row-head h2 { font-size: 18px; }
  .rank { width: 44px; font-size: 80px; -webkit-text-stroke-width: 2px; }
  .top10 .rail > .card { flex-basis: calc(var(--card-w) + 38px); }
  .rail { gap: 10px; cursor: auto; }
  .rail-btn { display: none; }
  .rail-wrap::after { width: 24px; }
  .grid-view { padding-top: 130px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 16px 10px; }
  .grid-head h2 { font-size: 21px; }
  .card-cap strong { font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .row { opacity: 1; transform: none; }
}


/* ==========================================================
   호버 트랜지션 (버튼 · 칩 · 링크)
   ========================================================== */
:root { --ease: cubic-bezier(0.22, 0.61, 0.36, 1); }

/* 버튼: 살짝 떠오르며 빛이 한 번 스쳐 지나감 */
.btn { position: relative; overflow: hidden; transition: background 0.3s var(--ease), transform 0.35s var(--ease), box-shadow 0.35s var(--ease), color 0.3s; }
.btn span { position: relative; z-index: 1; }
.btn::before {
  content: "";
  position: absolute; top: 0; bottom: 0; left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  transition: left 0s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.35); }
.btn:hover::before { left: 130%; transition: left 0.7s var(--ease); }
.btn:active { transform: translateY(0) scale(0.97); transition-duration: 0.1s; }
.btn.primary:hover { background: #fff; box-shadow: 0 10px 28px rgba(255, 255, 255, 0.18); }

/* 카테고리 칩: 배경이 부드럽게 차오름 */
.chip { position: relative; transition: color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease); }
.chip:hover { transform: translateY(-1px); }
.chip:active { transform: scale(0.95); transition-duration: 0.1s; }
.chip.active { box-shadow: 0 6px 16px rgba(255, 255, 255, 0.15); }

/* 헤더 버튼 */
.hbtn { transition: background 0.3s var(--ease), color 0.3s, transform 0.3s var(--ease), border-color 0.3s; }
.hbtn:hover { transform: translateY(-1px); }
.logo { transition: letter-spacing 0.4s var(--ease), text-shadow 0.4s; }
.logo:hover { letter-spacing: -0.02em; text-shadow: 0 0 18px rgba(229, 9, 20, 0.55); }

/* "전체보기" 링크: 밑줄이 왼쪽부터 그어지고 화살표가 밀림 */
.more { position: relative; transition: color 0.3s var(--ease), padding 0.3s var(--ease); }
.more::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease);
}
.more:hover { padding-right: 4px; }
.more:hover::after { transform: scaleX(1); }

/* 행 제목 */
.row-head h2 { transition: transform 0.35s var(--ease); }
.row:hover .row-head h2 { transform: translateX(3px); }

/* 줄 화살표 */
.rail-btn { transition: opacity 0.3s var(--ease), font-size 0.25s var(--ease), background 0.3s; }

/* 카드 배지/찜: 호버 시 살짝 반응 */
.badge, .fav { transition: transform 0.4s var(--ease), background 0.3s; }
@media (hover: hover) {
  .card:hover .badge { transform: translateY(-2px); background: rgba(229, 9, 20, 0.85); }
  .card:hover .fav { transform: scale(1.2); }
}

/* 검색창 포커스 */
.search-box input { transition: width 0.4s var(--ease), border-color 0.3s, background-color 0.3s, box-shadow 0.3s; }
.search-box input:focus { box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.06); }

/* 정렬/초기화 */
.grid-tools select, .ghost { transition: background 0.3s var(--ease), border-color 0.3s, transform 0.3s var(--ease); }
.grid-tools select:hover, .ghost:hover { border-color: rgba(255, 255, 255, 0.25); transform: translateY(-1px); }

@media (prefers-reduced-motion: reduce) {
  .btn::before { display: none; }
}

/* ==========================================================
   호버 지연·속도 조정 (확확 움직이지 않게)
   - 올릴 때: 조금 기다렸다가 천천히 반응
   - 뗄 때: 지연 없이 부드럽게 원위치
   ========================================================== */
:root { --hover-delay: 140ms; --hover-dur: 0.6s; --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94); }

.poster { transition: transform var(--hover-dur) var(--ease-soft), box-shadow var(--hover-dur) var(--ease-soft); }
.poster img { transition: transform 1.1s var(--ease-soft); }
.poster::after { transition: opacity 0.6s var(--ease-soft); }
.hover-info { transition: opacity 0.5s var(--ease-soft), transform 0.6s var(--ease-soft); }
@media (hover: hover) {
  .card:hover .poster { transform: translateY(-3px) scale(1.02); transition-delay: var(--hover-delay); }
  .card:hover .poster img { transform: scale(1.04); transition-delay: var(--hover-delay); }
  .card:hover .poster::after { transition-delay: var(--hover-delay); }
  .card:hover .hover-info { transition-delay: calc(var(--hover-delay) + 120ms); }
  .card:hover .badge, .card:hover .fav { transition-delay: var(--hover-delay); }
}

.btn { transition: background 0.5s var(--ease-soft), transform 0.55s var(--ease-soft), box-shadow 0.55s var(--ease-soft), color 0.4s; }
.btn:hover { transform: translateY(-1px); transition-delay: 80ms; }
.btn:hover::before { transition: left 1s var(--ease-soft) 120ms; }

.chip, .hbtn { transition: color 0.45s var(--ease-soft), background 0.45s var(--ease-soft), transform 0.45s var(--ease-soft), border-color 0.45s; }
.chip:hover, .hbtn:hover { transition-delay: 60ms; }

.spot-thumbs button { transition: opacity 0.55s var(--ease-soft), transform 0.6s var(--ease-soft), filter 0.55s var(--ease-soft), box-shadow 0.55s; }
.spot-thumbs button:hover { transform: translateY(-4px) scale(0.98); transition-delay: 90ms; }
.spot-thumbs button.on { transform: translateY(-6px) scale(1.04); }

.spot-nav { transition: opacity 0.5s var(--ease-soft), transform 0.55s var(--ease-soft), background 0.4s; }
.spot-nav:hover { transform: scale(1.04) !important; transition-delay: 60ms; }

.more, .more::after, .row-head h2 { transition-duration: 0.5s; transition-timing-function: var(--ease-soft); }
.row:hover .row-head h2 { transform: translateX(2px); transition-delay: 100ms; }
.logo { transition: letter-spacing 0.6s var(--ease-soft), text-shadow 0.6s; }
.rail-btn { transition: opacity 0.45s var(--ease-soft), font-size 0.4s var(--ease-soft); }
.row:hover .rail-btn:not(:disabled) { transition-delay: 120ms; }
/* 긴 제목이 카드 폭을 늘리지 않도록 (flex/grid 항목의 최소 폭 = 내용 폭 기본값 해제) */
.card, .rail > .card, .grid > .card { min-width: 0; max-width: 100%; }
.rail > .card { width: var(--card-w); max-width: var(--card-w); }
.top10 .rail > .card { width: calc(var(--card-w) + 58px); max-width: calc(var(--card-w) + 58px); }
.card-cap { min-width: 0; overflow: hidden; }
.card-cap strong, .card-cap span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card.ranked .poster { min-width: 0; }
@media (max-width: 768px) {
  .top10 .rail > .card { width: calc(var(--card-w) + 38px); max-width: calc(var(--card-w) + 38px); }
}
/* ---------- 위시리스트 카드/칩 ---------- */
.card.is-wish .poster { box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.55), 0 6px 18px rgba(0, 0, 0, 0.35); }
.card.is-wish .poster::before {
  content: "";
  position: absolute; inset: 0; z-index: 1;
  border-radius: inherit;
  border: 2px dashed rgba(233, 225, 255, 0.55);
  pointer-events: none;
}
.card.is-wish .poster img { filter: saturate(0.75) brightness(0.92); }
.card.is-wish .badge { background: rgba(139, 92, 246, 0.85); }
.card.is-wish .card-cap span { color: #c4b5fd; }
.chip.chip-wish { color: #d8ccff; }
.chip.chip-wish.active { background: #8b5cf6; color: #fff; box-shadow: 0 6px 16px rgba(139, 92, 246, 0.35); }
#r-wish .row-head h2 { color: #e4dcff; }

/* 결산 바로가기 */
.hbtn.recap { background: rgba(245, 179, 1, 0.14); border-color: rgba(245, 179, 1, 0.3); color: #ffd666; }
.hbtn.recap:hover { background: #f5b301; color: #111; }

/* 앱 설치 버튼 / 앱 모드 */
.hbtn.install { background: rgba(34, 197, 94, 0.14); border-color: rgba(34, 197, 94, 0.35); color: #86efac; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; }
.hbtn.install:hover { background: #22c55e; color: #06270f; }
.footer-links { margin: 0 0 14px; font-size: 14px; }
.footer-links a { color: #cfcfd6; transition: color 0.3s; }
.footer-links a:hover { color: #fff; }
html.is-app .header { padding-top: env(safe-area-inset-top); height: calc(64px + env(safe-area-inset-top)); }
@media (max-width: 768px) {
  html.is-app .header { height: auto; padding-top: calc(10px + env(safe-area-inset-top)); }
  .hbtn.recap span, .hbtn.install span { display: none; }
}


/* ==========================================================
   Lighthouse 최적화
   ========================================================== */
/* 화면에 보일 때만 그리기(긴 페이지 스타일/레이아웃 비용 감소) */
.row { content-visibility: auto; contain-intrinsic-size: auto 360px; }
@media (max-width: 768px) { .row { contain-intrinsic-size: auto 290px; } }
/* 지연 렌더 줄: 카드가 들어오기 전에도 높이를 잡아 레이아웃 흔들림(CLS) 방지 */
.row.is-lazy .rail { min-height: calc(var(--card-w) * 1.5 + 60px); }
/* 배너 포스터 자리 미리 확보 */
.spot-poster img { aspect-ratio: 2 / 3; height: auto; }
.poster img { aspect-ratio: 2 / 3; height: 100%; }
/* 스크린리더용 텍스트 */
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; font-style: normal; }

/* "전체보기" 카드 */
.more-card {
  flex: 0 0 var(--card-w);
  aspect-ratio: 2 / 3;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: #ddd;
  font: inherit;
  cursor: pointer;
  transition: background 0.5s var(--ease-soft, ease), border-color 0.5s;
}
.more-card span { font-size: 28px; font-weight: 800; color: #fff; }
.more-card em { font-style: normal; font-size: 13px; color: var(--muted); }
.more-card:hover { background: rgba(255, 255, 255, 0.09); border-color: rgba(255, 255, 255, 0.4); transition-delay: 80ms; }


/* 스크립트가 배너를 채우기 전에도 자리를 잡아 두기(CLS 방지) */
.spotlight:empty { min-height: min(82vh, 760px); }
@media (max-width: 768px) {
  /* 모바일 헤더(로고·검색·카테고리 3줄 ≈ 125px) 아래에서 배너 시작 */
  .spot-inner { padding-top: 142px; }
  /* 실제 배너 높이에 맞춘 자리 확보: 포스터(46vw×1.5, 최대 300) + 위 여백·글자·버튼·썸네일 ≈ 400 */
  .spotlight { min-height: calc(min(69vw, 300px) + 400px); }
  .spot.on { min-height: calc(min(69vw, 300px) + 400px); }
  .spot-poster { width: 46vw; max-width: 200px; aspect-ratio: 2 / 3; }
}
/* 글꼴이 늦게 도착해도 줄 높이가 흔들리지 않게 */
.spot h1, .row-head h2 { line-height: 1.15; }
.spot-text p { min-height: 1.7em; }


/* 첫 화면 배너: 등장 애니메이션 끔(가장 큰 이미지가 즉시 보이도록) */
.spotlight.first .spot.on .spot-poster,
.spotlight.first .spot.on .spot-text > *,
.spotlight.first .spot.on .spot-bg img { animation: none !important; opacity: 1; }

/* 줄(행)을 스크립트가 채우기 전에도 자리를 잡아 푸터가 첫 화면에 떴다가 밀려나지 않게(CLS) */
#homeView:empty { min-height: 140vh; }
