* { box-sizing: border-box; }

:root {
    --red: #e50914;
    --bg: #0b0b0f;
    --line: rgba(255, 255, 255, 0.09);
    --muted: #a3a3ad;
    --accent: #e50914;
}
body.t-hotel { --accent: #8b5cf6; }
body.t-travel { --accent: #3b82f6; }
body.t-food { --accent: #f97316; }
body.t-cafe { --accent: #c2853a; }
body.t-play { --accent: #22c55e; }
body.t-music { --accent: #ec4899; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: #fff;
    font-family: "Pretendard Variable", Pretendard, system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* 헤더 */
.header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 1000;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
    transition: background 0.25s, backdrop-filter 0.25s, border-color 0.25s;
    border-bottom: 1px solid transparent;
}
.header.solid {
    background: rgba(11, 11, 15, 0.86);
    backdrop-filter: saturate(160%) blur(14px);
    border-bottom-color: var(--line);
}
.logo { font-size: 26px; font-weight: 900; color: var(--red); letter-spacing: -0.04em; }
.header-nav { display: flex; align-items: center; gap: 6px; }
.header-nav a, .icon-btn {
    padding: 8px 14px;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}
.header-nav a:hover, .icon-btn:hover { background: rgba(255, 255, 255, 0.2); }

/* 히어로 */
.detail-hero {
    position: relative;
    min-height: 88vh;
    display: flex;
    align-items: center;
    padding: 110px 48px 60px;
    overflow: hidden;
}
.detail-bg { position: absolute; inset: -40px; z-index: 0; }
.detail-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(0.45) saturate(1.3);
    transform: scale(1.1);
    animation: bgIn 1.2s ease-out both;
}
@keyframes bgIn { from { opacity: 0; transform: scale(1.18); } }
.detail-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 20% 30%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%),
        linear-gradient(to top, var(--bg) 0%, rgba(11, 11, 15, 0.55) 45%, rgba(11, 11, 15, 0.35) 100%);
}

.detail-inner {
    position: relative;
    z-index: 2;
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.poster {
    aspect-ratio: 2 / 3;
    border-radius: 20px;
    overflow: hidden;
    background: #1a1a20;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
    animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.poster-empty, .card-noimg {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 45%, #111), #15151a);
    color: rgba(255, 255, 255, 0.85);
    font-size: 96px;
    font-weight: 800;
}
.card-noimg { font-size: 48px; aspect-ratio: 2 / 3; }

.detail-info { min-width: 0; padding-top: 12px; animation: rise 0.7s 0.1s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.crumbs { display: flex; gap: 8px; margin-bottom: 14px; }
.type-badge, .fav-badge {
    display: inline-flex;
    padding: 6px 12px;
    border-radius: 99px;
    font-size: 13px;
    font-weight: 700;
}
.type-badge { background: var(--accent); color: #fff; }
.fav-badge { background: rgba(255, 77, 109, 0.18); color: #ff8fa3; }

.detail-title {
    margin: 0 0 16px;
    font-size: clamp(34px, 5vw, 60px);
    line-height: 1.1;
    font-weight: 800;
    letter-spacing: -0.045em;
    word-break: keep-all;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    color: #d4d4da;
    font-size: 15px;
}
.stars { position: relative; display: inline-block; font-size: 20px; letter-spacing: 2px; line-height: 1; }
.stars-bg { color: rgba(255, 255, 255, 0.18); }
.stars-fg {
    position: absolute; left: 0; top: 0;
    width: var(--r);
    overflow: hidden;
    white-space: nowrap;
    color: #f5b301;
    animation: fill 0.9s 0.3s ease-out both;
}
@keyframes fill { from { width: 0; } }
.score { font-size: 18px; color: #fff; }
.dot::before { content: "·"; margin-right: 10px; color: #666; }

.series-link {
    display: inline-flex;
    margin-bottom: 16px;
    padding: 8px 14px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    font-size: 14px;
    font-weight: 600;
    transition: background 0.15s;
}
.series-link:hover { background: rgba(255, 255, 255, 0.15); }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 22px; }
.tag {
    padding: 6px 12px;
    border-radius: 99px;
    background: color-mix(in srgb, var(--accent) 18%, transparent);
    color: #f1f1f4;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, transform 0.15s;
}
.tag:hover { background: color-mix(in srgb, var(--accent) 38%, transparent); transform: translateY(-1px); }

.memo-card, .place-card {
    margin-bottom: 14px;
    padding: 18px 20px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.memo-card { border-left: 3px solid var(--accent); }
.memo-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.04em; }
.memo-card p, .place-card p { margin: 0; font-size: 16px; line-height: 1.75; color: #ececf0; word-break: keep-all; }

.place-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.place-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.btn:hover { background: rgba(255, 255, 255, 0.16); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.1); }

/* 섹션 */
.section {
    width: min(1280px, 100%);
    margin: 0 auto;
    padding: 30px 48px 10px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.section.in { opacity: 1; transform: none; }
.section h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.section h2::before { content: ""; width: 4px; height: 20px; border-radius: 4px; background: var(--accent); }

.swiper { padding: 8px 0 30px !important; overflow: visible !important; }
.section { overflow: hidden; }
.swiper-slide { width: 180px !important; }

.card {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    background: #1a1a20;
    aspect-ratio: 2 / 3;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 18px 36px rgba(0, 0, 0, 0.55); }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.5s ease; }
.card:hover img { transform: scale(1.06); }
.card-info {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 36px 12px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 30%, transparent);
}
.card-title {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-meta { color: #c9c9d0; font-size: 12px; }

.swiper-button-next, .swiper-button-prev {
    width: 42px !important;
    height: 42px !important;
    border-radius: 50%;
    background: rgba(20, 20, 26, 0.8);
    border: 1px solid var(--line);
    color: #fff !important;
    opacity: 0;
    transition: opacity 0.2s;
}
.section:hover .swiper-button-next, .section:hover .swiper-button-prev { opacity: 1; }
.swiper-button-disabled { opacity: 0 !important; }
.swiper-button-next::after, .swiper-button-prev::after { font-size: 16px !important; font-weight: 700; }

/* 토스트 */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 2000;
    padding: 12px 18px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 12px);
    transition: opacity 0.25s, transform 0.25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

body { padding-bottom: 60px; }

/* 모바일 */
@media (max-width: 860px) {
    .header { padding: 0 16px; height: 56px; }
    .logo { font-size: 22px; }
    .detail-hero { min-height: auto; padding: 80px 18px 30px; align-items: flex-start; }
    .detail-inner { grid-template-columns: 1fr; gap: 22px; }
    .poster { width: min(58vw, 240px); margin: 0 auto; border-radius: 16px; }
    .detail-info { padding-top: 0; }
    .crumbs, .detail-meta, .tag-row { justify-content: center; }
    .detail-title { text-align: center; font-size: 32px; }
    .series-link { display: flex; justify-content: center; }
    .memo-card p, .place-card p { font-size: 15px; }
    .place-actions { width: 100%; }
    .place-actions .btn { flex: 1; justify-content: center; }
    .section { padding: 22px 16px 4px; }
    .swiper-slide { width: 132px !important; }
    .swiper-button-next, .swiper-button-prev { display: none !important; }
    .card:hover, .card:hover img { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .section { opacity: 1; transform: none; }
}

/* 위시리스트 */
.wish-badge { display: inline-flex; padding: 6px 12px; border-radius: 99px; font-size: 13px; font-weight: 700; background: rgba(139, 92, 246, 0.22); color: #d8ccff; border: 1px dashed rgba(196, 181, 253, 0.6); }
.wish-note { display: inline-block; margin-bottom: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(139, 92, 246, 0.14); border: 1px dashed rgba(196, 181, 253, 0.5); color: #e4dcff; font-size: 14px; font-weight: 600; }
.detail-meta.is-wish .stars, .detail-meta.is-wish .score { display: none; }

/* ==========================================================
   성능: 슬라이더 라이브러리 없이 기본 가로 스크롤
   ========================================================== */
.rowSwiper { position: relative; }
.rowSwiper .swiper-wrapper {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px 2px 24px;
  scroll-snap-type: x proximity;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.rowSwiper .swiper-wrapper::-webkit-scrollbar { display: none; }
.rowSwiper .swiper-slide { flex: 0 0 auto; scroll-snap-align: start; }
.rowSwiper .swiper-button-prev, .rowSwiper .swiper-button-next {
  position: absolute; top: 50%; z-index: 3;
  margin-top: -32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.rowSwiper .swiper-button-prev { left: -8px; }
.rowSwiper .swiper-button-next { right: -8px; }
.rowSwiper .swiper-button-prev::after { content: "‹"; font-size: 26px !important; line-height: 1; }
.rowSwiper .swiper-button-next::after { content: "›"; font-size: 26px !important; line-height: 1; }
.card img { aspect-ratio: 2 / 3; }

/* 첫 화면 포스터·정보는 등장 애니메이션 없이 바로(LCP·FCP 개선) */
.poster, .detail-info { animation: none; }
.detail-bg img { animation-duration: 0.6s; }
