html{background:#fff;box-sizing:border-box;font-size:16px;}body{background:#fff}*,*:before,*:after{box-sizing:inherit;}body,h1,h2,h3,h4,h5,h6,p,ol,ul{margin:0;padding:0;font-weight:normal;}img{max-width:100%;height:auto;}

.dark-mode, .dark-mode body {
    background-color: #222;
    color: #eee;
}

body > header {
    display: flex;
    justify-content: space-between;
    margin: 0.3rem 0 1rem 0;
    align-items: center;
}

body > footer {
    display: flex;
    justify-content: space-between;
    color: #444;
    padding: 1rem 1.5rem;
}
body > footer a {
    color: #000;
}
.dark-mode body > footer {
    color: #999;
}
.dark-mode body > footer a {
    color: #bbb;
}

h1 {
    font-size: 1.6rem;
    margin-left: 0.3rem;
}
@media (min-width: 450px) {
    h1 {
        font-size: 2rem;
        margin-left: 1rem;
    }
}

#game-time {
    font-size: 1.2rem;
    width: 5rem;
    text-align: right;
    border: 1px solid #000;
    border-radius: 0.3rem;
    padding: 0.1rem 0.2rem;
}
.dark-mode #game-time {
    border-color: #eee;
}

h2 {
    text-align: center;
    width: 70%;
    margin: 0 auto;
    border-bottom: 1px solid #666;
    margin-bottom: 1rem;
}
.dark-mode h2 {
    border-bottom: 1px solid #bbb;
}
h3 {
    margin-top: 0.5rem;
    font-weight: bold;
}

.disabled {
    filter: grayscale(1);
}

header nav ul {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}
header nav li {
    margin-right: 0.7rem;
    cursor: pointer;
    list-style: none;
    width: 1.5rem;
    text-align: center;
    font-size: 1.8rem;
}
@media (min-width: 450px) {
    header nav li {
        margin-right: 1rem;
    }
}

#stats {
    width: 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: end;
    padding-top: 0.1rem;
}
#stats span {
    display: inline-block;
    width: 0.2rem;
    background-color: #333;
}
.dark-mode #stats span {
    background-color: #fff;
}
#stats span:nth-child(1) {
    height: 0.5rem;
}
#stats span:nth-child(2) {
    height: 1.3rem;
}
#stats span:nth-child(3) {
    height: 0.8rem;
}
#dark-mode-switch::after {
    content: "☀";
}
.dark-mode #dark-mode-switch::after {
    content: "☾";
}
#help {
    width: 2.1rem;
    border: 1px solid #000;
    border-radius: 50%;
    text-align: center;
}
.dark-mode #help {
    border: 1px solid #eee;
}

#message {
    position: absolute;
    top: -1000px;
    left: 0;
    padding: 0.5rem;
    font-size: 1.2rem;
    text-align: center;
    background: rgba(80, 100, 170, 0.5);
    color: #fff;
    text-shadow: 1px 1px 2px #666;
    width: 100%;
}
#message.warning {
    color: #000;
    background: rgba(198, 198, 112, 0.5);
}
#message.error {
    color: #000;
    background: rgba(210, 100, 100, 0.5);
}


#shield {
    display: none;
    background-color: rgba(120, 120, 120, 0.5);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.dialog-open > header, .dialog-open > main, .dialog-open > footer {
    filter: blur(5px) grayscale(1);
}
.paused {
    filter: blur(10px) grayscale(1);
}
dialog {
    top: 1rem;
    width: 90%;
    padding: 1rem;
    text-align: center;
    font-size: 1.2rem;
    max-height: 90%;
    overflow: auto;
}
dialog .close-icon {
    position: sticky;
    top: 0;
    right: 0;
    float: right;
}
dialog p, dialog fieldset {
    margin: 0.7rem 0;
}
dialog fieldset {
    padding: 1rem;
}
dialog select, dialog button {
    font-size: 1.2rem;
}
dialog button {
    font-size: 1.2rem;
    background-color: #bdcbec;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    border: 1px solid #666;
    text-align: center;
    box-shadow: 1px 1px 8px #aaa;
}
dialog details h3 {
    display: inline-block;
}

dialog fieldset {
    display: flex;
    justify-content: space-around;
}
.snapshot {
    width: 100%;
    height: 350px;
    border: 1px solid #444;
}
.snapshot *  {
    cursor: inherit;
}

