/* Distribution Explorer (/distributions). Mobile-first.
   Reuses .game-cards / .game-card from landing.css for the tile grid. */

.dist-container {
    max-width: 1100px;
    margin: 40px auto 80px;
    padding: 0 18px;
    font-family: 'Inter', system-ui, sans-serif;
    color: #1F2933;
}

.dist-header { margin-bottom: 22px; }
.dist-header h1 { margin: 0 0 8px; font-size: 1.85em; }
.dist-why {
    background: #EFF6FF;
    border-left: 3px solid #2563EB;
    border-radius: 0 8px 8px 0;
    padding: 10px 14px;
    margin: 0 0 12px;
    color: #1E3A8A;
    font-size: 0.95em;
    line-height: 1.55;
}
@media (prefers-color-scheme: dark) {
    .dist-why {
        background: rgba(37, 99, 235, 0.10);
        border-left-color: #60a5fa;
        color: #BFDBFE;
    }
}
.dist-subtitle {
    margin: 0;
    color: #4B5563;
    font-size: 0.98em;
    line-height: 1.5;
}

.dist-section-title {
    margin: 28px 0 12px;
    font-size: 1.1em;
    color: #1F2933;
    letter-spacing: -0.01em;
}

/* Tile grid uses landing's .game-cards but tightens columns */
.dist-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(170px, 100%), 1fr));
    gap: 10px;
    margin-bottom: 24px;
}

.dist-tile {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, transform 0.05s;
    color: inherit;
    text-decoration: none;
    display: block;
    font: inherit;
    width: 100%;
}
.dist-tile:hover {
    border-color: #2563EB;
    transform: translateY(-1px);
}
.dist-tile.active {
    border-color: #2563EB;
    background: #EFF6FF;
}
.dist-tile-name {
    font-weight: 600;
    font-size: 0.98em;
    color: #1F2933;
    margin-bottom: 2px;
}
.dist-tile-kind {
    font-size: 0.74em;
    /* WCAG fix: #6B7280 on white = 4.44:1, fails 4.5. Use #4B5563 = 7.0:1. */
    color: #4B5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Explorer panel */
.dist-explorer {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 14px;
    padding: 20px;
    margin-top: 8px;
}

.dist-explorer-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 4px;
}
.dist-explorer-title {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
    color: #1F2933;
}
.dist-explorer-kind {
    font-size: 0.78em;
    /* WCAG fix: #6B7280 on #F3F4F6 = 4.39:1, fails 4.5. Use #4B5563 = 6.5:1. */
    color: #4B5563;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 2px 8px;
    background: #F3F4F6;
    border-radius: 6px;
}
.dist-explorer-tutorial-link {
    margin-left: auto;
    font-size: 0.9em;
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
}
.dist-explorer-tutorial-link:hover { text-decoration: underline; }

.dist-explorer-blurb {
    margin: 6px 0 14px;
    color: #4B5563;
    font-size: 0.92em;
    line-height: 1.45;
}

.dist-formula {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 0.95em;
    overflow-x: auto;
}
.dist-formula-label {
    display: block;
    font-size: 0.74em;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
}

