:root {
    --bg-canvas: #09090b;       
    --bg-card: #18181b;         
    --border-lowkey: #27272a;   
    
    --text-primary: #fafafa;    
    --text-muted: #a1a1aa;      
    
    --indicator-active: #eab308; 
    --accent-warning: #ef4444;   
    
    --affinity-magic: #38bdf8;
    --affinity-force: #ef4444;
    --affinity-spirit: #22c55e;
    --affinity-void: #a855f7;
/* --- RARITY GLOW EFFECTS (Neon Edge Version) --- */
.glow-common {
    border-left: 4px solid var(--rarity-common);
    background: linear-gradient(90deg, rgba(176, 190, 197, 0.45) 0%, rgba(176, 190, 197, 0.08) 12%, transparent 35%);
}
.glow-uncommon {
    border-left: 4px solid var(--rarity-uncommon);
    background: linear-gradient(90deg, rgba(76, 175, 80, 0.45) 0%, rgba(76, 175, 80, 0.08) 12%, transparent 35%);
}
.glow-rare {
    border-left: 4px solid var(--rarity-rare);
    background: linear-gradient(90deg, rgba(41, 182, 246, 0.45) 0%, rgba(41, 182, 246, 0.08) 12%, transparent 35%);
}
.glow-epic {
    border-left: 4px solid var(--rarity-epic);
    background: linear-gradient(90deg, rgba(171, 71, 188, 0.45) 0%, rgba(171, 71, 188, 0.08) 12%, transparent 35%);
}
.glow-legendary {
    border-left: 4px solid var(--rarity-legendary);
    background: linear-gradient(90deg, rgba(255, 202, 40, 0.45) 0%, rgba(255, 202, 40, 0.08) 12%, transparent 35%);
}
.glow-mythical {
    border-left: 4px solid var(--rarity-mythical);
    background: linear-gradient(90deg, rgba(239, 83, 80, 0.45) 0%, rgba(239, 83, 80, 0.08) 12%, transparent 35%);
}
}

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

body {
    background-color: var(--bg-canvas);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    padding: 20px;
    line-height: 1.5;
}

/* NEW: Global Header & Toggle Styles */
.top-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto 30px auto;
}

.brand-stamp { font-size: 1.5rem; font-weight: 800; }
.brand-stamp .domain { color: var(--text-muted); font-weight: 400; }

.view-toggle {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 4px;
    display: flex;
    gap: 5px;
    border: 1px solid var(--border-lowkey);
}

.view-toggle span {
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s;
}

.view-toggle .active { background: var(--border-lowkey); color: var(--text-primary); }
.view-toggle .inactive { color: var(--text-muted); }

/* Main Grid */
.app-container {
    display: grid;
    grid-template-columns: 1fr; 
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr 1fr; 
        align-items: start;
    }
    .viewport-column {
        position: sticky;
        top: 20px; 
    }
}

/* Upload Box */
.upload-box { background-color: var(--bg-card); border: 1px dashed var(--border-lowkey); border-radius: 8px; padding: 15px; margin-bottom: 20px; }
.upload-box input[type="file"] { color: var(--text-muted); width: 100%; margin-bottom: 10px; }
.status-indicator { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }

/* Dashboard Cards General */
.dashboard-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-lowkey);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

/* CHAMPION IDENTITY CARD */
.identity-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 5px;
    padding: 15px;
}

#champ-name { font-size: 1.6rem; font-weight: 800; margin: 0; }

.champ-level-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1rem;
}
.champ-lvl { color: var(--text-primary); }

/* --- SIZZLE STATS: SVG STAR UI --- */
.star-container {
    display: inline-flex;
    gap: 2px;
    align-items: center;
}

.champ-star {
    width: 18px; 
    height: 18px;
    filter: drop-shadow(0px 2px 3px rgba(0, 0, 0, 0.6));
}

