/* ─────────────────────────────────────────────────────────
   GFX References 다크 테마
   거의 검은 바탕, 굵고 큰 제목, 기울어진 세리프 포인트,
   주황 / 초록 / 파랑 알약, 필름 노이즈.
   색, 글꼴, 움직임은 아래 변수에서 바꿀 수 있어요.
   ───────────────────────────────────────────────────────── */
:root {
  /* 바탕 (어두운 순서) */
  --bg: #080808;
  --bg-elev: #121212;
  --bg-card: #1a1a1a;
  --bg-hover: #232323;
  --bg-active: #2e2e2e;
  /* 색 면에 얹는 인쇄 질감 (아래 '색 면 질감' 참고) */
  --print: url("data:image/svg+xml,%3Csvg xmlns=%27http://www.w3.org/2000/svg%27 width=%27160%27 height=%27160%27%3E%3Cfilter id=%27n%27%3E%3CfeTurbulence type=%27fractalNoise%27 baseFrequency=%271.35%27 numOctaves=%273%27 stitchTiles=%27stitch%27/%3E%3CfeColorMatrix type=%27saturate%27 values=%270%27/%3E%3CfeComponentTransfer%3E%3CfeFuncR type=%27linear%27 slope=%271.7%27 intercept=%27-.45%27/%3E%3CfeFuncG type=%27linear%27 slope=%271.7%27 intercept=%27-.45%27/%3E%3CfeFuncB type=%27linear%27 slope=%271.7%27 intercept=%27-.45%27/%3E%3CfeFuncA type=%27linear%27 slope=%270%27 intercept=%27.5%27/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width=%27100%25%27 height=%27100%25%27 filter=%27url%28%23n%29%27/%3E%3C/svg%3E");
  --paper: #ecebe6;
  --paper-dim: #d9d7d0;
  --ink: #111111;

  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);

  --text: #f3f1ec;
  --text-dim: #aaa7a0;
  --text-faint: #86837c;

  /* 포인트 색: 주황 · 초록 · 파랑 */
  --accent: #ff7a1a;
  --accent-hover: #ff8f3d;
  --accent-soft: rgba(255, 122, 26, 0.16);
  --accent-2: #3fca5c;
  --accent-3: #86a8ff;
  --accent-4: #ff5a4e;
  --discord: #5865f2;

  --good: #3fca5c;
  --warn: #ffb020;
  --bad: #ff4d4d;
  --gold: #ff7a1a;
  --silver: #ecebe6;
  --bronze: #86a8ff;

  --radius: 6px;
  --radius-sm: 4px;
  --radius-lg: 10px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.7);

  /* 움직임 */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --fast: 0.16s;
  --mid: 0.3s;

  /* 글꼴 */
  /* 작은 글씨: Geist (Figma 의 Paragraph 스타일과 같은 글꼴), 한글은 Pretendard */
  --font: 'Geist', 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', system-ui,
    sans-serif;
  --display: 'Inter Tight', 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  --serif: 'Instrument Serif', 'Noto Serif KR', 'Nanum Myeongjo', Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.02em;
  -webkit-font-smoothing: antialiased;
  /* 한국어는 단어 중간에서 줄이 바뀌지 않게 */
  word-break: keep-all;
  overflow-wrap: break-word;
  /* 한글 세리프에 가짜 기울임을 만들지 않음 */
  font-synthesis-style: none;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* 필름 그레인: 배경에만 살짝 움직이는 노이즈.
   콘텐츠 뒤(z-index: -1)에 깔아서 썸네일·사진 위에는 보이지 않음.
   body 를 isolation 으로 묶어야 body 배경 위, 콘텐츠 아래에 그려짐 */
body {
  isolation: isolate;
}

body::before {
  content: '';
  position: fixed;
  inset: -10%;
  z-index: -1;
  pointer-events: none;
  opacity: 0.1;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.25' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 1.1 -.15'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(5) infinite;
}

@keyframes grain {
  0% {
    transform: translate(0, 0);
  }
  20% {
    transform: translate(-3%, 2%);
  }
  40% {
    transform: translate(2%, -3%);
  }
  60% {
    transform: translate(-3%, -1%);
  }
  80% {
    transform: translate(3%, 3%);
  }
  100% {
    transform: translate(0, 0);
  }
}

::selection {
  background: var(--accent);
  color: var(--ink);
}

* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a2a transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #2a2a2a;
  border-radius: 999px;
  border: 2px solid var(--bg);
}

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

button,
input,
select {
  font: inherit;
  color: inherit;
}

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 글자 하나씩 올라오는 제목 */
.split .w {
  display: inline-block;
  white-space: nowrap;
}

.split .ch {
  display: inline-block;
  animation: letter-in 0.75s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 32ms + 80ms);
}

@keyframes letter-in {
  from {
    opacity: 0;
    transform: translateY(0.45em) rotate(4deg);
    filter: blur(6px);
  }
}

/* ── 상단 바 ─────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(8, 8, 8, 0.84);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1440px;
  margin: 0 auto;
  height: 60px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 19px;
  white-space: nowrap;
}

.brand img {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  transition: transform 0.45s var(--spring);
}

.brand:hover img {
  transform: rotate(-12deg) scale(1.08);
}

.nav {
  display: flex;
  gap: 6px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  align-items: center;
  padding: 4px 0;
}

.nav::-webkit-scrollbar {
  display: none;
}

/* 메뉴마다 고유한 색 알약 */
.nav a,
.nav button {
  --pill: var(--paper);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 13px 0 11px;
  border-radius: 999px;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-card);
  border: 0;
  cursor: pointer;
  transition: color var(--fast), background var(--fast), transform 0.3s var(--spring);
}

.nav a::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pill);
  transition: transform 0.3s var(--spring), background var(--fast);
}

.nav a[data-route='explore'] {
  --pill: var(--accent);
}
.nav a[data-route='feed'] {
  --pill: var(--accent-4);
}
.nav a[data-route='popular'] {
  --pill: var(--accent-2);
}
.nav a[data-route='colors'] {
  --pill: var(--accent-3);
}
.nav a[data-route='leaderboard'] {
  --pill: var(--paper);
}

.nav a:hover,
.nav button:hover {
  color: var(--text);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.nav a:hover::before {
  transform: scale(1.4);
}

.nav a.active {
  color: var(--ink);
  background: var(--pill);
  animation: pill-on 0.4s var(--spring);
}

.nav a.active::before {
  background: var(--ink);
}

@keyframes pill-on {
  40% {
    transform: scale(1.08);
  }
}

.nav-random {
  background: transparent !important;
  box-shadow: inset 0 0 0 1px var(--line-strong);
}

.nav-random .shuffle {
  transition: transform 0.5s var(--spring);
}

.nav-random:hover .shuffle {
  transform: rotate(180deg);
}

/* 언어 전환 KO / EN */
.lang-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--bg-card);
}

.lang-switch button {
  height: 24px;
  min-width: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--fast), color var(--fast);
}

.lang-switch button:hover {
  color: var(--text);
}

.lang-switch button.on {
  background: var(--paper);
  color: var(--ink);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.bot-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

.bot-status i {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}

.bot-status.online i {
  background: var(--good);
}

.bot-status.online i::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--good);
  animation: ping 2.4s var(--ease) infinite;
}

@keyframes ping {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  70%,
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

.bot-status.offline i {
  background: var(--bad);
}

.account {
  position: relative;
}

.account-btn {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
}

.account-btn .avatar {
  transition: box-shadow var(--fast), transform 0.3s var(--spring);
}

.account-btn:hover .avatar {
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent);
  transform: scale(1.05);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-hover);
  flex-shrink: 0;
}

