/* Player's handbook. Loaded after pripyat.css and uses its tokens.
   Source: guides/assets/guides.css in the server repo. */

.g-page h1, .g-page h2, .g-page h3 { font-weight: 400; }

/* ---------- Header ---------- */
.g-head {
  position: relative;
  padding: 64px 24px 44px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(12, 10, 9, 0.62), var(--bg) 96%),
    url("/pripyat/img/red-sky-yard.jpg") center 35% / cover;
  border-bottom: 1px dashed var(--line);
}

.g-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(42px, 7vw, 76px);
  letter-spacing: 0.02em;
  color: var(--bone);
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.7);
}

.g-head-lede {
  max-width: 720px;
  margin: 14px auto 0;
  font-size: 20px;
  line-height: 1.6;
  color: var(--bone);
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8);
}

/* Guide pages: Handbook / Topic (the global nav sits above the header) */
.g-head-guide { padding-top: 40px; }

.g-crumbs { margin-bottom: 16px; font-size: 17px; }

.g-crumbs ol {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.g-crumbs li { display: inline-flex; align-items: center; gap: 8px; }
.g-crumbs li + li::before { content: "/"; margin: 0 10px; color: var(--dim); }
.g-crumbs i { color: var(--amber); font-size: 15px; }
.g-crumbs a { color: var(--bone); text-decoration: none; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.8); }
.g-crumbs a:hover { color: var(--amber); text-decoration: underline; }
.g-crumbs a:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.g-head-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 20px;
  margin-top: 18px;
  font-size: 15px;
  color: var(--text);
}

/* ---------- Hub: filter panel ---------- */
.g-hub {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  max-width: 1280px;
  padding-top: 32px;
}

.g-tools {
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.g-tools section { min-width: 0; }

.g-tools h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 21px;
  letter-spacing: 0.01em;
  color: var(--bone);
}

.g-search { position: relative; }

.g-search i {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--amber);
}

.g-search input {
  width: 100%;
  box-sizing: border-box;
  height: 50px;
  padding: 0 14px 0 42px;
  font: inherit;
  font-size: 19px;
  color: var(--bone);
  background: var(--bg);
  border: 1px solid var(--line-hot);
  border-radius: 4px;
}

.g-search input::placeholder { color: var(--dim); }

.g-topics { display: flex; flex-direction: column; gap: 2px; }

.g-topic {
  border-radius: 0 4px 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 18px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  border-left: 3px solid transparent;
  cursor: pointer;
}

.g-topic:hover { background: var(--surface-2); }
.g-topic[aria-pressed="true"] { color: var(--bone); background: rgba(200, 102, 47, 0.16); border-left-color: var(--rust); }
.g-topic-count { font-size: 15px; color: var(--dim); }

.g-chips { display: flex; flex-wrap: wrap; gap: 6px; }

.g-chip {
  min-height: 36px;
  padding: 4px 11px;
  font: inherit;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.g-chip:hover { border-color: var(--line-hot); }
.g-chip[aria-pressed="true"] { color: #fff4e8; background: var(--rust-deep); border-color: var(--rust); }
.g-tags-few .g-chip[data-rare]:not([aria-pressed="true"]) { display: none; }

/* Spoiler-free slider */
.g-toggle { display: flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 8px; font-size: 17px; cursor: pointer; }

.g-toggle input {
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  flex: none;
  width: 46px;
  height: 24px;
  margin: 0;
  background: var(--bg);
  border: 1px solid var(--line-hot);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease;
}

.g-toggle input::before {
  border-radius: 4px;
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--dim);
  transition: transform 0.16s ease, background 0.16s ease;
}

.g-toggle input:checked { background: var(--rust-deep); border-color: var(--rust); }
.g-toggle input:checked::before { transform: translateX(22px); background: #fff4e8; }

.g-link {
  min-height: 44px;
  margin-top: 6px;
  padding: 0;
  font: inherit;
  font-size: 16px;
  color: var(--amber);
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.g-link:hover { color: var(--bone); }
.g-link[hidden] { display: none; }

.g-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 7px 14px;
  font: inherit;
  font-size: 17px;
  color: var(--bone);
  background: rgba(200, 102, 47, 0.08);
  border: 1px solid var(--line-hot);
  border-radius: 4px;
  cursor: pointer;
}

.g-switch i { color: var(--amber); }
.g-switch:hover { background: rgba(200, 102, 47, 0.18); }
.g-switch[aria-pressed="true"] { background: var(--rust-deep); border-color: var(--rust); color: #fff4e8; }
.g-switch[aria-pressed="true"] i { color: inherit; }

.g-chip:focus-visible, .g-topic:focus-visible, .g-switch:focus-visible, .g-search input:focus-visible, .g-field select:focus-visible,
.g-toggle input:focus-visible, .g-link:focus-visible, .g-item > a:focus-visible, .g-spoiler summary:focus-visible, .g-gate summary:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- Hub: results ---------- */
.g-results { min-width: 0; }

.g-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--line);
}

.g-bar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0 16px; }
.g-bar .g-link { margin-top: 0; }
.g-count { margin: 0; font-size: 18px; color: var(--bone); }

