/* 인지도 — 화면 공통. 색은 아래 변수에서만 정한다.
   검정 바탕 + 파랑(소유자 지시 2026-10-02). 밝은 화면 설정은 따르지 않는다 — 사진이 가장 돋보이는 한 가지 테마 */
:root {
  --bg: #000; --panel: #0b0e15; --panel-2: #131926; --line: #1e2636; --text: #eef3ff; --muted: #8e9bb8; --faint: #56627d;
  --brand: #ff3d7f; --brand-2: #ffa3c4; --brand-ink: #fff; --brand-soft: rgba(255, 61, 127, .16);
  /* 그라데이션·테두리 선·빛번짐 금지 — 전부 단색(소유자 지시 2026-10-02) */
  --brand-hover: #e8306f;
  --glass: rgba(10, 14, 24, .72);
  --ok: #34d399; --warn: #fbbf24; --danger: #f87171; --info: #ffa3c4;
  --board-out: #000; --board-bg: #000; --hover-ring: rgba(99, 200, 255, .9); --is-dark: 1;
  --radius: 16px; --shadow: 0 12px 40px rgba(0, 0, 0, .6);  --top-h: 52px; --scope-h: 0px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* 스크롤 막대는 어디에도 보이지 않게(소유자 지시 2026-10-02) — 스크롤 자체는 그대로 된다 */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); overflow: hidden;
  font: 15px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
input, textarea, select { font: inherit; color: var(--text); }
:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--brand); color: #fff; padding: 8px 12px; border-radius: 8px; }
.skip:focus { left: 8px; }
[hidden] { display: none !important; }

/* ── 버튼 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--panel-2); cursor: pointer; font-weight: 600; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--line); }
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: transparent; cursor: pointer; display: inline-grid; place-items: center; font-size: 20px; }
.icon-btn:hover { background: var(--panel-2); }

/* ── 머리 ── 한 줄: 로고 · 검색 · 메뉴 · 내 정보 */
.top { height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0; display: flex; align-items: center; gap: 14px; background: rgba(0, 0, 0, .86); backdrop-filter: blur(14px); position: relative; z-index: 20; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo::before { content: ''; width: 22px; height: 22px; border-radius: 7px; background: var(--brand); }
.logo b { font-weight: 900; letter-spacing: .08em; font-size: 18px; color: var(--brand); }
.search { position: relative; flex: 1; max-width: 360px; min-width: 0; }
.search input { width: 100%; height: 38px; border-radius: 999px; border: 0; background: var(--panel-2); padding: 0 16px; outline: none; transition: background .15s; }
.search input:focus { background: var(--line); }
.qres { position: absolute; top: 46px; left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--panel); border-radius: 16px; box-shadow: var(--shadow); max-height: 60vh; overflow: auto; z-index: 30; }
.qres li { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; cursor: pointer; min-height: 44px; }
.qres li[aria-selected="true"], .qres li:hover { background: var(--panel-2); }
.qres .meta { color: var(--muted); font-size: 13px; margin-left: auto; white-space: nowrap; }
.nav { display: flex; gap: 2px; }
.nav a { text-decoration: none; padding: 6px 12px; border-radius: 999px; color: var(--muted); font-weight: 600; font-size: 14px; min-height: 36px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--panel-2); }
.who { display: flex; align-items: center; gap: 8px; margin-left: auto; flex-shrink: 0; }
.balance { text-decoration: none; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-2); white-space: nowrap; min-height: 34px; display: inline-flex; align-items: center; }
.me-link { text-decoration: none; font-weight: 600; max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }

/* ── 범위 ── 넓은 화면: 머리 줄 「규칙」 오른쪽(메뉴 글자와 같은 크기) / 좁은 화면: 판 위에 떠 있는 반투명 알약(아래 미디어 쿼리) */
.scopebar { display: flex; align-items: center; gap: 4px; min-width: 0; flex-shrink: 0; }
.top .scopebar .chip { min-height: 36px; padding: 0 12px; font-size: 14px; font-weight: 600; }
/* 「규칙」과 「♥ 찜」 사이도 메뉴끼리와 같은 2px — 머리 줄 gap(14px)을 되돌린다(소유자 지시 2026-10-02) */
@media (min-width: 900px) { .top .nav + .scopebar { margin-left: -12px; } }
.chips { display: flex; gap: 2px; flex-shrink: 0; }
.chip { min-height: 32px; padding: 0 13px; border-radius: 999px; border: 0; background: transparent; cursor: pointer; font-weight: 700; font-size: 13px; color: var(--muted); white-space: nowrap; transition: background .15s, color .15s; }
.chip:hover { color: var(--text); }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; }
.period { color: var(--faint); font-size: 12px; white-space: nowrap; padding: 0 10px 0 6px; }
.rules-link { display: none; }
/* 폼 안의 고르기 단추(로그인 창·순위 탭 등)는 단색 알약 — 테두리 없음 */
.tabs .chip, .filters .chip, .ctools .chip, .amounts .chip { background: var(--panel-2); }
.tabs .chip[aria-pressed="true"], .filters .chip[aria-pressed="true"], .ctools .chip[aria-pressed="true"], .amounts .chip[aria-pressed="true"] { background: var(--brand); }

/* ── 무대(판 + 옆 판) ── */
.stage { position: relative; height: calc(100dvh - var(--top-h) - var(--safe-t)); display: flex; }
.board-wrap { position: relative; flex: 1; min-width: 0; overflow: hidden; background: #000; }
#board { display: block; touch-action: none; cursor: grab; outline: none; }
/* 판 위에 뜬 것(안내 글·실시간 댓글 단추·알림)에서 핀치가 시작돼도 페이지가 확대되지 않게 — 누르기는 그대로 된다.
   「내 스타」 카드 격자는 위아래로 넘겨야 해서 뺀다 */
.board-wrap > :not(.mine-list), .board-wrap > :not(.mine-list) * { touch-action: none; }
#board:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.board-msg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 24px; color: var(--muted); pointer-events: none; }
.board-msg:empty { display: none; }
.board-msg .box { pointer-events: auto; background: var(--panel); padding: 20px 24px; border-radius: var(--radius); max-width: 360px; box-shadow: var(--shadow); }
.tagline { display: none; }
.board-bottom { position: absolute; left: 12px; bottom: calc(12px + var(--safe-b)); z-index: 4; display: flex; gap: 8px; flex-wrap: wrap; }
/* 반투명 파랑·조금 작게(소유자 지시 2026-10-02) — 단색만, 테두리·빛번짐 없음 */
.live-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(255, 61, 127, .7); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer; transition: background .15s; }
.live-btn:hover { background: rgba(232, 48, 111, .78); }
.live-btn .dot { width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse 1.6s infinite; }
.live-btn .badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--brand); font-size: 12px; display: inline-grid; place-items: center; }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .3 } }
@media (prefers-reduced-motion: reduce) { .live-btn .dot { animation: none; } * { scroll-behavior: auto !important; } }
.conn { position: absolute; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 4; font-size: 12px; color: var(--muted); background: var(--glass); padding: 4px 10px; border-radius: 999px; }
.conn:empty { display: none; }
.conn.bad { color: var(--warn); }
.layout-note { position: absolute; left: 50%; top: 60px; z-index: 4; transform: translateX(-50%); background: var(--glass); backdrop-filter: blur(12px); padding: 8px 14px; border-radius: 999px; font-size: 13px; box-shadow: var(--shadow); }

/* ── 옆 판(상세·피드) ── 넓은 화면: 오른쪽 / 좁은 화면: 화면 전체 */
.panel { width: 420px; flex-shrink: 0; border: 0; background: var(--panel); display: flex; flex-direction: column; min-height: 0; }
.panel.feed { width: 380px; }
/* 스타 상세는 판의 왼쪽(소유자 지시 2026-10-02). 실시간 피드는 오른쪽 그대로 */
.panel.detail { order: -1; }
/* 넓은 화면의 상세는 판 «위에» 뜬다 — 판 폭을 줄이지 않는다. 폭이 바뀌면 닫는 순간 캔버스가 다시 맞춰질 때까지
   오른쪽이 검게 비고 판이 옆으로 밀렸다(소유자 지적 2026-10-02). 판은 늘 전체 폭 그대로라 닫으면 바로 전체 판 */
