body {
    margin: 0px;
    height: 100%;
}

#header {
    position: absolute;
    z-index: 1;
    width: 100%;
    top: 0px;
    height: 50px;
    background-color: #887;
    background-image: url("stone.png");
    background-size: 489px 50px;
    box-sizing: border-box;
    border-bottom: 1px solid #765;
    font-family: "Libre Baskerville", serif;
}

#header h1 {
    font-size: 20px;
    margin-left: 20px;
    color: #FFF;
    text-shadow: 2px 2px 3px #A93, -2px -2px 3px #A93;
}

#appcontrols {
    position: absolute;
    height: 50px;
    right: 0px;
    font-family: "Lato";
}

#menubutton {
    background: #FFD;
    color: black;
    border: 1px solid #888;
    border-radius: 4px;
    margin: 12px 8px;
    padding: 2px 2px 0px 2px;
}
#menubutton.Selected {
    background: #F0C056;
}

#menubutton img {
    width: 24px;
    height: 18px;
}

.Menu {
    display: none;
    top: 48px;
    right: 0px;
    width: 240px;
    text-align: center;
    position: absolute;
    background: #FDA;
    box-sizing: border-box;
    padding: 10px;
    border-left: 1px solid #FA8;
    border-bottom: 1px solid #FA8;
    border-bottom-left-radius: 8px;
}

.Menu.MenuOpen {
    display: block;
}

.Menu button {
    background: white;
    color: black;
    border: 1px solid #888;
    border-radius: 4px;
    padding: 4px 4px;
    margin: 2px 4px;
}

.Menu button.Selected {
    background: #F0C056;
}

.Menu img.ArrangeIcon {
    width: 32px;
    height: 24px;
}

.Menu label {
    font-size: 85%;
}

#gamebody {
    position: absolute;
    width: 100%;
    top: 50px;
    bottom: 0px;
    background: #0000;
    pointer-events: none;
    margin: 0px;
    box-sizing: border-box;
}

#appbody {
    position: absolute;
    width: 100%;
    top: 50px;
    bottom: 0px;
    background: #EEE;
    margin: 0px;
    box-sizing: border-box;
    font-family: "Lato";
    line-height: 1.33;
}
.DarkTheme #appbody {
    background: #111;
}

#gameport {
    position: absolute;
    overflow: hidden;
    width: 100%;
    height: 100%;
    background: #CCAA88;
    margin: 0px;
    pointer-events: auto;
}

#commentarypane {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 75%;
    max-width: 400px;
    background: #B0FFB0;
    box-sizing: border-box;
    border: 4px solid #40D040;
    border-radius: 16px;
    box-shadow: 2px 2px 12px 4px #00000040;
}
.DarkTheme #commentarypane {
    background: #206020;
    color: white;
    border: 4px solid #00A000;
    box-shadow: 2px 2px 12px 4px #00000080;
}

#commentaryheader {
    background: #70E870;
    min-height: 22px;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}
.DarkTheme #commentaryheader {
    background: #108010;
}

#commentarytitle {
    font-family: "Courier Prime";
    font-size: 100%;
    margin-left: 20px;
}

#commentaryclose {
    width: 30px;
    height: 20px;
    background: #40D040;
    border-bottom-left-radius: 8px;
    float: right;
    text-align: center;
    color: #CFC;
    font-weight: bold;
}
.DarkTheme #commentaryclose {
    background: #00A000;
    color: #040;
}
#commentaryclose span {
    pointer-events: none;
}


.ViewPane {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    color: black;
    background: #FFFFFE;
    box-sizing: border-box;
}
.DarkTheme .ViewPane {
    background: #010000;
    color: white;
}

.SourcePane {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    color: black;
    background: #FFFFFE;
    box-sizing: border-box;
}
.DarkTheme .SourcePane {
    color: white;
    background: #010000;
}

.Arrange12 #gameport {
    left: 0px;
    width: 50%;
    top: 0px;
    height: 100%;
}
.Arrange12 .ViewPane {
    right: 0px;
    width: 50%;
    top: 0px;
    height: 50%;
    border-bottom: 1px solid #888;
}
.Arrange12 .SourcePane {
    right: 0px;
    width: 50%;
    bottom: 0px;
    height: 50%;
}

.Arrange111 #gameport {
    left: 0px;
    width: 33%;
    top: 0px;
    height: 100%;
}
.Arrange111 .ViewPane {
    left: 33%;
    right: 33%;
    width: 34%;
    top: 0px;
    height: 100%;
    border-right: 1px solid #888;
}
.Arrange111 .SourcePane {
    right: 0px;
    width: 33%;
    bottom: 0px;
    height: 100%;
}

