/* The loot council page (loot.html), on top of styles.css: its tokens, cards, chips, menu,
   sheet and tooltip are the roster's. */

:root {
  /* A target's status, in its sheet: green as the site's good; orange for a contested item (a
     warning, not bad news, so not --warn's red); blue for the raider's own (crafts, quests,
     dungeon drops), WoW's rare blue lifted to read on the dark */
  --compete: #e8873a;
  --own: #4a9be8;
}

/* Wider than the roster (Tailwind's lg, 1024): its xl, 1280, where the grid's 17 slots fit
   without sideways scrolling (it needs 966). The side padding is the roster's */
body.loot-page { max-width: 1280px; }

/* Back to the roster: the top-left corner, as the lock is the top-right one, and styled as it */
.back {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 12px 0 6px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  line-height: 18px;
  text-decoration: none;
  transition: color 150ms var(--ease), background 150ms var(--ease);
}
.back svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .back:hover { color: var(--bone); background: var(--field); }
}

/* Locked: one card in the middle saying what it is */
.loot-locked { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 420px; margin: 48px auto; padding: 32px 24px; text-align: center; }
.loot-locked[hidden] { display: none; }
.loot-locked p { margin: 0; color: var(--muted); font-size: 14px; line-height: 18px; }
.loot-locked strong { display: block; margin-bottom: 4px; color: var(--bone); font-size: 18px; line-height: 24px; font-weight: 500; }
.loot[hidden] { display: none; }
/* A remembered login (index.html's flag, set in the head): the page and its skeletons from the
   first paint, not the locked card, until loot.js knows */
.is-unlocked .loot[hidden] { display: block; }
.is-unlocked .loot-locked { display: none; }
/* Skeletons (design system): a cell, the name and the BiS count, each its real size */
.sk-cell { display: inline-block; width: 28px; height: 28px; border-radius: 4px; vertical-align: middle; }
.sk-bis { width: 32px; height: 10px; margin: 4px 0 4px auto; border-radius: 999px; }
/* The phase menu's size ("Phase 8" and its chevron; 40 on phones, the icon button) */
.sk-phase { width: 114px; }

/* The bar over the cards: views, phase, and how fresh the gear is */
/* 32 down from the heading to the first card, as everywhere */
.loot { margin-top: 32px; }
.g-num__head { display: inline-flex; align-items: center; gap: 2px; }
/* The BiS heading sorts (most first): the heading's own type, lit with an arrow while on */
.g-sort { display: inline-flex; align-items: center; gap: 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; transition: color 150ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .g-sort:hover { color: var(--bone); }
}
.g-sort.is-on { color: var(--bone); }
.g-sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.g-sort__icon { width: 12px; height: 12px; }
/* Where the data comes from: a heading per source, its line under it */
.bis-info { width: 320px; }
.info-list { margin: 0; }
.info-list dt { font-weight: 500; }
.info-list dd { margin: 2px 0 0; color: var(--muted); }
.info-list dd + dt { margin-top: 12px; }
.info-list a { color: var(--bone); }
/* Chips with only a word in them: even ends */
.loot .chip:not(:has(.chip__icon)) { padding: 0 12px; }

/* Cards: the roster card's look, with padding all round (no list running to the edge) */
.loot .card { margin: 0 0 16px; padding: 24px; }
/* The grid runs to the card's bottom edge, as the roster's list does: no padding under the
   last row, whose hover surface follows the card's corners (.loot-scroll) */
.loot .loot-grid-card { padding-bottom: 0; }
/* The title, and what sits beside it (wrapping under it on narrow screens, 8 below) */
.loot-card__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 16px; }
.loot-card__title { margin: 0; font-size: 16px; line-height: 20px; font-weight: 500; }
/* A title with its info button right after it (the button's round hover sits 4px off the text) */
.loot-card__titled { display: flex; align-items: center; gap: 2px; margin: -6px 0; }

/* This lockout: a pill per raider with what they got (hidden until someone has); the class
   chips' size, 32 tall with 20px icons, 6 from the end as the chips' icon is from the start */