.avatar.lg {
  width: 88px;
  height: 88px;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 210px;
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px) scale(0.96);
  transform-origin: top right;
  transition: opacity var(--fast), transform 0.25s var(--spring), visibility 0s linear var(--fast);
}

.menu.open {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity var(--fast), transform 0.25s var(--spring), visibility 0s;
}

.menu a,
.menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: none;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  transition: background var(--fast), padding var(--fast);
}

.menu a:hover,
.menu button:hover {
  background: var(--accent);
  padding-left: 14px;
}

.menu .menu-head {
  padding: 8px 10px 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.14);
  margin-bottom: 4px;
}

/* ── 공통 ───────────────────────────────────────────── */
.page {
  flex: 1;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 20px 20px 72px;
}

.page.page-enter {
  animation: page-in 0.5s var(--ease);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 18px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  transition: background var(--fast), color var(--fast), transform 0.14s var(--ease), box-shadow var(--fast);
}

.btn:hover {
  background: var(--bg-hover);
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn.primary {
  background: var(--accent);
  color: var(--ink);
  box-shadow: none;
}

.btn.primary:hover {
  background-color: var(--accent-hover);
}

.btn.primary:disabled:hover {
  background-color: var(--accent);
}

/* 디스코드 로그인 버튼: 상단 바에서는 하얀 알약 */
.btn.discord {
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
}

.btn.discord:hover {
  background-color: #fff;
}

.btn.ghost {
  background: transparent;
  box-shadow: none;
  color: var(--text-dim);
}

.btn.ghost:hover {
  color: var(--text);
  background: var(--bg-card);
}

.btn.sm {
  height: 32px;
  padding: 0 13px;
  font-size: 13.5px;
}

.btn.block {
  width: 100%;
}

/* "View all" 처럼 가로로 긴 종이색 바 */
.btn.view-all {
  width: 100%;
  height: 48px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: none;
  gap: 10px;
  font-weight: 600;
}

.btn.view-all em {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 400;
  font-synthesis: none;
}

.btn.view-all:hover {
  background-color: var(--accent);
}

.btn.view-all .arrow {
  display: inline-block;
  transition: transform 0.35s var(--spring);
}

.btn.view-all:hover .arrow {
  transform: translateY(3px);
}

/* 태그 칩 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--fast), background var(--fast), transform 0.14s var(--ease);
}

.chip:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.chip:active {
  transform: scale(0.95);
}

.chip.on {
  color: var(--ink);
  background: var(--accent);
  animation: pill-on 0.35s var(--spring);
}

.chip .count {
  color: var(--text-faint);
  font-weight: 500;
  font-size: 12px;
}

.chip.on .count {
  color: rgba(17, 17, 17, 0.6);
}

.chip.static {
  cursor: default;
}

.muted {
  color: var(--text-dim);
}

.faint {
  color: var(--text-faint);
}

h1,
h2,
h3 {
  font-family: var(--display);
  letter-spacing: -0.035em;
  margin: 0;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 44px 0 16px;
}

.section-title h2 {
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 900;
  line-height: 1.05;
}

.section-title h2:empty {
  display: none;
}

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--text-dim);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  animation: page-in 0.45s var(--ease);
}

@keyframes float {
  50% {
    transform: translateY(-6px);
  }
}

/* 점 세 개 로딩 */
.spinner {
  width: 46px;
  height: 12px;
  margin: 32px auto;
  background: radial-gradient(circle closest-side, var(--accent) 90%, transparent) 0 50% / 12px 12px no-repeat,
    radial-gradient(circle closest-side, var(--accent-2) 90%, transparent) 50% 50% / 12px 12px no-repeat,
    radial-gradient(circle closest-side, var(--accent-3) 90%, transparent) 100% 50% / 12px 12px no-repeat;
  animation: dots 1s infinite linear;
}

@keyframes dots {
  0%,
  100% {
    background-size: 12px 12px, 6px 6px, 6px 6px;
  }
  33% {
    background-size: 6px 6px, 12px 12px, 6px 6px;
  }
  66% {
    background-size: 6px 6px, 6px 6px, 12px 12px;
  }
}

.banner {
  max-width: 1440px;
  margin: 12px auto 0;
  padding: 0 20px;
  width: 100%;
}

.banner > div {
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  animation: page-in 0.4s var(--ease);
}

/* ── 탐색: 표지 ──────────────────────────────────────── */
.hero {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.hero-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  min-height: clamp(300px, 40vw, 500px);
  padding: 22px 26px 26px;
  border-radius: var(--radius-lg);
  background: radial-gradient(120% 90% at 20% 0%, #4a1800 0%, #140801 55%, var(--bg) 100%);
}

/* 표지 사진: 사진 속 글씨가 큰 제목과 겹치지 않게 살짝 흐리게 두고,
   아래 Cover 글씨에 마우스를 올리면 선명하게 보여줌 */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.12);
  filter: blur(5px) saturate(1.15);
  transition: opacity 1.2s var(--ease), filter 0.7s var(--ease);
}

.hero-bg.loaded {
  opacity: 0.85;
  animation: ken-burns 26s ease-in-out infinite alternate;
}

.hero-banner:has(.hero-cover:hover) .hero-bg {
  filter: none;
}

@keyframes ken-burns {
  from {
    transform: scale(1.06) translate(0, 0);
  }
  to {
    transform: scale(1.16) translate(-2%, 1.5%);
  }
}

/* 사진 위 어둡게 + 거친 질감 */
.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.2) 30%, rgba(0, 0, 0, 0.55) 58%, rgba(0, 0, 0, 0.92) 100%);
}

.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.35;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.hero-pills button {
  height: 26px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: transform 0.3s var(--spring), filter var(--fast);
  animation: pop-in 0.5s var(--spring) both;
}

.hero-pills button:hover {
  transform: translateY(-2px) rotate(-3deg);
  filter: brightness(1.08);
}

.hero-pills button:nth-child(1) {
  background-color: var(--accent);
  animation-delay: 0.1s;
}
.hero-pills button:nth-child(2) {
  background-color: var(--accent-2);
  animation-delay: 0.18s;
}
.hero-pills button:nth-child(3) {
  background-color: var(--accent-3);
  animation-delay: 0.26s;
}

.hero-vol {
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: rgba(243, 241, 236, 0.85);
}

.hero h1 {
  font-family: var(--display);
  font-size: clamp(52px, 10.5vw, 156px);
  font-weight: 900;
  line-height: 0.86;
  letter-spacing: -0.055em;
  margin: 0 0 0 -0.04em;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.35);
}

.hero-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hero p {
  margin: 0;
  max-width: 520px;
  color: rgba(243, 241, 236, 0.85);
  font-size: 15px;
  animation: page-in 0.7s var(--ease) 0.5s both;
}

.hero-cover {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: rgba(243, 241, 236, 0.75);
  border-bottom: 1px solid transparent;
  transition: color var(--fast), border-color var(--fast);
  animation: page-in 0.7s var(--ease) 0.7s both;
}

.hero-cover .k {
  margin-right: 8px;
  font-family: var(--font);
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(243, 241, 236, 0.6);
}

.hero-cover:hover {
  color: #fff;
  border-color: currentColor;
}

.searchbox {
  position: relative;
}

.searchbox input {
  width: 100%;
  height: 56px;
  border-radius: var(--radius-lg);
  border: 0;
  background: var(--bg-elev);
  padding: 0 56px 0 52px;
  font-size: 16px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--mid) var(--ease), background var(--fast);
}

.searchbox input::placeholder {
  color: var(--text-faint);
}