.Arrange21 #gameport {
    left: 0px;
    width: 50%;
    top: 0px;
    height: 50%;
}
.Arrange21 .ViewPane {
    left: 0px;
    width: 50%;
    bottom: 0px;
    height: 50%;
    border-right: 1px solid #888;
}
.Arrange21 .SourcePane {
    right: 0px;
    width: 50%;
    height: 100%;
}

.Arrange121 #gameport {
    left: 0px;
    width: 50%;
    top: 0px;
    height: 50%;
}
.Arrange121 .ViewPane {
    right: 0px;
    width: 50%;
    top: 0px;
    height: 50%;
}
.Arrange121 .SourcePane {
    width: 100%;
    bottom: 0px;
    height: 50%;
}

.TabBar {
    flex: 0 0 auto;
    width: 100%;
    min-height: 32px;
    background: #DFDCCF;
    overflow: hidden;
    padding-left: 8px;
    box-sizing: border-box;
}
.DarkTheme .TabBar {
    background: #555040;
}

.TabBar .TabItem {
    display: inline-block;
    font-size: 85%;
    margin: 4px 4px;
    padding: 2px 8px;
    background: #F4F4F0;
    border: 1px solid #888;
    border-radius: 8px;
}
.DarkTheme .TabBar .TabItem {
    background: #202010;
}

.TabBar .TabItem span {
    pointer-events: none;
}

.TabBar .TabItem.Selected {
    background: #FFD066;
}
.DarkTheme .TabBar .TabItem.Selected {
    background: #805000;
}

.TabBar .TabItem.Flashing {
    animation: buttonflash 0.3s linear alternate;
    animation-iteration-count: infinite;
}
.DarkTheme .TabBar .TabItem.Flashing {
    animation: darkbuttonflash 0.3s linear alternate;
    animation-iteration-count: infinite;
}

