/* Detail map viewer (javascripts/mapdetail.js) and the world map panel's resources / pins.
 * Colours use the theme's own variables so light and dark mode both work. */

/* ---------- World map panel ---------- */
.flwm-paneltools { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0.2rem 0 0.6rem; }
.flwm-paneltools .flwm-copylink { margin: 0; }
.md-typeset .flwm-detailbtn { margin: 0; padding: 0.35em 0.9em; font-size: 0.72rem; }
.flwm-res-row { display: flex; gap: 0.5rem; align-items: flex-start; margin: 0.25rem 0; }
.flwm-res-skill { flex: 0 0 5.2rem; font-size: 0.68rem; color: var(--md-default-fg-color--light); padding-top: 0.45rem; }
.flwm-res-icons { display: flex; flex-wrap: wrap; gap: 0.2rem; }
.flwm-res-icon { display: inline-flex; border-radius: 6px; padding: 1px; line-height: 0; }
.flwm-res-icon:hover, .flwm-res-icon:focus-visible { background: var(--md-accent-fg-color--transparent); outline: 1px solid var(--md-accent-fg-color); }
.flwm-res-icon img { width: 32px; height: 32px; }
.flwm-pin {
  border: 0; background: none; cursor: pointer; padding: 0 0.15rem; font-size: 0.8rem; line-height: 1;
  vertical-align: middle; opacity: 0.75;
}
.flwm-pin:hover, .flwm-pin:focus-visible { opacity: 1; transform: scale(1.15); }