#help-modal {
    height: 80%;
    overflow: auto;
}
#welcome-modal p, #help-modal p {
    text-align: left;
}
#help-modal svg {
    display: block;
    margin: 1rem auto;
}
dialog ol, dialog ul {
    margin-left: 1rem;
    text-align: left;
}
#help-modal table td {
    width: 2rem;
    text-align: center;
}
#help-modal table th {
    text-align: left;
    padding-left: 0.5rem;
}
#help-modal table svg {
    margin: 0.2rem 0;
}
#help-modal footer {
    margin-top: 1rem;
}

#win-modal table {
    width: 100%;
}
#win-modal thead th, #win-modal thead td {
    border-bottom: 1px solid #333;
}
#win-modal th {
    width: 50%;
    text-align: right;
    font-weight: bold;
}
#win-modal td {
    padding-left: 1rem;
    text-align: left;
}
.final-score {
    font-size: 1.5rem;
    font-weight: bold;
}
#stats-modal .level-stats ul {
    list-style-type: none;
    margin: 0;
}
#stats-modal .level-stats dd {
    text-align: right;
    display: inline-block;
    width: 9em;
    margin: 0;
}
#stats-modal .level-stats dt {
    display: inline;
    padding-left: 1rem;
}


main {
    position: relative;
}
main section {
    margin: 0;
    border: 1px solid #000;
}
.dark-mode main section {
    background-color: #292929;
    border: 1px solid #eee;
}

main nav {
    font-size: 1.1rem;
}
main nav ul {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
main nav li {
    list-style: none;
    background-color: #bdcbec;
    padding: 0.2rem 0;
    cursor: pointer;
    width: 25%;
    border-left: 1px solid #000;
    text-align: center;
    box-shadow: 1px 1px 8px #aaa;
    color: #222;
}
main nav li:last-child {
    border-right: 1px solid #000;
}

.dark-mode svg {
    background-color: #222;
}

#graph {
    width: 100%;
    height: 550px;
}
circle {
    cursor: pointer;
    fill: #555;
    stroke-width: 0;
}
.dark-mode circle {
    fill: #fff;
    stroke: #fff;
}
circle.central {
    stroke-width: 3px;
    stroke: #555;
    stroke-dasharray: 3px;
}
.dark-mode circle.central {
    stroke: #222;
}
circle.outlier {
    stroke-width: 6px;
    stroke: #555;
    stroke-opacity: 0.5;
}
circle.in-progress {
    fill: #7598a4;
    stroke: #7598a4;
}
circle.complete {
    fill: #4c8f65;
    stroke: #4c8f65;
}
circle.over {
    fill: #bd4242;
    stroke: #bd4242;
}
circle.selected {
    fill: #c18234;
    stroke: #c18234;
}
text {
  font-size: 1rem;
  font-weight: bold;
  text-shadow: -2px -2px 2px #fff, -2px 0px 2px #fff, 0px 0px 1px #fff, 0px 2px 1px #fff, 2px 2px 1px #fff;
}
.dark-mode text {
    text-shadow: -2px -2px 2px #292929, -2px 0px 2px #292929, 0px 0px 1px #292929, 0px 2px 1px #292929, 2px 2px 1px #292929;
}
.node-label {
    fill: #000;
}
.dark-mode .node-label {
    fill: #eee;
}
line {
    stroke: #2d2dd4;
    cursor: pointer;
}
line.revealed {
    stroke: #287853;
}
line.connection-mask {
    stroke: #fff0;
}
.dark-mode line.connection-mask {
    stroke: #2220;
}
.edge-label {
    fill: #a55;
    font-size: 1.2rem;
    cursor: pointer;
}


#edge-container {
    padding-top: 1rem;
}
#edges {
    padding: 0 1rem;
    text-align: center;
}
#edges .edge {
    display: inline-block;
    width: 4rem;
    margin: 0.3em;
    text-align: left;
    font-weight: bold;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding: 0.2rem;
}
#edges .edge::after {
    display: block;
    content: "";
    background-color: #99c;
    width: 2rem;
    position: absolute;
    top: 0.5rem;
    left: 1.2rem;
    height: var(--weight);
}
@media (min-width: 700px) {
    #edges .edge {
        width: 100px;
    }
    #edges .edge::after {
        width: 75px;
        left: 25px;
    }
}
#edges .selected::after {
    background-color: #a55;
}
#edges .used {
    color: #888;
}
.dark-mode #edges .used {
    color: #aaa;
}
#edges .used::after {
    background-color: #bbb;
}
