:root {
  /* Colors stolen from a highly compressed JPEG of Windows XP found on a dead hard drive */
  /* Sounds cool, right? Guess what - I lied! I stole it from the Internet*/
    --xp-blue: #245edb;
    --taskbar-bg: linear-gradient(to bottom, #245edb 0%, #3f8cf3 9%, #245edb 18%, #245edb 92%, #1941a5 100%);
    --win-gray: #ece9d8;
    --win-border: #0055ea;
    --task-item-bg: #3c81f3;
    --task-item-active-bg: #1e52b7;
}

body, html {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; font-family: "Tahoma", "Segoe UI", sans-serif;
    background-color: #3b6ea5; user-select: none;
}

#desktop {
    width: 100vw; 
    height: calc(100vh - 30px);
    /* Bliss.webp: Stare at the green grass all you want, but we both know this is the closest you've been to nature in months. */
    background: url('bliss.webp') no-repeat center center; 
    background-size: cover;
    position: relative; padding: 10px;
    display: flex; flex-direction: column; flex-wrap: wrap; 
    align-content: flex-start; gap: 20px;
}

.desktop-icon {
    width: 70px; display: flex; flex-direction: column; align-items: center;
    cursor: pointer; text-align: center; color: white; 
    text-shadow: 1px 1px 2px black;
}
.desktop-icon img { width: 32px; height: 32px; margin-bottom: 5px; filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.5)); }
.desktop-icon span { font-size: 11px; line-height: 1.2; padding: 2px; }
.desktop-icon:hover img { filter: brightness(1.2); }
.desktop-icon:active span { background-color: #0b61ff; outline: 1px dotted #0b61ff; }

.window {
    position: absolute; width: 1000px; height: 700px; 
    background: var(--win-gray); border: 3px solid var(--win-border);
    border-top-left-radius: 8px; border-top-right-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.4);
    display: flex; flex-direction: column;
    min-width: 240px; min-height: 200px; 
}
/* For when the user wants to see my shitty code in full screen */
.window.maximized { border: none; border-radius: 0; }

