@font-face {
    font-family: "Arial";
    font-weight: 700;
    src: local("Arial Bold"), url("/assets/fonts/arialbd.ttf") format("truetype");
}

@font-face {
    font-family: "Courier New";
    font-weight: 700;
    src: local("Courier New Bold"), url("/assets/fonts/courbd.ttf") format("truetype");
}

@font-face {
    font-family: "Courier New";
    font-weight: 700;
    font-style: italic;
    src: local("Courier New Bold Italic"), url("/assets/fonts/courbi.ttf") format("truetype");
}

@font-face {
    font-family: "Verdana";
    font-weight: 400;
    src: local("Verdana"), url("/assets/fonts/verdana.ttf") format("truetype");
}

@font-face {
    font-family: "Verdana";
    font-weight: 700;
    src: local("Verdana Bold"), url("/assets/fonts/verdanab.ttf") format("truetype");
}

@font-face {
    font-family: "Verdana";
    font-weight: 400;
    font-style: italic;
    src: local("Verdana Italic"), url("/assets/fonts/verdanai.ttf") format("truetype");
}

@font-face {
    font-family: "Verdana";
    font-weight: 700;
    font-style: italic;
    src: local("Verdana Bold Italic"), url("/assets/fonts/verdanaz.ttf") format("truetype");
}

@font-face {
    font-family: "Comic Sans MS";
    font-weight: 400;
    src: local("Comic Sans MS"), url("/assets/fonts/comic.ttf") format("truetype");
}

@font-face {
    font-family: "Comic Sans MS";
    font-weight: 700;
    src: local("Comic Sans MS Bold"), url("/assets/fonts/comicbd.ttf") format("truetype");
}

@font-face {
    font-family: "OpenDyslexic";
    font-weight: 400;
    src: local("OpenDyslexic Regular"), url("/assets/fonts/OpenDyslexic-Regular.otf") format("opentype");
}

@font-face {
    font-family: "OpenDyslexic";
    font-weight: 700;
    src: local("OpenDyslexic Bold"), url("/assets/fonts/OpenDyslexic-Bold.otf") format("opentype");
}

@font-face {
    font-family: "OpenDyslexic";
    font-weight: 400;
    font-style: italic;
    src: local("OpenDyslexic Italic"), url("/assets/fonts/OpenDyslexic-Italic.otf") format("opentype");
}

@font-face {
    font-family: "OpenDyslexic";
    font-weight: 700;
    font-style: italic;
    src: local("OpenDyslexic Bold Italic"), url("/assets/fonts/OpenDyslexic-Bold-Italic.otf") format("opentype");
}

:root {
    --page-bg: #535353;
    --page-color: #000000;
    --card-bg: #efefef;
    --card-bg-dark: #c6c6c6;
    --links-bg: #5a5a5a;
    --links-color: #ffffff;
    --links-white: #ffffff;
    --links-green: #29ff4a;
    --links-blue: #39d5f6;
    --links-yellow: #f7f72a;
    --links-orange: #ffb529;
    --candycorn-image: url("/assets/img/candycorn.gif");
    --footer-image: url("/assets/img/footer.gif");
    --footer-image-desktop: url("/assets/img/bannerframe.png");
    --footer-color: #ffffff;
    --log-border: grey;
    --log-bg: var(--card-bg);
    --button-bg: #e1e1e1;
    --button-border: #adadad;
    --button-bg-active: #bebebe;
    --link-color-active: var(--link-color);

    --comic-font: "Courier New", Courier, monospace;
    --text-font: Verdana, Arial, Helvetica, sans-serif;
    --links-font: Arial, Helvetica, sans-serif;
}

:root.font-opendyslexic {
    --comic-font: "OpenDyslexic", "Courier New", Courier, monospace;
}

:root.theme-dark {
    --page-bg: #000000;
    --page-color: #ffffff;
    --card-bg: #393939;
    --card-bg-dark: #262626;
    --link-color: #5599ff;
    --link-color-active: #f00;
}

:root.theme-classic {
    --page-bg: #dddddd;
    --card-bg: #ffffff;
    --card-bg-dark: #eeeeee;
    --links-bg: #000000;
    --links-color: #cccccc;
    --links-white: #cccccc;
    --links-green: #cccccc;
    --links-blue: #cccccc;
    --links-yellow: #cccccc;
    --links-orange: #cccccc;
    --footer-color: #000000;
}