.g-field { display: inline-flex; align-items: center; gap: 10px; font-size: 16px; color: var(--dim); }

.g-field select {
  height: 44px;
  padding: 0 12px;
  font: inherit;
  font-size: 17px;
  color: var(--bone);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
}

.g-list { display: flex; flex-direction: column; gap: 40px; margin-top: 8px; }

.g-group-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--rust);
}

.g-group-head h2 { margin: 0; font-family: var(--font-display); font-size: 36px; line-height: 1.1; color: var(--bone); }
.g-group-count { font-size: 16px; color: var(--dim); }

.g-items { margin: 0; padding: 0; list-style: none; }
.g-item { border-bottom: 1px dashed var(--line); }
.g-item[hidden] { display: none; }
.g-item > a { display: block; padding: 14px 10px 16px; color: inherit; text-decoration: none; }
.g-item > a:hover { background: var(--surface-2); }

.g-item-cat { display: none; margin-bottom: 2px; font-size: 15px; color: var(--amber); }
.g-flat .g-item-cat { display: block; }

.g-item-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.g-item-title { font-size: 23px; line-height: 1.25; color: var(--bone); }
.g-leader { flex: 1 1 48px; min-width: 48px; border-bottom: 2px dotted rgba(214, 160, 120, 0.32); }
.g-item-meta { display: inline-flex; align-items: baseline; gap: 14px; font-size: 16px; white-space: nowrap; }
.g-level { display: inline-flex; align-items: center; gap: 8px; width: 140px; color: var(--bone); }
.g-read { width: 88px; }

/* Level gauge: one bar per level, like a dosimeter reading */
.g-gauge { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.g-gauge i { display: block; width: 6px; height: 8px; background: rgba(214, 160, 120, 0.2); }
.g-gauge i:nth-child(2) { height: 12px; }
.g-gauge i:nth-child(3) { height: 16px; }
.g-gauge-1 i:nth-child(1), .g-gauge-2 i:nth-child(-n+2), .g-gauge-3 i { background: var(--amber); }

.g-item p { max-width: 68ch; margin: 6px 0 0; font-size: 17px; line-height: 1.5; }
.g-item-snippet { padding-left: 10px; border-left: 2px solid var(--rust); font-size: 16px !important; color: var(--dim); }
.g-item-snippet mark { color: var(--bone); background: rgba(200, 102, 47, 0.35); }
.g-item .g-badge-spoiler { display: flex; margin-top: 8px; font-size: 15px; color: var(--amber); }

.g-empty { margin: 24px 0 0; padding: 26px; font-size: 18px; text-align: center; border: 1px dashed var(--line); border-radius: 4px; }

.g-tag {
  border-radius: 6px;
  padding: 1px 7px;
  font-size: 14px;
  color: var(--dim);
  text-decoration: none;
  border: 1px solid var(--line);
}

a.g-tag:hover { color: var(--bone); border-color: var(--line-hot); }

.g-badge-spoiler { display: inline-flex; align-items: center; gap: 6px; color: #d0574a; }

/* ---------- Guide page ---------- */
.g-guide {
  display: grid;
  grid-template-columns: 230px minmax(0, 760px);
  gap: 44px;
  justify-content: center;
  max-width: 1120px;
  padding-top: 40px;
}

.g-guide-solo { grid-template-columns: minmax(0, 760px); }

.g-toc { position: sticky; top: 24px; align-self: start; transition: top 0.25s ease; }
.nav-pinned .g-toc { top: 96px; }   /* clear the global nav while it is showing (js/nav.js) */
.nav-pinned .g-prose h2, .nav-pinned .g-prose h3 { scroll-margin-top: 92px; }

.g-toc h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--dim);
}

