/* 발더스 게이트 3 인게임 아이템 툴팁 재현.
   --rarity 는 아이템마다 인라인으로 주입된다(등급 색). */

/* 아이템 상세의 역방향 도감 링크. 기존 설명창과 같은 폭·색상으로 이어진다. */
.item-monsters { max-width: min(620px, 100vw - 16px); margin: 20px 0; color: var(--text); }
.item-monsters h3 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; font-size: var(--fs-lg); }
.item-monsters h3 > span, .item-monsters-muted { color: var(--text-2); font-size: var(--fs-base); font-weight: 400; }
.item-monsters ul { list-style: none; padding: 0; margin: 0; }
.item-monsters li { margin: 0; border-top: 1px solid var(--line); }
.item-monsters .item-monster-link { display: flex; align-items: center; gap: 12px; padding: 12px 4px; color: inherit; text-decoration: none; border-radius: 3px; }
.item-monster-link:hover, .item-monster-link:focus-visible { background: var(--surface-3); outline: 1px solid var(--accent); outline-offset: -1px; }
.item-monster-link .monster-portrait { width: 40px; height: 40px; flex: 0 0 40px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; display: grid; place-items: center; }
.item-monster-link .monster-portrait img { width: 100%; height: 100%; object-fit: cover; }
.item-monster-content { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item-monster-content strong { display: block; font-size: var(--fs-lg); line-height: 1.5; }
.item-monster-content small { display: block; font-size: var(--fs-sm); line-height: 1.6; color: var(--text-2); }
.item-monster-sources { display: block; margin-top: 3px; }
.item-monster-sources small { color: var(--text); }
.item-monster-arrow, .item-monsters summary { color: var(--accent); }
.item-monsters summary { padding: 12px 4px; font-size: var(--fs-base); cursor: pointer; }

.tt {
  /* ⚠ **이 카드는 판을 안 따라간다.** 배경(`#14110d`·`#1c1813`)을 스스로 쥐는
     게임 그림 재현이라 밝은 판에서도 어두운 채다. 그래서 등급 색도 **어두운 판
     것으로 되돌려 박는다** — 안 그러면 밝은 판에서 어두운 글자가 어두운 카드에
     얹혀 안 보인다(「평범」 `#4a463c` 대 `#1c1813` → 1.5:1).
     ⚠ 값을 여기 다시 적지 않는다. `--rar-dark-*`(skin.css) 가 정본이다. */
  --rar-common:    var(--rar-dark-common);
  --rar-uncommon:  var(--rar-dark-uncommon);
  --rar-rare:      var(--rar-dark-rare);
  --rar-veryrare:  var(--rar-dark-veryrare);
  --rar-legendary: var(--rar-dark-legendary);
  --rar-story:     var(--rar-dark-story);

  --gold: #b8935a;
  --parchment: #f0f0e7;
  --ink: #cfc9bb;
  --dim: #8c8578;
  /* 폭을 뷰포트에 묶는다 — 375px 화면에서 620px 상자는 통째로 넘친다.
     min() 이라 데스크톱 값은 안 바뀐다. */
  max-width: min(620px, 100vw - 16px);
  border: 1px solid var(--gold);
  border-radius: 6px;
  overflow: hidden;
  background: #14110d;
  color: var(--parchment);
  font-family: 'Iowan Old Style', 'Apple SD Gothic Neo', Georgia, serif;
  box-shadow: 0 10px 34px #000a;
}

/* 머리: 등급 색이 왼쪽에서 스며 나오는 그라디언트 */
.tt-head {
  position: relative;
  display: flex;
  /* 아이콘은 첫 줄 옆에 붙는다. center 로 두면 이름이 2줄이 될 때만 92px 아이콘이
     10.7px 아래로 내려가서(2026-08-02 실측) 아이템마다 아이콘 위치가 달라진다. */
  align-items: flex-start;
  gap: 12px;
  padding: 16px 18px;
  background:
    linear-gradient(100deg,
      color-mix(in srgb, var(--rarity) 26%, #14110d) 0%,
      color-mix(in srgb, var(--rarity) 10%, #14110d) 58%,
      #14110d 100%);
  border-bottom: 1px solid #0007;
}
.tt-title { flex: 1; min-width: 0; }
.tt-name {
  margin: 0;
  font-size: 27px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--parchment);
  text-shadow: 0 1px 3px #000b;
  overflow-wrap: anywhere;
}
.tt-rarity { margin: 2px 0 0; font-size: 15px; color: var(--rarity); }
/* 이 장비가 무엇인가 — 「장검 · 군용 무기」·「평갑」·「방패」.
   등급 바로 아래에 둔다(게임 툴팁의 차례). 등급 색을 쓰지 않는다 — 종류는 등급과
   다른 축이라 같은 색이면 등급의 일부로 읽힌다. */
.tt-kind { margin: 2px 0 0; font-size: 13px; color: var(--parchment); opacity: .82; }
.tt-en { margin: 1px 0 0; font-size: 12px; color: var(--dim); font-family: system-ui, sans-serif; }

/* 아이콘: 등급 색으로 은은하게 발광 */
.tt-icon {
  flex: none;
  width: 92px; height: 92px;
  display: grid; place-items: center;
  filter: drop-shadow(0 0 14px color-mix(in srgb, var(--rarity) 55%, transparent));
}
.tt-icon img { max-width: 100%; max-height: 100%; }

.tt-body { padding: 14px 18px; background: #1c1813; }
.tt-effect { margin: 0 0 8px; font-size: 15px; line-height: 1.55; color: var(--parchment); }
.tt-effect:last-child { margin-bottom: 0; }
.tt-key { color: #e8c06c; font-weight: 600; }
/* 게임 용어. 게임 툴팁의 그 밑줄이다 — 주문 툴팁·특성 설명과 같은 표기를 쓴다. */
.tt-effect .lstag {
  color: var(--gold);
  /* border-bottom 이 아니라 text-decoration — 테두리는 칩 앞의 그림(.lstag-ico) 밑까지 그어지고,
     밑줄은 대체 요소엔 안 그어진다(눈가림 검수 2026-09-05 경미 7). */
  text-decoration: underline dotted color-mix(in srgb, var(--gold) 65%, transparent);
  text-underline-offset: 3px;
  cursor: help;
}
/* 게임이 실행 중 계산해 넣는 값. 우리가 채울 수 없어 원문 그대로 두되 티나게 한다. */
.tt-effect .ph { color: var(--gold); background: #241c11; padding: 0 4px; border-radius: 2px; }
.tt-damage { font-variant-numeric: tabular-nums; color: #d9cfb8; }

/* 플레이버: 깃펜 아이콘 + 이탤릭 회색 */
.tt-flavor {
  display: flex; gap: 10px;
  padding: 13px 18px;
  background: #191510;
  border-top: 1px solid #0006;
  color: var(--dim);
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
}
.tt-flavor p { margin: 0; }
.tt-ico-quill { flex: none; width: 17px; height: 17px; margin-top: 2px; opacity: .75; }

.tt-acq, .tt-grants { padding: 13px 18px; background: #16130f; border-top: 1px solid #0006; }
.tt-acq h3, .tt-grants h3 {
  margin: 0 0 7px;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--dim); font-family: system-ui, sans-serif;
}
.tt-acq-line { margin: 8px 0 2px; display: flex; flex-wrap: wrap; gap: 5px; }
.tt-acq-line:first-of-type { margin-top: 0; }
.tt-tag {
  font-family: system-ui, sans-serif; font-size: 11px;
  padding: 2px 7px; border-radius: 3px;
  background: #2a2419; border: 1px solid #3b3323; color: #cbbf9f;
}
.tt-tag.is-warn { color: #e0a03c; border-color: #6b4d1c; }
.tt-acq-raw { margin: 0 0 9px; font-size: 13.5px; line-height: 1.5; color: var(--ink); }
.tt-acq-raw:last-child { margin-bottom: 0; }
/* 딸림 줄 — 칩(막·방식·장소)이 하나도 없어 앞 줄에 딸린 단서로 보이는 문장.
   어느 줄에 딸렸는지는 단정하지 않으므로(web/lib/acquisition.js 참고) 화살표로
   "이어지는 내용"만 암시하고 특정 줄을 가리키지는 않는다. */
.tt-acq-raw.tt-acq-sub {
  margin-left: 14px; padding-left: 9px;
  border-left: 2px solid #3b3323;
  color: var(--dim);
  font-size: 13px;
}
.tt-acq-raw.tt-acq-sub::before { content: '↳ '; }
.tt-grants p { margin: 0; font-size: 14px; color: #e8c06c; }

.tt-acq.is-missing h3 { color: #e0a03c; }
.tt-missing { margin: 0; font-size: 13.5px; color: #e0a03c; }
/* 「못 얻는다」 축(web/tooltip.js 의 못얻음문구). `.tt-missing`(입수처 미확인)과
   **다른 축**이라 색도 다르게 둔다 — 실측(2026-08-17): 그 경고가 뜬 383개 중
   315개가 이 축과 무관했다. 결함①(2026-08-17): 예전에는 web/style.css 에만
   있었는데, 빌더(web/build.html)는 그 파일을 안 싣는다(skin.css·tooltip.css·
   mobile.css 뿐) — 빌더도 이 툴팁을 그리므로(build.js → renderTooltip) 그 줄이
   색도 없고 글자 크기도 어긋난 채 떴다. 두 화면이 같이 싣는 이 파일로 옮긴다. */
.tt-unobtainable { margin: 0 0 6px; font-size: 13.5px; color: #c0503f; }
/* 결함③(2026-08-17) — inaccessible 아이템은 게임 파일 보물표(칩)와 「못 얻습니다」
   단정이 **모순된 채로 나란히 뜬다**(실측 20개: confirmed/uncertain 입수 행이
   있는데도 실제로는 안 나온다). 칩은 안 지운다(사람이 정함) — 대신 그 앞에 이
   단서를 붙인다. summon_only 는 진짜로 얻는 것이라 모순이 아니라 안 붙는다. */
.tt-caveat { margin: 0 0 6px; font-size: 12.5px; font-style: italic; color: var(--dim); }

.tt-foot {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px;
  background: #100e0a;
  border-top: 1px solid #0007;
  font-family: system-ui, sans-serif; font-size: 13px; color: var(--ink);
}
.tt-stat { display: inline-flex; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }
.tt-ico-weight, .tt-ico-gold { width: 14px; height: 14px; display: inline-block; opacity: .8; }

/* 인라인 SVG 아이콘 (외부 의존 없음) */
.tt-ico-quill {
  background: currentColor;
  -webkit-mask: var(--quill) center/contain no-repeat;
  mask: var(--quill) center/contain no-repeat;
}
.tt-ico-weight { background: currentColor; -webkit-mask: var(--wt) center/contain no-repeat; mask: var(--wt) center/contain no-repeat; }
.tt-ico-gold { background: #d9b45c; -webkit-mask: var(--coin) center/contain no-repeat; mask: var(--coin) center/contain no-repeat; }

.tt {
  --quill: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M20 2c-6 0-11 4-13 10l-3 8 2 2 8-3c6-2 10-7 10-13V2h-4zM6.5 18.5l1.8-4.6C10 9.4 13.7 6.2 18 5.4c-1 4-4.3 7.6-8.6 9.3l-2.9 3.8z'/%3E%3C/svg%3E");
  --wt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23000' d='M12 3a3 3 0 0 0-2.8 4H7L4 20h16L17 7h-2.2A3 3 0 0 0 12 3zm0 2a1 1 0 1 1 0 2 1 1 0 0 1 0-2z'/%3E%3C/svg%3E");
  --coin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='%23000'/%3E%3C/svg%3E");
}

@media (max-width: 620px) {
  .tt-name { font-size: 22px; }
  .tt-icon { width: 68px; height: 68px; }
}

/* 아이템이 주는 행동·주문. 게임 부스트의 UnlockSpell 을 푼 것이라 아이콘과 비용이 있다.
   예전에는 나무위키에서 긁은 이름만 한 줄로 늘어놓았다("절단 열참 칼자루 일격"). */
.tt-grants {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 12px; border-top: 1px solid #2a2118;
}
.tt-grant {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 7px 3px 3px; background: #16110c80; border: 1px solid #2a2118;
}
.tt-grant img { width: 22px; height: 22px; object-fit: contain; }
.tt-grant-name { font-size: 12px; }
.tt-grant-cost { font-size: 10px; color: #9a8b7a; }

/* 파는 사람. 장소 태그와 구분되게 살짝 다르게 둔다 — 찾아갈 대상이 장소가 아니라 사람이다. */
.tt-seller {
  border-color: color-mix(in srgb, var(--rarity, var(--rar-common)) 45%, transparent);
}
