@font-face {
    font-family: '04B_03';
    src: url(04B_03.TTF) format('truetype');
}

/** Some variables (see also --window-width, in scaling-window-layout.css */
html {
    --scrollbar-width: 0px;
    --pixel: 2px;
    /* Dynamic: --window-width */
    --bg-color: #e6e6e6;
    --light-bg-color: #fafafa;
    --dark-bg-color: #a7a7a7;
    --lighter-blue-color: rgb(155, 192, 255);
    --light-blue-color: #639bff;
    --blue-color: #306fe6;
    --dark-blue-color: #101623;
    --red-color: rgb(220, 42, 42);
    --darkred-color: rgb(171, 28, 28);
    --green-color: #93d850;
    --darkgreen-color: #51851d;
}

/************************\
 *  var(--window-width)
 *  var(--site-width)
\************************/

/** KEY VIEWPORT WIDTHS:
        360: the window becomes 320px wide
        540, 720: mid, large viewports
        960: sidebar appears
        1080: sidebar appears, windows are wider

    KEY SIZES:
        16: font size
        320px, 480px, 640px: sizes of the window
*/

/** Layout **/
/**
@ body
|                               | <- hero-title goes here
| @ div.windows-and-sidebar     |
| | @div.windows @div.sidebar| || <- in mobile these are stacked
| | |            |           | ||
| | |            |           | || <- long. causes scroll
| | |            |           | ||
|                               |
| @ nav.taskbar                 | <- fixed
*/

html {
    --window-scale: 1;
    --window-width: calc(100% - 8px - var(--scrollbar-width));
    --sidebar-width: var(--window-width);
    --site-width: var(--window-width);
    --site-gap: calc(32px);
}
body, html {
    margin: 0;
    padding: 0;
    height: 100%;
}

.windows-and-sidebar {
    width: var(--site-width);
    margin: 0 auto 128px auto;
}

@media (min-width: 360px) {
    html { --window-width: calc(320px * var(--window-scale)); }
}

@media (min-width: 360px) { html { --window-scale: 1 } }
@media (min-width: 540px) { html { --window-scale: 1.5; } }

@media (min-width: 960px) {
    html {
        --sidebar-width: calc((64px + 128px) * var(--window-scale));
        --site-width: calc(var(--window-width) + var(--site-gap) + var(--sidebar-width));
    }
    .windows-and-sidebar {
        display: flex;
        gap: var(--site-gap);
        margin: 0 auto;
    }
    .windows { width: var(--window-width); }
    .sidebar { width: var(--sidebar-width); }
}


/************************\
 *     BASE STYLES
\************************/

html {
    font-family: '04B_03', monospace;
    color: white;
    font-size: 16px;
}

a, a:visited {
    color: var(--lighter-blue-color);
}

button, a.button-like, a.button-like:visited {
    display: inline-block;
    border: var(--pixel, 2px) outset var(--light-bg-color);
    background: var(--bg-color);
    font-size: inherit;
    line-height: 1;
    vertical-align: middle;
    padding: 8px 16px;
    color: var(--dark-blue-color);
    outline: none;
    font-family: inherit;
}

button:active, a.button-like:active, a.button-like:visited:active {
    border-style: inset;
    text-indent: var(--pixel, 2px);
}

ul {
    list-style-type: square;
}
ul, ol {
    padding-left: 24px;
}


body, html {
    overflow-y: auto;
    line-height: 1;
}

/************************\
 *       ELEMENTS
\************************/

/* screen-wide banner with text in the middle. Needs a div inside to keep width in check.*/
.site-banner {
    width: 100%;
    border-top: var(--pixel) solid currentColor;
    border-bottom: var(--pixel) solid currentColor;
}
.site-banner > .adblock-banner {
    width: var(--site-width);
    margin: auto;
    overflow: hidden;
}
.adblock-banner > * {
    margin-top: 8px;
    margin-bottom: 8px;
}


/* Buttons */
.button, .button:visited {
    display: inline-block;
    outline: none;
    border: var(--pixel, 2px) outset var(--light-bg-color);
    background: var(--bg-color);
    color: var(--dark-blue-color);

    padding: 0 10px;
}
.button:active {
    border-style: inset;
    text-indent: 2px;
}
.button, .button::before, .button::after {
    line-height: 1;
    vertical-align: middle;
    overflow: none;
    font-size: 20px;
    line-height: 32px;
}
.button:focus {
    outline: var(--pixel, 2px) dotted currentColor;
}

/* Buttons */
.button-taskbar, 
.button-taskbar:visited {
    color: var(--dark-blue-color);
    min-width: 150px;
}

/* Play on itch.io! */
.button-itch, .button-itch:visited, .button-itch:active {
    --pixel: 4px;
    display: block;
    margin: 2rem auto;
    width: max-content;

    font-size: 1.5em;
    padding: 1rem 2rem;

    color: var(--red-color);
}

.button-itch::before {
    display: inline-block;
    content: ' ';
    width: 1em;
    height: 1em;
    margin-right: 10px;
    background: url(itchio-textless-black.svg);
    background-size: 100%;
    background-repeat: no-repeat;
}

/** helpful editor: https://nikitahl.github.io/bg-image/ **/
body {
    background-color: #99e550;
    background-image: url(background-x8.png?x);
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-origin: padding-box;
    scroll-behavior: smooth;
}

/** TOP BIT: HERO (h1 tag container, above-the-fold holder) */
.hero-title {
    margin-top: calc(32px * var(--window-scale));
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-title h1,
.hero-title img { padding: 0; margin: 0; line-height: 1; }
.hero-title img {
    height: calc(24px * var(--window-scale));
    width: calc(24px * var(--window-scale));
}
.hero-title h1 {
    color: #36393b;
    margin-left: calc(8px * var(--window-scale));
    font-size: calc(30px * var(--window-scale));
    text-shadow: 0px calc(1px * var(--window-scale)) 0 #fbf236;
}

/** Windows */
.main-window::before {
    content: attr(aria-label);
    display: block;
    height: calc(16px * var(--window-scale));
    line-height: calc(16px * var(--window-scale));
    padding: 4px;
    margin: -4px; /* counteract outer element's padding */
    margin-bottom: 4px;
    background: #306fe6;
    color: white;
    font-size: calc(16px * var(--window-scale));
}
.main-window {
    position: relative;
    box-sizing: content-box;
    margin: calc(16px * var(--window-scale)) auto calc(64px * var(--window-scale));
    border: 2px solid lightgray;
    outline: 2px outset rgb(230, 230, 230);
    padding: 4px;
    background: #36393b;
    color: white;
    font-size: calc(14px * var(--window-scale));
    line-height: calc(16px * var(--window-scale));
}

/* Task bar */
.taskbar {
    position: fixed;
    position: sticky;
    bottom: 0;
    right: var(--scrollbar-width, 0);
    left: 0;
    background: var(--bg-color);
    border-top: var(--pixel, 2px) outset var(--light-bg-color);
}
.taskbar ul,
.taskbar li,
.taskbar img { list-style: none; padding: 0; margin: 0; line-height: 1; }
.taskbar li {
    display: inline-block;
    margin: var(--pixel, 2px) 0 var(--pixel, 2px) 0;
}
.taskbar .with-logo a {
    margin-left: 10px;
    padding-left: 0;
    background-color: var(--light-blue-color);
    border-color: var(--light-blue-color);
    color: white;
    text-shadow: rgba(255, 255, 255, 0.2) 0 0 2px;
}
.taskbar .with-logo img {
    height: 32px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

nav.taskbar {
    position: fixed;
    bottom: 0;
    z-index: 10;
}
