/* 98's font, declared here so it survives a change of theme. */
@font-face {
    font-family: "Pixelated MS Sans Serif";
    font-style: normal;
    font-weight: 400;
    src: url("font/ms_sans_serif-1d4d404a3bbe4b7007f89e792233aa9c.woff2?vsn=d") format("woff2"),
        url("font/ms_sans_serif-7bbbd32e0f9977dd70a4d1287927d5da.woff?vsn=d") format("woff");
}

@font-face {
    font-family: "Pixelated MS Sans Serif";
    font-style: normal;
    font-weight: 700;
    src: url("font/ms_sans_serif_bold-cb1c7473de82bb53662aaa2d7640e53e.woff2?vsn=d") format("woff2"),
        url("font/ms_sans_serif_bold-6eb2c63fbead0014ef0c4c537bfe328a.woff?vsn=d") format("woff");
}

:root {
    --background: #000;
    --desktop-ink: #fff;
    --window: rgba(212, 212, 212, 0.9);
}

:root.light {
    --background: #fff;
    --desktop-ink: #111;
    --window: rgba(171, 171, 171, 0.75);
}

html {
    background-color: var(--background);
    height: 100%;
}

body {
    -webkit-user-select: none;
    user-select: none;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    height: 100vh;
    height: 100svh;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
    align-items: center;
    line-height: 1.6;
    font-size: 18px;
    color: #222;
    font-family: "Comic Sans MS", "Chalkboard SE", "Comic Neue", serif;
}

#screen > .window {
    box-sizing: border-box;
    position: relative;
    font-family: inherit;
    font-size: inherit;
    width: 100%;
    max-width: 636px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.window-body {
    -webkit-user-select: text;
    user-select: text;
    overflow-y: auto;
    margin: 0;
    padding: 20px;
}

#tamanotchi img, #buttons img {
    image-rendering: pixelated;
}

#buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
}

#buttons img {
    flex: none;
}

#screen > .window.placed {
    position: fixed;
    margin: 0;
    max-width: none;
    max-height: none;
}

#screen > .window > .title-bar {
    touch-action: none;
}

#screen > .window > .title-bar > .title-bar-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#screen > .window > .title-bar > .title-bar-controls {
    flex: none;
}

#screen > .window.minimized .window-body {
    display: none;
}

#screen > .window[hidden] {
    display: none;
}

#screen {
    display: contents;
}

#dock {
    position: fixed;
    top: 0;
    right: 0;
    display: flex;
    flex-direction: column;
}

#dock > * {
    box-sizing: border-box;
    position: relative;
    border: none;
    border-radius: 0;
    width: 64px;
    height: 64px;
    background: url("./nextstep-tile-be89f9217b6e9cb4a3067bdc6e0c3c17.png?vsn=d");
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 11px;
    overflow: hidden;
}

.dock-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 4px;
    text-align: center;
    font-family: "Pixelated MS Sans Serif", Arial;
    font-size: 8px;
    line-height: 1;
    color: #fff;
    -webkit-font-smoothing: none;
    white-space: nowrap;
}

#dock > *[hidden] {
    display: none;
}

#dock img {
    width: auto;
    height: 36px;
}

#dock #kyle-app {
    border: none;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
    padding: 0;
}

#dock #kyle-app {
    padding-bottom: 0;
}

#dock #kyle-app img {
    width: 60px;
    height: 60px;
}

/* A page of its own is one window and a dock of two tiles: the way home and
   the light switch. The tiles sit in a row along the top and the window takes
   what is left. */

body.page {
    grid-template-rows: auto minmax(0, 1fr);
}

body.page #dock {
    position: static;
    flex-direction: row;
    justify-self: end;
    grid-row: 1;
}

body.page #screen,
body.page #screen > .window {
    grid-row: 2;
}

body.page .window-body > :first-child {
    margin-top: 0;
}

body.page .window-body > :last-child {
    margin-bottom: 0;
}

/* The light switch is a dock tile here at every width, where the desktop's
   own keeps it for the dock and hides it in the footer. */