:root.theme-cascade {
    --page-bg: #000000;
    --page-color: #ffffff;
    --card-bg: #262626;
    --card-bg-dark: #262626;
    --link-color: #0066ff;
}

:root.theme-scratch {
    --page-bg: #000000;
    --page-color: #ffffff;
    --card-bg: #0e4603;
    --card-bg-dark: #082a00;
    --links-bg: #000000;
    --links-green: #ffffff;
    --links-blue: #ffffff;
    --links-yellow: #ffffff;
    --links-orange: #ffffff;
    --link-color: #2cff4b;
    --log-bg: #000000;
    --candycorn-image: url("/assets/img/candycorn_scratch.png");
    --footer-image: url("/assets/img/scratch_footer.png");
    --footer-image-desktop: url("/assets/img/bannerframe_scratch.png");
}

:root.theme-sbahj {
    --page-bg: #0707ec;
    --card-bg: #14ff23;
    --card-bg-dark: #f400ec;
    --links-bg: #000000;
    --footer-image: url("/assets/img/sbahj_footer.png");
    --footer-image-desktop: url("/assets/img/bannerframe_sbahj.gif");

    --comic-font: "Comic Sans MS", Verdana, Arial, Helvetica, sans-serif;
    --text-font: "Comic Sans MS", Verdana, Arial, Helvetica, sans-serif;
    --links-font: "Comic Sans MS", Verdana, Arial, Helvetica, sans-serif;
}

:root.theme-trickster {
    --page-bg: url("/assets/img/Z2.gif");
    --page-color: #f9fd6b;
    --card-bg: #ff73fd;
    --card-bg-dark: url("/assets/img/bluetile.gif");
    --links-bg: #000000;
    --link-color: #fb060b;
    --footer-image: url("/assets/img/footer_trickster.gif");
    --footer-image-desktop: url("/assets/img/bannerframe_trickster.gif");
}

:root.theme-collide {
    --page-bg: #000000;
    --page-color: #ffffff;
    --card-bg: #262626;
    --card-bg-dark: #454545;
    --link-color: #ff0000;
}

:root.theme-act7 {
    --page-bg: #ffffff;
    --footer-color: #000000;
    --card-bg: #dbdbdb;
    --link-color: #ffffff;
    --links-bg: #f2f2f2;
    --links-color: #000000;
    --links-white: #000000;
}

:root.theme-homosuck {
    --page-bg: #042300;
    --page-color: #2ed73a;
    --card-bg: #073c00;
    --card-bg-dark: #168500;
    --link-color: #2ed73a;
    --links-bg: #042300;
    --links-white: #2ed73a;
    --links-green: #2ed73a;
    --links-blue: #2ed73a;
    --links-yellow: #2ed73a;
    --links-orange: #2ed73a;
    --candycorn-image: url("/assets/img/a6a6_tooth.gif");
    --footer-image: url("/assets/img/footer_a6a6.png");
    --footer-image-desktop: url("/assets/img/a6a6_bannerframe.png");
    --footer-color: #2ed73a;
}

body {
    margin: 0;
    background: var(--page-bg);
    display: flex;
    flex-direction: column;
    overflow-y: scroll;
}

#page-wrapper {
    display: flex;
    flex-direction: column;
}

body.desktop {
    margin: 0 8px;
    min-height: 100vh;
}

.desktop #page-wrapper {
    width: 950px;
    margin: 0 auto;
}

* {
    image-rendering: pixelated;
}

body, table, td, th {
    font-family: var(--text-font);
    font-size: 18px;
    color: var(--page-color);
}

body:not(.desktop) button,
body:not(.desktop) input {
    font-size: 18px;
    font-family: var(--text-font);
}

body.desktop,
.desktop table,
.desktop td,
.desktop th {
    font-size: 14px;
}

body:not(.desktop) button {
    appearance: none;
    -webkit-appearance: none;
    background: var(--button-bg);
    border-radius: 0;
    -webkit-border-radius: 0;
    border: 1px solid var(--button-border);
}

body:not(.desktop) button:active {
    background: var(--button-bg-active);
}

:root[class*="theme-"]:not(.theme-sbahj, .theme-classic) a {
    color: var(--link-color);
}

:root[class*="theme-"]:not(.theme-sbahj, .theme-classic) a:active {
    color: var(--link-color-active);
}

