/* Azalea wiki — same tokens as changelog.html */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --bg: #080C0B;
  --panel: #0E1513;
  --text: #E4E8E6;
  --text-muted: rgba(228,232,230,0.55);
  --text-faint: rgba(228,232,230,0.35);
  --hairline: rgba(90,138,133,0.15);
  --accent: #5A8A85;
  --accent-bright: #7ab5b0;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Manrope', sans-serif;
}
body { background: var(--bg); color: var(--text); font-family: var(--sans); min-height: 100vh; line-height: 1.6; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-bright); }
:focus-visible { outline: 2px solid var(--accent-bright); outline-offset: 3px; border-radius: 3px; }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--accent); color: #06100E; padding: .6rem 1rem; z-index: 200; font-weight: 700; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* Nav */
.wk-nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 2rem; border-bottom: 1px solid var(--hairline); position: sticky; top: 0; background: rgba(8,12,11,.9); backdrop-filter: blur(10px); z-index: 100; }
.wk-logo img { height: 32px; width: auto; display: block; }
.wk-links { display: flex; gap: 1.5rem; font-family: var(--mono); font-size: .78rem; font-weight: 600; letter-spacing: .04em; }
.wk-links a { color: var(--text-muted); }
.wk-links a:hover { color: var(--text); }
.wk-proto { text-align: center; font-family: var(--mono); font-size: .7rem; letter-spacing: .12em; text-transform: uppercase; color: #d9b45a; background: rgba(217,180,90,.08); padding: .4rem 1rem; }

/* Layout */
.wk-main { max-width: 1080px; margin: 0 auto; padding: 2.5rem 2rem 6rem; }
.wk-crumbs { font-family: var(--mono); font-size: .72rem; color: var(--text-faint); margin-bottom: 1.5rem; }
.wk-crumbs span { margin: 0 .5rem; }
.wk-crumbs a { color: var(--text-muted); }
h1 { font-size: clamp(2rem, 5vw, 2.75rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-bottom: .75rem; }
h2 { font-size: 1.35rem; font-weight: 800; margin: 2.5rem 0 1rem; }
h3, h4 { font-size: 1.05rem; font-weight: 700; margin: 1.75rem 0 .5rem; }
.wk-label { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: .5rem; }
.wk-lede { color: var(--text-muted); font-size: 1.05rem; max-width: 62ch; margin-bottom: 1.5rem; }
.wk-btn { display: inline-block; font-family: var(--mono); font-size: .78rem; font-weight: 700; padding: .55rem 1rem; border: 1px solid var(--accent); border-radius: 6px; margin-bottom: 1.5rem; }
.wk-btn:hover { background: rgba(90,138,133,.12); }
code { font-family: var(--mono); font-size: .85em; background: var(--panel); padding: .1rem .35rem; border-radius: 4px; }

/* Hub */
.hub-search { display: block; padding: 1rem 1.25rem; border: 1px solid var(--hairline); border-radius: 10px; background: var(--panel); color: var(--text-muted); font-family: var(--mono); font-size: .9rem; }
.hub-search:hover { border-color: var(--accent); color: var(--text); }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .75rem; }
.tile { display: flex; flex-direction: column; gap: .2rem; padding: 1rem 1.1rem; border: 1px solid var(--hairline); border-radius: 10px; background: var(--panel); color: var(--text); }
.tile span { font-size: .8rem; color: var(--text-faint); }
.tile:hover { border-color: var(--accent); color: var(--text); }

/* Item database */
.db-controls { position: sticky; top: 73px; background: var(--bg); padding: .75rem 0; z-index: 5; }
#db-q { width: 100%; padding: .85rem 1rem; font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--hairline); border-radius: 10px; }
#db-q:focus { outline: none; border-color: var(--accent); }
.db-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .75rem; }
.db-chips button { font: 600 .75rem var(--mono); color: var(--text-muted); background: none; border: 1px solid var(--hairline); border-radius: 999px; padding: .35rem .8rem; cursor: pointer; }
.db-chips button:hover { color: var(--text); }
.db-chips button.on { color: #06100E; background: var(--accent-bright); border-color: var(--accent-bright); }
.db-count { font-family: var(--mono); font-size: .72rem; color: var(--text-faint); margin: .5rem 0 1rem; }
.db-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; }
.db-card { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 1px solid var(--hairline); border-radius: 10px; background: var(--panel); color: var(--text); }
.db-card:hover { border-color: var(--accent); color: var(--text); }
.db-ph { width: 100%; aspect-ratio: 4 / 3; display: grid; place-items: center; border-radius: 6px; background: radial-gradient(circle at 50% 40%, rgba(90,138,133,.22), transparent 70%); font-size: 2.2rem; font-weight: 800; color: var(--accent); margin-bottom: .4rem; }
.db-shot { display: block; overflow: hidden; border-radius: 6px; margin-bottom: .4rem; aspect-ratio: 1; background: var(--panel); }
.db-shot img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.db-card:hover .db-shot img { transform: scale(1.07); }
.db-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem; }
.db-cat { font-family: var(--mono); font-size: .65rem; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.db-badges { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.db-badge { font-family: var(--mono); font-size: .62rem; font-weight: 600; letter-spacing: .02em; padding: .1rem .35rem; border-radius: 4px; border: 1px solid var(--hairline); background: rgba(90,138,133,.12); color: var(--text-muted); }
.db-badge.tracer { color: #f28b82; background: rgba(242,139,130,.12); border-color: rgba(242,139,130,.3); }
.db-badge.ap { color: #f6c177; background: rgba(246,193,119,.12); border-color: rgba(246,193,119,.3); }
.db-badge.count { color: var(--text-faint); background: transparent; border-color: var(--hairline); }
.db-badge.tier { color: var(--accent-bright); border-color: rgba(122,181,176,.25); }
.db-desc { font-size: .85rem; color: var(--text-muted); line-height: 1.45; }
.db-empty { color: var(--text-muted); }

/* Item page */
.item { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 2.5rem; align-items: start; }
.item-img { aspect-ratio: 1; border: 1px solid var(--hairline); border-radius: 12px; display: grid; place-items: center; align-content: center; gap: .5rem; background: radial-gradient(circle at 50% 40%, rgba(90,138,133,.22), transparent 70%); }
.item-img span { font-size: 4rem; font-weight: 800; color: var(--accent); }
.item-img small { font-family: var(--mono); font-size: .7rem; color: var(--text-faint); }
.item-stage { position: relative; margin: 0; border: 1px solid var(--hairline); border-radius: 14px; overflow: hidden; background: var(--panel); }
.item-stage img { width: 100%; height: auto; display: block; transition: transform .25s ease-out; }
.item-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at var(--gx, 50%) var(--gy, 40%), rgba(255,255,255,.08), transparent 55%); }
.item-inspect { position: absolute; left: .75rem; bottom: .75rem; z-index: 1; font: 700 .72rem var(--mono); letter-spacing: .04em; color: var(--text); background: rgba(8,12,11,.75); border: 1px solid var(--hairline); border-radius: 6px; padding: .5rem .8rem; cursor: pointer; backdrop-filter: blur(6px); }
.item-inspect:hover { border-color: var(--accent-bright); }
.item-tag { font-size: 1.05rem; color: var(--text); background: var(--panel); border-left: 3px solid var(--accent-bright); padding: .8rem 1rem; border-radius: 0 8px 8px 0; margin: .5rem 0 1.5rem; max-width: 60ch; }
.shelf { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .6rem; }
.shelf-card { display: flex; flex-direction: column; gap: .3rem; min-width: 0; font-size: .72rem; color: var(--text-muted); }
.shelf-card img, .shelf-card .db-ph { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--hairline); margin: 0; font-size: 1.4rem; transition: border-color .2s; }
.shelf-card span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shelf-card:hover img { border-color: var(--accent); }
.shelf-card:hover { color: var(--text); }
.shot-view { margin: auto; padding: 0; border: 1px solid var(--hairline); border-radius: 10px; background: #000; max-width: min(96vw, 1720px); }
.shot-view::backdrop { background: rgba(0,0,0,.8); }
.shot-view img { display: block; width: 100%; height: auto; max-height: 92vh; object-fit: contain; }
.shot-close { position: absolute; top: .5rem; right: .75rem; font-size: 1.6rem; line-height: 1; color: #fff; background: none; border: 0; cursor: pointer; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; font-size: .9rem; margin-bottom: 1.25rem; }
.facts dt { font-family: var(--mono); font-size: .72rem; color: var(--text-faint); padding-top: .15rem; }
.related { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.related a { display: inline-block; padding: .4rem .8rem; border: 1px solid var(--hairline); border-radius: 999px; font-size: .85rem; }

/* Prose */
.prose { max-width: 70ch; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose aside, .prose figure { margin-bottom: 1rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .3rem; }
.prose img { max-width: 100%; height: auto; border-radius: 10px; display: block; }
.prose blockquote { border-left: 2px solid var(--accent); padding-left: 1rem; color: var(--text-muted); font-style: italic; }
.callout { border: 1px solid var(--hairline); border-left: 3px solid var(--accent-bright); background: var(--panel); padding: 1rem 1.2rem; border-radius: 8px; }
.callout-title { font-family: var(--mono); font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-bright); margin-bottom: .4rem; }
.prose hr { border: 0; border-top: 1px solid var(--hairline); margin: 2rem 0; }
.wl-missing { color: var(--text-muted); border-bottom: 1px dotted var(--text-faint); cursor: help; }

/* Places */
.atlas { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.atlas-map { position: sticky; top: 90px; aspect-ratio: 1; border: 1px solid var(--hairline); border-radius: 12px; background: var(--panel) url(/assets/map_02_4k.webp) center / cover; overflow: hidden; }
.pin { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent-bright); border: 2px solid #06100E; transition: transform .15s, opacity .2s; }
.pin.t1 { background: #9ec9a0; } .pin.t2 { background: #d9c27a; } .pin.t3 { background: #e0955a; } .pin.t4 { background: #d9645a; }
.pin span { position: absolute; left: 50%; bottom: 150%; transform: translateX(-50%); white-space: nowrap; font: 700 .7rem var(--mono); color: var(--text); background: rgba(8,12,11,.85); padding: .2rem .45rem; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.pin:hover, .pin.hot { transform: scale(1.6); z-index: 2; }
.pin:hover span, .pin.hot span, .pin:focus-visible span { opacity: 1; }
.pin.dim { opacity: .15; }
.dot { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: rgba(230,236,233,.45); border: 1px solid rgba(6,16,14,.7); }
.dot > span { position: absolute; left: 50%; bottom: 220%; transform: translateX(-50%); white-space: nowrap; font: 600 .66rem var(--mono); color: var(--text-muted); background: rgba(8,12,11,.85); padding: .15rem .4rem; border-radius: 4px; opacity: 0; pointer-events: none; transition: opacity .15s; }
.dot > span small { margin-left: .4em; opacity: .7; font-size: inherit; }
.dot:hover { background: var(--text); } .dot:hover > span { opacity: 1; z-index: 3; }
.where { margin-top: .9rem; font-size: .9rem; color: var(--text-muted); }
.loc-cards { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.loc-card { display: flex; flex-direction: column; gap: .2rem; padding: .7rem .9rem; border: 1px solid var(--hairline); border-radius: 8px; background: var(--panel); color: var(--text); }
.loc-card:hover, .loc-card.hot { border-color: var(--accent); color: var(--text); }
.loc-head { display: flex; justify-content: space-between; gap: .5rem; align-items: baseline; }
.tier { font: 700 .65rem var(--mono); font-style: normal; letter-spacing: .08em; color: var(--accent-bright); border: 1px solid var(--hairline); border-radius: 999px; padding: .05rem .45rem; }
.loc-teaser { font-size: .82rem; color: var(--text-muted); line-height: 1.45; }
.uncharted { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; }
.uncharted li { font-size: .8rem; color: var(--text-faint); border: 1px dashed var(--hairline); border-radius: 999px; padding: .3rem .75rem; }
.loc-aka { font-style: italic; color: var(--text-muted); margin: -.4rem 0 1.5rem; }
.loc { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 2.5rem; align-items: start; }
.loc-side { position: sticky; top: 90px; display: flex; flex-direction: column; gap: 1rem; }
.minimap { position: relative; margin: 0; aspect-ratio: 1; border: 1px solid var(--hairline); border-radius: 12px; background: var(--panel) url(/assets/map_02_4k.webp) no-repeat; background-size: 600%; overflow: hidden; }
.minimap-pin { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--accent-bright); border: 2px solid #06100E; box-shadow: 0 0 0 6px rgba(122,181,176,.25); }
.minimap figcaption { position: absolute; left: .5rem; bottom: .5rem; font: 600 .65rem var(--mono); color: var(--text-muted); background: rgba(8,12,11,.75); padding: .15rem .4rem; border-radius: 4px; }
.loc-side .facts { margin: 0; }
.side-h { font-size: .72rem; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-faint); margin: 0; }
.nearby { list-style: none; display: flex; flex-direction: column; gap: .35rem; font-size: .85rem; }
.nearby li { display: flex; justify-content: space-between; gap: .5rem; }
.nearby span { font: 600 .7rem var(--mono); color: var(--text-faint); white-space: nowrap; }
.loc-side .wk-btn { margin: 0; text-align: center; }

/* Item Sidepanel Drawer */
.wk-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 6, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}
.wk-drawer-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}
.wk-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: clamp(560px, 40vw, 760px);
  max-width: 94vw;
  background: var(--panel);
  border-left: 1px solid rgba(90, 138, 133, 0.3);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.85);
  z-index: 160;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}
.wk-drawer.active {
  transform: translateX(0);
}
.drawer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--hairline);
  background: rgba(14, 21, 19, 0.95);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
}
.drawer-handle { display: none; }
.drawer-btn-close {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  font: 700 .8rem var(--mono);
  color: var(--text-muted);
  background: rgba(228, 232, 230, 0.06);
  border: 1px solid var(--hairline);
  padding: .45rem .85rem;
  border-radius: 6px;
  cursor: pointer;
  transition: color .2s, border-color .2s, background .2s;
}
.drawer-btn-close:hover {
  color: var(--text);
  border-color: var(--accent);
  background: rgba(90, 138, 133, 0.2);
}
.drawer-full-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  font: 600 .8rem var(--mono);
  color: var(--accent-bright);
  padding: .45rem .75rem;
  border-radius: 6px;
  transition: opacity .2s;
}
.drawer-full-link:hover {
  text-decoration: underline;
  opacity: .85;
}
.drawer-body {
  padding: 1.75rem 1.75rem 4rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  line-height: 1.6;
}
.drawer-body > * {
  flex-shrink: 0;
}
.drawer-body .item-stage {
  margin: 0 auto;
  max-width: 360px;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  background: #060a09;
  border: 1px solid var(--hairline);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
  position: relative;
  overflow: hidden;
}
.drawer-body .item-stage img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform .25s ease-out;
  background: radial-gradient(circle at 50% 50%, rgba(90, 138, 133, 0.16), transparent 70%);
}
.drawer-body h2 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: .35rem 0 0;
}
.drawer-body .item-tag {
  font-size: 1.05rem;
  padding: .85rem 1.1rem;
  margin: 0;
  line-height: 1.5;
}
.drawer-body .facts {
  margin: 0;
  font-size: .95rem;
  gap: .5rem 1.5rem;
}
.drawer-body .facts dt {
  font-size: .75rem;
  padding-top: .15rem;
}
.drawer-copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-left: .6rem;
  padding: .2rem .55rem;
  font: 600 .68rem var(--mono);
  color: var(--accent);
  background: rgba(90, 138, 133, 0.12);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  cursor: pointer;
}
.drawer-copy-btn:hover {
  color: var(--accent-bright);
  border-color: var(--accent);
}
.drawer-copy-btn.copied {
  color: #9ec9a0;
  border-color: #9ec9a0;
}
.drawer-body .shelf {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}
.drawer-body .shelf-card {
  font-size: .75rem;
  cursor: pointer;
}

