:root {
  color-scheme: dark;
  --ink: #eee6d5;
  --muted: #bcbaae;
  --background: #11141d;
  --surface: #1b1d27;
  --well: #151822;
  --line: #524638;
  --gold: #e5bd7d;
  --bronze: #a17740;
  --heading: 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  font: 16px/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; }
main, .mast-inner, footer > div { width: min(100% - 3rem, 81rem); margin-inline: auto; }
main { flex: 1; min-width: 0; padding-bottom: 4rem; }
a { color: var(--gold); text-underline-offset: .18em; }
.masthead { background: #0e1018; border-bottom: 1px solid var(--line); margin-bottom: 1.15rem; }
.mast-inner { display: flex; justify-content: space-between; gap: 1.25rem; align-items: center; padding-block: .75rem; }
.brand { display: inline-flex; gap: .65rem; align-items: center; color: var(--gold); font: 700 1.05rem/1.25 var(--heading); text-decoration: none; }
.brand img { flex: none; }
.market-select { display: flex; align-items: center; gap: .75rem; }
label { display: grid; gap: .35rem; color: var(--muted); font-size: .83rem; font-weight: 650; }
input, select, button { font: inherit; }
input:not([type=checkbox]), select, button {
  min-height: 2.75rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .52rem .7rem;
  color: var(--ink);
  background: var(--well);
}
input::placeholder { color: #aaa796; }
input[type=checkbox] { accent-color: var(--gold); }
button { cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--bronze); }
button:disabled { cursor: default; opacity: .58; }
:focus-visible { outline: 2px solid #f4d194; outline-offset: 3px; }

.hero {
  position: relative;
  display: grid;
  align-items: center;
  isolation: isolate;
  min-height: clamp(13rem, 24vw, 20rem);
  overflow: hidden;
  border: 1px solid var(--bronze);
  border-radius: 6px;
  background: #232837;
}
.hero picture, .hero::after { position: absolute; inset: 0; }
.hero picture { z-index: -2; }
.hero-art { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 60% 51%; }
.hero::after {
  content: '';
  z-index: -1;
  background: linear-gradient(95deg, #0b101bea 3%, #101625bf 34%, #11152248 61%, transparent 83%);
}
.hero-copy { padding: clamp(1.4rem, 5vw, 4rem); max-width: 38rem; }
h1, h2, h3 { margin: 0; font-family: var(--heading); line-height: 1.12; }
.hero h1 { color: #ffdc97; font-size: clamp(2.55rem, 5.8vw, 5.3rem); letter-spacing: -.045em; text-shadow: 0 2px 6px #09090d; }
.hero p { max-width: 28rem; margin: .65rem 0 0; color: #f5ead7; font-size: clamp(.93rem, 2vw, 1.12rem); }

.activity-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; margin-block: .75rem .95rem; }
.activity-links button {
  display: grid;
  align-items: end;
  justify-items: start;
  min-width: 0;
  min-height: 7rem;
  padding: .65rem .9rem;
  border-color: var(--bronze);
  color: #ffdfa8;
  text-shadow: 0 2px 4px #08080c;
  font: 700 clamp(1.05rem, 2.25vw, 1.55rem)/1.1 var(--heading);
  background-color: #292634;
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center 52%;
}
.activity-farming { background-image: linear-gradient(0deg, #0c0a09e8 0%, #0f101037 50%, transparent), url('/art/farming.webp'); }
.activity-gathering { background-image: linear-gradient(0deg, #0c0a09e8 0%, #0f101037 50%, transparent), url('/art/gathering.webp'); }
.activity-crafting { background-image: linear-gradient(0deg, #0c0a09e8 0%, #0f101037 50%, transparent), url('/art/crafting.webp'); }
.activity-links button:hover, .activity-links button[aria-current] { border-color: #ffdfa8; }
.activity-links button[aria-current] span { text-decoration: underline; text-underline-offset: .25em; }
.market-tabs { display: flex; gap: .35rem 1.65rem; border-bottom: 1px solid var(--line); }
.market-tabs button { border: 0; border-radius: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-size: .94rem; font-weight: 650; }
.market-tabs button:hover, .market-tabs button[aria-current] { color: var(--gold); border-bottom-color: var(--gold); }

.heading { display: flex; justify-content: space-between; align-items: end; gap: 1.2rem; padding-block: 1.45rem 1rem; }
.heading h2 { font-size: clamp(1.85rem, 3.75vw, 2.85rem); color: var(--gold); }
.heading p { color: var(--muted); margin: .42rem 0 0; }
.market-status { flex: 0 1 24rem; text-align: end; }
#freshness { font-size: .8rem; font-variant-numeric: tabular-nums; }
.market-status button { margin-top: .45rem; font-size: .79rem; }

#filters { display: flex; flex-wrap: wrap; align-items: end; gap: .7rem 1rem; padding: .95rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: 4px; }
#filters[hidden] { display: none; }
#filters > label { min-width: 8rem; flex: 0 1 auto; }
#filters > label:first-child { flex: 2 1 15rem; }
#filters input[type=number] { width: 8rem; }
#filters .checkbox { display: flex; gap: .45rem; align-items: center; min-height: 2.75rem; }
#filters button { font-weight: 700; color: #21170e; background: #d9b274; border-color: #d9b274; }
#filters button:hover { background: #ebc68c; }
#status { margin: 1rem 0 .5rem; color: var(--muted); min-height: 1.4rem; }
.weekly-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.report-section { margin-block: 1rem 1.5rem; min-width: 0; }
.report-section h2, .report-section h3 { color: var(--gold); margin: 0 0 .45rem; }
.report-section p { margin: 0 0 .65rem; color: var(--muted); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); background: var(--surface); border-radius: 4px; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; text-align: left; }
th, td { padding: .46rem .85rem; border-bottom: 1px solid #39343a; }
thead th { background: #252530; font-size: .81rem; color: #dfc49b; white-space: nowrap; }
tbody tr:nth-child(even) { background: #1e202b; }
tbody tr:hover { background: #272630; }
tbody tr:last-child td { border-bottom: 0; }
td:first-child { min-width: 11rem; }
td:not(:first-child) { white-space: nowrap; }
.link-button {
  display: inline-flex;
  align-items: center;
  gap: .57rem;
  border: 0;
  background: none;
  padding: 0 .2rem 0 0;
  min-height: 2.75rem;
  color: var(--gold);
  text-align: left;
  font-weight: 650;
}
.link-button:hover span, .link-button:hover { text-decoration: underline; text-underline-offset: .2em; }
.item-icon {
  width: 1.9rem;
  height: 1.9rem;
  flex: none;
  object-fit: cover;
  border: 1px solid var(--icon-line, #958365);
  border-radius: 4px;
  background: var(--well);
}
.item-icon[hidden] { display: none; }
.item-icon[data-quality=UNCOMMON] { --icon-line: #81bc69; }
.item-icon[data-quality=RARE] { --icon-line: #80b3f0; }
.item-icon[data-quality=EPIC] { --icon-line: #c28cf2; }
.item-icon[data-quality=LEGENDARY] { --icon-line: #edaa63; }
.secondary { display: block; color: var(--muted); font-size: .8rem; margin: 0 0 .2rem; }
.positive { color: #abd19b; font-weight: 650; }
.negative { color: #f3a091; }
#pagination { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-top: .75rem; }
#pagination[hidden] { display: none; }

dialog { color: var(--ink); background: var(--surface); border: 1px solid var(--bronze); border-radius: 6px; width: min(48rem, 100% - 1.5rem); max-height: 88vh; padding: 1.15rem; }
dialog::backdrop { background: #0b0c13c9; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .85rem; }
.dialog-head h2 { display: flex; align-items: center; gap: .65rem; color: var(--gold); }
.dialog-head .item-icon { width: 2.2rem; height: 2.2rem; }
.detail-choices { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: .9rem; }
.detail-choices button[aria-pressed=true] { border-color: var(--bronze); color: var(--gold); background: #332c2a; }
canvas { display: block; width: 100%; height: 12rem; margin-block: .75rem; }
.location-grid { width: min(100%, 22.5rem); height: auto; border: 1px solid var(--line); }
footer { background: #0e1018; border-top: 1px solid var(--line); }
footer > div { display: flex; flex-wrap: wrap; gap: .5rem 1.15rem; padding-block: 1rem; font-size: .85rem; }
footer small { flex-basis: 100%; color: var(--muted); }

@media (max-width: 54rem) {
  .heading { align-items: start; }
  .weekly-columns { grid-template-columns: 1fr; gap: 0; }
  th, td { padding-inline: .65rem; }
}
@media (max-width: 39rem) {
  main, .mast-inner, footer > div { width: min(100% - 1.4rem, 81rem); }
  .mast-inner, .heading { display: grid; }
  .mast-inner { gap: .45rem; }
  .masthead { margin-bottom: .7rem; }
  .market-select { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .55rem; }
  .market-select select { width: 100%; }
  .hero { align-items: end; min-height: 12rem; }
  .hero::after { background: linear-gradient(90deg, #0b101bcd, #10162555), linear-gradient(0deg, #0b101bdc, transparent 85%); }
  .hero-copy { padding: 1rem; }
  .hero p { max-width: 20rem; }
  .activity-links { gap: .39rem; margin-block: .5rem .45rem; }
  .activity-links button { padding: .45rem .32rem; min-height: 5.25rem; font-size: clamp(.85rem, 3.5vw, 1.12rem); }
  .market-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
  .market-tabs button { padding-inline: .2rem; font-size: clamp(.72rem, 3.2vw, .85rem); }
  .heading { gap: .35rem; padding-top: 1rem; }
  .market-status { text-align: start; }
  #filters > label { flex: 1 1 8rem; min-width: 0; }
  #filters > label:first-child { flex-basis: 100%; }
  #filters input[type=number] { width: 100%; }
  td:first-child { min-width: 9.5rem; }
}