body.page #dock #toggle {
    display: flex;
    border: none;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
    font-size: 30px;
}

body.page #dock #toggle .dock-icon {
    line-height: 1;
}

#icons {
    display: grid;
    grid-template-columns: repeat(4, 72px);
    position: fixed;
    top: 16px;
    left: 12px;
    gap: 4px;
    padding: 4px;
}

#icons .icon:not(.app):not(#credits-icon) {
    display: none;
}

#credits-window h2 {
    margin-top: 0;
}

#screen > #catclock-window:not([hidden]) {
    position: fixed;
    top: 96px;
    left: 12px;
    width: auto;
    height: auto;
}

/* The desktop stays the site's: no theme borders, rounding or font here. */
.icon {
    background: none;
    border: none;
    border-radius: 0;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 2px;
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--desktop-ink);
    font-family: "Pixelated MS Sans Serif", Arial;
    font-size: 11px;
    text-shadow: none;
}

.icon.dropped {
    position: fixed;
}

#icons .icon:active {
    box-shadow: none;
    text-shadow: none;
}

#icons .icon:focus {
    outline: none;
}

.icon:focus-visible .icon-label {
    outline: 1px dotted var(--desktop-ink);
}

.icon-image {
    position: relative;
    line-height: 0;
}

.icon-image img {
    width: auto;
    height: 32px;
    image-rendering: pixelated;
}

.icon.selected .icon-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: #000080;
    opacity: 0.5;
}

.icon-label {
    padding: 0 1px;
    line-height: 1.2;
}

.icon.selected .icon-label {
    background: #000080;
    color: #fff;
    outline: 1px dotted #fff;
}

.resizer {
    display: none;
    position: absolute;
}
.resizer-n, .resizer-s {
    left: 0;
    right: 0;
    height: 6px;
    cursor: ns-resize;
}
.resizer-e, .resizer-w {
    top: 0;
    bottom: 0;
    width: 6px;
    cursor: ew-resize;
}
.resizer-n { top: -3px; }
.resizer-s { bottom: -3px; }
.resizer-e { right: -3px; }
.resizer-w { left: -3px; }
.resizer-ne, .resizer-nw, .resizer-se, .resizer-sw {
    width: 12px;
    height: 12px;
    z-index: 1;
}
.resizer-ne, .resizer-nw { top: -3px; }
.resizer-se, .resizer-sw { bottom: -3px; }
.resizer-ne, .resizer-se { right: -3px; }
.resizer-nw, .resizer-sw { left: -3px; }
.resizer-nw, .resizer-se { cursor: nwse-resize; }
.resizer-ne, .resizer-sw { cursor: nesw-resize; }

h1 {
    font-size: 2em;
    line-height: 1.2;
}
h2 {
    font-size: 1.5em;
    line-height: 1.2;
}

a {
    color: #e9658b;
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

.favicon {
    height: 1em;
    padding-right: 0.3em;
    transform: translateY(0.1em);
}

#header {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25em;
    align-items: center;
}

#me {
    width: 96px;
    height: 96px;
}

#header h1 {
    margin: 0;
}

#header p {
    margin: 0.2em 0 0;
}
#header .field-border {
    line-height: 0;
}

footer {
    text-align: center;
}

#footer-break {
    display: none;
}

footer > a:hover {
    filter: brightness(1.5);
}

#toggle, #themes-app {
    display: none;
    font-size: 24px;
    color: inherit;
    text-shadow: none;
}

#applemusic {
    max-width: 480px;
    border: 4px solid #e9658b;
    border-radius: 10px;
    box-sizing: border-box;
}

