/* Root */

:root {
    --taskbar-h: 40px;
}

/* Font */

@font-face {
    font-family: MSW98UI;
    src: url("../assets/fonts/MSW98UI-Regular.woff2") format("woff2"),
         url("../assets/fonts/MSW98UI-Regular.woff") format("woff");
    font-display: swap;
}

/* General */

* {
    font-family: MSW98UI, "MS Sans Serif", sans-serif;
    box-sizing: border-box;
}

:lang(ja) {
    font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "メイリオ", "Meiryo", "ＭＳ Ｐゴシック", "MS PGothic", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

html,
body {
    min-height: 100vh;
    overflow: hidden;
}

body {
   display: flex;
   flex-direction: column;
   margin: 0;
}

:focus-visible {
    outline: 2px dotted #505050;
    outline-offset: 2px;
}

button {
    cursor: pointer;
}

[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

[disabled] img {
    filter: grayscale(1);
    opacity: 0.7;
}

a {
    text-decoration: none;
}

h2 {
    font-weight: normal;
    font-size: 20px;
    padding: 4px 6px;
    margin: 10px 0;
    border: 3px inset #C0C0C0;
    box-shadow: inset 3px 3px 0 #afafaf, inset -3px -3px 0 #cfcfcf;
}

h3 {
    margin: 20px 0 10px 0;
}

h4 {
    text-align: center;
    margin-bottom: 0;
    font-size: 18px;
}

.bounce {
    animation: bounce 2s ease infinite;
} @keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
	40% {transform: translateY(-4px);}
	60% {transform: translateY(-2px);}
}

.separator {
    height: 2px;
    margin: 6px 0;
    background-color: #808080;
    box-shadow: 0 2px 0 #ffffff;
}

/* JS */

.window.is-closed {
    display: none;
}

/* Desktop */

main#desktop {
    position: relative;
    height: calc(100vh - var(--taskbar-h));
    overflow: hidden;
    background-color: #008080;
}

#desktop nav.desktop-icons {
    position: absolute;
    top: 10px;
    left: 40px;
    z-index: 10;
}

#desktop nav.desktop-icons ul {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 0;
    margin: 0;
    list-style-type: none;
}

#desktop nav.desktop-icons .desktop-icon {
    width: 72px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: #ffffff;
    background-color: transparent;
    border: none;
    padding: 0;
    font: inherit;
    text-align: center;
}

#desktop nav.desktop-icons .desktop-icon img {
    width: 48px;
    height: 48px;
    border: 2px dotted transparent;
}

#desktop nav.desktop-icons .desktop-icon:hover img {
    border: 2px dotted #505050;
}

#desktop nav.desktop-icons .desktop-icon:focus-visible img {
    border: 2px dotted #505050;
}

#desktop nav.desktop-icons .desktop-icon span {
    display: block;
    line-height: 1.1;
}

/* Masked H1 */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Window */

#window-frame {
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
}

#window-frame .window {
    pointer-events: auto;
}

#window-frame .window:not(.window-start-menu):not([hidden]):not(.is-closed) {
    display: flex;
    flex-direction: column;
    max-height: calc(100% - 10px);
    overflow: hidden;
}

#window-frame .window .titlebar {
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    background: linear-gradient(to right,#000080, #067DCB);
    color: #ffffff
}

#window-frame .window .titlebar .title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
}

#window-frame .window .titlebar .title img {
    width: 18px;
    height: 18px;
}

#window-frame .window .titlebar .controls {
    display: flex;
    align-items: center;
    gap: 2px;
}

#window-frame .window .titlebar .controls button {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px outset #c0c0c0;
    background-color: #c0c0c0;
}

#window-frame .window .titlebar .controls img {
    width: 12px;
    height: 12px;
}

.window {
    width: 420px;
    background-color: #c0c0c0;
    border: 6px outset #c0c0c0;
    z-index: 1;
}

.window .window-content {
    background-color: #ffffff;
    padding: 10px;
    border-top: 3px inset #c0c0c0;
}

