/* ===== GENERAL ===== */
.os-root {
    min-height: 100vh;
    font-family: "MS Sans Serif", Tahoma, Verdana, sans-serif;
}

.hidden {
    display: none !important;
}

/* ===== BOOT SCREEN ===== */
.boot-screen {
    position: fixed;
    inset: 0;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9eb89a;
    font-family: "Lucida Console", monospace;
    font-size: 0.9rem;
    z-index: 9999;
}

.boot-text {
    text-align: left;
    line-height: 1.4rem;
    padding: 20px;
}

/* ===== OVERLAYS ===== */
.overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

/* shutdown */
.overlay--shutdown {
    background: #000;
    color: #f5f5f5;
}

.shutdown-box {
    text-align: center;
}

.shutdown-face {
    font-size: 5rem;
    margin-bottom: 0.5rem;
}

.shutdown-text {
    margin-bottom: 1.2rem;
    font-size: 1.1rem;
}

.power-button {
    background: #4caf50;
    color: white;
    border: 2px solid #204021;
    padding: 0.5rem 1.4rem;
    border-radius: 3px;
    cursor: pointer;
}

/* login */
.overlay--login {
    background: #0a246a;
    color: white;
}

.login-box {
    background: #d4d0c8;
    padding: 2rem 3rem;
    border: 2px solid #000;
    box-shadow: 4px 4px 0 #000;
    text-align: center;
}

