:root {
    --os-bg: #000000;
    --os-accent: #10b981; /* Emerald 500 */
    --warfare-color: #f97316;
    --homeland-color: #3b82f6;
    
    /* Windows 11 Dark Mode Tokens */
    --win-glass-bg: rgba(32, 32, 32, 0.85);
    --win-glass-border: rgba(255, 255, 255, 0.08);
    --win-highlight: rgba(255, 255, 255, 0.05);
    --win-shadow: 0 20px 50px -12px rgba(0, 0, 0, 0.6);
    --win-radius: 12px;
}

body {
    font-family: 'Rajdhani', sans-serif;
    background-color: #000;
    overflow: hidden;
    user-select: none;
    cursor: default;
}

.font-mono { font-family: 'Share Tech Mono', monospace; }
.text-shadow { text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

/* Desktop Wallpaper */
.desktop-bg {
    background-color: var(--os-bg);
    /* NOTE: I have added a placeholder URL so you can see the effect in this preview.
       Uncomment the second line and remove the first when using your local files.
    */
    background-image: url('https://i.imgur.com/ofHv1Cz.jpeg');
    /* background-image: url('strg/ui/p2022_bg_lowres.png'); */
    
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* CRT Scanline Effect - Made subtler for Modern Look */
.scanlines {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.15;
}

/* =========================================
   MODERN WINDOW STYLES (Windows 11-esque)
   ========================================= */
.os-window {
    position: absolute;
    background: var(--win-glass-bg);
    backdrop-filter: blur(24px) saturate(125%); 
    -webkit-backdrop-filter: blur(24px) saturate(125%);
    
    border: 1px solid var(--win-glass-border);
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        var(--win-shadow);
        
    display: flex;
    flex-direction: column;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    border-radius: var(--win-radius);
    animation: windowOpen 0.2s cubic-bezier(0, 0, 0.2, 1);
}

.os-window.active {
    border-color: rgba(255, 255, 255, 0.15);
    z-index: 50;
    box-shadow: 
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 30px 60px -12px rgba(0, 0, 0, 0.8);
}

/* Header Styling */
.window-header {
    background: transparent;
    height: 40px;
    cursor: default;
    -webkit-user-drag: none;
}
.window-header:active { cursor: grabbing; }

/* Content Area styling */
.os-window > div:last-child {
    border-bottom-left-radius: var(--win-radius);
    border-bottom-right-radius: var(--win-radius);
}

/* =========================================
   MACOS-STYLE DOCK
   ========================================= */

/* Start Menu Styles */
#start-menu-btn {
    border: 1px solid transparent;
}
#start-menu-btn:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.mode-switch-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.15s;
}
.mode-switch-btn i {
    font-size: 14px;
}
.mode-switch-btn.active {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.mode-switch-btn:hover:not(.active) {
    background: rgba(71, 85, 105, 0.3);
    color: #cbd5e1;
}

.start-app-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 16px 8px;
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.start-app-item span {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #cbd5e1;
    text-align: center;
}
.start-app-item:hover {
    background: rgba(30, 41, 59, 0.7);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Social Widget Styles */
.social-sidebar {
    width: 80px;
    background: rgba(15, 23, 42, 0.95);
    border-left: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(18px);
    border-radius: 12px;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible; /* allow play button to render outside */
}
.social-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}
.social-label {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #60a5fa;
    text-align: center;
}
.social-friends {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    max-height: 250px;
    overflow-y: auto;
}
/* Remove forced width; keep natural layout and allow overflow */
.friend-item {
    position: relative;
    cursor: pointer;
    transition: transform 0.15s;
    overflow: visible; /* ensure extended elements are interactive */
}
.friend-item:hover {
    transform: translateY(-2px);
}
.friend-avatar {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08);
    transition: 0.15s;
}
.friend-item.online .friend-avatar {
    box-shadow: 0 0 0 2px #10b981;
}
.friend-item.online .friend-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #10b981;
    border: 2px solid rgba(15, 23, 42, 0.95);
    border-radius: 50%;
}
.friend-item.away .friend-avatar {
    box-shadow: 0 0 0 2px #f59e0b;
}
.friend-item.away .friend-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #f59e0b;
    border: 2px solid rgba(15, 23, 42, 0.95);
    border-radius: 50%;
}
.friend-item.offline .friend-avatar {
    opacity: 0.5;
}
.social-add-btn {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.2);
    border: 1px dashed rgba(99, 102, 241, 0.4);
    color: #818cf8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: 0.15s;
    margin: 0 auto;
}
.social-add-btn:hover {
    background: rgba(99, 102, 241, 0.3);
    border-color: rgba(99, 102, 241, 0.6);
}

/* Chat Window Styles */
.chat-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.15s;
}
.chat-tab:hover {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.05);
}
.chat-tab.active {
    color: #818cf8;
    border-bottom-color: #818cf8;
    background: rgba(99, 102, 241, 0.1);
}

.dock-icon {
    position: relative;
    width: 56px; /* 14 * 4 */
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.15s cubic-bezier(0, 0, 0.2, 1);
    cursor: pointer;
    z-index: 1;
}

.dock-icon:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: scale(1.3) translateY(-10px);
    z-index: 2;
}

.dock-icon:active {
    transform: scale(1.1) translateY(-5px);
}

/* Active app indicator dot */
.dock-icon.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 6px;
    background: var(--os-accent);
    border-radius: 50%;
    box-shadow: 0 0 6px var(--os-accent), 0 0 10px var(--os-accent);
    transition: all 0.2s;
}

/* Minimized app style */
.dock-icon.minimized {
    opacity: 0.5;
}

