/* 링크 허브 — 휴대폰 인앱 브라우저(유튜브·인스타) 기준. 번호 배지는 영상 끝 카드와 같은 노랑 + G마켓 산스(숫자만 담은 2KB 글꼴) */
@font-face { font-family: "HubNum"; src: url("fonts/gmarket-num.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --bg: #fbf8f1;
  --card: #ffffff;
  --ink: #1b1915;
  --muted: #6d675d;
  --line: #ebe5d8;
  --badge: #ffe500;
  --badge-ink: #111111;
  --btn: #111111;
  --btn-ink: #ffe500;
  --ad-bg: #111111;
  --ad-ink: #f4f1ea;
  --hit: #ffe500;
  --ended: #9a9387;
  --shadow: 0 1px 2px rgba(27, 25, 21, .06), 0 4px 14px rgba(27, 25, 21, .05);
  --font: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard", "Noto Sans KR", "Malgun Gothic", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f;
    --card: #1f1d18;
    --ink: #f3efe6;
    --muted: #a8a194;
    --line: #2f2c25;
    --btn: #ffe500;
    --btn-ink: #111111;
    --ad-bg: #2a2720;
    --ad-ink: #f3efe6;
    --ended: #7d776c;
    --shadow: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f; --card: #1f1d18; --ink: #f3efe6; --muted: #a8a194; --line: #2f2c25;
  --btn: #ffe500; --btn-ink: #111111; --ad-bg: #2a2720; --ad-ink: #f3efe6; --ended: #7d776c; --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 var(--font);
  word-break: keep-all; overflow-wrap: anywhere;
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.ad {
  background: var(--ad-bg); color: var(--ad-ink); text-align: center;
  font-size: 13px; font-weight: 600; padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top));
}

.top, #list, .notice, .foot { max-width: 560px; margin-inline: auto; padding-inline: 16px; }
.top { padding-top: 28px; padding-bottom: 8px; }
.top h1 { margin: 0; font-size: 26px; line-height: 1.25; letter-spacing: -.02em; }
.series { margin: 4px 0 0; font-weight: 700; display: inline-block; background: var(--badge); color: var(--badge-ink); padding: 1px 8px; border-radius: 4px; font-size: 14px; }
.guide { margin: 14px 0 12px; color: var(--muted); font-size: 15px; }
.guide b { color: var(--ink); }
.search input {
  width: 100%; height: 48px; padding: 0 16px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: 17px; outline: none;
}
.search input:focus { border-color: var(--ink); }

.notice { margin: 8px auto 0; }
.notice[hidden] { display: none; }
.notice span { display: block; background: var(--card); border: 1.5px solid var(--ink); border-radius: 12px; padding: 10px 14px; font-size: 15px; }

#list { display: grid; gap: 10px; padding-top: 12px; padding-bottom: 8px; }
.card {
  display: grid; grid-template-columns: auto 64px 1fr; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px 12px 12px;
  color: inherit; text-decoration: none; box-shadow: var(--shadow); scroll-margin-top: 16px;
  -webkit-tap-highlight-color: transparent; transition: transform .08s ease;
}
a.card:active { transform: scale(.985); }
.num {
  min-width: 56px; height: 56px; padding: 0 6px; border-radius: 12px; background: var(--badge); color: var(--badge-ink);
  display: grid; place-items: center; font-family: "HubNum", var(--font); font-weight: 700; font-size: 26px; line-height: 1; letter-spacing: -.02em;
}
.num small { font-size: 13px; margin-left: 1px; }
.thumb { width: 64px; height: 64px; border-radius: 10px; background: #fff; object-fit: contain; border: 1px solid var(--line); }
.thumb.none { display: block; background: var(--line); }
.body { min-width: 0; display: grid; gap: 2px; }
.name { font-weight: 700; font-size: 16px; line-height: 1.35; }
.full { color: var(--muted); font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.go { margin-top: 6px; justify-self: start; background: var(--btn); color: var(--btn-ink); font-weight: 700; font-size: 14px; padding: 6px 12px; border-radius: 999px; }
.card.ended { opacity: .72; }
.card.ended .num { background: var(--line); color: var(--ended); }
.card.ended .go { background: transparent; color: var(--ended); border: 1px solid var(--line); }
.card.hit { outline: 3px solid var(--hit); outline-offset: 2px; }
@media (prefers-reduced-motion: no-preference) {
  .card.hit { animation: hit 1.2s ease 2; }
  @keyframes hit { 50% { outline-color: transparent; } }
}
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.foot { padding-top: 16px; padding-bottom: max(32px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 12.5px; }
.foot p { margin: 4px 0; }

@media (max-width: 360px) {
  .card { grid-template-columns: auto 52px 1fr; gap: 10px; }
  .thumb { width: 52px; height: 52px; }
  .num { min-width: 48px; height: 48px; font-size: 22px; }
}