.title-bar {
    /* That iconic blue gradient that screams 'I am currently freezing' */
    background: linear-gradient(to bottom, #0058ee 0%, #3b88fd 8%, #0058ee 100%);
    padding: 5px 8px; height: 20px;
    display: flex; justify-content: space-between; align-items: center;
    color: white; font-weight: bold; font-size: 13px;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5); cursor: default;
    flex-shrink: 0;
}
/* Greyed out because the window isn't the main character right now */
.title-bar.inactive { background: linear-gradient(to bottom, #7697e7 0%, #7c9ee7 8%, #7697e7 100%); }
.title-bar-text { display: flex; align-items: center; }
.window-controls { display: flex; gap: 3px; }
.win-btn {
    width: 21px; height: 21px; border: 1px solid white; border-radius: 3px;
    color: white; background: transparent; font-family: sans-serif; font-weight: bold; font-size: 10px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 0 2px rgba(0,0,0,0.2);
}
.btn-min, .btn-max { background: linear-gradient(#4a8bf5, #2659ba); }
/* The 'Rage Quit' button. Always red, always tempting. */
.btn-close { background: linear-gradient(#e06c6c, #a82e2e); font-size: 12px; }
.win-btn:active { filter: brightness(0.8); }

.window-content {
    flex-grow: 1; background: white; border: none; 
    margin: 2px; position: relative; overflow: hidden;
}

/* Iframes: Because security is a myth and I wanted to embed a whole other mess here */
.window-iframe { width: 100%; height: 100%; border: none; display: block; pointer-events: auto; }

.resizer-r { position: absolute; right: 0; top: 0; width: 5px; height: 100%; cursor: e-resize; z-index: 10; }
.resizer-b { position: absolute; bottom: 0; left: 0; width: 100%; height: 5px; cursor: s-resize; z-index: 10; }
.resizer-br { 
    position: absolute; bottom: 0; right: 0; width: 15px; height: 15px; 
    cursor: se-resize; z-index: 20;
    background: linear-gradient(135deg, transparent 50%, #7f9db9 50%);
}

#taskbar {
    position: absolute; bottom: 0; width: 100%; height: 30px;
    background: var(--taskbar-bg);
    display: flex; justify-content: space-between; align-items: center;
    /* Z-index 99999 because I want it to stay on top of your failures */
    z-index: 99999; border-top: 1px solid rgba(255,255,255,0.2);
}

#start-button {
    height: 100%;
    /* The green button of hope and regret */
    background: linear-gradient(to bottom, #388e3c 0%, #58bf58 10%, #388e3c 100%);
    border: none; border-top-right-radius: 14px; border-bottom-right-radius: 14px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
    color: white; font-family: "Trebuchet MS", sans-serif; font-weight: bold; font-style: italic; font-size: 16px;
    padding: 0 15px 0 5px; display: flex; align-items: center; gap: 4px;
    cursor: pointer; text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
}
#start-button:hover { filter: brightness(1.1); }
#start-button img { width: 22px; height: 22px; }

.separator {
    width: 2px; height: 24px; background: rgba(0,0,0,0.2); border-right: 1px solid rgba(255,255,255,0.2); margin: 0 10px;
}
.quick-launch { display: flex; gap: 8px; margin-right: 15px; }
.quick-icon { width: 16px; height: 16px; cursor: pointer; }
.quick-icon:hover { filter: brightness(1.2); }

#task-list { display: flex; gap: 2px; }

.task-item {
    width: 150px; 
    height: 24px;
    margin-top: 2px;
    background: var(--task-item-bg); 
    color: white; 
    border-radius: 2px;
    border: 1px solid #103275; 
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.3), 1px 1px 2px rgba(0,0,0,0.2);
    display: flex; 
    align-items: center; 
    padding: 0 5px; 
    gap: 5px;
    font-size: 11px; 
    cursor: pointer;
}

.task-item:hover { background: #5394ff; }

.task-item.active { 
    background: var(--task-item-active-bg); 
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.4); 
    border-color: #0b2658;
}

.task-item img { 
    width: 16px; 
    height: 16px; 
    flex-shrink: 0; 
}

.start-menu {
    position: absolute;
    bottom: 30px;
    left: 0;
    width: 380px; 
    background: #1c5fd1; 
    border: 1px solid #00309c;
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
    display: none;
    flex-direction: column;
    z-index: 10000;
    box-shadow: 2px 2px 20px rgba(0,0,0,0.5);
    height: 480px;
}

.start-header {
    background: linear-gradient(to bottom, #114fb1 0%, #3e88f1 100%);
    padding: 7px;
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 1px #000;
}
.user-avatar { width: 34px; height: 34px; border: 2px solid #fff; border-radius: 3px; margin-right: 10px; }

.start-body {
    display: flex;
    background: white; 
    border: 1px solid #1c5fd1;
    margin: 0 1px;
    flex-grow: 1;
}

.start-left {
    width: 55%;
    padding: 5px;
    display: flex;         
    flex-direction: column; 
}
.start-item {
    display: flex;
    padding: 6px;
    cursor: pointer;
    border-radius: 3px;
}
.start-item:hover { background: #316ac5; color: white; }
.start-item img { width: 32px; height: 32px; margin-right: 8px; }
.item-text { display: flex; flex-direction: column; }
.item-text b { font-size: 11px; }
.item-text span { font-size: 9px; opacity: 0.8; }

.all-programs {
    margin-top: 10px;
    border-top: 1px solid #ccc;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.window-content.no-border {
    border: none !important;
    margin: 0 !important;
}

.ie-toolbar {
    background: #ece9d8;
    border-bottom: 1px solid #999;
    padding: 2px;
    font-size: 11px;
}
.ie-menu { padding: 2px 5px; color: #000; cursor: default; }
.ie-address-bar { display: flex; align-items: center; padding: 2px 5px; gap: 5px; }

.address-input { 
    background: white; 
    border: 1px solid #7f9db9;  
    flex-grow: 1;               
    padding: 3px 5px; 
    font-size: 11px; 
    color: #000;
    font-family: "Tahoma", sans-serif;
    outline: none;             
    box-shadow: inset 1px 1px 2px rgba(0,0,0,0.1); 
}

/* MINESWEEPER: A masterclass in 1990s 3D border effects */
.minesweeper-container {
    background-color: #bdbdbd;
    padding: 6px; 
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
}

.mines-header {
    background-color: #bdbdbd;
    border-top: 2px solid #808080; 
    border-left: 2px solid #808080;
    border-right: 2px solid white;
    border-bottom: 2px solid white;
    padding: 4px 6px;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.digital-display {
    background: black;
    color: red;
    font-family: "Courier New", monospace;
    font-size: 22px;
    font-weight: bold;
    width: 42px;
    text-align: center;
    border-top: 1px solid #808080;
    border-left: 1px solid #808080;
    border-right: 1px solid white;
    border-bottom: 1px solid white;
    line-height: 1.2;
    letter-spacing: 1px;
}

.smiley-btn {
    width: 26px;
    height: 26px;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    background-color: #c0c0c0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px; 
}
.smiley-btn:active {
    border-top: 1px solid #808080; 
    border-left: 1px solid #808080;
}
.smiley-btn img { width: 20px; height: 20px; }

.mines-grid {
    display: grid;
    border-top: 3px solid #808080;
    border-left: 3px solid #808080;
    border-right: 3px solid white;
    border-bottom: 3px solid white;
    background-color: #bdbdbd; 
}

.mine-cell {
    width: 24px; height: 24px;
    border-top: 2px solid white;
    border-left: 2px solid white;
    border-right: 2px solid #808080;
    border-bottom: 2px solid #808080;
    background-color: #c0c0c0;
    font-size: 14px; font-weight: 900;
    display: flex; align-items: center; justify-content: center;
    cursor: default;
}
.mine-cell.revealed {
    border: 1px solid #808080; 
    border-right: none; border-bottom: none; 
    background-color: #c0c0c0;
}

/* The 'You Fucked Up' color */
.mine-hit { background-color: red !important; }

.mine-cell img {
    width: 20px !important;  
    height: 20px !important; 
    pointer-events: none;    
}

.mine-hit img {
    filter: drop-shadow(1px 1px 1px rgba(0,0,0,0.5));
}

.n-1 { color: #0000ff; }
.n-2 { color: #008000; }
.n-3 { color: #ff0000; }
.n-4 { color: #000080; }
.n-5 { color: #800000; }
.n-6 { color: #008080; }
.n-7 { color: #000000; }
.n-8 { color: #808080; }

.start-right {
    width: 45%;
    background: #d3e5fa; 
    border-left: 1px solid #91b2e6;
    padding: 10px 5px;
}
.sys-item {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    color: #003399;
    cursor: pointer;
}
.sys-item:hover { background: #316ac5; color: white; }

.start-footer {
    background: linear-gradient(to bottom, #3e88f1 0%, #114fb1 100%);
    padding: 5px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
.footer-btn {
    background: none; border: none; color: white; font-size: 11px;
    display: flex; align-items: center; cursor: pointer;
}
.footer-btn img { width: 18px; margin-right: 5px; }

.start-sidebar {
    width: 30px;
    background: linear-gradient(to bottom, #1658d5, #428eff);
    color: white;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 10px 5px;
    font-weight: bold;
    text-shadow: 1px 1px 2px black;
}

.start-links {
    flex-grow: 1;
    padding: 5px;
    background: white;
}

.task-item span {
    white-space: nowrap;      
    overflow: hidden;         
    text-overflow: ellipsis;  
    flex-grow: 1;             
}
/* System Tray: Where icons go to be forgotten */
#system-tray {
    height: 24px; background: #1290e8; border-left: 1px solid #10428d;
    box-shadow: inset 1px 0 2px rgba(0,0,0,0.2);
    padding: 0 15px 0 10px; display: flex; align-items: center; gap: 10px;
    color: white; font-size: 11px; flex-shrink: 0; margin-right: 2px; border-radius: 2px;
}
.tray-arrow {
    width: 16px; height: 16px; background: #166bbe; border-radius: 50%;
    display: flex; justify-content: center; align-items: center;
    border: 1px solid white; font-size: 10px; font-weight: bold; cursor: pointer; margin-left: -19px;
}

.guestbook-container {
    width: 100%;
    height: 600px;
    border: none;
    margin-top: 10px;
}

.guestbook-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
}

/* --- SOLITAIRE XP STYLE --- */
/* ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: THE "OFFICE PRODUCTIVITY KILLER" BOARD                               ::
 :: Standard issue green. Because nothing says "I'm working hard"        ::
 :: like staring at a digital felt table for six hours.                  ::
 ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
*/
.solitaire-board {
    background-color: #008000; /* Stolen from a virtual casino in 1995 */
    width: 100%;
    height: 100%;
    position: relative;
    padding: 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    user-select: none;
    overflow: hidden;
}

/* Top Bar: Score & Time (Tracking your wasted youth) */
.sol-header {
    display: flex;
    justify-content: space-between;
    color: white;
    font-family: Arial, sans-serif;
    font-size: 11px;
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

/* Stock/Waste/Foundation row: The 'upper management' of the board */
.sol-top-row {
    display: flex;
    justify-content: space-between;
    height: 100px; 
    margin-bottom: 15px;
}

/* Tableau: Where the actual grunt work happens */
.sol-bottom-row {
    display: flex;
    justify-content: space-between; 
    flex-grow: 1;
    position: relative;
}

/* Empty Slots: For when you run out of moves and start questioning your life */
.card-slot {
    width: 71px;
    height: 96px;
    border: 1px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    position: relative;
    background: rgba(0,0,0,0.1);
}

.stock-pile { cursor: pointer; }
.waste-pile { }
.foundation-group { display: flex; gap: 10px; }
.tableau-group { 
    display: flex; 
    justify-content: space-between; 
    width: 100%; 
    padding-right: 10px;
}

.tableau-slot {
    width: 71px;
    position: relative; /* Essential for stacking, like your unpaid bills */
    height: 100%;
}

/* --- THE CARD (SPRITESHEET LOGIC) --- */
/*
 ----------------------------------------------------------------------
 [!] BITMAP NOSTALGIA OVERLOAD [!]
 Squeezing a spritesheet into a modern browser. 
 If the shadows look like garbage, it's called "vintage," okay?
 ----------------------------------------------------------------------
*/
.sol-card {
    width: 71px;
    height: 96px;
    background-image: url('assets/solitaire/95ishdeck.gif');
    background-repeat: no-repeat;
    border-radius: 3px; 
    position: absolute;
    cursor: grab;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* The mysterious back of the card. What's underneath? Disappointment. */
.sol-card.back {
    background-position: 0px -384px; 
}

/* Grabbing the card. Try not to drag it off the screen, Einstein. */
.sol-card:active { cursor: grabbing; }
