/* =========================================================
   ON통 (All-in-Tong) — Design System
   "세상의 모든 유익한 정보를 모아놓은 큐레이션 저장고"
   ========================================================= */

:root {
  /* Brand */
  --brand-primary: #ff7a45;
  --brand-primary-dark: #e85d2a;
  --brand-secondary: #ffd166;
  --brand-ink: #1f1b16;

  /* Category colors (심리/기력/문구/소식) */
  --c-simri: #9b87f5;       /* 심리통 보라 */
  --c-simri-soft: #efeaff;
  --c-giryeok: #34d399;     /* 기력통 초록 */
  --c-giryeok-soft: #e3fbf1;
  --c-mungu: #f472b6;       /* 문구통 분홍 */
  --c-mungu-soft: #fde7f3;
  --c-sosik: #60a5fa;       /* 소식통 파랑 */
  --c-sosik-soft: #e3efff;

  /* Neutrals */
  --bg: #fafaf7;
  --bg-muted: #f3f2ee;
  --surface: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-subtle: #9ca3af;
  --border: #e7e5de;
  --border-strong: #d6d3c8;

  /* Ad slot */
  --ad-bg: #f8f6ef;
  --ad-border: #e0dbc8;
  --ad-text: #9a8a58;

  /* Shape */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(31, 27, 22, 0.04);
  --shadow: 0 4px 16px rgba(31, 27, 22, 0.06);
  --shadow-lg: 0 12px 40px rgba(31, 27, 22, 0.12);

  /* Layout */
  --container: 1120px;
  --nav-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  font-family: "Pretendard", "Noto Sans KR", -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}
