/* The game guide (templates/guide.html, guide_more.html, guide_parts.html). Built on the site's
   theme, static/classic/dkc.css: its colours and fonts (--gold, --crimson, --rule, --plate, --head ...)
   and its .board plates. No decoration of its own: no ::before / ::after anywhere in this file. */

.gpage { --gap: 22px; }
.gpage > * { margin-top: 0; }

/* ---------- page head and tabs ---------- */
.ghead { margin: 0 0 14px; }
.ghead .eyebrow { margin: 0 0 4px; }
.ghead h1 { margin: 0; }

.gtabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--gap); padding: 0; }
.gtabs a {
  display: inline-block; padding: 7px 14px; border: 1px solid var(--rule-2); border-radius: var(--r);
  font: 400 13.5px/1.2 var(--head); letter-spacing: .08em; color: var(--dim); background: rgba(8, 6, 6, .5);
  white-space: nowrap; transition: color .12s, border-color .12s, background .12s;
}
.gtabs a:hover { color: var(--ink); border-color: var(--gold-2); text-decoration: none; background: rgba(207, 162, 85, .08); }
.gtabs a[aria-current] { color: var(--night); background: var(--gold); border-color: var(--gold); }
.gtabs.sub { margin-top: calc(-1 * var(--gap) + 10px); }

/* the tab row with the search box on its right */
.gbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 0 0 var(--gap); }
.gbar .gtabs { order: 1; margin: 0; flex: 1 1 auto; min-width: 0; }
.gsearch { order: 2; position: relative; flex: 0 0 300px; margin-left: auto; }
.gsearch input { width: 100%; margin: 0; padding: 8px 12px; font: 400 14px var(--sans); color: var(--ink);
  background: rgba(8, 6, 6, .6); border: 1px solid var(--rule-2); border-radius: var(--r); }
.gsearch input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px rgba(207, 162, 85, .2); }
.gsearch-list { position: absolute; z-index: 40; top: calc(100% + 4px); right: 0; width: max(100%, min(460px, 92vw)); margin: 0; padding: 4px; list-style: none;
  max-height: 420px; overflow-y: auto; background: var(--night-2); border: 1px solid var(--rule-2); border-radius: var(--r);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .7); }
.gsearch-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 10px; align-items: center; padding: 6px 8px;
  border-radius: 2px; cursor: pointer; }
.gsearch-list li[aria-selected="true"], .gsearch-list li:hover { background: rgba(207, 162, 85, .14); }
.gsearch-list .gs-pic { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; overflow: hidden;
  border: 1px solid var(--rule); border-radius: 2px; background: rgba(0, 0, 0, .4); }
