:root {
  --bg: #f3f4f7;
  --card: #ffffff;
  --text: #0f1115;
  --sub: #4b5563;
  --muted: #8b93a1;
  --line: #e7e9ee;
  --ca: #2563eb;
  --cb: #e5484d;
  --radius: 20px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12;
    --card: #151922;
    --text: #f5f6f8;
    --sub: #c2c7d0;
    --muted: #8a92a0;
    --line: #232834;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.45;
  letter-spacing: -0.01em;
  word-break: keep-all;
  overflow-wrap: anywhere;
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; }
[hidden] { display: none !important; }

/* ---------- 상단 바 ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  height: 52px; padding: 0 16px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
}
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: -0.03em; }
.logo small { font-size: 10px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-left: 2px; transform: translateY(1px); }
.logo b {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px;
  font-size: 16px; font-weight: 900; color: #fff; letter-spacing: 0;
  background: linear-gradient(135deg, #2563eb 0 50%, #e5484d 50% 100%);
}
.live { font-size: 12px; font-weight: 600; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.live i { width: 7px; height: 7px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .18); animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

main { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }

/* ---------- 메인 ---------- */
.hero h1 { font-size: 24px; font-weight: 800; letter-spacing: -0.04em; margin: 6px 0 4px; }
.hero p { margin: 0 0 14px; color: var(--muted); font-size: 14px; }

.tabs { display: flex; gap: 6px; overflow-x: auto; margin: 0 -16px 14px; padding: 0 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; height: 34px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.list { display: grid; gap: 14px; }

/* ---------- 대결 카드 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card-link { display: block; -webkit-tap-highlight-color: transparent; }
.card-link:active .pair { transform: scale(.985); }

.pair { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 2px; background: var(--line); transition: transform .15s; }
.half { position: relative; aspect-ratio: 4 / 5; overflow: hidden; }
.half-a { --c: var(--ca); }
.half-b { --c: var(--cb); }

/* 사진이 없을 때: 진영 색 그라데이션 + 큰 이모지 */
.media-bg {
  position: absolute; inset: 0; display: grid; place-items: center;
  background:
    radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--c) 55%, #fff) 0%, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #000) 0%, color-mix(in srgb, var(--c) 70%, #000) 100%);
}
.media-bg .emoji { font-size: clamp(44px, 15vw, 64px); filter: drop-shadow(0 6px 14px rgba(0,0,0,.25)); transform: translateY(-10%); }
.half img, .media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.half img.pending { opacity: 0; }