.searchbox input:focus {
  outline: none;
  background: var(--bg-card);
  box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 5px var(--accent-soft);
}

.searchbox .icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  pointer-events: none;
  transition: color var(--fast), transform 0.35s var(--spring);
}

.searchbox:focus-within .icon {
  color: var(--accent);
  transform: translateY(-50%) rotate(-12deg) scale(1.12);
}

.searchbox kbd {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  padding: 2px 8px;
}

.filters {
  display: grid;
  gap: 0;
  padding: 4px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 0;
}

.filter-row + .filter-row {
  border-top: 1px solid var(--line);
}

.filter-row > .label {
  width: 76px;
  flex-shrink: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--text-dim);
}

.filter-row .items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.segmented button {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-card);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--fast), color var(--fast), transform 0.14s var(--ease);
}

.segmented button:hover {
  color: var(--text);
  background: var(--bg-hover);
}

.segmented button:active {
  transform: scale(0.95);
}

.segmented button.on {
  background: var(--paper);
  color: var(--ink);
  animation: pill-on 0.35s var(--spring);
}

.segmented button.on .faint {
  color: rgba(17, 17, 17, 0.5);
}

/* 색 동그라미 */
.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  cursor: pointer;
  padding: 0;
  transition: transform 0.3s var(--spring), box-shadow var(--fast);
  position: relative;
}

.swatch:hover {
  transform: scale(1.2);
}

.swatch.on {
  transform: scale(1.08);
  box-shadow: 0 0 0 3px var(--bg-elev), 0 0 0 5px var(--text);
}

.color-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.color-picker input[type='color'] {
  width: 30px;
  height: 30px;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.3s var(--spring);
}

.color-picker input[type='color']:hover {
  transform: scale(1.15) rotate(20deg);
}

.color-picker input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker input[type='color']::-webkit-color-swatch {
  border-radius: 50%;
  border: 2px dashed var(--line-strong);
}

.color-picker input[type='color']::-moz-color-swatch {
  border-radius: 50%;
  border: 2px dashed var(--line-strong);
}

select.select {
  height: 36px;
  border-radius: 999px;
  border: 0;
  background-color: var(--bg-card);
  padding: 0 34px 0 14px;
  font-weight: 600;
  font-size: 13.5px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim) 50%), linear-gradient(135deg, var(--text-dim) 50%, transparent 50%);
  background-position: calc(100% - 18px) 16px, calc(100% - 13px) 16px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: background-color var(--fast);
}

select.select:hover {
  background-color: var(--bg-hover);
}

select.select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

select.select option {
  background: var(--bg-elev);
}

.results-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 30px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.results-head .count {
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.results-info {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.active-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.active-filters .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.active-filters .x {
  margin-left: 2px;
  font-size: 15px;
  line-height: 1;
  opacity: 0.6;
}

.active-filters .chip {
  height: 26px;
  font-size: 12.5px;
  animation: pop-in 0.35s var(--spring);
}

@keyframes pop-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

/* ── 카드 / 그리드 ───────────────────────────────────── */
.masonry {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.masonry-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card {
  --c: #ff7a1a;
  display: block;
  position: relative;
}

/* 스크롤해서 화면에 들어온 카드부터 차례로 떠오름 (components.js 의 ResultsGrid) */
.card.in {
  animation: card-in 0.65s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 55ms);
}

@media (prefers-reduced-motion: no-preference) {
  .card:not(.in) {
    opacity: 0;
  }
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
}

.card-media {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111;
  transition: border-radius var(--mid) var(--ease), box-shadow var(--mid) var(--ease);
}

.card:hover .card-media {
  box-shadow: 0 16px 40px -16px color-mix(in srgb, var(--c) 75%, transparent);
}

/* 이미지가 뜨기 전 반짝이는 자리 표시 */
.card-media::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.14) 50%, transparent 80%);
  background-size: 200% 100%;
  animation: skeleton 1.3s linear infinite;
  transition: opacity 0.3s;
  pointer-events: none;
}

.card-media.ready::before {
  opacity: 0;
  animation: none;
}

@keyframes skeleton {
  from {
    background-position: 150% 0;
  }
  to {
    background-position: -50% 0;
  }
}

/* 마우스를 올리면 아래에서 올라오는 어두운 막 */
.card-media::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.55));
  opacity: 0;
  transition: opacity var(--mid);
  pointer-events: none;
}

.card:hover .card-media::after {
  opacity: 1;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  filter: blur(10px) saturate(0.6);
  transform: scale(1.05);
  transition: opacity 0.5s var(--ease), filter 0.6s var(--ease), transform 0.8s var(--ease);
}

.card-media img.loaded {
  opacity: 1;
  filter: none;
  transform: none;
}

.card:hover .card-media img.loaded {
  transform: scale(1.06);
}

.card-badge {
  position: absolute;
  z-index: 2;
  left: 8px;
  top: 8px;
  height: 22px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--paper);
  color: var(--ink);
  transition: transform 0.35s var(--spring);
}

.card-badge.c0 {
  background-color: var(--accent);
}
.card-badge.c1 {
  background-color: var(--accent-2);
}
.card-badge.c2 {
  background-color: var(--accent-3);
}

.card:hover .card-badge {
  transform: scale(1.06);
}

/* 순위 번호: 큰 굵은 숫자 */
.card-rank {
  position: absolute;
  z-index: 2;
  left: 0;
  bottom: 0;
  min-width: 46px;
  height: 46px;
  padding: 0 10px;
  display: grid;
  place-items: center;
  border-radius: 0 var(--radius) 0 0;
  font-family: var(--display);
  font-weight: 900;
  font-size: 24px;
  letter-spacing: -0.04em;
  background: var(--bg);
  color: var(--text);
}

.card-rank.r1 {
  background: var(--accent);
  color: var(--ink);
}

.card-rank.r2 {
  background: var(--paper);
  color: var(--ink);
}

.card-rank.r3 {
  background: var(--accent-3);
  color: var(--ink);
}

.palette-bar {
  display: flex;
  height: 3px;
  margin-top: 6px;
  border-radius: 2px;
  overflow: hidden;
  transition: height var(--mid) var(--ease);
}

.card:hover .palette-bar {
  height: 6px;
}

.palette-bar span {
  display: block;
}

.card-body {
  padding: 7px 1px 0;
}

.card-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-title .id {
  color: var(--text-faint);
  margin-right: 5px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 1px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.card-meta .who {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-meta .react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  color: var(--text-dim);
  font-weight: 600;
  transition: transform 0.3s var(--spring);
}

.card:hover .card-meta .react {
  transform: scale(1.1);
}

.load-more {
  display: flex;
  justify-content: center;
  margin-top: 30px;
}

/* ── 오버레이 (상세 / 로그인) ─────────────────────────── */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  overflow-y: auto;
  padding: 32px 20px;
  animation: fade 0.25s var(--ease);
}

.overlay.closing {
  pointer-events: none;
  animation: fade-out 0.2s var(--ease) forwards;
}

@keyframes fade {
  from {
    opacity: 0;
  }
}

@keyframes fade-out {
  to {
    opacity: 0;
  }
}

.sheet {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: sheet-in 0.5s var(--spring);
}

.overlay.closing .sheet {
  animation: sheet-out 0.2s var(--ease) forwards;
}

@keyframes sheet-in {
  from {
    transform: translateY(30px) scale(0.96);
    opacity: 0;
  }
}

@keyframes sheet-out {
  to {
    transform: translateY(10px) scale(0.97);
    opacity: 0;
  }
}