.login-avatar {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.login-title {
    margin: 0 0 1rem;
    font-size: 1.5rem;
}

.login-form {
    text-align: left;
    margin-bottom: 1rem;
}

.login-label {
    display: block;
    font-family: "Lucida Console", monospace;
    font-size: 0.8rem;
    margin-bottom: 2px;
}

.login-input {
    width: 220px;
    border: 2px inset #d4d0c8;
    padding: 2px 4px;
    margin-bottom: 8px;
    font-family: monospace;
    font-size: 0.85rem;
    background: #ffffff;
}

.login-button {
    background: #0a246a;
    color: white;
    border: 2px solid #000;
    padding: 0.4rem 1.3rem;
    cursor: pointer;
}

/* ===== DESKTOP ===== */
.desktop {
    min-height: 100vh;
    background-image: url("/images/GameOS.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

/* desktop icons */
.desktop-icons {
    position: absolute;
    top: 24px;
    left: 10px;
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    z-index: 5;
}

.desktop-icon {
    width: 80px;
    text-align: center;
    cursor: default;
}

.icon-image {
    width: 48px;
    height: 48px;
    background: rgba(210, 224, 210, 0.9);
    border: 2px solid #ffffff;
    box-shadow: 2px 2px 0 #404040;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.2rem;
    font-size: 1.6rem;
}

.icon-label {
    color: #ffffff;
    text-shadow: 1px 1px #000;
    font-size: 0.75rem;
}

/* desktop weather widget */
.desktop-weather {
    position: absolute;
    top: 16px;
    right: 10px;
    min-width: 160px;
    background: rgba(212, 208, 200, 0.9);
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    padding: 4px 6px;
    box-shadow: 2px 2px 0 #404040;
    font-size: 0.8rem;
    z-index: 5;
}

.weather-main {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weather-icon {
    font-size: 1.2rem;
}

.weather-temp {
    font-weight: bold;
}

.weather-desc {
    margin-top: 2px;
}

/* OS chrome unselectable */
.desktop,
.desktop-icons,
.desktop-icon,
.icon-image,
.icon-label,
.taskbar,
.start-button,
.taskbar-right,
.taskbar-apps,
.start-menu,
.start-item,
.window-title-bar,
.win-btn,
.title-icon,
.window-title,
.task-icon,
.desktop-weather {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* allow window content selectable */
.window-content {
    user-select: text;
}

/* ===== TASKBAR & START MENU ===== */
.taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: #c3d6bf;
    border-top: 2px solid #ffffff;
    box-shadow: inset 0 1px 0 #ffffff, inset 0 -1px 0 #5e7758;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 20;
}

/* start button */
.start-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #b3c8ae;
    border: 2px solid #ffffff;
    border-right-color: #4e6647;
    border-bottom-color: #4e6647;
    padding: 4px 14px;
    height: 30px;
    cursor: pointer;
    overflow: visible;
}

.start-flag {
    display: inline-block;
    line-height: 1;
    font-size: 1.1rem;
    margin-bottom: 1px;
}

.start-text {
    font-weight: bold;
    font-size: 0.9rem;
}

/* taskbar apps */
.taskbar-apps {
    display: flex;
    gap: 4px;
}

.task-icon {
    width: 32px;
    height: 28px;
    border: 2px solid #ffffff;
    border-right-color: #4e6647;
    border-bottom-color: #4e6647;
    background: #d4e3cf;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* clock + user */
.taskbar-right {
    color: #000;
    font-size: 0.8rem;
    padding: 2px 6px;
    border: 1px solid #5e7758;
    background: #e3efe0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.task-clock {
    font-family: "MS Sans Serif", Tahoma, sans-serif;
}

.task-user {
    font-size: 0.8rem;
    font-weight: bold;
}

/* start menu */
.start-menu {
    position: fixed;
    bottom: 40px;
    left: 0;
    width: 260px;
    height: 260px;
    display: flex;
    border: 3px solid #000000;
    background: #d4d0c8;
    box-shadow: 4px 4px 0 #000000;
    z-index: 25;
}

.start-menu-left {
    width: 40px;
    background: linear-gradient(180deg, #567a57, #273c2a);
    color: #fff;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    text-align: center;
    font-weight: bold;
    font-size: 0.7rem;
    padding-bottom: 8px;
}

.start-menu-logo {
    transform: rotate(-90deg);
}

.start-menu-right {
    flex: 1;
    padding: 4px;
    display: flex;
    flex-direction: column;
}

.start-menu-right hr {
    border: 0;
    border-top: 1px solid #808080;
    margin: 4px 0;
}

.start-item {
    width: 100%;
    text-align: left;
    padding: 3px 6px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 0.85rem;
}

.start-item:hover {
    background: #316ac5;
    color: #ffffff;
}

.start-item-danger {
    color: #a02222;
}

/* ===== APP WINDOWS ===== */
.app-window {
    position: absolute;
    top: 70px;
    left: 10px;
    width: min(90%, 820px);
    min-width: 520px;
    min-height: 320px;
    background: #d4d0c8;
    border: 3px solid #000;
    box-shadow: 6px 6px 0 #000000;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: opacity 0.55s cubic-bezier(0.22, 0.61, 0.36, 1),
    transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 10;
}

.app-window.is-open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* weather app a bit bigger */
#app-weather {
    width: 500px !important;
    min-height: 320px !important;
}

/* title bar */
.window-title-bar {
    height: 26px;
    background: linear-gradient(180deg, #9eb89a, #6e8c6b);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 4px;
    cursor: move;
}

.title-left {
    display: flex;
    align-items: center;
    gap: 4px;
}

.title-icon {
    font-size: 0.9rem;
}

.window-title {
    font-size: 0.85rem;
    font-weight: bold;
}

.window-buttons {
    display: flex;
    gap: 2px;
}

.win-btn {
    width: 18px;
    height: 18px;
    border: 2px solid #ffffff;
    border-right-color: #404040;
    border-bottom-color: #404040;
    background: #d4d0c8;
    font-size: 0.7rem;
    padding: 0;
    cursor: pointer;
}

/* content */
.window-content {
    padding: 8px 10px 10px;
    background: #f4f4e8;
    border-top: 2px solid #ffffff;
}

/* scoreboard content */
.site-title {
    font-size: 1.6rem;
    margin: 0 0 2px;
    color: #2d422f;
}

.site-tagline {
    margin: 0 0 6px;
    font-size: 0.9rem;
    color: #4b634d;
}

.user-label {
    font-size: 0.85rem;
    margin: 0 0 10px;
    color: #2d422f;
}

.main-game-card {
    border: 3px groove #d4d0c8;
    padding: 6px 8px 8px;
    background: #f8fbf4;
    margin-bottom: 10px;
}

.main-game-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #607a60;
}

.main-game-name {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 2px 0 6px;
}

.btn-primary {
    display: inline-block;
    font-size: 0.8rem;
    padding: 3px 8px;
    border: 2px solid #ffffff;
    border-right-color: #204021;
    border-bottom-color: #204021;
    background: #7da57b;
    color: #ffffff;
    text-decoration: none;
}

/* divider */
.divider {
    margin: 10px 0 7px;
    text-align: center;
    font-size: 0.75rem;
    color: #4b634d;
}

/* categories */
.categories-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 8px;
}

.category-group {
    border: 3px groove #d4d0c8;
    padding: 6px 7px;
    background: #f8fbf4;
}

.category-heading {
    font-size: 0.9rem;
    margin: 0 0 4px;
    color: #2d422f;
}

.category-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.cat-pill {
    font-size: 0.8rem;
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background: #e4efe1;
    padding: 2px 6px;
    cursor: pointer;
}

/* headings */
.window-heading {
    font-size: 1.2rem;
    margin: 0 0 4px;
    color: #2d422f;
}

.window-subtext {
    font-size: 0.85rem;
    margin: 0 0 8px;
}

/* ===== MUSIC PLAYER ===== */
.music-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.music-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.music-label {
    font-size: 0.85rem;
}

.music-select {
    flex: 1;
    font-size: 0.85rem;
    border: 2px inset #d4d0c8;
    background: #ffffff;
    max-height: 140px;
}

.music-current {
    font-size: 0.85rem;
}

.music-times {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
}

#songProgress {
    width: 100%;
}

.music-controls {
    display: flex;
    gap: 6px;
    margin-top: 4px;
}

.music-volume {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    font-size: 0.8rem;
}

#musicVolume {
    width: 120px;
}

.music-hint {
    font-size: 0.75rem;
    margin-top: 4px;
}

/* about list */
.about-list {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 0.85rem;
}

/* ===== EXPLORER ===== */
.explorer-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.explorer-toolbar {
    display: flex;
    gap: 4px;
    margin-bottom: 2px;
}

.btn-toolbar {
    font-size: 0.78rem;
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background: #e4efe1;
    padding: 2px 6px;
    cursor: pointer;
}

.explorer-path {
    font-size: 0.75rem;
    padding: 2px 4px;
    border: 2px inset #d4d0c8;
    background: #f4f4e8;
}

.explorer-body {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 6px;
    margin-top: 4px;
}

.explorer-list {
    list-style: none;
    margin: 0;
    padding: 2px;
    border: 2px inset #d4d0c8;
    background: #ffffff;
    height: 200px;
    overflow-y: auto;
    font-size: 0.8rem;
}

/* explorer items not selectable */
.explorer-list,
.explorer-item,
.explorer-item-name {
    user-select: none !important;
}

.explorer-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    cursor: default;
}

