/* keldurn-classic-edge: the frame of keldurn.com/{lang}/classic/. The house is keldurn.com (site/styles.css: night,
   ink, gold, Georgia); inside it the pages speak the game's interface language: tooltips, the quest log, tables with
   tabular figures, the game's quality colours. No web fonts, no third-party requests. */
:root {
  color-scheme: dark;
  --ink: #f3ead1;
  --muted: #aaa38f;
  --gold: #ddb45e;
  --gold-soft: #8d713b;
  --night: #05070c;
  --rule: rgba(221, 180, 94, 0.18);
  /* the game's own colours */
  --tip-bg: rgba(6, 8, 26, 0.94);
  --tip-edge: #9aa0ae;
  --game-yellow: #ffd100;
  --q0: #9d9d9d; --q1: #ffffff; --q2: #1eff00; --q3: #0070dd; --q4: #a335ee; --q5: #ff8000; --q6: #e6cc80; --q7: #e6cc80;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}
* { box-sizing: border-box; }
html { min-width: 320px; background: var(--night); }
body {
  margin: 0; min-height: 100vh; overflow-x: hidden; color: var(--ink);
  background: radial-gradient(circle at 50% 0, rgba(56, 75, 111, 0.30), transparent 40rem), linear-gradient(160deg, #0b0f18 0%, #05070c 56%, #020306 100%);
  font: 400 17px/1.65 var(--serif);
}
a { color: var(--gold); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }
:focus-visible { outline: 2px solid var(--game-yellow); outline-offset: 2px; }
.kc-skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: #171105; padding: 8px 12px; z-index: 5; }
.kc-skip:focus { left: 12px; }

/* masthead and footer: keldurn.com's */
.kc-mast, .kc-crumbs, .kc-main, .kc-foot { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.kc-mast { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--rule); }
.kc-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; text-transform: uppercase; letter-spacing: 0.19em; font: 700 15px/1 var(--sans); }
.kc-mast-nav { display: flex; align-items: center; gap: 18px; font: 600 14px/1 var(--sans); }
.kc-mast-nav a { color: var(--muted); text-decoration: none; }
.kc-mast-nav a:hover { color: var(--ink); }
.kc-mast-nav .kc-sec { color: var(--ink); }
a.kc-play { display: inline-block; padding: 11px 18px; color: #171105; border: 1px solid #efcd7b; background: var(--gold); text-decoration: none; font: 700 14px/1.2 var(--sans); box-shadow: 0 8px 28px rgba(221, 180, 94, 0.2); }
a.kc-play:hover { color: #171105; background: #e9c36f; }
.kc-crumbs { font: 13px/1.4 var(--sans); color: var(--muted); padding-top: 14px; }
.kc-crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; }
.kc-crumbs li + li::before { content: "/"; margin: 0 8px; color: var(--gold-soft); }
.kc-crumbs a { color: var(--muted); }
.kc-main { padding: 28px 0 64px; }
.kc-foot { border-top: 1px solid var(--rule); padding: 22px 0 40px; display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; font: 13px/1.5 var(--sans); color: var(--muted); }
.kc-foot p { margin: 0; }
.kc-lang summary { cursor: pointer; color: var(--ink); }
.kc-lang ul { list-style: none; padding: 8px 0 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.kc-lang a[aria-current] { color: var(--ink); text-decoration: none; }

/* type */
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; }
h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.01em; }
h2 { font-size: 24px; margin-top: 1.8em; color: var(--ink); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
.kc-lead { font-size: 19px; color: #ded4bb; max-width: 64ch; }
.kc-main section > p, .kc-rules { max-width: 72ch; }
.kc-rules { padding-inline-start: 1.2em; }
.kc-rules li { margin-bottom: 0.4em; }
.kc-source { font: 13px/1.5 var(--sans); color: var(--muted); }

/* tables: the game's lists, tabular figures, scroll inside themselves */
.kc-tbl { overflow-x: auto; max-width: 100%; margin: 0 0 1.2em; border: 1px solid rgba(154, 160, 174, 0.28); background: rgba(6, 8, 26, 0.55); }
.kc-tbl table { border-collapse: collapse; width: 100%; font: 15px/1.4 var(--sans); font-variant-numeric: tabular-nums; }
.kc-tbl th, .kc-tbl td { padding: 7px 12px; text-align: start; border-bottom: 1px solid rgba(154, 160, 174, 0.14); white-space: nowrap; }
.kc-tbl thead th { color: var(--game-yellow); font-weight: 600; background: rgba(255, 209, 0, 0.04); }
.kc-tbl .n { text-align: end; }
.kc-tbl tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.kc-tbl caption { text-align: start; padding: 8px 12px; color: var(--muted); }

/* quality colours (item names) and icon borders */
.q0 { color: var(--q0); } .q1 { color: var(--q1); } .q2 { color: var(--q2); } .q3 { color: var(--q3); } .q4 { color: var(--q4); } .q5 { color: var(--q5); } .q6 { color: var(--q6); } .q7 { color: var(--q7); }
.kc-icon { display: inline-block; vertical-align: middle; width: var(--s, 36px); height: var(--s, 36px); border: 1px solid #3a3d48; border-radius: 3px; background: #0d1020; }
.kc-icon-none { background: radial-gradient(circle at 50% 40%, #1b2034, #0a0c16 70%); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); }
.kc-qb0 { border-color: var(--q0); } .kc-qb1 { border-color: #c8c8c8; } .kc-qb2 { border-color: var(--q2); } .kc-qb3 { border-color: var(--q3); } .kc-qb4 { border-color: var(--q4); } .kc-qb5 { border-color: var(--q5); } .kc-qb6, .kc-qb7 { border-color: var(--q6); }

/* search */
.kc-search label { display: block; font: 600 14px/1.4 var(--sans); color: var(--muted); margin-bottom: 6px; }
.kc-search-row { display: flex; gap: 0; max-width: 720px; }
.kc-search input, .kc-search select, .kc-search button { font: 16px/1.2 var(--sans); padding: 11px 12px; border: 1px solid var(--gold-soft); background: #0a0d16; color: var(--ink); border-radius: 0; }
.kc-search input { flex: 1 1 auto; min-width: 0; }
.kc-search select { border-inline-start: 0; max-width: 40%; }
.kc-search button { border-inline-start: 0; background: var(--gold); color: #171105; font-weight: 700; cursor: pointer; }
.kc-search-big input { font-size: 19px; padding: 15px 16px; }

/* hub */
.kc-hub-head { padding: 18px 0 8px; }
.kc-toollist { margin: 0; display: grid; grid-template-columns: minmax(180px, 260px) 1fr; border-top: 1px solid var(--rule); }
.kc-toollist > div { display: contents; }
.kc-toollist dt, .kc-toollist dd { margin: 0; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.kc-toollist dt { font: 600 17px/1.4 var(--sans); padding-inline-end: 20px; }
.kc-toollist dd { color: #d9cfb6; }
.kc-count { font: 14px/1.4 var(--sans); color: var(--muted); }

/* the closing call to action */
.kc-close { margin-top: 56px; padding: 22px 0 0; border-top: 1px solid var(--rule); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; }
.kc-close p { margin: 0; font-size: 19px; }

/* tool pages: the shared head */
.kc-tool-head { margin-bottom: 18px; }
.kc-lost { max-width: 72ch; padding: 24px 0; }

@media (max-width: 720px) {
  body { font-size: 16px; }
  .kc-mast { min-height: 68px; }
  .kc-mast-nav { gap: 12px; }
  .kc-mast-nav .kc-signin, .kc-mast-nav .kc-sec { display: none; }
  .kc-brand img { width: 32px; height: 32px; }
  .kc-toollist { grid-template-columns: 1fr; }
  .kc-toollist dt { border-bottom: 0; padding-bottom: 0; }
  .kc-search-row { flex-wrap: wrap; }
  .kc-search select { border-inline-start: 1px solid var(--gold-soft); border-top: 0; max-width: none; flex: 1 1 50%; }
  .kc-search input { flex-basis: 100%; }
  .kc-search button { border-top: 0; flex: 1 1 30%; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
[dir="rtl"] .kc-crumbs li + li::before { content: "\\"; }

/* ---------------------------------------------------------------- database pages: the game's own interface */
.kc-entry { max-width: 1120px; }
.kc-origin { border-inline-start: 3px solid var(--gold); padding: 6px 12px; background: rgba(221, 180, 94, 0.07); font: 14px/1.5 var(--sans); max-width: 72ch; }
.kc-item-top, .kc-quest-top { display: grid; grid-template-columns: minmax(0, 460px) minmax(220px, 1fr); gap: 28px 40px; align-items: start; margin-bottom: 8px; }
.kc-quest-top { grid-template-columns: minmax(0, 640px) minmax(220px, 1fr); }
/* the item tooltip, large: icon outside on the left as on an item link */
.kc-tipbox { display: flex; gap: 10px; align-items: flex-start; }
.kc-icon-big { flex: 0 0 auto; border-width: 2px; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); }
.kc-tip { flex: 1 1 auto; min-width: 0; background: var(--tip-bg); border: 1px solid var(--tip-edge); border-radius: 5px; box-shadow: inset 0 0 0 2px #1d2030, 0 10px 30px rgba(0, 0, 0, 0.55); padding: 10px 14px 12px; font: 15px/1.38 var(--sans); color: #fff; }
.kc-tip p { margin: 0; }
h1.kc-tip-name { font: 600 22px/1.25 var(--sans); margin: 0 0 2px; letter-spacing: 0; }
.kc-tip-2 { display: flex; justify-content: space-between; gap: 16px; }
.kc-tip-green { color: var(--q2); }
.kc-tip-red { color: #ff2020; }
.kc-tip-set { color: var(--game-yellow); margin-top: 10px !important; }
.kc-tip-setitem { color: var(--q0); padding-inline-start: 10px; }
.kc-tip-setbonus { color: var(--q0); }
.kc-tip-flavor { color: var(--game-yellow); margin-top: 6px !important; }
.kc-tip-note { color: #fff; }
.kc-facts { border-collapse: collapse; width: 100%; font: 15px/1.45 var(--sans); font-variant-numeric: tabular-nums; }
.kc-facts th { text-align: start; font-weight: 400; color: var(--muted); padding: 6px 16px 6px 0; vertical-align: top; width: 42%; border-bottom: 1px solid rgba(154, 160, 174, 0.14); }
.kc-facts td { padding: 6px 0; border-bottom: 1px solid rgba(154, 160, 174, 0.14); }
.kc-facts ul { margin: 0; padding: 0; list-style: none; }
.kc-where { color: var(--muted); font-size: 14px; }
.kc-icon-s { margin-inline-end: 8px; border-radius: 3px; }
.kc-rel-text { color: #d9cfb6; }
.kc-note, .kc-cap { font: 13px/1.5 var(--sans); color: var(--muted); }
.kc-reagent { display: inline-flex; align-items: center; margin-inline-end: 12px; }
/* coins: the game's money icons (ui/moneyframe), plain discs without art */
.kc-money { white-space: nowrap; font-variant-numeric: tabular-nums; }
.kc-coin::after { content: ""; display: inline-block; width: 13px; height: 13px; margin-inline-start: 3px; vertical-align: -1px; border-radius: 50%; background-color: #c9a227; background-image: var(--kc-coins); background-size: 52px 13px; background-repeat: no-repeat; }
.kc-coin-g::after { background-position: 0 0; }
.kc-coin-s::after { background-position: -13px 0; background-color: #c0c0c8; }
.kc-coin-c::after { background-position: -26px 0; background-color: #b4692f; }
body[style*="--kc-coins"] .kc-coin::after { background-color: transparent; border-radius: 0; }
/* the quest log: parchment from the quest frame (ui/questframe), dark ink, item rewards in their dark frames */
.kc-log { color: #2b1a08; background-color: #dcc28f; background-image: var(--kc-parch); background-position: right bottom; background-size: 109.4% 145.5%; padding: 22px 26px 24px; border: 1px solid #5d4a2a; border-radius: 3px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); font: 17px/1.6 var(--serif); }
.kc-log a { color: #5a1d00; }
.kc-log a:hover { color: #000; }
.kc-log .kc-rel-text { color: #4a3a22; }
h1.kc-log-title { font-size: clamp(26px, 4vw, 34px); color: #261504; margin-bottom: 14px; }
h2.kc-log-h { font-size: 19px; color: #261504; margin: 18px 0 6px; }
.kc-log p { max-width: 64ch; }
.kc-log-h3 { font-weight: 700; margin: 10px 0 6px !important; }
.kc-log-small { padding: 14px 20px; font-size: 16px; }
.kc-objectives { list-style: none; padding: 0; margin: 0 0 8px; }
.kc-objectives li { padding-inline-start: 22px; background: var(--kc-bullet) no-repeat 0 4px / 16px 16px; }
.kc-rewards { list-style: none; padding: 0; margin: 0 0 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.kc-rewards li { display: flex; align-items: center; background: #15110a; border: 1px solid #3d2f17; border-radius: 3px; padding: 4px 8px 4px 4px; font: 14px/1.3 var(--sans); }
.kc-rewards li a, .kc-rewards li .kc-rel-text { color: inherit; }
.kc-rewards li a.q0, .kc-rewards li span.q0 { color: var(--q0); } .kc-rewards li .q1 { color: var(--q1); } .kc-rewards li .q2 { color: var(--q2); } .kc-rewards li .q3 { color: #3a9bff; } .kc-rewards li .q4 { color: #c27cff; } .kc-rewards li .q5 { color: var(--q5); }
.kc-count-x { color: #fff; margin-inline-start: 6px; }
.kc-log .kc-money { color: #261504; }
.kc-side .kc-facts th { width: 38%; }
.kc-chain { margin: 0 0 12px; padding-inline-start: 1.4em; }
.kc-chain li { margin: 2px 0; }
.kc-plain { list-style: none; margin: 0; padding: 0; }
/* lists */
.kc-listpage h1 .kc-page-n { color: var(--muted); font-size: 0.6em; font-weight: 400; }
.kc-pager { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 18px; font: 15px/1 var(--sans); }
.kc-pager a, .kc-pager span { padding: 8px 12px; border: 1px solid var(--gold-soft); text-decoration: none; }
.kc-pager span[aria-current] { background: var(--gold); color: #171105; border-color: var(--gold); }
.kc-tbl td .kc-icon-s { vertical-align: middle; }
.kc-book p { max-width: 64ch; }
@media (max-width: 860px) {
  .kc-item-top, .kc-quest-top { grid-template-columns: 1fr; }
  .kc-log { padding: 16px 16px 18px; }
  .kc-tipbox .kc-icon-big { width: 44px; height: 44px; }
}
/* hub: entry points as rows of links with their counts */
.kc-hub-db h3 { font: 600 16px/1.3 var(--sans); color: var(--game-yellow); margin: 22px 0 8px; }
.kc-linkrow { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font: 15px/1.5 var(--sans); }
.kc-linkrow .kc-n { color: var(--muted); font-variant-numeric: tabular-nums; margin-inline-start: 4px; }
.kc-hub-tools, .kc-hub-db { margin-top: 36px; }
/* instant search results: the game's tooltip panel under the field */
.kc-search { position: relative; }
.kc-search-list { position: absolute; z-index: 4; inset-inline: 0; top: 100%; max-width: 720px; margin: 2px 0 0; padding: 4px 0; list-style: none; background: var(--tip-bg); border: 1px solid var(--tip-edge); border-radius: 4px; box-shadow: 0 14px 34px rgba(0, 0, 0, 0.6); font: 15px/1.35 var(--sans); max-height: 60vh; overflow-y: auto; }
.kc-search-list a { display: flex; justify-content: space-between; gap: 16px; padding: 7px 12px; text-decoration: none; color: #fff; }
.kc-search-list li[aria-selected="true"] a, .kc-search-list a:hover { background: rgba(255, 209, 0, 0.1); }
.kc-search-type { color: var(--muted); font-size: 13px; }
.kc-search-note { padding: 8px 12px; color: var(--muted); }
.kc-search-all a { color: var(--gold); border-top: 1px solid rgba(154, 160, 174, 0.2); }
.kc-log :focus-visible, .kc-log a:focus-visible { outline-color: #5a1d00; }

/* ---------------------------------------------------------------- one layout for every entry (director A3)
   the entry's own panel + its facts on the left, relation sections in the wide column; no relations = one column */
.kc-split { display: grid; grid-template-columns: minmax(280px, 440px) minmax(0, 1fr); gap: 28px 44px; align-items: start; }
.kc-split-solo { grid-template-columns: minmax(0, 560px); }
.kc-split-main > * + * { margin-top: 18px; }
.kc-split-rel > section:first-child h2 { margin-top: 0; }
.kc-split-main .kc-facts th { width: 46%; }
/* name plate: the line the game draws over a creature (name in reaction colour, <subname>, level and rank) */
.kc-plate { background: var(--tip-bg); border: 1px solid var(--tip-edge); border-radius: 5px; padding: 12px 16px; box-shadow: inset 0 0 0 2px #1d2030; font: 15px/1.4 var(--sans); }
h1.kc-plate-name { font: 600 24px/1.2 var(--sans); margin: 0; color: #ffd100; }
.kc-plate-hostile h1.kc-plate-name { color: #ff2020; }
.kc-plate-friendly h1.kc-plate-name { color: #19ff19; }
.kc-plate-sub { margin: 2px 0 0; color: #fff; }
.kc-plate-level { margin: 6px 0 0; color: #d9cfb6; }
.kc-plate-desc { margin: 8px 0 0; color: #d9cfb6; font: 15px/1.5 var(--serif); }
.kc-plate-object h1.kc-plate-name, .kc-plate-zone h1.kc-plate-name, .kc-plate-faction h1.kc-plate-name { color: #ffd100; }
.kc-rank { color: var(--gold); }
.kc-rank-3 { color: #ff8040; }
.kc-react-hostile { color: #ff4d4d; } .kc-react-friendly { color: #3dff3d; } .kc-react-neutral { color: #ffd100; }
/* spell tooltip */
.kc-tip-head { align-items: baseline; }
.kc-tip-head h1.kc-tip-name { color: #fff; }
.kc-tip-rank { color: #9d9d9d; }
.kc-tip-desc { color: var(--game-yellow); margin-top: 6px !important; }
.kc-aura { margin-top: 10px; padding: 8px 12px; border-inline-start: 3px solid var(--tip-edge); font: 14px/1.45 var(--sans); color: #d9cfb6; }
.kc-aura-h { margin: 0 0 2px; color: var(--muted); }
.kc-tip-setonly h1.kc-tip-setname { color: var(--game-yellow); }
.kc-tip-setonly .kc-tip-setitem { display: flex; align-items: center; padding: 2px 0; }
/* the zone map: the game's map image with the spawn points as an SVG layer on top */
.kc-map { margin: 0 0 14px; }
.kc-map-box { position: relative; aspect-ratio: 1002 / 668; border: 1px solid #5d4a2a; border-radius: 3px; overflow: hidden; background: #1b1408; }
.kc-map-box img { display: block; width: 100%; height: 100%; }
.kc-map-box svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.kc-map-box circle { fill: rgba(255, 209, 0, 0.85); stroke: #2b1a08; stroke-width: 2; }
.kc-map-box text { fill: #1a1004; font: 700 13px var(--sans); text-anchor: middle; }
.kc-map figcaption { font: 14px/1.5 var(--sans); color: var(--muted); margin-top: 6px; }
@media (max-width: 860px) {
  .kc-split, .kc-split-solo { grid-template-columns: minmax(0, 1fr); }
}
.kc-boss h3 { font: 600 17px/1.3 var(--sans); margin: 14px 0 6px; }
.kc-loot { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; font: 14px/1.4 var(--sans); }
.kc-loot li { display: flex; align-items: center; }
.kc-loot .kc-n { color: var(--muted); margin-inline-start: 6px; font-variant-numeric: tabular-nums; }

.kc-cond { display: inline-block; margin-top: 2px; }
