*{box-sizing:border-box}

html,body,#boot-screen{
width:100%;
height:100%;
margin:0
}

body{
overflow:hidden;
background:white;
color:black;
font-family:"Courier New",monospace;
font-size:14px;
image-rendering:pixelated
}

/*boot*/
#boot-screen{
position:fixed;
inset:0;
z-index:9999;
display:flex;
flex-direction:column;
align-items:center;
justify-content:center;
background:white;
color:black
}

.boot-logo{
margin-bottom:18px;
font-size:48px;
font-weight:bold;
letter-spacing:4px
}

.boot-text{margin-bottom:15px}

.loading-bar{
width:260px;
height:18px;
padding:3px;
border:2px solid black
}

.loading-bar span{
display:block;
width:30%;
height:100%;
background:black;
animation:loading 1.2s steps(6) infinite
}

@keyframes loading{
0%{width:0}
100%{width:100%}
}

/*desktop*/
#desktop{
position:fixed;
inset:0;
overflow:hidden;
background:white;
color:black
}

.desktop-icons{
position:absolute;
top:20px;
left:20px;
display:flex;
flex-direction:column;
gap:18px
}

.desktop-icon{
width:90px;
padding:5px;
color:black;
text-align:center;
cursor:pointer;
user-select:none
}

.desktop-icon:hover{
background:#eee;
outline:1px dotted #555
}

.desktop-icon .icon{
width:50px;
height:50px;
margin:auto;
display:flex;
align-items:center;
justify-content:center
}

.desktop-icon .icon img{
width:42px;
height:42px;
object-fit:contain
}

.desktop-icon span{
display:block;
font-size:12px;
word-break:break-word
}

/*window*/
.window{
position:absolute;
top:80px;
left:80px;
width:650px;
height:430px;
display:none;
background:white;
color:black;
border:2px solid black;
box-shadow:5px 5px 0 #aaa
}

.window.small-window{
width:350px;
height:460px
}

.window-title{
height:34px;
display:flex;
align-items:center;
justify-content:space-between;
padding-left:10px;
background:#eee;
color:black;
font-weight:bold;
cursor:move;
user-select:none
}

.window-buttons{
height:100%;
display:flex
}

.window-buttons button{
width:34px;
height:100%;
border:0;
border-left:1px solid #999;
background:#ddd;
color:black;
font-family:inherit;
font-weight:bold;
cursor:pointer
}

.window-buttons button:hover{background:#ccc}

.window-buttons button:last-child:hover{
background:#ff6868;
color:white
}

.window-body{
height:calc(100% - 34px)
}

/*files*/
.file-manager{display:flex}

.file-main{
flex:1;
min-width:0;
display:flex;
flex-direction:column
}

.file-sidebar{
width:170px;
padding:12px;
border-right:1px solid #ccc;
background:#f5f5f5
}

.file-sidebar div{
padding:9px 5px;
cursor:pointer
}

.file-sidebar div:hover{background:#e5e5e5}

.file-toolbar{
display:flex;
align-items:center;
justify-content:space-between;
gap:8px;
padding:6px 10px;
background:#f5f5f5;
border-bottom:1px solid #ccc;
font-size:11px
}

.file-toolbar-buttons{
display:flex;
gap:4px
}

.file-toolbar-buttons button{
padding:5px 8px;
border:1px solid #999;
background:white;
color:black;
font-family:inherit;
cursor:pointer
}

.file-toolbar-buttons button:hover{background:#eee}

.file-area{
flex:1;
padding:20px;
display:flex;
align-content:flex-start;
flex-wrap:wrap;
gap:22px
}

.file-item{
width:90px;
padding:7px;
text-align:center;
cursor:pointer
}

.file-item:hover{background:#eee}

.file-item.selected{
background:#ddd;
outline:1px solid #999
}

.file-icon{
background:white;
color:black;
border:1px solid #999
}

/*terminal*/
.terminal-line{
display:flex;
gap:7px
}

.terminal-line span{white-space:nowrap}

#terminal-input{
flex:1;
min-width:0;
border:0;
outline:none;
background:transparent;
color:black;
font-family:inherit;
font-size:inherit
}

/*browser*/
.browser-body{
height:calc(100% - 34px);
display:flex;
flex-direction:column
}

.address-bar{
display:flex;
gap:4px;
padding:6px;
background:#f5f5f5;
border-bottom:1px solid #ccc
}

.address-bar button{
padding:5px 9px;
border:1px solid #999;
background:white;
color:black;
font-family:inherit;
cursor:pointer
}

.address-bar button:hover{background:#eee}

#address{
flex:1;
min-width:0;
padding:5px 7px;
border:1px solid #999;
outline:none;
background:white;
color:black;
font-family:inherit
}

.browser-page{
flex:1;
padding:30px;
background:#eee;
color:#111;
font-family:Arial,sans-serif;
text-align:center
}

/*notes*/
.editor-toolbar{
display:flex;
align-items:center;
justify-content:space-between;
gap:8px;
padding:6px 10px;
background:#f5f5f5;
border-bottom:1px solid #ccc
}

#editor-filename{
flex:1;
min-width:0;
padding:5px 7px;
border:1px solid #999;
outline:none;
background:white;
color:black;
font-family:inherit
}

.editor-toolbar-buttons{
display:flex;
gap:4px
}

.editor-toolbar-buttons button{
padding:5px 8px;
border:1px solid #999;
background:white;
color:black;
font-family:inherit;
cursor:pointer
}

.editor-toolbar-buttons button:hover{background:#eee}

#notes-area{
width:100%;
height:calc(100% - 34px - 36px - 20px);
resize:none;
padding:15px;
border:0;
outline:none;
background:white;
color:black;
font-family:"Courier New",monospace;
font-size:14px
}

#editor-status{
height:20px;
padding:2px 10px;
background:#f5f5f5;
color:#555;
font-size:11px
}

/*calculator*/
.calculator{padding:15px}

#calculator-display{
width:100%;
height:50px;
margin-bottom:10px;
padding:7px;
border:2px solid #999;
outline:none;
background:white;
color:black;
font-family:inherit;
font-size:20px;
text-align:right
}

