@font-face {
    font-family: 'IBM VGA 8x16';
    src: url("woff - Web (webfonts)/Web437_IBM_VGA_8x16.woff") format('woff');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

:root {
    --green:     #7ec850;
    --green-dim: #4a7a2a;
    --green-hi:  #b4ff6e;
    --amber:     #c8a040;
    --amber-hi:  #ffd060;
    --bg:        #0c0e09;
    --bg2:       #131810;
    --bg3:       #1a2214;
    --border:    #2a3820;
    --border-hi: #3e5530;
    --text:      #c8d8b0;
    --text-dim:  #607050;
    --text-hi:   #e8f0d0;
    --red:       #c84040;
    --red-hi:    #ff5555;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'IBM VGA 8x16', 'IBM Plex Mono', 'Courier New', monospace;
    min-height: 100vh;
    overflow: hidden;
    user-select: none;
}

/* ─── BOOT & SHUTDOWN ─── */
#boot {
    position: fixed; inset: 0;
    background: #000;
    padding: 36px 44px;
    font-size: 15px;
    line-height: 1.55;
    overflow-y: auto;
    z-index: 10;
    transition: opacity 0.7s ease;
    user-select: text;
}
#boot.out { opacity: 0; pointer-events: none; }

.line     { min-height: 1.55em; white-space: pre-wrap; letter-spacing: 0.02em; }
.spacer   { min-height: 0.7em; }
.ok       { color: #7ec850; font-weight: bold; }
.fail     { color: var(--red); font-weight: bold; }
.bracket  { color: #3a6020; }
.muted    { color: #444; }
.white    { color: #ddd; }
.git-out  { color: #888; }
.prompt-c { color: #7ec850; }

.blink-cur {
    display: inline-block; width: 9px; height: 1em;
    background: #ddd;
    animation: bc 1s step-end infinite;
    vertical-align: -1px; margin-left: 1px;
}
@keyframes bc { 0%,49%{background:#ddd} 50%,100%{background:transparent} }

/* ─── RETRO SKIP BUTTON ─── */
#skip-trigger-btn {
    position: fixed;
    bottom: 30px;
    right: 40px;
    z-index: 15;
    background: var(--bg2);
    border: 1px solid var(--border);
    color: var(--green);
    padding: 10px 18px;
    font-family: 'IBM VGA 8x16', monospace;
    font-size: 12px;
    cursor: pointer;
    letter-spacing: 0.05em;
    box-shadow: 2px 2px 0 #000;
    transition: opacity 0.4s ease;
}
#skip-trigger-btn:hover {
    border-color: var(--green);
    color: var(--green-hi);
    background: var(--bg3);
}
#skip-trigger-btn:active {
    box-shadow: 0px 0px 0 #000;
    transform: translate(2px, 2px);
}
#skip-trigger-btn.hidden { opacity: 0; pointer-events: none; }

/* ─── GREEN SCANLINE RETRO FLASH ─── */
#flash {
    position: fixed; inset: 0; 
    background: #223a15;
    opacity: 0; pointer-events: none; z-index: 20;
    transition: opacity 0.07s;
}
#flash::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 2px,
        rgba(0,0,0,0.3) 2px, rgba(0,0,0,0.3) 4px
    );
}
#flash.on { opacity: 1; }

/* ─── DESKTOP ─── */
#desktop {
    position: fixed; inset: 0;
    opacity: 0; pointer-events: none;
    transition: opacity 0.6s ease;
    display: flex; flex-direction: column;
}
#desktop.show { opacity: 1; pointer-events: all; }

/* Wallpaper — dithered dot grid */
#wp {
    position: absolute; inset: 0; z-index: 0;
    background-color: #0c110a;
    background-image: radial-gradient(circle, #1a2414 1px, transparent 1px);
    background-size: 18px 18px;
}
/* Scanlines overlay */
#wp::after {
    content: '';
    position: absolute; inset: 0;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0px, transparent 3px,
        rgba(0,0,0,0.18) 3px, rgba(0,0,0,0.18) 4px
    );
    pointer-events: none;
}

/* ─── DESKTOP ICONS ─── */
#icons {
    position: absolute; top: 20px; right: 20px;
    display: flex; flex-direction: column; gap: 8px;
    z-index: 2;
}
.dicon {
    width: 76px;
    display: flex; flex-direction: column; align-items: center;
    gap: 5px; cursor: pointer; padding: 6px 4px;
    border: 1px solid transparent;
}
.dicon:hover { border-color: var(--border-hi); background: rgba(126,200,80,0.05); }
.dicon:active { background: rgba(126,200,80,0.12); }
.dicon-box {
    width: 44px; height: 44px;
    border: 1px solid var(--border);
    background: var(--bg2);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: var(--green);
}
.dicon:hover .dicon-box { border-color: var(--green-dim); color: var(--green-hi); }
.dicon-lbl {
    font-size: 11px; color: var(--text-dim);
    text-align: center; line-height: 1.3;
}
.dicon:hover .dicon-lbl { color: var(--text); }

/* ─── TASKBAR ─── */
#taskbar {
    position: absolute; bottom: 0; left: 0; right: 0;
    height: 26px;
    background: var(--bg2);
    border-top: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 6px; gap: 1px;
    z-index: 200;
}
.tb-start {
    font-size: 11px; color: var(--green-hi);
    padding: 0 10px; height: 20px;
    border: 1px solid var(--green-dim);
    background: var(--bg3);
    display: flex; align-items: center;
    cursor: pointer; letter-spacing: 0.08em;
}
.tb-start:hover { background: var(--border); }