@keyframes rise {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
  transition: background var(--fast), transform 0.35s var(--spring);
}

.close-btn:hover {
  background: var(--accent);
  transform: rotate(90deg);
}

.detail {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr);
}

.detail-media {
  position: relative;
  background: #040404;
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  min-height: 320px;
}

.detail-media img {
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  animation: media-in 0.8s var(--ease);
}

@keyframes media-in {
  from {
    opacity: 0;
    transform: scale(1.04);
    filter: blur(10px);
  }
}

.detail-media .palette-bar {
  height: 10px;
  margin: 0;
  border-radius: 0;
}

.detail-info {
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* 오른쪽 정보가 차례로 나타나기 */
.detail-info > * {
  animation: rise 0.5s var(--ease) both;
}

.detail-info > :nth-child(2) {
  animation-delay: 0.05s;
}
.detail-info > :nth-child(3) {
  animation-delay: 0.1s;
}
.detail-info > :nth-child(4) {
  animation-delay: 0.15s;
}
.detail-info > :nth-child(5) {
  animation-delay: 0.2s;
}
.detail-info > :nth-child(6) {
  animation-delay: 0.25s;
}

.detail-info h2 {
  font-size: clamp(26px, 2.6vw, 36px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.04em;
  padding-right: 44px;
}

.detail-info h2 .id {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 20px;
  letter-spacing: 0;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  line-height: 1.2;
  color: var(--text);
}

.field-label .faint {
  font-family: var(--font);
  font-style: normal;
  font-size: 12px;
}

.kv {
  display: grid;
  grid-template-columns: 74px 1fr;
  margin: 0;
  font-size: 14px;
  border-top: 1px solid var(--line-strong);
}

.kv dt,
.kv dd {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.kv dt {
  color: var(--text-faint);
  font-weight: 600;
}

.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.user-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
  transition: background-size 0.3s var(--ease), color var(--fast);
}

.user-link:hover {
  color: var(--accent);
  background-size: 100% 1px;
}

.user-link img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.palette {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.palette button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--text-dim);
  font-size: 11px;
  font-family: var(--mono);
  transition: color var(--fast);
}

.palette button:hover {
  color: var(--text);
}

.palette button span.sw {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  transition: transform 0.35s var(--spring), border-radius 0.3s var(--ease);
}

.palette button:hover span.sw {
  transform: translateY(-4px) scale(1.08);
  border-radius: 30%;
}

/* 반응 */
.reactions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.react-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: var(--bg-card);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--fast), box-shadow var(--fast), transform 0.14s var(--ease);
}

.react-btn:hover {
  background: var(--bg-hover);
}

.react-btn:active {
  transform: scale(0.93);
}

.react-btn > span:first-child {
  display: inline-block;
  transition: transform 0.35s var(--spring);
}

.react-btn:hover > span:first-child {
  transform: scale(1.22) rotate(-10deg);
}

.react-btn.on {
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}

.react-btn .n {
  display: inline-block;
  font-size: 13.5px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.react-btn.on .n {
  color: var(--accent);
}

.react-btn.pop {
  animation: pop 0.5s var(--spring);
}

.react-btn.pop > span:first-child {
  animation: emoji-jump 0.65s var(--spring);
}

.react-btn.pop .n {
  animation: count-up 0.4s var(--ease);
}

@keyframes pop {
  40% {
    transform: scale(1.14);
  }
}

@keyframes emoji-jump {
  30% {
    transform: translateY(-7px) scale(1.4) rotate(-14deg);
  }
}

@keyframes count-up {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

.actions {
  display: grid;
  gap: 8px;
}

.actions > .btn {
  height: 46px;
}

.actions .row {
  display: flex;
  gap: 8px;
}

.actions .row .btn {
  flex: 1;
}

.hint {
  font-size: 12.5px;
  color: var(--text-faint);
}

.detail-similar {
  padding: 4px 26px 30px;
  border-top: 1px solid var(--line);
}

/* ── 로그인 창: 주황 카드 ──────────────────────────── */
.sheet.small {
  max-width: 460px;
  margin-top: 10vh;
  padding: 38px 30px 30px;
  background: var(--accent);
  color: var(--ink);
  border-radius: var(--radius);
  /* 네 귀퉁이의 작은 점 */
  background-image: radial-gradient(circle, var(--ink) 2.5px, transparent 3px), radial-gradient(circle, var(--ink) 2.5px, transparent 3px),
    radial-gradient(circle, var(--ink) 2.5px, transparent 3px), radial-gradient(circle, var(--ink) 2.5px, transparent 3px), var(--print);
  background-size: 12px 12px, 12px 12px, 12px 12px, 12px 12px, 160px 160px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-blend-mode: normal, normal, normal, normal, overlay;
  background-position: 8px 8px, calc(100% - 8px) 8px, 8px calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), 0 0;
}

.sheet.small .close-btn {
  top: 18px;
  right: 18px;
  background: var(--ink);
  color: var(--accent);
}

.sheet.small .close-btn:hover {
  background: #000;
}

.login-body {
  text-align: center;
}

.login-body h2 {
  font-size: 44px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.05em;
  animation: rise 0.5s var(--ease) 0.08s both;
}

.login-body > p {
  animation: rise 0.5s var(--ease) 0.2s both;
}

.login-body .muted,
.login-body .hint {
  color: rgba(17, 17, 17, 0.72);
}

.login-body .btn {
  background: var(--ink);
  color: var(--text);
  box-shadow: none;
  animation: rise 0.5s var(--ease) 0.26s both;
}

.login-body .btn:hover {
  background: #000;
}

.login-body .btn.block {
  height: 46px;
}

.login-body .btn.sm {
  animation: none;
}

.login-body .empty {
  color: var(--ink);
  border-color: rgba(17, 17, 17, 0.35);
}

.login-code {
  font-family: var(--mono);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--accent);
  margin: 12px 0;
  animation: pop-in 0.45s var(--spring);
}

.command-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(17, 17, 17, 0.12);
  border-radius: var(--radius);
  padding: 8px 8px 8px 12px;
  font-family: var(--mono);
  font-size: 14px;
  text-align: left;
}

.command-box code {
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: rgba(17, 17, 17, 0.7);
  margin: 16px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(17, 17, 17, 0.25);
}

