/* CELESTIAL OS - CORE STYLESHEET 
   v4.9 (Restored Grid & Fixed Tooltip)
*/

/* 1. RESET & ARCHITECTURE */
#celestial-os-root, #celestial-os-root * { 
    box-sizing: border-box !important; 
    margin: 0; padding: 0; 
    line-height: normal; 
    text-decoration: none !important; 
    list-style: none; border: none; 
}

#celestial-os-root {
    --cos-accent: #AE9EFF; 
    --cos-sun: #FFD700; 
    --cos-moon: #C0C0C0; 
    --cos-glass: rgba(10, 5, 20, 0.05); 
    --cos-border: rgba(174, 158, 255, 0.25);
    position: relative; 
    padding: 60px 40px; 
    color: white; 
    font-family: 'Atkinson Hyperlegible Mono', monospace;
    max-width: 1050px; 
    margin: 40px auto; 
    background: var(--cos-glass); 
    border: 1px solid var(--cos-border);
    border-radius: 40px; 
    backdrop-filter: blur(40px); 
    box-shadow: 0 0 50px rgba(0,0,0,0.6); 
    display: block;
}

/* Celestial Vibes */
#celestial-os-root.sun-vibe { --cos-accent: var(--cos-sun); --cos-border: rgba(255, 215, 0, 0.3); }
#celestial-os-root.moon-vibe { --cos-accent: var(--cos-moon); --cos-border: rgba(192, 192, 192, 0.3); }

.cos-grid { display: grid; grid-template-columns: 320px 1fr; gap: 40px; }

/* 2. SIDEBAR & PORTRAIT */
.cos-portrait { 
    width: 100%; 
    aspect-ratio: 1/1.2; 
    border: 1px solid var(--cos-border); 
    border-radius: 20px; 
    position: relative; 
    overflow: hidden; 
    transition: 0.5s; 
    background: rgba(0,0,0,0.2); 
}
.cos-portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* 3. HOLLOW CELESTIAL TOGGLES */
.cos-celestial-icons { position: absolute; top: 25px; right: 25px; display: flex; gap: 12px; z-index: 10; }
.cos-celestial-icons i { 
    font-size: 1.8rem; 
    cursor: pointer; 
    transition: 0.3s; 
    color: rgba(255, 255, 255, 0.2); 
    filter: drop-shadow(0 0 10px rgba(174, 158, 255, 0.25)); 
}
.cos-celestial-icons i.ph-sun:hover { color: var(--cos-sun); filter: drop-shadow(0 0 10px var(--cos-sun)); }
.cos-celestial-icons i.ph-moon:hover { color: var(--cos-moon); filter: drop-shadow(0 0 10px var(--cos-moon)); }

/* 4. COMBAT STATUS & SKILLS (Matches Screenshot 1) */
.cos-stats-panel { background: rgba(255,255,255,0.02); border: 1px solid var(--cos-border); padding: 20px; border-radius: 15px; margin-top: 25px; }
.cos-panel-header { font-size: 0.65rem; text-transform: uppercase; color: #fff; text-align: center; margin-bottom: 8px; font-weight: bold; }
.cos-stats-list { margin-bottom: 20px; }
.cos-stat-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 0.75rem; border-bottom: 1px solid rgba(255,255,255,0.05); text-transform: uppercase; }
.stat-val { color: var(--cos-accent); text-shadow: 0 0 8px var(--cos-accent); font-weight: bold; }

.cos-skill-header { font-size: 0.6rem; color: var(--cos-accent); text-transform: uppercase; letter-spacing: 2px; margin: 20px 0 10px 0; display: flex; align-items: center; gap: 10px; opacity: 0.8; }
.cos-skill-header::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--cos-border), transparent); }

/* ... Keep the Top/Layout CSS from before ... */

/* UPDATED SKILL GRID & POPOUT */
.cos-skills-container { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 8px; 
    margin-top: 10px; 
}

.cos-skill-tag { 
    position: relative; /* This traps the popout inside the tag */
    font-size: 0.65rem; 
    background: rgba(255, 255, 255, 0.03); 
    padding: 10px 4px; 
    border-radius: 4px; 
    border: 1px solid var(--cos-border); 
    cursor: help; 
    text-align: center; 
    text-transform: uppercase; 
}

.cos-skill-tag:hover { 
    background: rgba(174, 158, 255, 0.15); 
    border-color: var(--cos-accent); 
}

/* THE NEW POPOUT SYSTEM */
.cos-skill-popout {
    position: absolute;
    bottom: 125%; /* Shows above the skill */
    left: 50%;
    transform: translateX(-50%);
    width: 180px;
    padding: 12px;
    background: #0f0a1e;
    border: 1px solid var(--cos-accent);
    color: #fff;
    font-size: 0.7rem;
    text-transform: none;
    line-height: 1.4;
    border-radius: 4px;
    pointer-events: none;
    opacity: 0;
    transition: 0.2s ease-in-out;
    z-index: 100;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}

/* Tooltip Arrow */
.cos-skill-popout::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--cos-accent) transparent transparent transparent;
}

.cos-skill-tag:hover .cos-skill-popout {
    opacity: 1;
    bottom: 110%;
}


/* 6. CONTENT AREA */
.cos-info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; margin-bottom: 25px; }
.cos-info-box { background: rgba(255,255,255,0.02); padding: 10px 15px; border-left: 2px solid var(--cos-accent); }
.cos-label { font-size: 0.6rem; opacity: 0.6; text-transform: uppercase; letter-spacing: 2px; display: block; }
.cos-val { font-size: 0.75rem; display: block; margin-top: 2px; }

/* Progress Bars */
.cos-bar-wrap { margin-bottom: 15px; }
.cos-bar-meta { display: flex; justify-content: space-between; font-size: 0.75rem; margin-bottom: 5px; text-transform: uppercase; }
.cos-bar-bg { height: 8px; background: rgba(255,255,255,0.05); border-radius: 10px; overflow: hidden; }
.cos-bar-fill { height: 100%; background: var(--cos-accent); box-shadow: 0 0 15px var(--cos-accent); transition: 0.8s cubic-bezier(0.4, 0, 0.2, 1); }

/* 7. BOTTOM LAYOUT & SPACING */
.cos-bottom-layout { margin-top: 50px; border-top: 1px solid var(--cos-border); padding-top: 35px; }
.cos-tastes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 30px; }
.cos-taste-col h4 { font-size: 0.7rem; text-transform: uppercase; color: var(--cos-accent); text-align: center; margin-bottom: 15px; letter-spacing: 2px; }
.cos-list li { font-size: 0.75rem; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; opacity: 0.8; }
.cos-list i { color: var(--cos-accent); font-size: 0.6rem; }

/* System Log */
.cos-system-log { margin-top: 40px; padding: 0 20px; background: rgba(0, 0, 0, 0.25); border: 1px solid var(--cos-border); border-radius: 8px; display: flex; align-items: center; gap: 12px; height: 48px; }
#cos-log-text { font-size: 0.75rem; color: var(--cos-accent); text-transform: uppercase; letter-spacing: 2px; flex: 1; }
.cos-log-cursor { width: 8px; height: 16px; background: var(--cos-accent); animation: cos-blink 1s infinite; }
@keyframes cos-blink { 50% { opacity: 0; } }

/* Footer */
.cos-footer { margin-top: 35px; display: flex; justify-content: flex-end; gap: 25px; padding-bottom: 15px; }
.cos-social { color: white; font-size: 1.5rem; transition: 0.3s; opacity: 0.6; }
.cos-social:hover { opacity: 1; color: var(--cos-accent); transform: scale(1.1); }