.tb-power {
    font-size: 11px; color: var(--red);
    padding: 0 8px; height: 20px;
    border: 1px solid #5a1a1a;
    background: #1a0a0a;
    display: flex; align-items: center;
    cursor: pointer; margin-right: 6px;
    letter-spacing: 0.08em;
    font-weight: bold;
}
.tb-power:hover { background: #3a1212; color: var(--red-hi); border-color: var(--red); }

.tb-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.tb-btn {
    font-size: 11px; color: var(--text-dim);
    padding: 0 8px; height: 20px;
    border: 1px solid transparent;
    background: transparent;
    display: flex; align-items: center;
    cursor: pointer; gap: 5px;
}
.tb-btn:hover { color: var(--text); border-color: var(--border); background: var(--bg3); }
.tb-btn.open  { color: var(--green); border-color: var(--green-dim); background: var(--bg3); }
.tb-btn.focus { color: var(--green-hi); border-color: var(--green); background: rgba(126,200,80,0.08); }
.tb-flex { flex: 1; }
.tb-tray {
    font-size: 11px; color: var(--text-dim);
    padding: 0 8px; display: flex; align-items: center; gap: 14px;
    border-left: 1px solid var(--border);
}
#tb-clock { color: var(--text); min-width: 40px; text-align: right; }

/* ─── WINDOWS ─── */
.win {
    position: absolute;
    min-width: 280px; min-height: 160px;
    background: var(--bg2);
    border: 1px solid var(--border);
    display: flex; flex-direction: column;
    z-index: 50;
    box-shadow:
        inset 1px 1px 0 rgba(126,200,80,0.12),
        inset -1px -1px 0 rgba(0,0,0,0.5),
        2px 2px 0 #000;
}
.win.focused {
    border-color: var(--green-dim);
    z-index: 60;
    box-shadow:
        inset 1px 1px 0 rgba(126,200,80,0.2),
        inset -1px -1px 0 rgba(0,0,0,0.6),
        2px 2px 0 #000;
}

.win-tb {
    height: 22px; flex-shrink: 0;
    background: var(--bg3);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center;
    padding: 0 4px; gap: 4px;
    cursor: move;
}
.win.focused .win-tb {
    border-bottom-color: var(--green-dim);
    background-image: repeating-linear-gradient(
        90deg,
        transparent 0px, transparent 3px,
        rgba(126,200,80,0.07) 3px, rgba(126,200,80,0.07) 4px
    );
}
.win-title {
    flex: 1; font-size: 11px; color: var(--text-dim);
    letter-spacing: 0.06em; padding-left: 2px;
    overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
    pointer-events: none;
}
.win.focused .win-title { color: var(--green-hi); }

.wbtn {
    width: 16px; height: 14px;
    border: 1px solid var(--border-hi);
    background: var(--bg3);
    font-size: 9px; color: var(--text-dim);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; flex-shrink: 0;
}
.wbtn:hover { background: var(--border); color: var(--text-hi); border-color: var(--green-dim); }
.wbtn.x:hover { background: #3a0a0a; color: var(--red); border-color: var(--red); }

.win-body {
    flex: 1; overflow-y: auto;
    padding: 14px 16px;
    font-size: 12px; line-height: 1.75; color: var(--text);
    user-select: text;
}
.win-body::-webkit-scrollbar { width: 8px; }
.win-body::-webkit-scrollbar-track { background: var(--bg); }
.win-body::-webkit-scrollbar-thumb { background: var(--border-hi); }
.win-body::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

.win-grip {
    position: absolute; bottom: 0; right: 0;
    width: 12px; height: 12px; cursor: se-resize;
    border-top: 1px solid var(--border);
    border-left: 1px solid var(--border);
    z-index: 10;
}

/* ─── CONTENT STYLES ─── */
.wh { color: var(--green-hi); font-size: 12px; margin-bottom: 10px; letter-spacing: 0.05em; }
.wl { color: var(--text-dim); font-size: 11px; margin-bottom: 1px; margin-top: 8px; }
.wv { color: var(--text-hi); }
.wtag {
    display: inline-block; font-size: 11px;
    border: 1px solid var(--border-hi); color: var(--green-dim);
    padding: 0 6px; margin: 2px 3px 0 0;
}
.wdiv { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.wa { color: var(--green); text-decoration: none; border-bottom: 1px solid var(--green-dim); }
.wa:hover { color: var(--green-hi); border-bottom-color: var(--green-hi); }
.wdim { color: var(--text-dim); font-size: 11px; }

.proj { margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.proj:last-child { border-bottom: none; margin-bottom: 0; }
.proj-name { color: var(--amber-hi); font-size: 12px; }
.proj-desc { color: var(--text-dim); font-size: 11px; margin-top: 2px; }
.proj-tags { margin-top: 4px; }

.twin-out { margin-bottom: 4px; max-height: calc(100% - 24px); overflow-y: auto; }
.tl { font-size: 12px; line-height: 1.6; white-space: pre-wrap; color: #999; }
.tp { color: var(--green); }
.twin-row { display: flex; align-items: center; }
.twin-in {
    background: transparent; border: none; outline: none;
    color: var(--text-hi); font-family: inherit; font-size: 12px;
    flex: 1; caret-color: var(--green);
}

.wstatusbar {
    flex-shrink: 0; height: 18px;
    background: var(--bg); border-top: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 8px;
    font-size: 10px; color: var(--text-dim); gap: 12px;
    pointer-events: none;
}
.wsb-seg { border-right: 1px solid var(--border); padding-right: 12px; }
