/* KCD2DB: Bohemia, 1403. Dark: the soot brown of the game's inventory screen. Light: parchment, as in Henry's journal.
   The accent is the deep red of the game's banners; headings in Alegreya SC, close to the game's own serif. */
[data-theme="dark"] body[data-game="kingdom-come-deliverance-2"] {
  --bg: #15120f; --bg-2: #1a1612; --panel: #201b16; --panel-2: #29231c; --line: #352d24; --line-2: #4a3f31;
  --ink: #efe6d6; --ink-soft: #d3c7b2; --muted: #a0927b; --head: rgba(18, 15, 12, .96);
  --frame: #8b7148; --shade: rgba(14, 11, 8, .74);
}
[data-theme="light"] body[data-game="kingdom-come-deliverance-2"] {
  --bg: #f1e9d8; --bg-2: #e9dfca; --panel: #fbf7ee; --panel-2: #f4ecdc; --line: #dfd2b8; --line-2: #ccbb98;
  --ink: #261e15; --ink-soft: #40352a; --muted: #6f6150; --head: rgba(28, 22, 16, .97);
  --frame: #a3864f; --shade: rgba(30, 22, 14, .66);
}
body[data-game="kingdom-come-deliverance-2"] .top { border-bottom: 2px solid #8f2f1e; }
/* the mark: Kuttenberg's coat of arms from the game's map, before the site's name */
body[data-game="kingdom-come-deliverance-2"] .gname { padding-left: 46px; border-left: 0; background: url(img/towns/kutna_hora-arms.webp) 0 50% / 38px 38px no-repeat; }
body[data-game="kingdom-come-deliverance-2"] .logo + .gname { padding-left: 64px; border-left: 1px solid rgba(255, 255, 255, .16); background-position: 18px 50%; }
/* pickers: codex pictures stand tall, coats of arms keep their shape */
.picker-list img.tall { width: 60px; height: 104px; object-fit: cover; border-radius: 6px; }
img.arms { display: inline-block; vertical-align: middle; margin-right: 10px; object-fit: contain; }
.town-head { display: flex; gap: 22px; align-items: flex-start; margin: 4px 0 18px; }
.town-head > img.arms { width: 110px; height: 110px; flex: none; }
.town-lore { display: flex; gap: 16px; align-items: flex-start; max-width: 860px; }
.cx-pic { border-radius: 8px; border: 1px solid var(--frame); background: #1c1712; flex: none; }
.cx-pic.small { width: 120px; height: auto; }
.cx-entry { display: flex; gap: 24px; align-items: flex-start; }
.cx-entry .cx-pic { width: 300px; height: auto; }
.cx-entry.wide { flex-direction: column; }
.cx-entry.wide .cx-pic { width: 100%; max-width: 860px; }
.cx-pic.wide { width: 360px; height: auto; }
.town-lore.wide { flex-direction: column; }
.cx-text { max-width: 720px; }
.cx-thumb { display: inline-block; vertical-align: middle; width: 30px; height: 60px; object-fit: cover; border-radius: 4px; margin-right: 10px; }
.herb-pic { float: right; width: 200px; height: auto; margin: 0 0 12px 18px; border-radius: 8px; background: #f3ead6; }
.getit-line { font-size: 1.05em; }
@media (max-width: 700px) {
  .town-head, .town-lore, .cx-entry { flex-direction: column; }
  .cx-entry .cx-pic { width: 100%; max-width: 360px; }
  .herb-pic { float: none; display: block; margin: 0 0 12px; }
}
body[data-game="kingdom-come-deliverance-2"] .hero-art { background-color: #15120f; }
body[data-game="kingdom-come-deliverance-2"] .hero-art::after { background: linear-gradient(180deg, rgba(16, 12, 9, .1) 0%, rgba(16, 12, 9, .45) 55%, var(--bg) 100%); }
body[data-game="kingdom-come-deliverance-2"] .hero-art .crumbs, body[data-game="kingdom-come-deliverance-2"] .hero-art .crumbs a { color: #eadfca; }
body[data-game="kingdom-come-deliverance-2"] .picker-list img { border-color: var(--frame); background: radial-gradient(circle at 50% 40%, #3a3127, #17130f); }
body[data-game="kingdom-come-deliverance-2"] .hero-home { min-height: 0; aspect-ratio: 1600 / 520; max-height: 560px; }
@media (max-width: 979px) { body[data-game="kingdom-come-deliverance-2"] .hero-home { aspect-ratio: auto; } }
.home-first .picker { max-width: none; margin-top: 4px; }
.home-list li { margin: 6px 0; }

/* item icons: the game's 64 px inventory icons on a dark ground, like the inventory */
.ki { display: inline-block; vertical-align: middle; margin-right: 8px; border-radius: 4px; background: radial-gradient(circle at 50% 40%, #3a3127, #17130f); }
.ki.none { background: var(--panel-2); }
th .ki { margin-right: 10px; }
th small { display: block; margin-left: 42px; color: var(--muted); font-weight: 400; }
.item-head { display: flex; gap: 18px; align-items: flex-start; margin: 8px 0 18px; }
.item-head > .ki { width: 96px; height: 96px; flex: none; }
.item-head .facts { flex: 1; margin: 0; }
td.ids code { font-size: 12px; margin: 0 6px 4px 0; display: inline-block; }
@media (max-width: 640px) {
  .item-head { flex-direction: column; gap: 10px; }
  .item-head > .ki { width: 72px; height: 72px; }
  .item-head .facts { width: 100%; grid-template-columns: max-content 1fr; }
  .item-head .facts dt { border-bottom: 1px solid var(--line); padding-bottom: 8px; }
}
#t-quality td:nth-child(4) { white-space: nowrap; }
ul.getit li { margin: 8px 0; }

/* dice: the chance of each face as a small bar; 1 and 5 score, the devil joins a combination */
.faces { display: inline-flex; gap: 3px; align-items: flex-end; vertical-align: middle; }
.face { position: relative; width: 16px; height: 34px; display: inline-flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.face i { display: block; width: 12px; background: var(--line-2); border-radius: 2px 2px 0 0; min-height: 1px; }
.face.scores i { background: var(--game-ac, #b5442f); }
.face.devil i { background: #6b4a8c; }
.face b { font: 600 10px/1 var(--mono, monospace); color: var(--muted); margin-top: 2px; }
#dice-app { margin: 8px 0 20px; }
.dice-q { font-weight: 700; margin: 0 0 8px; }
.dice-hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px 16px; }
@media (max-width: 400px) { .dice-hand { grid-template-columns: 1fr; } }
.dice-slot { display: flex; align-items: center; gap: 8px; }
.dice-slot select { flex: 1; min-width: 0; padding: 6px; font: inherit; background: var(--panel); color: var(--ink); border: 1px solid var(--line-2); border-radius: 4px; }
.dice-pic { width: 40px; height: 40px; flex: none; }
.dice-pic img { border-radius: 4px; background: radial-gradient(circle at 50% 40%, #3a3127, #17130f); }
.dice-btns button { font: inherit; padding: 6px 12px; margin: 10px 8px 0 0; background: var(--panel-2); color: var(--ink); border: 1px solid var(--line-2); border-radius: 4px; cursor: pointer; }
.dice-btns button:hover { border-color: var(--game-ac, #b5442f); }
.dice-res { margin-top: 14px; border-collapse: collapse; }
.dice-res th { text-align: left; font-weight: 400; padding: 6px 18px 6px 0; }
.dice-res td { font: 700 20px/1.2 var(--display, serif); padding: 6px 0; }
.dice-res td small { font: 400 13px var(--sans, sans-serif); color: var(--muted); }
.dice-res td.wait { color: var(--muted); font-size: 15px; }
ol.steps li, ul.ings li { margin: 6px 0; }
/* the perk screen: dark like the game's character window, gold medallions, locked perks dark */
#perk-app { position: relative; }
.pk-screen { display: grid; grid-template-columns: 230px 1fr 320px; min-height: calc(100vh - 220px); border: 1px solid var(--frame); border-radius: 8px; overflow: hidden; background: radial-gradient(ellipse at 50% 0%, #2c241b, #14100c 70%); color: #efe6d6; }
.pk-skills { overflow-y: auto; padding: 10px 8px; background: rgba(0, 0, 0, .25); border-right: 1px solid #3b3126; }
.pk-group { margin: 10px 8px 4px; color: #a8957a; font-size: 12px; }
.pk-skills button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: none; color: #e9dcc4; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.pk-skills button small { margin-left: auto; color: #a8957a; }
.pk-skills button:hover, .pk-skills button[aria-current="true"] { background: rgba(181, 68, 47, .18); border-color: #6b4a2e; }
.pk-main { overflow-y: auto; padding: 14px 18px; }
.pk-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid #3b3126; padding-bottom: 12px; }
.pk-head h2 { margin: 0; color: #f3e6c9; }
.pk-desc { margin: 2px 0 0; color: #c9b89a; font-size: 14px; max-width: 520px; }
.pk-lvl { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 14px; color: #c9b89a; }
.pk-num { display: inline-flex; align-items: center; border: 1px solid #6b4a2e; border-radius: 6px; overflow: hidden; }
.pk-num button { width: 32px; height: 32px; border: 0; background: #2a2119; color: #f3e6c9; font-size: 18px; cursor: pointer; }
.pk-num input { width: 48px; height: 32px; border: 0; text-align: center; background: #1a140f; color: #f3e6c9; font: inherit; -moz-appearance: textfield; }
.pk-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 12px 0; border-bottom: 1px solid rgba(107, 74, 46, .35); }
.pk-level { color: #c79a5a; font-size: 13px; padding-top: 22px; }
.pk-cells { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; }
.pk-cell { display: flex; flex-direction: column; align-items: center; width: 96px; gap: 4px; padding: 4px; border: 1px solid transparent; border-radius: 8px; background: none; color: #efe1c6; font: inherit; font-size: 12.5px; line-height: 1.25; text-align: center; cursor: pointer; text-decoration: none; }
.pk-cell img { filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .6)); }
.pk-cell:hover, .pk-cell.on { border-color: #b5442f; background: rgba(181, 68, 47, .12); }
.pk-cell.hidden-perk img { outline: 2px dashed #8b7148; outline-offset: 2px; border-radius: 50%; }
.pk-cell.locked img { filter: grayscale(1) brightness(.45); }
.pk-cell.locked span { color: #7c6d5a; }
.pk-or { display: inline-flex; align-items: center; gap: 4px; padding: 2px 6px; border: 1px dashed #6b4a2e; border-radius: 10px; }
.pk-or em { color: #c79a5a; font-size: 12px; }
.pk-side { overflow-y: auto; padding: 16px; background: rgba(0, 0, 0, .3); border-left: 1px solid #3b3126; font-size: 14px; }
.pk-side h3 { margin: 6px 0 2px; color: #f3e6c9; }
.pk-big { display: block; margin: 0 auto 6px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .7)); }
.pk-meta, .pk-hint { color: #a8957a; margin: 0 0 8px; }
.pk-lore { border-top: 1px solid #3b3126; margin-top: 10px; padding-top: 6px; color: #cdbb9b; font-style: italic; }
.pk-link { background: none; border: 0; padding: 0; color: #e08a6c; font: inherit; cursor: pointer; text-decoration: underline; }
.pk-side a { color: #e08a6c; }
.pk-tip { position: absolute; z-index: 5; width: 270px; padding: 8px 10px; border-radius: 6px; background: #f5ecd9; color: #2a1d12; border: 1px solid #8b7148; box-shadow: 0 4px 14px rgba(0, 0, 0, .5); font-size: 13px; pointer-events: none; }
.pk-tip span { display: block; margin-top: 3px; }
@media (max-width: 980px) {
  .pk-screen { grid-template-columns: 1fr; }
  .pk-skills { display: flex; flex-wrap: wrap; gap: 4px; border-right: 0; border-bottom: 1px solid #3b3126; }
  .pk-skills button { width: auto; }
  .pk-group { width: 100%; }
  .pk-side { border-left: 0; border-top: 1px solid #3b3126; }
}
/* a book's pages: parchment, as Henry reads them */
.book-text { display: grid; gap: 14px; max-width: 760px; }
.book-page { padding: 14px 18px; border-radius: 6px; background: #efe4cb; color: #2b2015; border: 1px solid #c9b48a; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; line-height: 1.55; }
.book-page small { display: block; color: #7a6548; font-family: var(--sans, sans-serif); margin-bottom: 4px; }
hr.soft { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
/* horse stats as bars out of 30, like the game's horse window */
.hbar { display: inline-flex; align-items: center; gap: 6px; min-width: 96px; justify-content: flex-end; }
.hbar i { display: block; height: 7px; width: 60px; background: var(--line-2); border-radius: 4px; position: relative; overflow: hidden; }
.hbar i { background: linear-gradient(90deg, var(--game-ac, #b5442f) var(--w, 0), var(--line-2) 0); }
.hbar b { font-weight: 600; min-width: 18px; text-align: right; }
.hstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 22px; max-width: 760px; margin: 8px 0 14px; }
.hstats div { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); padding: 6px 0; }