@media (min-width: 656px) {
    #tamanotchi img {
        transform: scaleX(-1);
    }

    #dock #toggle, #dock #themes-app {
        display: flex;
        border: none;
        box-shadow: none;
        min-width: 0;
        min-height: 0;
        font-size: 30px;
    }

    #dock #toggle .dock-icon, #dock #themes-app .dock-icon {
        line-height: 1;
    }

    /* Wide enough for a desktop, the dock hangs in its corner again and the
       window sits in the middle of the floor. */

    body.page #dock {
        position: fixed;
        flex-direction: column;
    }

    body.page #screen {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    body.page #screen > .window {
        position: relative;
        max-height: calc(100% - 48px);
    }

    #screen {
        display: block;
        position: relative;
        width: 100%;
        height: 100%;
    }

    /* --top is where a window opens; it leaves itself the room below. */
    #screen > .window {
        position: absolute;
        top: var(--top, 0px);
        height: auto;
        max-height: calc(100% - var(--top, 0px) - 16px);
    }

    #screen > #catclock-window:not([hidden]) {
        display: flex;
        top: 24px;
        left: 32px;
        width: auto;
    }

    #catclock-window .window-body {
        padding: 0;
    }

    #catclock {
        display: block;
    }

    #icons {
        left: auto;
        right: 80px;
        grid-template-columns: repeat(3, 72px);
    }

    #icons .icon:not(.app):not(#credits-icon) {
        display: flex;
    }


    #testimonials-window:not([hidden]),
    #friends-window:not([hidden]),
    #credits-window:not([hidden]) {
        display: flex;
        width: 420px;
        max-height: min(480px, calc(100% - var(--top, 0px) - 16px));
    }

    #testimonials-window h2,
    #friends-window h2 {
        margin-top: 0;
    }

    #friends-window {
        left: 300px;
        --top: 140px;
    }

    #testimonials-window {
        left: 360px;
        --top: 200px;
    }

    #credits-window:not([hidden]) {
        left: 420px;
        --top: 260px;
        width: 560px;
    }

    #themes-window:not([hidden]) {
        display: flex;
        left: 200px;
        --top: 320px;
        width: 320px;
    }

    #screen > #kfarwell-window {
        left: 92px;
        top: 92px;
        max-height: 75vh;
        width: 636px;
        max-width: calc(100vw - 64px);
        z-index: 2;
    }

    #webamp-host {
        z-index: 1;
    }

    #buttons {
        box-sizing: border-box;
        width: 100%;
        padding: 4px;
        max-height: 25vh;
        overflow-y: auto;
        align-content: flex-end;
    }

    #screen > #kfarwell-window.placed {
        max-height: none;
    }

    #screen > .window .resizer {
        display: block;
    }
}

@media (min-width: 1320px) {
    #screen > #kfarwell-window {
        left: 220px;
        top: 24px;
    }
}

[data-phx-session],
[data-phx-teleported-src] {
    display: contents;
}

#chat-window .window-body {
    overflow: hidden;
    padding: 6px;
    display: flex;
    flex: 1;
    min-height: 0;
}

.chat {
    -webkit-user-select: none;
    user-select: none;
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 4px;
    min-height: 0;
    font-family: "SerenityOS Emoji", "Pixelated MS Sans Serif", Arial;
    font-size: 11px;
    line-height: 1.5;
    -webkit-font-smoothing: none;
}

.chat button,
.chat input,
.chat label,
.chat menu {
    font-family: inherit;
    font-size: inherit;
}

.chat-body {
    display: flex;
    flex: 1;
    gap: 4px;
    min-height: 0;
}

.chat-contacts {
    width: 116px;
    flex: none;
    margin: 0;
    overflow-y: auto;
}

.chat-contacts summary {
    font-weight: bold;
    list-style: none;
}

.chat-contacts summary::marker,
.chat-contacts summary::-webkit-details-marker {
    content: "";
    display: none;
}

.chat-contact {
    text-decoration: none;
    color: inherit;
}

.chat-contact:hover {
    text-decoration: underline;
}

.chat-contact.host {
    color: #e9658b;
    font-weight: bold;
}

