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

.tt {
  --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-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: 1px dotted color-mix(in srgb, var(--gold) 65%, transparent);
  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; }

.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, #f0f0e7) 45%, transparent);
}