.g-toc ol { margin: 0; padding: 0; list-style: none; border-left: 1px solid var(--line); }
.g-toc a { display: block; padding: 6px 0 6px 14px; font-size: 16px; color: var(--text); text-decoration: none; }
.g-toc a:hover { color: var(--bone); }
.g-toc > ol { max-height: calc(100vh - 90px); overflow-y: auto; }
.g-toc ol ol { border-left: 0; }
.g-toc ol ol a { padding: 3px 0 3px 28px; font-size: 15px; color: var(--dim); }

.g-quick { margin: 0 0 26px; padding: 16px 20px 6px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--amber); }
.g-quick-label { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--amber); }

.g-prose { font-size: 19px; line-height: 1.7; }
.g-prose > :first-child { margin-top: 0; }
.g-prose p { margin: 0 0 16px; }
.g-prose strong { color: var(--bone); font-weight: 400; text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 3px; }
.g-prose ul, .g-prose ol { margin: 0 0 16px; padding-left: 24px; }
.g-prose li { margin: 5px 0; }
.g-prose li::marker { color: var(--rust); }

.g-prose h2, .g-prose h3 { scroll-margin-top: 20px; color: var(--bone); }
.g-prose h2 { margin: 38px 0 12px; padding-bottom: 8px; font-family: var(--font-display); font-size: 31px; border-bottom: 1px dashed var(--line); }
.g-prose h3 { margin: 26px 0 8px; font-size: 22px; color: var(--amber); }

.g-table { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--line); border-radius: 4px; }
.g-table table { width: 100%; min-width: 460px; border-collapse: collapse; font-size: 17px; line-height: 1.45; }
.g-table th { padding: 10px 12px; text-align: left; font-weight: 400; color: var(--bone); background: var(--surface-2); }
.g-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; }

.g-note { margin: 0 0 18px; padding: 14px 18px; background: var(--surface); border-left: 3px solid var(--rust); }
.g-note p:last-child { margin-bottom: 0; }

/* Screenshots: ![Caption](name.png) in a guide */
.g-fig { margin: 6px 0 24px; }
.g-fig img { display: block; max-width: 100%; height: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; }
.g-fig-link { display: block; cursor: zoom-in; border-radius: 4px; }
.g-fig-link:hover img { border-color: var(--line-hot); }
.g-fig-link:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.g-fig figcaption { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--dim); }
.g-spoiler-body .g-fig { margin-bottom: 18px; }

/* YouTube videos: @[Caption](https://www.youtube.com/watch?v=ID) in a guide; a poster until play is pressed */
.g-video-play, .g-video-frame { display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; border-radius: 4px; }
.g-video-play img { width: 100%; height: 100%; object-fit: cover; }
.g-video-frame { border: 1px solid var(--line); background: #000; }
.g-video-btn {
  position: absolute; left: 50%; top: 50%; width: 76px; height: 76px; margin: -38px 0 0 -38px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: rgba(12, 10, 9, 0.78); border: 2px solid var(--amber); color: var(--amber); font-size: 28px;
  box-shadow: 0 0 0 6px rgba(12, 10, 9, 0.35); transition: background 0.15s, color 0.15s;
}
.g-video-btn i { margin-left: 5px; }
.g-video-play:hover img { border-color: var(--line-hot); }
.g-video-play:hover .g-video-btn, .g-video-play:focus-visible .g-video-btn { background: var(--amber); color: var(--bg); }
.g-video-play:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; }
.g-video-note { display: block; font-size: 14px; }
@media (max-width: 600px) { .g-video-btn { width: 60px; height: 60px; margin: -30px 0 0 -30px; font-size: 22px; } }