.star-yellow { fill: #facc15; }
.star-purple { fill: #c084fc; }
.star-red { fill: #ef4444; }
.star-empty { fill: #334155; opacity: 0.5; }
/* --------------------------------- */

.champ-traits-row {
    display: flex;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--text-primary);
}

/* Dynamic Affinity Colors */
.affinity-magic { color: var(--affinity-magic); font-weight: 600; }
.affinity-force { color: var(--affinity-force); font-weight: 600; }
.affinity-spirit { color: var(--affinity-spirit); font-weight: 600; }
.affinity-void { color: var(--affinity-void); font-weight: 600; }

/* STAT GRID */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.stat-box {
    background-color: var(--bg-canvas); 
    border: 1px solid var(--border-lowkey);
    border-radius: 8px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-label { color: var(--text-muted); font-size: 0.75rem; font-weight: 700; margin-bottom: 4px; }
.stat-val { color: var(--text-primary); font-size: 1.25rem; font-weight: 700; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.warning-text { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }

/* RIGHT COLUMN ACTION BARS */
.action-bar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-lowkey);
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
    z-index: 2;
}

.action-bar:hover { background-color: #27272a; }
.action-content { display: flex; gap: 10px; align-items: center; }
.action-highlight { font-weight: 700; }
.action-icon { color: var(--text-muted); font-size: 1.2rem; }

/* --- ACTION DRAWERS (Accordions) --- */
.action-drawer {
    display: none; /* Hidden by default */
    padding: 15px 20px;
    background-color: #121214; 
    border: 1px solid var(--border-lowkey);
    border-top: none;
    border-radius: 0 0 8px 8px;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: -12px; 
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.drawer-stat {
    display: flex;
    justify-content: space-between;
}

/* When the bar above is 'open', square off the bottom corners */
.action-bar.open {
    border-radius: 8px 8px 0 0;
    border-bottom: 1px dashed var(--border-lowkey);
    margin-bottom: 0;
}

/* When the bar above is 'open', show this drawer */
.action-bar.open + .action-drawer {
    display: block;
}

/* Simulation Button */
.btn-clear-sim {
    display: block;
    width: 100%;
    padding: 14px;
    background-color: transparent;
    border: 1px solid var(--border-lowkey);
    color: var(--text-primary);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
}
.btn-clear-sim:hover { border-color: var(--accent-warning); color: var(--accent-warning); }

/* BASEMENT */
details { background-color: var(--bg-card); border: 1px solid var(--border-lowkey); border-radius: 6px; margin-top: 30px; opacity: 0.7; }
details summary { padding: 12px 15px; font-weight: 600; cursor: pointer; list-style: none; }
.basement-content pre { background: #000; color: #4ade80; padding: 15px; overflow-x: auto; font-family: monospace; font-size: 0.8rem; }

/* --- EMPOWERMENT TAG --- */
.empowerment-tag {
    color: #f59e0b; 
    font-size: 0.65em; 
    vertical-align: baseline;
    margin-left: 4px;
}

/* --- Brand Subtitle --- */
.brand-container {
    display: flex;
    flex-direction: column;
}

.brand-subtitle {
    font-size: 0.7rem;
    color: #64748b; /* Muted Slate */
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

/* --- Coming Soon Badge --- */
.badge-soon {
    background: rgba(245, 158, 11, 0.1); /* Translucent Amber */
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.4);
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

/* ==========================================
   INFO TOOLTIP
   ========================================== */
.info-wrapper {
    position: relative;
    display: inline-block;
    cursor: help;
    z-index: 999;
}

.info-icon {
    color: #94a3b8; /* Muted Slate */
    font-size: 1.2rem;
    transition: color 0.2s ease;
}

.info-wrapper:hover .info-icon {
    color: #38bdf8; /* Neon Blue on hover */
}

/* The Hidden Tooltip Box (Flipped to drop DOWN) */
.tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 150%; /* <-- Changed from bottom to top to push it down */
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    background: #1e293b;
    color: #e2e8f0;
    border: 1px solid var(--border-lowkey);
    border-radius: 6px;
    padding: 12px;
    font-size: 0.75rem;
    line-height: 1.4;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 999;
    pointer-events: none; 
}

/* The tiny UPWARD pointing arrow */
.tooltip-content::after {
    content: "";
    position: absolute;
    bottom: 100%; /* <-- Moved to the top edge of the box */
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #1e293b transparent; /* <-- Flipped the colors so it points up */
}

/* Fade in on hover */
.info-wrapper:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Text formatting inside the tooltip */
.tooltip-content p {
    margin: 0 0 10px 0;
    text-align: left;
}

.tooltip-content p strong {
    color: #f8fafc;
}

.tooltip-content .beta-note {
    color: #f59e0b; /* Flame Amber */
    font-style: italic;
    margin-bottom: 0;
}

.viewport-column {
    position: relative;
    z-index: 50;
}