/* pe-map.css — Pe Phase Space visualization page */

/* ── Layout ──────────────────────────────────────────────── */

.pe-map-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.pe-map-header {
    margin-bottom: 1.5rem;
}

.pe-map-breadcrumb {
    font-size: 0.75rem;
    font-family: var(--font-mono);
    color: var(--text-faint);
    margin: 0 0 0.4rem;
}

.pe-map-header h1 {
    margin: 0 0 0.75rem;
    font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.pe-map-intro {
    max-width: 700px;
    color: var(--text-dim);
    line-height: 1.7;
    margin: 0;
    font-size: 0.92rem;
}

/* ── Canvas wrap ─────────────────────────────────────────── */

.pe-map-wrap {
    position: relative;
    overflow: hidden;
    background: #060810;
    border: 1px solid rgba(255, 200, 150, 0.12);
    border-radius: 4px;
    margin: 1.5rem 0 0;
}

.pe-map-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
}

/* ── Tooltip ─────────────────────────────────────────────── */

#pe-tooltip,
#pe-universe-tooltip {
    position: absolute;
    pointer-events: none;
    background: rgba(6, 8, 16, 0.95);
    border: 1px solid rgba(200, 151, 106, 0.45);
    border-radius: 2px;
    padding: 0.45rem 0.7rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.72rem;
    color: #f5f2f0;
    line-height: 1.65;
    opacity: 0;
    transition: opacity 0.12s;
    white-space: nowrap;
    z-index: 10;
    top: 0;
    left: 0;
}

/* ── Stats bar ───────────────────────────────────────────── */

.pe-map-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
    padding: 0.7rem 1rem;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.7rem;
    color: rgba(160, 152, 144, 0.65);
    border: 1px solid rgba(255, 200, 150, 0.12);
    border-top: none;
    border-radius: 0 0 4px 4px;
    background: rgba(4, 6, 12, 0.6);
    margin-bottom: 2rem;
}

.pe-map-meta span {
    color: #c8976a;
}

/* ── Legend grid ──────────────────────────────────────────── */

.pe-map-section-heading {
    font-size: 1.05rem;
    margin-bottom: 0.9rem;
    color: var(--text-dim);
}

.pe-map-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.75rem;
    max-width: 900px;
}

.pe-map-legend-grid--wide {
    max-width: 1000px;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
}

.pe-legend-void       { color: #ff3333; font-size: 0.85rem; }
.pe-legend-constraint { color: #22ff88; font-size: 0.85rem; }
.pe-legend-amber      { color: #c8976a; font-size: 0.85rem; }
.pe-legend-teal       { color: #00c8a5; font-size: 0.85rem; }
.pe-legend-dual       { color: #ffaa44; font-size: 0.85rem; }
.pe-legend-rank1      { color: #ffee88; font-size: 0.85rem; }
.pe-legend-nexus      { color: #ffffcc; font-size: 0.85rem; }
.pe-legend-self       { color: #33bbff; font-size: 0.85rem; }

.pe-legend-detail {
    font-size: 0.82rem;
    color: var(--text-dim);
    line-height: 1.55;
}

/* ── Formula bar ─────────────────────────────────────────── */

.pe-map-formula-bar {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.pe-map-formula-bar p {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 0.78rem;
    color: var(--text-faint);
    line-height: 1.8;
}

.pe-map-links {
    margin-top: 0.5rem;
}

.pe-map-links a {
    color: var(--accent);
    margin-right: 1.5rem;
}

/* ── Responsive ──────────────────────────────────────────── */

@media (max-width: 600px) {
    .pe-map-main {
        padding: 1.25rem 1rem;
    }

    .pe-map-meta {
        gap: 0.2rem 1rem;
        font-size: 0.65rem;
    }

    .pe-map-legend-grid {
        grid-template-columns: 1fr;
    }
}