.half-name {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 28px 10px 10px;
  background: linear-gradient(to top, rgba(0,0,0,.72), rgba(0,0,0,0));
  color: #fff; font-weight: 800; font-size: 15px; line-height: 1.25; text-align: center;
  letter-spacing: -0.03em; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.half-name.long { font-size: 13px; }

.vs {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 2;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 900; font-style: italic; letter-spacing: -0.02em;
  color: #fff; background: #0f1115;
  border: 3px solid var(--card);
  box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.tag-hot {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  font-size: 11px; font-weight: 800; color: #fff; background: #ef4444;
  padding: 4px 8px; border-radius: 999px; box-shadow: 0 2px 8px rgba(239,68,68,.4);
}

.card-body { padding: 14px 16px 6px; }
.card-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 600; }
.chip {
  font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px;
  background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--sub);
}
.card-title {
  margin: 8px 0 12px; font-size: 17px; font-weight: 800; line-height: 1.35; letter-spacing: -0.035em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.mini { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: var(--line); gap: 2px; }
.mini div { height: 100%; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.card-pcts { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; }
.card-pcts .pa { color: var(--ca); }
.card-pcts .pb { color: var(--cb); }
.card-pcts .empty { color: var(--muted); font-weight: 600; }

.card-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px 16px 16px; }
.card-actions .btn { height: 44px; font-size: 14px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
  font-size: 15px; font-weight: 700; cursor: pointer; white-space: nowrap;
  -webkit-tap-highlight-color: transparent; transition: transform .1s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.icon { width: 46px; padding: 0; }
.btn svg { width: 18px; height: 18px; flex: none; }
/* 공유하기 = 노란색(카톡 느낌), 링크 복사 = 흰색 */
.btn.share { background: #fee500; border-color: #fee500; color: #191600; }
.btn.copy { background: var(--card); }
.btn.done { background: #16a34a; border-color: #16a34a; color: #fff; }

/* ---------- 대결 페이지 ---------- */
.meta { display: flex; justify-content: space-between; align-items: center; }
.total { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.battle h1 {
  font-size: 23px; font-weight: 800; line-height: 1.3; letter-spacing: -0.045em;
  margin: 10px 0 16px; text-wrap: balance;
}

.arena { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.side {
  --c: var(--ca);
  position: relative; padding: 0; border: 0; background: none; cursor: pointer;
  border-radius: var(--radius); -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, opacity .25s, filter .25s;
}
.side-b { --c: var(--cb); }
.side:active { transform: scale(.97); }
.side:focus-visible { outline: 3px solid var(--c); outline-offset: 3px; }
.media {
  position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden;
  border-radius: var(--radius); box-shadow: var(--shadow);
  background:
    radial-gradient(120% 90% at 50% 20%, color-mix(in srgb, var(--c) 55%, #fff) 0%, transparent 60%),
    linear-gradient(160deg, color-mix(in srgb, var(--c) 92%, #000) 0%, color-mix(in srgb, var(--c) 70%, #000) 100%);
}
.media .emoji {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: clamp(52px, 18vw, 84px); transform: translateY(-8%);
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.25));
}
.media .name {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  padding: 36px 12px 14px;
  background: linear-gradient(to top, rgba(0,0,0,.75), rgba(0,0,0,0));
  color: #fff; font-weight: 800; font-size: 18px; line-height: 1.25; letter-spacing: -0.04em;
  text-align: center; text-wrap: balance;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.media .name.long { font-size: 15px; }
.mine {
  display: none; position: absolute; top: 10px; right: 10px; z-index: 2;
  font-size: 11px; font-weight: 800; color: #fff; background: var(--c);
  padding: 4px 9px; border-radius: 999px; box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.arena .vs { width: 46px; height: 46px; font-size: 15px; border-color: var(--bg); }

.voted .side { cursor: default; }
.voted.undo-open .side { cursor: pointer; }
.voted .side:active { transform: none; }
.voted .side.picked .media { box-shadow: 0 0 0 3px var(--c), var(--shadow); }
.voted .side.picked .mine { display: inline-block; }
.voted .side:not(.picked) { filter: grayscale(.55); opacity: .8; }
.side.leading .media .emoji { animation: bounce 1.8s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(-8%); } 50% { transform: translateY(-12%); } }

.credits { display: grid; gap: 2px; justify-items: center; margin: -6px 4px 18px; font-size: 11px; line-height: 1.45; color: var(--muted); text-align: center; }
.credit-line { color: inherit; opacity: .9; }
.credit-line b { font-weight: 700; color: var(--sub); }
.credit-line:active { text-decoration: underline; }
.tap-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 10px 0 0; font-weight: 600; }
.voted .tap-hint { display: none; }

.scores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; text-align: center; }
.score { display: flex; flex-direction: column; align-items: center; }
.pct { font-size: 34px; font-weight: 900; letter-spacing: -0.05em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.score-a .pct { color: var(--ca); }
.score-b .pct { color: var(--cb); }
.count { font-size: 13px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }

.tug {
  position: relative; display: flex; gap: 3px; height: 14px; margin: 14px 0 10px;
  border-radius: 999px; overflow: hidden; background: var(--line);
}
.tug-a, .tug-b { height: 100%; width: 50%; transition: width .8s cubic-bezier(.2,.8,.2,1); }
.tug-a { background: var(--ca); border-radius: 999px 0 0 999px; }
.tug-b { background: var(--cb); border-radius: 0 999px 999px 0; }
.tug-mid { display: none; }

.status { text-align: center; font-weight: 800; font-size: 16px; margin: 4px 0 16px; min-height: 24px; letter-spacing: -0.03em; text-wrap: balance; }
.status .hot { color: #ef4444; }

.cta { background: var(--card); border-radius: var(--radius); padding: 18px 16px 16px; box-shadow: var(--shadow); text-align: center; }
.cta-msg { margin: 0 0 14px; font-weight: 800; font-size: 17px; letter-spacing: -0.035em; text-wrap: balance; }
.cta-msg { margin-bottom: 4px; }
.cta-sub { margin: 0 0 14px; font-size: 13px; color: var(--muted); }
.share-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.share-row .btn { height: 50px; font-size: 15px; }
.link-box {
  display: flex; align-items: center; gap: 8px; margin-top: 10px;
  padding: 6px 6px 6px 12px; border-radius: 12px; background: var(--bg); border: 1px dashed var(--line);
}
.link-url { flex: 1; min-width: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; font-variant-numeric: tabular-nums; }
.link-copy { flex: none; height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: var(--text); color: var(--bg); font-size: 13px; font-weight: 700; cursor: pointer; }
.link-copy.done { background: #16a34a; color: #fff; }
.link-copy svg { width: 14px; height: 14px; vertical-align: -2px; }
.save-img { display: flex; align-items: center; justify-content: center; height: 46px; margin-top: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font-size: 14px; font-weight: 700; text-decoration: none; }
.save-img:active { transform: scale(.98); }
.save-img-tip { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.save-img[hidden], .save-img-tip[hidden] { display: none; }

.hint { font-size: 12px; color: var(--muted); text-align: center; margin: 14px 0 26px; text-wrap: balance; }

.more h2, .comments h2 { font-size: 18px; font-weight: 800; letter-spacing: -0.035em; margin: 8px 0 12px; }

/* ---------- 댓글 ---------- */
.comments { margin: 22px 0 32px; }
.comments h2 { display: flex; align-items: center; gap: 6px; }
.cmt-count { font-size: 15px; color: var(--muted); font-weight: 700; }
.cmt-form { background: var(--card); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; box-shadow: var(--shadow); }
.cmt-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cmt-nick, .cmt-body {
  width: 100%; font: inherit; color: inherit; background: var(--bg);
  border: 1px solid transparent; border-radius: 12px; padding: 11px 12px;
  font-size: 16px; /* iOS 확대 방지 */
}
.cmt-nick { max-width: 150px; height: 42px; }
.cmt-body { resize: none; min-height: 72px; line-height: 1.45; }
.cmt-nick:focus, .cmt-body:focus { outline: none; border-color: var(--text); }
.cmt-ipnote, .cmt-len { font-size: 12px; color: var(--muted); font-weight: 600; }
.cmt-submit { height: 40px; padding: 0 20px; font-size: 14px; }
.cmt-submit:disabled { opacity: .5; }
.cmt-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.cmt { position: relative; background: var(--card); border-radius: 16px; padding: 12px 14px 4px 16px; box-shadow: var(--shadow); overflow: hidden; }
.cmt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--line); }
.cmt.side-a::before { background: var(--ca); }
.cmt.side-b::before { background: var(--cb); }
.cmt-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; }
.cmt-who { font-weight: 800; }
/* 무엇을 골랐는지: 진영 색 알약 */
.cmt-pick {
  display: inline-flex; align-items: center; gap: 2px; flex: none;
  font-size: 12px; font-weight: 800; color: #fff; padding: 3px 9px; border-radius: 999px; background: var(--muted);
}
.cmt.side-a .cmt-pick, .cmt-pick.mine-a { background: var(--ca); }
.cmt.side-b .cmt-pick, .cmt-pick.mine-b { background: var(--cb); }
.cmt-form .cmt-pick { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; }
.cmt-locked {
  margin: 0; padding: 18px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow);
  text-align: center; font-size: 14px; font-weight: 700; color: var(--sub);
}
.cmt-time { color: var(--muted); margin-left: auto; font-size: 12px; }
.cmt-text { margin: 6px 0 0; white-space: pre-wrap; font-size: 15px; line-height: 1.5; }
.cmt-report { }
.cmt-empty { color: var(--muted); font-size: 14px; text-align: center; margin: 18px 0; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; top: calc(64px + env(safe-area-inset-top));
  transform: translate(-50%, -10px);
  background: var(--text); color: var(--bg);
  padding: 11px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; text-align: center;
  opacity: 0; pointer-events: none; transition: all .25s; width: max-content; max-width: calc(100% - 32px);
  box-shadow: 0 8px 24px rgba(0,0,0,.2); z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 작은 폰 (360px 이하) ---------- */
@media (max-width: 360px) {
  main { padding-left: 12px; padding-right: 12px; }
  .battle h1 { font-size: 21px; }
  .media .name { font-size: 16px; padding-bottom: 12px; }
  .media .name.long { font-size: 13px; }
  .half-name { font-size: 14px; }
  .half-name.long { font-size: 12px; }
  .pct { font-size: 30px; }
}

/* ---------- 태블릿·데스크톱 ---------- */
@media (min-width: 768px) {
  main { max-width: 880px; padding: 28px 24px 56px; }
  .battle { max-width: 640px; }
  .hero h1 { font-size: 30px; }
  .list { grid-template-columns: 1fr 1fr; gap: 18px; }
  .battle h1 { font-size: 30px; }
  .arena { gap: 14px; }
  .media .name { font-size: 22px; }
  .media .name.long { font-size: 18px; }
  .pct { font-size: 44px; }
  .side:hover .media { transform: translateY(-2px); }
  .media { transition: transform .2s, box-shadow .2s; }
  .voted .side:hover .media { transform: none; }
  .share-row { max-width: 420px; margin: 0 auto; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ===================== 선택지 3개 이상 ===================== */
/* 댓글: 선택지 색 (--pc) */
.cmt-pick { background: var(--pc, var(--muted)); }
.cmt::before { background: var(--pc, var(--line)); }

/* --- 메인 카드: 사진 모자이크 --- */
.mosaic { position: relative; display: grid; gap: 2px; background: var(--line); aspect-ratio: 5 / 4; transition: transform .15s; }
.mosaic .tile { position: relative; overflow: hidden; min-height: 0; }
.mosaic .tile .half-name { font-size: 13px; padding: 22px 6px 7px; -webkit-line-clamp: 1; }
.mosaic .tile .media-bg .emoji { font-size: clamp(26px, 9vw, 40px); }
.mosaic .tile.first::after {
  content: "👑"; position: absolute; top: 6px; left: 6px; z-index: 2; font-size: 16px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.4));
}
.mosaic.n3 { grid-template-columns: 1.2fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.n3 .tile:first-child { grid-row: 1 / 3; }
.mosaic.n4 { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; }
.mosaic.n5 { grid-template-columns: repeat(6, 1fr); grid-template-rows: 1.15fr 1fr; }
.mosaic.n5 .tile:nth-child(-n+2) { grid-column: span 3; }
.mosaic.n5 .tile:nth-child(n+3) { grid-column: span 2; }
.mosaic.n6 { grid-template-columns: repeat(3, 1fr); grid-template-rows: 1fr 1fr; }
.mosaic.n7, .mosaic.n8 { grid-template-columns: repeat(4, 1fr); grid-template-rows: 1fr 1fr; }
.mosaic.n7 .tile:first-child { grid-row: 1 / 3; }
.multi-badge { width: auto; height: 30px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-style: normal; }
.mosaic .multi-badge { top: 8px; left: auto; right: 8px; transform: none; height: 26px; font-size: 12px; padding: 0 10px; }
.mosaic .tag-hot { top: 40px; left: auto; right: 8px; }
.mini.multi { gap: 2px; }
.card-top2 { margin-top: 7px; font-size: 13px; font-weight: 800; color: var(--sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-top2.empty { color: var(--muted); font-weight: 600; }

/* --- 대결 화면: 사진 격자 --- */
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
/* 홀수 개면 마지막 칸은 가운데 */
.mgrid.n3 .mtile:last-child, .mgrid.n5 .mtile:last-child, .mgrid.n7 .mtile:last-child { grid-column: 1 / -1; width: calc(50% - 4px); justify-self: center; }
.mtile { --c: var(--ca); }
.mtile .media { aspect-ratio: 5 / 4; }
.mtile .media .name { font-size: 16px; padding: 30px 10px 22px; -webkit-line-clamp: 1; }
.mtile .media .emoji { font-size: clamp(40px, 13vw, 64px); }
.mtile .mpct {
  position: absolute; right: 10px; top: 10px; z-index: 2;
  font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); font-variant-numeric: tabular-nums;
}
.mtile .mine { right: auto; left: 10px; top: auto; bottom: 30px; }
.mtile .rank-badge {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  font-size: 11px; font-weight: 800; color: #fff; background: rgba(0,0,0,.55); padding: 3px 8px; border-radius: 999px;
}
.mtile.leading .rank-badge { background: #f59e0b; color: #1f1300; }
.mtile .mbar { position: absolute; left: 10px; right: 10px; bottom: 9px; z-index: 2; height: 6px; border-radius: 999px; background: rgba(255,255,255,.3); overflow: hidden; }
.mtile .mbar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 999px; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.mtile.picked .mbar i { background: var(--c); }

/* --- 대결 화면: 실시간 순위 --- */
.ranking { list-style: none; margin: 14px 0 6px; padding: 12px; display: grid; gap: 10px; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.rank-row { display: grid; grid-template-columns: 26px minmax(64px, auto) 1fr auto; align-items: center; gap: 8px; font-size: 14px; }
.rank-row .rk { text-align: center; font-weight: 900; color: var(--muted); }
.rank-row .rname { font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-row .rbar { height: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.rank-row .rbar i { display: block; height: 100%; width: 0; background: var(--c); border-radius: 999px; transition: width .7s cubic-bezier(.2,.8,.2,1); }
.rank-row .rpct { font-size: 12px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rank-row.is-mine .rname::after { content: " · 내 선택"; color: var(--c); font-size: 12px; }
.is-multi .status { margin-top: 10px; }
.mosaic .half { aspect-ratio: auto; }

/* ===================== 대댓글 ===================== */
.cmt-actions { display: flex; gap: 14px; margin-top: 2px; }
.cmt-act { font-size: 12px; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 10px 0; min-height: 40px; cursor: pointer; }
.cmt-act:active { color: var(--text); }
.replies { list-style: none; margin: 0 0 4px; padding: 0 0 0 14px; display: grid; gap: 6px; border-left: 2px solid var(--line); }
.replies:empty { display: none; }
.cmt.reply { background: var(--bg); box-shadow: none; border-radius: 12px; padding: 9px 12px 2px 14px; }
.cmt.reply .cmt-text { font-size: 14px; }
.cmt.reply .cmt-pick { font-size: 11px; padding: 2px 7px; }
.reply-form { display: grid; gap: 6px; margin: 6px 0 8px 14px; }
.reply-form textarea {
  width: 100%; font: inherit; font-size: 16px; color: inherit; background: var(--bg);
  border: 1px solid var(--text); border-radius: 12px; padding: 10px 12px; resize: none; min-height: 64px;
}
.reply-form textarea:focus { outline: none; }
.reply-cancel { background: none; border: 0; color: var(--muted); font-weight: 700; font-size: 13px; padding: 8px 4px; cursor: pointer; }
.reply-submit { height: 38px; padding: 0 16px; font-size: 13px; }
.card-lock { font-size: 13px; font-weight: 700; color: var(--muted); }
.credits.before-vote { display: none; }

/* ---------- 사진 없는 선택지: 이름 첫 글자 모노그램 ---------- */
.emoji.initial {
  font-family: inherit; font-weight: 900; font-style: normal; letter-spacing: -0.06em; line-height: 1;
  color: rgba(255, 255, 255, .95); filter: none;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .06), 0 10px 30px rgba(0, 0, 0, .18);
}
.media-bg .emoji.initial { font-size: clamp(56px, 20vw, 88px); }
.media .emoji.initial { font-size: clamp(72px, 26vw, 120px); }
.mtile .media .emoji.initial { font-size: clamp(48px, 16vw, 76px); }
/* 모노그램 뒤에 은은한 원 두 개 (빈 느낌 없애기) */
.media-bg:has(.initial)::before, .media:has(> .initial)::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 85% 12%, rgba(255,255,255,.16) 0 18%, transparent 18.5%),
    radial-gradient(circle at 8% 92%, rgba(0,0,0,.10) 0 26%, transparent 26.5%);
}

/* ---------- 만들기 버튼 ---------- */
.make-cta {
  display: flex; align-items: center; justify-content: center; height: 46px; margin: 0 0 14px;
  border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--text) 25%, transparent);
  font-size: 15px; font-weight: 800; color: var(--text);
}
.make-cta:active { transform: scale(.98); }
.report-wrap { text-align: center; margin: -14px 0 22px; }
.report-battle { border: 0; background: none; font-size: 12px; color: var(--muted); text-decoration: underline; cursor: pointer; padding: 6px; }

/* ---------- 대결 만들기 페이지 ---------- */
.me { display: inline-flex; gap: 10px; font-size: 13px; font-weight: 600; color: var(--sub); }
.me a { color: var(--muted); text-decoration: underline; }
.make { max-width: 560px; margin: 0 auto; padding: 18px 16px 40px; }
.make h1 { margin: 4px 0 6px; font-size: 26px; letter-spacing: -0.04em; }
.make-sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.make-gate { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 20px 22px; text-align: center; }
.gate-art { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 16px; }
.gate-art span { width: 64px; height: 80px; border-radius: 14px; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: #fff; background: linear-gradient(160deg, #3b82f6, #1d4ed8); }
.gate-art span:last-child { background: linear-gradient(160deg, #f43f5e, #be123c); }
.gate-art i { font-style: italic; font-weight: 900; font-size: 14px; }
.gate-msg { font-size: 17px; font-weight: 800; margin: 0 0 16px; }
.kakao-login { width: 100%; height: 52px; background: #fee500; border-color: #fee500; color: #191600; font-size: 16px; }
.gate-note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

.make-form { display: grid; gap: 20px; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 14px; font-weight: 800; display: flex; justify-content: space-between; align-items: baseline; }
.field-label em { font-style: normal; font-weight: 600; font-size: 12px; color: var(--muted); }
.make-form input:not([type=file]) {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--card); color: var(--text); font: inherit; font-size: 16px; font-weight: 600;
}
.make-form input:focus { outline: 2px solid var(--text); outline-offset: -1px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; font-weight: 700; cursor: pointer; color: var(--sub); }
.cat-chip[aria-checked="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

.opt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt-row { position: relative; display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 16px; padding: 8px; border: 1px solid var(--line); flex-wrap: wrap; }
.opt-row::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; border-radius: 0 4px 4px 0; background: var(--c); }
.opt-photo {
  flex: none; width: 64px; height: 64px; border-radius: 12px; overflow: hidden; padding: 0; cursor: pointer;
  border: 1.5px dashed color-mix(in srgb, var(--c) 60%, transparent);
  background: color-mix(in srgb, var(--c) 10%, var(--card)); color: var(--c);
  display: grid; place-items: center; align-content: center; gap: 0;
}
.opt-photo .plus { font-size: 22px; font-weight: 700; line-height: 1; }
.opt-photo .cap { font-size: 11px; font-weight: 700; }
.opt-photo.has { border: 0; }
.opt-photo img { width: 100%; height: 100%; object-fit: cover; }
.make-form input.opt-name { flex: 1; min-width: 0; height: 48px; border: 0; background: transparent; padding: 0 6px; }
.make-form input.opt-name:focus { outline: none; }
.opt-x { flex: none; height: 32px; min-width: 32px; padding: 0 8px; border-radius: 10px; border: 0; background: color-mix(in srgb, var(--text) 7%, transparent); color: var(--sub); font-size: 13px; font-weight: 700; cursor: pointer; }
.photo-x { position: absolute; left: 8px; bottom: -2px; transform: translateY(100%); height: 24px; font-size: 11px; background: none; color: var(--muted); text-decoration: underline; padding: 0; }
.opt-row:has(.photo-x) { margin-bottom: 18px; }
.add-opt { width: 100%; border-style: dashed; color: var(--sub); }
.preview .card { pointer-events: none; }
.make-rules { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.make-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: #fee2e2; color: #b91c1c; font-size: 14px; font-weight: 700; }
.btn.big { width: 100%; height: 56px; font-size: 17px; border-radius: 16px; }
.btn:disabled { opacity: .6; }

.notice-page { max-width: 420px; margin: 18vh auto 0; padding: 0 16px; text-align: center; }
.notice-page h1 { font-size: 22px; }
.notice-page p { color: var(--muted); }