.gsearch-list .gs-pic img { max-width: 34px; max-height: 34px; object-fit: contain; image-rendering: pixelated; }
.gsearch-list .gs-pic.z img { max-width: none; height: 34px; image-rendering: auto; }
.gsearch-list .gs-name { display: block; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-list .gs-name b { color: var(--gold); font-weight: 700; }
.gsearch-list .gs-hint { display: block; font-size: 12.5px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gsearch-list .gs-kind { margin-right: 6px; font: 600 10px var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.gsearch-list .gs-none { display: block; padding: 8px; color: var(--dim); cursor: default; }
.gtabs.sub a { padding: 5px 11px; font-size: 12.5px; }
.gtabs.plain { margin: 0; }

.glede { max-width: 72ch; color: var(--dim); margin: 0 0 var(--gap); }
.gjump { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: -6px 0 var(--gap); font-size: 14px; color: var(--faint); }
.gjump a { white-space: nowrap; }
.gnote { max-width: 80ch; margin: -8px 0 var(--gap); font-size: 13.5px; color: var(--faint); }
.gtip { margin: 0 0 12px; font-size: 14px; color: var(--dim); }
.quiet { color: var(--dim); }

/* ---------- overview cards ---------- */
.gcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin: 0 0 var(--gap); }
.gcard {
  display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 14px 16px; min-height: 112px; border: 1px solid var(--rule-2); border-radius: var(--r);
  background: linear-gradient(180deg, var(--plate-2), var(--plate)); color: var(--ink);
  box-shadow: inset 0 0 0 3px rgba(10, 8, 8, .55), 0 10px 26px rgba(0, 0, 0, .45);
  transition: border-color .14s, transform .14s, box-shadow .14s;
}
.gcard:hover { text-decoration: none; color: var(--ink); border-color: var(--gold-2); transform: translateY(-2px);
  box-shadow: inset 0 0 0 3px rgba(10, 8, 8, .55), 0 14px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(207, 162, 85, .25); }
.gcard-pic { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px;
  border: 1px solid var(--rule); border-radius: var(--r); background: rgba(0, 0, 0, .35); overflow: hidden; }
.gcard-pic img { max-width: 76px; max-height: 76px; object-fit: contain; }
.gcard-body { display: block; min-width: 0; }
.gcard-title { display: flex; align-items: center; gap: 8px; font: 400 19px/1.2 var(--head); letter-spacing: .04em; color: var(--silver); }
.gcard:hover .gcard-title { color: var(--gold); }
.gcard-text { display: block; margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge, .count { display: inline-block; padding: 1px 8px; border: 1px solid var(--gold-2); border-radius: 999px;
  font: 600 12px/1.5 var(--sans); letter-spacing: .02em; color: var(--gold); background: rgba(207, 162, 85, .08); vertical-align: middle; }
h2 .count { margin-left: 6px; font-size: 12px; }

/* ---------- boxed sections and tables ---------- */
.gpage .board { margin-bottom: var(--gap); }
.gsec > h2, .gpage .board > h2 { margin: 0 0 12px; font-size: 20px; }
.gscroll, .gpage .gsec { overflow-x: auto; }
.gt .lbl { display: none; }
.gcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 0 var(--gap); align-items: start; }

.gt { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.gt th { white-space: nowrap; padding: 8px 10px; }
.gt td { padding: 7px 10px; vertical-align: middle; }
.gt td.num, .gt th.num { white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.gt td.lv { font: 400 17px var(--head); color: var(--silver); }
.gt td.name { font-weight: 600; }
.gt td.name a { color: var(--ink); }
.gt td.name a:hover { color: var(--gold); }
.gt td.pic, .gt th.pic { width: 1%; padding-right: 4px; text-align: center; white-space: nowrap; }
.gt td.req { font-size: 13.5px; color: var(--dim); white-space: nowrap; }
.gt td.maps { font-size: 13.5px; color: var(--dim); min-width: 200px; }
.gt td.maps a { color: var(--dim); }
.gt td.maps a:hover { color: var(--gold); }
.gt tr[id] { scroll-margin-top: 90px; }
.gt tr:target td { background: rgba(163, 18, 31, .22); }

img.px { image-rendering: pixelated; image-rendering: crisp-edges; max-width: none; vertical-align: middle; }
.gt td.pic img.px { display: block; margin: 0 auto; }
.gt.items td.pic img.px, .gt.drops td.pic img.px { max-height: 120px; object-fit: contain; }
.gt td.pic.mon { min-width: 80px; }
img.ipic { display: block; margin: 0 auto; width: 72px; height: 72px; max-width: none; border: 1px solid var(--rule); border-radius: var(--r); background: #000; }
.gt.items td.name { min-width: 170px; }

.tag { display: inline-block; margin-left: 6px; padding: 0 6px; border: 1px solid var(--rule-2); border-radius: var(--r);
  font: 600 10.5px/1.6 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); vertical-align: 2px; }
.tag.boss { color: #ffb3b9; border-color: var(--crimson-2); background: rgba(163, 18, 31, .25); }

/* items: where to get one */
.gt.items td.where { font-size: 13.5px; min-width: 200px; max-width: 340px; }
details.found summary { cursor: pointer; color: var(--gold); list-style-position: inside; }
details.found summary:hover { color: #ffe0a6; }
details.found ul { list-style: none; margin: 6px 0 2px; padding: 6px 0 0 10px; border-left: 2px solid var(--rule-2); max-height: 260px; overflow-y: auto; }
details.found li { margin: 2px 0; line-height: 1.4; }
.shops { margin: 4px 0 0; }

/* skills: one icon size, even rows, the game's description under the name */
.gt.skills td.pic { width: 56px; }
.gt.skills img.sicon { width: 36px; height: 36px; }
.gt.skills td.name { width: 55%; }
.gt.skills td.num { width: 1%; }
details.about summary { cursor: pointer; list-style-position: inside; }
details.about summary:hover { color: var(--gold); }
.sdesc { margin: 8px 0 4px; padding: 2px 0 2px 14px; border-left: 2px solid var(--rule-2); max-width: 70ch; }
.sdesc p { margin: 0 0 .6em; font-weight: 400; font-size: 14px; line-height: 1.55; color: var(--dim); }
.sdesc p:last-child { margin-bottom: 0; }

/* ---------- a monster ---------- */
.mhead { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 28px; align-items: center; }
.mhead-pic { display: flex; align-items: center; justify-content: center; min-width: 160px; min-height: 160px; padding: 10px;
  border: 1px solid var(--rule); border-radius: var(--r);
  background: radial-gradient(closest-side, rgba(163, 18, 31, .22), rgba(0, 0, 0, .35)); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 18px; margin: 0; }
.stats div { padding-left: 10px; border-left: 2px solid var(--gold-2); }
.stats dt { font: 400 11.5px var(--head); letter-spacing: .14em; color: var(--faint); }
.stats dd { margin: 2px 0 0; font: 400 19px var(--head); color: var(--silver); white-space: nowrap; }
.gsec.slayer { border-top: 2px solid var(--sky); }
.gsec.vampire { border-top: 2px solid var(--crimson-2); }

/* ---------- the world map ---------- */
.wmap-board { padding: 14px; }
.wmap { display: block; width: 100%; height: auto; border: 1px solid var(--rule); border-radius: var(--r); background: var(--night); }
.wmap .wz rect { fill: rgba(0, 0, 0, 0); stroke: rgba(214, 196, 168, .22); stroke-width: 1.5; transition: fill .12s, stroke .12s; }
.wmap .wz:hover rect, .wmap .wz:focus rect { fill: rgba(207, 162, 85, .16); stroke: var(--gold); stroke-width: 3; }
.wmap .wq { fill: rgba(238, 230, 220, .55); font: 400 20px var(--head); text-anchor: middle; pointer-events: none; }
.wmap .wz:hover .wq { fill: #fff; }
.wmap .wland { fill: var(--silver); font: 400 30px var(--head); letter-spacing: .08em; text-anchor: middle; pointer-events: none;
  paint-order: stroke; stroke: rgba(0, 0, 0, .85); stroke-width: 6px; }
.wmap .wgate circle { fill: rgba(163, 18, 31, .85); stroke: #ffd9a0; stroke-width: 2; }
.wmap .wgate circle.core { fill: #ffd9a0; stroke: none; }
.wmap .wgate:hover circle { fill: var(--crimson-2); stroke: #fff; }
.wmap .wgate.town circle { fill: var(--gold); stroke: #2a1d0b; }
.wmap .wgate.town circle.core { fill: #2a1d0b; }
.wmap .wgate.town:hover circle { fill: #ffe0a6; }
.wmap .wtown rect { fill: var(--gold); stroke: #2a1d0b; stroke-width: 2; }
.wmap .wtown:hover rect { fill: #ffe0a6; }
.key { display: inline-flex; align-items: center; gap: 6px; margin-left: 14px; white-space: nowrap; }
.key i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; }
.key .k-gate, .key .k-exit { background: rgba(163, 18, 31, .9); border: 2px solid #ffd9a0; }
.key .k-town { border-radius: 1px; transform: rotate(45deg); width: 10px; height: 10px; background: var(--gold); }
.key .k-towngate { background: var(--gold); border: 2px solid #2a1d0b; }
.key .k-npc { background: var(--sky); border: 2px solid #1b2733; }

.places { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.place { display: flex; flex-direction: column; gap: 4px; padding: 8px; border: 1px solid var(--rule); border-radius: var(--r);
  background: rgba(0, 0, 0, .25); color: var(--ink); transition: border-color .12s, background .12s; }
.place:hover { text-decoration: none; color: var(--ink); border-color: var(--gold-2); background: rgba(207, 162, 85, .07); }
.place img, .place .noimg { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; border-radius: 2px; background: #0b0909; }
.place .pname { font: 400 15px/1.25 var(--head); color: var(--silver); }
.place:hover .pname { color: var(--gold); }
.place .plv { font-size: 12.5px; color: var(--faint); }

/* ---------- one map, with its exits and townsfolk on it (places: maps.css) ---------- */
.gmap { position: relative; line-height: 0; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--night); }
.gmap > img { display: block; width: 100%; height: auto; }
.pin { position: absolute; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  transform: translate(-50%, -7px); line-height: 1.2; text-decoration: none; }
.pin.l { transform: translate(-7px, -7px); align-items: flex-start; }
.pin.r { transform: translate(calc(-100% + 7px), -7px); align-items: flex-end; }
.pin i { display: block; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .55), 0 2px 6px rgba(0, 0, 0, .6); }
.pin span { padding: 1px 6px; border-radius: 2px; font: 600 11.5px var(--sans); white-space: nowrap; background: rgba(10, 8, 8, .82); color: var(--ink); }
.pin.exit i { background: var(--crimson); border: 2px solid #ffd9a0; }
.pin.exit span { color: #ffe0a6; }
.pin.exit:hover { z-index: 3; text-decoration: none; }
.pin.exit:hover i { background: var(--crimson-2); border-color: #fff; }
.pin.exit:hover span { background: var(--crimson); color: #fff; }
.pin.npc i { width: 10px; height: 10px; background: var(--sky); border: 2px solid #1b2733; }
.pin.npc span { display: none; color: #cfe2fb; }
.pin.npc:hover { z-index: 3; }
.pin.npc:hover span { display: block; }

/* ---------- guide_more.html's boxes, in the same look ---------- */
.gpage .guide-table table { width: 100%; }
.gpage .guide-table td.num, .gpage .guide-table th.num { white-space: nowrap; }
.gpage .guide-table h3 { margin: 18px 0 8px; }
.gpage .panel.prose { max-width: none; }

@media (max-width: 760px) {
  .gpage { --gap: 16px; }
  .gsearch { order: 0; flex: 1 1 100%; margin-left: 0; }
  .gtabs a { padding: 6px 10px; font-size: 12.5px; }
  .gtabs.sub a { padding: 4px 9px; font-size: 12px; }
  .gcards { grid-template-columns: 1fr; gap: 12px; }
  .gcard { grid-template-columns: 64px minmax(0, 1fr); min-height: 0; padding: 12px; }
  .gcard-pic { width: 64px; height: 64px; }
  .gcard-pic img { max-width: 58px; max-height: 58px; }
  .gcols { grid-template-columns: minmax(0, 1fr); }
  .mhead { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .stats { width: 100%; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gt { font-size: 13.5px; }
  /* skills: one card per skill, the numbers on a line under the name, the description full width */
  .gt.skills thead { display: none; }
  .gt.skills tr { display: grid; grid-template-columns: 44px repeat(4, auto) minmax(0, 1fr); align-items: center; column-gap: 12px;
    padding: 8px 0; border-bottom: 1px solid var(--rule); }
  .gt.skills tbody tr td { padding: 0; border: 0; background: none; }
  .gt.skills td.pic { grid-row: 1 / span 2; width: auto; }
  .gt.skills td.name { grid-column: 2 / -1; width: auto; }
  .gt.skills td.num { width: auto; text-align: left; font-size: 13px; color: var(--dim); }
  .gt.skills td.num:empty { display: none; }
  .gt.skills td.lv { font: 400 13px var(--sans); color: var(--dim); }
  .gt.skills .lbl { display: inline; color: var(--faint); }
  .gt.items { min-width: 760px; }
  .gt.monsters { min-width: 640px; }
  .gt.items td.where { min-width: 160px; }
  .gt td.pic img.px { max-width: 56px; max-height: 72px; object-fit: contain; }
  img.ipic { width: 52px; height: 52px; }
  .gt.skills img.sicon { max-width: none; max-height: none; }
  .pin span { font-size: 10px; padding: 0 4px; }
  .key { margin-left: 8px; }
  .places { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Korean pages: the site's Korean fonts come in through the same variables (--head, --sans); Hangul
   reads badly letter-spaced, and Korean words should not break in the middle */
.gpage:lang(ko) { word-break: keep-all; }
.gpage:lang(ko) .gtabs a, .gpage:lang(ko) .stats dt, .gpage:lang(ko) .tag, .gpage:lang(ko) .eyebrow,
.gpage:lang(ko) .gt th, .gpage:lang(ko) .gsearch-list .gs-kind { letter-spacing: 0; }
.gpage:lang(ko) .tag { text-transform: none; }
/* unspaced Korean place names (로스트타이얀지하1층) may break anywhere rather than spill out of a card or cell */
.gpage:lang(ko) .pname, .gpage:lang(ko) td.maps, .gpage:lang(ko) .gcard-title,
.gpage:lang(ko) .gs-name, .gpage:lang(ko) .stats dd { overflow-wrap: anywhere; }
/* a monster's or item's Korean name stays on one line (the table scrolls sideways on a phone instead) */
.gpage:lang(ko) .gt td.name > a, .gpage:lang(ko) .gt td.name > summary, .gpage:lang(ko) .gt td.name > span.sname { white-space: nowrap; }
