/* =============================================================================
   🔬  LAB INTEL — three weighty panels under the existing oscilloscope + radar
   ---------------------------------------------------------------------------
   A. Pair Co-Occurrence Heatmap (45×45 grid)
   B. Number Lifecycle Grid (1..45 cells)
   C. Last 10 Draws Detail (cards with pattern flags)
   ============================================================================= */

/* ── Shared panel skin (matches existing .panel-osc) ──────────────────── */
.panel-lab-heatmap,
.panel-lab-lifecycle,
.panel-lab-last {
    background: linear-gradient(180deg,
        rgba(18, 14, 42, 0.65),
        rgba(6, 6, 18, 0.85));
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow:
        0 0 24px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(120, 110, 220, 0.10);
    margin-top: 18px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   🔥 LAB-A · Pair Heatmap
   ═══════════════════════════════════════════════════════════════════════════ */
.lab-heatmap-wrap {
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 16px;
    margin-top: 10px;
    align-items: start;
}
@media (max-width: 1000px) {
    .lab-heatmap-wrap { grid-template-columns: 1fr; }
}

.lab-heatmap-canvas {
    width: 100%;
    height: 380px;
    background: rgba(5, 5, 12, 0.85);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(120, 110, 220, 0.12);
}
.lab-heatmap-legend {
    grid-column: 1 / 2;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(220, 220, 240, 0.55);
}
.lh-gradient {
    flex: 1;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(90deg,
        rgba(20, 30, 60, 0.6),
        rgba(120, 80, 180, 0.7),
        rgba(255, 170, 50, 0.85),
        rgba(255, 216, 107, 1.0));
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.lab-heatmap-tops {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(10, 8, 22, 0.55);
    border-radius: 10px;
    padding: 12px 14px;
    box-shadow: inset 0 0 0 1px rgba(120, 110, 220, 0.10);
}
.lab-heatmap-tops-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(220, 220, 240, 0.55);
    margin-bottom: 4px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(120, 110, 220, 0.12);
}
.lh-top-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.85);
}
.lh-top-pair {
    display: flex;
    align-items: center;
    gap: 6px;
}
.lh-top-ball {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, #c8a8ff, #7a5fd0);
    color: #1a1428;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    font-size: 10px;
}
.lh-top-link { color: rgba(176, 149, 245, 0.65); }
.lh-top-share {
    color: #ffd86b;
    font-size: 10px;
}


/* ═══════════════════════════════════════════════════════════════════════════
   📈 LAB-B · Number Lifecycle Grid
   ═══════════════════════════════════════════════════════════════════════════ */
.lab-lifecycle-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}
.lab-lc-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(220, 220, 240, 0.55);
    margin-right: 6px;
}
.lab-lc-sort {
    background: rgba(40, 35, 70, 0.5);
    color: rgba(220, 220, 240, 0.75);
    border: 1px solid rgba(120, 110, 220, 0.18);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 11px;
    cursor: pointer;
    font-family: 'JetBrains Mono', monospace;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lab-lc-sort:hover {
    background: rgba(60, 50, 100, 0.7);
    color: #f4f4ff;
}
.lab-lc-sort.active {
    background: linear-gradient(135deg, #ffd86b, #d99e4b);
    color: #1a1428;
    border-color: rgba(255, 216, 107, 0.45);
}

.lab-lifecycle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
}
.lab-lc-cell {
    background: rgba(20, 16, 42, 0.6);
    border-radius: 8px;
    padding: 8px 10px;
    border-left: 3px solid var(--cell-tone, rgba(176, 149, 245, 0.4));
    transition: transform 0.12s ease, background 0.15s ease;
}
.lab-lc-cell:hover {
    transform: translateY(-1px);
    background: rgba(40, 30, 70, 0.7);
}
.lab-lc-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 4px;
}
.lab-lc-num {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--cell-tone, #ffd86b);
}
.lab-lc-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(180, 180, 220, 0.55);
}
.lab-lc-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(220, 220, 240, 0.75);
}
.lab-lc-grid .lc-k { color: rgba(180, 180, 220, 0.5); }
.lab-lc-grid .lc-v { text-align: right; }
.lab-lc-bar {
    margin-top: 6px;
    height: 4px;
    background: rgba(10, 8, 22, 0.7);
    border-radius: 2px;
    overflow: hidden;
}
.lab-lc-bar > div {
    height: 100%;
    background: linear-gradient(90deg, #c8a8ff, #ffd86b);
    transition: width 0.5s ease;
}


/* ═══════════════════════════════════════════════════════════════════════════
   🔍 LAB-C · Last 10 Draws Detail
   ═══════════════════════════════════════════════════════════════════════════ */
.lab-last-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}
.lab-last-card {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 16px;
    padding: 12px 14px;
    background: rgba(15, 12, 38, 0.65);
    border-radius: 10px;
    border-left: 3px solid rgba(176, 149, 245, 0.35);
}
.lab-last-id {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding-right: 14px;
    border-right: 1px solid rgba(120, 110, 220, 0.18);
    min-width: 120px;
}
.lab-last-drawnum {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px;
    color: #ffd86b;
    line-height: 1;
}
.lab-last-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(180, 180, 220, 0.55);
}