@media (min-width: 900px) { .panel.detail { position: absolute; left: 0; top: 0; bottom: 0; z-index: 6; } }
.stage.feed-over .panel.feed { position: absolute; right: 0; top: 0; bottom: 0; z-index: 6; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); min-height: 56px; flex-shrink: 0; }
.panel-head h2 { font-size: 17px; margin: 0; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; }
@media (max-width: 899px) {
  .panel, .panel.feed { position: fixed; inset: 0; width: auto; z-index: 40; border: 0; padding-top: var(--safe-t); height: 100dvh; }
  .nav .wide-only { display: none; }
  .tagline { font-size: 12px; padding: 6px 10px; }
  .rules-link { display: none; }
}
@media (max-width: 520px) {
  .nav a { padding: 8px 6px; }
  .me-link { display: none; }
}

/* ── 상세 ── */
.hero { position: relative; aspect-ratio: 4 / 5; max-height: 46vh; width: 100%; background: var(--panel-2); overflow: hidden; }
.hero img, .hero canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero .over { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px 14px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.85); }
.hero h3 { margin: 0; font-size: 26px; line-height: 1.2; }
.hero .over { pointer-events: none; }
/* 사진첩 — 옆으로 밀어 넘기기 */
.hero .slides { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; outline: none; }
.hero .slides::-webkit-scrollbar { display: none; }
.hero, .lb-slides { user-select: none; -webkit-user-select: none; } /* 마우스로 사진을 끌어 넘길 때 글자가 선택되지 않게 */
.hero .slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; border: 0; padding: 0; margin: 0; background: #000; cursor: zoom-in; }
.hero .slide img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; -webkit-user-drag: none; user-select: none; }
.pnav { position: absolute; top: 42%; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; display: grid; place-items: center; opacity: 0; transition: opacity .15s; }
.pnav.prev { left: 10px; } .pnav.next { right: 10px; }
.hero:hover .pnav, .pnav:focus-visible { opacity: 1; }
@media (hover: none) { .pnav { display: none; } }
.pcount { position: absolute; right: 12px; top: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; pointer-events: none; }
.pdots { position: absolute; left: 0; right: 0; bottom: 8px; display: flex; justify-content: center; gap: 5px; pointer-events: none; z-index: 1; }
.pdots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.45); }
.pdots i.on { background: #fff; width: 16px; border-radius: 3px; }
.pthumbs { display: flex; gap: 6px; padding: 8px 12px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--line); }
.pthumbs::-webkit-scrollbar { display: none; }
.pthumbs button { flex: 0 0 auto; width: 48px; height: 60px; padding: 0; border: 0; border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--panel-2); opacity: .4; }
.pthumbs button.on { opacity: 1; }
.pthumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 상세 탭 — 사진 아래, 내리면 위에 붙는다 */
.dtabs { position: sticky; top: 0; z-index: 3; display: flex; gap: 2px; padding: 0 8px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.dtabs::-webkit-scrollbar { display: none; }
.dtab { flex: 1 0 auto; min-height: 46px; padding: 0 12px; border: 0; background: none; color: var(--muted); font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; position: relative; }
.dtab:hover { color: var(--text); }
.dtab[aria-selected="true"] { color: var(--text); font-weight: 800; }
.dtab[aria-selected="true"]::after { content: ''; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--brand); }
.dtab .tcount { color: var(--brand); font-weight: 700; font-size: 12px; }
.dpane { min-height: 240px; outline: none; }
.dpane .empty { padding: 40px 16px; }
.pgrid-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.notice { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; font-size: 13px; margin-bottom: 12px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.notice li { margin: 2px 0; }
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pgrid button { aspect-ratio: 4 / 5; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: zoom-in; background: var(--panel-2); }
.pgrid img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; transition: transform .2s; }
.pgrid button:hover img { transform: scale(1.04); }
/* 크게 보기 */
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.94); }
.lb-slides { display: flex; width: 100%; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.lb-slides::-webkit-scrollbar { display: none; }
.lb-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: grid; place-items: center; padding: calc(56px + var(--safe-t)) 12px calc(24px + var(--safe-b)); }
.lb-slide img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; user-select: none; }
.lb-top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 12px; padding: calc(8px + var(--safe-t)) 8px 8px 16px; color: #fff; }
.lb-name { font-weight: 800; }
.lb-count { color: #ccc; font-size: 14px; margin-right: auto; }
.lb-close { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.12); color: #fff; font-size: 20px; cursor: pointer; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 30px; cursor: pointer; }
.lb-nav.prev { left: 16px; } .lb-nav.next { right: 16px; }
@media (hover: none) { .lb-nav { display: none; } }
.hero .sub { opacity: .85; font-size: 14px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: rgba(255,255,255,.18); color: #fff; vertical-align: middle; }
.tag.official { background: var(--info); }
.tag.seed { background: rgba(255,255,255,.22); }
.sec { padding: 16px; border-bottom: 1px solid var(--line); }
.sec h4 { margin: 0 0 10px; font-size: 15px; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--panel-2); border-radius: 12px; padding: 10px 12px; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actions .btn { width: 100%; }
.actions .full { grid-column: 1 / -1; }
.note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.pending-note { font-size: 13px; color: var(--ok); margin-top: 8px; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.spark i { flex: 1; background: var(--brand); opacity: .75; border-radius: 2px 2px 0 0; min-height: 1px; }
.videos { display: grid; gap: 10px; }
.video { position: relative; border-radius: 12px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.video button.play { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: transparent; }
.video img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video .pbtn { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%); width: 64px; height: 44px; border-radius: 12px; background: rgba(0,0,0,.7); color: #fff; display: grid; place-items: center; font-size: 20px; }
.video .vt { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; color: #fff; font-size: 13px; text-shadow: 0 1px 6px rgba(0,0,0,.9); text-align: left; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video .na { position: absolute; inset: 0; display: grid; place-items: center; color: #ddd; font-size: 14px; padding: 12px; text-align: center; background: #222; }
.cat { font-size: 11px; padding: 1px 6px; border-radius: 6px; background: rgba(255,255,255,.2); margin-right: 6px; }

/* 댓글 */
.composer { position: sticky; bottom: 0; background: var(--panel); border-top: 1px solid var(--line); padding: 10px 12px calc(10px + var(--safe-b)); z-index: 2; }
.composer .target { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.composer .target img, .composer .target canvas { width: 24px; height: 30px; border-radius: 4px; object-fit: cover; }
.composer .row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; min-height: 44px; overflow-y: hidden; max-height: 140px; border-radius: 12px; border: 0; background: var(--panel-2); padding: 10px 12px; outline: none; }
.composer textarea:focus { background: var(--line); }
.composer .count { font-size: 12px; color: var(--faint); text-align: right; margin-top: 4px; }
.composer .reply-to { font-size: 13px; color: var(--brand); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.ctools { display: flex; gap: 6px; margin-bottom: 8px; align-items: center; }
.ctools .chip { min-height: 32px; }
.newbar { position: sticky; top: 0; z-index: 3; margin: 0 auto; display: block; }
.comments { list-style: none; margin: 0; padding: 0; }
.cm { padding: 12px 16px; border-top: 1px solid var(--line); }
.cm.reply { padding-left: 40px; background: color-mix(in srgb, var(--panel-2) 50%, transparent); }
.cm.hl { animation: hl 2.4s ease-out; }
@keyframes hl { 0% { background: var(--brand-soft); } 100% { background: transparent; } }
.cm .h { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.cm .nick { font-weight: 700; }
.cm .t { color: var(--faint); }
.cm .b { margin: 4px 0 6px; white-space: pre-wrap; word-break: break-word; }
.cm .gone { color: var(--faint); font-style: italic; }
.cm .ops { display: flex; gap: 2px; flex-wrap: wrap; }
.cm .ops button { background: none; border: 0; color: var(--muted); font-size: 13px; padding: 6px 8px; min-height: 36px; border-radius: 8px; cursor: pointer; }
.cm .ops button:hover { background: var(--panel-2); }
.cm .ops button[aria-pressed="true"] { color: var(--brand); }
.more { display: block; width: 100%; padding: 12px; border: 0; background: none; color: var(--muted); cursor: pointer; min-height: 44px; }

/* ── 피드 ── */
.filters { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); overflow-x: auto; flex-shrink: 0; scrollbar-width: none; }
.feed-list { list-style: none; margin: 0; padding: 0; }
.fi { display: flex; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); align-items: flex-start; }
.fi .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; font-size: 15px; background: var(--panel-2); }
.fi.support .ic { background: var(--brand-soft); color: var(--brand); }
.fi .tx { flex: 1; min-width: 0; font-size: 14px; }
.fi .tx a, .fi .tx button.lnk { color: var(--text); font-weight: 700; text-decoration: none; background: none; border: 0; padding: 0; cursor: pointer; font-size: inherit; }
.fi .tx a:hover, .fi .tx button.lnk:hover { text-decoration: underline; }
.fi .msg { display: block; margin-top: 4px; padding: 8px 10px; border-radius: 10px; background: var(--panel-2); cursor: pointer; text-align: left; width: 100%; border: 0; word-break: break-word; }
.fi time { display: block; color: var(--faint); font-size: 12px; margin-top: 2px; }
.fi.gone .tx { color: var(--faint); font-style: italic; }
.fi.mine { background: color-mix(in srgb, var(--brand-soft) 60%, transparent); }
.feed-status { font-size: 12px; color: var(--muted); padding: 6px 14px; border-bottom: 1px solid var(--line); flex-shrink: 0; display: flex; justify-content: space-between; gap: 8px; }
.feed-status.bad { color: var(--warn); }
.newpill { position: sticky; top: 8px; z-index: 2; display: flex; justify-content: center; pointer-events: none; height: 0; }
.newpill button { pointer-events: auto; border: 0; background: var(--brand); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); min-height: 40px; }

/* ── 쪽(순위·시즌·내 정보·지갑·제안·규칙·목록) ── */
.page { position: fixed; inset: calc(var(--top-h) + var(--safe-t)) 0 0 0; z-index: 15; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; padding: 20px 16px calc(40px + var(--safe-b)); }
.page .wrap { max-width: 920px; margin: 0 auto; }
.page h1 { font-size: 24px; margin: 4px 0 6px; }
.page .lead { color: var(--muted); margin: 0 0 18px; }
.card { background: var(--panel); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 17px; margin: 0 0 12px; }
.rows { width: 100%; border-collapse: collapse; }
.rows th, .rows td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.rows th { font-size: 13px; color: var(--muted); font-weight: 600; }
.rows tr.click { cursor: pointer; }
.rows tr.click:hover td { background: var(--panel-2); }
.rows .num { text-align: right; }
.rk { font-weight: 800; width: 48px; }
.nm { display: flex; align-items: center; gap: 10px; }
.thumb { width: 32px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--panel-2); flex-shrink: 0; }
@media (max-width: 640px) {
  .rows.cards thead { display: none; }
  .rows.cards tr { display: grid; grid-template-columns: 30px 1fr auto; gap: 2px 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
  .rows.cards td { border: 0; padding: 0; }
  .rows.cards td[data-k]::before { content: attr(data-k) " "; color: var(--muted); font-size: 12px; }
  .rows.cards td.rk { grid-row: span 2; align-self: center; }
  .rows.cards td.extra { grid-column: 2 / -1; font-size: 13px; color: var(--muted); }
}
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field textarea, .field select { min-height: 44px; border-radius: 12px; border: 0; background: var(--panel-2); padding: 10px 12px; outline: none; width: 100%; }
.field input:focus, .field textarea:focus { background: var(--line); }
.field .hint { font-size: 12px; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch input { width: 20px; height: 20px; accent-color: var(--brand); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.mini { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 12px; background: var(--panel-2); text-decoration: none; cursor: pointer; border: 0; text-align: left; width: 100%; min-height: 56px; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 10px 0; border-bottom: 1px solid var(--line); display: flex; gap: 10px; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.plus { color: var(--ok); font-weight: 700; }
.minus { color: var(--danger); font-weight: 700; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.err { color: var(--danger); font-size: 14px; }
.pill { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: var(--danger); }

/* ── 창(모달) ── */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 60; display: grid; place-items: center; padding: 16px; }
.modal { width: 100%; max-width: 420px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); max-height: calc(100dvh - 32px); overflow-y: auto; }
.modal .mh { display: flex; align-items: center; padding: 8px 8px 0 18px; }
.modal .mh h2 { flex: 1; font-size: 18px; margin: 0; }
.modal .mb { padding: 12px 18px 18px; }
@media (max-width: 520px) { .modal-back { place-items: end stretch; padding: 0; } .modal { max-width: none; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b); } }
.amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.summary { background: var(--panel-2); border-radius: 12px; padding: 12px; display: grid; gap: 6px; font-size: 14px; margin: 10px 0; }
.summary div { display: flex; justify-content: space-between; }
.summary b { font-variant-numeric: tabular-nums; }

.toast { position: fixed; left: 50%; bottom: calc(80px + var(--safe-b)); transform: translateX(-50%); z-index: 80; background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); max-width: calc(100% - 32px); text-align: center; pointer-events: none; opacity: 0; transition: opacity .2s; }
.toast.on { opacity: 1; }
.toast.bad { background: var(--danger); color: #fff; }

/* 목록 보기 */
.alist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.alist button { width: 100%; text-align: left; border: 0; background: var(--panel); border-radius: 12px; padding: 8px; cursor: pointer; display: grid; gap: 6px; }
.alist .ph { aspect-ratio: 4 / 5; border-radius: 8px; overflow: hidden; background: var(--panel-2); }
.alist .ph img, .alist .ph canvas { width: 100% !important; height: 100% !important; object-fit: cover; display: block; } /* face() 가 그림 얼굴에 px 폭을 박아 넣는다 */
.alist .n { font-weight: 700; }
.alist .s { font-size: 12px; color: var(--muted); }
.cropbox { position: relative; display: inline-block; max-width: 100%; cursor: crosshair; }
.cropbox img { max-width: 100%; max-height: 320px; display: block; border-radius: 10px; }
.cropbox .fp { position: absolute; width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; box-shadow: 0 0 0 2px var(--brand); transform: translate(-50%, -50%); pointer-events: none; }
.previews { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.previews canvas { border-radius: 8px; background: var(--panel-2); }

/* 좁은 화면: 머리 줄은 로고 · 검색 · ☰ · 내 정보 — 순위·시즌·제안·규칙은 ☰ 메뉴 창에 */
.menu-btn { display: none; color: var(--text); flex-shrink: 0; }
/* 머리 줄이 빠듯한 폭 — 배치 시각·「인지도」 글자·닉네임을 접어 한 줄에 다 들어가게 */
@media (max-width: 1365px) { .scopebar .period { display: none; } }
@media (min-width: 900px) and (max-width: 1199px) {
  .top { gap: 8px; }
  .me-link { display: none; }
  .nav a, .top .scopebar .chip { padding: 0 8px; }
  .top .nav + .scopebar { margin-left: -6px; } /* 이 폭은 머리 줄 gap 8px */
  .search { min-width: 120px; }
}
@media (max-width: 899px) {
  /* 머리 줄(.top 은 backdrop-filter 라 fixed 의 기준이 된다)의 바로 아래, 판 위에 뜬다 */
  .top .scopebar { position: absolute; left: 12px; top: calc(100% + 12px); z-index: 4; padding: 4px; border-radius: 999px; background: var(--glass); backdrop-filter: blur(12px); box-shadow: var(--shadow); max-width: calc(100% - 24px); overflow-x: auto; touch-action: pan-x; /* 판 위 알약 — 옆으로 넘기기만, 핀치로 페이지 확대 안 됨 */ }
  .top .scopebar .chip { min-height: 32px; padding: 0 13px; font-size: 13px; font-weight: 700; }
  body:has(#page:not([hidden])) .top .scopebar { display: none; } /* 순위·규칙 같은 쪽 위에는 안 뜬다 */
  .top .nav { display: none; }
  .menu-btn { display: inline-grid; order: 1; } /* ☰ 는 맨 오른쪽 — 뒤에 붙는 「앱 설치」 단추보다도 오른쪽 */
  .who { margin-left: 0; }
  .top .scopebar { display: none; } /* 폰의 「♥ 찜」은 판 위 알약 대신 ☰ 메뉴 맨 아래 줄(소유자 지시 2026-10-02) */
  .search { max-width: none; }
}
@media (max-width: 520px) {
  .top { gap: 6px; padding-left: 12px; padding-right: 10px; }
  .search { min-width: 0; }
  .search input { padding: 0 12px; }
  .logo b { font-size: 16px; }
  .menu-btn { width: 36px; height: 40px; }
  /* 폰 머리 줄은 포인트·「앱」 단추까지 들어가 검색 칸이 「ㅂ」 한 글자로 눌렸다 — ☺(내 정보)는 ☰ 메뉴에 있으니 숨기고 단추 여백을 줄인다 */
  .who { gap: 6px; }
  .who .icon-btn { display: none; }
  .who .balance { padding: 4px 10px; }
  .who .btn.small { padding-left: 12px; padding-right: 12px; }
}
/* 390·393(아이폰 기본 크기)도 「앱 설치」·로그인이 들어가면 검색 칸이 80px 로 눌려 「스타 ㅊ」로 잘렸다 — 로고는 글자만 */
@media (max-width: 400px) { .logo::before { display: none; } }
@media (max-width: 380px) {
  /* 작은 폰(360·320) — 로고는 글자만, 「앱」 단추도 좁게 */
  .top { padding-left: 10px; padding-right: 8px; }
  .logo::before { display: none; }
  .top .app-dl { padding: 0 8px; }
  .search input { padding: 0 10px; }
  /* 판 위 범위 알약: 오른쪽 확대 단추 기둥(46px)을 비켜 한 줄에 다 들어가게 */
  .top .scopebar { left: 8px; top: calc(100% + 8px); max-width: calc(100% - 16px); }
  .chip, .top .scopebar .chip { padding: 0 9px; font-size: 12.5px; min-height: 30px; }
  .period { display: none; }
}
.menu-list { display: grid; gap: 4px; }
.menu-list a { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; text-decoration: none; background: var(--panel-2); transition: background .15s; }
.menu-list a:hover { background: var(--line); }
.menu-list b { font-size: 16px; }
.menu-list span { font-size: 13px; color: var(--muted); }
.menu-list .menu-jjim b { display: inline-flex; align-items: center; gap: 4px; }
.menu-list .menu-jjim svg, .menu-list .menu-jjim svg * { fill: currentColor; stroke: none; }
.menu-list .menu-jjim[aria-pressed="true"] { box-shadow: inset 0 0 0 1px var(--line); }

/* ── 구글 로그인 창 ── */
.login-box { text-align: center; }
.login-hero { display: grid; justify-items: center; gap: 6px; margin: 4px 0 18px; }
.login-hero b { font-size: 22px; font-weight: 900; letter-spacing: .04em; color: var(--brand); }
.login-hero p { margin: 0; color: var(--muted); font-size: 13px; }
.login-mark { width: 52px; height: 52px; border-radius: 16px; background: var(--brand); }
.btn.google { width: 100%; min-height: 52px; gap: 12px; background: #fff; color: #1f1f1f; border: 0; font-size: 15px; font-weight: 700; border-radius: 14px; text-decoration: none; transition: background .15s; }
.btn.google:hover { background: #eceff4; }
.btn.google.busy { opacity: .7; pointer-events: none; }

/* ── 하트(찜) ── */
#favBtn { color: var(--muted); }
#favBtn.on { color: var(--brand-2); }
#favBtn.pop svg { animation: heartpop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes heartpop { 0% { transform: scale(.6); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { #favBtn.pop svg { animation: none; } }
/* 「♥ 찜」은 머리 줄 순위·선물·제안·규칙과 같은 모양 — 파란 바탕 없음, 지금 고른 것만 하얀 글자+옅은 바탕(소유자 지시 2026-10-02) */
.chip.mine-chip { display: inline-flex; align-items: center; gap: 4px; background: transparent; color: var(--muted); }
.chip.mine-chip:hover, .chip.mine-chip[aria-pressed="true"] { color: var(--text); background: var(--panel-2); }
body:has(#page:not([hidden])) .chip.mine-chip[aria-pressed="true"]:not(:hover) { color: var(--muted); background: transparent; } /* 순위·선물 같은 쪽을 보는 동안은 그 메뉴만 하얗게 */
.chip.mine-chip svg, .chip.mine-chip svg * { fill: currentColor; stroke: none; }
.chip.mine-chip svg { vertical-align: -2px; }

/* ── 내 스타 ── */
.mine-empty { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 28px 26px !important; max-width: 340px; background: var(--panel) !important; }
.mine-empty b { font-size: 18px; }
.mine-empty p { margin: 0 0 6px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.mine-heart { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 61, 127, .14); margin-bottom: 4px; }
.mine-list { position: absolute; inset: 0; z-index: 3; overflow-y: auto; overscroll-behavior: contain; background: var(--bg); padding: 64px 16px calc(76px + var(--safe-b)); }
.mine-list[hidden] { display: none; }
.mine-list .alist { max-width: 920px; margin: 0 auto; }
@media (max-width: 520px) { .mine-list { padding: 54px 12px calc(72px + var(--safe-b)); } .mine-list .alist { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.myhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mycard { position: relative; }
.myheart, .alist .myheart { position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; padding: 0; border-radius: 50%; border: 0; background: rgba(0, 6, 20, .62); backdrop-filter: blur(6px); display: grid; place-items: center; cursor: pointer; }
.myheart:hover { transform: scale(1.08); }

/* ── 관리자 설정 아이콘 ── 관리자 구글 계정으로 로그인했을 때만, 화면 오른쪽 아래. 둥근 회색 바탕(투명도 40%) 안에 하얀 톱니(단색 — 테두리·그라데이션·빛번짐 없음) */
.admin-fab { position: fixed; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 30; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: rgba(138, 145, 156, .6); color: #fff; cursor: pointer; transition: background .15s; }
.admin-fab:hover { background: rgba(115, 122, 133, .6); }
.admin-fab svg { width: 24px; height: 24px; }
.admin-fab[disabled] { opacity: .6; cursor: wait; }
.admin-fab svg { display: block; }
body:has(.admin-fab) .conn { right: 64px; } /* 연결 상태 글자가 아이콘 밑에 깔리지 않게 */
@media (min-width: 900px) { body:has(#feed:not([hidden])) .admin-fab { right: calc(380px + 12px); } } /* 오른쪽 실시간 창을 가리지 않게 */

/* 사진 고르기 단추 — 진짜 파일 칸은 안 보이게(누름은 label 이 넘겨 준다) */
.btn.filepick { position: relative; width: 100%; min-height: 48px; cursor: pointer; background: var(--panel-2); }
.btn.filepick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

/* 회원 동그라미 프로필(내 정보 머리 · 머리 줄) — 단색, 테두리 선 없음 */
.uface { display: inline-grid; place-items: center; border-radius: 50%; object-fit: cover; color: #fff; font-weight: 800; flex-shrink: 0; overflow: hidden; }
.mehead { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.mehead-t { min-width: 0; }
.mehead-t h1 { margin: 0 0 4px; overflow-wrap: anywhere; }
.mehead-t .lead { margin: 0; overflow-wrap: anywhere; }
.meava { position: relative; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; flex-shrink: 0; line-height: 0; }
.meava .cam { position: absolute; right: -2px; bottom: -2px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 15px; line-height: 1; }
.meava:hover .cam { background: var(--brand-hover); }
/* 닉네임 — 이름 오른쪽 아래 연필, 누르면 그 자리에서 칸으로 */
.nickrow { display: flex; align-items: flex-end; gap: 6px; margin: 0 0 4px; min-width: 0; }
.mehead-t .nickrow h1 { margin: 0; min-width: 0; }
.nickpen { flex-shrink: 0; width: 26px; height: 26px; margin-bottom: 2px; padding: 0; border: 0; border-radius: 50%; background: var(--brand); display: grid; place-items: center; cursor: pointer; line-height: 0; }
.nickpen:hover { background: var(--brand-hover); }
.nickedit { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.nickin { flex: 1; min-width: 0; max-width: 260px; height: 38px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--panel-2); outline: none; color: inherit; font: inherit; font-size: 18px; font-weight: 700; }
.nickerr { margin: 0 0 4px; }
.nickhint { margin: 0 0 4px; }
.nickerr:not(:empty) + .nickhint { display: none; } /* 오류가 뜨면 안내문은 숨김(같은 말) */
.prow { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card h3.sub { font-size: 15px; margin: 0 0 8px; }
.icon-btn .uface { display: grid; }
@media (max-width: 520px) { .mehead { gap: 12px; } .mehead .meava .uface { width: 72px !important; height: 72px !important; font-size: 30px !important; } }

/* 프로필 사진 편집기 */
.avedit { margin-top: 12px; }
.avwrap { display: flex; justify-content: center; }
.avstage { border-radius: 14px; touch-action: none; cursor: grab; background: #000; }
.avstage:active { cursor: grabbing; }
.avtools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 10px; }
.avtools .btn { min-width: 44px; font-size: 16px; }
.avrange { display: flex; align-items: center; gap: 12px; margin: 6px 0; font-size: 14px; }
.avrange span { width: 34px; color: var(--muted); flex-shrink: 0; }
.avrange input { flex: 1; accent-color: var(--brand); }
.avact { display: flex; gap: 8px; align-items: center; margin-top: 14px; }
