/* Expedition Final UI tokens, scaled from the 2560x1440 reference to a 1920 wide page (x0.75). */
:root {
  --u: .75px;

  --night: #120905;
  --night-ember: #1e0901;
  --night-raised: #1f1816;
  --parchment: #a59991;
  --control: #584a40;
  --control-hover: #6f3720;
  --control-track: #5b483f;
  --nav-selected: #a89890;
  --nav-hover-line: #a89890b3;

  --text-heading: #e6dece;
  --text-nav: #c2b7b1;
  --text-paragraph: #968c87;
  --text-label: #a8a09c;
  --text-helper: #8c8380;
  --text-on-dark: #ffffff;

  --ink: #120905;
  --ink-body: #35221a;

  --good: #4c5e29;
  --good-strong: #3e5e29;
  --bad: #5b210a;
  --bar-track: #857a72;

  --rarity-common: #575757;
  --rarity-uncommon: #2c5129;
  --rarity-rare: #193d73;
  --tag-neutral: #5c5b56;
  --tag-type: #464218;
  --tag-weapon: #741313;

  --font: "Libre Caslon Text", "Noto Serif SC", Georgia, serif;

  --fs-header-2: calc(32.36 * var(--u));
  --fs-header-3: calc(21 * var(--u));
  --fs-nav: calc(32 * var(--u));
  --fs-body: calc(26 * var(--u));
  --fs-caption: calc(21 * var(--u));
  --fs-slot-label: calc(17.86 * var(--u));

  --space-5: calc(5 * var(--u));
  --space-6-5: calc(6.5 * var(--u));
  --space-10: calc(10 * var(--u));
  --space-13: calc(13 * var(--u));
  --space-20: calc(20 * var(--u));
  --space-26: calc(26 * var(--u));
  --space-39: calc(39 * var(--u));
  --space-52: calc(52 * var(--u));

  --radius-chip: 3px;
  --radius-panel: 6px;
  --radius-row: 10px;
  --radius-pill: 1000px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--night);
  color: var(--text-paragraph);
  font: 400 var(--fs-body)/1.22 var(--font);
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--text-heading); outline-offset: 2px; }
.window :focus-visible { outline-color: var(--ink); }

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-13);
  height: calc(100 * var(--u));
  padding: 0 var(--space-52);
  background: var(--night);
  font-size: var(--fs-nav);
}
.nav .brand { color: var(--text-heading); margin-right: var(--space-26); }
.nav .version { margin-left: auto; font-size: var(--fs-caption); color: var(--text-label); }
.nav a {
  padding: var(--space-6-5) var(--space-20);
  border-radius: var(--radius-pill);
  color: var(--text-nav);
  text-decoration: none;
}
.nav a:hover { outline: 2px solid var(--nav-hover-line); outline-offset: -2px; }
.nav a[aria-current] { background: var(--nav-selected); color: var(--ink); }

.screen { padding: var(--space-39) var(--space-52); }

h1, h2, h3 { margin: 0; font-weight: 400; }
h2 { font-size: var(--fs-header-2); color: var(--text-heading); }
.window h2 { color: var(--ink); }
h3 {
  font-size: var(--fs-header-3);
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-label);
}
.window h3 { color: var(--ink-body); }

.helper { color: var(--text-helper); }

input, select, button {
  font: inherit;
  padding: var(--space-10) var(--space-13);
  background: var(--control);
  color: var(--text-heading);
  border: 0;
  border-radius: var(--radius-panel);
  min-width: 0;
}
input::placeholder { color: var(--text-nav); }
input:hover, select:hover, button:hover { background: var(--control-hover); }
button { padding: var(--space-13) var(--space-39); cursor: pointer; }

.tags { display: flex; flex-wrap: wrap; gap: var(--space-6-5); }
.tag {
  padding: var(--space-5) var(--space-10);
  border-radius: var(--radius-chip);
  background: var(--tag-neutral);
  color: var(--text-on-dark);
  font-size: var(--fs-caption);
}
.tag.common { background: var(--rarity-common); }
.tag.notable { background: var(--rarity-uncommon); }
.tag.rare { background: var(--rarity-rare); }
.tag.type { background: var(--tag-type); }
.tag.weapon { background: var(--tag-weapon); }

.window {
  background: var(--parchment);
  color: var(--ink-body);
  border-radius: var(--radius-panel);
  padding: var(--space-39);
  display: flex;
  flex-direction: column;
  gap: var(--space-39);
}
.window header { display: flex; flex-direction: column; gap: var(--space-13); }
.window a { color: var(--ink); text-decoration: underline; }
.window p { margin: 0; }
.window section { display: flex; flex-direction: column; gap: var(--space-13); }

.stat { display: flex; align-items: baseline; gap: var(--space-10); }
.stat::after { content: ""; order: 1; flex: 1; align-self: flex-end; margin-bottom: .3em; border-bottom: 1px solid var(--bar-track); }
.stat span { order: 0; }
.stat strong { order: 2; font-weight: 400; color: var(--ink); }

.lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--space-6-5); }
.recipe { display: flex; flex-direction: column; gap: var(--space-6-5); }
.recipe + .recipe { margin-top: var(--space-13); }
.note { font-size: var(--fs-caption); }

.resist { display: grid; grid-template-columns: 1fr auto; gap: var(--space-6-5) var(--space-10); }
.resist strong { font-weight: 400; color: var(--ink); }
.bar { grid-column: 1 / -1; position: relative; height: calc(13 * var(--u)); background: var(--bar-track); border-radius: var(--radius-chip); }
.bar::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--ink-body); }
.bar i { position: absolute; top: 0; bottom: 0; border-radius: var(--radius-chip); }

dl { display: grid; grid-template-columns: max-content 1fr; gap: var(--space-6-5) var(--space-20); margin: 0; }
dt { color: var(--ink-body); }
dd { margin: 0; min-width: 0; color: var(--ink); }
dd dl { padding-left: var(--space-10); border-left: 2px solid var(--bar-track); }

.layout { display: grid; grid-template-columns: minmax(300px, 34%) 1fr; gap: var(--space-39); align-items: start; }
#browser { position: sticky; top: var(--space-39); display: flex; flex-direction: column; gap: var(--space-13); max-height: calc(100vh - 100 * var(--u) - 2 * var(--space-39)); padding: var(--space-26); background: var(--night-ember); border-radius: var(--radius-panel); }
#filters { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-13); }
#q, #ingredient { grid-column: 1 / -1; }
#count { margin: 0; font-size: var(--fs-caption); color: var(--text-label); }
#list { margin: 0; padding: 0; list-style: none; overflow-y: auto; min-height: 0; }
#list li { display: flex; justify-content: space-between; gap: var(--space-13); padding: var(--space-10) var(--space-13); border-radius: var(--radius-row); color: var(--text-nav); font-weight: 700; cursor: pointer; }
#list li:hover { background: var(--night-raised); }
#list li.active { background: var(--control-track); color: var(--text-heading); }
#list li small { flex: none; align-self: center; font-weight: 400; font-size: var(--fs-slot-label); color: var(--text-paragraph); }
#list li.active small { color: var(--text-nav); }
#more { align-self: flex-start; }
.preview { display: flex; flex-wrap: wrap; gap: var(--space-13); }

@media (max-width: 800px) {
  .nav { padding: 0 var(--space-13); }
  .screen { padding: var(--space-13); }
  .layout { grid-template-columns: 1fr; gap: var(--space-26); }
  #browser { position: static; max-height: 70vh; }
}
