/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* donjon.css
 *
 * copyright (c) 2009-2024 drow <drow@bin.sh>
 * all rights reserved
*/

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* common */

  h1 { text-align: center; }
  hr { border: none; border-top: 1px solid; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* font-family */

  body { font-family: 'Asul', sans-serif; }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* structure */

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* header */

  .layout_header a { text-decoration: none; }
  .layout_header p.subtitle { margin-top: -2ex; text-align: center; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* navigation */

  .layout_nav {
    border-right: 1px solid #999999;
    padding-bottom: 4ex;
  }
  .layout_nav .widgets {
    margin-top: 8ex;
    text-align: center;
  }
  .layout_nav .widget {
    margin-top: 4ex;
  }
  .layout_nav .widget input[type="button"] {
    min-width: 150px;
    padding: 1ex 2em;
    border-radius: 1ex;
  }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* search index */

  .search_index { display: flex; text-align: center; }
  .search_index_box { flex: 1; display: flex; flex-direction: column; }

  .search_index input {
    flex: 1;
    margin: 1em;
    border: 1px solid #999999;
    border-radius: 0.5ex 0.5ex 0px 0px;
    padding: 1ex 1em;
    padding-left: 5ex;
    background-color: white;
    background-image: url('https://khazad-cdn.com/mines/a7cc82ccf8ee431895a3e9caadb3b306-2b6c859b5b3344bc725ca9cbf9e42b1f.png');
    background-size: 3ex 3ex;
    background-position: 1ex center;
    background-repeat: no-repeat;
    font-family: 'Asul', sans-serif;
  }
  .index_results {
    position: absolute;
    margin: 0px 1em;
    margin-top: calc(0px - 1em - 1px);
    border: 1px solid #999999;
    border-radius: 0px 0px 0.5ex 0.5ex;
    width: calc(100% - 2em - 2px);
    padding-bottom: 1ex;
    background: #ffffff;
    font-family: 'Asul', sans-serif;
  }
  .index_results li { text-align: left; }
  .index_results li.selected { background: #cccccc; }
  .index_results:hover li.selected { background: none; }
  .layout_nav .index_results ul li { padding-left: 5ex; font-size: 80%; }

  .index_results a {
    white-space: nowrap;
    overflow-x: hidden;
    text-overflow: ellipsis;
  }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* nav menu */

  .layout_nav h2 { margin: 1ex 1ex; font-size: 100%; cursor: pointer; }
  .layout_nav h2 span.disclose { display: inline-block; width: 2ex; }
  .layout_nav div.list { margin: 1ex 1em; }
  .layout_nav ul { margin: 0px; padding: 0px; list-style: none; }
  .layout_nav ul li { padding: 3px 1em; font-size: 80%; }
  .layout_nav ul li:hover { background: #cccccc; }
  .layout_nav a { display: block; text-decoration: none; color: #000000; }
  .layout_nav a:link { color: #000000; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* content */

  .layout_content {
    padding: 1ex 2em;
    padding-bottom: 2em;
  }
  .layout_content h1 { margin: 2ex 2em; text-align: center; }
  .layout_content h2 { margin: 2ex 0em; }
  .layout_content h3 { margin: 2ex 1em; }

  .layout_content a:link { color: #0000cc; }
  .layout_content a:hover { color: #0000ff; }
  .layout_content a:active { color: #0000cc; }
  .layout_content a:visited { color: #0000cc; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* footer */

  .layout_footer { text-align: center; font-size: 80%; }
  .layout_footer p { text-align: center; }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* content tricks */

  p.intro {
    margin-bottom: 6ex;
    border: 1px solid #cccccc;
    border-radius: 2ex 0px;
    padding: 1ex 2em;
    background: #f0f0f0;
  }
  div.source_code {
    margin: 4ex 2em;
    border: 1px solid;
    border-radius: 1ex;
    max-height: 50ex;
    overflow: auto;
  }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* footnotes */

  div.footnotes {
    margin-top: 6ex;
    padding: 0px 10%;
    text-align: center;
    font-size: 80%;
  }
  div.footnotes p { text-align: center; }
  div.footnotes span.def { white-space: nowrap; margin: 0px 1em; }
  div.footnotes span.def b { margin-right: 0.5em; }

  div.footnotes + div.footnotes {
    margin-top: 2ex;
  }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* link blocks */

  .link_block { display: flex; margin: 2ex 2em; }
  .link_block div.img { flex: 0 0 100px; text-align: center; }
  .link_block div.desc { flex: 1; margin-left: 2em; }
  .link_block div.desc h3 { margin: 1ex 0px; margin-top: 0px; }
  .link_block div.desc p { margin: 1ex 0px; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* link icons */

  img.axe { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px 0px; }
  img.calc { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -50px; }
  img.coins { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -100px; }
  img.dice { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -150px; }
  img.dragon { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -200px; }
  img.dungeon { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -250px; }
  img.system { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -300px; }
  img.tavern { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -350px; }
  img.tome { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -400px; }
  img.weather { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -450px; }
  img.world { background: url('https://khazad-cdn.com/mines/c4db56e60350220829087a6f228f3964-96ac3390a611c34f4072aefbc1a09051.gif') 0px -500px; }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* form tricks */

  h3.error {
    margin: 4ex 10%; border: 1px solid; padding: 1ex 5%;
    text-align: center; color: #cc0000;
  }

  table.form table.form { margin: 0px; }
  table.form select { min-width: 10em; }
  table.form select.num { min-width: 5em; }
  table.form td.compact select { min-width: 5em; max-width: 10em; }

  td.preview { padding-left: 2em; }
  td.preview h3 { margin: 0px; margin-bottom: 1ex; }
  td.preview div.img { width: 201px; overflow: hidden; }

  option.in1 { padding-left: 1em; }
  option.in2 { padding-left: 2em; }

  img.svg_icon { max-width: 24px; max-height: 24px; }

/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
/* scripted form */

  form.scripted {
    width: max-content;
    margin: 2ex auto;
  }
  form.scripted.stats {
    width: auto;
  }
  form.scripted div.out_wrapper {
    margin: 2ex 2em;
  }
  form.scripted div.out_wrapper textarea {
    width: calc(100% - 1em - 2px);
  }
  form.scripted div.out {
    margin: 2ex 2em;
  }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* flexform */

  div.flexform {
    margin: 2ex 2em;
    border: 1px solid #cccccc; border-radius: 0.5ex;
  }
  div.flexform.px800 {
    width: 800px;
    margin: 2ex auto;
  }
  div.flexform.content {
    max-width: min-content;
    margin: 2ex auto;
  }

  div.flexcols {
    display: flex;
    margin: 1ex 0em;
    flex-flow: row nowrap; align-items: top;
  }
  div.flexcols > div {
    flex-basis: 25%;
    flex-grow: 1;
  }
  div.flexcols > div.flexcol {
    margin: 0px;
    margin-left: 1em;
  }
  div.flexcols > div.flexgroup {
    margin: 0px;
    margin-left: 1em;
  }
  div.flexcols > div:last-child {
    margin-right: 1em;
  }

  div.flexcol > div.flexgroup {
    margin: 0px;
    margin-bottom: 1ex;
  }
  div.flexcol > div:last-child {
    margin-bottom: 0px;
  }

  div.flexgroup {
    margin: 1ex 1em;
    border: 1px solid #cccccc; border-radius: 0.5ex;
  }
  div.flexrow {
    padding: 1ex 1em;
    display: flex;
    flex-flow: row nowrap; align-items: top;
  }
  div.flexform.content div.flexrow {
    padding: 1ex 2em;
  }
  div.flexrow:first-child {
    border-radius-top-left: 0.5ex;
    border-radius-top-right: 0.5ex;
  }
  div.flexrow:last-child {
    border-radius-bottom-left: 0.5ex;
    border-radius-bottom-right: 0.5ex;
  }
  div.flexrow:hover {
    background: #dedede;
  }

  div.flexrow > div {
    flex-basis: 25%;
    flex-grow: 1;
  }
  div.flexrow > div.label_column {
    margin-top: 0.5ex;
    margin-right: 1em;
    text-align: right;
    font-weight: bold;
  }
  div.flexrow > div.input_column select {
    min-width: 10em;
  }
  div.flexrow > div.input_column p {
    margin: 0px;
  }
  div.flexrow > div.input_column p + p {
    margin-top: 1ex;
  }
  div.flexrow > div.flex_column {
    display: flex;
    flex-flow: row nowrap; align-items: center;
  }

  div.flex_column > div {
    flex-basis: 25%;
    flex-grow: 1;
  }
  div.flex_column > div.label_column {
    margin-top: 0.5ex;
    margin-right: 1em;
    text-align: right;
    font-weight: bold;
  }

  div.flexgroup.preview {
    text-align: center;
  }
  div.flexgroup.preview > div.sticky {
    position: sticky;
    top: 2ex;
    margin-bottom: 2ex;
  }
  div.flexgroup.preview h2 {
    text-align: center;
  }
  div.flexgroup.preview p {
    text-align: center;
  }

  div.flexrow.actions {
    white-space: nowrap;
  }
  div + div.flexrow.actions {
    margin-top: 1ex;
  }
  div.flexrow > div.actions {
    text-align: center;
  }
  div.flexrow > div.actions > input[type="button"] {
    margin: 0px 1em;
  }
  div.flexrow.actions + div.flexrow {
    margin-top: 1ex;
  }

  div.flexrow.disabled {
    color: #999999;
  }
  div.flexrow.disabled:hover {
    background: none;
  }

  div.flexgroup.disabled {
    color: #999999;
  }
  div.flexgroup.disabled div.flexrow:hover {
    background: none;
  }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* rpc output */

  div.out {
    margin: 0px;
    border: 1px solid #cccccc; border-radius: 0.5ex;
    width: 40em;
    padding: 0ex 1em;
  }
  div.out > * { margin: 1ex 0em; }
  div.out > div { margin: 0px; }
  div.out > div > * { margin: 1ex 0em; }
  div.out ol li { padding: 0.5ex 0.5em; }
  div.out ol li:hover { background: #f0f0f0; }
  div.out hr { border-color: #cccccc; }

  ol.manifest div.row { position: relative; }
  ol.manifest div.copied {
    position: absolute; top: 0px; right: 0px;
    width: min-content;
    border-radius: 0.5ex; padding: 0.5ex 1em; background: #333333;
    font-size: 75%; font-weight: bold; color: #ffffff;
    opacity: 1; transition: opacity 3s;
  }
  ol.manifest div.faded { opacity: 0; }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* gen sheet */

  div.gen_page {
    margin: 4ex 2em;
  }
  div.gen_sheet {
    padding: 1ex 1em;
  }
  div.gen_sheet div.section {
    margin-bottom: 1ex;
  }
  div.gen_sheet div.section.primary {
    display: flex;
    flex-direction: row-reverse;
  }
  div.gen_sheet div.image {
    flex: 0 0 min-content;
    margin-left: 1em;
  }
  div.gen_sheet div.statblock {
    flex: 1 1 100%;
  }
  div.gen_sheet div.row {
    display: flex;
  }
  div.gen_sheet div.row > div {
    flex: 1 1 50%;
    padding: 0px 0.5em;
  }
  div.gen_sheet div.cell {
    display: flex;
  }
  div.gen_sheet div.cell > div {
    flex: 1 1 50%;
    padding: 0.5ex 0.5em;
  }
  div.gen_sheet div.nowrap {
    white-space: nowrap;
  }
  div.gen_sheet div.key {
    font-weight: bold;
    white-space: nowrap;
  }
  div.gen_sheet div.key.min {
    flex: 0 0 8em;
  }
  div.gen_sheet.classic div.key {
    text-align: right;
  }
  div.gen_sheet.modern div.cell {
    border: 1px solid;
    margin-bottom: 1ex;
  }
  div.gen_sheet.modern div.cell + div.cell {
    margin-left: 1em;
  }
  div.gen_sheet.modern div.key {
    font-size: smaller;
  }

  @media only screen and (max-width: 1023px) {
    div.gen_sheet div.section.primary {
      flex-direction: column;
    }
    div.gen_sheet div.image {
      margin-left: 0px;
      margin-bottom: 2ex;
      text-align: center;
    }
  }

/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* stats table */

  table.stats {
    margin: 2ex auto;
    border: none;
    border-top: 1px solid;
    border-color: #cccccc;
  }
  table.stats table {
    margin: 4px;
    border: none;
    border-top: 1px solid;
    border-color: #cccccc;
    width: 100%;
  }

  table.stats tr.selected td { background: #deffde; }
  table.stats tr:hover td { background: #dedede; }
  table.stats tr.empty:hover td { background: none; }
  table.stats tr:hover ol li:hover { background: #ffffff; }
  table.stats tr:hover table tr:hover td { background: #ffffff; }
  table.stats tr:hover table tr.empty:hover td { background: none; }
  table.stats tr:hover table tr:hover ol li:hover { background: #dedede; }

  table.stats th {
    padding: 1ex 1em;
    background: #000000;
    color: #ffffff;
  }
  table.stats td {
    border: none;
    border-bottom: 1px solid;
    border-color: #cccccc;
    padding: 4px 1em;
    vertical-align: top;
  }
  table.stats td.icon img {
    border: 1px solid;
    border-color: #cccccc;
  }
  table.stats td.section_title {
    width: 8em;
    padding-top: 8px;
    text-align: right;
    white-space: nowrap;
    font-size: 120%;
    font-weight: bold;
  }
  table.stats td.detail {
    width: 8em;
    text-align: right;
    white-space: nowrap;
    font-style: italic;
  }
  table.stats td.key {
    width: 8em;
    text-align: right;
    white-space: nowrap;
    font-weight: bold;
  }

  table.stats td.value { vertical-align: bottom; }
  table.stats td.value p { margin: 0px 0px 0px 0px; }
  table.stats td.value p + p { margin-top: 1ex; }
  table.stats td.value ol { margin: 0px 0px 2ex 2em; padding: 0px; }
  table.stats td.value ol li { margin: 0px; padding: 2px 0.5em; }
  table.stats td.value hr { margin: 4px 0em; border-color: #cccccc; }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* screen */

  @media screen {
    body { display: flex; flex-direction: column; }
    .layout_header { flex: 1; }
    .layout_page { flex: 1; display: flex; align-items: stretch; }
    .layout_nav { flex: 0 0 16em; }
    .layout_content { flex: 1; }
    .layout_content.content_overflow { flex: 1; overflow-x: scroll; }
    .layout_footer { flex: 1; }

    body { background: #000000; }
    .layout_header { background: #000000; color: #ffffff; }
    .layout_header a { color: #ffffff; }
    .layout_nav { background: #dedede; }
    .layout_content { background: #ffffff; }
    .layout_footer { background: #000000; color: #ffffff; }
    .layout_footer a { color: #ffffff; }

    .layout_header.ukraine {
      background-image: linear-gradient(to bottom, #0057B8, #0057B8 50%, #FFD700 50%, #FFD700);
      background-size: cover;
      background-repeat: no-repeat;
      border-bottom: 1px solid black;
    }
    .source_code {
      border-color: #333333;
      background: #333333;
      color: #33ff33;
    }

    /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
    /* dark mode */

    * { transition: filter 0.5s; }
    body.dark_mode { filter: invert(100%); }
    body.dark_mode .undark { filter: invert(100%); }

    body.dark_mode .layout_header { filter: invert(100%); }
    body.dark_mode .layout_footer { filter: invert(100%); }
    body.dark_mode .true_color { filter: invert(100%); }

    body.dark_mode .layout_header { border-bottom: 1px solid #999999; }
    body.dark_mode .layout_footer { border-top: 1px solid #999999; }

    body.dark_mode th { background: #cccccc; color: #000000; }

    body.dark_mode .layout_content a:link { color: #666600; }
    body.dark_mode .layout_content a:hover { color: #666600; }
    body.dark_mode .layout_content a:active { color: #666600; }
    body.dark_mode .layout_content a:visited { color: #666600; }

    body.dark_mode input[type="checkbox"] { filter: invert(100%); }
    body.dark_mode input[type="image"] { filter: invert(100%); }
    body.dark_mode canvas { filter: invert(100%); }
    body.dark_mode img { filter: invert(100%); }
    body.dark_mode img.bw { filter: invert(0%); }
    body.dark_mode .lunar { filter: invert(100%); }
  }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* mobile */

  @media screen and (hover: none) {
    .layout_nav { display: none; }

    .link_block div.img { display: none; }
    .link_block h3 { margin: 0px; }
    .link_block p { margin: 0px; }

    div.flexrow { display: block; }
    div.flexrow > div.label_column { padding: 0.5ex 0.5em; text-align: left; }
    div.flexrow > div.input_column { padding: 0.5ex 0.5em; text-align: left; }
  }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
/* print */

  @media print {
    body { padding: 0px 1ex; }

    .layout_header {
      border: 1px solid;
      border-color: #333333;
      box-shadow: 0.5ex 0.5ex 0.5ex #999999;
    }
    .layout_header h1 { margin: 1ex 0px; padding: 0px; }
    .layout_header a { color: #000000; }

    .layout_nav { display: none; }
    .layout_footer { border: 1px solid; border-color: #333333; }
    .layout_footer a { color: #000000; }

    p.subtitle { display: none; }
    th.ctrl { display: none; }
    td.ctrl { display: none; }
  }

/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
