/* =====================================================================
   15 — 테마 세 가지 (운영자 요청 2026-11-19)
   ☀️ 라이트 · 🌙 다크 · 🔴 2호기(운영자의 사심 — 빨강과 주황)
   ---------------------------------------------------------------------
   ⚠️ 왜 따로 두나: 09-nuri-design.css 가 시네마틱 디자인을 입히면서
      :root[data-theme="dark"] 까지 **밝은 색으로 덮어** 다크·2호기를 골라도
      거의 그대로 밝았어요. 09 는 integrate.cjs 가 다시 쓰는 파일이라 고치지 않고,
      모든 화면 **맨 뒤**에 실리는 이 파일에서 테마별 색을 다시 정합니다.
   ⚠️ 색 이름(토큰)만 바꿉니다. 화면 규칙은 대부분 이 토큰을 따라와요.
      토큰을 안 쓰고 색을 박아 둔 몇 자리만 아래 「덧칠」 에서 맞춥니다.
   ===================================================================== */

/* ---------- ☀️ 라이트 — 밝고 산뜻하게 ---------- */
:root[data-theme="light"]{
  --bg:#fbfbf6; --surface:#ffffff; --surface-2:#f4f3ec; --surface-3:#e9e7dc;
  --text:#18241c; --text-muted:#56615a; --heading:#132018;
  --fg:#18241c; --fg-2:rgba(24,36,28,.8); --fg-3:rgba(24,36,28,.68);
  --line:#e6e3d6; --line-2:#d2cebf;
  --accent:#8fd46a; --brand:#3c7a2b; --brand-strong:#2f6421; --brand-soft:#dcefcd; --accent-text:#356f25;
  --chip-bg:#e9f3df; --chip-text:#2f6421;
  --header-bg:rgba(251,251,246,.86);
  --shadow-md:0 16px 48px rgba(24,36,28,.10);
  color-scheme:light;
}

/* ---------- 🌙 다크 — 숲속 밤 ---------- */
:root[data-theme="dark"]{
  --bg:#0f1411; --surface:#171d19; --surface-2:#1e2621; --surface-3:#28312b;
  --text:#e8eee5; --text-muted:#a9b5ab; --heading:#f3f7f0;
  --fg:#e8eee5; --fg-2:rgba(232,238,229,.8); --fg-3:rgba(232,238,229,.62);
  --line:rgba(232,238,229,.10); --line-2:rgba(232,238,229,.2);
  --accent:#8fd46a; --brand:#9fe07e; --brand-strong:#b8eb9e; --brand-soft:rgba(143,212,106,.18); --accent-text:#a9e48b;
  --chip-bg:rgba(143,212,106,.14); --chip-text:#c2ecaa;
  --header-bg:rgba(15,20,17,.84);
  --ink:#0a0d0b;
  --shadow-md:0 18px 50px rgba(0,0,0,.45);
  --gold:#f0cf74;
  color-scheme:dark;
}