@keyframes buttonflash {
    0% { background: #FFFFFF; }
    100% { background: #B0FFB0; }
}
@keyframes darkbuttonflash {
    0% { background: #000000; }
    100% { background: #005000; }
}

.TabBar .TabLabel {
    display: inline-block;
    font-weight: bold;
    margin: 4px 4px;
}

.TabBar button.NavButton {
    font-weight: bold;
    background: #F4F4F0;
    border: 1px solid #888;
    border-radius: 4px;
    margin: 0px 2px;
}

.TabBar button.NavButton:disabled, .TabBar button.NavButton:disabled:active {
    color: #888;
    background: #DFDCCF;
}

.TabBar button.NavButton:active {
    background: white;
}

.TabContent {
    flex: 1 1 auto;
    width: 100%;
    height: 1px;
}

.ScrollContent {
    width: 100%;
    height: 100%;
    padding: 10px 20px;
    box-sizing: border-box;
    overflow-y: scroll;
}

.ScrollContent h2 {
    font-size: 120%;
}

.ScrollXYContent {
    width: 100%;
    height: 100%;
    padding: 0px;
    box-sizing: border-box;
    overflow: scroll;
    background: white;
}
.DarkTheme .ScrollXYContent {
    filter: invert(90%) hue-rotate(180deg);
}

.ScrollXYContent object {
    pointer-events: none;
}

.AboutPage h2 {
    font-size: 110%;
    font-family: "Libre Baskerville", serif;
}

.AboutPage a {
    color: #00C;
}
.DarkTheme .AboutPage a {
    color: #88F;
}

.AboutPage a.Internal {
    color: #A40;
}
.DarkTheme .AboutPage a.Internal {
    color: #F99;
}
.AboutPage code {
    font-size: 90%
}

.AboutPage hr {
    border: none;
    height: 1px;
    background: #AAA;
    margin-left: 40px;
    margin-right: 40px;
}

.Commentary {
    font-style: italic;
}
.Commentary em {
    font-style: normal;
}

.Commentary p {
    margin: 16px 20px;
}

.Commentary p.Right {
    text-align: right;
}

.Commentary code {
    font-size: 85%;
}

.Commentary a.External {
    color: #00C;
}
.DarkTheme .Commentary a.External {
    color: #AAF;
}

.Commentary a.Internal {
    color: #A40;
}
.DarkTheme .Commentary a.Internal {
    color: #F99;
}
.Commentary a.SourceOnly {
    color: #A40;
    text-decoration-style: dashed;
}
.DarkTheme .Commentary a.SourceOnly {
    color: #F99;
}

.Commentary .Contrib {
    font-size: 85%;
}

.Commentary .Com_Id {
    font-family: "Courier Prime";
    font-size: 85%;
}

ul.DataList {
    list-style: none;
    padding-left: 0px;
}

ul.DataList ul {
    padding-left: 20px;
}

.DataList li {
    padding-left: 4px;
}

.DataList li.Selected {
    background: #FFDD88;
}
.DarkTheme .DataList li.Selected {
    background: #705000;
}

.DataList li.IsRoom {
    margin-top: 10px;
}

.DataList li.Filename {
    margin-top: 4px;
    margin-bottom: 4px;
}

.DataList li.ContainsLabel {
    font-size: 85%;
    font-style: italic;
    padding-left: 25px;
}

code {
    font-family: "Courier Prime";
}

.ObjLabel {
    float: right;
    font-family: "Courier Prime";
    font-size: 75%;
    background: #888;
    color: white;
    padding: 1px 3px 0px 3px;
    border-radius: 4px;
    margin-left: 4px;
    margin-right: 4px;
    margin-top: 4px;
}
.ObjLabelRoom {
    background: #C75;
}
.ObjLabelGlob {
    background: #69C;
}
.ObjLabelItem {
    background: #87C;
}

.DarkTheme .ObjLabel {
    color: black;
}

button.ObjPage {
    font-family: "Courier Prime";
    font-weight: bold;
    font-size: 85%;
    line-height: 1em;
    background: white;
    color: #444;
    border: 1px solid #888;
    border-radius: 8px;
    padding: 3px 2px 0px 3px;
    margin-left: 3px;
    margin-right: 3px;
}
.DarkTheme button.ObjPage {
    background: black;
    color: #CCC;
}

.ObjPageBack {
    float: right;
}
.ObjPageBack a {
    font-size: 85%;
    color: #A40;
}

.DarkTheme .ObjPageBack a {
    color: #FA6;
}

a.CommentButton {
    position: relative;
    top: -4px;
    float: right;
    padding: 1px;
    border: none;
    margin-left: 8px;
    background: none;
}

a.CommentButton img {
    width: 36px;
    height: 27px;
}

a.CommentButtonSmall {
    position: relative;
    float: right;
    padding: 1px;
    border: none;
    margin-left: 8px;
    background: none;
}

a.CommentButtonSmall img {
    width: 24px;
    height: 18px;
}

.PrintString {
    font-family: "Libre Baskerville", serif;
    font-size: 90%;
    font-weight: bold;
}

.PrintDictWord {
    font-family: "Libre Baskerville", serif;
    font-size: 90%;
    font-weight: bold;
}

.ShowAddr {
    font-size: 85%;
}

.ChangedNote {
    font-weight: bold;
    color: #B00;
    padding-left: 2px;
    padding-right: 1px;
}
.DarkTheme .ChangedNote {
    color: #F44;
}

.DelAttr {
    text-decoration-line: line-through;
    text-decoration-color: #B00;
}
.DarkTheme .DelAttr {
    text-decoration-color: #F44;
}

.TimerActive {
    font-size: 130%;
}
.TimerInactive {
    font-size: 130%;
    color: #AAA;
}
.DarkTheme .TimerInactive {
    color: #888;
}

#scrollcontent_file.ScrollContent {
    padding-left: 8px;
}

.SourceFile {
    display: block flow-root;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    font-family: "Courier Prime";
    font-size: 90%;
}

.SourceFile > div {
    border-left: 8px solid #FFFFFE;
    padding-left: 8px;
}
.DarkTheme .SourceFile > div {
    border-left: 8px solid #010000;
}

.SourceFile .Selected {
    background: #FFDD88;
}
.DarkTheme .SourceFile .Selected {
    background: #705000;
}

.SourceFile .SelRange {
    border-left: 8px solid #FFDD88;
}
.DarkTheme .SourceFile .SelRange {
    border-left: 8px solid #705000;
}

.SourceFile .Hilit {
    background: #FFF4DD;
}
.DarkTheme .SourceFile .Hilit {
    background: #403000;
}

.LineExtraHeight {
    line-height: 38px;
}

.LineExtraHeightSmall {
    line-height: 23px;
}

.GameMap {
}

.Src_Comment {
    color: #292;
}
.DarkTheme .Src_Comment {
    color: #8D8;
}

.Src_Ifndef {
    color: #999;
}
.DarkTheme .Src_Ifndef {
    color: #777;
}

.Src_Str {
    color: #A44;
    font-weight: bold;
}
.DarkTheme .Src_Str {
    color: #F99;
}

.Src_Dict {
    color: #A2A;
}
.DarkTheme .Src_Dict {
    color: #E7E;
}

.Src_Iddef {
    color: #44C;
    font-weight: bold;
}
.DarkTheme .Src_Iddef {
    color: #AAF;
}

.Src_Id {
    color: #44C;
}
.DarkTheme .Src_Id {
    color: #AAF;
}

.Src_Implid {
    color: #44C;
}
.DarkTheme .Src_Implid {
    color: #AAF;
}

.Src_Localid {
    color: #850;
}
.DarkTheme .Src_Localid {
    color: #FC8;
}

a.Src_Id {
    text-decoration: none;
}
a.Src_Id:hover {
    text-decoration: underline;
}

a.Src_Implid {
    text-decoration: none;
}
a.Src_Implid:hover {
    text-decoration: underline;
    text-decoration-style: dashed;
}