/* Tooltip */
.dock-icon .tooltip {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    opacity: 0;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.15s cubic-bezier(0, 0, 0.2, 1);
    white-space: nowrap;
}

.dock-icon:hover .tooltip {
    opacity: 1;
    transform: translateX(-50%) scale(1);
    transition-delay: 0.1s;
}


/* Scrollbar - Slim & Modern */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.2); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.3); }

/* Animations */
.fade-in { animation: osBoot 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }

@keyframes osBoot { 
    from { opacity: 0; transform: scale(0.98) translateY(10px); } 
    to { opacity: 1; transform: scale(1) translateY(0); } 
}

/* Window Open Animation (Pop in) */
@keyframes windowOpen {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* Settings dropdown + toast */
.settings-dd-item { font-family: 'Rajdhani', sans-serif; }
.settings-toast { transition: opacity .4s; pointer-events:none; }

/* Play Button (global for Lobby & Social) */
.play-btn {
    position: absolute;
    left: -52px;
    top: 6px; /* vertically align in 48px friend/lobby items */
    width: 36px;
    height: 36px;
    background: rgba(16, 185, 129, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #000;
    cursor: pointer;
    transition: .15s;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    pointer-events: auto;
}

/* Make social widget behave like lobby: outer wrapper 110px, inner 80px aligned right */
#social-widget { width: 110px; position: fixed; right: .5rem; bottom: 1rem; overflow: visible; z-index: 50; }
.social-sidebar { width: 80px; margin-left: auto; overflow: visible; position: relative; }
.play-btn:hover { background:#10b981; transform:scale(1.1); box-shadow:0 0 0 2px rgba(16,185,129,0.3),0 4px 12px rgba(0,0,0,0.5); }

/* Rich Player Card (CS2/Discord-style) */
.playercard {
    position: absolute;
    min-width: 280px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.6);
    font-size: 11px;
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.playercard.hidden { display: none; }
.playercard .pc-banner {
    width: 100%;
    height: 56px;
    border-radius: 8px;
    background: linear-gradient(135deg,#0f172a,#1e293b);
}
.playercard .pc-header {
    display: flex;
    gap: 10px;
    align-items: center;
}
.playercard .pc-avatar {
    width: 52px;
    height: 52px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    color: #fff;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.08);
    margin-top: -34px;
}
.playercard .pc-meta { display:flex; flex-direction:column; gap:4px; }
.playercard .pc-name { font-size: 14px; font-weight: 800; letter-spacing: 0.6px; }
.playercard .pc-rank { color:#94a3b8; text-transform:uppercase; font-size:10px; }
.playercard .pc-badges { display:flex; gap:6px; flex-wrap:wrap; }
.playercard .pc-badge { font-weight:700; font-size:9px; padding:2px 6px; border:1px solid rgba(255,255,255,0.1); border-radius:6px; }
.playercard .pc-medals-row { display:flex; gap:6px; flex-wrap:wrap; }
.playercard .pc-medal { display:flex; align-items:center; gap:6px; padding:6px 8px; border:1px solid rgba(255,255,255,0.06); border-radius:8px; background:rgba(255,255,255,0.03); }
.playercard .pc-medal i { font-size:12px; }
.playercard .pc-medal span { font-size:10px; font-weight:700; color:#cbd5e1; }
.playercard .pc-ratings-row { display:flex; gap:10px; }
.playercard .pc-rating { display:flex; align-items:center; gap:6px; background:rgba(71,85,105,0.35); border:1px solid rgba(255,255,255,0.06); border-radius:8px; padding:6px 8px; }
.playercard .pc-rating span { font-size:10px; color:#cbd5e1; }
.playercard .pc-rating strong { font-size:12px; color:#fff; }
.playercard .pc-actions { display:flex; flex-wrap:wrap; gap:6px; }
.playercard .pc-action { display:flex; align-items:center; gap:6px; padding:8px 10px; background:rgba(30,41,59,0.5); border:1px solid rgba(255,255,255,0.08); border-radius:8px; font-size:10px; font-weight:800; color:#cbd5e1; cursor:pointer; transition:.15s; }
.playercard .pc-action:hover { background:rgba(30,41,59,0.7); border-color:rgba(255,255,255,0.15); color:#fff; }

/* Server Card (shown on play button hover) */
.servercard {
    position: fixed;
    width: 280px;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 28px rgba(0,0,0,0.7);
    z-index: 10050; /* above scanlines and windows */
    display: flex;
    flex-direction: column;
    pointer-events: none;
}
.servercard.hidden { display: none; }
.servercard .sc-map-preview {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg,#0f172a,#1e293b);
    position: relative;
}
.servercard .sc-map-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 50%, rgba(15,23,42,0.9) 100%);
}
.servercard .sc-content { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.servercard .sc-header { display: flex; flex-direction: column; gap: 4px; }
.servercard .sc-name { font-size: 13px; font-weight: 800; letter-spacing: 0.6px; color: #fff; }
.servercard .sc-region { font-size: 10px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.8px; }
.servercard .sc-details { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.servercard .sc-detail { display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: rgba(71,85,105,0.3); border: 1px solid rgba(255,255,255,0.06); border-radius: 6px; font-size: 11px; }
.servercard .sc-detail i { font-size: 10px; color: #60a5fa; }
.servercard .sc-detail span { color: #cbd5e1; font-weight: 600; }
.servercard .sc-ping { color: #10b981 !important; }
.servercard .sc-footer { font-size: 10px; color: #64748b; text-align: center; padding-top: 4px; border-top: 1px solid rgba(148,163,184,0.1); font-weight: 600; letter-spacing: 0.5px; }