@keyframes scroll {
    from {
        background-position: 605px 0;
    }
    to {
        background-position: 0 0;
    }
}

#trickster-banner {
    height: 20px;
    background: url("/assets/img/trickster_banner.png") #000000;
    animation: scroll 20s linear infinite;
    cursor: pointer;
}

.desktop #trickster-banner {
    width: 950px;
    margin: 0 auto;
}

#banner {
    display: flex;
}

#banner img {
    width: 100%;
}

.desktop #banner {
    width: 950px;
    margin: 0 auto;
}

#menu-bar {
    background: var(--links-bg);
    color: var(--links-color);
    font-family: var(--links-font);
    font-weight: 700;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.desktop #menu-bar {
    font-size: 10px;
    height: 19px;
    justify-content: center;
}

.theme-classic .desktop #menu-bar {
    font-size: 9px;
    font-family: var(--text-font);;
}

.separator {
    width: 9px;
    text-align: center;
}

.candycorn {
    width: 32px;
    height: 32px;
    background: no-repeat var(--candycorn-image);
    background-size: 32px 32px;
}

.desktop .candycorn {
    width: 16px;
    height: 16px;
    background-size: 16px 16px;
    margin: 0 9px;
    margin-top: 2px;
}

.theme-classic .desktop .candycorn {
    background: transparent;
    width: unset;
    height: unset;
    margin-top: 0;
}

.theme-classic .desktop .candycorn::before {
    color: #fff;
    font-weight: 700;
    content: "||";
}

#menu-button {
    background: transparent;
    border: 0;
    color: var(--links-color);
    font-family: var(--links-font);
    font-weight: 700;
    display: flex;
    flex-direction: row;
    align-items: center;
}

:root.modal-open {
    overflow-x: hidden;
    overflow-y: hidden;
}

#menu-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

:root.modal-open #menu-container {
    pointer-events: auto;
}

#menu-background, #menu-background-2 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, .5);
    z-index: 0;
    opacity: 0;
    transition: opacity .15s;
    pointer-events: none;
}

#menu-background-2 {
    z-index: 2;
}

:root.modal-open #menu-background {
    opacity: 1;
    pointer-events: auto;
}

:root.message-box-open.options-menu-open #menu-background-2 {
    opacity: 1;
    pointer-events: auto;
}

#menu {
    background: var(--links-bg);
    flex: 1;
    width: 270px;
    min-height: 100%;
    box-sizing: border-box;
    padding: 8px;
    padding-top: 42px;
    z-index: 1;
    position: absolute;
    top: 0;
    left: -270px;
    transition: left .15s;
}

:root.menu-open #menu {
    left: 0;
}

#options-menu {
    display: flex;
    flex-direction: column;
    font-weight: 700;
    background: var(--card-bg);
    flex: 1;
    width: 270px;
    min-height: 100vh;
    box-sizing: border-box;
    padding: 8px;
    z-index: 1;
    position: absolute;
    top: 0;
    right: -270px;
    transition: right .15s;
}

#options-menu > * {
    margin-bottom: 12px;
}

:root.options-menu-open #options-menu {
    right: 0;
}

.menu-item {
    display: flex;
    flex-direction: row;
    font-family: var(--links-font);
    font-weight: 700;
}

.menu-item a {
    margin-left: 4px;
}

.link-white {
    color: var(--links-white) !important;
}

.link-green {
    color: var(--links-green) !important;
}

.link-blue {
    color: var(--links-blue) !important;
}

.link-yellow {
    color: var(--links-yellow) !important;
}

.link-orange {
    color: var(--links-orange) !important;
}

#footer {
    display: flex;
    flex-direction: row;
    color: var(--footer-color);
    font-size: .75em;
}

.desktop #footer {
    font-size: 1em;
    text-align: center;
    align-items: center;
    justify-content: center;
    min-width: 950px;
    min-height: 110px;
    background: no-repeat var(--footer-image-desktop);
}

.desktop #footer-image {
    display: none;
}

#footer a {
    color: var(--footer-color) !important;
}

#footer-image {
    min-width: 102px;
    min-height: 102px;
    background: no-repeat var(--footer-image);
}

#footer-text {
    box-sizing: border-box;
    padding: 4px;
}

.desktop #page-outer {
    background: var(--card-bg-dark);
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
    justify-content: center;
    padding-top: 7px;
    padding-bottom: 23px;
    align-items: flex-start;
}

.supercartridge #page-outer {
    padding-top: 0;
}