/* ---------- Viewer ---------- */
html.fld-open { overflow: hidden; }
.fld-overlay {
  position: fixed; inset: 0; z-index: 10; background: rgba(0, 0, 0, .6);
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
}
.fld-box {
  background: var(--md-default-bg-color); color: var(--md-default-fg-color);
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  width: min(1400px, 100%); height: min(900px, 100%); display: flex; flex-direction: column; overflow: hidden;
  font-size: 0.8rem;
}
.fld-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--md-default-fg-color--lightest);
}
.fld-head h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.fld-kicker { display: block; font-size: 0.65rem; text-transform: uppercase; letter-spacing: .06em; color: var(--md-default-fg-color--light); }
.fld-tools { display: flex; gap: 0.3rem; }
.fld-btn {
  min-width: 2rem; height: 2rem; border-radius: 8px; border: 1px solid var(--md-default-fg-color--lightest);
  background: transparent; color: inherit; font-size: 1rem; cursor: pointer; line-height: 1;
}
.fld-btn:hover, .fld-btn:focus-visible { background: var(--md-default-fg-color--lightest); }
.fld-body { flex: 1; display: flex; min-height: 0; }
.fld-view { position: relative; flex: 1 1 auto; min-width: 0; background: #11141a; }
.fld-scroll { position: absolute; inset: 0; overflow: auto; cursor: grab; display: flex; align-items: flex-start; }
.fld-scroll.is-dragging { cursor: grabbing; }
.fld-stage { position: relative; flex: none; margin: auto; }
.fld-img { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.fld-side {
  flex: 0 0 clamp(340px, 30vw, 460px); border-left: 1px solid var(--md-default-fg-color--lightest);
  overflow: auto; padding: 0.6rem 0.8rem 1rem;
}
.fld-side h4 { margin: 0.9rem 0 0.3rem; font-size: 0.75rem; text-transform: uppercase; letter-spacing: .04em; }
.fld-muted { color: var(--md-default-fg-color--light); font-weight: 400; }
.fld-note { margin: 0 0 0.3rem; font-size: 0.7rem; }
.fld-credit { font-size: 0.68rem; color: var(--md-default-fg-color--light); margin-top: 1rem; }
.fld-filter {
  width: 100%; box-sizing: border-box; padding: 0.4rem 0.6rem; border-radius: 8px;
  border: 1px solid var(--md-default-fg-color--lighter); background: transparent; color: inherit; font: inherit;
}
.fld-list { list-style: none; margin: 0; padding: 0; }
.fld-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.35rem; border-radius: 6px; cursor: pointer;
}
.fld-row--nopin { cursor: default; opacity: .8; }
.fld-row:hover { background: var(--md-default-fg-color--lightest); }
.fld-row.is-active { background: rgba(212, 160, 23, .25); }
/* The name takes the leftover room (and wraps inside itself if it must), so the tag and
   coordinates stay on the same line instead of dropping below. */
.fld-row .fld-name { font-weight: 600; flex: 1 1 0; min-width: 0; }
.fld-row > .fld-tag, .fld-row > .fld-xy, .fld-row > img, .fld-row > .fld-num, .fld-row > .fld-dot { flex: none; white-space: nowrap; }
.fld-row a.fld-name { color: var(--md-typeset-a-color); text-decoration: none; }
.fld-row a.fld-name:hover { text-decoration: underline; }
.fld-xy { margin-left: auto; font-family: var(--md-code-font-family, monospace); font-size: 0.7rem; color: var(--md-default-fg-color--light); }
.fld-sub { flex-basis: 100%; padding-left: 1.6rem; font-size: 0.7rem; color: var(--md-default-fg-color--light); }
.fld-tag {
  font-size: 0.62rem; padding: 0 0.35rem; border-radius: 999px; border: 1px solid var(--md-default-fg-color--lighter);
  color: var(--md-default-fg-color--light); text-transform: capitalize;
}
.fld-num {
  display: inline-flex; align-items: center; justify-content: center; min-width: 1.25rem; height: 1.25rem;
  border-radius: 999px; background: #d4a017; color: #1b1300; font-size: 0.65rem; font-weight: 700;
}
.fld-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: #3aa0ff; box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(0, 0, 0, .35); margin: 0 0.3rem; }
.fld-arrow { width: 1.25rem; text-align: center; color: #e2557a; font-weight: 700; }
.fld-icon { width: 24px; height: 24px; }

/* toggles and tooltip over the picture */
.fld-toggles {
  position: absolute; left: 0.6rem; bottom: 0.6rem; display: flex; flex-wrap: wrap; gap: 0.5rem;
  background: rgba(15, 18, 24, .85); color: #eef; padding: 0.35rem 0.6rem; border-radius: 8px; font-size: 0.7rem;
}
.fld-toggle { display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; }
.fld-tip {
  position: absolute; left: 0.6rem; top: 0.6rem; max-width: min(360px, 80%); pointer-events: none;
  background: rgba(15, 18, 24, .92); color: #fff; padding: 0.4rem 0.6rem; border-radius: 8px; font-size: 0.75rem;
  opacity: 0; transition: opacity .15s;
}
.fld-tip.is-on { opacity: 1; }
.fld-tip-xy { color: #b9c3cf; font-family: var(--md-code-font-family, monospace); }
.fld-tip-sub { color: #d6dde6; font-size: 0.7rem; margin-top: 0.15rem; }

/* markers */
.fld-mk {
  position: absolute; transform: translate(-50%, -50%); border: 0; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.fld-mk--building {
  min-width: 20px; height: 20px; padding: 0 4px; border-radius: 999px; background: #d4a017; color: #1b1300;
  font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0, 0, 0, .5);
}
.fld-mk--npc { width: 11px; height: 11px; border-radius: 50%; background: #3aa0ff; box-shadow: 0 0 0 2px #fff, 0 1px 3px rgba(0, 0, 0, .6); }
.fld-mk--resource {
  gap: 1px; padding: 2px; border-radius: 8px; background: rgba(255, 255, 255, .92);
  box-shadow: 0 0 0 2px #2e9e5b, 0 2px 4px rgba(0, 0, 0, .5);
}
.fld-mk--resource img { width: 22px; height: 22px; }
.fld-mk--exit {
  width: 22px; height: 22px; border-radius: 6px; background: #e2557a; color: #fff; font-size: 13px; font-weight: 800;
  box-shadow: 0 0 0 2px #fff, 0 2px 4px rgba(0, 0, 0, .5);
}
.fld-mk:hover, .fld-mk:focus-visible { z-index: 3; outline: none; transform: translate(-50%, -50%) scale(1.25); }
.fld-mk.is-active { z-index: 4; animation: fld-pulse 1.2s ease-out 2; transform: translate(-50%, -50%) scale(1.35); }
@keyframes fld-pulse {
  0% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(255, 214, 10, .95); }
  100% { box-shadow: 0 0 0 2px #fff, 0 0 0 18px rgba(255, 214, 10, 0); }
}
.fld-mk.fld-dim { opacity: .2; }
.fld-hide-building .fld-mk--building, .fld-hide-npc .fld-mk--npc,
.fld-hide-resource .fld-mk--resource, .fld-hide-exit .fld-mk--exit { display: none; }

/* ---------- Items page (javascripts/items.js) ---------- */
.fli-controls { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin: 1rem 0 0.4rem; }
.fli-search {
  flex: 1 1 14rem; padding: 0.45rem 0.7rem; border-radius: 8px; font: inherit; font-size: 0.8rem;
  border: 1px solid var(--md-default-fg-color--lighter); background: transparent; color: inherit;
}
.fli-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.fli-chip {
  padding: 0.25rem 0.7rem; border-radius: 999px; font-size: 0.72rem; cursor: pointer;
  border: 1px solid var(--md-default-fg-color--lighter); background: transparent; color: inherit;
}
.fli-chip:hover { border-color: var(--md-accent-fg-color); }
.fli-chip.is-on { background: var(--md-primary-fg-color); border-color: var(--md-primary-fg-color); color: var(--md-primary-bg-color); }
.fli-count { font-size: 0.7rem; color: var(--md-default-fg-color--light); margin: 0.2rem 0 0.4rem; }
.fli-wrap { overflow-x: auto; }
.md-typeset .fli-table { display: table; width: 100%; font-size: 0.72rem; }
.md-typeset .fli-table td { vertical-align: middle; }
/* breathing room between columns (headers and cells line up because they share it) */
.md-typeset .fli-table th, .md-typeset .fli-table td { padding: 0.45em 0.8em; }
/* Gap between the right-aligned numbers and the left-aligned "Where to find it" column */
.md-typeset .fli-table td.fli-wherecell, .md-typeset .fli-table th.fli-wherehead { padding-left: 2em; }
/* icon column: fixed size, and never let the image shrink (the column padding above would squeeze it) */
.md-typeset .fli-table td.fli-iconcell { width: 40px; padding-left: 0.3em; padding-right: 0.3em; }
.md-typeset .fli-iconcell img { width: 40px; height: 40px; max-width: none; display: block; object-fit: contain; }
.md-typeset .fli-name a { font-weight: 700; color: inherit; }
.md-typeset .fli-name a:hover { color: var(--md-accent-fg-color); }
.md-typeset .fli-table .fli-num { text-align: center; font-variant-numeric: tabular-nums; }
.md-typeset .fli-table th.fli-text { text-align: left; }
.md-typeset ul.fli-where { list-style: none; margin: 0; padding: 0; }
.md-typeset ul.fli-where li { margin: 0; }
.md-typeset .fli-xy { margin-left: 0.35rem; font-size: 0.65rem; }
.fli-muted { color: var(--md-default-fg-color--light); }
.fli-table tr { scroll-margin-top: 6rem; }
.fli-table tr.is-hit td { background: rgba(212, 160, 23, .2); }
/* Frozen header row: column names stay under the site header while the list scrolls (wider screens;
   phones show each item as a card with its own labels). The header paints the same page gradient so rows
   scroll out of sight underneath it. --fli-top is set by items.js to the height of the site header. */
@media screen and (min-width: 45em) {
  .fli-wrap { overflow: visible; }
  .md-typeset .fli-table thead th {
    position: sticky; top: var(--fli-top, 2.4rem); z-index: 2; white-space: nowrap;
    background: linear-gradient(var(--fl-bg-angle), var(--fl-bg-top), var(--fl-bg-bottom)) fixed;
    box-shadow: inset 0 -2px 0 var(--md-default-fg-color--lightest);
  }
}
/* category tabs (Gathering / Advanced / Weapons / Armor) */
.fli-tabs { display: flex; flex-wrap: wrap; gap: 0.2rem; margin: 1rem 0 0; border-bottom: 2px solid var(--md-default-fg-color--lightest); }
.fli-tab {
  font: inherit; font-size: 0.75rem; font-weight: 600; cursor: pointer; padding: 0.45rem 0.9rem;
  color: var(--md-default-fg-color--light); background: transparent; border: 0; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.fli-tab:hover { color: var(--md-default-fg-color); }
.fli-tab.is-on { color: var(--md-accent-fg-color); border-bottom-color: var(--md-accent-fg-color); }
.fli-tab-n { font-size: 0.62rem; font-weight: 400; color: var(--md-default-fg-color--light); }
.fli-tag {
  display: inline-block; margin-left: 0.35rem; padding: 0 0.35rem; font-size: 0.58rem; font-weight: 600; vertical-align: middle;
  border-radius: 999px; color: #8a5a00; background: rgba(212, 160, 23, .22);
}
[data-md-color-scheme="slate"] .fli-tag { color: #f0c860; }
.fli-qty { display: inline-block; min-width: 2.2em; color: var(--md-default-fg-color--light); font-variant-numeric: tabular-nums; }
.fli-elsewhere { font-size: 0.7rem; margin: 0 0 0.4rem; color: var(--md-default-fg-color--light); }
.fli-elsewhere:empty { display: none; }
.fli-linkbtn { font: inherit; padding: 0; border: 0; background: none; cursor: pointer; color: var(--md-typeset-a-color); text-decoration: underline; }
/* "Used in N" under an item name: collapsed until clicked */
.md-typeset .fli-used { margin: 0.15rem 0 0; padding: 0; border: 0; background: none; box-shadow: none; font-size: 0.66rem; font-weight: 400; }
.md-typeset .fli-used > summary {
  display: inline-block; padding: 0; margin: 0; cursor: pointer; list-style: none; background: none;
  color: var(--md-default-fg-color--light); border-bottom: 1px dotted currentColor;
}
.md-typeset .fli-used > summary::-webkit-details-marker { display: none; }
.md-typeset .fli-used > summary::before, .md-typeset .fli-used > summary::after { content: none; display: none; }
.md-typeset .fli-used > summary:hover { color: var(--md-accent-fg-color); }
.md-typeset .fli-used[open] > summary { color: var(--md-default-fg-color); }
.md-typeset .fli-used ul { list-style: none; margin: 0.3rem 0 0.2rem; padding: 0; max-width: 22rem; max-height: 14rem; overflow-y: auto; }
.md-typeset .fli-used li { margin: 0 0 0.2rem; padding: 0; line-height: 1.4; }
.fli-used-skill { color: var(--md-default-fg-color--light); }

/* phones: each item becomes a card */
@media screen and (max-width: 44.984375em) {
  .md-typeset .fli-table thead { display: none; }
  .md-typeset .fli-table, .md-typeset .fli-table tbody { display: block; }
  .md-typeset .fli-table tr {
    display: grid; grid-template-columns: 48px 1fr; gap: 0.1rem 0.6rem; padding: 0.5rem 0;
    border-bottom: 1px solid var(--md-default-fg-color--lightest);
  }
  .md-typeset .fli-table tr[hidden] { display: none; }
  .md-typeset .fli-table td { display: block; border: 0; padding: 0; text-align: left; }
  .md-typeset .fli-table td.fli-iconcell { grid-column: 1; grid-row: 1 / span 9; }
  .md-typeset .fli-table td.fli-num { text-align: left; }
  .md-typeset .fli-table td.fli-wherecell { padding-left: 0; }
  .md-typeset .fli-table td:not(.fli-iconcell) { grid-column: 2; }
  .md-typeset .fli-table td[data-label]::before { content: attr(data-label) ": "; color: var(--md-default-fg-color--light); }
  .md-typeset .fli-table td.fli-wherecell::before { display: block; }
}

@media screen and (max-width: 760px) {
  .fld-overlay { padding: 0; }
  .fld-box { border-radius: 0; height: 100%; }
  .fld-head { padding: 0.5rem 0.6rem; }
  .fld-body { flex-direction: column; }
  .fld-view { flex: 0 0 55%; }
  .fld-side { flex: 1 1 auto; border-left: 0; border-top: 1px solid var(--md-default-fg-color--lightest); }
}

/* ✎ "suggest a correction" link beside each item name: faint until the row is hovered */
/* "Need an Update?" column: a pencil per row that opens the suggestion form for that item */
.md-typeset .fli-table th.fli-fixhead, .md-typeset .fli-table td.fli-fixcell { text-align: center; white-space: nowrap; }
.md-typeset a.fli-fix { display: inline-block; padding: 0.2rem 0.45rem; border-radius: 0.3rem; font-size: 0.85rem; text-decoration: none; color: var(--md-default-fg-color--light); }
.md-typeset a.fli-fix:hover, .md-typeset a.fli-fix:focus-visible { color: var(--fl-cta-fg, var(--md-accent-fg-color)); background: var(--fl-cta-bg, transparent); }
.fli-fix-text { display: none; }
@media screen and (max-width: 44.984375em) {
  .md-typeset .fli-table td.fli-fixcell { text-align: left; margin-top: 0.3rem; }
  .md-typeset a.fli-fix { padding: 0; font-size: 0.7rem; }
  .fli-fix-text { display: inline; }
}
