@import url('https://fonts.googleapis.com/css2?family=VT323&display=swap');

:root {
    --teal: #008080;
    --silver: #c0c0c0;
    --gray: #808080;
    --navy: #000080;
    --white: #ffffff;
    --black: #000000;
    --taskbar-height: 28px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'MS Sans Serif', Tahoma, Arial, sans-serif;
    font-size: 11px;
    background: var(--teal);
    user-select: none;
    cursor: default;
}

/* DESKTOP */
#desktop {
    position: fixed;
    inset: 0 0 var(--taskbar-height) 0;
    background: var(--teal);
    background-image: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 3px,
        rgba(0, 0, 0, .04) 3px,
        rgba(0, 0, 0, .04) 4px
    );
}

/* DESKTOP ICONS */
.di {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 74px;
    padding: 4px 2px;
    border: 1px solid transparent;
    cursor: pointer;
}

.di:hover {
    border: 1px dotted rgba(255, 255, 255, .7);
    background: rgba(0, 0, 128, .35);
}

.di .ic {
    font-size: 28px;
    line-height: 1;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.di span {
    color: #fff;
    font-size: 11px;
    text-align: center;
    text-shadow: 1px 1px 2px #000, 0 0 4px #000;
    word-break: break-word;
    line-height: 1.2;
    max-width: 70px;
}

#icon-grid {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: 6px;
    padding: 10px;
    height: 100%;
}

/* WIN98 WINDOW */
.ww {
    position: absolute;
    display: flex;
    flex-direction: column;
    background: var(--silver);
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    box-shadow: 1px 1px 0 var(--gray), 2px 2px 0 #000;
    min-width: 300px;
    min-height: 200px;
}

.ww.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.ww.minimized {
    display: none;
}

/* WINDOW TITLEBAR */
.wtb {
    height: 22px;
    background: linear-gradient(90deg, #000080, #1084d0);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2px 0 4px;
    cursor: move;
    flex-shrink: 0;
}

.wtb-l {
    display: flex;
    align-items: center;
    gap: 4px;
    font-weight: bold;
    font-size: 11px;
    overflow: hidden;
    white-space: nowrap;
}

.wtb-btns {
    display: flex;
    gap: 2px;
}

.wtb-btns button {
    width: 16px;
    height: 14px;
    font-size: 9px;
    padding: 0;
    line-height: 1;
    background: var(--silver);
    color: var(--black);
    border: 1px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wtb-btns button:active {
    border-color: var(--gray) var(--white) var(--white) var(--gray);
    padding: 1px 0 0 1px;
}

/* MENUBAR */
.wmb {
    height: 20px;
    background: var(--silver);
    display: flex;
    align-items: center;
    padding: 0 2px;
    border-bottom: 1px solid var(--gray);
    flex-shrink: 0;
    position: relative;
    z-index: 10;
}

.mi {
    padding: 2px 6px;
    cursor: pointer;
    font-size: 11px;
}

.mi:hover {
    background: var(--navy);
    color: #fff;
}

.dd {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--silver);
    min-width: 150px;
    z-index: 500;
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
}

.ddi {
    padding: 4px 20px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.ddi:hover {
    background: var(--navy);
    color: #fff;
}

.ddd {
    height: 1px;
    background: var(--gray);
    margin: 2px 4px;
}

/* SCREENSAVER CONTENT */
.ssc {
    flex: 1;
    background: #000;
    overflow: hidden;
    border: 2px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
}

.ssc iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* STATUSBAR */
.wsb {
    height: 20px;
    background: var(--silver);
    border-top: 1px solid var(--gray);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 4px;
    flex-shrink: 0;
}

.sp {
    font-size: 10px;
    padding: 1px 6px;
    border: 1px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
}

/* DIALOGS */
.dlg {
    position: absolute;
    background: var(--silver);
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    box-shadow: 2px 2px 6px rgba(0, 0, 0, .5);
    z-index: 400;
}

.dtabs {
    display: flex;
    padding: 6px 8px 0;
    gap: 2px;
}

.dtab {
    padding: 3px 14px;
    font-size: 11px;
    cursor: pointer;
    border: 2px solid;
    border-color: var(--white) var(--gray) transparent var(--white);
    background: var(--silver);
    position: relative;
    top: 1px;
    z-index: 1;
}

.dtab.active {
    font-weight: bold;
    border-bottom-color: var(--silver);
}

.dbody {
    padding: 12px;
    border-top: 1px solid var(--gray);
}

.drow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.drow label {
    font-size: 11px;
    min-width: 80px;
}

.dfoot {
    padding: 8px 12px;
    border-top: 1px solid var(--gray);
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.btn {
    min-width: 72px;
    padding: 3px 12px;
    font-family: inherit;
    font-size: 11px;
    background: var(--silver);
    cursor: pointer;
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
}

.btn:active {
    border-color: var(--gray) var(--white) var(--white) var(--gray);
    padding: 4px 11px 2px 13px;
}

.btn:disabled {
    color: var(--gray);
    cursor: default;
}

.inp, .sel {
    height: 21px;
    background: #fff;
    font-family: inherit;
    font-size: 11px;
    padding: 1px 4px;
    border: 2px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
}

.sel {
    cursor: pointer;
}

/* MONITOR PREVIEW */
.mon-wrap {
    display: flex;
    justify-content: center;
    padding: 8px 0 14px;
}

.mon-out {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--gray);
    padding: 6px 6px 4px;
    border-radius: 6px;
    border: 2px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
}

.mon-scr {
    background: #000;
    border: 2px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
    overflow: hidden;
    line-height: 0;
}

#preview-canvas {
    display: block;
    width: 200px;
    height: 130px;
}

.mon-base {
    width: 60px;
    height: 10px;
    background: var(--gray);
    margin-top: 4px;
    border-radius: 0 0 4px 4px;
}

/* RESIZE HANDLE */
.rh {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    background: linear-gradient(135deg, transparent 40%, var(--gray) 40%, var(--gray) 60%, transparent 60%),
                linear-gradient(135deg, transparent 60%, var(--white) 60%);
}

/* TASKBAR */
#taskbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--taskbar-height);
    background: var(--silver);
    border-top: 2px solid var(--white);
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    z-index: 1000;
}

