/* The player guide (/guide, guide/build.py): docs layout, sidebar left, page, outline right, search over all of it.
   Andesit palette from style.css; nothing here touches the other pages. */

.g-body { background-image: none; }
.g-wrap {
  display: grid; grid-template-columns: 284px minmax(0, 1fr) 232px;
  max-width: 1440px; margin: 0 auto; min-height: calc(100vh - 68px);
}

/* Sidebar */
.g-side {
  position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); overflow-y: auto;
  padding: 24px 18px 40px 24px; border-right: 1px solid var(--line-soft);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.g-search-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 40px; padding: 0 10px 0 12px; margin-bottom: 22px;
  font: 500 14px Inter, sans-serif; color: var(--dim); text-align: left;
  background: #1d1c1a; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; transition: border-color 0.15s, color 0.15s;
}
.g-search-btn:hover, .g-search-btn:focus-visible { border-color: var(--gold); color: var(--text); outline: none; }
.g-search-btn svg, .g-search-mini svg, .g-search-field svg { width: 17px; height: 17px; flex-shrink: 0; }
.g-search-btn span { flex: 1; }
kbd {
  display: inline-block; min-width: 20px; padding: 1px 6px; font: 500 11px/18px Inter, sans-serif; color: var(--dim); text-align: center;
  background: #282624; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px;
}
.g-group { margin: 22px 0 6px; padding-left: 12px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold); }
.g-nav > .g-group:first-child { margin-top: 0; }
.g-nav li a {
  display: block; padding: 6px 12px; margin: 1px 0; font-size: 14.5px; line-height: 1.4; color: #bdb8b0; text-decoration: none;
  border-radius: 6px; border-left: 2px solid transparent;
}
.g-nav li a:hover { color: var(--text); background: #1d1c1a; }
.g-nav li a[aria-current="page"] { color: var(--text); font-weight: 600; background: #282624; border-left-color: var(--gold); border-radius: 0 6px 6px 0; }
.g-side-shade { display: none; }

/* Page */
.g-main { min-width: 0; padding: 40px clamp(20px, 5vw, 72px) 80px; }
.g-bar { display: none; }
.g-article { max-width: 760px; margin: 0 auto; }
.g-crumb { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--gold); }
.g-article h1 { font-size: 38px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; }
.g-lead { margin: 14px 0 0; padding-bottom: 28px; border-bottom: 1px solid var(--line-soft); font-size: 18px; line-height: 1.55; color: var(--dim); }
.g-content { font-size: 16px; line-height: 1.75; color: #d9d4cb; }
.g-content > :first-child { margin-top: 28px; }
.g-content p { margin: 16px 0; }
.g-content h2, .g-content h3 { position: relative; scroll-margin-top: 92px; color: var(--text); }
.g-content h2 { margin: 48px 0 12px; font-size: 25px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; }
.g-content h3 { margin: 32px 0 8px; font-size: 19px; line-height: 1.3; font-weight: 600; }
.g-anchor { position: absolute; left: -1.1em; width: 1em; color: var(--line); text-decoration: none; opacity: 0; transition: opacity 0.15s; }
.g-content h2:hover .g-anchor, .g-content h3:hover .g-anchor, .g-anchor:focus { opacity: 1; color: var(--gold); }
.g-content a { color: var(--gold-hi); text-decoration: underline; text-decoration-color: rgba(201, 180, 138, 0.4); text-underline-offset: 3px; }
.g-content a:hover { text-decoration-color: var(--gold-hi); }
.g-content .g-anchor { text-decoration: none; color: var(--line); }
.g-content strong { color: var(--text); font-weight: 600; }
.g-content ul, .g-content ol { margin: 16px 0; padding-left: 24px; }
.g-content ul { list-style: disc; }
.g-content ol { list-style: decimal; }
.g-content li { margin: 6px 0; padding-left: 4px; }
.g-content li::marker { color: var(--gold); }
.g-content code { padding: 2px 6px; font: 0.88em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--gold-hi); background: #282624; border: 1px solid var(--line-soft); border-radius: 4px; }
.g-content blockquote { margin: 20px 0; padding: 2px 18px; border-left: 3px solid var(--line); color: var(--dim); }
.g-table { margin: 20px 0; overflow-x: auto; border: 1px solid var(--line-soft); border-radius: 8px; }
.g-table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.g-table th { padding: 10px 14px; font-weight: 600; color: var(--text); text-align: left; background: #1d1c1a; border-bottom: 1px solid var(--line); white-space: nowrap; }
.g-table td { padding: 9px 14px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.g-table tr:first-child td { border-top: 0; }
.g-table tbody tr:hover td { background: rgba(40, 38, 36, 0.5); }
.g-hint { --tone: var(--water); margin: 22px 0; padding: 14px 18px; background: color-mix(in srgb, var(--tone) 9%, #1a1918); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent); border-left: 4px solid var(--tone); border-radius: 0 8px 8px 0; }
.g-hint b { display: block; margin-bottom: 2px; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tone); }
.g-hint p { margin: 0; }
.g-tip { --tone: var(--earth-green); }
.g-warning { --tone: var(--fire); }
.g-content mark, .g-results mark { padding: 0 2px; color: #17150f; background: var(--gold); border-radius: 2px; }

.g-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line-soft); }
.g-pager a { display: block; padding: 14px 18px; text-decoration: none; border: 1px solid var(--line); border-radius: 8px; transition: border-color 0.15s; }
.g-pager a:hover { border-color: var(--gold); }
.g-pager small { display: block; font-size: 12px; color: var(--dim); }
.g-pager span { font-weight: 600; color: var(--text); }
.g-next { grid-column: 2; text-align: right; }

/* Outline */
.g-toc { position: sticky; top: 68px; align-self: start; max-height: calc(100vh - 68px); overflow-y: auto; padding: 40px 24px 40px 8px; }
.g-toc-title { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); }
.g-toc ul { border-left: 1px solid var(--line-soft); }
.g-toc a { display: block; margin-left: -1px; padding: 4px 0 4px 14px; font-size: 13.5px; line-height: 1.4; color: var(--dim); text-decoration: none; border-left: 2px solid transparent; }
.g-toc .g-toc-3 a { padding-left: 26px; font-size: 13px; }
.g-toc a:hover { color: var(--text); }
.g-toc a.on { color: var(--gold-hi); border-left-color: var(--gold); }

/* Search */
.g-search { position: fixed; inset: 0; z-index: 60; }
.g-search[hidden] { display: none; }
.g-search-shade { position: absolute; inset: 0; background: rgba(8, 8, 7, 0.72); backdrop-filter: blur(3px); }
.g-search-box {
  position: relative; display: flex; flex-direction: column; width: min(680px, calc(100vw - 24px)); max-height: min(640px, calc(100vh - 14vh - 24px));
  margin: 12vh auto 0; background: #1d1c1a; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55); overflow: hidden;
}
.g-search-field { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--line-soft); color: var(--gold); }
.g-search-field input { flex: 1; min-width: 0; height: 58px; font: 500 17px Inter, sans-serif; color: var(--text); background: none; border: 0; outline: none; }
.g-search-field input::-webkit-search-cancel-button { display: none; }
.g-search-field kbd { cursor: pointer; }
.g-results { flex: 1; overflow-y: auto; padding: 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.g-rgroup { margin: 10px 10px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); }
.g-rgroup:first-child { margin-top: 4px; }
.g-r { display: grid; grid-template-columns: 22px 1fr; gap: 2px 10px; padding: 10px 12px; text-decoration: none; border-radius: 8px; border: 1px solid transparent; }
.g-r svg { grid-row: span 2; width: 18px; height: 18px; margin-top: 2px; color: var(--dim); }
.g-r b { font-weight: 600; color: var(--text); font-size: 15px; }
.g-r b i { font-style: normal; color: var(--dim); font-weight: 500; }
.g-r span { font-size: 13.5px; line-height: 1.5; color: var(--dim); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.g-r.on { background: #282624; border-color: var(--line); }
.g-r.on svg { color: var(--gold); }
.g-rempty { padding: 28px 16px; text-align: center; color: var(--dim); }
.g-rempty p { margin: 0 0 12px; }
.g-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.g-chips button { padding: 5px 12px; font: 500 13px Inter, sans-serif; color: var(--text); background: #282624; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.g-chips button:hover { border-color: var(--gold); }
.g-search-foot { display: flex; gap: 18px; margin: 0; padding: 10px 16px; font-size: 12px; color: var(--dim); border-top: 1px solid var(--line-soft); }
.g-search-foot kbd { margin-right: 3px; }

/* Narrower: no outline; then the sidebar becomes a drawer */
@media (max-width: 1240px) {
  .g-wrap { grid-template-columns: 264px minmax(0, 1fr); }
  .g-toc { display: none; }
}
@media (max-width: 900px) {
  .g-wrap { display: block; }
  .g-side {
    position: fixed; z-index: 40; top: 0; left: 0; height: 100vh; width: min(300px, 86vw); padding-top: 20px;
    background: #171615; transform: translateX(-100%); transition: transform 0.25s; visibility: hidden;
  }
  .g-side.open { transform: none; visibility: visible; }
  .g-side-shade { position: fixed; inset: 0; z-index: 39; border: 0; background: rgba(8, 8, 7, 0.6); }
  .g-side.open + .g-side-shade { display: block; }
  .g-bar { position: sticky; top: 68px; z-index: 5; display: flex; gap: 10px; margin: -40px -20px 24px; padding: 10px 20px; background: rgba(20, 19, 18, 0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
  .g-menu, .g-search-mini { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; font: 500 14px Inter, sans-serif; color: var(--text); background: #1d1c1a; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
  .g-menu svg { width: 18px; height: 18px; }
  .g-search-mini { flex: 1; color: var(--dim); }
  .g-main { padding-top: 40px; }
  .g-article h1 { font-size: 30px; }
  .g-content h2 { scroll-margin-top: 140px; }
  .g-content h3 { scroll-margin-top: 140px; }
  .g-anchor { display: none; }
}
@media (max-width: 560px) {
  .g-search-box { margin-top: 0; width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; border: 0; }
  .g-search-foot { display: none; }
  .g-pager { grid-template-columns: 1fr; }
  .g-next { grid-column: 1; }
}
@media (hover: none) { .g-search-btn kbd, .g-search-foot { display: none; } }
@media (prefers-reduced-motion: reduce) { .g-side { transition: none; } }

/* Level map ([[level-map]] in a page, guide/build.py): each zone's monster levels, story quests and bounty board on one
   level axis. Thin bars with their label inside (wide bars) or beside them; the full text on hover or focus (title). */
.g-levelmap { margin: 22px 0 26px; padding: 16px 0 12px; background: #1a1918; border: 1px solid var(--line-soft); border-radius: 8px; }
.g-lm-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 0 18px 12px; font-size: 13px; color: var(--dim); }
.g-lm-legend i { display: inline-block; width: 14px; height: 8px; margin-right: 6px; border-radius: 2px; vertical-align: 1px; }
.g-lm-scroll { overflow-x: auto; overflow-y: hidden; padding-right: 18px; }
.g-lm-in { min-width: 660px; }
.g-lm-row, .g-lm-axis { display: grid; grid-template-columns: 150px 1fr; }
.g-lm-row { align-items: center; border-top: 1px solid var(--line-soft); }
.g-lm-row:first-child { border-top: 0; }
.g-lm-name, .g-lm-axis b { position: sticky; left: 0; z-index: 2; padding: 8px 12px 8px 18px; background: #1a1918; line-height: 1.25; }
.g-lm-name b { display: block; font-size: 14px; color: var(--text); }
.g-lm-name small { font-size: 12px; color: var(--dim); }
.g-lm-track { position: relative; height: 60px; margin-right: 8px; border-left: 1px solid var(--line); }
.g-lm-track > i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line-soft); opacity: 0.6; }
.g-lm-bar { position: absolute; height: 10px; border-radius: 4px; outline: none; cursor: default; }
.g-lm-bar span { position: absolute; top: -3px; font: 600 11.5px/16px Inter, sans-serif; white-space: nowrap; color: var(--text); }
.g-lm-after span { left: calc(100% + 6px); }
.g-lm-before span { right: calc(100% + 6px); }
.g-lm-bar.g-lm-inside span { left: 6px; top: 12px; color: var(--dim); }
.g-lm-bar:hover, .g-lm-bar:focus-visible { box-shadow: 0 0 0 2px #1a1918, 0 0 0 3px var(--gold); }
.g-lm-mon { top: 8px; background: #4a4640; }
.g-lm-story { top: 26px; background: var(--gold); }
.g-lm-bounty { top: 42px; background: var(--water); }
.g-lm-track .g-lm-mon.g-lm-inside span { top: -2px; left: 6px; font-size: 11px; line-height: 14px; color: #d2cdc5; }
.g-lm-bar.g-lm-mon.g-lm-inside { height: 14px; top: 6px; }
.g-lm-none { position: absolute; top: 28px; font-size: 12px; font-style: italic; color: var(--dim); white-space: nowrap; }
.g-lm-axis { border-top: 1px solid var(--line); font-size: 11px; color: var(--dim); }
.g-lm-axis b { padding-top: 4px; padding-bottom: 0; font-weight: 500; }
.g-lm-axis div { position: relative; height: 20px; margin-right: 8px; }
.g-lm-axis span { position: absolute; top: 4px; transform: translateX(-50%); }
.g-lm-axis span:first-child { transform: none; }
.g-lm-axis span:last-child { transform: translateX(-100%); }