.calculator-buttons{
display:grid;
grid-template-columns:repeat(4,1fr);
gap:5px
}

.calculator-buttons button{
height:50px;
border:1px solid #999;
background:#f5f5f5;
color:black;
font-family:inherit;
font-size:16px;
cursor:pointer
}

.calculator-buttons button:hover{background:#ddd}

.calculator-buttons button:active{
transform:translate(1px,1px)
}

.calculator-buttons .zero{
grid-column:span 4
}

/*settings*/
.settings-body{padding:20px}

.settings-body h2{
margin-top:0;
color:black;
font-size:18px
}

.setting-row{
min-height:42px;
display:flex;
align-items:center;
justify-content:space-between;
padding:8px;
border-bottom:1px solid #ccc
}

.setting-row button{
padding:5px 8px;
border:1px solid #999;
background:white;
color:black;
font-family:inherit;
cursor:pointer
}

/*start*/
#start-menu{
position:absolute;
left:5px;
bottom:52px;
width:300px;
display:none;
padding:10px;
border:2px solid black;
background:white;
box-shadow:5px 5px 0 #aaa;
z-index:5000
}

.start-title{
padding:8px;
background:#eee;
color:black;
font-size:18px;
font-weight:bold
}

.start-user{
padding:10px;
border-bottom:1px solid #ccc;
color:#555;
font-size:11px
}

.start-apps{
display:flex;
flex-direction:column;
gap:3px;
padding:8px 0
}

.start-apps button{
padding:10px;
border:0;
background:transparent;
color:black;
font-family:inherit;
text-align:left;
cursor:pointer
}

.start-apps button:hover{background:#eee}

.start-footer{
padding-top:8px;
border-top:1px solid #ccc;
color:#555;
font-size:10px;
text-align:right
}

/*taskbar*/
#taskbar{
position:absolute;
left:0;
right:0;
bottom:0;
height:calc(52px + env(safe-area-inset-bottom,0px));
display:flex;
align-items:center;
padding:4px;
border-top:2px solid black;
background:#eee;
z-index:6000
}

#start-button{
width:44px;
height:42px;
border:2px solid black;
background:white;
color:black;
font-family:inherit;
font-size:18px;
font-weight:bold;
cursor:pointer
}

#start-button:hover{background:#ddd}

#taskbar-apps{
display:flex;
gap:4px;
margin-left:5px
}

.taskbar-app{
width:42px;
height:42px;
padding:6px;
display:flex;
align-items:center;
justify-content:center;
border:1px solid #111;
background:white;
cursor:pointer
}

.taskbar-app img{
width:28px;
height:28px;
object-fit:contain;
display:block
}

.taskbar-app:hover{background:#ddd}

.system-info{
margin-left:auto;
height:40px;
display:flex;
align-items:center;
gap:15px;
padding:0 10px;
border-left:1px solid #ccc;
color:black;
font-size:12px
}

/*other*/
.window.maximized{
top:0!important;
left:0!important;
width:100%!important;
height:calc(100% - 52px)!important;
box-shadow:none
}

::-webkit-scrollbar{width:12px}

::-webkit-scrollbar-track{background:#eee}

::-webkit-scrollbar-thumb{
background:#aaa;
border:2px solid #eee
}

::-webkit-scrollbar-thumb:hover{background:#888}

/* each window opens at a different spot so they dont overlap */
#files-window      { top: 60px;  left: 60px;  }
#notes-window      { top: 80px;  left: 100px; }
#terminal-window   { top: 100px; left: 140px; }
#browser-window    { top: 70px;  left: 120px; }
#calculator-window { top: 90px;  left: 160px; }
#settings-window   { top: 110px; left: 180px; }
#paint-window      { top: 50px;  left: 80px; width: 950px; height: 680px; }


.paint-app {
    height: calc(100% - 34px);
    display: flex;
    flex-direction: column;
    background: #ddd;
}

.paint-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px;
    background: #eee;
    border-bottom: 2px solid #999;
    flex-wrap: wrap;
}

.paint-toolbar button {
    height: 32px;
    padding: 4px 10px;
    border: 1px solid #888;
    background: white;
    color: black;
    font-family: inherit;
    cursor: pointer;
}

.paint-toolbar button:hover {
    background: #ddd;
}

.paint-toolbar button.active {
    background: black;
    color: white;
}

.paint-toolbar label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
}

#paint-color {
    width: 38px;
    height: 30px;
    padding: 1px;
    border: 1px solid #888;
    cursor: pointer;
}

#paint-size {
    width: 90px;
}

.paint-canvas-container {
    flex: 1;
    overflow: auto;
    padding: 15px;
    background: #aaa;
}

#paint-canvas {
    display: block;
    background: white;
    border: 2px solid black;
    cursor: crosshair;
}

.paint-status {
    height: 24px;
    padding: 4px 8px;
    background: #eee;
    border-top: 1px solid #999;
    font-size: 11px;
}
/*mobile*/
@media(max-width:700px){
.window{
left:5px;
width:calc(100% - 10px);
height:calc(100% - 70px)
}

.desktop-icons{left:10px}
}