#start-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    height: 22px;
    font-family: inherit;
    font-size: 12px;
    font-weight: bold;
    background: var(--silver);
    cursor: pointer;
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
}

#start-btn:active,
#start-btn.active {
    border-color: var(--gray) var(--white) var(--white) var(--gray);
}

.tbsep {
    width: 2px;
    height: 22px;
    flex-shrink: 0;
    border-left: 1px solid var(--gray);
    border-right: 1px solid var(--white);
    margin: 0 2px;
}

#tbits {
    flex: 1;
    display: flex;
    gap: 2px;
    overflow: hidden;
    flex-wrap: nowrap;
}

.tbit {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    height: 22px;
    font-family: inherit;
    font-size: 11px;
    background: var(--silver);
    cursor: pointer;
    border: 2px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tbit:hover {
    background: #d0d0d0;
}

.tbit.active {
    border-color: var(--gray) var(--white) var(--white) var(--gray);
    background: #b8b8b8;
}

.tbtray {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 2px 6px;
    height: 22px;
    border: 2px solid;
    border-color: var(--gray) var(--white) var(--white) var(--gray);
    font-size: 11px;
}

#clock {
    min-width: 55px;
    text-align: right;
}

/* START MENU */
#startmenu {
    position: fixed;
    bottom: var(--taskbar-height);
    left: 0;
    width: 290px;
    background: var(--silver);
    border: 2px solid;
    border-color: var(--white) var(--gray) var(--gray) var(--white);
    box-shadow: 3px 0 8px rgba(0, 0, 0, .4);
    z-index: 2000;
    display: flex;
}

.sm-bar {
    width: 22px;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    background: linear-gradient(to top, var(--navy), var(--gray));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 8px;
}

.sm-bar span {
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    letter-spacing: 2px;
    font-family: 'VT323', monospace;
}

.sm-items {
    flex: 1;
    padding: 4px 0;
}

.smi {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    cursor: pointer;
}

.smi:hover {
    background: var(--navy);
    color: #fff;
}

.smi:hover small {
    color: #ccc;
}

.smi-ic {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.smi div {
    font-size: 11px;
    line-height: 1.4;
}

.smi small {
    font-size: 10px;
    color: #555;
}

.sm-div {
    height: 1px;
    background: var(--gray);
    margin: 4px 0;
}

/* UTILITY */
.hidden {
    display: none !important;
}

.tabpanel {
    display: none;
}

.tabpanel.active {
    display: block;
}

/* CHECKBOX/RADIO */
.chk-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    font-size: 11px;
}

.chk-row input {
    cursor: pointer;
}

/* GROUP BOX */
.grpbox {
    border: 1px solid var(--gray);
    border-top: none;
    padding: 8px;
    margin-top: 14px;
    position: relative;
}

.grpbox-title {
    position: absolute;
    top: -8px;
    left: 8px;
    background: var(--silver);
    padding: 0 4px;
    font-size: 11px;
    font-weight: bold;
}
