:root {
  color-scheme: dark;
  --ink: #f2eee3;
  --muted: #b2b7ac;
  --subtle: #858f83;
  --gold: #e5c98a;
  --bg: #181e1c;
  --top: #131916;
  --panel: #202823;
  --hover: #29352d;
  --edge: #3c473d;
  --focus: #f7dca1;
  font-family: "Instrument Sans", "Segoe UI", "Malgun Gothic", "Yu Gothic UI", "Microsoft YaHei UI", sans-serif;
  font-size: 15px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
button, input, select { font: inherit; }
button, select { color: inherit; cursor: pointer; }
button { border: 0; background: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, .stage:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}
a { color: inherit; }
[hidden] { display: none !important; }
.top {
  min-height: 64px; display: grid; grid-template-columns: 242px 1fr auto; align-items: stretch;
  padding: 0 24px; background: var(--top); border-bottom: 1px solid var(--edge);
}
.brand {
  display: flex; width: max-content; align-items: center; gap: 12px; padding: 0 2px;
  text-decoration: none; font-family: Georgia, "Baskervville", serif; font-size: 20px;
  letter-spacing: .14em; color: var(--gold);
}
.brand-icon { width: 20px; height: 20px; border: 1px solid #e5c98aab; transform: rotate(45deg); display: grid; place-items: center; }
.brand-icon::before { content: ""; display: block; width: 8px; height: 8px; background: var(--gold); }
#tabs { display: flex; min-width: 0; gap: 6px; }
#tabs button { padding: 0 17px; color: var(--muted); border-bottom: 2px solid transparent; text-align: center; }
#tabs button:hover { color: var(--ink); background: #ffffff08; }
#tabs button[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); background: #e5c98a0b; }
.top-right { display: flex; align-items: center; min-width: 0; gap: 17px; }
#guideHome { font-size: .79rem; text-decoration: none; color: var(--muted); white-space: nowrap; }
#guideHome:hover { color: var(--gold); }
#language, .filters-select {
  max-width: 100%; background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; padding: 7px 9px;
}
#workspace { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100dvh - 64px); min-height: 260px; }
#workspace[data-tab="recipes"] { grid-template-columns: minmax(320px, 38%) minmax(0, 1fr); }
.rail { overflow: hidden; min-height: 0; display: flex; flex-direction: column; border-right: 1px solid var(--edge); }
.rail-head { padding: 24px 21px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.52rem; letter-spacing: -.04em; font-weight: 650; }
#toggleRail { display: none; }
#railBody { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.search-wrap {
  margin: 0 20px; display: flex; align-items: center; position: relative; border: 1px solid var(--edge);
  background: #141b17; border-radius: 7px; flex: 0 0 auto;
}
.search-wrap:focus-within { border-color: var(--gold); }
.search-wrap input { color: var(--ink); flex: 1; width: 100%; border: 0; outline: 0; background: transparent; padding: 11px 33px 11px 34px; }
.search-wrap input::placeholder { color: var(--subtle); }
.search-icon { width: 11px; height: 11px; border-radius: 50%; border: 1.5px solid var(--muted); position: absolute; left: 13px; }
.search-icon::after { content: ""; width: 5px; height: 1.5px; background: var(--muted); position: absolute; transform: rotate(45deg); right: -4px; bottom: -2px; }
kbd { position: absolute; right: 10px; color: var(--subtle); border: 1px solid var(--edge); border-radius: 3px; padding: 0 4px; pointer-events: none; }
#filters { padding: 18px 20px 12px; }
#filters:empty { display: none; }
.filter-label { color: var(--muted); font-size: .8rem; display: block; margin-bottom: 8px; }
.layer-set { display: flex; flex-wrap: wrap; gap: 6px; }
.layer {
  display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--edge);
  padding: 5px 8px; border-radius: 5px; color: var(--muted); font-size: .79rem; min-height: 32px;
}
.layer[aria-pressed="true"] { background: var(--hover); color: var(--ink); border-color: #657365; }
.layer[aria-pressed="false"] .symbol { opacity: .55; }
.filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.filter-row label { color: var(--muted); font-size: .79rem; display: grid; gap: 6px; }
.gather-filter { grid-template-columns: minmax(0, 1fr); margin-top: 9px; }
.filters-select { width: 100%; font-size: .88rem; }
.check { margin-top: 12px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: .81rem; }
input[type="checkbox"] { accent-color: var(--gold); }
#resultSummary { color: var(--muted); padding: 8px 21px; font-size: .8rem; border-bottom: 1px solid var(--edge); }
#results { flex: 1; overflow: auto; min-height: 0; scrollbar-color: #667569 transparent; }
.section-label { padding: 15px 20px 6px; color: var(--muted); font-size: .77rem; font-weight: 600; }
.row {
  display: grid; grid-template-columns: 35px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  width: 100%; min-height: 52px; padding: 7px 18px 7px 19px; text-align: start;
  border-bottom: 1px solid #303b32; border-left: 2px solid transparent;
}
.row:hover { background: var(--hover); }
.row[aria-current="true"] { background: #303e34; border-left-color: var(--gold); }
.row strong { display: block; color: var(--ink); font-weight: 600; font-size: .9rem; overflow-wrap: anywhere; }
.row small { color: var(--muted); font-size: .75rem; display: block; margin-top: 3px; line-height: 1.3; }
.row-end { color: var(--subtle); }
.symbol {
  --color: #d8b9ef; display: inline-grid; place-items: center; flex-shrink: 0; width: 26px; height: 26px;
  background: #131a17; color: var(--color); border: 1px solid color-mix(in srgb, var(--color) 55%, #1f2c25);
  border-radius: 6px; font-size: 17px; line-height: 1; font-weight: 700;
}
.symbol[data-kind="dungeon"] { --color: #f1c994; }
.symbol[data-kind="tower"] { --color: #90e1dc; }
.symbol[data-kind="material"] { --color: #cde68b; }
.symbol[data-kind="harvest"] { --color: #8cd5a6; }
.symbol[data-kind="questStart"] { --color: #73e0e0; }
.symbol[data-kind="questGuide"] { --color: #8cddff; }
.detail-actions button[aria-pressed="true"] { border-color: #73e0e0; color: #a4f3ee; }
.symbol[data-kind="portal"] { --color: #b2c8fa; }
.symbol[data-kind="checkpoint"] { --color: #92d4aa; }
.symbol[data-kind="item"] { --color: #e3c987; }
.layer .symbol { width: 18px; height: 18px; font-size: 12px; border-radius: 3px; }
.sprite {
  display: inline-block; flex-shrink: 0; width: 34px; height: 34px; background-size: 816px 816px;
  background-position: calc(var(--sx) * -34px) calc(var(--sy) * -34px); background-repeat: no-repeat;
}
.paging { padding: 8px 12px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--edge); color: var(--muted); }
.quiet, .chip {
  border: 1px solid var(--edge); background: var(--panel); color: var(--ink); border-radius: 5px; padding: 6px 10px; font-size: .81rem;
}
.quiet:hover, .chip:hover { background: var(--hover); }
.quiet:disabled { opacity: .42; cursor: default; }
.atlas { display: grid; grid-template-rows: minmax(0, 1fr) auto; min-height: 0; min-width: 0; position: relative; }
.atlas.is-expanded { position: fixed; inset: 0; z-index: 10; }
.stage { overflow: hidden; position: relative; isolation: isolate; background: #265e62; touch-action: none; cursor: grab; }
.stage.drag { cursor: grabbing; }
.world { position: absolute; display: block; max-width: none; pointer-events: none; user-select: none; transform-origin: 0 0; }
.markers, .ranges { position: absolute; inset: 0; pointer-events: none; }
.range { position: absolute; border-radius: 50%; border: 1px solid #e9d1ff; background: #b47ed74a; }
.pin, .cluster {
  display: flex; align-items: center; position: absolute; transform: translate(-50%, -50%);
  pointer-events: auto; min-height: 29px; padding: 0; cursor: pointer;
}
.pin .symbol { box-shadow: 0 2px 9px #0a1718c7; }
.pin .sprite { border: 1px solid #cde68ba1; border-radius: 6px; background-color: #172219; box-shadow: 0 2px 9px #0a1718c7; }
.pin.is-active { z-index: 4; }
.pin.is-active .symbol, .pin.is-active .sprite { outline: 2px solid #fff4cf; outline-offset: 2px; }
.pin .pin-name {
  display: none; left: calc(100% + 5px); position: absolute; white-space: nowrap;
  color: #faf6e7; font-size: .76rem; background: #101713ed; border: 1px solid #a9b49566;
  padding: 4px 7px; border-radius: 4px; pointer-events: none;
}
.pin:hover, .pin:focus-visible { z-index: 5; }
.pin:hover .pin-name, .pin:focus-visible .pin-name, .pin.is-active .pin-name, .pin.with-label .pin-name { display: block; }
.cluster {
  border: 1px solid #dcebb5; min-width: 31px; justify-content: center; padding: 0 6px; border-radius: 50%;
  background: #20372d; color: #edf8d8; font-size: .78rem; box-shadow: 0 2px 9px #101713ab;
}
.compass {
  position: absolute; right: 19px; top: 19px; display: grid; justify-items: center;
  width: 41px; height: 55px; background: #141e1bdc; border: 1px solid #c0d9bf66; border-radius: 7px; pointer-events: none;
}
.compass b { margin-top: 5px; font-size: .75rem; color: #f7e7bc; }
.compass i { margin-bottom: 8px; width: 12px; height: 20px; clip-path: polygon(50% 0,100% 100%,50% 72%,0 100%); background: #f0dbad; }
.map-controls { position: absolute; right: 19px; bottom: 20px; display: grid; gap: 5px; }
.map-controls button {
  min-width: 41px; min-height: 41px; background: #151f1de8; color: #fff4d4;
  border: 1px solid #c0d9bf66; border-radius: 6px; font-size: 21px; line-height: 1;
}
.map-controls button:hover { background: #314037; }
.scale { position: absolute; left: 17px; bottom: 17px; white-space: nowrap; border-bottom: 2px solid #fff4d4; color: #fff4d4; text-shadow: 0 1px 3px #000; font-size: .75rem; padding-bottom: 3px; pointer-events: none; }
.map-footer { background: var(--top); border-top: 1px solid var(--edge); color: var(--muted); padding: 6px 12px 6px 15px; font-size: .77rem; display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.map-detail {
  position: absolute; z-index: 6; left: 17px; top: 17px; max-height: calc(100% - 125px); overflow: auto;
  width: min(360px, calc(100% - 84px)); background: #19221ff5; box-shadow: 0 6px 22px #0c171989;
  border: 1px solid #657269; border-radius: 9px; padding: 16px;
}
.detail-heading { display: flex; align-items: start; gap: 9px; margin-bottom: 9px; }
.detail-heading h2 { flex: 1; min-width: 0; overflow-wrap: anywhere; font-size: 1.14rem; }
.dismiss { padding: 2px 6px; font-size: 1.15rem; color: var(--muted); }
.detail-content { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.detail-content p + p, .detail-content p + .data-row, .detail-content .data-row + p { margin-top: 8px; }
.data-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-top: 1px solid #465246; font-variant-numeric: tabular-nums; }
.data-row strong { color: var(--ink); font-weight: 600; text-align: end; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.recipe-detail { overflow: auto; min-width: 0; padding: clamp(22px, 4vw, 62px); align-content: start; background: #202923; }
.recipe-sheet { max-width: 710px; margin: 0 auto; }
.recipe-title { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.recipe-title h2 { font-size: clamp(1.4rem, 3.4vw, 2.5rem); overflow-wrap: anywhere; }
.recipe-title .sprite { scale: 1.17; margin: 4px; }
.recipe-sheet h3 { font-size: .97rem; margin: 21px 0 8px; }
.recipe-sheet .data-row { padding: 11px 0; margin: 0; }
.ingredients { border-top: 1px solid var(--edge); }
.ingredient {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: start; min-height: 53px;
  border-bottom: 1px solid var(--edge); padding: 6px 4px; color: var(--ink);
}
button.ingredient:hover { background: var(--hover); }
.ingredient > span:nth-child(2) { flex: 1; }
.ingredient b { font-weight: 650; white-space: nowrap; color: var(--gold); }
.empty { color: var(--muted); padding: 18px 20px; line-height: 1.5; }
.recipe-sheet .empty { padding-left: 0; }
.recipe-mobile-back { display: none; }
@media (max-width: 900px) {
  .top { grid-template-columns: 190px 1fr auto; padding: 0 13px; }
  #workspace { grid-template-columns: 275px minmax(0, 1fr); }
  .top-right { gap: 8px; }
  #guideHome { font-size: .73rem; }
  #tabs button { padding: 0 11px; }
}
@media (max-width: 680px) {
  .top { min-height: 99px; grid-template-columns: 1fr auto; grid-template-rows: 53px 46px; padding: 0 12px; }
  .brand { font-size: 16px; gap: 9px; }
  .brand-icon { width: 15px; height: 15px; }
  .brand-icon::before { width: 6px; height: 6px; }
  #tabs { grid-column: 1 / -1; grid-row: 2; }
  #tabs button { flex: 1; padding: 0 4px; }
  .top-right { grid-column: 2; grid-row: 1; gap: 8px; }
  #guideHome { font-size: .67rem; }
  #language { font-size: .78rem; padding: 5px 2px; }
  #workspace { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 1fr) auto; height: calc(100dvh - 100px); min-height: 320px; }
  .atlas { grid-row: 1; }
  .rail { grid-row: 2; max-height: min(40dvh, 325px); border-right: 0; border-top: 1px solid var(--edge); }
  .rail-head { padding: 8px 12px; }
  h1 { font-size: 1.13rem; }
  #toggleRail { display: block; }
  .rail.folded #railBody { display: none; }
  .search-wrap { margin: 0 12px; }
  .search-wrap input { padding-top: 8px; padding-bottom: 8px; }
  #filters { padding: 8px 12px 5px; }
  .filter-label { margin-bottom: 4px; }
  #resultSummary { padding: 5px 12px; }
  .row { min-height: 46px; padding-left: 12px; }
  .map-detail { left: 9px; top: 9px; padding: 10px; max-height: calc(100% - 55px); width: min(370px, calc(100% - 66px)); }
  .compass, .map-controls { right: 9px; }
  .compass { top: 9px; }
  .map-controls { bottom: 10px; }
  .map-controls button { min-width: 39px; min-height: 39px; }
  .scale { left: 10px; bottom: 8px; }
  .map-footer { padding: 4px 8px; }
  #workspace[data-tab="recipes"] { grid-template-columns: 1fr; grid-template-rows: 1fr; }
  #workspace[data-tab="recipes"] .rail { grid-row: 1; max-height: none; }
  #workspace[data-tab="recipes"] #toggleRail { display: none; }
  #workspace[data-tab="recipes"] .rail #railBody { display: flex; }
  #workspace[data-tab="recipes"][data-recipe-selected="true"] .rail { display: none; }
  .recipe-detail { grid-row: 1; }
  .recipe-mobile-back { display: inline-block; margin-bottom: 14px; }
}

:root { --afgg-consent-height: 0px; }
#workspace { height: calc(100dvh - 64px - var(--afgg-consent-height)); }
main .stage .world { image-rendering: auto; }
.craft-about { color: var(--ink, #eee); background: #19201e; padding: 22px max(16px, calc((100% - 1020px)/2)); line-height: 1.6; }
.craft-about h2 { margin: 0 0 10px; font-size: 1.2rem; }
.craft-about p { margin: 0 0 10px; }
.craft-about a { color: #e8ce92; }
.craft-about nav { display: flex; flex-wrap: wrap; gap: 12px; }
