:root {
  --color1: lightblue;
  --color2: lightgreen;
  --color3: lightyellow;
  --color4: lightpink;
  --body_bg: #F5F5F5;
  --body_text: black;
  --link_active: blue;
  --link_focus: red;
  --table_border: black;
  --checkbox_bg: white;
  --checkbox_selected: red;
  --comment_text: #79649b;
  --list_bg: white;
  --list_border: black;
  --tooltip_bg: #F5F5F5;
  --shadow_color: rgba(0, 0, 0, 0.1)
}
@media (prefers-color-scheme: dark) {
  :root {
    --color1: #171717;
    --color2: #183920;
    --color3: #172446;
    --color4: #553143;
    --body_bg: #212121;
    --body_text: white;
    --link_active: #8a90b8;
    --link_focus: red;
    --table_border: gray;
    --checkbox_bg: black;
    --checkbox_selected: red;
    --comment_text: lightyellow;
    --list_bg: black;
    --list_border: gray;
    --tooltip_bg: #0A0A0A;
  --shadow_color: rgba(255, 255, 255, 0.1)
  }
}

body {
    background-color: var(--body_bg);
    color: var(--body_text);
    margin: 20px;
    margin-bottom: 0px;
}
body.night_mode { 
    background-color: #212121;
    color: white;
}

a, a:active {
    text-decoration: none;
    color: var(--link_active);
}
a:hover, a:focus {
    text-decoration: underline;
    color: var(--link_focus);
}
label, label:active {
    display: grid;
    place-items: center;
    height: 100%;
    line-height: 100%;
    cursor: pointer;
    color: var(--link_active);
}
label:hover {
    background-blend-mode: overlay;
    background-color: var(--shadow_color);
}

table {
    font: 135% monospace; 
    border-collapse: collapse;
}
table th {
    height: 2em;
    text-align: center;
    font-weight: bold;
    border: 2px solid var(--table_border);
    padding: 5px 10px 5px 10px;
    box-sizing: border-box;
}
table td {
    text-align: left;
    border: 1px solid var(--table_border);
    padding: 3px 10px 3px 10px;
    box-sizing: border-box;
}
table th:has(> label) {
    padding: 0;
}
table td img {
    display: block;
    width: 50px;
    height: 50px;
    margin-left: auto;
    margin-right: auto;
}
table img:after {
    content: '';
    background: url(/files/public/images/kapiba_logo_round.png);
    background-size: 100%;
    display: block;
    width: 50px;
    height: 50px;
    margin-left: auto;
    margin-right: auto;
}
table.fixed {
    table-layout: fixed;
}

th input, td input {
    width: 100%;
    height: 100%;
    border: none;
    background-color: transparent;
    color: var(--body_text);
    box-sizing: border-box;
    outline: none;
    padding: unset;
    font: 100% monospace;
    text-align: center;
}
input[type="checkbox"]{
    -webkit-appearance: initial;
    appearance: initial;
    border: 1px solid var(--table_border);
    border-radius: 3px;
    background: var(--checkbox_bg);
    display: block;
    width: 20px;
    height: 20px;
    margin-left: auto;
    margin-right: auto;
}
input[type="checkbox"]:checked {
    background: var(--checkbox_selected);
}

.gone {
    display: none;
}
.hidden {
    visibility: hidden;
    border: none;
    padding: 0px;
}
.dotted {
    position: relative;
    display: inline-block;
    border-bottom: 2px dotted var(--body_text);
}
.middle {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}
.centered {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}
.width25 {
    min-width: 25%;
}

pre {
    white-space: pre-wrap;
    white-space: -moz-pre-wrap;
    white-space: -pre-wrap;
    white-space: -o-pre-wrap;
    word-wrap: break-word;
}
.header { 
    font: 150% monospace; 
    font-weight: bold; 
}
.readme { 
    font: 135% monospace; 
}
.list {
    background-color: var(--list_bg);
    padding-top: 15px;
    padding-bottom: 15px;
    border-top: 1px solid var(--list_border);
    border-bottom: 1px solid var(--list_border); 
}

.tooltiptext {
    visibility: hidden;
    position: absolute;
    height: auto;
    width: 20em;
    border: 1px solid var(--table_border);
    color: var(--body_text);
    text-align: center;
    border-radius: 5px;
    padding: 0.5em;
    bottom: 135%;
    left: 50%;
    transform: translate(-50%);
}
.warning.tooltiptext {
    visibility: visible;
    background-color: var(--color4);
}
.confirm.tooltiptext {
    visibility: visible;
    background-color: var(--color2);
}
.subinfo.tooltiptext {
    visibility: visible;
}

.dt-scroll-body {
    scrollbar-width: thin;
}
.dt-scroll-body::-webkit-scrollbar {
    width: 2px;
}
.dt-scroll-body thead tr {
    visibility: collapse;
}
.dt-scroll-body thead th {
    border-top: none;
    border-bottom: none;
}
.dt-scroll-body tbody tr:hover td, tr.selected td {
    background-blend-mode: overlay;
    background-color: var(--shadow_color);
}
.dt-scroll-body .icon,
.dt-scroll-body .regval {
    min-width: 4em;
}

.dt-scroll-body tr td.swaptext {
    transition: opacity 0.2s linear;
}
.dt-scroll-body tr td.swaptext .name {
    transition: inherit;
    height: unset;
    opacity: 1;
}
.dt-scroll-body tr td.swaptext .comment {
    color: var(--comment_text);
    transition: none;
    height: 0;
    opacity: 0;
}
.dt-scroll-body tr.selected td.swaptext .comment {
    transition: inherit;
    height: unset;
    opacity: 1;
}
.dt-scroll-body tr.selected td.swaptext .name {
    transition: none;
    height: 0;
    opacity: 0;
}

.spinner-container {
    display: grid;
    place-items: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.spinner {
    border: 6px solid rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border-left-color: #09f;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.level_0, .color1 {
    background-image: linear-gradient(to right, var(--color1), var(--color1));
}
.level_1, .color2 {
    background-image: linear-gradient(to right, var(--color2), var(--color2));
}
.level_2, .color3 {
    background-image: linear-gradient(to right, var(--color3), var(--color3));
}
.franken, .color4 { 
    background-image: linear-gradient(to right, var(--color4), var(--color4));
}
.color1.color2 {
    background-image: linear-gradient(to bottom right, var(--color1) 50%, var(--color2) 50%);
}
.color2.color3 {
    background-image: linear-gradient(to bottom right, var(--color2) 50%, var(--color3) 50%);
}
.color1.color3 {
    background-image: linear-gradient(to bottom right, var(--color1) 50%, var(--color3) 50%);
}
