/* Extracted from pages/stack.html */
.stack-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

/* Stack visualization */
#stack-vis {
    border: 2px solid var(--border);
    padding: 1.5rem;
    min-height: 300px;
    position: relative;
    overflow: hidden;
}

.stack-vis-inner {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 280px;
}

.stack-block {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    transition: all 0.3s;
    cursor: default;
    position: relative;
    min-width: 40px;
    border-top: 2px solid var(--border);
}
.stack-block:hover { opacity: 0.8; }

.stack-block-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-faint);
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    padding: 0.5rem 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    max-height: 100px;
    text-overflow: ellipsis;
}

.stack-block-score {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-faint);
    padding-bottom: 0.4rem;
}

/* Phase indicator */
.phase-banner {
    border: 2px solid var(--border);
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.phase-banner.pandemonium { border-color: var(--kill); }
.phase-name-big {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
}
.phase-name-big.kill { color: var(--kill); }
.phase-detail { font-size: 0.82rem; color: var(--text-dim); max-width: 400px; }

/* Metrics row */
.metrics-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 2px solid var(--border);
    border-top: none;
    margin-bottom: 1.5rem;
}
.metric-cell {
    padding: 1rem;
    text-align: center;
    border-right: 2px solid var(--border);
}
.metric-cell:last-child { border-right: none; }
.metric-val {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.5rem;
    display: block;
}
.metric-val.kill { color: var(--kill); }
.metric-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-faint);
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-faint);
}
.empty-state h2 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.empty-state p { font-size: 0.88rem; }

/* Phase legend */
.phase-legend {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    border: 2px solid var(--border);
    margin-top: 1.5rem;
}
.legend-cell {
    padding: 0.75rem 1rem;
    border-right: 2px solid var(--border);
}
.legend-cell:last-child { border-right: none; }
.legend-phase { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-faint); margin-bottom: 0.25rem; }
.legend-range { font-family: var(--font-mono); font-size: 0.75rem; }
.legend-desc { font-size: 0.72rem; color: var(--text-faint); margin-top: 0.2rem; }

@media (max-width: 600px) {
    .metrics-row { grid-template-columns: 1fr 1fr; }
    .metric-cell:nth-child(2) { border-right: none; }
    .metric-cell:nth-child(3) { border-top: 2px solid var(--border); }
    .metric-cell:nth-child(4) { border-top: 2px solid var(--border); border-right: none; }
    .phase-legend { grid-template-columns: 1fr 1fr; }
    .legend-cell:nth-child(2n) { border-right: none; }
    .legend-cell:nth-child(3), .legend-cell:nth-child(4) { border-top: 2px solid var(--border); }
}
