
/* --------------------------------
   PERCOLATION EXPLORER
-------------------------------- */

.percolation-explorer {
    margin-top: 70px;
    border-top: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
}

.explorer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;

    padding: 18px 0;
    border-bottom: 1px solid #ddd;
}

.explorer-label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1.4px;
    color: #777;

    margin: 0 0 8px;
}

.explorer-header h3 {
    font-family: Arial, sans-serif;
    font-size: 22px;
    margin: 0;
}

.explorer-status {
    display: flex;
    align-items: center;
    gap: 8px;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 11px;
    letter-spacing: 1px;
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #aaa;

    transition: background 0.2s ease;
}

.status-dot.active {
    background: #1a1a1a;
}


/* MAIN VISUAL AREA */

.explorer-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.explorer-panel {
    min-width: 0;
}

.lattice-panel {
    border-right: 1px solid #ddd;
}

.panel-header {
    display: flex;
    justify-content: space-between;

    padding: 14px 18px;

    border-bottom: 1px solid #ddd;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: #666;
}

/* LATTICE */

.explorer-lattice {
    width: min(72%, 320px);
    aspect-ratio: 1 / 1;
    margin: 28px auto;
    display: grid;
    gap: 3px
}


/* PROBABILITY GRAPH */

.probability-plot {
    height: 300px;
    margin: 28px 32px 45px 42px;

    position: relative;

    border-left: 1px solid #bbb;
    border-bottom: 1px solid #bbb;
}

.probability-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.plot-y-label {
    position: absolute;
    left: -34px;
    top: -7px;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #777;
}

.plot-y-middle {
    top: 50%;
}

.plot-y-bottom {
    top: auto;
    bottom: -5px;
}

.plot-x-label {
    position: absolute;
    bottom: -28px;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #777;
}

.plot-x-start {
    left: 0;
}

.plot-x-end {
    right: 0;
}

.critical-marker {
    position: absolute;

    left: 59.3%;
    top: 0;
    bottom: 0;

    border-left: 1px dashed #aaa;
}

.critical-marker span {
    position: absolute;
    bottom: -28px;
    left: 6px;

    white-space: nowrap;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    color: #777;
}

/* CONTROLS */

.explorer-controls {
    width: 100%;
    padding: 22px 0 26px;
    border-top: 1px solid #ddd;
}

.explorer-controls-inner {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(220px, 0.7fr);
    gap: 48px;
    align-items: end;

    width: 100%;
    padding: 0 70px;
    box-sizing: border-box;
}

.probability-control {
    width: 100%;
    min-width: 0;
}

.control-label {
    display: flex;
    justify-content: space-between;

    margin-bottom: 14px;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    color: #666;
}

#probability-slider {
    width: 100%;
    cursor: pointer;
    accent-color: #1a1a1a;
}

.explorer-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.explorer-button {
    flex: 1;

    min-width: 100px;
    padding: 10px 14px;

    background: transparent;
    border: 1px solid #aaa;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 10px;
    letter-spacing: 1px;

    color: #1a1a1a;

    cursor: pointer;

    white-space: nowrap;

    transition:
        background 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.explorer-button:disabled,
#probability-slider:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.explorer-button:hover {
    background: #1a1a1a;
    color: #f7f7f5;
    border-color: #1a1a1a;
}


/* DATA STRIP */

.explorer-data {
    display: grid;
    grid-template-columns: repeat(4, 1fr);

    border-top: 1px solid #ddd;
}

.data-item {
    padding: 18px 0;
}

.data-item:not(:last-child) {
    border-right: 1px solid #ddd;
    padding-right: 18px;
    margin-right: 18px;
}

.data-label {
    display: block;

    font-family: 'IBM Plex Mono', monospace;
    font-size: 9px;
    letter-spacing: 1px;
    color: #888;

    margin-bottom: 6px;
}

.data-value {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px;
}

/* JS CHANGES */


.explorer-site {
    aspect-ratio: 1 / 1;

    background: #e2e2de;

    transition: 
        background 0.15s ease,
        transform 0.15s ease;
}

.explorer-site.occupied {
    background: #777;
}

.explorer-site.spanning {
    background: #1a1a1a;
}

/* SPANNING CURVE */

.spanning-curve {
    fill: none;
    stroke: #1a1a1a;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;

    vector-effect: non-scaling-stroke;
}

.current-probability-line {
    stroke: #aaa;
    stroke-width: 1;
    stroke-dasharray: 4 4;

    vector-effect: non-scaling-stroke;
}

.probability-marker {
    fill: #f7f7f5;
    stroke: #1a1a1a;
    stroke-width: 2;

    vector-effect: non-scaling-stroke;
}


@media (max-width: 800px) {
    .explorer-controls-inner {
        grid-template-columns: 1fr;
        
        gap: 25px;

        width: 100%;
        padding: 0 20px;
    }

    .explorer-actions {
        width: 100%;
    }

    .explorer-data {
        grid-template-columns: 1fr 1fr;
    }

    .data-item:not(:last-child) {
        border-right: none;
    }

    .explorer-status {
        font-size: 9px;
    }
}