.explorer-item:hover {
    background: #316ac5;
    color: #ffffff;
}

.explorer-item-icon {
    width: 18px;
}

.explorer-preview {
    border: 2px inset #d4d0c8;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.preview-title {
    font-size: 0.78rem;
    padding: 2px 4px;
    background: #d4d0c8;
    border-bottom: 1px solid #808080;
}

.preview-body {
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.file-editor {
    width: 100%;
    height: 150px;
    font-family: monospace;
    font-size: 0.8rem;
}

/* ===== CALCULATOR ===== */
.calc-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.calc-display {
    width: 100%;
    border: 2px inset #d4d0c8;
    padding: 3px 4px;
    font-family: monospace;
    font-size: 1rem;
    text-align: right;
    background: #ffffff;
}

.calc-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    margin-top: 4px;
}

.calc-btn {
    border: 2px solid #ffffff;
    border-right-color: #808080;
    border-bottom-color: #808080;
    background: #e4efe1;
    font-size: 0.9rem;
    padding: 4px 0;
    cursor: pointer;
}

.calc-op {
    background: #d4e3cf;
}

.wide-btn {
    grid-column: span 4;
}

/* ===== TASK MANAGER ===== */
.taskmgr-content {
    font-size: 0.85rem;
}

.task-list {
    list-style: none;
    margin: 4px 0 6px;
    padding: 4px;
    border: 2px inset #d4d0c8;
    background: #ffffff;
    max-height: 160px;
    overflow-y: auto;
}

.task-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
    gap: 4px;
}

.task-item-empty {
    font-style: italic;
    color: #555;
}

/* ===== WEATHER APP ===== */
.weather-content {
    font-size: 0.9rem;
    padding: 10px;
}

.weather-list {
    list-style: none;
    margin: 8px 0 0;
    padding-left: 0;
    border: 2px inset #d4d0c8;
    background: #ffffff;
    padding: 8px;
}

.weather-item-single {
    list-style: none;
    text-align: center;
}

.big-weather-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.big-weather-temp {
    font-size: 1.6rem;
    font-weight: bold;
    margin-bottom: 6px;
}

.big-weather-desc {
    font-size: 1rem;
    color: #2d422f;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 700px) {
    .desktop-icons {
        top: 8px;
        left: 50%;
        transform: translateX(-50%);
        flex-direction: row;
    }

    .app-window {
        width: 96%;
        min-width: 0;
    }

    .explorer-body {
        grid-template-columns: 1fr;
    }
}