.chat-main {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

.chat-main menu[role="tablist"] {
    margin: 0 0 -2px 0;
    flex-wrap: wrap;
}

.chat-typing {
    position: sticky;
    bottom: 0;
    margin: 0;
    padding-top: 1px;
    background: #fff;
    color: grey;
    overflow: hidden;
    white-space: nowrap;
}

.chat-panel {
    flex: 1;
    min-height: 0;
    display: flex;
    padding: 4px;
    position: relative;
}

/* The log's bevel, drawn outside it: a scrolling box paints its own
   content over an inset shadow. */
.chat-panel::before,
.chat-panel::after {
    content: "";
    position: absolute;
    pointer-events: none;
    border-style: solid;
    border-width: 1px;
    box-sizing: border-box;
    z-index: 1;
}

.chat-panel::before {
    top: 4px;
    right: 4px;
    bottom: 4px;
    left: 4px;
    border-color: grey #fff #fff grey;
}

.chat-panel::after {
    top: 5px;
    right: 5px;
    bottom: 5px;
    left: 5px;
    border-color: #0a0a0a #dfdfdf #dfdfdf #0a0a0a;
}

.chat-context-menu {
    position: absolute;
    z-index: 20;
    background: silver;
    padding: 2px;
    box-shadow: inset -1px -1px grey, inset 1px 1px #fff,
        inset -2px -2px #0a0a0a, inset 2px 2px #dfdfdf;
}

.chat-context-menu button {
    display: block;
    width: 100%;
    background: none;
    border: none;
    box-shadow: none;
    text-align: left;
    padding: 2px 16px 2px 8px;
    min-height: 0;
    color: #222;
    text-shadow: none;
    cursor: pointer;
}

.chat-context-menu button:hover {
    background: #000080;
    color: #fff;
}

.chat-empty {
    color: grey;
    margin: 0;
}

.chat-nickname {
    margin: 0;
    align-items: center;
}

.chat-nickname form {
    flex: 1;
    display: flex;
}

.chat-nickname input {
    flex: 1;
    min-width: 0;
}

.chat-log {
    -webkit-user-select: text;
    user-select: text;
    background: #fff;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 3px 5px;
    line-height: 1.25;
}

.chat-message {
    margin: 0;
}

.chat-author {
    font-weight: bold;
}

.chat-author::after {
    content: ": ";
    font-weight: normal;
}

.chat-message.theirs .chat-author {
    color: #000080;
}

.chat-text {
    word-break: break-word;
}

.chat-text .chat-line {
    display: inline;
}

.chat-text h1,
.chat-text h2,
.chat-text h3 {
    display: block;
    margin: 2px 0;
    font-size: 15px;
}

.chat-text h2 {
    font-size: 13px;
}

.chat-text h3 {
    font-size: 12px;
}

.chat-text blockquote {
    display: block;
    margin: 1px 0 1px 2px;
    padding-left: 5px;
    border-left: 3px solid #808080;
}

.chat-text pre {
    display: block;
    margin: 2px 0;
    padding: 3px 5px;
    white-space: pre-wrap;
    box-shadow: inset -1px -1px #fff, inset 1px 1px grey;
    background: #efefef;
}

.chat-text code {
    padding: 0 2px;
    background: #efefef;
    font-family: monospace;
}

.chat-text a {
    color: #0000c0;
    text-decoration: underline;
}

.chat-text ul {
    margin: 1px 0;
    padding-left: 18px;
}

.chat-spoiler {
    background: #0a0a0a;
    color: transparent;
    cursor: pointer;
}

.chat-spoiler.revealed {
    background: rgba(0, 0, 0, 0.08);
    color: inherit;
    cursor: auto;
}

.chat-message img {
    display: block;
    max-width: 100%;
    max-height: 160px;
    margin: 2px 0;
    image-rendering: auto;
}

.chat-presence.online {
    color: #008000;
}

.chat-presence.idle,
.chat-presence.away {
    color: #b8860b;
}

.chat-presence.dnd {
    color: #a00;
}

.chat-presence.offline,
.chat-presence.unknown {
    color: grey;
}

.chat-compose {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.chat-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-wrap: wrap;
}

.chat-tool {
    min-width: 0;
    min-height: 0;
    height: 18px;
    padding: 0 3px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #222;
    text-shadow: none;
}

label.chat-tool {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: silver;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
        inset -2px -2px grey, inset 2px 2px #dfdfdf;
    line-height: normal;
    cursor: pointer;
}

label.chat-tool:active:not(.disabled) {
    box-shadow: inset -1px -1px #fff, inset 1px 1px #0a0a0a,
        inset -2px -2px #dfdfdf, inset 2px 2px grey;
}

label.chat-tool.disabled {
    pointer-events: none;
    color: grey;
    text-shadow: 1px 1px 0 #fff;
}

label.chat-tool.disabled span {
    opacity: 0.4;
}

.chat-tool.wide {
    padding: 0 5px;
}

.chat-block {
    display: block;
    width: 11px;
    height: 9px;
    background: #222;
}

.chat-tool.h1 {
    font-size: 13px;
}

.chat-tool.h2 {
    font-size: 12px;
}

.chat-tool.h3 {
    font-size: 11px;
}

.chat-tool.right {
    margin-left: auto;
}

.chat-form {
    display: flex;
    gap: 4px;
}

.chat-form textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    font-family: inherit;
    font-size: inherit;
}

