@font-face {
    font-family: "Nocturne";
    src: url("NocturneSerif-Regular.ttf") format("truetype");
    font-style: normal;
    font-display: swap;
}

:root {
  --heat: 46, 160, 90;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
	--bg: #15141b;
	--fg: #ecebf3;
	--mut: #9d9bab;
	--card: #1f1e29;
	--line: #1c2528;
	--acc: #F3E7CF;
	--hi: #2c5a45;
}

* {
  scrollbar-color: #8a7f6c transparent;
  scrollbar-width: thin;
}

html {
  scroll-padding-top: env(safe-area-inset-top, 0px);
}
body {
	font-family: "Nocturne", serif;
	margin: 0;
	color: #FEEDD1;
	background-color: black;
	font-size: 18px;
	line-height: 120%;
}

.tn>img {
    width: 38px;
    margin: -8px;
    margin-right: 0;
    margin-bottom: 0px;
}

h1 {
    font-size: 26px;
	line-height: 120%;
    margin: 0;
    position: absolute;
    left: 0%;
    width: 100%;
    text-align: center;
    top: 2.5vw;
	color: #F3E7CF;
    text-shadow: 0 0 2px #CAB99D,
        0 0 5px #CAB99D,
        0 0 10px #CAB99D,
        0 0 20px #CAB99D;
    font-weight: normal;
}

h2 {
  font-size: 16px;
	line-height: 120%;
  margin: 18px 0 6px;
}
p.m,
small {
  color: var(--mut);
}
p.m {
  margin: 0 0 10px;
  display: none;
}
.grid2 {
    width: 30.1vw;
	  display: inline-block;
    flex-shrink: 0;
    margin-top: -12px;
    overflow: auto;
    max-height: 100%;
}

.card {
  padding: 12px;
}

select,
input {
  width: 100%;
  box-sizing: border-box;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
[hidden] {
  display: none !important;
}

table {
  border-collapse: collapse;
  width: 100%;
}

th,
td {
  border: 1px solid var(--line);
  padding: 4px 8px;
  text-align: center;
  white-space: nowrap;
}

#gt {
    position: absolute;
    left: 7.85%;
    top: 22.6vw;
    font-size: 1.25vw;
    line-height: 150%;
    width: auto;
}

td#g-total {
    position: absolute;
    top: -2.8vw;
    left: 9.3vw;
}

div#abil {
    padding-bottom: 0;
}

#gt td {
    padding: 0;
    border: 0 solid transparent;
    text-align: right;
    white-space: nowrap;
    border-right-width: 2.2vw;
    border-bottom-width: 0.82vw;
    box-sizing: content-box;
    width: 6.7vw;
}

td.l {
  text-align: left;
}
td.pl {
  white-space: pre-line;
  min-width: 90px;
  max-width: 320px;
    font-size: 14px;
    line-height: 120%;
}
td.d {
  color: var(--mut);
}
td.bb {
  background: var(--hi);
}
td select {
  padding: 3px;
  min-width: 80px;
}
.ok {
  color: var(--acc);
}
.sk {
  padding: 10px;
}
.sk.nr {
  background: rgba(229, 72, 77, 0.16);
  border-color: #e5484d;
  color: #e5484d;
}
.sk.nr .rk {
  color: #e5484d;
}
.sh {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  justify-content: space-between;
}
.sh select {
  width: auto;
  min-width: 90px;
}
select.bb {
  background: var(--hi);
  color: var(--fg);
}
.sk ul {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.sk li {
  display: flex;
  gap: 8px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.rk {
    flex: none;
    position: relative;
    width: 1.8em;
    height: 1.8em;
    box-sizing: border-box;
    border: 2px solid var(--acc);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--acc);
    line-height: 2em;
}

.rk i {
  position: absolute;
  right: -5px;
  bottom: -5px;
  width: 13px;
  height: 13px;
  color: var(--acc);
  font-style: normal;
  font-size: 13px;
  line-height: 15px;
  text-align: center;
  font-weight: 700;
  text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
}

.ln .rk {
  width: 1.8em;
  height: 1.8em;
  font-size: 10px;
  margin: 0;
}

.si {
      height: 1.2em;
  width: auto;
  vertical-align: middle;
}

.ln .si {
  height: 20px;
}

.chp {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 2px 8px 2px 0;
    vertical-align: middle;
}

.sw {
  position: relative;
  flex: none;
  display: inline-flex;
}

.bn {
    position: absolute;
    right: 0px;
    top: 0px;
    background: rgba(0, 0, 0, 0.67);
    color: var(--acc);
    font-style: normal;
    font-size: 0.6vw;
    line-height: 120%;
    font-weight: 700;
    border-radius: 50%;
    padding: 3px;
    z-index: 1;
    aspect-ratio: 1;
    border: 2px solid var(--acc);
}

.li0 {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}

.sk li {
  align-items: flex-start;
}

.sk li:first-child {
    border-top: 0;
}

.br {
  flex-basis: 100%;
  height: 0;
}

.ds {
  white-space: pre-line;
  margin-top: 4px;
}
summary {
  cursor: pointer;
  font-weight: 700;
}
details[open] {
  padding-bottom: 4px;
}
.st {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 4px;
  color: var(--mut);
}
.st b {
  color: var(--fg);
}
.boon,
.bane {
  padding: 1px 8px;
  border-radius: 6px;
  background: #f1efe6;
}
.boon {
  color: #b8860b;
}
.bane {
  color: #1e3a8a;
}

.row {
    padding-left: 10px;
}

.row:first-child {
    padding-left: 0;
    font-size: 32px;
    line-height: 120%;
    padding-top: 0.4vw;
}
.row:first-child button {
    text-shadow: 0 0 2px #CAB99D, 0 0 5px #CAB99D, 0 0 10px #CAB99D, 0 0 20px #CAB99D;
    padding-bottom: 0;
}

.row small,
.ab small {
  white-space: pre-line;
    margin-top: 4px;
    display: inline-block;
}
.ab {
  margin: 8px 0;
}
.pk {
  box-sizing: border-box;
  padding: 0.4vw 1vw;
  color: #FEEDD1;
  font: inherit;
  text-align: left;
  cursor: pointer;
    background: transparent;
    border: 0;
    pointer-events: all;
}
div#mrow button {
    padding-top: 0;
}

