/** ANIMATIONS */
@keyframes dial-spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}
@keyframes scrolling-text {
    0% {
        transform: translateX(0%);
    }
    100% {
        transform: translateX(100%);
    }
}

/** ROOT */
:root {
    --top-height: 40px;
    --bottom-height: 50px;
    --green-primary: rgb(154, 255, 72);
    --blue-primary: rgb(0, 119, 255);
    --crosshair-size: 100px;
    --crosshair-secondary-size: 150px;
    --portal-scale: 1;
}

/** ORDER */
#windows-left {
    order: 0;
}
#navigation-window {
    order: 1;
}
#windows-right {
    order: 2;
}

/** BODY */
body {
    margin: 0;
    overflow-x: hidden;
    overflow-y: hidden;
}
.container {
    box-sizing: border-box;
    min-height: 100dvh;
    width: 100%;
}
a {
    color: var(--green-primary);
}
p {
    color: var(--green-primary);
}
a:hover {
    color: white;
}
li {
    margin: 8px 0px;
}

/** WINDOWS */
.windows-container {
    display: grid;
    grid: 1fr / 1fr 2.2fr 1fr;
    width: 100%;
    min-height: 100dvh;
    box-sizing: border-box;
}
.base-window {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--green-primary);
    color: var(--green-primary);
    margin: auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    font-size: 0.9em;
    background-image: url("/assets/machine-dark.png");
    background-size: 270px;
}
.base-window h1 {
    font-family: "Silkscreen", monospace;
    text-align: left;
    margin: 0;
    font-size: 1.2em;
}
.windows-column .base-window {
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}
.window-title {
    background: linear-gradient(
        180deg,
        rgba(210, 255, 64, 1) 0%,
        rgba(191, 250, 62, 1) 10%,
        rgba(101, 207, 42, 1) 55%,
        rgba(91, 189, 39, 1) 56%,
        rgba(95, 195, 40, 1) 60%,
        rgba(97, 199, 41, 1) 100%
    );
    display: flex;
    align-items: center;
    padding: 2px 6px;
    height: 22px;
}
.window-title h1 {
    flex-grow: 1;
    color: black;
    text-shadow: 1px 1px 0px rgba(0, 0, 0, 0.2);
}
.window-title img,
.window-title a {
    height: 18px;
}
.window-title img {
    filter: drop-shadow(1px 1px 0px rgba(0, 0, 0, 0.5));
}
#windows-bottom {
    display: none;
}
.window-content {
    padding: 0px 10px;
}
.windows-column {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
    justify-content: center;
    overflow-y: auto;
    box-sizing: border-box;
    padding: 0px 10px;
}
.windows-content {
    display: flex;
    flex-direction: column;
    gap: 1em;
    width: 100%;
    height: 100%;
}
.dial-window {
    flex-grow: 1;
    border: 7px solid transparent;
    border-image: url("/assets/teal-border.png") 60 / 30px round;
    background-image: url("/assets/brains-blue.png");
    background-size: 300px;
    position: relative;
}
.dial-window img {
    image-rendering: pixelated;
    position: absolute;
    width: 100%;
}
#right-dial-window {
    order: 0;
}
#left-dial-window {
    order: 3;
    transform: scaleX(-1) scaleY(-1);
}
#right-dial-window img {
    filter: drop-shadow(-2px -3px 1px rgb(76, 0, 255));
}
#left-dial-window img {
    filter: drop-shadow(2px 3px 0px rgb(76, 0, 255));
}
.view-all {
    border-top-style: solid;
    border-width: 1px;
    background-color: black;
    padding: 2px 0px;
    box-sizing: border-box;
    height: fit-content;
    border-color: var(--green-primary);
}
.view-all p {
    margin: 0px 0px;
}
.view-all a {
    color: var(--green-primary);
}
.view-all:hover {
    border-color: var(--green-primary);
    background-color: var(--green-primary);
}
.view-all:hover p {
    color: black;
}