/* ── 인기 / 색상 / 랭킹 / 프로필 ──────────────────────── */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 18px 0 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.page-head h1 {
  font-size: clamp(40px, 6.4vw, 84px);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.sub-filters {
  margin-bottom: 18px;
}

.page-head p {
  margin: 12px 0 0;
  max-width: 640px;
  color: var(--text-dim);
}

.color-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.color-tile {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 0;
  background: var(--bg-elev);
  transition: transform var(--mid) var(--ease), box-shadow var(--mid) var(--ease), background var(--mid);
  cursor: pointer;
  text-align: left;
  padding: 0;
  animation: card-in 0.55s var(--ease) both;
}

.color-tile:nth-child(2) {
  animation-delay: 0.03s;
}
.color-tile:nth-child(3) {
  animation-delay: 0.06s;
}
.color-tile:nth-child(4) {
  animation-delay: 0.09s;
}
.color-tile:nth-child(5) {
  animation-delay: 0.12s;
}
.color-tile:nth-child(6) {
  animation-delay: 0.15s;
}
.color-tile:nth-child(7) {
  animation-delay: 0.18s;
}
.color-tile:nth-child(8) {
  animation-delay: 0.21s;
}
.color-tile:nth-child(9) {
  animation-delay: 0.24s;
}
.color-tile:nth-child(10) {
  animation-delay: 0.27s;
}
.color-tile:nth-child(n + 11) {
  animation-delay: 0.3s;
}

.color-tile:hover {
  transform: translateY(-4px);
  background: var(--bg-card);
}

.color-tile .sw {
  height: 92px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  transition: height var(--mid) var(--ease), filter var(--mid);
}

.color-tile:hover .sw {
  height: 100px;
  filter: saturate(1.15);
}

.color-tile .info {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.color-tile .info b {
  font-family: var(--display);
  font-size: 16px;
  font-weight: 750;
}

.color-tile .info .faint {
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
}

.color-tile.on {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.color-tile.on .faint {
  color: rgba(17, 17, 17, 0.6);
}

.color-tile.on::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 900;
  animation: pop-in 0.35s var(--spring);
}

.hex-search {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  margin: 18px 0 8px;
  flex-wrap: wrap;
}

.hex-text {
  flex: 1;
  min-width: 200px;
}

.hex-search b {
  font-family: var(--display);
  font-size: 17px;
  letter-spacing: -0.02em;
}

.hex-search input[type='color'] {
  width: 52px;
  height: 52px;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  transition: transform 0.35s var(--spring);
}

.hex-search input[type='color']:hover {
  transform: scale(1.08) rotate(-8deg);
}

.hex-search input[type='color']::-webkit-color-swatch-wrapper {
  padding: 0;
}

.hex-search input[type='color']::-webkit-color-swatch {
  border-radius: 50%;
  border: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.hex-search input[type='color']::-moz-color-swatch {
  border-radius: 50%;
  border: 0;
}

.text-input {
  height: 40px;
  border-radius: 999px;
  border: 0;
  background: var(--bg);
  padding: 0 14px;
  font-family: var(--mono);
  width: 130px;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow var(--fast);
}

.text-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 2px var(--accent);
}

/* 랭킹 시상대 */
.podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: end;
  margin-bottom: 22px;
}

.podium .p {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 22px 16px;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
  transition: transform var(--mid) var(--ease), box-shadow var(--mid);
  animation: podium-in 0.7s var(--spring) both;
}

.podium .p:nth-child(1) {
  animation-delay: 0.14s;
}
.podium .p:nth-child(3) {
  animation-delay: 0.26s;
}

@keyframes podium-in {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
}

.podium .p:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow);
}

/* 1위: 주황 카드 / 2위: 종이색 / 3위: 파랑 */
.podium .p.first {
  padding-top: 34px;
  padding-bottom: 30px;
  background: var(--accent);
  color: var(--ink);
  background-image: radial-gradient(circle, var(--ink) 2.5px, transparent 3px), radial-gradient(circle, var(--ink) 2.5px, transparent 3px),
    radial-gradient(circle, var(--ink) 2.5px, transparent 3px), radial-gradient(circle, var(--ink) 2.5px, transparent 3px), var(--print);
  background-size: 12px 12px, 12px 12px, 12px 12px, 12px 12px, 160px 160px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-blend-mode: normal, normal, normal, normal, overlay;
  background-position: 8px 8px, calc(100% - 8px) 8px, 8px calc(100% - 8px), calc(100% - 8px) calc(100% - 8px), 0 0;
}

.podium .p:nth-child(1):not(.first) {
  background: var(--paper);
  color: var(--ink);
}

.podium .p:nth-child(3) {
  background: var(--accent-3);
  color: var(--ink);
}

.podium .p.first .hint,
.podium .p:nth-child(1) .hint,
.podium .p:nth-child(3) .hint {
  color: rgba(17, 17, 17, 0.65);
}

.podium .p.first .avatar {
  box-shadow: 0 0 0 4px var(--ink);
}

.podium .place {
  font-family: var(--display);
  font-size: 44px;
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -0.05em;
}

