/* ===== Reset & tokens ===== */
*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #0a0908;
  color: #f5f5f5;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: contain;
}
button, input, select { font-family: inherit; }
button { cursor: pointer; border: 0; background: none; color: inherit; }
img { display: block; max-width: 100%; }
a { color: inherit; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

:root {
  --bg: #0a0908;
  --bg-elev: #141210;
  --gold: #d4b36a;
  --gold-hi: #f0d48a;
  --muted: #8d8a85;
  --muted-2: #6a675f;
  --line: rgba(255,255,255,0.10);
  --safe-top: max(12px, env(safe-area-inset-top, 0px));
  --safe-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  --safe-left: max(16px, env(safe-area-inset-left, 0px));
  --safe-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ===== Shared views ===== */
.view { min-height: 100vh; min-height: 100dvh; }
.view[hidden] { display: none !important; }

/* ===== Grid ===== */
.view--grid {
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  max-width: 920px;
  margin: 0 auto;
}
.grid-header__titles h1 {
  margin: 2px 0 0;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.03em;
}
.grid-header__sub {
  margin: 2px 0 12px;
  color: var(--muted);
  font-size: 0.86rem;
}
.search input {
  width: 100%;
  border: 1px solid var(--line);
  background: #161412;
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 16px; /* iOS zoom 방지 */
  outline: none;
}
.search input::placeholder { color: #6e6b65; }
.search input:focus { border-color: rgba(212,179,106,0.55); }

.filter-block { margin-top: 8px; }
.filter-label {
  margin: 0 0 4px;
  color: var(--muted-2);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.filters {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0;
}
.filters--scroll {
  flex-wrap: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  margin: 0 -4px;
  padding: 0 4px 2px;
}
.filters--scroll::-webkit-scrollbar { display: none; }
.filters--wrap { flex-wrap: wrap; }
.filter-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #12100e;
  color: #cfcbc4;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
}
.filter-chip.is-active {
  border-color: var(--gold);
  color: var(--gold-hi);
  background: rgba(212,179,106,0.12);
}
.filter-chip--stat { padding: 5px 11px; font-size: 0.78rem; }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 10px 0 10px;
}
.sort select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: #161412 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%238d8a85' d='M1 1l5 5 5-5'/></svg>") no-repeat right 10px center;
  color: #e8e4de;
  border-radius: 10px;
  padding: 8px 28px 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  outline: none;
}
.sort select:focus { border-color: rgba(212,179,106,0.55); }
.result-count {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.8rem;
  white-space: nowrap;
}

.item-grid-wrap { position: relative; }
.item-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (min-width: 720px) {
  .item-grid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
}
.item-grid.is-virtual {
  display: block;
  position: relative;
  width: 100%;
}
.item-grid.is-virtual .grid-card {
  position: absolute;
}
.grid-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 8px 12px;
  border-radius: 16px;
  background: #12100e;
  border: 1px solid var(--line);
  color: inherit;
  text-align: center;
  min-height: 0;
  content-visibility: auto;
  contain-intrinsic-size: 140px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.grid-card:hover,
.grid-card:focus-visible {
  border-color: rgba(212,179,106,0.55);
  outline: none;
}
.grid-card:active { transform: scale(0.98); }
.grid-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: 1.5px solid #c9a44a;
  box-shadow: 0 0 16px rgba(255, 140, 50, 0.22);
  object-fit: cover;
  background: #1a1612;
}
.grid-card__name {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.grid-card__meta {
  font-size: 0.68rem;
  color: var(--muted-2);
}
.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 16px;
}
.site-footer {
  margin-top: 28px;
  padding: 16px var(--safe-right) calc(24px + var(--safe-bottom)) var(--safe-left);
  border-top: 1px solid var(--line);
  color: var(--muted-2);
  font-size: 0.72rem;
  line-height: 1.55;
  text-align: center;
}
#app > .site-footer {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== Card view ===== */
.view--card {
  display: flex;
  justify-content: center;
  background:
    radial-gradient(120% 80% at 50% 0%, #16120e 0%, #0a0908 55%);
}
.card-shell {
  width: 100%;
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) max(18px, var(--safe-right)) var(--safe-bottom) max(18px, var(--safe-left));
  position: relative;
}
@media (min-width: 760px) {
  .card-shell {
    padding: var(--safe-top) max(32px, var(--safe-right)) var(--safe-bottom) max(32px, var(--safe-left));
  }
}
.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 4px;
  min-height: 44px;
  flex: 0 0 auto;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: #cfcbc4;
  font-size: 0.92rem;
  font-weight: 600;
  padding: 6px 4px;
  border-radius: 10px;
}
.icon-btn:focus-visible { outline: 2px solid var(--gold); }
.card-counter {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.8rem;
  font-weight: 600;
}
.card-top__spacer { width: 52px; }