/** NAVIGATION TOP */
#navigation-top {
    display: flex;
    justify-content: center;
    height: var(--top-height);
    border-style: solid;
    border-width: 1px;
    border-color: var(--green-primary);
    border-bottom-style: none;
    position: relative;
    background: linear-gradient(180deg, rgb(0, 0, 0) 0%, rgb(4, 53, 0) 100%);
    box-sizing: border-box;
}
#navigation-hat-wrapper {
    position: absolute;
    transform: translate(0, 0%);
    width: 20%;
    z-index: 900;
    height: 60px;
    overflow-y: hidden;
}
#navigation-hat {
    background: black url("/assets/demon-eye.png");
    background-position: center 12px;
    image-rendering: pixelated;
    height: 120px;
    border-style: solid;
    border-width: 2px;
    border-color: var(--green-primary);
    border-radius: 100%;
    box-sizing: border-box;
    transform: translateY(-50%);
    width: 100%;
}
#navigation-hat p {
    z-index: 999;
    width: fit-content;
    height: 100%;
    margin: 0 auto;
    color: var(--green-primary);
    font-size: 1.3em;
    font-family: "Silkscreen";
    transform: translate(0, calc(50% + 0.3em));
    opacity: 0.5;
}
#navigation-hat img {
    width: fit-content;
    max-width: 100%;
    height: 40%;
    transform: translate(0, calc(50% + 2.5em));
    margin: 0 auto;
    image-rendering: pixelated;
}
#top-nav {
    position: absolute;
    top: 0%;
    right: 0%;
    display: flex;
    gap: 5px;
    align-items: center;
    height: 100%;
    margin: auto 8px;
}
.top-nav-link {
    display: block;
    height: 23px;
    width: 23px;
    margin: auto;
}
.top-nav-link:hover {
    opacity: 0.5;
}
.top-nav-img {
    filter: invert(74%) sepia(47%) saturate(588%) hue-rotate(46deg)
        brightness(111%) contrast(108%);
    height: 23px;
    width: 23px;
    margin: auto;
}
#navigation-title h1 {
    font-family: "Ashven";
    font-weight: normal;
    letter-spacing: 3px;
    padding: 0;
    font-size: 0.9em;
    color: var(--green-primary);
    text-align: center;
    margin: 0;
    transform: translateY(-4px) skewX(5deg);
    font-style: italic;
}
#navigation-title {
    position: absolute;
    top: 0%;
    left: 0%;
    height: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
}
#navigation-title img {
    filter: invert(74%) sepia(47%) saturate(588%) hue-rotate(46deg)
        brightness(111%) contrast(108%);
    height: 18px;
    width: 18px;
}
#navigation-title h1 span {
    font-size: 2em;
    max-height: 14px;
}

