/* Equipment wiki (/wiki). Page chrome follows the site (parchment, Philosopher titles, orange tabs); item names and
   tooltips sit on dark in-game style panels because the client colours (^ffdc50, ^6cfb4b, ...) need a dark ground. */
.wiki, .wdlg { --w-dark: #17130f; --w-dark2: #221c16; --w-line: #4a3b2b; --w-soft: #b8ad9f; }
.wiki-body { text-align: left; font-family: Roboto Regular, Roboto, sans-serif; font-size: 14px; color: var(--exo-text); }
#wiki-page.htmx-request .wiki-body { opacity: .6; transition: opacity .15s; }

.wiki-nav { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.wiki-filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.wiki-filter select, .wiki-filter input, .wpick__filter select, .wpick__filter input {
  height: 38px; min-width: 0; padding: 0 10px; border: 1px solid #ddd6d0; border-radius: 10px; background: #fefdfb;
  font-family: inherit; font-size: 14px; color: var(--exo-text);
}
.wiki-filter input[type=search] { flex: 1 1 180px; }
.wiki-filter__lbl { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-family: Philosopher; font-weight: 700; color: var(--exo-accent); }
.wiki-count { margin: 4px 0 8px; font-size: 13px; color: var(--exo-muted); }
.wiki-sub { margin: 18px 0 8px; font-family: Philosopher; font-weight: 700; font-size: 17px; color: var(--exo-accent); }

.wbtn {
  display: inline-flex; align-items: center; justify-content: center; height: 38px; padding: 0 16px; border: 0;
  border-radius: 10px; background: #fb7008; color: #fff; font-family: Philosopher; font-weight: 700; font-size: 15px;
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.wbtn:hover { background: #e06204; }
.wbtn--sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.wbtn--ghost { background: #fde9d6; color: #ad5407; }
.wbtn--ghost:hover { background: #fcd9b8; }

/* icon: 32x32 cell of the generated sprite (background-image in wiki-icons.css) */
.wico {
  flex: none; display: inline-block; width: 32px; height: 32px; border: 1px solid #6b5636; border-radius: 3px;
  background-color: #000; background-repeat: no-repeat; background-position: calc(var(--i) * -32px) 0; cursor: help;
}
.wico:focus-visible { outline: 2px solid #fb7008; outline-offset: 1px; }
.wname { font-weight: 700; text-decoration: none; overflow-wrap: anywhere; }
a.wname:hover { text-decoration: underline; }

.wtier { display: inline-block; padding: 1px 8px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #1b130b; background: #c9bba8; }
.wtier--Initiate { background: #6cfb4b; }
.wtier--Exotic { background: #ffdc50; }
.wtier--Mythic { background: #ff8a3d; }
.wtier--Ascendant { background: #ff5a5a; }
.wtier--Sovereign { background: #c99bff; }

/* tooltip (client look) */
.wtip {
  max-width: 330px; padding: 8px 10px; border: 1px solid #8a7550; border-radius: 4px; background: rgba(8, 8, 12, .95);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .45); color: #fff; font: 12px/1.5 Tahoma, Verdana, "Segoe UI", sans-serif;
  text-align: left; overflow-wrap: anywhere;
}
.wtip--static { max-width: none; }
#wtip-float { position: fixed; z-index: 1000; left: 0; top: 0; pointer-events: none; display: none; }
#wtip-float.on { display: block; }
#wtip-float.touch { pointer-events: auto; }

/* item page */
.witem { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 20px; align-items: start; }
.wbox { padding: 14px; margin-bottom: 14px; border-radius: 10px; background: var(--exo-panel); }
.wbox__title { margin-bottom: 8px; font-family: Philosopher; font-weight: 700; font-size: 16px; color: var(--exo-accent); }
.wbox--actions { display: flex; flex-wrap: wrap; gap: 8px; background: transparent; padding: 0; }
.wref { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.wref__lv { min-width: 38px; padding: 4px 6px; border-radius: 6px; background: #fde9d6; color: #ad5407; font-weight: 700; font-size: 13px; text-align: center; text-decoration: none; }
.wref__lv:hover { background: #fcd9b8; }
.wref__lv.active { background: #fb7008; color: #fff; }
.wset { margin: 8px 0; padding: 0; list-style: none; }
.wset li { padding: 2px 0; color: var(--exo-muted); }
.wset li.on { color: #2a5bd7; font-weight: 700; }
.wset__items { display: grid; gap: 4px; padding: 8px; border-radius: 6px; background: var(--w-dark); }
.wset__item { display: flex; gap: 8px; align-items: center; }

/* compare + picker layout */
.wbuild { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.wcmp-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.wcmp-bar .wref { margin: 0; }
.wcmp-cols { display: grid; grid-template-columns: repeat(var(--cols, 1), minmax(0, 1fr)); gap: 10px; min-height: 120px; }
.wcmp-col { display: grid; gap: 6px; align-content: start; justify-items: start; }
.wdrop__empty { grid-column: 1 / -1; }
.wdrop.over { outline: 2px dashed #fb7008; outline-offset: 2px; }
.wcmp { margin-top: 14px; }
.wcmp__row {
  display: grid; grid-template-columns: minmax(110px, 1.2fr) repeat(var(--cols, 1), minmax(0, 1fr)); gap: 8px;
  align-items: center; padding: 7px 10px; margin-bottom: 4px; border-radius: 6px; background: var(--exo-panel);
}
.wcmp__row--head { background: transparent; font-family: Philosopher; font-weight: 700; color: var(--exo-accent); }
.wdiff { font-size: 12px; font-weight: 700; white-space: nowrap; }
.wdiff--up { color: var(--exo-ok); }
.wdiff--down { color: var(--exo-err); }

.wsets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.wset-col__title { margin-bottom: 6px; font-family: Philosopher; font-weight: 700; font-size: 18px; color: #f13838; }
.wset-col__title small { font-family: Roboto Regular, Roboto, sans-serif; font-size: 13px; font-weight: 400; color: var(--exo-muted); }
.wslot {
  display: grid; grid-template-columns: 64px 34px minmax(0, 1fr) 22px; gap: 8px; align-items: center; min-height: 44px;
  padding: 5px 8px; margin-bottom: 4px; border-radius: 6px; background: var(--w-dark); border: 1px solid var(--w-line);
}
.wslot__lbl { font-size: 12px; color: var(--w-soft); }
.wslot__empty { grid-column: 2 / 4; font-size: 12px; font-style: italic; color: #7d7368; }
.wslot__x { color: #d9cfc3; text-decoration: none; font-size: 18px; line-height: 1; text-align: center; }
.wslot__x:hover { color: #ff6b6b; }
.wset-bonus { margin-top: 8px; padding: 10px; border-radius: 6px; background: #eef2fd; font-size: 13px; }
.wset-bonus__name { font-weight: 700; color: #2a5bd7; margin-top: 4px; }
.wset-bonus__line { color: var(--exo-text); }

.wpick { position: sticky; top: 12px; padding: 12px; border-radius: 10px; background: var(--w-dark2); }
.wpick__title { margin-bottom: 8px; font-family: Philosopher; font-weight: 700; font-size: 17px; color: #ffdc50; }
.wpick__filter { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.wpick__filter input { grid-column: 1 / 2; }
.wpick__list { display: grid; gap: 4px; max-height: 560px; overflow-y: auto; }
.wpick__item {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 5px 6px;
  border-radius: 6px; background: var(--w-dark); border: 1px solid var(--w-line); cursor: grab;
}
.wpick__item:active { cursor: grabbing; }
.wpick__add { display: flex; gap: 4px; }
.wpick__hint { display: block; margin-top: 8px; color: var(--w-soft); }

@media (max-width: 1080px) {
  .wbuild { grid-template-columns: 1fr; }
  .wpick { position: static; }
}
@media (max-width: 760px) {
  .witem { grid-template-columns: 1fr; }
  .wsets { grid-template-columns: 1fr; }
  .wcmp-cols { grid-template-columns: 1fr; }
  .wcmp__row { font-size: 13px; padding: 6px 8px; }
}

/* /wiki grid (design E): tier tabs, job rows x slot columns, icons only */
.wgrid-tabs, .wdlg__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.wgrid-tab {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 8px; background: #fde9d6;
  color: #ad5407; font-family: Philosopher; font-weight: 700; font-size: 16px; text-decoration: none;
}
.wgrid-tab:hover { background: #fcd9b8; }
.wgrid-tab.active { color: #1b130b; }
.wgrid-tab--Initiate.active { background: #6cfb4b; }
.wgrid-tab--Exotic.active { background: #ffdc50; }
.wgrid-tab--Mythic.active { background: #ff8a3d; }
.wgrid-tab--Ascendant.active { background: #ff5a5a; }
.wgrid-tab--Sovereign.active { background: #c99bff; }
.wgrid-wrap { overflow-x: auto; border: 1px solid var(--w-line); border-radius: 6px; background: var(--w-dark); }
.wgrid { width: 100%; min-width: 960px; border-collapse: collapse; } /* auto layout: columns with 3-4 variants get wider */
.wgrid th, .wgrid td { border-bottom: 1px solid #2c241c; border-left: 1px solid #2c241c; }
.wgrid thead th {
  padding: 8px 4px; background: var(--w-dark2); color: #d9cfc3; font-size: 12px; font-weight: 700; text-align: center;
  border-bottom: 1px solid var(--w-line);
}
.wgrid th:first-child { width: 116px; border-left: 0; }
.wgrid thead th:first-child, .wgrid tbody th { text-align: left; padding: 6px 10px; font-family: Philosopher; font-size: 15px; color: #ffdc50; }
.wgrid td { padding: 5px 3px; text-align: center; vertical-align: middle; height: 44px; white-space: nowrap; }
.wgrid-it { display: inline-block; margin: 1px; line-height: 0; border-radius: 3px; }
.wgrid-it:hover .wico, .wgrid-it:focus-visible .wico { border-color: #ffdc50; box-shadow: 0 0 0 1px #ffdc50; }
.wgrid-it:focus-visible { outline: 2px solid #fb7008; }

/* compare dialog */
.wdlg { width: min(880px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 1px solid #8a7550; border-radius: 8px; background: var(--w-dark); color: #fff; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.wdlg::backdrop { background: rgba(20, 14, 10, .6); }
.wdlg__head { display: flex; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--w-line); }
.wdlg__title { font-family: Philosopher; font-weight: 700; font-size: 18px; color: #ffdc50; }
.wdlg__head form { margin-left: auto; }
.wdlg__x { width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent; color: #d9cfc3; font-size: 24px; cursor: pointer; }
.wdlg__x:hover { background: #2c241c; }
.wdlg__body { display: flex; flex-wrap: wrap; font-family: Roboto Regular, Roboto, sans-serif; }
.wdlg__pick { flex: 1 1 280px; min-width: 0; padding: 12px 14px; border-right: 1px solid var(--w-line); }
.wdlg__tabs .wgrid-tab { min-height: 32px; padding: 0 10px; font-size: 14px; background: #2c241c; color: #d9cfc3; }
.wdlg__note { margin-bottom: 6px; font-size: 12px; color: var(--w-soft); }
.wdlg__list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow-y: auto; }
.wdlg__cand { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 3px 8px; border: 1px solid transparent; border-radius: 4px; font: 12px/1.35 Tahoma, Verdana, sans-serif; text-decoration: none; }
.wdlg__cand:hover, .wdlg__cand.active { border-color: #fb7008; background: #2c241c; }
.wdlg__cmp { flex: 2 1 420px; min-width: 0; padding: 12px 14px; font: 12px/1.45 Tahoma, Verdana, sans-serif; }
.wdlg__row { display: grid; grid-template-columns: minmax(120px, 1.1fr) repeat(var(--cols, 1), minmax(0, 1fr)); gap: 8px; align-items: center; padding: 4px 0; border-bottom: 1px solid #2c241c; }
.wdlg__row--head { align-items: start; }
.wdlg__name { display: flex; gap: 6px; align-items: center; }
.wdlg__stat { color: var(--w-soft); }
.wdlg__empty { margin: 12px 0 0; color: var(--w-soft); font-size: 13px; }
.wdlg__act { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.wdlg .wdiff--up { color: #6cfb4b; }
.wdlg .wdiff--down { color: #ff6b6b; }
@media (max-width: 760px) {
  .wdlg__pick { border-right: 0; border-bottom: 1px solid var(--w-line); }
}