.podium .name {
  font-family: var(--display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.03em;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium .score {
  font-family: var(--display);
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

/* 순위표: 종이색 표 */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  animation: page-in 0.6s var(--ease) 0.2s both;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(17, 17, 17, 0.12);
  font-size: 14px;
}

.table th {
  color: rgba(17, 17, 17, 0.55);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  border-bottom-color: rgba(17, 17, 17, 0.4);
}

.table tr:last-child td {
  border-bottom: 0;
}

.table td.num,
.table th.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table tbody tr {
  cursor: pointer;
}

.table tbody td {
  transition: background var(--fast);
}

.table tbody tr:hover td {
  background: var(--accent);
}

.table tbody tr:hover .who-cell .avatar {
  transform: scale(1.12) rotate(-6deg);
}

.rank-cell {
  font-family: var(--display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: -0.03em;
  width: 64px;
  font-variant-numeric: tabular-nums;
}

.who-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.who-cell .avatar {
  transition: transform 0.3s var(--spring);
}

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}

.pager .muted {
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
}

/* 프로필: 거친 주황 배너 + 겹친 아바타 + 큰 이름 */
.profile-head {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 14px 20px;
  padding: 62px 24px 24px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
  isolation: isolate;
  animation: page-in 0.5s var(--ease);
}

.profile-head > .avatar {
  grid-column: 1;
  grid-row: 1;
}

.profile-head > .profile-name {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}

.profile-head > .profile-score {
  grid-column: 2;
  grid-row: 2;
}

.profile-head::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 118px;
  background: radial-gradient(120% 140% at 0% 0%, #ffb067 0%, var(--accent) 35%, #c64a00 100%);
  transform-origin: top;
  animation: banner-in 0.8s var(--ease) both;
}

.profile-head::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 118px;
  opacity: 0.45;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.15' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

@keyframes banner-in {
  from {
    transform: scaleY(0.4);
    opacity: 0;
  }
}

.profile-head .avatar.lg {
  width: 112px;
  height: 112px;
  border: 6px solid var(--bg-elev);
  box-sizing: border-box;
  animation: pop-in 0.6s var(--spring) 0.15s both;
}

.profile-head h1 {
  font-size: clamp(30px, 4.4vw, 54px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.profile-head .handle {
  display: block;
  margin-bottom: 4px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 18px;
  color: var(--text-dim);
}

.profile-score {
  text-align: right;
}

.profile-score .big {
  font-family: var(--display);
  font-size: clamp(30px, 3.6vw, 44px);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}

.profile-score .muted {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.stat {
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 16px 18px;
  transition: transform var(--mid) var(--ease), background var(--mid);
  animation: card-in 0.55s var(--ease) both;
}

.stat:nth-child(2) {
  animation-delay: 0.06s;
}
.stat:nth-child(3) {
  animation-delay: 0.12s;
}
.stat:nth-child(4) {
  animation-delay: 0.18s;
}

.stat:hover {
  transform: translateY(-3px);
  background: var(--bg-card);
}

.stat .v {
  font-family: var(--display);
  font-size: 34px;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat .k {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--text-dim);
}

.bars {
  display: grid;
  gap: 12px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.bar {
  display: grid;
  grid-template-columns: 140px 1fr 40px;
  gap: 12px;
  align-items: center;
  font-size: 13.5px;
}

.bar b {
  text-align: right;
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}

.bar .track {
  height: 10px;
  border-radius: 999px;
  background: var(--bg);
  overflow: hidden;
}

.bar .fill {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  transform-origin: left;
  animation: grow-x 1s var(--ease) 0.25s both;
}

.bar:nth-child(3n + 2) .fill {
  background: var(--accent-2);
}

.bar:nth-child(3n + 3) .fill {
  background: var(--accent-3);
}

@keyframes grow-x {
  from {
    transform: scaleX(0);
  }
}

/* ── 토스트 ─────────────────────────────────────────── */
#toasts {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  justify-items: center;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 11px 14px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
  font-weight: 600;
  font-size: 14px;
  animation: toast-in 0.45s var(--spring);
  max-width: min(92vw, 520px);
}

.toast::before {
  content: '';
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-3);
}

.toast.ok::before {
  background: var(--good);
}

.toast.error::before {
  background: var(--bad);
}

.toast.leaving {
  animation: toast-out 0.25s var(--ease) forwards;
}

@keyframes toast-in {
  from {
    transform: translateY(24px) scale(0.9);
    opacity: 0;
  }
}

@keyframes toast-out {
  to {
    transform: translateY(12px) scale(0.95);
    opacity: 0;
  }
}

/* ── 푸터: 주황 카드 + 큰 워드마크 ───────────────────── */
.footer {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px 28px;
}

.footer-signal {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 44px 24px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--ink);
  text-align: center;
  background-image: radial-gradient(circle, var(--ink) 2.5px, transparent 3px), radial-gradient(circle, var(--ink) 2.5px, transparent 3px),
    radial-gradient(circle, var(--ink) 2.5px, transparent 3px), radial-gradient(circle, var(--ink) 2.5px, transparent 3px), var(--print);
  background-size: 12px 12px, 12px 12px, 12px 12px, 12px 12px, 160px 160px;
  background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, repeat;
  background-blend-mode: normal, normal, normal, normal, overlay;
  background-position: 10px 10px, calc(100% - 10px) 10px, 10px calc(100% - 10px), calc(100% - 10px) calc(100% - 10px), 0 0;
}

.footer-signal h2 {
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.footer-signal p {
  margin: 0;
  max-width: 520px;
  font-size: 14px;
  font-weight: 550;
  color: rgba(17, 17, 17, 0.78);
}

.footer-signal .btn {
  margin-top: 6px;
  background: var(--ink);
  color: var(--text);
  box-shadow: none;
}

.footer-signal .btn:hover {
  background: #000;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.footer-mark {
  font-family: var(--display);
  font-weight: 900;
  font-size: clamp(44px, 12vw, 128px);
  line-height: 0.84;
  letter-spacing: -0.055em;
  margin-left: -0.04em;
}

.footer-mark .ch {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.5em);
}

.footer.in .footer-mark .ch {
  animation: letter-in 0.8s var(--ease) both;
  animation-delay: calc(var(--d, 0) * 35ms);
  opacity: 1;
  transform: none;
}

.footer-cols {
  display: flex;
  gap: 40px;
  font-size: 13px;
  color: var(--text-dim);
}

.footer-cols nav {
  display: grid;
  gap: 4px;
}

.footer-cols nav a {
  transition: color var(--fast), transform 0.3s var(--spring);
}

.footer-cols nav a:hover {
  color: var(--accent);
  transform: translateX(3px);
}

.footer-cols p {
  margin: 0;
  max-width: 260px;
  color: var(--text-faint);
  font-size: 12.5px;
}

/* ── 피드: 썸네일을 영상 목록처럼 보기 ─────────────────
   유튜브 홈 화면의 크기와 색을 따름 (Roboto, 16:9, 모서리 12px) */
.yt-screen {
  --yt-bg: #0f0f0f;
  --yt-text: #f1f1f1;
  --yt-sub: #aaaaaa;
  --yt-chip: rgba(255, 255, 255, 0.1);
  --yt-chip-hover: rgba(255, 255, 255, 0.2);
  --yt-chip-on: #f1f1f1;
  --yt-chip-on-text: #0f0f0f;
  --yt-line: rgba(255, 255, 255, 0.2);
  padding: 20px 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--yt-bg);
  color: var(--yt-text);
  font-family: Roboto, Arial, 'Pretendard Variable', Pretendard, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  letter-spacing: 0;
  transition: background var(--mid) var(--ease), color var(--mid) var(--ease);
}

.yt-screen.light {
  --yt-bg: #ffffff;
  --yt-text: #0f0f0f;
  --yt-sub: #606060;
  --yt-chip: rgba(0, 0, 0, 0.05);
  --yt-chip-hover: rgba(0, 0, 0, 0.1);
  --yt-chip-on: #0f0f0f;
  --yt-chip-on-text: #ffffff;
  --yt-line: #d3d3d3;
}

.yt-top {
  display: grid;
  gap: 14px;
  margin-bottom: 22px;
}

.yt-search {
  display: flex;
  max-width: 640px;
  height: 40px;
}

.yt-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0 16px;
  border: 1px solid var(--yt-line);
  border-right: 0;
  border-radius: 40px 0 0 40px;
  background: transparent;
  color: var(--yt-text);
  font: inherit;
  font-size: 16px;
}

.yt-search input:focus {
  outline: none;
  border-color: #1c62b9;
}

.yt-search button {
  width: 64px;
  border: 1px solid var(--yt-line);
  border-radius: 0 40px 40px 0;
  background: var(--yt-chip);
  color: var(--yt-text);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.yt-search button:hover {
  background: var(--yt-chip-hover);
}

.yt-chips {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.yt-chips button {
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: var(--yt-chip);
  color: var(--yt-text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--fast);
}

.yt-chips button:hover {
  background: var(--yt-chip-hover);
}

.yt-chips button.on {
  background: var(--yt-chip-on);
  color: var(--yt-chip-on-text);
}

.yt-chips .shuffle span {
  display: inline-flex;
  transition: transform 0.5s var(--spring);
}

.yt-chips .shuffle:hover span {
  transform: rotate(180deg);
}

.yt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 40px 16px;
}

.yt-card {
  display: block;
  min-width: 0;
  color: var(--yt-text);
}

.yt-card.in {
  animation: card-in 0.6s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@media (prefers-reduced-motion: no-preference) {
  .yt-card:not(.in) {
    opacity: 0;
  }
}

.yt-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  transition: border-radius 0.2s ease;
}

.yt-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.4s var(--ease), transform 0.6s var(--ease);
}

.yt-thumb img.loaded {
  opacity: 1;
}

/* 마우스를 올리면 실제 화면처럼 모서리가 펴지고 살짝 확대 */
.yt-card:hover .yt-thumb {
  border-radius: 0;
}

.yt-card:hover .yt-thumb img.loaded {
  transform: scale(1.03);
}

.yt-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
}

.yt-info {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}

.yt-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 500;
}

.yt-text {
  min-width: 0;
}

.yt-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 16px;
  font-weight: 500;
  line-height: 22px;
  margin-bottom: 4px;
}