.nav {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  color: var(--brand-ink);
}
.logo .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--brand-primary);
  display: inline-block;
  margin: 0 4px 3px 2px;
  align-self: center;
}
.logo em {
  color: var(--brand-primary);
  font-style: normal;
}
.nav-links {
  display: flex;
  gap: 6px;
  margin-left: 8px;
}
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 15px;
  transition: background .15s, color .15s;
}
.nav-links a:hover { background: var(--bg-muted); color: var(--text); }
.nav-links a.is-active {
  background: var(--brand-ink);
  color: #fff;
}
.nav-spacer { flex: 1; }
.nav-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-search {
  width: 38px; height: 38px;
  border-radius: 50%;
  background: var(--bg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.btn-ghost, .btn-primary {
  padding: 9px 16px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform .1s, background .15s;
}
.btn-ghost { color: var(--text); background: var(--bg-muted); }
.btn-primary { color: #fff; background: var(--brand-primary); }
.btn-primary:hover { background: var(--brand-primary-dark); }
.btn-primary:active { transform: translateY(1px); }

/* ---------- Hero (Home) — Compact strip ---------- */
.hero {
  padding: 28px 0 8px;
}
.hero-strip {
  background: linear-gradient(135deg, #fff2e8, #fff8ed);
  border-radius: var(--radius-lg);
  padding: 26px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid #ffe1c8;
}
.hero-strip h1 {
  font-size: 26px;
  margin: 0 0 6px;
  letter-spacing: -0.6px;
  font-weight: 800;
  line-height: 1.3;
}
.hero-strip h1 .on {
  color: var(--brand-primary);
}
.hero-strip p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}
.hero-strip .strip-stats {
  display: flex; gap: 20px;
  padding: 8px 18px;
  background: #fff;
  border-radius: 999px;
  border: 1px solid #ffe1c8;
  font-size: 13px;
  flex-shrink: 0;
}
.hero-strip .strip-stats b {
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 17px;
  display: block;
  line-height: 1;
}
.hero-strip .strip-stats span {
  color: var(--text-subtle);
  font-size: 11px;
  margin-top: 2px;
}
.hero-strip .strip-stats .item { text-align: center; }

/* ---------- Section ---------- */
.section {
  padding: 40px 0;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.section-head h2 {
  font-size: 26px;
  letter-spacing: -0.5px;
  margin: 0;
  font-weight: 800;
}
.section-head .sub {
  color: var(--text-muted);
  font-size: 14px;
  margin-top: 4px;
}
.section-head .more {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
}
.section-head .more:hover { color: var(--brand-primary); }

/* Pills */
.pill-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.pill {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 600;
}
.pill.is-on {
  background: var(--brand-ink);
  border-color: var(--brand-ink);
  color: #fff;
}

/* Category quick nav — 4 big colored tiles */
.cat-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0 10px;
}
.cat-tile {
  position: relative;
  display: flex; align-items: center; gap: 14px;
  padding: 22px 20px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 700;
  overflow: hidden;
  transition: transform .15s, box-shadow .15s;
  cursor: pointer;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cat-tile .tile-emoji {
  font-size: 34px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.15));
}
.cat-tile .tile-name { font-size: 18px; letter-spacing: -0.3px; }
.cat-tile .tile-sub { font-size: 11px; opacity: .85; margin-top: 2px; font-weight: 500; }
.cat-tile.simri { background: linear-gradient(135deg, #9b87f5, #6f57db); }
.cat-tile.giryeok { background: linear-gradient(135deg, #34d399, #059669); }
.cat-tile.mungu { background: linear-gradient(135deg, #f472b6, #db2777); }
.cat-tile.sosik { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.cat-tile::after {
  content: "›";
  position: absolute;
  right: 18px;
  font-size: 26px;
  opacity: .7;
  line-height: 1;
}

/* ---------- Card Grid ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}
.card-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
.card-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  cursor: pointer;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
  border-color: var(--border-strong);
}
.card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
  color: rgba(255,255,255,.95);
  overflow: hidden;
  background-size: cover;
  background-position: center;
}
.card-thumb.has-image .thumb-emoji { display: none; }
.card-thumb.has-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.45) 100%);
  z-index: 1;
}
.card-rank {
  position: absolute;
  right: 10px; bottom: 10px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,.28);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  z-index: 2;
  backdrop-filter: blur(4px);
}
.card-hot {
  position: absolute;
  right: 10px; top: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ff3b3b;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .5px;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(255,59,59,.35);
}
.card-thumb .thumb-emoji {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.18));
}
.card-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(255,255,255,.28), transparent 60%);
}
.card-cat {
  position: absolute;
  left: 12px; top: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  z-index: 2;
}
.card-cat.simri { color: var(--c-simri); }
.card-cat.giryeok { color: var(--c-giryeok); }
.card-cat.mungu { color: var(--c-mungu); }
.card-cat.sosik { color: var(--c-sosik); }

.card-body {
  padding: 14px 16px 18px;
}
.card-hook {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-primary);
  margin-bottom: 6px;
  letter-spacing: .2px;
}
.card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0 0 10px;
  min-height: 44px;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-subtle);
}
.card-meta b { color: var(--text-muted); font-weight: 700; }

/* Hero/Feature card */
.feature-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  background: linear-gradient(135deg, var(--c-simri) 0%, #7a64e0 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}
.feature-card.theme-giryeok { background: linear-gradient(135deg, var(--c-giryeok), #0d9467); }
.feature-card.theme-mungu { background: linear-gradient(135deg, var(--c-mungu), #be2a77); }
.feature-card.theme-sosik { background: linear-gradient(135deg, var(--c-sosik), #1e6ed8); }
.feature-left {
  padding: 44px 44px 44px;
  display: flex; flex-direction: column;
  justify-content: center;
}
.feature-left .tag {
  display: inline-block;
  padding: 5px 12px;
  background: rgba(255,255,255,.2);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 14px;
  width: fit-content;
}
.feature-left h3 {
  font-size: 30px;
  line-height: 1.2;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.feature-left p {
  margin: 0 0 22px;
  opacity: .92;
  font-size: 15px;
  max-width: 360px;
}
.feature-left .btn-primary {
  background: #fff;
  color: var(--brand-ink);
  width: fit-content;
}
.feature-left .btn-primary:hover { background: #fffae6; }
.feature-right {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
}
.feature-emoji {
  font-size: 180px;
  line-height: 1;
  filter: drop-shadow(0 10px 30px rgba(0,0,0,.2));
}

/* Ranking list */
.rank-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 28px;
}
.rank-item {
  display: flex;
  gap: 16px;
  padding: 12px 8px;
  border-bottom: 1px dashed var(--border);
  align-items: center;
  cursor: pointer;
  border-radius: 8px;
  transition: background .12s;
}
.rank-item:hover { background: var(--bg-muted); }
.rank-num {
  font-weight: 800;
  font-size: 22px;
  color: var(--brand-primary);
  width: 28px;
  flex-shrink: 0;
}
.rank-body { flex: 1; min-width: 0; }
.rank-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rank-meta { font-size: 12px; color: var(--text-subtle); }
.rank-thumb {
  width: 56px; height: 56px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; flex-shrink: 0;
}

/* ---------- Ad Slot ---------- */
.ad-slot {
  background: var(--ad-bg);
  border: 1px dashed var(--ad-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--ad-text);
  font-size: 13px;
  margin: 28px 0;
  position: relative;
}
.ad-slot::before {
  content: "광고 (AD)";
  position: absolute;
  top: 8px; left: 12px;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ad-text);
  opacity: .8;
  font-weight: 700;
}
.ad-slot.banner { min-height: 90px; display: flex; align-items: center; justify-content: center; }
.ad-slot.banner-lg { min-height: 250px; }
.ad-slot.inline { min-height: 100px; }
.ad-slot .ad-label {
  font-weight: 700;
  font-size: 15px;
  color: var(--ad-text);
}
.ad-slot .ad-size {
  display: block;
  font-size: 11px;
  margin-top: 4px;
  opacity: .7;
}

/* ---------- Category page ---------- */
.cat-head {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.cat-head .crumb {
  color: var(--text-subtle);
  font-size: 13px;
  margin-bottom: 10px;
}
.cat-head .crumb a:hover { color: var(--brand-primary); }
.cat-head h1 {
  font-size: 38px;
  margin: 0 0 8px;
  letter-spacing: -0.8px;
  font-weight: 800;
}
.cat-head .desc {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0;
  max-width: 620px;
}
.cat-head .badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  border-radius: 999px;
  margin-right: 8px;
  vertical-align: middle;
}
.cat-head.simri { border-top: 4px solid var(--c-simri); }
.cat-head.giryeok { border-top: 4px solid var(--c-giryeok); }
.cat-head.mungu { border-top: 4px solid var(--c-mungu); }
.cat-head.sosik { border-top: 4px solid var(--c-sosik); }
.cat-head.simri .badge { background: var(--c-simri); }
.cat-head.giryeok .badge { background: var(--c-giryeok); }
.cat-head.mungu .badge { background: var(--c-mungu); }
.cat-head.sosik .badge { background: var(--c-sosik); }

/* ---------- Detail / Test player ---------- */
.detail-hero {
  text-align: center;
  padding: 64px 20px 40px;
  background: linear-gradient(180deg, var(--c-simri-soft), #fff 85%);
  border-radius: var(--radius-lg);
  margin-top: 24px;
}
.detail-hero.theme-giryeok { background: linear-gradient(180deg, var(--c-giryeok-soft), #fff 85%); }
.detail-hero.theme-mungu { background: linear-gradient(180deg, var(--c-mungu-soft), #fff 85%); }
.detail-hero.theme-sosik { background: linear-gradient(180deg, var(--c-sosik-soft), #fff 85%); }

.detail-hero .tag {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.detail-hero h1 {
  font-size: 36px;
  margin: 0 0 12px;
  line-height: 1.25;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.detail-hero .hook {
  font-size: 16px;
  color: var(--text-muted);
  margin: 0 auto 28px;
  max-width: 560px;
}
.detail-hero .emoji-big {
  font-size: 96px;
  line-height: 1;
  margin-bottom: 16px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,.1));
}
.detail-meta {
  display: inline-flex;
  gap: 24px;
  padding: 10px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
}
.detail-meta b { color: var(--text); font-weight: 700; }
.start-btn {
  padding: 15px 36px;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  background: var(--brand-primary);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(255, 122, 69, 0.35);
  transition: transform .1s;
}
.start-btn:hover { background: var(--brand-primary-dark); }
.start-btn:active { transform: translateY(1px); }

/* Question screen */
.quiz-wrap {
  max-width: 640px;
  margin: 40px auto;
}
.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.quiz-progress .bar {
  flex: 1;
  height: 8px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress .fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary), #ffa76e);
  border-radius: 999px;
  transition: width .35s ease;
}
.quiz-progress .count {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 46px;
  text-align: right;
}
.quiz-question {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  text-align: center;
  margin-bottom: 20px;
}
.quiz-question .q-num {
  color: var(--brand-primary);
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 14px;
  letter-spacing: .5px;
}
.quiz-question h2 {
  font-size: 22px;
  line-height: 1.4;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quiz-opt {
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  transition: all .12s;
}
.quiz-opt:hover {
  border-color: var(--brand-primary);
  background: #fff7f2;
  transform: translateX(2px);
}

/* ---------- Result ---------- */
.result-hero {
  background: linear-gradient(135deg, var(--c-simri), #7a64e0);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 48px 32px;
  text-align: center;
  margin-top: 24px;
}
.result-hero.theme-giryeok { background: linear-gradient(135deg, var(--c-giryeok), #0d9467); }
.result-hero.theme-mungu { background: linear-gradient(135deg, var(--c-mungu), #be2a77); }
.result-hero.theme-sosik { background: linear-gradient(135deg, var(--c-sosik), #1e6ed8); }

.result-hero .label {
  font-size: 14px;
  opacity: .8;
  margin-bottom: 8px;
  letter-spacing: 1px;
}
.result-hero .emoji-big {
  font-size: 110px;
  line-height: 1;
  margin: 8px 0 16px;
}
.result-hero h1 {
  font-size: 32px;
  margin: 0 0 10px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.result-hero .subtitle {
  font-size: 16px;
  opacity: .9;
  max-width: 560px;
  margin: 0 auto;
}

.result-body {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  margin-top: -30px;
  position: relative;
  z-index: 1;
}
.result-body h3 {
  font-size: 17px;
  margin: 0 0 12px;
  font-weight: 800;
}
.result-body p {
  color: var(--text-muted);
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.65;
}
.result-traits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.trait-chip {
  padding: 14px 16px;
  background: var(--bg-muted);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
}
.trait-chip b { color: var(--brand-primary); display: block; margin-bottom: 3px; font-size: 12px; }

.share-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 28px 0 8px;
  flex-wrap: wrap;
}
.share-btn {
  padding: 12px 22px;
  background: var(--bg-muted);
  border-radius: 999px;
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
  display: inline-flex; align-items: center; gap: 6px;
}
.share-btn:hover { background: var(--border); }
.share-btn.primary { background: var(--brand-primary); color: #fff; }
.share-btn.primary:hover { background: var(--brand-primary-dark); }

/* =========================================================
   Phrase collection (문구통 상세 페이지)
   ========================================================= */
.phrase-hero {
  text-align: center;
  padding: 52px 20px 36px;
  background: linear-gradient(180deg, var(--c-mungu-soft), #fff);
  border-radius: var(--radius-lg);
  margin-top: 24px;
  position: relative;
  overflow: hidden;
}
.phrase-hero .emoji-big {
  font-size: 80px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.08));
}
.phrase-hero h1 {
  font-size: 32px;
  margin: 0 0 10px;
  letter-spacing: -0.5px;
  font-weight: 800;
}
.phrase-hero .hook {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0 auto;
  max-width: 520px;
}
.phrase-hero .meta-pill {
  display: inline-flex;
  gap: 18px;
  padding: 8px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.phrase-hero .meta-pill b { color: var(--text); font-weight: 700; }

/* 상단 필터 pills (toourguest 스타일) */
.phrase-filter {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 20px 4px 18px;
  margin: 14px 0 4px;
  scrollbar-width: none;
  position: sticky;
  top: var(--nav-h);
  background: var(--bg);
  z-index: 10;
}
.phrase-filter::-webkit-scrollbar { display: none; }
.filter-pill {
  flex-shrink: 0;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .1s, color .1s, border-color .1s;
  white-space: nowrap;
}
.filter-pill:hover {
  border-color: var(--border-strong);
  color: var(--text);
}
.filter-pill.on {
  background: #fde5ec;
  border-color: #f9c3d3;
  color: #c2185b;
  font-weight: 700;
}

/* 4열 세로형 카드 그리드 */
.phrase-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 8px 0 40px;
}

.phrase-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 22px 22px 22px;
  box-shadow: 0 2px 8px rgba(31,27,22,.04);
  display: flex;
  flex-direction: column;
  min-height: 280px;
  transition: transform .12s, box-shadow .12s;
}
.phrase-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(31,27,22,.08);
}

.phrase-card .card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 2px;
}
.phrase-card .card-tags {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
}
.phrase-card .card-tag {
  padding: 4px 9px;
  background: var(--bg-muted);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  background: none;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color .1s, background .1s;
  flex-shrink: 0;
}
.copy-btn:hover {
  color: var(--text);
  background: var(--bg-muted);
}
.copy-btn.copied {
  color: #059669;
}
.copy-btn svg {
  width: 14px; height: 14px;
}

.phrase-card .card-divider {
  width: 40px;
  height: 1px;
  background: var(--border-strong);
  margin: 16px auto 18px;
}

.phrase-card .phrase-text {
  font-family: "Noto Serif KR", "Nanum Myeongjo", serif;
  font-size: 14.5px;
  line-height: 2.05;
  color: var(--text);
  text-align: center;
  flex: 1;
  word-break: keep-all;
  overflow-wrap: break-word;
  white-space: pre-line;
  margin: 0;
  font-weight: 400;
  letter-spacing: -0.2px;
}
.phrase-card .phrase-text.religion {
  /* 종교별 문구에서 [기독교] 같은 라벨 강조용 */
  font-size: 14px;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  background: var(--brand-ink);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  z-index: 200;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1200px) {
  .phrase-list { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .phrase-list { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 680px) {
  .phrase-list { grid-template-columns: 1fr; gap: 14px; }
  .phrase-hero h1 { font-size: 24px; }
  .phrase-hero .emoji-big { font-size: 60px; }
  .phrase-card { min-height: auto; padding: 20px 20px; }
  .phrase-card .phrase-text { font-size: 15px; line-height: 1.95; }
  .filter-pill { padding: 9px 16px; font-size: 13px; }
}

/* --- Rich result sections (motto, bars, compat, advice) --- */

.motto-card {
  text-align: center;
  padding: 26px 24px;
  background: linear-gradient(135deg, #fff8ed, #fff);
  border: 1.5px dashed #ffd89a;
  border-radius: var(--radius);
  margin: 20px 0 28px;
  position: relative;
}
.motto-card::before,
.motto-card::after {
  content: "";
  position: absolute;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--brand-primary);
  opacity: .12;
}
.motto-card::before { top: -8px; left: 20px; }
.motto-card::after  { bottom: -8px; right: 20px; }
.motto-card .quote {
  font-size: 20px;
  line-height: 1.5;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: var(--text);
  margin: 0;
}
.motto-card .motto-label {
  display: inline-block;
  padding: 4px 12px;
  background: var(--brand-primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: .3px;
}

/* Axis bars */
.axis-bars {
  margin: 18px 0 10px;
}
.axis-bar {
  margin-bottom: 16px;
}
.axis-bar:last-child { margin-bottom: 0; }
.axis-bar .axis-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
}
.axis-bar .axis-head .lbl-l {
  color: var(--text);
}
.axis-bar .axis-head .lbl-r {
  color: var(--text-subtle);
}
.axis-bar .axis-head .lbl-l.dim,
.axis-bar .axis-head .lbl-r.on {
  color: var(--text);
}
.axis-bar .axis-head .lbl-l.on { color: var(--brand-primary); }
.axis-bar .axis-head .lbl-r.on { color: var(--brand-primary); }
.axis-bar .axis-head .pct {
  font-weight: 800;
  font-size: 12px;
  color: var(--brand-primary);
}
.axis-bar .bar-track {
  position: relative;
  height: 12px;
  background: var(--bg-muted);
  border-radius: 999px;
  overflow: hidden;
}
.axis-bar .bar-fill {
  position: absolute;
  top: 0; left: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-primary), #ffb86b);
  transition: width .6s cubic-bezier(.22,.9,.3,1);
  animation: barGrow .8s cubic-bezier(.22,.9,.3,1);
}
@keyframes barGrow {
  from { width: 0 !important; }
}
.axis-bar .bar-desc {
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 6px;
}

/* Compatibility grid */
.compat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}
.compat-col {
  padding: 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-muted);
}
.compat-col.good { background: #e6faf1; }
.compat-col.bad  { background: #fee8ec; }
.compat-col .col-head {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  margin-bottom: 10px;
  color: var(--text);
}
.compat-col.good .col-head { color: #059669; }
.compat-col.bad .col-head  { color: #dc2626; }
.compat-col .c-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  font-weight: 600;
}
.compat-col .c-item .mini-emoji {
  font-size: 20px;
}

/* Advice box */
.advice-box {
  background: linear-gradient(180deg, #fffbf5, var(--surface));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-top: 14px;
}
.advice-box h4 {
  margin: 0 0 14px;
  font-size: 14px;
  font-weight: 800;
  color: var(--brand-primary);
  letter-spacing: .2px;
}
.advice-box ol {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: advice;
}
.advice-box li {
  counter-increment: advice;
  padding: 10px 0 10px 40px;
  border-bottom: 1px dashed var(--border);
  font-size: 14px;
  position: relative;
  line-height: 1.55;
}
.advice-box li:last-child { border-bottom: none; }
.advice-box li::before {
  content: counter(advice);
  position: absolute;
  left: 0; top: 8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--brand-primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800;
}

/* Result section header */
.result-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px dashed var(--border);
}
.result-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}
.result-section h3 {
  font-size: 16px;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.2px;
}
.result-section .sec-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: -6px 0 12px;
}

/* Friend challenge banner */
.friend-challenge {
  margin: 22px 0 0;
  padding: 20px 22px;
  background: linear-gradient(135deg, #9b87f5, #f472b6);
  color: #fff;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.friend-challenge .fc-body { flex: 1; min-width: 0; }
.friend-challenge h4 {
  margin: 0 0 4px;
  font-size: 16px;
  letter-spacing: -0.2px;
  font-weight: 800;
}
.friend-challenge p {
  margin: 0;
  font-size: 12px;
  opacity: .9;
}
.friend-challenge button {
  background: #fff;
  color: var(--brand-ink);
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

/* Recirculation bar */
.recirc {
  margin-top: 48px;
  padding: 32px 0;
  border-top: 1px solid var(--border);
}
.recirc h3 {
  font-size: 20px;
  margin: 0 0 16px;
  font-weight: 800;
}

/* ---------- Footer ---------- */
.site-footer {
  background: #1c1a16;
  color: #a39d8f;
  padding: 48px 0 32px;
  margin-top: 80px;
  font-size: 13px;
}
.site-footer .f-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid #2a2722;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.site-footer .logo { color: #fff; }
.site-footer .f-desc { max-width: 320px; line-height: 1.6; }
.site-footer .f-col { min-width: 120px; }
.site-footer .f-col h4 {
  color: #fff; font-size: 13px; margin: 0 0 10px; font-weight: 700;
}
.site-footer .f-col a { display: block; color: #a39d8f; padding: 3px 0; }
.site-footer .f-col a:hover { color: #fff; }
.site-footer .f-bottom {
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  color: #6f6a5e; font-size: 12px;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .card-grid { grid-template-columns: repeat(3, 1fr); }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-visual { max-width: 380px; justify-self: center; margin-top: 20px; }
  .feature-card { grid-template-columns: 1fr; }
  .feature-right { padding: 0 20px 30px; }
  .feature-emoji { font-size: 120px; }
  .rank-list { grid-template-columns: 1fr; }
  .hero h1 { font-size: 34px; }
  .nav-links a { padding: 8px 10px; font-size: 14px; }
}

@media (max-width: 680px) {
  .card-grid, .card-grid.grid-3, .card-grid.grid-2 { grid-template-columns: repeat(2, 1fr); }
  .section-head h2 { font-size: 22px; }
  .hero { padding: 32px 0 10px; }
  .hero h1 { font-size: 28px; }
  .hero-stats { gap: 16px; flex-wrap: wrap; }
  .detail-hero h1 { font-size: 26px; }
  .detail-hero .emoji-big { font-size: 72px; }
  .quiz-question h2 { font-size: 18px; }
  .result-hero h1 { font-size: 26px; }
  .result-traits { grid-template-columns: 1fr; }
  .nav { gap: 10px; }
  .nav-links { overflow-x: auto; flex-wrap: nowrap; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-tools .btn-ghost { display: none; }
  .feature-left { padding: 28px 24px; }
  .feature-left h3 { font-size: 22px; }
}

@media (max-width: 440px) {
  .card-grid, .card-grid.grid-3, .card-grid.grid-2 { grid-template-columns: 1fr; }
}

/* fade-in */
.view { animation: fadeUp .3s ease; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =========================================================
   ADMIN (관리자)
   ========================================================= */
.admin-wrap {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 32px 0 80px;
  min-height: calc(100vh - var(--nav-h));
}
.admin-side {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  height: fit-content;
}
.admin-side .who {
  padding: 14px 12px;
  background: var(--bg-muted);
  border-radius: 10px;
  margin-bottom: 12px;
}
.admin-side .who b { display: block; font-size: 14px; }
.admin-side .who span { font-size: 12px; color: var(--text-subtle); }
.admin-side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  transition: background .12s, color .12s;
}
.admin-side nav a:hover { background: var(--bg-muted); color: var(--text); }
.admin-side nav a.is-on { background: var(--brand-ink); color: #fff; }
.admin-side nav a.is-on span { opacity: 1; }
.admin-side nav .section-label {
  font-size: 11px; font-weight: 800; letter-spacing: 1px;
  color: var(--text-subtle); padding: 14px 12px 6px;
}

.admin-main .page-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap; gap: 12px;
}
.admin-main .page-head h1 {
  margin: 0; font-size: 28px; letter-spacing: -0.5px; font-weight: 800;
}
.admin-main .page-head .desc { color: var(--text-muted); margin: 4px 0 0; font-size: 14px; }
.admin-btn {
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--brand-primary);
  color: #fff;
  font-weight: 700; font-size: 14px;
  transition: background .12s;
}
.admin-btn:hover { background: var(--brand-primary-dark); }
.admin-btn.ghost { background: var(--bg-muted); color: var(--text); }
.admin-btn.ghost:hover { background: var(--border); }
.admin-btn.danger { background: #fee2e2; color: #b91c1c; }

/* Dashboard */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.stat-card .lbl { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 8px; }
.stat-card .num { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; }
.stat-card .trend { font-size: 12px; color: var(--c-giryeok); margin-top: 4px; font-weight: 700; }
.stat-card .trend.down { color: #f87171; }

.admin-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
}
.admin-box .box-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.admin-box .box-head h3 { margin: 0; font-size: 16px; font-weight: 800; }
.admin-box .box-head .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Admin content table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th, .admin-table td {
  text-align: left;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.admin-table th {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-subtle);
  background: var(--bg-muted);
  text-transform: uppercase;
  letter-spacing: .5px;
}
.admin-table tbody tr:hover { background: #fffbf3; }
.admin-table .thumb-mini {
  width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; background-size: cover; background-position: center;
  flex-shrink: 0;
}
.admin-table .row-title {
  font-weight: 700; font-size: 14px;
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1; -webkit-box-orient: vertical;
  overflow: hidden;
}
.admin-table .row-hook { font-size: 12px; color: var(--text-subtle); margin-top: 2px; }
.admin-table .cat-badge {
  display: inline-block;
  padding: 3px 9px; border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.admin-table .cat-badge.simri { background: var(--c-simri-soft); color: #6f57db; }
.admin-table .cat-badge.giryeok { background: var(--c-giryeok-soft); color: #059669; }
.admin-table .cat-badge.mungu { background: var(--c-mungu-soft); color: #db2777; }
.admin-table .cat-badge.sosik { background: var(--c-sosik-soft); color: #2563eb; }
.admin-table .flag {
  display: inline-block; padding: 2px 8px; font-size: 11px; border-radius: 4px;
  font-weight: 700; margin-right: 4px;
}
.admin-table .flag.pin { background: #fff2e8; color: var(--brand-primary); }
.admin-table .flag.hot { background: #ffe4e6; color: #e11d48; }

.icon-btn {
  padding: 6px 10px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
}
.icon-btn:hover { background: var(--bg-muted); color: var(--text); }
.icon-btn.danger:hover { background: #fee2e2; color: #b91c1c; }

/* Form */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
  padding: 24px;
}
.form-grid .full { grid-column: 1 / -1; }
.form-grid label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
  letter-spacing: .3px;
}
.form-grid input[type="text"],
.form-grid input[type="url"],
.form-grid textarea,
.form-grid select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 14px;
  background: var(--surface);
  transition: border-color .1s;
}
.form-grid input:focus,
.form-grid textarea:focus,
.form-grid select:focus {
  outline: none;
  border-color: var(--brand-primary);
}
.form-grid textarea { resize: vertical; min-height: 80px; }
.form-grid .hint { font-size: 11px; color: var(--text-subtle); margin-top: 4px; }
.form-grid .checkbox {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.form-grid .checkbox.on {
  border-color: var(--brand-primary);
  background: #fff2e8;
  color: var(--brand-primary);
}

.form-actions {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 16px 24px;
  background: var(--bg-muted);
  border-top: 1px solid var(--border);
}

.thumb-preview {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 16px;
  align-items: start;
}
.thumb-preview .preview-box {
  width: 160px; height: 160px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 56px;
  background-size: cover; background-position: center;
  border: 1px solid var(--border);
  overflow: hidden;
  position: relative;
}
.thumb-preview .input-wrap { flex: 1; }

/* 파일 업로드 버튼 */
.upload-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  flex-wrap: wrap;
}
.upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--brand-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .1s;
}
.upload-btn:hover { background: #000; }
.upload-btn.ghost {
  background: var(--bg-muted);
  color: var(--text);
}
.upload-btn.ghost:hover { background: var(--border); }
.upload-btn svg { width: 14px; height: 14px; }
.upload-status {
  font-size: 12px;
  color: var(--text-subtle);
}
.upload-status.ok { color: #059669; }
.upload-status.err { color: #dc2626; }

/* 결과별 배너 편집 블록 */
.result-edit-list {
  display: grid;
  gap: 10px;
  padding: 20px 24px 24px;
}
.result-edit-row {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}
.result-edit-row .banner-preview {
  width: 160px;
  height: 90px;
  border-radius: 8px;
  background: var(--bg-muted);
  background-size: cover;
  background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 34px;
  color: var(--text-subtle);
  border: 1px dashed var(--border-strong);
  overflow: hidden;
  flex-shrink: 0;
}
.result-edit-row .banner-preview.has-image {
  border-style: solid;
  border-color: var(--border);
}
.result-edit-row .meta {
  min-width: 0;
}
.result-edit-row .r-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.result-edit-row .r-sub {
  font-size: 12px;
  color: var(--text-subtle);
}
.result-edit-row .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* 결과 페이지 배너 (공개 화면) */
.result-banner {
  margin-top: 24px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.result-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: cover;
}

/* Storage usage 표시 */
.storage-indicator {
  padding: 16px 20px;
  background: var(--bg-muted);
  border-radius: 12px;
  margin-top: 20px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.storage-indicator.warn {
  background: #fff4e5;
  color: #b45309;
}
.storage-indicator.danger {
  background: #fee2e2;
  color: #b91c1c;
}
.storage-indicator .s-bar {
  flex: 1;
  height: 8px;
  background: var(--surface);
  border-radius: 999px;
  margin: 0 16px;
  overflow: hidden;
}
.storage-indicator .s-fill {
  height: 100%;
  background: var(--brand-primary);
  transition: width .3s;
}
.storage-indicator.warn .s-fill { background: #f59e0b; }
.storage-indicator.danger .s-fill { background: #ef4444; }

@media (max-width: 680px) {
  .result-edit-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .result-edit-row .banner-preview {
    width: 100%;
    height: 140px;
  }
  .result-edit-row .actions {
    justify-content: flex-end;
  }
}

/* Collection editor */
.coll-list { padding: 0; }
.coll-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px; align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
}
.coll-item:last-child { border-bottom: none; }
.coll-item h4 { margin: 0 0 3px; font-size: 15px; font-weight: 700; }
.coll-item .meta { font-size: 12px; color: var(--text-subtle); }
.coll-item .items-preview {
  display: flex; gap: 4px; margin-top: 8px;
}
.coll-item .items-preview .mini {
  width: 28px; height: 28px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; background-size: cover;
}

/* Picker in collection edit */
.item-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 16px 24px 0;
}
.item-picker .pick-card {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .1s;
}
.item-picker .pick-card:hover { border-color: var(--border-strong); }
.item-picker .pick-card.selected {
  border-color: var(--brand-primary);
  background: #fff7f2;
}
.item-picker .pick-thumb {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; background-size: cover; flex-shrink: 0;
}
.item-picker .pick-body { flex: 1; min-width: 0; }
.item-picker .pick-title {
  font-size: 12px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.item-picker .pick-cat { font-size: 10px; color: var(--text-subtle); }

/* Admin entry link in header */
.admin-entry {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #1f1b16;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.admin-entry:hover { background: #000; }

/* Modal (for share image) */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(31,27,22,.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fadeBack .2s ease;
}
@keyframes fadeBack { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: 92vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--bg-muted);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.modal-body { padding: 22px 24px; }
.modal-body canvas {
  width: 100%; height: auto;
  border-radius: var(--radius);
  display: block;
  box-shadow: var(--shadow);
}
.modal-foot {
  display: flex; gap: 8px; justify-content: flex-end;
  padding: 14px 24px 22px;
}

@media (max-width: 960px) {
  .admin-wrap { grid-template-columns: 1fr; }
  .admin-side { position: static; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .item-picker { grid-template-columns: repeat(2, 1fr); }
  .admin-table th:nth-child(4), .admin-table td:nth-child(4),
  .admin-table th:nth-child(5), .admin-table td:nth-child(5) { display: none; }
}