.card-stage {
  flex: 1 1 auto;
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 0;
}
.item-card {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 0 12px;
  touch-action: pan-y;
  user-select: none;
  width: 100%;
  gap: 0;
}

/* 기본(760px 미만): 아이콘·이름 아래 전폭 스탯. 760px 이상에서 좌우 2열 */
.hero {
  --stat-gap: 16px;
  position: relative;
  width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
  margin: 4px 0 20px;
  gap: 8px;
}
.hero__left {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0 12px;
}
.hero__glow {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 280px;
  height: 280px;
  transform: translate(-50%, -52%);
  background:
    radial-gradient(circle, rgba(255,140,40,0.38) 0%, rgba(255,110,20,0.16) 38%, rgba(10,9,8,0) 70%);
  pointer-events: none;
  filter: blur(2px);
  z-index: 0;
}
.hero__icon-wrap {
  position: relative;
  z-index: 1;
  margin: 8px 0 16px;
  width: 136px;
  height: 136px;
  border-radius: 22px;
  padding: 3px;
  background: linear-gradient(160deg, #f2d889, #b8882e 45%, #8a5a18);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.5),
    0 10px 30px rgba(0,0,0,0.45);
  flex: 0 0 auto;
}
.hero__icon-wrap img {
  width: 100%;
  height: 100%;
  border-radius: 19px;
  object-fit: cover;
  background: #1a140e;
}

.stat-panel {
  position: relative;
  z-index: 2;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 20px 18px 16px;
  border-radius: 24px;
  background: rgba(16, 14, 12, 0.82);
  border: 1px solid rgba(255,255,255,0.09);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.stat { margin: 0; }
.stat__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}
.stat__label {
  font-size: 16px;
  color: #e8e4de;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.stat__value {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}
.stat__track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.stat__bar {
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 0.45s ease;
}
/* 수치 1개: 라벨 위에 큰 숫자, 그 아래 막대 */
.stat-panel.is-single .stat__row {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 14px;
}

/* Names — hero 왼쪽(데스크톱) / 아이콘 아래(모바일) */
.item-names {
  position: relative;
  z-index: 1;
  text-align: center;
  margin: 0 0 12px;
  padding: 0 8px;
}
.item-names h2 {
  margin: 0;
  font-weight: 800;
  font-size: clamp(1.7rem, 7.4vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.2;
  color: #fff;
  word-break: keep-all;
}
.item-names h2.is-long { font-size: clamp(1.35rem, 6vw, 1.85rem); }
.item-names .en {
  margin: 6px 0 0;
  color: #9a9690;
  font-size: 0.98rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--gold);
  color: var(--gold-hi);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: rgba(0,0,0,0.25);
  margin: 0;
  position: relative;
  z-index: 1;
}

.explain {
  width: 100%;
  max-width: none;
  background: #141311;
  border: 1px solid #2c2a27;
  border-radius: 20px;
  padding: 28px 26px;
  text-align: left;
  margin-bottom: 28px;
  box-sizing: border-box;
}
.explain__hook {
  margin: 0 0 12px;
  font-size: clamp(1.45rem, 4.6vw, 1.875rem); /* ~23–30px */
  font-weight: 900;
  color: #ffc34d;
  letter-spacing: -0.03em;
  line-height: 1.3;
  word-break: keep-all;
  overflow-wrap: break-word;
  text-shadow:
    0 0 16px rgba(255, 195, 77, 0.45),
    0 0 32px rgba(255, 195, 77, 0.22);
}
.explain__desc {
  margin: 0;
  color: #fff;
  font-size: 1.1875rem; /* 19px */
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: -0.03em;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.explain__tip {
  margin: 16px 0 0;
  padding: 16px 18px;
  border-left: 3px solid #ff6b6b;
  background: rgba(255, 90, 90, 0.08);
  border-radius: 14px;
}
.explain__tip-label {
  margin: 0 0 4px;
  color: #ff8a8a;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.explain__tip-text {
  margin: 0;
  color: #cfc8c0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.02em;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.recs {
  width: 100%;
  margin-top: 4px;
  padding-top: 4px;
  padding-bottom: 8px;
}
.recs__label {
  text-align: center;
  color: #7a7770;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 12px;
  letter-spacing: 0.06em;
}
.recs__row {
  display: flex;
  justify-content: center;
  gap: 28px;
}
.rec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 76px;
}
.rec img {
  width: 62px;
  height: 62px;
  border-radius: 16px;
  object-fit: cover;
  border: 1px solid rgba(255,255,255,0.12);
  background: #1a1612;
  box-shadow: 0 4px 14px rgba(0,0,0,0.35);
}
.rec span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #e8e4de;
  letter-spacing: -0.03em;
}

.card-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pager-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cfcbc4;
}
.pager-btn:disabled { opacity: 0.28; }
.pager-btn:active { color: #fff; }

/* swipe feedback */
.item-card.is-leaving-left { transform: translateX(-24px); opacity: 0.4; transition: 0.18s ease; }
.item-card.is-leaving-right { transform: translateX(24px); opacity: 0.4; transition: 0.18s ease; }

@media (max-width: 759px) {
  .recs__row { gap: 18px; }
  .explain { padding: 22px 18px; }
  .explain__hook { font-size: 1.5rem; }
  .explain__desc { font-size: 1.0625rem; }
}

@media (min-width: 480px) and (max-width: 759px) {
  .hero__icon-wrap { width: 160px; height: 160px; border-radius: 26px; }
  .hero__icon-wrap img { border-radius: 23px; }
  .hero__glow { width: 320px; height: 320px; }
}

/* 760px 이상: 왼쪽 아이콘+이름, 오른쪽 큰 수치 패널. column-gap 최소 48px */
@media (min-width: 760px) {
  .hero {
    --stat-gap: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: var(--stat-gap);
    row-gap: 0;
    align-items: stretch;
    margin: 12px 0 28px;
  }
  .hero__left {
    min-height: 340px;
    padding: 20px 8px 16px;
  }
  .hero__icon-wrap {
    width: 200px;
    height: 200px;
    margin: 0 0 16px;
    border-radius: 32px;
  }
  .hero__icon-wrap img { border-radius: 29px; }
  .hero__glow { width: 380px; height: 380px; top: 38%; }
  .stat-panel {
    min-height: 340px;
    padding: 32px 36px 28px;
    gap: 22px;
  }
  .stat__label { font-size: 17px; }
  .stat__value { font-size: 26px; }
  .stat__track { height: 12px; }
  .stat-panel.is-single { gap: 14px; padding: 36px 40px 32px; }
  .stat-panel.is-single .stat__row { margin-bottom: 18px; }
  .stat-panel.is-single .stat__value { font-size: 56px; }
  .stat-panel.is-single .stat__label { font-size: 18px; }
  .stat-panel.is-single .stat__track { height: 14px; }
  .explain__hook { font-size: 1.875rem; } /* 30px */
}

@media (min-width: 900px) {
  .hero { --stat-gap: 64px; }
  .item-names h2 { font-size: clamp(1.9rem, 3.2vw, 2.35rem); }
}

/* Grid cards are links */
a.grid-card { text-decoration: none; color: inherit; }
.pager-btn { text-decoration: none; }
a.pager-btn { display: flex; }

/* Related items + legal pages + footer nav */
.related {
  width: 100%;
  max-width: 460px;
  margin: 8px 0 16px;
}
.related__label {
  text-align: center;
  color: #7a7770;
  font-size: 0.78rem;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: 0.06em;
}
.related__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.related__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 72px;
  text-decoration: none;
  color: #e8e4de;
  font-size: 0.68rem;
  font-weight: 600;
  text-align: center;
}
.related__item img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid #c9a44a;
  background: #1a1612;
}
.related__item span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.site-footer a {
  color: var(--gold);
  text-decoration: none;
}
.site-footer a:hover, .site-footer a:focus-visible { text-decoration: underline; }
.site-footer__nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 0 0 10px;
}
.site-footer__legal {
  max-width: 36rem;
  margin: 8px auto 0;
  color: var(--muted-2);
  font-size: 0.68rem;
  line-height: 1.55;
}
.site-footer__en { margin-top: 6px; }

.view--page {
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  max-width: 720px;
  margin: 0 auto;
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}
.page-header a { color: #cfcbc4; text-decoration: none; font-weight: 600; }
.page-header a:hover { color: var(--gold-hi); }
.legal {
  background: #12100e;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px 22px 36px;
  line-height: 1.7;
  color: #e8e4de;
  font-size: 0.95rem;
}
.legal h1 {
  margin: 0 0 8px;
  font-size: 1.55rem;
  letter-spacing: -0.03em;
  color: #fff;
}
.legal h2 {
  margin: 1.6em 0 0.5em;
  font-size: 1.08rem;
  color: var(--gold-hi);
}
.legal p { margin: 0.6em 0; }
.legal ul { margin: 0.4em 0 0.8em; padding-left: 1.2em; }
.legal li { margin: 0.3em 0; }
.legal .todo, .todo {
  display: inline-block;
  background: rgba(232, 186, 92, 0.15);
  border: 1px dashed var(--gold);
  color: var(--gold-hi);
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 700;
}
.legal a { color: var(--gold); }
.updated { color: var(--muted-2); font-size: 0.82rem; margin-bottom: 1.2em; }

.icon-btn { text-decoration: none; }
a.icon-btn { display: inline-flex; }