#md {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px 12px;
  box-sizing: border-box;
}
.mb {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
}
.mh {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px;
}
.mh input {
  flex: 1;
}
.mh .pk {
  width: auto;
}
#mc {
  overflow: auto;
  padding: 0 10px 10px;
}
.tg {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 6px;
}
.tg.w {
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.wrap {
    margin: auto;
    position: relative;
}

.tile {
  background: var(--card);
  border-radius: 10px;
  padding: 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  font-size: 16px;
  line-height: 120%;
}

.tg:not(.w) .tile {
  text-align: center;
  padding: 0;
}

.tg:not(.w) .tile b {
    position: absolute;
    top: 5px;
    text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
    width: 100%;
    left: 0;
}

.tile.sel {
  background: #343347;
}

.im {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    line-height: 120%;
    font-weight: 700;
    color: var(--mut);
    overflow: hidden;
    margin-top: 10px;
}
.im img,
.im video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.gh {
  margin: 14px 0 6px;
  font-weight: 700;
  color: var(--acc);
}
.ln {
  font-size: 14px;
	line-height: 120%;
  margin-top: 3px;
  white-space: pre-line;
  color: var(--mut);
}

.tile > small {
  color: var(--mut);
}

.pc {
    display: flex;
    align-items: flex-start;
    position: absolute;
    left: 6.38%;
    margin: 0;
    padding: 0;
    top: 5.96vw;
    width: 27.03%;
    height: 13.05vw;
    overflow: hidden;
}

.pf {
  flex: 1;
  min-width: 0;
  position: relative;
  height: 100%;
    pointer-events: none;
}
.pt {
    flex: none;
    width: 12vw;
    cursor: pointer;
    position: absolute;
    right: 0;
    bottom: 0;
    height: 97%;
}
.pt .im {
  margin: 0;
  height: 100%;
    border-radius: 0;
}

div#lt {
    flex-grow: 1;
    padding: 12px;
    box-sizing: border-box;
    gap: 0.5em;
    padding-top: 0;
    overflow: auto;
    max-height: 100%;
}

section {
    padding-left: 35%;
    padding-top: 5.8vw;
    padding-right: 2.5%;
    padding-bottom: 2.2vw;
    background: url(background.png);
    background-repeat: no-repeat;
    background-size: 100%;
    position: relative;
    aspect-ratio: 1.85567;
    box-sizing: border-box;
}

.mainWrapper {
    display: flex;
    max-height: 100%;
    overflow: auto;
    width: 100%;
}

/* class picker: allowed-skill icons on the name line, right aligned */
.tn {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tn .al {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.tn .chp {
  margin: 0 0 0 6px;
}

.sks {
    display: flex;
    flex-wrap: wrap;
    padding: 0.5vw;
    position: absolute;
    bottom: 0;
}

.ski {
  display: inline-flex;
}

.ski.off {
    filter: brightness(0.33);
}

.ski .si {
    height: 1.5vw;
    padding-right: 0.5vw;
    padding-top: 0.5vw;
}

.gm {
  color: #F3CC4B;
}

#gt td {
  cursor: pointer;
}

#tip {
  position: fixed;
  z-index: 20;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

#tip hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

td.gm {
  position: relative;
}

td.gm::after {
    content: "";
    position: absolute;
    right: -0.8vw;
    top: 0.5vw;
    width: 0;
    height: 0;
    border-left: 0.3vw solid transparent;
    border-right: 0.3vw solid transparent;
    transform: translateY(-50%);
}

td.gm.up::after {
  border-bottom: 7px solid currentColor;
}

td.gm.dn::after {
  border-top: 7px solid currentColor;
}

.mv {
    position: absolute;
    top: 19.8vw;
    left: 28vw;
    text-align: right;
    width: 5vw;
    font-size: 1.25vw;
    line-height: 150%;
}

.chp .bn {
    font-size: 10px;
    padding: 1px;
    border-width: 1px;
    right: -5px;
    top: -5px;
}

.bt {
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-top: 8px;
}

.sc {
  margin-top: 8px;
}

.bt::before {
  content: "";
  display: inline-block;
  margin-right: 8px;
  border-left: 7px solid currentColor;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.bt.open::before {
  transform: rotate(90deg);
}

.wrapper {
    overflow: hidden;
    max-width: 100vw;
    max-height: 100vh;
}