.lab-last-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.lab-last-balls {
    display: flex;
    gap: 6px;
}
.lab-last-ball {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, #c8a8ff, #7a5fd0);
    color: #1a1428;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 12px;
    box-shadow: 0 0 8px rgba(176, 149, 245, 0.3);
}
.lab-last-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.75);
}
.lab-last-meta span.k { color: rgba(180, 180, 220, 0.55); }
.lab-last-flags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
}
.lab-last-flag {
    padding: 3px 10px;
    border-radius: 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: rgba(40, 30, 70, 0.7);
    color: rgba(220, 220, 240, 0.85);
    border: 1px solid rgba(120, 110, 220, 0.20);
}
.lab-last-flag[data-tone="amber"]  { background: rgba(255, 170, 50,  0.20); color: #ffaa33; border-color: rgba(255, 170, 50, 0.4); }
.lab-last-flag[data-tone="gold"]   { background: rgba(255, 216, 107, 0.20); color: #ffd86b; border-color: rgba(255, 216, 107, 0.4); }
.lab-last-flag[data-tone="rose"]   { background: rgba(255, 107, 107, 0.20); color: #ff8aa6; border-color: rgba(255, 107, 107, 0.4); }
.lab-last-flag[data-tone="purple"] { background: rgba(200, 107, 255, 0.20); color: #c86bff; border-color: rgba(200, 107, 255, 0.4); }
.lab-last-flag[data-tone="blue"]   { background: rgba(107, 188, 255, 0.20); color: #6bbcff; border-color: rgba(107, 188, 255, 0.4); }


/* =============================================================================
   🕰  LAB-D · TIME TRAVEL
   ============================================================================= */
.panel-lab-tt {
    background: linear-gradient(180deg,
        rgba(28, 22, 55, 0.65),
        rgba(8, 6, 22, 0.85));
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow:
        0 0 28px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(176, 149, 245, 0.10);
    margin-top: 18px;
}

/* Slider */
.tt-slider-wrap {
    margin-top: 12px;
}
.tt-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: linear-gradient(90deg,
        rgba(176, 149, 245, 0.25),
        rgba(255, 216, 107, 0.6));
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.tt-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px; height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd86b, #d99e4b);
    box-shadow: 0 0 14px rgba(255, 216, 107, 0.7);
    cursor: pointer;
    border: none;
}
.tt-slider::-moz-range-thumb {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ffd86b, #d99e4b);
    box-shadow: 0 0 14px rgba(255, 216, 107, 0.7);
    cursor: pointer;
    border: none;
}
.tt-slider-ticks {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(180, 180, 220, 0.5);
}
.tt-current {
    color: #ffd86b;
    text-shadow: 0 0 6px rgba(255, 216, 107, 0.4);
}

/* Transport */
.tt-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.tt-btn {
    width: 38px; height: 38px;
    background: rgba(40, 35, 75, 0.6);
    color: rgba(240, 240, 255, 0.85);
    border: 1px solid rgba(120, 110, 220, 0.22);
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    transition: background 0.2s ease, transform 0.12s ease;
}
.tt-btn:hover {
    background: rgba(70, 55, 130, 0.85);
    transform: translateY(-1px);
}
.tt-btn-play {
    width: 46px; height: 46px;
    background: linear-gradient(135deg, #ffd86b, #d99e4b);
    color: #1a1428;
    font-size: 18px;
    box-shadow: 0 0 18px rgba(255, 216, 107, 0.4);
    border: none;
}
.tt-btn-play:hover { transform: translateY(-1px) scale(1.03); }
.tt-btn-play.playing {
    background: linear-gradient(135deg, #ff8aa6, #c83a5a);
}

.tt-speed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(180, 180, 220, 0.55);
}
.tt-speed input {
    width: 80px;
    height: 4px;
    background: rgba(120, 110, 220, 0.2);
    border-radius: 2px;
    outline: none;
}
#ttSpeedLabel {
    color: #ffd86b;
    min-width: 28px;
    text-align: right;
}

/* Stage */
.tt-stage {
    margin-top: 16px;
    padding: 14px 18px;
    background: rgba(10, 8, 22, 0.55);
    border-radius: 10px;
    border-left: 3px solid #ffd86b;
}
.tt-voice {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 18px;
    color: rgba(245, 240, 255, 0.92);
    line-height: 1.45;
    margin-bottom: 14px;
}

.tt-readout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
}
.tt-stat {
    background: rgba(28, 22, 55, 0.45);
    border-radius: 8px;
    padding: 10px 12px;
}
.tt-stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(220, 220, 240, 0.55);
}
.tt-stat-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    color: #ffd86b;
    margin-top: 4px;
}
.tt-stat-sub {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: rgba(180, 180, 220, 0.55);
    margin-top: 2px;
}

.tt-stat-brainstem {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 4px;
}
.tt-bs-row {
    display: grid;
    grid-template-columns: 50px 1fr 46px;
    gap: 6px;
    align-items: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: rgba(220, 220, 240, 0.8);
}
.tt-bs-row > span:first-child {
    color: rgba(180, 180, 220, 0.55);
    text-transform: uppercase;
    font-size: 9px;
}
.tt-bs-row > span:last-child {
    color: #ffd86b;
    text-align: right;
}
.tt-bs-bar {
    height: 6px;
    background: rgba(20, 16, 40, 0.7);
    border-radius: 3px;
    overflow: hidden;
}
.tt-bs-fill {
    display: block;
    height: 100%;
    transition: width 0.4s ease;
}
.tt-bs-o { background: linear-gradient(90deg, #5BB3F0, #B095F5); }
.tt-bs-b { background: linear-gradient(90deg, #88D8B0, #ffd86b); }
.tt-bs-d { background: linear-gradient(90deg, #ffaa33, #ff6b6b); }
