:root {
  color-scheme: dark;
  --bg: var(--sl-bg, #0b0e13);
  --panel: var(--sl-panel, #11151c);
  --paper: #f1eada;
  --muted: var(--sl-muted, #b7b1a4);
  --gold: #e1bd7e;
  --line: var(--sl-raised, #1a2029);
  --serif: Georgia, "Songti SC", "Noto Serif CJK SC", serif;
  --sans: "Avenir Next", "PingFang SC", system-ui, sans-serif;
  --head: 65px;
}
* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--paper);
  font: 14px/1.45 var(--sans);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
button,
select,
summary {
  cursor: pointer;
}
button {
  touch-action: manipulation;
}
a {
  color: var(--gold);
  text-underline-offset: 3px;
}
:where(button, input, select, summary, a):focus-visible {
  outline: 2px solid #ffe4a0;
  outline-offset: 3px;
}
h1,
h2,
h3,
h4,
p {
  margin-block-start: 0;
}
h1,
h2,
h3,
h4 {
  font-family: var(--serif);
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
[hidden] {
  display: none !important;
}
#site-header {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  min-height: var(--head);
  padding: 0 clamp(12px, 2vw, 34px);
  gap: clamp(18px, 3.2vw, 48px);
  background: var(--sl-bg, #0b0e13);
  border-bottom: 1px solid #746348;
}
.crest img {
  display: block;
  width: 153px;
  height: 54px;
  object-fit: contain;
}
.g-nav,
.g-langs {
  display: flex;
  align-self: stretch;
  align-items: stretch;
  gap: clamp(12px, 2.5vw, 38px);
}
.g-nav a,
.g-langs a,
.g-langs button {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--sl-muted, #b7b1a4);
  text-decoration: none;
  white-space: nowrap;
  font: 600 16px var(--serif);
}
.g-nav a.active {
  color: var(--gold);
}
.g-nav a.active::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gold);
  height: 2px;
}
.g-langs {
  margin-left: auto;
  gap: 8px;
}
.g-langs a {
  font: 600 12px var(--sans);
  padding: 0 6px;
}
.g-langs .active {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 5px;
}
.atlas-desk {
  display: grid;
  grid-template-columns: clamp(284px, 23.2vw, 355px) minmax(0, 1fr) clamp(
      228px,
      18.6vw,
      286px
    );
  min-height: 580px;
  height: calc(100dvh - var(--head));
  overflow: hidden;
}
#decision,
#supplies {
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--sl-line, #373940) transparent;
  min-width: 0;
}
#decision {
  border-right: 1px solid var(--line);
  background: linear-gradient(125deg, var(--sl-raised, #1a2029) 0%, var(--sl-panel, #11151c) 60%, var(--sl-panel, #11151c));
}
.map-work {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(220px, 1fr) auto;
  overflow: hidden;
  background: var(--sl-panel, #11151c);
}
#map-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  background: var(--sl-panel, #11151c);
  border-bottom: 1px solid var(--sl-line, #373940);
  min-height: 60px;
}
#map-head .g-map-title {
  min-width: 0;
  flex: 1;
}
.g-map-title h2 {
  margin: 0;
  font: 700 clamp(16px, 1.6vw, 23px)/1.25 var(--serif);
}
.g-map-title p {
  font-size: 11px;
  color: var(--muted);
  margin: 2px 0 0;
}
.g-origin {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  color: var(--muted);
  font-size: 12px;
}
.g-origin select {
  border: 1px solid var(--sl-line, #373940);
  background: var(--sl-panel, #11151c);
  color: #ede4d2;
  padding: 8px 6px;
  min-height: 38px;
  max-width: 165px;
  border-radius: 2px;
}
#map {
  min-width: 0;
  min-height: 0;
  height: 100%;
}
#advice {
  border-top: 1px solid #6b6048;
  max-height: min(38dvh, 320px);
  overflow: auto;
  scrollbar-width: thin;
  background: linear-gradient(140deg, var(--sl-raised, #1a2029), var(--sl-panel, #11151c));
  color: var(--paper);
}
#supplies {
  background: var(--sl-panel, #11151c);
  border-left: 1px solid var(--line);
}
.g-supply-head {
  padding: 22px 16px 15px;
  border-bottom: 1px solid var(--line);
}
.g-supply-head h2 {
  font: 700 23px var(--serif);
  margin: 0 0 14px;
}
.g-switch {
  display: flex;
  background: var(--sl-bg, #0b0e13);
  border: 1px solid var(--line);
  padding: 2px;
  gap: 2px;
}
.g-switch button {
  flex: 1;
  min-height: 33px;
  background: none;
  border: 0;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.g-switch button[aria-pressed="true"] {
  background: var(--sl-raised, #1a2029);
  color: var(--paper);
}
.g-count {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  align-items: center;
  margin: 13px 0 6px;
  color: var(--muted);
  font-size: 12px;
}
.g-count strong {
  color: var(--paper);
  font-variant-numeric: tabular-nums;
}
.g-progress {
  height: 2px;
  background: var(--sl-raised, #1a2029);
}
.g-progress i {
  display: block;
  height: 100%;
  background: var(--gold);
}
.g-items {
  padding: 5px 8px;
}
.g-item {
  width: 100%;
  padding: 8px 7px;
  min-height: 58px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-bottom-color: var(--sl-raised, #1a2029);
  border-radius: 2px;
  background: transparent;
  text-align: left;
}
.g-item:hover {
  background: var(--sl-raised, #1a2029);
}
.g-item[aria-pressed="true"] {
  background: linear-gradient(100deg, #413b25, var(--sl-raised, #1a2029));
  border-color: #8b7751;
}
.g-item img {
  display: block;
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px var(--sl-bg, #0b0e13));
}
.g-item strong,
.g-item small {
  display: block;
  overflow-wrap: anywhere;
}
.g-item strong {
  font-size: 14px;
  font-weight: 650;
  line-height: 1.24;
}
.g-item small {
  margin-top: 4px;
  font-size: 11px;
  color: #b9b6a1;
}
.g-item .quantity {
  color: var(--gold);
  white-space: nowrap;
  font: 600 12px var(--sans);
  font-variant-numeric: tabular-nums;
}
.g-item .quantity.done {
  color: var(--sl-muted, #b7b1a4);
}
.g-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  background: var(--sl-raised, #1a2029);
  font: 18px var(--serif);
  color: var(--gold);
}
.g-base-note {
  margin: 10px 14px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}
.g-zero {
  padding: 30px 16px;
  color: var(--muted);
}
#undo {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sl-raised, #1a2029);
  border: 1px solid #968154;
  color: #fbefd7;
  padding: 10px 15px;
  box-shadow: 0 5px 25px #0009;
  font-size: 13px;
}
#undo button {
  background: transparent;
  border: 0;
  color: var(--gold);
  font-weight: 700;
  min-height: 34px;
}
.g-quiet {
  padding: 21px;
}
.g-quiet h2 {
  margin: 0 0 6px;
}
@media (min-width: 1520px) {
  .atlas-desk {
    grid-template-columns: 355px minmax(0, 1fr) 286px;
  }
}
@media (max-width: 1090px) and (min-width: 761px) {
  .atlas-desk {
    grid-template-columns: 260px minmax(0, 1fr) 200px;
  }
  .g-origin {
    display: block;
  }
  .g-origin span {
    display: none;
  }
  .g-origin select {
    max-width: 125px;
  }
  .g-item {
    grid-template-columns: 32px minmax(0, 1fr) auto;
    gap: 5px;
  }
  .g-item img {
    width: 32px;
    height: 32px;
  }
  .g-supply-head {
    padding: 16px 10px;
  }
  .g-item strong {
    font-size: 12px;
  }
}
@media (max-width: 760px) {
  :root {
    --head: 54px;
  }
  .crest img {
    width: 92px;
    height: 44px;
  }
  #site-header {
    gap: 14px;
    padding: 0 12px;
  }
  .g-nav {
    gap: 12px;
  }
  .g-nav a {
    font-size: 13px;
  }
  .g-nav a.g-extra {
    display: none;
  }
  .g-langs {
    gap: 0;
  }
  .g-langs a {
    padding: 0 5px;
    font-size: 11px;
  }
  .atlas-desk {
    display: flex;
    flex-direction: column;
    overflow: visible;
    height: auto;
    min-height: 0;
  }
  #decision {
    order: 0;
    border-right: 0;
    overflow: visible;
  }
  #supplies {
    order: 1;
    border: 0;
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .map-work {
    order: 2;
    display: flex;
    flex-direction: column;
    overflow: visible;
  }
  .g-supply-head {
    padding: 10px 14px 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 0;
  }
  .g-supply-head h2 {
    font-size: 16px;
    margin: 0;
    flex: 1;
  }
  .g-switch button {
    min-height: 31px;
    padding: 0 10px;
  }
  .g-count,
  .g-progress,
  .g-base-note {
    display: none;
  }
  .g-items {
    display: flex;
    overflow-x: auto;
    padding: 5px 12px 10px;
    gap: 6px;
    scrollbar-width: thin;
  }
  .g-item {
    width: fit-content;
    min-width: 98px;
    min-height: 55px;
    grid-template-columns: 28px minmax(0, 1fr);
    padding: 5px;
    gap: 0 5px;
    border: 1px solid var(--sl-raised, #1a2029);
    flex: none;
  }
  .g-item img,
  .g-symbol {
    width: 28px;
    height: 28px;
    grid-row: span 2;
  }
  .g-item strong {
    font-size: 12px;
  }
  .g-item small {
    display: none;
  }
  .g-item .quantity {
    grid-column: 2;
  }
  #map-head {
    padding: 8px 12px;
    min-height: 48px;
    gap: 6px;
  }
  .g-origin {
    gap: 4px;
  }
  .g-origin select {
    max-width: 118px;
  }
  .g-origin span {
    display: none;
  }
  .g-map-title h2 {
    font-size: 17px;
  }
  #map {
    height: clamp(275px, 39svh, 370px);
    min-height: 250px;
  }
  #advice {
    max-height: none;
    overflow: visible;
  }
  #undo {
    width: max-content;
    max-width: 92vw;
    bottom: 10px;
  }
  .g-zero {
    padding: 10px 14px;
  }
}
@media (max-width: 355px) {
  #site-header {
    gap: 9px;
    padding: 0 6px;
  }
  .g-nav {
    gap: 8px;
  }
  .g-nav a {
    font-size: 12px;
  }
  .crest img {
    width: 75px;
  }
  .g-origin select {
    max-width: 105px;
  }
}
#field-detail {
  overflow: auto;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 22px 18px;
  background: radial-gradient(
    ellipse at 50% 35%,
    var(--sl-line, #373940) 0,
    var(--sl-raised, #1a2029) 35%,
    var(--sl-panel, #11151c) 72%,
    var(--sl-panel, #11151c) 100%
  );
  border-top: 1px solid var(--sl-line, #373940);
}
.g-dossier {
  text-align: center;
  max-width: 520px;
}
.g-specimen {
  width: clamp(85px, 15vh, 170px);
  height: clamp(85px, 15vh, 170px);
  object-fit: contain;
  filter: drop-shadow(0 14px 16px #0b0e13b0);
}
.g-dossier-kicker {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  margin: 6px 0;
}
.g-dossier h2 {
  font-size: clamp(25px, 3vw, 43px);
  margin: 0 0 8px;
}
.g-dossier p {
  margin: 5px 0;
  color: var(--sl-text, #ede4cf);
}
.g-craft-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 14px;
}
.g-craft-line span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}
.g-craft-line img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}
.g-craft-line em {
  color: var(--gold);
  font-style: normal;
}
@media (max-width: 760px) {
  #field-detail {
    min-height: 205px;
    padding: 15px;
  }
  .g-specimen {
    height: 65px;
    width: 65px;
  }
  .g-dossier h2 {
    font-size: 22px;
  }
  .g-dossier p {
    font-size: 12px;
  }
}
.craft-board {
  width: min(100%, 530px);
  margin: auto;
  text-align: left;
}
.craft-board header {
  display: flex;
  align-items: center;
  gap: 14px;
}
.craft-board header img {
  height: 72px;
  width: 72px;
  object-fit: contain;
  filter: drop-shadow(0 8px 9px var(--sl-bg, #0b0e13));
}
.craft-board header span {
  font-size: 12px;
  color: var(--gold);
  font-weight: 600;
}
.craft-board h2 {
  font: 600 clamp(20px, 2.3vw, 33px)/1.22 var(--serif);
  margin: 4px 0;
}
.craft-board > p {
  margin: 14px 0;
  color: var(--paper);
  line-height: 1.6;
}
.station-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--sl-line, #373940);
  border-bottom: 1px solid var(--sl-line, #373940);
  padding: 10px 0;
  font-size: 13px;
}
.station-line select {
  background: var(--sl-raised, #1a2029);
  border: 1px solid var(--sl-line, #373940);
  border-radius: 3px;
  padding: 7px 10px;
  min-height: 38px;
  max-width: 52%;
}
.mat-entry {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--sl-line, #373940);
}
.mat-entry img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.mat-entry b,
.mat-entry small {
  display: block;
}
.mat-entry small {
  font-size: 12px;
  color: var(--muted);
}
.mat-entry strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.short {
  color: #eac187;
}
.enough {
  color: var(--sl-muted, #b7b1a4);
}
.g-do,
.g-next {
  color: var(--paper);
  background: var(--sl-raised, #1a2029);
  border: 1px solid var(--sl-line, #373940);
  border-radius: 2px;
  min-height: 40px;
  padding: 6px 12px;
  font-weight: 600;
}
.g-do {
  margin-top: 14px;
}
.g-next {
  margin: 12px 12px 0;
}
.field-status {
  font-size: 19px;
  margin: 0;
}
@media (max-width: 760px) {
  .craft-board header img {
    width: 50px;
    height: 50px;
  }
  .craft-board > p {
    font-size: 13px;
    margin: 9px 0;
  }
  .station-line {
    font-size: 12px;
  }
  .craft-board h2 {
    font-size: 22px;
  }
}
.mat-entry {
  grid-template-columns: 36px minmax(0, 1fr) auto minmax(46px, auto);
}
.mat-entry > strong {
  text-align: right;
}
.g-owned-input {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}
.g-owned-input input {
  width: 65px;
  min-height: 37px;
  border: 1px solid var(--sl-line, #373940);
  background: var(--sl-panel, #11151c);
  padding: 4px 6px;
  border-radius: 2px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 930px) {
  .g-owned-input {
    flex-direction: column;
    gap: 1px;
    font-size: 10px;
  }
  .g-owned-input input {
    width: 52px;
  }
  .mat-entry {
    gap: 6px;
    grid-template-columns: 28px minmax(0, 1fr) auto minmax(42px, auto);
  }
  .mat-entry img {
    width: 28px;
    height: 28px;
  }
}
@media (max-width: 520px) {
  #site-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "wordmark locales" "links links";
    gap: 0;
    padding: 0 10px;
  }
  #site-header .crest {
    grid-area: wordmark;
    width: max-content;
  }
  .crest img {
    width: 117px;
    height: 40px;
  }
  .g-langs {
    grid-area: locales;
  }
  .g-langs a {
    min-width: 32px;
    justify-content: center;
  }
  .g-nav {
    grid-area: links;
    display: flex;
    justify-content: space-between;
    gap: 5px;
    border-top: 1px solid var(--sl-raised, #1a2029);
  }
  .g-nav a,
  .g-nav a.g-extra {
    display: flex;
    min-height: 40px;
    font-size: 12px;
    padding: 0 2px;
  }
}
.nav-short {
  display: none;
}
@media (max-width: 400px) {
  .nav-wide {
    display: none;
  }
  .nav-short {
    display: inline;
  }
}
.hunt-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
}

@media(max-width:1100px) and (min-width:521px){.g-nav a.quest-nav{display:flex;font-size:12px}.g-nav{gap:8px}#site-header{gap:8px}}
@media(max-width:520px){.g-nav a.quest-nav{display:flex}.g-nav a,.g-nav a.g-extra{font-size:11px;padding-inline:1px}}
