/* 어두운 돌 바탕에 금빛 테두리 (게임 화면 느낌). 색은 의미(능력치, 아이템 등급, 오르내림)에 쓴다. */
:root {
  color-scheme: dark;
  --bg: #0b0a08;
  --panel: #14120e;
  --panel-2: #1b1813;
  --field: #0a0907;
  --fg: #d9d0bd;
  --muted: #8d8471;
  --faint: #5f574a;
  --line: #3a3224;
  --line-soft: #241f17;
  --gold: #c9a45c;
  --gold-hi: #e8cf8f;
  --gold-dim: #7d6538;
  --red: #e0574b;
  --green: #6cc46c;
  --blue: #6e9cff;
  --amber: #e0a24a;
  --here: #33290f;
  --point-bg: #3a1714;
  --trial-bg: #142339;
  --top-h: 56px;
  --serif: "Noto Serif KR", "Nanum Myeongjo", "Batang", serif;
  --glow: 0 0 10px rgba(201, 164, 92, .35);
  scrollbar-color: #2e271c var(--bg);
}

* { box-sizing: border-box; }
html { background: var(--bg); scrollbar-gutter: stable; }   /* 페이지 길이와 상관없이 폭이 같게 */
body {
  margin: 0; color: var(--fg); min-height: 100vh; display: flex; flex-direction: column;
  font: 14px/1.55 "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  background:
    radial-gradient(ellipse 120% 60% at 50% -10%, #2a2013 0%, transparent 60%),
    radial-gradient(ellipse 80% 50% at 50% 110%, #1a130b 0%, transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
a { color: var(--gold); }
a:hover { color: var(--gold-hi); }
.wrap { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 16px; }
::selection { background: #5a4520; color: #fff; }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 2px; }

/* ---------------------------------------------------------------- 위쪽 메뉴 */
.top {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(rgba(23, 20, 15, .97), rgba(12, 10, 8, .97));
  border-bottom: 1px solid var(--gold-dim);
  box-shadow: 0 1px 0 #000, 0 8px 24px rgba(0, 0, 0, .65);
}
.top-row { display: flex; align-items: center; gap: 28px; height: var(--top-h); }
.brand {
  display: flex; align-items: center; gap: 10px; text-decoration: none; white-space: nowrap;
  font-family: var(--serif); font-weight: 700; font-size: 19px; letter-spacing: .04em;
  color: var(--gold-hi); text-shadow: var(--glow);
}
.brand:hover { color: #fff1c9; }
.emblem {
  width: 14px; height: 14px; flex: none; transform: rotate(45deg); border: 1px solid var(--gold);
  background: radial-gradient(circle, var(--gold-hi) 0 2px, #3a2c14 3px, #120e08 100%);
  box-shadow: var(--glow), inset 0 0 3px #000;
}
.tabs { display: flex; height: 100%; }
.tabs a {
  position: relative; display: flex; align-items: center; justify-content: center; padding: 0 14px; white-space: nowrap;
  font-family: var(--serif); font-weight: 600; font-size: 15px; color: var(--muted); text-decoration: none;
  transition: color .15s;
}
.tabs a:hover { color: var(--gold-hi); }
.tabs a.on { color: var(--gold-hi); text-shadow: var(--glow); background: radial-gradient(ellipse at 50% 100%, rgba(201, 164, 92, .16), transparent 70%); }
.tabs a.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-hi), transparent); box-shadow: 0 0 10px var(--gold);
}
.tabs a.on::before {
  content: ""; position: absolute; bottom: -4px; left: 50%; width: 6px; height: 6px; margin-left: -3px;
  transform: rotate(45deg); background: var(--gold-hi); box-shadow: 0 0 6px var(--gold);
}

main.wrap { flex: 1; padding-top: 24px; padding-bottom: 32px; }

/* ---------------------------------------------------------------- 제목 */
h1, h2, h3 { font-family: var(--serif); color: var(--gold-hi); font-weight: 700; }
h1 { font-size: 24px; margin: 0; line-height: 1.3; text-shadow: 0 0 14px rgba(201, 164, 92, .2); }
h2 { display: flex; align-items: center; gap: 10px; font-size: 16px; margin: 28px 0 10px; color: var(--gold); }
h2::before {
  content: ""; width: 7px; height: 7px; flex: none; transform: rotate(45deg);
  background: var(--gold); box-shadow: 0 0 6px rgba(201, 164, 92, .6);
}
h2::after { content: ""; flex: 1; min-width: 20px; height: 1px; background: linear-gradient(90deg, var(--gold-dim), transparent); }
.page-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; margin-bottom: 14px; }
.page-head .meta { color: var(--muted); font-size: 13px; }

/* ---------------------------------------------------------------- 공통 부품 */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
b { color: #ece3cf; }
.pill { display: inline-block; padding: 0 8px; border-radius: 2px; font-size: 12px; font-weight: 700; line-height: 20px; }
.pill.point { background: var(--point-bg); color: #ff8a7a; border: 1px solid #6b2a22; }
.pill.trial { background: var(--trial-bg); color: #8fb4ff; border: 1px solid #2a4470; }

/* 칩: 고르는 단추 */
.chips { display: grid; grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); gap: 4px; }
.chips.flow { display: flex; flex-wrap: wrap; }
.chips.flow .chip { white-space: nowrap; padding: 6px 13px; }
.chip {
  border: 1px solid var(--line); background: linear-gradient(#1c1913, #110f0a); padding: 6px 8px; border-radius: 2px;
  text-align: center; cursor: pointer; font: inherit; font-size: 13px; color: var(--fg); transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--gold-dim); color: var(--gold-hi); }
.chip.on {
  border-color: var(--gold); color: var(--gold-hi); font-weight: 700;
  background: linear-gradient(#3a2e17, #1e180e); box-shadow: 0 0 8px rgba(201, 164, 92, .25), inset 0 0 6px rgba(0, 0, 0, .6);
}

/* 입력란 */
select, input[type=text], input[type=search], input[type=number], textarea {
  font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 2px; background-color: var(--field); color: var(--fg);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7); transition: border-color .15s;
}
input[type=search] { appearance: none; }
/* 검색칸의 지우기 × 단추도 금빛으로 */
input[type=search]::-webkit-search-cancel-button {
  appearance: none; width: 12px; height: 12px; cursor: pointer; opacity: .7;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' stroke='%23c9a45c' stroke-width='1.6'%3E%3Cpath d='M2 2l8 8M10 2l-8 8'/%3E%3C/svg%3E") no-repeat center;
}
input[type=search]::-webkit-search-cancel-button:hover { opacity: 1; }
select:hover, input[type=text]:hover, input[type=search]:hover, input[type=number]:hover, textarea:hover { border-color: #4a4030; }
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--gold-dim); box-shadow: inset 0 1px 3px rgba(0, 0, 0, .7), 0 0 0 1px rgba(201, 164, 92, .15); }
input::placeholder, textarea::placeholder { color: var(--faint); }
select {
  appearance: none; padding-right: 28px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0h10L5 6z' fill='%23c9a45c'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
input.search {
  padding-left: 31px; min-width: 220px; width: min(100%, 340px);   /* 예시 글이 잘리지 않게 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d8471' stroke-width='1.6'%3E%3Ccircle cx='6' cy='6' r='4.6'/%3E%3Cpath d='M9.5 9.5L13 13'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 10px center;
}
/* 페이지 HTML 에 넣어 둔 내용 (검색 로봇용). 자바스크립트가 돌면 숨고 화면이 같은 내용을 그린다 */
.js .seo-text { display: none; }
.seo-text h2 { font-size: 15px; margin: 18px 0 6px; }
.seo-text ul { margin: 0; padding-left: 20px; line-height: 1.7; }
input[type=number] { text-align: right; }
input[type=checkbox] {
  appearance: none; width: 15px; height: 15px; margin: 0; flex: none; cursor: pointer; vertical-align: -3px;
  display: inline-grid; place-content: center; border: 1px solid var(--gold-dim); border-radius: 2px; background: var(--field);
}
input[type=checkbox]::before {
  content: ""; width: 9px; height: 9px; transform: scale(0); transition: transform .1s; background: var(--gold-hi);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}
input[type=checkbox]:checked { border-color: var(--gold); }
input[type=checkbox]:checked::before { transform: scale(1); }
/* 스위치 (켜고 끄기) */
input.switch {
  width: 32px; height: 18px; border-radius: 9px; place-content: center start; padding: 0 2px; border-color: var(--line);
  transition: background .15s, border-color .15s;
}
input.switch::before { width: 12px; height: 12px; border-radius: 50%; clip-path: none; transform: none; background: var(--muted); transition: translate .15s, background .15s; }
input.switch:checked { background: #3a2e17; border-color: var(--gold); }
input.switch:checked::before { translate: 14px 0; background: var(--gold-hi); }
label.toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }

/* 단추 */
button.btn {
  font: inherit; font-family: var(--serif); font-weight: 600; padding: 6px 16px; cursor: pointer; color: var(--gold-hi); white-space: nowrap;
  border: 1px solid var(--gold-dim); border-radius: 2px; background: linear-gradient(#3b2f19, #1d170d);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, .12), 0 1px 2px #000; transition: border-color .15s, color .15s;
}
button.btn:hover { border-color: var(--gold); color: #fff1c9; background: linear-gradient(#4a3a1e, #251d10); }
button.btn:active { background: linear-gradient(#1d170d, #2e2414); }
button.btn:disabled { opacity: .6; cursor: default; }
button.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); box-shadow: none; font-family: inherit; font-weight: 400; }
button.btn.ghost:hover { border-color: var(--gold-dim); color: var(--gold-hi); }

/* 패널: 왼쪽 위·오른쪽 아래 모서리에 금빛 장식 (패널·표·카드 모두 같게) */
.box, .card, .mod-group, table.grid, .tooltip { position: relative; }
.box::before, .box::after, .card::before, .card::after, .mod-group::before, .mod-group::after,
table.grid::before, table.grid::after, .tooltip::before, .tooltip::after {
  content: ""; position: absolute; width: 9px; height: 9px; pointer-events: none; border: 0 solid var(--gold); z-index: 3;
}
.box::before, .card::before, .mod-group::before, table.grid::before, .tooltip::before {
  top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px;
}
.box::after, .card::after, .mod-group::after, table.grid::after, .tooltip::after {
  bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px;
}
.box {
  border: 1px solid var(--line); border-radius: 2px; padding: 14px 16px;
  background: linear-gradient(var(--panel-2), var(--panel)); box-shadow: inset 0 0 0 1px #000, 0 2px 12px rgba(0, 0, 0, .45);
}

/* ---------------------------------------------------------------- 표 */
table.grid {
  width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .45);
}
table.grid th {
  background: linear-gradient(#231e15, #18140e); color: var(--gold); font-family: var(--serif); font-size: 12.5px;
  text-align: left; padding: 7px 10px; font-weight: 700; border-bottom: 1px solid var(--gold-dim);
}
table.grid td { padding: 7px 10px; vertical-align: top; border-top: 1px solid var(--line-soft); }
table.grid tr:nth-child(2) td { border-top: 0; }
table.grid tr:nth-child(even) td { background: #17140f; }
table.grid tr:hover td { background: #211b12; }
table.grid tr.here td { background: var(--here); }
td.name { font-weight: 700; white-space: nowrap; color: #ece3cf; }
table.grid th { white-space: nowrap; }
td.dim, td.name.dim { color: var(--muted); }
td.dim, td.npc { white-space: nowrap; }
td.special { color: var(--amber); }
.reward-point { color: #ff8a7a; font-weight: 700; }
.reward-regret { color: #8fb4ff; font-weight: 700; }

/* 젬 색 */
.g-red { color: var(--red); }
.g-green { color: var(--green); }
.g-blue { color: var(--blue); }
.g-white { color: #b8b0a0; }
.mine { font-weight: 700; text-shadow: 0 0 3px currentColor; }   /* 빌드 젬: 젬 색(힘·민첩·지능)은 그대로 */
.gem-line { display: block; }
.gem-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 4px 20px; }
.gem-cols ul { list-style: none; margin: 0; padding: 0; }
.gem-cols li { display: flex; gap: 8px; line-height: 1.7; }
.gem-cols .lv { color: var(--muted); width: 22px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- 액트 */
/* 직업·장 고르기 패널: 줄마다 왼쪽 이름 + 꽉 찬 단추 칸 */
.picker { display: flex; flex-direction: column; gap: 8px; padding: 10px 14px; }
.pick-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 12px; padding: 4px; margin: -4px; border-radius: 2px; }
.pick-label { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--gold-hi); }
.pick-chips { display: grid; gap: 4px; }
.pick-chips.jobs { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.pick-chips.acts { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.pick-chips.views { grid-template-columns: repeat(7, minmax(0, 1fr)); }   /* 한글 PoB 보기: 칸 크기를 직업 고르기와 같게 */
.pob-views { margin: 16px 0 18px; }
.pob-out { scroll-margin-top: calc(var(--head-h, var(--top-h)) + 8px); }   /* 목록에서 고르면 여기로 내려온다 (메뉴에 안 가리게) */
/* 리그 스타터 빌드 */
.starter-box { margin-top: 12px; }
.starter-box summary { cursor: pointer; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.starter-box summary b { font-family: var(--serif); color: var(--gold-hi); font-size: 15px; }
.starter-box summary span { font-size: 12px; }
.starter-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 6px; margin-top: 10px; }
.starter { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 2px; background: linear-gradient(#1c1913, #110f0a); }
.starter:hover { border-color: var(--gold-dim); }
.starter-open { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px 10px;
  background: none; border: 0; color: var(--fg); cursor: pointer; font: inherit; text-align: left; }
.starter-open b { font-size: 13px; color: #ece3cf; }
.starter-open:hover b { color: var(--gold-hi); }
.starter-open span { font-size: 11px; color: var(--muted); }
.starter-src { align-self: center; padding: 0 10px; font-size: 12px; white-space: nowrap; }
.starter-note { margin-top: 8px; font-size: 12px; }
/* 불러온 빌드 목록 */
.saved-builds:empty { display: none; }
.saved-head { margin: 12px 0 6px; font-size: 12px; color: var(--muted); }
.saved-list { display: flex; flex-wrap: wrap; gap: 6px; }
.saved-item { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: 2px; background: linear-gradient(#1c1913, #110f0a); }
.saved-item.on { border-color: var(--gold); box-shadow: 0 0 8px rgba(201, 164, 92, .25); }
.saved-item button { background: none; border: 0; color: var(--fg); cursor: pointer; font: inherit; }
.saved-open { display: flex; flex-direction: column; align-items: flex-start; padding: 5px 4px 5px 10px; text-align: left; }
.saved-open b { font-size: 13px; color: #ece3cf; }
.saved-item.on .saved-open b { color: var(--gold-hi); }
.saved-open span { font-size: 11px; color: var(--muted); }
.saved-del, .saved-ren { padding: 0 7px; font-size: 14px; color: var(--muted) !important; }
.saved-ren { padding-left: 4px; font-size: 12px; }
.saved-del:hover, .saved-ren:hover, .saved-open:hover b { color: var(--gold-hi) !important; }
.pick-chips.sets { display: flex; flex-wrap: wrap; }   /* PoB 세트(Act 1 … Atlas): 이름 길이가 제각각이라 줄바꿈 */
.pick-chips.sets .chip { min-width: 88px; padding: 7px 14px; }
.tree-card { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 28px; padding: 16px 20px; }
.tree-title { font-family: var(--serif); font-weight: 700; font-size: 19px; color: var(--gold-hi); }
.tree-link { margin-left: auto; font-size: 13px; }
/* 패시브 트리 (캔버스) */
.tree-holder { margin-top: 10px; }
.tree-wrap {
  position: relative; height: min(78vh, 820px); min-height: 420px; border: 1px solid var(--gold-dim); border-radius: 2px;
  overflow: hidden; background: #070605; user-select: none;
}
.tree-wrap:fullscreen { height: 100vh; border: 0; }
.tree-canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.tree-canvas:active { cursor: grabbing; }
.tree-tools { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.tree-tools .chip { background: rgba(12, 10, 7, .85); padding: 5px 10px; min-width: 34px; }
.tree-tip {
  position: absolute; z-index: 2; max-width: 360px; pointer-events: none; border: 1px solid #5a4a2c;
  background: rgba(8, 7, 5, .95); box-shadow: 0 4px 18px rgba(0, 0, 0, .7); font-size: 13px; line-height: 1.5;
}
.tree-tip .tt-head { padding: 7px 14px 6px; text-align: center; border-bottom: 1px solid #3a2f1c; background: linear-gradient(#211b12, #14110b); }
.tree-tip-name { font-family: var(--serif); font-weight: 700; font-size: 15px; color: #c8c8c8; }
.tree-tip .k-N .tree-tip-name, .tree-tip .k-AN .tree-tip-name { color: #e8cf8f; }
.tree-tip .k-K .tree-tip-name { color: #e8a65f; }
.tree-tip .k-M .tree-tip-name { color: #a58bd6; }
.tree-tip-kind { font-size: 11px; color: var(--muted); }
.tree-tip-body { padding: 8px 14px 9px; color: #8888ff; text-align: center; }
.tree-tip-note { color: var(--muted); font-style: italic; font-size: 12px; margin-top: 4px; }
.tree-tip-item { padding: 0 8px 8px; }
.tree-tip-item .tooltip { margin: 0; box-shadow: none; }
.tree-tip-item .item-trade { display: none; }   /* 설명 창은 누를 수 없어 거래소 링크는 장비 화면에서 */
.tree-search { position: absolute; top: 10px; left: 10px; display: flex; align-items: center; gap: 8px; }
.tree-search input { width: 260px; background: rgba(12, 10, 7, .88); }
.tree-count { font-size: 12px; color: #7fe0ff; text-shadow: 0 0 4px #000; }
@media (max-width: 600px) {
  .tree-wrap { height: 70vh; min-height: 360px; }
  .tree-tools { top: auto; bottom: 10px; }
  .tree-tools .chip { padding: 5px 8px; }
  .tree-search input { width: 220px; }
}
.pick-chips .chip { padding: 7px 4px; font-size: 14px; white-space: nowrap; }
.pick-row.empty { box-shadow: 0 0 0 1px var(--gold), 0 0 12px rgba(201, 164, 92, .35); animation: job-glow 2s ease-in-out infinite; }
@keyframes job-glow { 50% { box-shadow: 0 0 0 1px var(--gold-dim), 0 0 4px rgba(201, 164, 92, .15); } }
.act-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 22px; }
.act-name { font-family: var(--serif); font-weight: 700; font-size: 21px; color: var(--gold-hi); }

/* ---------------------------------------------------------------- 빌드: 카드는 아이템 설명 창처럼 */
.pob-input input { flex: 1; min-width: 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.card {
  border: 1px solid var(--line); border-radius: 2px; padding: 8px 12px 10px; background: linear-gradient(#18150f, #0f0d0a);
  box-shadow: inset 0 0 0 1px #000, 0 2px 10px rgba(0, 0, 0, .4);
}
.card-head {
  font-family: var(--serif); font-weight: 700; color: var(--gold); font-size: 13px; margin: -8px -12px 8px; padding: 6px 12px;
  background: linear-gradient(#262015, #17130d); border-bottom: 1px solid var(--line); text-align: center;
}
.card-head.main { color: #ff8a7a; }
ul.gem-list { list-style: none; margin: 0; padding: 0; }
ul.gem-list li { display: flex; gap: 8px; line-height: 1.7; }
ul.gem-list .lv { color: var(--muted); width: 24px; text-align: right; flex: none; font-variant-numeric: tabular-nums; }
/* 장비: 게임 아이템 설명 창처럼. 머리는 희귀도 색, 옵션은 가운데 정렬, 오른쪽에 옵션 종류 표시 */
.tooltips { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 10px; align-items: start; }
.tooltip { --rc: #c8c8c8; border: 1px solid var(--line); border-radius: 2px; background: #0c0b09; box-shadow: inset 0 0 0 1px #000, 0 2px 10px rgba(0, 0, 0, .45); }
.t-unique { --rc: #d8813a; } .t-relic { --rc: #82ad6a; } .t-rare { --rc: #ffff77; } .t-magic { --rc: #8888ff; }
.tt-head {
  text-align: center; padding: 6px 10px 8px; border-bottom: 1px solid color-mix(in srgb, var(--rc) 35%, #000);
  background: linear-gradient(color-mix(in srgb, var(--rc) 22%, transparent), color-mix(in srgb, var(--rc) 5%, transparent));
}
.tt-top { display: flex; align-items: center; justify-content: space-between; min-height: 22px; }
.tt-slot { font-size: 11.5px; color: var(--muted); }
.tt-name, .tt-base { color: var(--rc); font-family: var(--serif); font-weight: 700; line-height: 1.4; }
.tt-name { font-size: 15px; }
.tt-base { font-size: 13.5px; }
.tt-body { padding: 8px 8px 10px; font-size: 13px; line-height: 1.55; }
.tt-line { display: grid; grid-template-columns: 50px 1fr 50px; align-items: center; gap: 4px; color: #8888ff; }
.tt-text { grid-column: 2; text-align: center; white-space: pre-line; }
.tt-badge {
  grid-column: 3; justify-self: end; font-size: 11px; line-height: 16px; padding: 0 5px; white-space: nowrap;
  border: 1px solid currentColor; border-radius: 2px; opacity: .85;
}
.tt-tier { grid-column: 1; grid-row: 1; justify-self: start; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tt-tier.pre { color: #e0776d; }   /* 접두어 */
.tt-tier.suf { color: #7aa7ff; }   /* 접미어 */
.tt-line.k-implicit .tt-badge { color: var(--muted); }
.tt-line.k-crafted, .tt-line.k-enchant { color: #b4b4ff; }
.tt-line.k-fractured { color: #a29162; }
.tt-line.exarch .tt-badge { color: #e0773a; }
.tt-line.eater .tt-badge { color: #b57ce0; }
.t-gem { --rc: #1ba29b; } .t-currency { --rc: #aa9e82; } .t-card { --rc: #d9d0bd; }
.tt-line.off { opacity: .45; }   /* 거래소 검색 조건에 넣지 않은 옵션 */
/* 거래소 검색 탭 */
textarea.paste { display: block; width: 100%; resize: vertical; font-size: 13px; }
.trade-result { display: grid; grid-template-columns: minmax(0, 460px) minmax(0, 1fr); gap: 14px 20px; margin-top: 14px; align-items: start; }
.trade-side { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
/* 바깥 사이트로 가는 큰 금빛 단추 (거래소 검색, 패시브 트리 열기) */
a.btn.trade-go, a.btn.go {
  display: inline-block; text-decoration: none; font-size: 15px; padding: 10px 22px;
  font-family: var(--serif); font-weight: 600; color: var(--gold-hi);
  border: 1px solid var(--gold-dim); border-radius: 2px; background: linear-gradient(#3b2f19, #1d170d);
  box-shadow: inset 0 1px 0 rgba(255, 220, 150, .12), 0 1px 2px #000;
}
a.btn.trade-go:hover, a.btn.go:hover { border-color: var(--gold); color: #fff1c9; background: linear-gradient(#4a3a1e, #251d10); }
@media (max-width: 640px) { .trade-result { grid-template-columns: minmax(0, 1fr); } }
.tt-sep { height: 1px; margin: 6px 24px; background: linear-gradient(90deg, transparent, var(--gold-dim), transparent); }
.tt-links { margin-top: 6px; text-align: center; font-size: 12px; color: var(--muted); }
/* 장비의 '거래소' 링크 (카카오 거래소 검색을 새 창으로) */
a.item-trade {
  padding: 1px 9px; font-size: 12px; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: rgba(0, 0, 0, .3);
}
a.item-trade:hover { border-color: var(--gold-dim); color: var(--gold-hi); }
.r-unique { color: #d8813a; }
.r-relic { color: #82ad6a; }
.r-rare { color: #ffff77; }
.r-magic { color: #8888ff; }

/* ---------------------------------------------------------------- 즐겨찾기 ☆, 도구 줄 */
button.star {
  font: inherit; background: none; border: 0; padding: 0 6px 0 0; cursor: pointer; color: var(--faint); font-size: 14px; line-height: 1;
}
button.star:hover { color: var(--gold-hi); }
button.star.on { color: var(--gold); }
.toolbar { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin: 14px 0 12px; }
.toolbar .pick { display: inline-flex; align-items: center; gap: 6px; }
.toolbar .pick b { font-weight: 400; color: var(--muted); font-size: 13px; }
td.up { color: var(--red); }
td.down { color: var(--blue); }

/* ---------------------------------------------------------------- 메인화면 시세 요약 */
.sum-head { margin-top: 30px; }
.sum-rate { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; font-size: 15px; }
.sum-rate b { font-size: 20px; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.sum-currency { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 900px) { .sum-currency { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .sum-currency { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.sum-card {
  border: 1px solid var(--line); border-radius: 2px; padding: 7px 10px; background: linear-gradient(#18150f, #0f0d0a);
  display: flex; flex-direction: column;   /* 이름이 한 줄이든 두 줄이든 가격·등락은 카드 아래에 맞춘다 */
}
.sum-card .sum-name { font-size: 13px; color: #ece3cf; word-break: keep-all; margin-bottom: 2px; }
.sum-card .sum-price { margin-top: auto; font-size: 16px; font-weight: 700; color: var(--gold-hi); font-variant-numeric: tabular-nums; }
.sum-card .sum-change { font-size: 12px; color: var(--muted); }
.sum-change.up { color: var(--red); } .sum-change.down { color: var(--blue); }
.sum-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 12px; }
.sum-list { padding: 4px 12px 8px; }
.sum-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto 64px; align-items: center; gap: 6px; padding: 4px 0;
  border-top: 1px solid var(--line-soft); font-size: 13px; }
.sum-row:first-child { border-top: 0; }
.sum-row .sum-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ece3cf; }
.sum-row .sum-price { color: var(--gold-hi); font-variant-numeric: tabular-nums; text-align: right; }
.sum-row .sum-change { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .sum-panels { grid-template-columns: minmax(0, 1fr); } }
/* 즐겨찾기 찾기: 결과는 이름만, 누르면 ☆ 넣기·빼기 */
.sum-search { padding: 8px 12px 0; }
.sum-search input.search { width: 100%; min-width: 0; }
.sum-hits { margin-top: 4px; }
.sum-hits > .muted { padding: 4px 0; font-size: 13px; }
.sum-hit {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; width: 100%;
  padding: 5px 2px; font: inherit; font-size: 13px; text-align: left; color: var(--fg); cursor: pointer;
  background: none; border: 0; border-top: 1px solid var(--line-soft);
}
.sum-hit:first-child { border-top: 0; }
.sum-hit:hover { background: #1c1811; }
.sum-hit .star { color: var(--faint); padding: 0 4px 0 0; }
.sum-hit:hover .star, .sum-hit.on .star { color: var(--gold); }
.sum-hit .sum-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #ece3cf; }
.sum-hit .muted { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.sum-search:has(.sum-hits:not(:empty)) + .sum-list { border-top: 1px solid var(--line); margin-top: 6px; }

/* ---------------------------------------------------------------- 레시피 */
.recipe-list { padding: 4px 14px 8px; }
.recipe {
  display: grid; grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr); align-items: center; gap: 10px;
  padding: 7px 0; border-top: 1px solid var(--line-soft);
}
.recipe:first-child { border-top: 0; }
.recipe-arrow { text-align: center; color: var(--gold); font-size: 16px; }
.recipe-get b { color: var(--gold-hi); }
.recipe-get .muted { font-size: 12.5px; margin-top: 1px; }
@media (max-width: 640px) {
  .recipe { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .recipe-arrow { display: none; }
  .recipe-get > b::before { content: "→ "; color: var(--gold); }
}

/* ---------------------------------------------------------------- 검색식 */
.seg { display: inline-flex; gap: 4px; }
.seg .chip { min-width: 72px; }
.shop-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.shop-row > b { width: 96px; flex: none; color: var(--gold); font-family: var(--serif); }
.shop-mods { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.shop-mods label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mins { display: flex; gap: 10px 22px; flex-wrap: wrap; }
.mins label { display: inline-flex; align-items: center; gap: 8px; }
.mins label span { color: var(--muted); font-size: 13px; }
.mins input { width: 74px; }
.regex-out { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.regex-out input {
  flex: 1; min-width: 0; font-family: Consolas, "Cascadia Mono", monospace; font-size: 15px; padding: 9px 12px; color: var(--gold-hi);
}
.regex-out .btn { padding: 9px 20px; }
/* 지도 검색식: 결과 칸은 내려가도 메뉴 바로 아래에 붙어 있다 */
.box.map-out { position: sticky; top: calc(var(--head-h, var(--top-h)) + 6px); z-index: 4; margin-top: 8px; padding: 10px 16px;
  box-shadow: inset 0 0 0 1px #000, 0 6px 16px rgba(0, 0, 0, .7); }
.map-out .regex-out { margin-top: 0; }
.map-out .meter { margin-top: 6px; }
.meter { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 12px; }
.meter .bar { flex: 1; height: 4px; background: var(--field); border: 1px solid var(--line-soft); }
.meter .fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-dim), var(--gold)); transition: width .2s; }
.meter.over .fill { background: var(--red); }
.mod-group {
  margin-top: 14px; border: 1px solid var(--line); border-radius: 2px;
  background: linear-gradient(var(--panel-2), var(--panel)); box-shadow: inset 0 0 0 1px #000, 0 2px 12px rgba(0, 0, 0, .45);
}
.mod-head {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: linear-gradient(#262015, #17130d); border-bottom: 1px solid var(--gold-dim);
}
.mod-head h3 { margin: 0; font-size: 14px; color: var(--gold-hi); }
.mod-head .muted { font-size: 12px; }
.mod-head .picked {
  margin-left: auto; font-size: 12px; font-weight: 700; color: var(--red);
  padding: 0 8px; line-height: 20px; border: 1px solid #6b2a22; background: var(--point-bg); border-radius: 2px;
}
.mods .mod-cols { columns: 2 380px; column-gap: 28px; padding: 8px 14px 10px; }
.mods label {
  display: flex; align-items: flex-start; gap: 8px; padding: 3px 6px; margin: 0 -6px; border-radius: 2px;
  cursor: pointer; break-inside: avoid; color: #8888ff;
}
.mods label input { margin-top: 3px; }
.mods label:hover { color: #aaaaff; background: #17140f; }
.mods label.on { color: var(--red); text-decoration: line-through; text-decoration-color: rgba(224, 87, 75, .6); }
.mods label.on input { border-color: var(--red); }
.mods label.on input::before { background: var(--red); }

/* ---------------------------------------------------------------- 개선 요청 (누르면 열린다) */
#feedback { padding-bottom: 28px; }
#feedback details { border-top: 1px solid var(--line-soft); padding-top: 14px; }
#feedback summary {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: var(--muted); font-size: 13px;
}
#feedback summary::-webkit-details-marker { display: none; }
#feedback summary::before { content: "✎"; color: var(--gold-dim); }
#feedback summary:hover { color: var(--gold-hi); }
#feedback details[open] summary { color: var(--gold); margin-bottom: 8px; }
#feedback textarea { display: block; width: 100%; padding: 8px 10px; resize: vertical; }
#feedback .trap { position: absolute; left: -9999px; width: 1px; height: 1px; }
.ok { color: var(--green); }
.warn { color: var(--red); }

/* ---------------------------------------------------------------- 아래쪽 */
.foot { color: var(--faint); font-size: 12px; line-height: 1.8; padding: 18px 0 26px; text-align: center; background: linear-gradient(transparent, rgba(0, 0, 0, .4)); }
.foot a { color: inherit; text-decoration: underline; text-decoration-color: rgba(201, 164, 92, .35); text-underline-offset: 2px; }
.foot a:hover { color: var(--gold); }
.fb-note { margin-top: 8px; font-size: 12px; }
/* 개인정보 처리방침 */
.privacy { line-height: 1.75; }
.privacy h2 { margin: 22px 0 6px; font-size: 15px; }
.privacy ul { margin: 0; padding-left: 20px; }
.privacy li { margin: 3px 0; }
.foot::before {
  content: ""; display: block; max-width: 420px; height: 1px; margin: 0 auto 16px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}

/* ---------------------------------------------------------------- 좁은 화면 */
@media (max-width: 640px) {
  :root { --top-h: 96px; }
  .top-row { flex-direction: column; align-items: stretch; gap: 0; height: auto; padding: 0; }
  .brand { justify-content: center; height: 46px; font-size: 18px; }
  .tabs { display: grid; grid-template-columns: repeat(3, 1fr); height: auto; border-top: 1px solid var(--line-soft); }
  .tabs a { padding: 0; height: 40px; }
  main.wrap { padding-top: 18px; }
  .mins { display: grid; grid-template-columns: max-content 1fr max-content; gap: 8px 10px; align-items: center; }
  .mins label { display: contents; }
  .mins input { width: 100%; }
  input.search { min-width: 0; flex: 1; }
  .toolbar input.search { flex-basis: 100%; }
  .pick-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .pick-chips.jobs, .pick-chips.views { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .pick-chips.acts { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .pick-chips .chip { padding: 6px 2px; font-size: 13px; }
  .tabs a { font-size: 13px; letter-spacing: -.02em; }
  /* 표의 줄을 카드처럼 위아래로 쌓는다. 칸 이름은 data-label 로 앞에 붙인다 */
  table.grid, table.grid tbody, table.grid tr, table.grid td { display: block; width: 100%; }
  table.grid tr:first-child { display: none; }
  table.grid tr { border-top: 1px solid var(--line-soft); padding: 7px 0; }
  table.grid tr:nth-child(2) { border-top: 0; }
  table.grid td { border: 0; padding: 1px 12px; }
  table.grid td:empty { display: none; }
  table.grid td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-weight: 400; }
  table.grid tr:nth-child(even) td, table.grid tr:hover td { background: none; }
  table.grid tr:nth-child(even) { background: #17140f; }
  td.name { white-space: normal; font-size: 15px; }
  .hide-sm { display: none; }
  .tt-line { grid-template-columns: 26px 1fr auto; }
  .regex-out { flex-wrap: wrap; }
  .regex-out input { flex-basis: 100%; }
  .regex-out .btn { flex: 1; }
  /* 붙어 있는 지도 결과 칸은 한 줄로 (화면을 덜 가리게) */
  .map-out .regex-out { flex-wrap: nowrap; }
  .map-out .regex-out input { flex-basis: auto; font-size: 14px; }
  .map-out .regex-out .btn { flex: none; padding: 9px 14px; }
}