.chat-form button {
    min-width: 58px;
}

.chat-file {
    display: none;
}

.chat-upload {
    display: contents;
}

#chat-emoji,
#chat-gif {
    display: contents;
}

.chat-picker[hidden] {
    display: none;
}

.chat-picker {
    position: absolute;
    display: flex;
    flex-direction: column;
    bottom: 100%;
    left: 0;
    right: 0;
    margin-bottom: 4px;
    z-index: 20;
    background: silver;
    padding: 4px;
    box-shadow: inset -1px -1px #0a0a0a, inset 1px 1px #fff,
        inset -2px -2px grey, inset 2px 2px #dfdfdf;
}

.chat-picker-grid {
    background: #fff;
    box-shadow: inset -1px -1px #fff, inset 1px 1px grey,
        inset -2px -2px #dfdfdf, inset 2px 2px #0a0a0a;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 2px;
}

.chat-picker-search {
    display: flex;
    margin-bottom: 4px;
}

.chat-picker-search input {
    flex: 1;
    min-width: 0;
}

.chat-emoji-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 30px);
    justify-content: space-between;
    overflow-x: hidden;
    row-gap: 3px;
}

.chat .chat-emoji {
    border: none;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
    width: 30px;
    height: 30px;
    padding: 0;
    background-color: transparent;
    background-image: url("./emoji-982ab8d521b70ab94456c38d9865f0e0.png?vsn=d");
    background-repeat: no-repeat;
    background-size: 1320px 1200px;
    image-rendering: pixelated;
    cursor: pointer;
}

.chat .chat-emoji:hover {
    background-color: #000080;
}

.chat-gif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
    gap: 2px;
}

.chat-gif {
    background: none;
    border: none;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
    padding: 0;
    cursor: pointer;
    line-height: 0;
}

.chat-gif img {
    width: 100%;
    height: 56px;
    object-fit: cover;
}

.chat-gif:hover img,
.chat-gif:focus img {
    outline: 2px solid #000080;
    outline-offset: -2px;
}

.chat-gif-search {
    display: flex;
    gap: 4px;
    margin-bottom: 4px;
}

.chat-gif-search input {
    flex: 1;
    min-width: 0;
}

.chat-picker-note {
    margin: 4px 0 0;
    color: grey;
}

.chat-status {
    margin: 0;
    color: #a00;
}

.chat-sending {
    margin: 0;
    color: grey;
}

.chat .status-bar {
    margin: 0;
}

.chat-connection {
    flex: 0 0 96px;
}

#music {
    display: none;
}

#screen > #chat-window {
    isolation: isolate;
}

#screen > #chat-window:not([hidden]) {
    position: fixed;
    inset: 0;
    height: auto;
    max-width: none;
    z-index: 10;
}

@media (min-width: 656px) {
    #screen > #chat-window:not([hidden]) {
        display: flex;
        position: absolute;
        inset: auto;
        z-index: auto;
        right: 76px;
        top: 156px;
        width: 520px;
        height: 380px;
    }
}

* {
    cursor: url("./cursor-64e600f5c82d811f530724925e4c41f0.png?vsn=d"), auto;
}