.yt-channel,
.yt-meta {
  font-size: 14px;
  line-height: 20px;
  color: var(--yt-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.yt-card:hover .yt-channel {
  color: var(--yt-text);
}

.yt-screen .load-more .btn.view-all {
  font-family: var(--font);
}

.yt-screen .empty {
  color: var(--yt-sub);
  border-color: var(--yt-line);
}

/* ── 색 면 질감: 주황 · 초록 · 파랑 · 종이색 면에 인쇄물 같은 거친 결 ── */
.nav a.active,
.lang-switch button.on,
.menu,
.btn.primary,
.btn.discord,
.btn.view-all,
.chip.on,
.banner > div,
.hero-pills button,
.segmented button.on,
.card-badge,
.card-rank.r1,
.card-rank.r2,
.card-rank.r3,
.color-tile.on,
.podium .p:nth-child(1):not(.first),
.podium .p:nth-child(3),
.table,
.bar .fill,
.toast,
.close-btn {
  background-image: var(--print);
  background-size: 160px 160px;
  background-blend-mode: overlay;
}

/* ── 반응형 ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .brand span {
    display: none;
  }

  .nav-random .label {
    display: none;
  }

  .nav .nav-random {
    padding: 0 9px;
  }
}

@media (max-width: 960px) {
  .detail {
    grid-template-columns: 1fr;
  }

  .detail-media {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  .bot-status span {
    display: none;
  }
}

@media (max-width: 720px) {
  /* 상단 바를 두 줄로: 위는 로고 · 언어 · 계정, 아래는 메뉴.
     아래로 스크롤하면 숨었다가 위로 올리면 다시 나타남 (main.js 의 nav-hidden) */
  .topbar {
    transition: transform 0.35s var(--ease);
  }

  body.nav-hidden .topbar {
    transform: translateY(-100%);
  }

  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    gap: 0 10px;
    padding: 0 12px;
  }

  .brand {
    flex: 1;
    height: 52px;
  }

  .brand span {
    display: inline;
  }

  .nav {
    order: 3;
    flex: 0 0 100%;
    gap: 6px;
    padding: 0 0 10px;
  }

  .nav a,
  .nav button {
    font-size: 13px;
  }

  .topbar-right {
    gap: 10px;
  }

  .page {
    padding: 12px 12px 48px;
  }

  .banner {
    padding: 0 12px;
  }

  .hero-banner {
    min-height: 340px;
    padding: 16px 16px 18px;
  }

  .hero h1 {
    font-size: clamp(42px, 14.5vw, 72px);
  }

  .hero p {
    font-size: 14px;
  }

  .searchbox input {
    height: 50px;
    font-size: 15px;
  }

  .filters {
    padding: 2px 14px;
  }

  .filter-row {
    gap: 8px;
  }

  .filter-row > .label {
    width: 100%;
  }

  .overlay {
    padding: 0;
  }

  .sheet {
    border-radius: 0;
    min-height: 100%;
    animation: sheet-up 0.4s var(--ease);
  }

  @keyframes sheet-up {
    from {
      transform: translateY(50px);
      opacity: 0;
    }
  }

  .sheet.small {
    min-height: 0;
    margin: 12vh 12px 24px;
    border-radius: var(--radius);
    padding: 56px 20px 24px;
  }

  .detail-media {
    border-radius: 0;
  }

  .detail-info {
    padding: 22px 16px;
  }

  .detail-similar {
    padding: 4px 16px 24px;
  }

  .podium {
    grid-template-columns: 1fr;
  }

  .podium .p.first {
    order: -1;
  }

  /* 시상대를 가로 한 줄 카드로 */
  .podium .p,
  .podium .p.first {
    grid-template-columns: auto auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
    column-gap: 14px;
    row-gap: 0;
    padding: 18px 20px;
  }

  .podium .place {
    grid-column: 1;
    grid-row: 1 / span 3;
    font-size: 36px;
  }

  .podium .avatar.lg {
    grid-column: 2;
    grid-row: 1 / span 3;
    width: 60px;
    height: 60px;
  }

  .podium .name,
  .podium .score,
  .podium .hint {
    grid-column: 3;
  }

  .podium .score {
    font-size: 26px;
  }

  .profile-head {
    grid-template-columns: minmax(0, 1fr);
    padding: 62px 18px 18px;
  }

  .profile-head > .profile-score {
    grid-column: 1;
    grid-row: 3;
    text-align: left;
  }

  .bar {
    grid-template-columns: 100px 1fr 32px;
  }

  .table th,
  .table td {
    padding: 11px 12px;
  }

  .table .hide-sm {
    display: none;
  }

  .searchbox kbd {
    display: none;
  }

  .masonry {
    gap: 10px;
  }

  .yt-screen {
    padding: 14px 12px 20px;
  }

  .yt-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .masonry-col {
    gap: 16px;
  }

  .footer {
    padding: 0 12px 24px;
  }

  .footer-signal {
    padding: 36px 18px;
  }

  .footer-cols {
    gap: 24px;
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  #account .btn.discord .label {
    display: none;
  }

  #account .btn.discord {
    padding: 0 10px;
  }

  .nav a::before {
    display: none;
  }

  .nav {
    gap: 4px;
  }

  .nav a {
    padding: 0 8px;
    font-size: 12.5px;
  }

  .brand {
    font-size: 17px;
  }
}

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

  .footer-mark .ch {
    opacity: 1;
    transform: none;
  }
}

/* ─────────────────────────────────────────────────────────
   관리자: 레퍼런스 가져오기 (#/import)
   왼쪽에 큰 이미지, 오른쪽에 입력칸 · 태그. 키보드로 빠르게.
   ───────────────────────────────────────────────────────── */
.imp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.imp-scan {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 420px;
  min-width: 0;
}

/* 채널 이름이 잘리지 않게 최소 너비 (좁은 화면에서는 한 줄 전체) */
.imp-scan select {
  flex: 0 1 280px;
  min-width: 220px;
  max-width: 100%;
}

.imp-scan-info {
  color: var(--text-dim);
  font-size: 13px;
}

.imp-scan-info.warn {
  color: var(--warn);
}

.imp-counts,
.imp-tabs,
.imp-cats,
.imp-tags,
.imp-actions,
.imp-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.imp-tabs {
  margin-bottom: 18px;
}

.imp-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.imp-progress {
  font-family: var(--mono);
  color: var(--text-dim);
}

.imp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr);
  gap: 20px;
  align-items: start;
}

.imp-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.imp-img {
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
}

.imp-img-missing {
  display: grid;
  place-items: center;
  min-height: 240px;
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  background: var(--bg-elev);
  border-radius: var(--radius-lg);
}

.imp-source {
  color: var(--text-dim);
  font-size: 13px;
}

.imp-source a {
  color: var(--accent);
}

.imp-content {
  margin: 8px 0 0;
  padding: 10px 12px;
  max-height: 140px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: 13px/1.5 var(--font);
  color: var(--text);
  background: var(--bg-elev);
  border-radius: var(--radius);
}

.imp-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 80px;
}

.imp-label {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.imp-input {
  width: 100%;
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 15px;
}

.imp-input:focus {
  outline: none;
  border-color: var(--accent);
}

.imp-hint {
  align-items: center;
  min-height: 0;
  font-size: 12.5px;
  color: var(--warn);
}

.chip.sm {
  height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.imp-form kbd,
.imp-tabs kbd {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  font: 600 10.5px var(--mono);
  color: inherit;
  opacity: 0.8;
}

.chip.on kbd,
.btn.primary kbd {
  background: rgba(0, 0, 0, 0.14);
}

.imp-actions {
  margin-top: 10px;
}

.imp-help {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-faint);
}

.imp-dup:empty {
  display: none;
}

.imp-dup {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: rgba(255, 176, 32, 0.08);
}

.imp-dup-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.imp-dup-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.imp-dup-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 120px;
  font-size: 12px;
  color: var(--text-dim);
}

.imp-dup-list img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.imp-names-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 14px;
}

.imp-names h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 18px;
}

.imp-names h2 .count {
  font-size: 13px;
  color: var(--text-faint);
}