/* Table thumbnails: | ![](name.png) Item name | in a guide */
.g-cell-item { display: flex; align-items: center; gap: 12px; }
.g-thumb { flex: none; position: relative; display: block; width: 56px; height: 56px; overflow: hidden; background: radial-gradient(circle, #463a31 0%, #2b231d 62%, var(--surface-2) 100%); border: 1px solid var(--line); border-radius: 4px; }   /* lit center so dark items read */
.g-thumb img { position: absolute; inset: 3px; display: block; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
a.g-thumb { cursor: zoom-in; }
a.g-thumb:hover { border-color: var(--line-hot); }
a.g-thumb:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.g-table td.g-td-item { padding-top: 7px; padding-bottom: 7px; }
.g-table tr:has(.g-td-item) td { vertical-align: middle; }

.g-lightbox { width: 100vw; max-width: none; height: 100vh; max-height: none; margin: 0; padding: 0; color: var(--text); background: transparent; border: 0; cursor: zoom-out; }
.g-lightbox::backdrop { background: rgba(8, 6, 5, 0.94); }
.g-lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; }
.g-lightbox img { display: block; max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); object-fit: contain; border-radius: 4px; }
.g-lightbox p { max-width: 760px; margin: 0; padding: 0 16px; font-size: 17px; line-height: 1.5; text-align: center; color: var(--bone); }
.g-lightbox-close { position: fixed; top: 14px; right: 14px; width: 44px; height: 44px; font-size: 22px; color: var(--bone); background: var(--surface); border: 1px solid var(--line); border-radius: 50%; cursor: pointer; }
.g-lightbox-close:hover { border-color: var(--line-hot); }
html:has(.g-lightbox[open]) { overflow: hidden; }

/* Spoilers */
.g-spoiler { margin: 0 0 18px; background: var(--surface); border: 1px dashed rgba(208, 87, 74, 0.55); border-radius: 4px; }

.g-spoiler summary {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  color: var(--bone);
  cursor: pointer;
  list-style: none;
}

.g-spoiler summary::-webkit-details-marker, .g-gate summary::-webkit-details-marker { display: none; }
.g-spoiler summary i { color: #d0574a; }
.g-spoiler-hint { margin-left: auto; font-size: 15px; color: var(--dim); }
.g-spoiler[open] .g-spoiler-hint { visibility: hidden; }
.g-spoiler-body { padding: 4px 16px 4px; border-top: 1px dashed var(--line); }
.g-spoiler-body > :first-child { margin-top: 12px; }

.g-gate > summary {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  list-style: none;
  background: linear-gradient(160deg, rgba(163, 58, 42, 0.2), rgba(163, 58, 42, 0.03) 65%), var(--surface);
  border: 1px solid rgba(163, 58, 42, 0.5);
}

.g-gate > summary > i { font-size: 30px; color: #d0574a; }
.g-gate-title { font-family: var(--font-display); font-size: 31px; color: var(--bone); }
.g-gate-text { max-width: 560px; font-size: 19px; line-height: 1.55; }
.g-gate-show { margin-top: 8px; padding: 10px 22px; font-size: 18px; color: #fff4e8; background: var(--rust-deep); border: 1px solid var(--rust); border-radius: 4px; }
.g-gate[open] > summary { display: none; }
.g-gate-back { margin: 16px 0 0; text-align: center; }
.g-gate-back a { text-decoration: none; }
.g-gate-back i { margin-right: 8px; }
.g-gate[open] + .g-gate-back { display: none; }

/* Foot of a guide */
.g-foot-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 30px; }
.g-checked { display: flex; gap: 10px; align-items: baseline; margin: 16px 0 0; font-size: 15px; line-height: 1.6; color: var(--dim); }
.g-checked i { color: var(--amber); }

.g-related { margin-top: 30px; }
.g-related h2 { margin: 0 0 8px; font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); }
.g-related ul { margin: 0; padding: 0; list-style: none; }
.g-related li { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 5px 0; font-size: 18px; }
.g-related .g-badge-spoiler { font-size: 14px; }

.g-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 26px; }
.g-pager a { padding: 14px 16px; font-size: 18px; color: var(--bone); text-decoration: none; border: 1px solid var(--line); border-radius: 4px; }
.g-pager a:hover { border-color: var(--line-hot); }
.g-pager a span { display: block; font-size: 13px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.g-pager .g-next { grid-column: 2; text-align: right; }

.g-page .footer { margin-top: 70px; }

@media (max-width: 960px) {
  .g-hub { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .g-guide { grid-template-columns: minmax(0, 760px); gap: 26px; }
  .g-toc { position: static; }
}

@media (max-width: 640px) {
  .g-head { padding: 44px 16px 32px; }
  .g-head-guide { padding-top: 28px; }
  .g-tools { padding: 16px; }
  .g-item-title { font-size: 21px; }
  .g-group-head h2 { font-size: 31px; }
  .g-prose { font-size: 18px; }
  .g-thumb { width: 44px; height: 44px; }
  .g-cell-item { gap: 10px; }
  .g-pager { grid-template-columns: 1fr; }
  .g-pager .g-next { grid-column: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .g-chip, .g-toggle input, .g-toggle input::before, .g-toc, .g-video-btn { transition: none; }
}