#window-frame .window:not(.window-start-menu):not([hidden]):not(.is-closed) .window-content {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.window-home .window-content .boot-screen {
    background-color: #ffffff;
    padding: 12px;
    border: 2px inset #c0c0c0;
}

.window-home .window-content .boot-screen.booted {
    display: none;
}

.window-home .window-content .boot-title {
    margin: 0 0 10px;
    font-weight: bold;
}

.window-home .window-content .boot-sub {
    margin: 8px 0 0;
    font-size: 12px;
}

.window-home .window-content .boot-progress {
    height: 14px;
    border: 2px inset #c0c0c0;
    background-color: #ffffff;
    overflow: hidden;
}

.window-home .window-content .boot-bar {
    height: 100%;
    width: 40%;
    background-color: #000080;
    animation: boot-move 1s linear infinite;
}

@keyframes boot-move {
    0%   { transform: translateX(-120%); }
    100% { transform: translateX(260%); }
}

.home-content[hidden] {
    display: none;
}

/* Taskbar */

#taskbar {
    background-color: #c0c0c0;
    height: var(--taskbar-h);
    display: flex;
    align-items: center;
    padding: 2px 6px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
}

#taskbar div .taskbar-btn {
    display: flex;
    background-color: #c0c0c0;
    border-color: #cfcfcf #000000 #000000 #cfcfcf;
}

#taskbar div button img {
    margin: 5px;
}

#taskbar .start-menu {
    display: flex;
    align-items: center;
    gap: 10px;
}

#taskbar .start-menu button p {
    margin: 5px;
    font-weight: 700;
}

:lang(ja) #taskbar .start-menu button p {
    margin: 0;
}

#taskbar .handler {
    border: 3px outset #c0c0c0;
    width: 2px;
    height: 25px;
    margin: 0 5px;
    align-items: center;
    cursor: col-resize;
}

#taskbar .help-area {
    display: flex;
}       

#taskbar div.taskbar-windows button {
    background-color: #c0c0c0;
    border-color: #cfcfcf #000000 #000000 #cfcfcf;
    width: 150px;
    height: 31px;
    text-align: left;
}

#taskbar div.taskbar-windows button img {
    width: 16px;
    height: 16px;
    margin: 0 5px 0 0;
}

#taskbar .system-tray {
    margin-left: auto;
}

#taskbar .system-tray ul {
    display: flex;
    align-items: center;
    list-style-type: none;
    background-color: #c0c0c0;
    border: 2px inset #c0c0c0;
    border-bottom-color: #cfcfcf;
    padding-left: 0;
}

#taskbar .system-tray ul li > a {
    padding-right: 10px;
}

#taskbar .system-tray ul li button {
    display: inline-flex;
    align-items: center;
    border: none;
    background-color: #c0c0c0;
}

button#local-time {
    margin-left: 15px;
    padding: 2px 10px 0 0;
}

button#local-time span {
    margin: 0;
}

button#local-time:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    right: 0;
    bottom: 120%;
    background-color: #ffffe1;
    color: #000000;
    border: 1px solid #000000;
    padding: 4px 6px;
    font-size: 11px;
    white-space: nowrap;
    box-shadow: 2px 2px 0 #808080;
    z-index: 2000;
}

button#local-time:hover::after,
button#local-time:focus-visible::after {
    content: attr(data-tooltip);
}

@media (min-width: 540px) and (max-width: 991px) {
    #desktop div.window-tablet-alert {
        height: fit-content;
        z-index: 2000;
    }

  html.tablet-mode #window-frame .window:not(.window-start-menu):not([hidden]):not(.is-closed) {
        position: fixed;
        top: 30px;
        left: 120px;
        right: 40px;
        bottom: calc(var(--taskbar-h) + 10px);
        overflow: hidden;
        display: flex;
        flex-direction: column;
  }

  html.tablet-mode #window-frame .window:not(.window-start-menu):not([hidden]):not(.is-closed) .window-content {
        flex: 1;
        min-height: 0;
        overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}