.imp-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  margin-bottom: 10px;
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.imp-group-names {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.imp-group-names label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.imp-group-names .count {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

@media (max-width: 860px) {
  .imp-grid,
  .imp-names-grid {
    grid-template-columns: 1fr;
  }

  .imp-form {
    position: static;
  }
}

/* ── 보드 / 수정 제안 / 여러 제작자 ───────────────────── */

/* 카드 위 "보드에 저장" 버튼: 마우스를 올리면 보이고, 터치 화면에서는 항상 보임 */
.card-save {
  position: absolute;
  z-index: 3;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: opacity var(--fast), transform 0.3s var(--spring), background var(--fast), color var(--fast);
}

.card:hover .card-save,
.yt-card:hover .card-save,
.card-save:focus-visible {
  opacity: 1;
  transform: none;
}

.card-save:hover {
  background: var(--accent);
  color: var(--ink);
}

@media (hover: none) {
  .card-save {
    opacity: 1;
    transform: none;
  }
}

/* 어두운 창 (보드 고르기, 수정) */
.sheet.panel {
  max-width: 560px;
  margin-top: 6vh;
  padding: 30px 26px 26px;
}

.sheet.panel h3 {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
  padding-right: 44px;
  margin-bottom: 6px;
}

.picker > p.muted {
  font-size: 13.5px;
  margin-bottom: 18px;
}

.picker-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 46vh;
  overflow-y: auto;
  margin-bottom: 16px;
}

.picker-none {
  padding: 10px 0;
}

.picker-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-card);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}

.picker-item:hover {
  background: var(--bg-hover);
}

.picker-item.on {
  border-color: var(--accent);
}

.picker-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  font-size: 14px;
}

.picker-name b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.picker-name .faint {
  font-size: 12px;
}

.picker-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  transition: background var(--fast), border-color var(--fast);
}

.picker-item.on .picker-check {
  border-color: var(--accent);
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.picker-new,
.board-new {
  display: flex;
  gap: 8px;
}

.picker-new .form-input,
.board-new .form-input {
  flex: 1;
  min-width: 0;
}

.board-new {
  flex: 0 1 420px;
}

/* 보드 표지: 썸네일 최대 4장 */
.board-cover {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
}

.board-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 0;
}

.board-cover.n1 img {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}

.board-cover.n2 img {
  grid-row: 1 / -1;
}

.board-cover.n3 img:first-child {
  grid-row: 1 / -1;
}

.board-cover.sm {
  width: 72px;
  border-radius: var(--radius-sm);
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px 18px;
  margin-bottom: 32px;
}

.board-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.board-tile .board-cover {
  margin-bottom: 6px;
  transition: transform 0.35s var(--spring), box-shadow var(--fast);
}

.board-tile:hover .board-cover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.board-name {
  font-weight: 800;
  font-size: 16px;
  letter-spacing: -0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.board-tile .faint {
  font-size: 13px;
}

.board-owner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.board-owner .user-link img {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

/* 입력칸 */
.form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-card);
  font-size: 15px;
}

.form-input.area {
  height: auto;
  padding: 10px 14px;
  resize: vertical;
  font: inherit;
}

.form-input:focus {
  outline: none;
  border-color: var(--accent);
}

.edit-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.edit-form > p.muted {
  margin: -8px 0 0;
  font-size: 13.5px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-field[hidden] {
  display: none;
}

.form-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
}

.segmented.wrap {
  display: flex;
}

.edit-tags {
  max-height: 200px;
  overflow-y: auto;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

/* 수정 제안 */
.proposal-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 40px;
}

.proposal {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-elev);
}

.detail-proposals:empty {
  display: none;
}

.detail-proposals .proposal {
  grid-template-columns: minmax(0, 1fr);
  padding: 12px;
  margin-bottom: 8px;
  background: var(--bg-card);
}

.proposal-thumb img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius);
}

.proposal-thumb.gone {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-faint);
  font-size: 13px;
}

.proposal-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.proposal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.proposal-title {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.02em;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proposal-title .id {
  color: var(--accent);
  margin-right: 6px;
}

.status {
  flex-shrink: 0;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--bg-active);
  color: var(--text-dim);
}

.status.s-pending {
  background: var(--accent-soft);
  color: var(--accent);
}

.status.s-accepted {
  background: rgba(63, 202, 92, 0.16);
  color: var(--good);
}

.status.s-rejected {
  background: rgba(255, 77, 77, 0.14);
  color: var(--bad);
}

.proposal-who {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
}

.proposal-who a:hover {
  color: var(--accent);
}

.avatar.xs {
  width: 20px;
  height: 20px;
}

.proposal-note {
  margin: 0;
  padding: 6px 12px;
  border-left: 3px solid var(--accent);
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  color: var(--text-dim);
}

.diff {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 6px 10px;
  margin: 0;
  font-size: 13.5px;
}

.diff dt {
  color: var(--text-faint);
  font-weight: 600;
}

.diff dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.diff-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.chip.static.add {
  border-color: rgba(63, 202, 92, 0.5);
  color: var(--good);
}

.chip.static.remove {
  border-color: rgba(255, 77, 77, 0.45);
  color: var(--bad);
  text-decoration: line-through;
}

.proposal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* 메뉴 숫자 */
.badge {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: 1px;
}

.account-btn {
  position: relative;
}

.badge.dot {
  position: absolute;
  top: -4px;
  right: -6px;
  margin: 0;
  box-shadow: 0 0 0 2px var(--bg);
}

label.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
}

.creator-list {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}

@media (max-width: 640px) {
  .proposal {
    grid-template-columns: minmax(0, 1fr);
  }

  .board-new {
    flex: 1 1 100%;
  }

  .board-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }
}

/* ── 그레인 설정 ─────────────────────────────────────── */

/* 표지 사진 위에는 그레인을 얹지 않음 (작품 자체의 질감과 헷갈리지 않게) */
.hero-banner::after {
  content: none;
}

.profile-head::after {
  opacity: 0.35;
}

/* 그레인 끄기: 배경 노이즈와 색 위의 인쇄 질감을 모두 없앰 */
html.no-grain {
  --print: none;
}

html.no-grain body::before,
html.no-grain .profile-head::after {
  content: none;
}

.grain-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color var(--fast), background var(--fast);
}

.grain-toggle::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  transition: background var(--fast);
}

.grain-toggle:hover {
  color: var(--text);
}

.grain-toggle[aria-pressed='false'] {
  color: var(--text-faint);
}

.grain-toggle[aria-pressed='false']::before {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--text-faint);
}

@media (max-width: 640px) {
  .grain-toggle {
    padding: 0 9px;
  }
}

/* ── 사이트에서 올리기 ──────────────────────────────── */
.upload-btn {
  height: 30px;
}

.drop-zone {
  display: block;
  width: 100%;
  padding: 0;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}

.drop-zone:hover,
.drop-zone.over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 150px;
  padding: 16px;
  text-align: center;
}

.drop-inner b {
  color: var(--text);
  font-size: 15px;
}

.drop-inner img {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius);
  object-fit: contain;
}

.drop-name {
  font-size: 13px;
  color: var(--text);
  overflow-wrap: anywhere;
}

.upload-dup:empty {
  display: none;
}

.upload-dup {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--warn);
  border-radius: var(--radius);
  background: rgba(255, 176, 32, 0.08);
}

.upload-dup-title {
  font-weight: 700;
  font-size: 13.5px;
}

.upload-dup-list {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.upload-dup-list a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 140px;
  font-size: 12px;
}

.upload-dup-list img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.upload-dup .btn {
  align-self: flex-start;
}

@media (max-width: 640px) {
  .upload-btn {
    padding: 0 10px;
  }
}

/* ── 태그 관리 (관리자) ─────────────────────────────── */
.tag-admin-search {
  flex: 0 1 280px;
}

.tag-admin-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 40px;
  border-top: 1px solid var(--line);
}

.tag-admin-row {
  display: grid;
  grid-template-columns: minmax(140px, auto) 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
}

.tag-admin-row .chip {
  justify-self: start;
}

.tag-admin-row .faint {
  font-size: 13px;
  text-align: right;
}

.tag-admin-desc {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .tag-admin-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .tag-admin-desc {
    display: none;
  }
}