.desktop #page {
    width: auto;
    min-width: 650px;
    max-width: 950px;
    margin: 0 auto;
}

#page {
    background: var(--card-bg);
}

body:not(.desktop) #page img {
    max-width: 100%;
}

body:not(.desktop) #page > img {
    width: 100%;
}

#title {
    margin: 0;
    padding: 20px 0;
    font-size: 32px;
    font-family: var(--comic-font);
    font-weight: 700;
    text-align: center;
    margin: 0 5%;
    overflow: hidden;
    overflow-wrap: break-word;
}

.desktop #title {
    max-width: 600px;
    padding: 14px 0;
    margin: 0 auto;
}

:root.theme-cascade #title {
    color: #0066ff;
}

:root.theme-collide #title {
    color: #ff0000;
}

#content {
    width: 90%;
    margin: 0 auto;
}

.desktop #content {
    width: 600px;
}

.comic-text {
    font-family: var(--comic-font);
    font-weight: 700;
    text-align: center;
    margin: 0;
    padding-top: calc(20px + 1em);
    padding-bottom: calc(17px + 1em);
    overflow: hidden;
    overflow-wrap: break-word;
    max-width: 100%;
}

.font-size-0 .comic-text {
    font-size: .85em;
}

.font-size-2 .comic-text {
    font-size: 1.15em;
}

.font-size-3 .comic-text {
    font-size: 1.3em;
}

.font-size-4 .comic-text {
    font-size: 1.45em;
}

.font-size-5 .comic-text {
    font-size: 1.6em;
}

.font-size-6 .comic-text {
    font-size: 1.75em;
}

.commands {
    padding-bottom: 38px;
    font-size: 26px;
    overflow: hidden;
    overflow-wrap: break-word;
}

.collide .commands {
    font-size: 34px;
}

.act7 .commands {
    font-size: 48px;
}

.desktop .commands {
    font-size: 24px;
}

:root.theme-cascade .commands,
:root.theme-collide .commands,
:root.theme-homosuck .commands {
    color: #000000;
}

#page-footer {
    padding-bottom: 17px;
    font-size: .75em;
    font-weight: 700;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

body:not(.desktop) #page-footer-right {
    margin-left: auto;
}

.desktop #page-footer {
    font-size: 10px;
}

.collide #page-footer,
.act7 #page-footer {
    font-size: 1em;
}

:root.theme-cascade #page-footer,
:root.theme-collide #page-footer,
:root.theme-homosuck #page-footer {
    color: #000000;
}

#page-footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
}

#page-footer li {
    display: flex;
    flex-direction: row;
}

#page-footer li:not(:last-child)::after {
    content: "|";
    font-weight: 400;
    margin: 0 .4em;
}

#options-link {
    margin-left: auto;
}

.adventure-list {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding-top: 24px;
    font-size: 24px;
    padding-bottom: 150px;
}

.adventure-list a {
    margin-bottom: .5em;
}

.log {
    font-size: .75em;
    font-weight: 700;
    padding-bottom: 150px;
}

.desktop .log {
    font-size: 10px;
}

.search {
    text-align: center;
    padding-bottom: 150px;
    overflow-wrap: break-word;
}

#map {
    text-align: center;
    padding-top: .6em;
    padding-bottom: 150px;
}

#map > * {
    margin: 0 auto;
}

.read-log {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    background: var(--log-bg);
    border: 1px dashed var(--log-border);
}

.authorlog {
    background: #fff;
    border: 3px solid #c6c6c6;
}

.log-content {
    padding: 20px 5%;
    text-align: start;
}

.log-show, .log-hide {
    margin: 0 auto;
}

.read-log:not(.open) .log-content,
.read-log:not(.open) .log-hide {
    display :none;
}

.read-log.open .log-show {
    display: none;
}

#imgtip {
    position: absolute;
    pointer-events: none;
}

#media {
    display: flex;
    flex-direction: column;
}

#media img:not(:last-child) {
    margin-bottom: 20px;
}

#media.hscroll {
    display: block;
    overflow-x: scroll;
}

#media.hscroll img {
    margin: 0;
    max-width: unset !important;
}

body:not(.desktop) #media.hscroll img {
    height: calc(100vw * 9/13);
}

@keyframes blink {
    to {
        visibility: hidden;
    }
}