/* Formula explainer — plain-language slider hint below the KaTeX */
.dist-formula-explain {
    margin: 10px 0 0;
    font-size: 0.88em;
    color: var(--text-secondary, #4B5563);
    line-height: 1.5;
    border-top: 1px solid var(--border, #E5E7EB);
    padding-top: 8px;
}

/* Quant use-cases panel */
.dist-use-cases {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px 14px;
    margin: 0 0 16px;
    font-size: 0.88em;
    line-height: 1.5;
}
.dist-use-cases-label {
    display: block;
    font-size: 0.74em;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 6px;
    font-weight: 600;
}
.dist-use-cases ul {
    margin: 0;
    padding-left: 18px;
    color: #1F2933;
}
.dist-use-cases ul li { margin-bottom: 3px; }

/* Sliders */
.dist-sliders {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 8px 0 18px;
}
.dist-slider-row {
    display: grid;
    grid-template-columns: minmax(80px, 1fr) 2fr minmax(56px, auto);
    align-items: center;
    gap: 12px;
}
.dist-slider-label {
    font-weight: 600;
    color: #1F2933;
    font-size: 0.92em;
}
.dist-slider-row input[type="range"] {
    width: 100%;
    accent-color: #2563EB;
}
.dist-slider-value {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: #2563EB;
    font-weight: 600;
    font-size: 0.92em;
    min-width: 56px;
}

/* Summary stats */
.dist-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    margin: 6px 0 18px;
}
.dist-stat-cell {
    background: #F9FAFB;
    border-radius: 8px;
    padding: 8px 10px;
}
.dist-stat-label {
    font-size: 0.72em;
    color: #6B7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dist-stat-value {
    font-size: 1.05em;
    font-weight: 700;
    color: #1F2933;
    font-variant-numeric: tabular-nums;
}

/* Charts */
.dist-charts {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}
.dist-chart-wrap {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 12px 12px 6px;
    /* Overflow fix: prevents chart wrap from pushing auth-bar to 365px on 320px screens */
    min-width: 0;
    overflow-x: auto;
}
.dist-chart-title {
    margin: 0 0 6px;
    font-size: 0.84em;
    font-weight: 600;
    color: #1F2933;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.dist-chart-subtitle {
    font-weight: 400;
    font-size: 0.9em;
    text-transform: none;
    letter-spacing: 0;
    color: #6B7280;
}
.dist-chart-canvas-box {
    position: relative;
    height: 260px;
}

.dist-footer {
    margin-top: 28px;
    padding-top: 14px;
    border-top: 1px solid #E5E7EB;
    font-size: 0.9em;
}
.dist-footer a {
    color: #2563EB;
    text-decoration: none;
    font-weight: 600;
}
.dist-footer a:hover { text-decoration: underline; }

@media (min-width: 720px) {
    .dist-charts { grid-template-columns: 1fr 1fr; }
    .dist-sliders { grid-template-columns: 1fr 1fr; padding-right: 110px; }
}

@media (prefers-color-scheme: dark) {
    .dist-container { color: #f1f5f9; }
    .dist-header h1 { color: #f1f5f9; }
    .dist-subtitle, .dist-explorer-blurb { color: #cbd5e1; }
    .dist-section-title { color: #f1f5f9; }
    .dist-tile {
        background: #0f172a;
        border-color: #1e293b;
    }
    .dist-tile:hover { border-color: #60a5fa; }
    .dist-tile.active {
        background: #1e3a8a;
        border-color: #60a5fa;
    }
    .dist-tile-name { color: #f1f5f9; }
    /* WCAG fix: #94a3b8 on active-tile bg #1e3a8a = 4.04:1 fails 4.5:1.
       #cbd5e1 on #1e3a8a = 8.15:1, passes AA. */
    .dist-tile-kind { color: #cbd5e1; }
    .dist-explorer {
        background: #0f172a;
        border-color: #1e293b;
    }
    .dist-explorer-title { color: #f1f5f9; }
    .dist-explorer-kind {
        background: #1e293b;
        color: #94a3b8;
    }
    .dist-explorer-tutorial-link { color: #60a5fa; }
    .dist-formula {
        background: #0b1220;
        border-color: #334155;
        color: #e2e8f0;
    }
    .dist-formula-label { color: #94a3b8; }
    .dist-formula-explain { color: #94a3b8; border-top-color: #334155; }
    .dist-use-cases {
        background: #0b1220;
        border-color: #334155;
    }
    .dist-use-cases-label { color: #94a3b8; }
    .dist-use-cases ul { color: #e2e8f0; }
    .dist-slider-label { color: #f1f5f9; }
    .dist-slider-value { color: #60a5fa; }
    .dist-stat-cell {
        background: #0b1220;
    }
    .dist-stat-label { color: #94a3b8; }
    .dist-stat-value { color: #f1f5f9; }
    .dist-chart-wrap {
        background: #0f172a;
        border-color: #1e293b;
    }
    .dist-chart-title { color: #cbd5e1; }
    .dist-footer { border-top-color: #334155; }
    .dist-footer a { color: #60a5fa; }
}