/** NAVIGATION WINDOW */
#navigation-window {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: calc(100% - 1px);
    box-sizing: border-box;
}
#portals-window {
    width: 100%;
    height: 100%;
    position: relative;
    background: black;
    background-attachment: scroll;
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0px 0px 20px inset green;
}
.portal {
    position: absolute;
    box-sizing: border-box;
}
.portal-indicator {
    position: relative;
    z-index: 90;
    width: 50%;
    height: 50%;
}
.portal-indicator-right {
    float: right;
}
.portal-name {
    color: var(--green-primary);
    border-width: 1px;
    border-style: solid;
    width: fit-content;
    padding: 4px;
    position: absolute;
    margin: 0;
    background-color: black;
    z-index: 100;
    box-sizing: border-box;
    font-family: "Silkscreen";
    font-size: 0.9em;
    white-space: nowrap;
}
.portal-line {
    color: var(--green-primary);
    border-width: 1px;
    width: 200%;
    border-top-style: solid;
    transform-origin: 0% 0%;
    transform: rotate(45deg);
    position: absolute;
    z-index: 0;
    top: 0%;
    box-sizing: border-box;
}
.portal-indicator-right .portal-line {
    transform-origin: 100% 0%;
    right: 0%;
    transform: rotate(-45deg);
}
.portal-indicator-right .portal-name {
    right: 0%;
}
.portal-node {
    border-radius: 100%;
    image-rendering: pixelated;
    border-width: 1px;
    border-style: solid;
    border-color: var(--green-primary);
    padding: 4px;
    background-color: black;
    z-index: 99;
    box-sizing: border-box;
    position: absolute;
    width: calc(100% - 2.5em);
    aspect-ratio: 1;
}
.portal-node-right {
    bottom: 0%;
    right: 0%;
}
.portal-node-left {
    bottom: 0%;
    left: 0%;
}
.portal-signal.portal-node-left {
    bottom: calc(0% - 2.5em / 2);
    left: calc(0% - 2.5em / 2);
}
.portal-signal.portal-node-right {
    bottom: calc(0% - 2.5em / 2);
    right: calc(0% - 2.5em / 2);
}
.portal-link:hover .portal-name {
    border-color: greenyellow;
    background-color: greenyellow;
    color: rgb(0, 0, 0);
}
.portal-link:hover .portal-node {
    box-shadow: 0px 0px 10px greenyellow;
}
.portal-crosshair,
.portal-crosshair-secondary {
    position: absolute;
    box-sizing: border-box;
    transform: translate(-50%, -50%);
    z-index: 0;
    border-radius: 100%;
}
.portal-crosshair {
    width: var(--crosshair-size);
    height: var(--crosshair-size);
    border-width: 1px;
    border-style: solid;
    border-color: var(--green-primary);
    background-color: rgba(0, 128, 0, 0.397);
    mix-blend-mode: difference;
    transition: 0.5s;
    transition-timing-function: ease-in-out;
}
.portal-crosshair-secondary {
    width: var(--crosshair-secondary-size);
    height: var(--crosshair-secondary-size);
    border-width: 1px;
    border-style: solid;
    border-color: rgb(54, 192, 0);
    background-color: rgba(0, 128, 0, 0.1);
    mix-blend-mode: difference;
    transition: 0.5s;
    transition-timing-function: ease-in-out;
}
.portal-crosshair-focused {
    background-color: rgb(32, 87, 0);
}
.portal-locked {
    filter: grayscale();
}
.portal-locked .portal-name {
    font-family: "Libre Barcode 39";
    font-size: 1.5em;
    height: 1.1em;
}
#hiding-place .portal-name {
    font-family: "Consolas";
    height: auto;
    font-size: 1em;
}

/** BUTTON */
.my-button {
    position: absolute;
    bottom: 0%;
    padding: 0;
    box-sizing: border-box;
    width: 88px;
    height: 31px;
    margin: 5px;
}
#button-img {
    width: 88px;
    height: 31px;
    image-rendering: pixelated;
}
#windows-bottom .my-button {
    display: none;
}

/** MISC NAV */
.misc-nav {
    position: absolute;
    bottom: 0%;
    right: 0%;
    display: flex;
    gap: 8px;
    margin: 5px 5px;
}
.misc-nav-img {
    height: 13px;
    transform: translateY(2px);
    margin-right: 5px;
    filter: invert(28%) sepia(100%) saturate(1597%) hue-rotate(199deg)
        brightness(102%) contrast(115%);
}
.misc-nav-link {
    color: var(--blue-primary);
    background-color: black;
    border: 2px solid var(--blue-primary);
    border-radius: 20px;
    padding: 4px 10px;
}
.misc-nav-link:hover {
    background-color: var(--blue-primary);
    color: black;
}
.misc-nav-link:hover .misc-nav-img {
    filter: none;
}

/* Quote */
#quote-window .window-content {
    padding: 20px 20px 22px 20px;
    max-height: 100px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}
#quote {
    color: rgb(73, 212, 30);
    font-family: "Consolas";
    margin: 0;
    line-height: 1.3rem;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/** LOG */
#log-window .window-content {
    padding: 0;
}
#log-window .view-all,
#log-window h1 {
    margin: 0;
}
#latest-log-entry {
    min-height: 86px;
}

/** CHANGELOG */
#changelog-window table tr {
    margin: 10px;
}
table,
th,
td {
    text-align: left;
    font-family: monospace;
    font-size: 1.08em;
}
.changelog-date {
    color: var(--green-primary);
    vertical-align: top;
    padding-right: 10px;
    font-family: monospace;
}
.changelog-content {
    vertical-align: top;
    padding-bottom: 7px;
    color: rgb(7, 199, 0);
}
#changelog-window .view-all {
    margin: 0;
}
#changelog-window .window-content {
    margin: 10px 0px;
}
#changelog-list {
    height: 343px;
}