/* ---------- 🔴 2호기 — 검붉은 바탕에 빨강→주황 ---------- */
:root[data-theme="unit02"]{
  --bg:#170b09; --surface:#221110; --surface-2:#2d1714; --surface-3:#3b1e19;
  --text:#fbeae3; --text-muted:#d6b2a6; --heading:#fff3ec;
  --fg:#fbeae3; --fg-2:rgba(251,234,227,.82); --fg-3:rgba(251,234,227,.64);
  --line:rgba(255,140,100,.16); --line-2:rgba(255,140,100,.3);
  --accent:#ff6a2a; --brand:#ff7a3d; --brand-strong:#ff9a5c; --brand-soft:rgba(255,90,54,.2); --accent-text:#ffa06a;
  --chip-bg:rgba(255,90,54,.16); --chip-text:#ffc2a0;
  --header-bg:rgba(23,11,9,.86);
  --ink:#1a0805;
  --u02-grad:linear-gradient(135deg,#e8251c 0%,#ff5a1f 55%,#ff9a1a 100%);
  --shadow-md:0 18px 50px rgba(0,0,0,.5);
  --gold:#ffb04a;
  color-scheme:dark;
}

/* =====================================================================
   덧칠 — 토큰을 안 쓰고 밝은 색을 박아 둔 자리만
   ===================================================================== */
:root[data-theme="dark"] body,:root[data-theme="unit02"] body,
html[data-theme="dark"],html[data-theme="unit02"]{background:var(--bg);color:var(--text)}

/* 머리 · 검색칸 · 펼침 메뉴 */
:root:is([data-theme="dark"],[data-theme="unit02"]) .m-search input,
:root:is([data-theme="dark"],[data-theme="unit02"]) #mSearchInput,
:root:is([data-theme="dark"],[data-theme="unit02"]) #searchInput{background:var(--surface-2);color:var(--fg)}
:root:is([data-theme="dark"],[data-theme="unit02"]) #authArea .auth-link:hover,
:root:is([data-theme="dark"],[data-theme="unit02"]) #mainNav .mn-link:hover{background:rgba(255,255,255,.06)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .btn-ghost:hover,
:root:is([data-theme="dark"],[data-theme="unit02"]) .btn-outline:hover{background:rgba(255,255,255,.07)}
:root:is([data-theme="dark"],[data-theme="unit02"]) input,
:root:is([data-theme="dark"],[data-theme="unit02"]) select,
:root:is([data-theme="dark"],[data-theme="unit02"]) textarea{background:var(--surface-2);color:var(--fg);border-color:var(--line-2)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .brand .brand-title::after{color:var(--fg)}

/* 글 줄 · 카드 · 칩 — 고른 칩(검정 바탕)은 어두운 테마에서 밝게 뒤집습니다 */
:root:is([data-theme="dark"],[data-theme="unit02"]) .chip.on,
:root:is([data-theme="dark"],[data-theme="unit02"]) .chip.active,
:root:is([data-theme="dark"],[data-theme="unit02"]) .tab.on,
:root:is([data-theme="dark"],[data-theme="unit02"]) .tab.active,
:root:is([data-theme="dark"],[data-theme="unit02"]) .side-col .active,
:root:is([data-theme="dark"],[data-theme="unit02"]) .side-col .on:not(#hubFilterToggle){background:var(--fg)!important;color:var(--bg)!important;border-color:var(--fg)!important}

/* 「현재 보기」 줄 — 세계 색 알약은 어두운 바탕에서도 또렷하게 */
:root:is([data-theme="dark"],[data-theme="unit02"]) .ctx-bar.on{background:color-mix(in srgb,var(--accent) 22%,var(--bg))}
:root:is([data-theme="dark"],[data-theme="unit02"]) .ctx-bar.on .ctx-lbl{color:color-mix(in srgb,var(--accent) 60%,#fff)}

/* 바닥글 */
:root:is([data-theme="dark"],[data-theme="unit02"]) .site-footer{background:var(--bg);color:var(--fg-3)}

/* ---------- 🔴 2호기만의 것 — 빨강→주황 그라데이션 ---------- */
:root[data-theme="unit02"] .btn-primary,
:root[data-theme="unit02"] .hub-write,
:root[data-theme="unit02"] #openWrite{background:var(--u02-grad)!important;border-color:transparent!important;color:#fff!important}
:root[data-theme="unit02"] #site-header,
:root[data-theme="unit02"] .site-header{border-bottom:2px solid transparent;border-image:var(--u02-grad) 1}
:root[data-theme="unit02"] #mainNav .mn-link.active::after{background:var(--u02-grad)}
:root[data-theme="unit02"] .post-item:hover{background:rgba(255,90,54,.08)}
:root[data-theme="unit02"] ::selection{background:#ff5a1f;color:#fff}

/* =====================================================================
   🏠 홈(index.html) — 홈은 자기 색 토큰을 따로 갖고 있어 여기서 같이 맞춥니다
   ===================================================================== */
:root:is([data-theme="dark"],[data-theme="unit02"]) .c-top.solid,
:root:is([data-theme="dark"],[data-theme="unit02"]) #portal header.nav{background:var(--header-bg)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .c-top .btn{background:rgba(255,255,255,.08);color:var(--fg)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .bc.a::after{background:linear-gradient(to top,var(--surface) 10%,color-mix(in srgb,var(--surface) 72%,transparent) 48%,color-mix(in srgb,var(--surface) 12%,transparent) 100%)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .marq span{-webkit-text-stroke-color:rgba(255,255,255,.22)}

/* 2호기는 고른 세계 색(nuri-shell.js 가 :root 에 바로 적는 --accent)보다 빨강·주황이 먼저입니다.
   ⚠️ 「현재 보기」 줄은 줄 자체에 세계 색을 따로 적어서, 거기서는 여전히 그 동물 색이 보여요. */
:root[data-theme="unit02"]{--accent:#ff6a2a!important}

/* 🏠 홈 — 크림색을 직접 박아 둔 안개 · 유리 · 띠를 어두운 테마에서는 바탕색으로
   (그대로 두면 검은 바탕 위에 흰 안개 띠가 떠 보였어요) */
:root:is([data-theme="dark"],[data-theme="unit02"]){--bg-0:color-mix(in srgb,var(--bg) 0%,transparent)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .intro .scrim{
  background:linear-gradient(to bottom,var(--bg) 0%,var(--bg) 17%,color-mix(in srgb,var(--bg) 88%,transparent) 34%,transparent 62%),
             linear-gradient(to top,var(--bg) 0%,transparent 14%)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .intro .ih,
:root:is([data-theme="dark"],[data-theme="unit02"]) .intro .sub{text-shadow:0 2px 24px rgba(0,0,0,.55)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .intro .stats,
:root:is([data-theme="dark"],[data-theme="unit02"]) .card-glass{background:color-mix(in srgb,var(--surface) 78%,transparent);border-color:var(--line-2)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .picker .scrim{
  background:linear-gradient(90deg,color-mix(in srgb,var(--bg) 94%,transparent) 0%,color-mix(in srgb,var(--bg) 76%,transparent) 40%,color-mix(in srgb,var(--bg) 20%,transparent) 100%),
             linear-gradient(to bottom,var(--bg) 0%,transparent 18%,transparent 78%,var(--bg) 100%)}
@media (max-width:900px){
  :root:is([data-theme="dark"],[data-theme="unit02"]) .picker .scrim{
    background:linear-gradient(color-mix(in srgb,var(--bg) 72%,transparent),color-mix(in srgb,var(--bg) 72%,transparent)),
               linear-gradient(to bottom,var(--bg) 0%,transparent 14%,transparent 86%,var(--bg) 100%)}
  :root:is([data-theme="dark"],[data-theme="unit02"]) .catbar{background:var(--header-bg)}
}
:root:is([data-theme="dark"],[data-theme="unit02"]) .iris{background:radial-gradient(circle at 50% 58%,color-mix(in srgb,var(--accent) 30%,var(--bg)) 0%,var(--bg) 68%)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .nav{background:var(--header-bg)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .p-hero .media::after{
  background:linear-gradient(to top,var(--bg) 0%,transparent 40%),linear-gradient(to bottom,color-mix(in srgb,var(--bg) 50%,transparent),transparent 30%)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .tile{background:linear-gradient(135deg,color-mix(in srgb,var(--c) 34%,var(--surface)) 0%,var(--surface) 100%)}
:root:is([data-theme="dark"],[data-theme="unit02"]) .tile .kind,
:root:is([data-theme="dark"],[data-theme="unit02"]) .field input,
:root:is([data-theme="dark"],[data-theme="unit02"]) .field textarea{background:color-mix(in srgb,var(--surface-2) 70%,transparent)}

/* 🏠 홈의 포인트 글씨(--accent-t: 세계 색을 **어둡게** 섞은 색)가 어두운 테마에서는 바탕에 묻혔어요
      (「로그인」 · 「● 내 세계」 등). 어두운 테마에서는 **밝게** 섞습니다. */
:root:is([data-theme="dark"],[data-theme="unit02"]){--accent-t:color-mix(in srgb,var(--accent) 72%,#fff)}
:root:is([data-theme="dark"],[data-theme="unit02"]) #accountLink{color:var(--fg)}