#hscroll-arrow {
    font-size: 24px;
    user-select: none;
    -webkit-user-select: none;
    margin: 4px;
    animation: blink 2s steps(2, start) infinite;
}

body:not(.desktop) #JterniaDeploy > div,
body:not(.desktop) #SBURBStage {
    width: 100vw !important;
    height: calc(100vw * (9 / 13)) !important;
}

/* Transcripts */
@keyframes ultimate-reward {
    0%,
    55.5555%,
    81.4815%,
    to {
        color: initial;
        text-shadow: -1px -1px 0 #eee,
                     0px -1px 0 #eee,
                     1px -1px 0 #eee,
                     -1px 0px 0 #eee,
                     1px 0px 0 #eee,
                     -1px 1px 0 #eee,
                     0px 1px 0 #eee,
                     1px 1px 0 #eee;
    }

    72.2222%,
    74.0741%,
    75.9259% {
        color: #fff601;
        text-shadow: -1px -1px 0 #f70000,
                     0px -1px 0 #f70000,
                     1px -1px 0 #f70000,
                     -1px 0px 0 #f70000,
                     1px 0px 0 #f70000,
                     -1px 1px 0 #f70000,
                     0px 1px 0 #f70000,
                     1px 1px 0 #f70000;
    }
    
    73.5185%,
    75.3704% {
        color: #fefefe;
        text-shadow: -1px -1px 0 black,
                     0px -1px 0 black,
                     1px -1px 0 black,
                     -1px 0px 0 black,
                     1px 0px 0 black,
                     -1px 1px 0 black,
                     0px 1px 0 black,
                     1px 1px 0 black;
    }
}

.ultimatereward-text {
    animation: ultimate-reward 5.4s steps(9,jump-none) infinite;
}

@keyframes green-sun {
    from {
        color: #00ed4f;
    }
    to {
        color: #00d246;
    }
}

.greensun-text {
    color: #00ed4f;
    animation: green-sun 100ms steps(2, start) infinite;
}

@keyframes universe-blue {
    from {
        color: #001e82;
    }
    to {
        color: #003bff;
    }
}

.universeblue-text {
    color: #001e82;
    animation: universe-blue 100ms steps(2, start) infinite;
}

@keyframes universe-red {
    from {
        color: #b30000;
    }
    to {
        color: #f20000;
    }
}

.universered-text {
    color: #b30000;
    animation: universe-red 100ms steps(2, start) infinite;
}

/* Why does this have to be based on percentages? Why can't I just
   specify n keyframes and have that be the whole animation. I hate CSS. */
@keyframes trickster {
    0% {
        color: #ffd1d1;
    }
    14.2857% {
        color: #ffe6d1;
    }
    28.5714% {
        color: #fff6d1;
    }
    42.8571% {
        color: #d1ffe3;
    }
    57.1429% {
        color: #d1f9ff;
    }
    71.4286% {
        color: #d1dcff;
    }
    100% {
        color: #f0d1ff;
    }
}

.trickster-text {
    color: #ffd1d1;
    animation: trickster 350ms steps(7, start) infinite;
}

@keyframes trickster-2 {
    0% {
        color: #d1dcff;
    }
    71.4286% {
        color: #d1dcff;
    }
    100% {
        color: #f0d1ff;
    }
}

.trickster-text-2 {
    color: #d1dcff;
    animation: trickster-2 350ms steps(7, start) infinite;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.toast {
    position: fixed;
    padding: 4px 8px;
    background: var(--card-bg);
    max-width: 90vw;
    cursor: pointer;
    box-shadow: 0 0 5px black;
    animation: fade-in .35s;
    transition: opacity .35s;
    z-index: 999;
}

.toast.fading-out {
    opacity: 0;
}

#message-box {
    background: var(--card-bg);
    padding: 8px;
    max-width: 90vw;
    max-height: calc(100vh - 10vw);
    opacity: 0;
    transition: opacity .15s;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    box-shadow: 0 0 5px black;
}

.desktop #message-box {
    max-width: 600px;
    max-height: calc(100vh - 20px);
}

#message-box-content {
    min-width: 200px;
    min-height: 50px;
    word-wrap: break-word;
    max-width: 100%;
    max-height: 100%;
}

#message-box-content > * {
    max-width: 100%;
    max-height: 100%;
}

#message-box-dismiss {
    margin-top: 6px;
}

:root.message-box-open #message-box {
    opacity: 1;
    pointer-events: auto;
}