/** STATUS */
#status-window {
    min-height: 80px;
    background: url("/assets/none-bg.png");
    background-size: cover;
    background-position: center;
}
#status {
    background: none;
}
#status-window .window-content {
    display: flex;
    padding: 12px 15px 15px 15px;
}

/** COUNTDOWN */
#countdown-display {
    font-family: "Silkscreen", monospace;
    font-size: 1.4em;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 3px;
}

#countdown-display span {
    min-width: 1.6em;
    text-align: center;
}

.cd-label {
    font-size: 0.6em;
    opacity: 0.7;
    min-width: auto !important;
}

#countdown-message {
    margin-top: 4px;
    font-size: 1.25em;
    opacity: 0.8;
}

/** ARTIFACTS */
#artifacts-window .window-content {
    padding: 20px 5px;
}
.artifacts-extra {
    display: none;
}
#artifacts {
    gap: 10px;
}

/** DIALS */
.dial-large-container {
    position: absolute;
    transition: 2s ease;
    width: 100%;
    height: 100%;
}
.dial-large {
    aspect-ratio: 1;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 50%;
    left: 50%;
    animation-name: dial-spin;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    object-fit: contain;
    image-rendering: pixelated;
    transform: translate(-50%, -50%);
}
.dial-large-primary {
    order: 1;
    opacity: 0.4;
    animation-duration: 400s;
}
.dial-large-secondary {
    order: 2;
    opacity: 0.4;
    animation-duration: 400s;
    animation-direction: reverse;
    width: 250%;
    height: 250%;
}
.dial-large-tertiary {
    order: 3;
    opacity: 0.8;
    animation-duration: 500s;
}
.dial-large-quaternary {
    order: 4;
    opacity: 0.5;
    animation-direction: reverse;
    animation-duration: 500s;
}
.dial {
    width: 460px;
    position: absolute;
    transition: 2s ease;
    top: 70%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: black;
    border-radius: 100%;
    border-style: solid;
    border-width: 1px;
    border-color: var(--dark-blue);
    z-index: -1;
    image-rendering: pixelated;
}
.dial-container {
    position: absolute;
    width: 100%;
    height: 230px;
    z-index: -1;
    transform: translate(0%, 0%) scaleY(-1);
    left: 0%;
    top: 0%;
    overflow: hidden;
}
.dial-container.left {
    transform: translate(0%, 0%) scaleY(-1) scaleX(-1);
}
.dial-container.bottom.left {
    transform: translate(0%, 0%) scaleY(1) scaleX(-1);
}
.dial-container.bottom {
    transform: translate(0%, 0%);
    top: auto;
    bottom: 0%;
}

/** SMALL SCREEN STYLING */
@media screen and (max-width: 1500px) {
    body {
        overflow-y: auto;
    }
    .windows-container {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto;
        box-sizing: border-box;
        gap: 5px;
    }
    #navigation-window {
        width: calc(100%);
        margin: auto;
        grid-column: 1 / 3;
        grid-row: 1 / 1;
    }

    .base-window {
        margin: 0;
    }
    .window-content {
        flex-grow: 1;
    }
    .dial-window {
        display: none;
    }
    #quote-window {
        flex-grow: 1;
    }

    #windows-right-content,
    #windows-left-content {
        margin: 0;
        padding: 0;
        height: 100%;
    }
    #windows-left,
    #windows-right {
        height: 100%;
    }
    #changelog-window {
        flex-grow: 1;
    }
    #status-window {
        flex-grow: 1;
    }

    #windows-left {
        grid-column: 1;
        grid-row: 2;
    }
    #windows-right {
        grid-column: 2;
        grid-row: 2;
    }
    .windows-column {
        width: 100%;
        padding: 0;
        height: fit-content;
        overflow-y: initial;
    }
    .windows-content {
        width: calc(100%);
        padding-left: 0px;
        margin: auto;
        gap: 5px;
        height: fit-content;
    }
    #portals-window {
        height: 90dvh;
    }
    .dial,
    .dial-inside,
    .dial-container {
        display: none;
    }

    /** ORDER */
    #navigation-window {
        order: 0;
    }
    #windows-left {
        order: 1;
    }
    #windows-right {
        order: 2;
    }

    #webmaster {
        order: 0;
    }
    #gallery {
        order: 1;
    }
    #characters {
        order: 2;
    }
    #comics {
        order: 3;
    }
    #lab {
        order: 4;
    }
    #showcase {
        order: 5;
    }
    #collection {
        order: 6;
    }
    #foryou {
        order: 7;
    }
    #guestbook {
        order: 8;
    }

    #hiding-place {
        order: 9;
    }
    #links {
        order: 4;
    }
}