.loot-lockout[hidden] { display: none; }
.lockout-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* Phones: two rows (32 + 8 + 32), "Vis alle" under them for the rest (loot.js, clampLockout) */
.lockout-list.is-clamped { max-height: 72px; overflow: hidden; }
.lockout-more { margin-top: 12px; }
.lockout-more[hidden] { display: none; }
.lockout:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lockout { display: flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border: 0; border-radius: 999px; background: var(--field); color: var(--bone); font: inherit; cursor: pointer; transition: background 150ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  .lockout:hover { background: var(--field-hover); }
}
.lockout__name { font-size: 14px; line-height: 18px; font-weight: 500; }
/* Stacked as the design system's avatar group: each overlaps the one before by 30% (its -0.75rem
   on 40px), later ones on top, parted by a 2px ring in the pill's colour. --field is see-through,
   so the ring is the same colour made solid on the card's surface (and the hover's, on hover) */
.lockout { --pill: color-mix(in srgb, #fff 8.4%, var(--surface)); }
@media (hover: hover) and (pointer: fine) {
  .lockout:hover { --pill: color-mix(in srgb, #fff 11.6%, var(--surface)); }
}
.lockout__items { display: flex; }
.lockout__items .icon { width: 20px; height: 20px; border: 1px solid var(--q-empty); border-radius: 999px; background: var(--q-empty) center / 108% no-repeat; box-shadow: 0 0 0 2px var(--pill); transition: box-shadow 150ms var(--ease); }
.lockout__items .icon + .icon { margin-left: -6px; }

/* The grid: names down the side (pinned while it scrolls sideways), a column per slot */
/* Out to the card's edges, so it scrolls edge to edge; the card's 24px is in the first and
   last columns instead of padding here, so the pinned names cover the left edge too (a
   pinned cell stops at the scroll padding, and the cells would show through beside it) */
/* Its bottom corners round as the card's (its radius less the 1px border), so the last row's
   hover stays inside them, scrolled sideways or not (the scroll area clips to its corners) */
.loot-scroll { --grid-inset: 24px; --name-col: 140px; overflow-x: auto; margin: 0 -24px; border-radius: 0 0 31px 31px; scrollbar-width: thin;
  /* While more is off to the right: the edge fades, as the chips' (dragScroll sets --fade-r).
     Scrolled sideways, the cells fade in the same way out from under the pinned names
     (--fade-l from where the names end); the names themselves never fade */
  --fade-l: 0px;
  --fade-r: 0px;
  --names-end: calc(var(--grid-inset) + var(--name-col));
  mask-image: linear-gradient(to right, #000 var(--names-end), transparent var(--names-end), #000 calc(var(--names-end) + var(--fade-l)), #000 calc(100% - var(--fade-r)), transparent 100%); }
.loot-scroll.is-scrollable { cursor: grab; }
.loot-scroll.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
/* Fixed layout: the names and numbers have their widths, and the 17 slots share the rest
   equally (sized by their headings, "Shoulder" got more room than "Neck"). At least 42px a
   slot (14 round a 28px cell); narrower than that the grid scrolls */
.loot-grid { width: 100%; min-width: calc(2 * var(--grid-inset) + var(--name-col) + 17 * 42px + 72px); table-layout: fixed; border-collapse: separate; border-spacing: 0; }
.col-name { width: calc(var(--grid-inset) + var(--name-col)); }
/* Score: room for its heading with the sort icon and info button (about 63px: 12 icon, 2,
   "Score", 2, the info button's 18 inside its -6 margin), 2 each side */
.col-bis { width: calc(72px + var(--grid-inset)); }
.loot-grid th { font-weight: 500; }
.loot-grid thead th { padding: 0 2px 8px; color: var(--muted); font-size: 11px; line-height: 14px; white-space: nowrap; }
.loot-grid tbody tr + tr > * { border-top: 1px solid var(--line); }
/* The row under the mouse lights up, edge to edge in the card as the roster's rows (the pinned
   name too), so it's easy to follow a raider across the 17 slots */
.loot-grid tbody tr[data-char] > * { transition: background 150ms var(--ease); }
@media (hover: hover) and (pointer: fine) {
  /* A step above the roster's --panel: across 17 columns the faint one got lost. Solid, as the
     pinned name covers the cells scrolling under it */
  .loot-grid tbody tr[data-char]:hover > * { background: color-mix(in srgb, #fff 5%, var(--surface)); }
}
.g-name { position: sticky; left: 0; z-index: 1; width: 1%; padding: 0 12px 0 var(--grid-inset); background: var(--surface); text-align: left; transition: box-shadow 150ms var(--ease); }
.loot-grid tr > :last-child { padding-right: var(--grid-inset); }
.loot-grid thead .g-name { padding-left: var(--grid-inset); }
/* Scrolled sideways: a line where the cells go under the names (inside the name cell, as the
   mask's fade starts right after it) */
.loot-scroll.is-scrolled .g-name { box-shadow: inset -1px 0 0 var(--line); }
.g-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.g-who__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 18px; }
.g-slot { overflow: hidden; text-overflow: ellipsis; text-align: center; }
/* 40 a row: the 28px cell with 6 above and below */
.g-cell { padding: 6px 2px; text-align: center; }
.g-num { padding: 0 0 0 12px; font-size: 14px; line-height: 18px; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
thead .g-num { font-size: 11px; line-height: 14px; }
/* BiS: what they have in the name's weight, out of how many in muted */
.g-have { font-weight: 500; }
.g-of { color: var(--muted); }
.loot-empty { padding: 32px 0; color: var(--muted); font-size: 14px; text-align: center; }
/* No BiS lists from WoWSims (a new game it hasn't covered yet): a line over the grid */
.loot-note { margin: 0 0 16px; padding: 12px 16px; border-radius: 16px; background: var(--field); color: var(--muted); font-size: 14px; line-height: 18px; }
.loot-note[hidden] { display: none; }

/* A slot: what they wear in it, as the front page's gear strip (styles.css .strip .icon): 28px,
   a 1px border in the item's quality (q-*), the picture filling it; an empty slot a field
   square without the border. A button where it opens the slot's BiS */
.cell {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: none;
  vertical-align: middle;
}
button.cell { cursor: pointer; }
.cell .icon { box-sizing: border-box; width: 28px; height: 28px; border: 1px solid var(--q-empty); border-radius: 4px; background: var(--q-empty) center / cover no-repeat; }
.cell .icon.is-empty { background: var(--field); border-color: transparent; }
/* No BiS count: a short dash at the column's right edge */
.g-dash { display: inline-block; width: 8px; height: 2px; border-radius: 999px; background: var(--hairline); vertical-align: middle; }
@media (hover: hover) and (pointer: fine) {
  button.cell:hover { filter: brightness(1.25); }
}
.cell:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }

/* A target's sheet: what it is, then everyone who wants it */
.facts { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; padding: 4px 8px 12px; font-size: 14px; line-height: 20px; }
.fact { display: contents; }
.fact dt { color: var(--muted); }
.fact dd { display: flex; align-items: center; gap: 8px; min-width: 0; margin: 0; }
.is-quiet { color: var(--muted); }
/* A target's status in the sheet, in its frame's colour (no colour for no competition) */
.status--obtained { color: var(--good); }
.status--competition { color: var(--compete); }
.status--own { color: var(--own); }
/* Upgrade % (want list, item dropped, the sheet): better green, worse red, as the officer tiles */
.is-up { color: var(--good); }
.is-down { color: var(--warn); }

@media (max-width: 639px) {
  .back span { display: none; }
  .back { padding: 0; width: 32px; justify-content: center; }
  .loot .card { padding: 16px; border-radius: 24px; }
  .loot-controls { margin: 0 -16px 16px; padding: 0 16px 16px; }
  .loot-scroll { --grid-inset: 16px; --name-col: 104px; margin: 0 -16px; border-radius: 0 0 23px 23px; }
  .sk-phase { width: 40px; }
}

/* Officer actions: under a target's facts, and Tildel in an item's row */
.cell-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 8px 12px; }
/* Tildel and Angre: one size, so swapping them moves nothing: the wider word, Angre (39px),
   with 12 a side, rounded to 64 */
.award-btn { min-width: 64px; height: 24px; gap: 0; padding: 0 12px; background: var(--bar); color: var(--stone); }
@media (hover: hover) and (pointer: fine) {
  .award-btn:hover { background: color-mix(in srgb, var(--bar), #fff 12%); }
  .award-btn.is-undo:hover { background: var(--field-hover); }
}
.awarded { color: var(--good); font-weight: 500; }
/* Angre, as the logout dialog's Logg ut: the field surface with red text */
.award-btn.is-undo { background: var(--field); color: var(--warn); }
/* A target's Fjern takes the place of Marker som tildelt: its size, in Angre's red */
.pill-button.is-remove { color: var(--warn); }
}
/* An awarded row stays readable (it's what was just done), unlike the has-it rows */
/* Bottom centre, above everything */
.toast { inset: auto 0 24px; margin: 0 auto; padding: 10px 16px; font-size: 14px; line-height: 18px; }

/* Changing a target: search, then the items (best for the spec first); a pick saves */
.edit-search { padding: 4px 8px 8px; }
.edit-search input {
  width: 100%;
  border: 1px solid transparent;
  background: var(--field);
  color: var(--bone);
  font: inherit;
  /* As the page's search fields: their size and their placeholder ink */
  font-size: 15px;
  line-height: 20px;
  caret-color: var(--caret);
}
.edit-search input::placeholder { color: var(--muted); opacity: 1; }
.edit-search input { height: 40px; padding: 0 16px; border-radius: 999px; }
.edit-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.edit-search input:focus-visible { outline: none; background: var(--field-hover); }
/* 8 in from the scroll area's edges, so the picks' surfaces line up with the search field above
   (not out to the sheet's rows); 2px between items, so a hovered one and the selected one
   don't run together */
.pick-list { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0 8px 8px; list-style: none; }
.pick {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 18px;
  align-items: center;
  /* 12 from the icon, as every row with a 28px icon (search list, boss rows, raider sheet) */
  gap: 12px;
  width: 100%;
  /* 48 tall, as the raider sheet's item rows (7 round the name and its line); 4 more on the
     right: the check's own whitespace already sets it in, and by the 12px corner it looked
     pushed into it */
  padding: 7px 12px 7px 8px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--bone);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
@media (hover: hover) and (pointer: fine) {
  button.pick:hover { background: var(--field); }
}
.pick:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.pick .icon { width: 28px; height: 28px; border: 1px solid var(--q-empty); border-radius: 4px; background: var(--q-empty) center / 108% no-repeat; }
.pick__text { display: flex; flex-direction: column; min-width: 0; }
/* The name, and WoWSims' badge right after it */
.pick__title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pick__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 18px; font-weight: 500; }
.pick__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; line-height: 16px; }
.pick__tag { flex: none; padding: 0 6px; border-radius: 999px; background: var(--field); color: var(--muted); font-size: 11px; line-height: 16px; font-weight: 500; }
.pick__check { width: 18px; height: 18px; color: var(--bar); visibility: hidden; }
.pick.is-static { cursor: default; }
/* A sheet heading with an info button after it, as the BiS column's heading has */
.sheet-sub__head { display: inline-flex; align-items: center; gap: 2px; }
/* The main hand's 1H and 2H chips (loot.js handChips): text chips as the armour filter's, on
   the search field's 8px inset, 8 above the list */
.hand-chips { display: flex; gap: 8px; padding: 0 8px 8px; }
.hand-chips .chip { padding: 0 12px; }
.pick.is-selected { background: var(--field); }
.pick.is-selected .pick__check { visibility: visible; }
.pick-empty { padding: 8px 8px; color: var(--muted); font-size: 14px; }

/* The grid's search and armour chips: the roster's controls, its divider running to the
   card's edges, 16 down to the table */
.loot-controls { margin-bottom: 16px; }
/* Item search: the matching targets stay lit, the rest of the grid dims (as the roster's strip) */
.loot-grid .cell { transition: background 150ms var(--ease), opacity 150ms var(--ease); }
.loot-grid.is-searching .cell:not(.is-hit) { opacity: 0.2; }

/* The search's list of items, under the field */
.item-suggest { padding: 4px; max-width: none; }
.suggest {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 40px;
  padding: 6px 12px 6px 6px;
  border: 0;
  border-radius: 12px;
  background: none;
  color: var(--bone);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.suggest.is-active { background: var(--field-hover); }
.suggest .icon { width: 28px; height: 28px; border: 1px solid var(--q-empty); border-radius: 4px; background: var(--q-empty) center / 108% no-repeat; }
.suggest__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 18px; font-weight: 500; }
/* For items of one name, who needs it in the count's place: never cut (loot.js shortens it to
   one name and "+N" first), the item's name is */
.suggest__who { white-space: nowrap; }
.suggest__count { color: var(--muted); font-size: 13px; line-height: 16px; font-variant-numeric: tabular-nums; }

/* The sheet is wider here: who should get an item is a five-column table */
@media (min-width: 640px) {
  .sheet--wide:not(.sheet--bottom) { width: min(92vw, 480px); }
}
.sheet-note { margin: 0; padding: 4px 8px 12px; color: var(--muted); font-size: 14px; line-height: 18px; }
/* Who should get it: one slim line per raider */
/* 4 at the bottom: the last row's 40px already has 8 under its 24px button, so it's 20 down to
   the next line, as everywhere */
.want-table { display: grid; grid-template-columns: minmax(0, 1fr) auto auto minmax(56px, max-content); padding: 0 8px 4px; }
.want-row { display: contents; }
.want-row > * { display: flex; align-items: center; justify-content: flex-end; min-height: 40px; padding: 0 0 0 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.want-row > :first-child { justify-content: flex-start; padding-left: 0; }
/* No column headings (the numbers say what they are): no line above the first */
.want-row:first-child > * { border-top: 0; }
.want-row__who { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.want-row__state { color: var(--compete); font-size: 13px; }

/* What they got: the item, and Fjern for an award or mark */
.got-table { display: grid; grid-template-columns: minmax(0, 1fr) auto; padding: 0 8px 4px; }
.got-row { display: contents; }
.got-row > * { display: flex; align-items: center; justify-content: flex-end; min-height: 48px; padding-left: 16px; border-top: 1px solid var(--line); }
.got-row:first-child > * { border-top: 0; }
.got-row > :first-child { justify-content: flex-start; padding-left: 0; }
.got-row__item { gap: 12px; min-width: 0; }
/* Fjern in a row: a trash icon on the round 32px icon button (a column of red pills shouted),
   turning red on hover; the text Fjern stays where it replaces Marker som tildelt. 16, as the
   lock: a squarish shape (18 looked too big) */
.remove-btn__icon { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .remove-btn:hover { color: var(--warn); }
}
.remove-btn[aria-expanded="true"] { color: var(--warn); }
.got-row__item .icon { flex: none; width: 28px; height: 28px; border: 1px solid var(--q-empty); border-radius: 4px; background: var(--q-empty) center / 108% no-repeat; }
.got-row__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; line-height: 18px; font-weight: 500; }

/* Fjern's confirmation: a small bubble at the button, the logout dialog's words and buttons at
   popover size (12 in, the text 4 further, as the dialog's 16 and 8) */
.confirm-pop { width: 240px; padding: 12px; }
.confirm-pop__title { margin: 4px 4px 4px; font-size: 14px; line-height: 18px; font-weight: 500; }
.confirm-pop__text { margin: 0 4px 16px; color: var(--muted); font-size: 13px; line-height: 16px; }
.confirm-pop .officer-actions { margin-top: 0; }
.confirm-pop .officer-actions button { height: 32px; font-size: 13px; }