@media (max-width: 720px) {
  .atlas, .loc { grid-template-columns: 1fr; }
  .atlas-map, .loc-side { position: static; }
  .loc-side { order: -1; }
  .minimap { max-width: 260px; }
  .wk-nav { padding: 1rem; }
  .wk-links { gap: .9rem; }
  .wk-back { display: none; }
  .wk-main { padding: 1.5rem 1rem 4rem; }
  .item { grid-template-columns: 1fr; gap: 1.5rem; }
  .item-img { max-width: 260px; }
  .db-controls { position: sticky; top: 65px; background: var(--bg); padding: .5rem 0; z-index: 10; }
  .db-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: var(--hairline) transparent;
    padding-bottom: .4rem;
    margin: .5rem -1rem 0;
    padding-left: 1rem;
    padding-right: 1.5rem;
    mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 32px), transparent 100%);
  }
  .db-chips::-webkit-scrollbar { height: 3px; }
  .db-chips::-webkit-scrollbar-track { background: transparent; }
  .db-chips::-webkit-scrollbar-thumb { background: var(--hairline); border-radius: 999px; }
  .db-chips button { flex: none; white-space: nowrap; }
  .db-grid { grid-template-columns: 1fr 1fr; gap: .5rem; }
  .db-card { padding: .75rem; }
  .db-ph { aspect-ratio: 16 / 9; font-size: 1.6rem; }
  .shelf { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
  .db-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

  .wk-drawer {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 85vh;
    border-left: none;
    border-top: 1px solid var(--hairline);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.75);
    transform: translateY(100%);
  }
  .wk-drawer.active {
    transform: translateY(0);
  }
  .drawer-handle {
    display: block;
    width: 38px;
    height: 4px;
    background: var(--hairline);
    border-radius: 2px;
    margin: .6rem auto .2rem;
  }
  .drawer-body {
    padding: 1rem 1rem 2.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