/** SMALLER SCREEN ADJUSTMENTS */
@media screen and (max-width: 850px) {
    .base-window {
        margin-bottom: 5px;
    }
    .windows-container {
        display: flex;
        flex-direction: column;
    }
    #navigation-window {
        margin: 0;
        height: fit-content;
    }
    #windows-left {
        display: none;
    }
    #windows-right {
        display: none;
    }
    #windows-bottom {
        display: flex;
        flex-direction: column;
        gap: 0px;
    }
    #portals-window {
        height: fit-content;
    }
    #navigation-hat-wrapper {
        display: none;
    }

    /* Portals */
    .portals-container {
        display: flex;
        flex-wrap: wrap;
        height: fit-content;
        padding: 20px 10px 20px 10px;
        align-items: center;
        justify-content: center;
        margin: auto;
    }
    home-portal {
        width: fit-content;
    }
    .portal {
        position: relative !important;
        width: 300px !important;
        height: 50px !important;
        top: 0% !important;
        left: 0% !important;
        right: 0% !important;
        bottom: 0% !important;
        margin: 5px;
    }
    .portal-node {
        position: absolute !important;
        z-index: 999 !important;
        height: 55px;
        width: 55px;
        left: -4px;
        top: 50%;
        transform: translateY(-50%);
        right: initial;
    }
    .portal-line {
        display: none;
    }
    .portal-indicator {
        position: absolute;
        width: 100%;
        height: 39px;
        z-index: 900 !important;
        top: 50%;
        transform: translateY(-50%);
    }
    .portal-name {
        font-size: 1.1em;
        padding: 10px 10px 10px 40px;
        border-radius: 15px;
        width: 100%;
        font-family: "Silkscreen";
        left: initial !important;
        right: initial !important;
    }

    .portal-crosshair,
    .portal-crosshair-secondary {
        display: none;
    }
    .portal-locked {
        display: none;
        width: 0 !important;
        height: 0 !important;
        position: absolute !important;
    }
    #navigation-hat {
        position: absolute;
        height: 100px;
    }
    .dial-large-primary {
        width: 100%;
        height: 100%;
    }
    .dial-large-secondary {
        width: 100%;
        height: 100%;
    }
    .dial-large-tertiary {
        width: 100%;
        height: 100%;
    }
    .dial-large-quaternary {
        width: 110%;
        height: 110%;
    }
    #portals-window {
        background: none;
        box-shadow: 0px 0px 30px inset green;
    }
    .misc-nav {
        width: calc(100% - 10px);
        position: relative;
        flex-wrap: wrap;
        order: 11;
        font-size: 0.9em;
        gap: 3px;
    }
    .misc-nav a {
        flex-grow: 1;
    }
    #portals-window .my-button {
        display: none;
    }
    #windows-bottom .my-button {
        display: block;
    }
    .my-button {
        position: relative;
        width: 100%;
        height: 41px;
        margin: 0;
        padding-top: 4px;
        border: 1px solid green;
        order: 999;
        background: black;
    }
    #navigation-hat {
        border-style: none;
        background-color: transparent;
    }
    .dial-large {
        object-fit: cover;
    }
}

/** This is a rare case. */
@media screen and (max-height: 730px) {
    .windows-column {
        justify-content: unset;
    }
}
