.replay-analysis {
    margin-top: 18px;
    padding-top: 4px;
    border-top: 1px solid #89552b;
}

.replay-analysis h3 {
    margin: 16px 0 12px;
    font-size: 14px;
}

.replay-map {
    display: block;
    width: auto;
    max-width: min(100%, 512px);
    max-height: 512px;
    height: auto;
    box-sizing: border-box;
    background: #15100b;
    border: 1px solid #89552b;
}

.replay-map-legend {
    margin: 10px 0 20px;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    font-size: 12px;
}

.replay-map-legend li,
.replay-chart-players label {
    overflow-wrap: anywhere;
}

.replay-analysis-note,
.replay-chart-readout,
.replay-chart-time {
    color: #e7bd8f;
    font-size: 12px;
    line-height: 1.5;
}

.replay-analysis .pm-folders button {
    border: 0;
    border-radius: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.replay-chart-players {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    font-size: 12px;
}

.replay-chart-players legend {
    margin-bottom: 6px;
}

.replay-chart-players label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-weight: normal;
}

.replay-chart-players input[type="checkbox"] {
    width: 13px;
    height: 13px;
    margin: 0;
}

.replay-activity-chart {
    display: block;
    width: 100%;
    height: auto;
    background: #422303;
    border: 1px solid #89552b;
    box-sizing: border-box;
}

.replay-chart-axis {
    fill: #e7bd8f;
    font-size: 12px;
}

.replay-chart-grid {
    stroke: #89552b;
    stroke-width: .5;
}

.replay-chart-cursor {
    stroke: #fff;
    stroke-opacity: .6;
    stroke-dasharray: 4 4;
}

.replay-chart-time {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 6px;
    font-weight: normal;
}

.replay-chart-time input {
    flex: 1;
    min-width: 0;
    width: auto;
    accent-color: #ffb000;
}

.replay-chart-readout {
    display: block;
    min-height: 36px;
    overflow-wrap: anywhere;
}

.replay-analysis [hidden] {
    display: none;
}


.replay-build-order-player {
    width: 320px;
    max-width: 100%;
}

.replay-build-order-log {
    max-height: 480px;
    overflow: auto;
}

.replay-build-order-log:focus-visible {
    outline: 1px solid #ffc18a;
    outline-offset: 2px;
}

.replay-build-order-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    text-align: left;
    padding: 7px 6px;
}

.replay-build-order-table th:nth-child(1) {
    width: 86px;
}

.replay-build-order-table th:nth-child(2) {
    width: 96px;
}

.replay-build-order-table th:nth-child(3) {
    width: auto;
}

.replay-build-order-table td:nth-child(1) {
    color: #e7bd8f;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.replay-build-time,
.replay-build-selection {
    display: block;
    margin: 6px 0 10px;
    color: #e7bd8f;
    font-size: 12px;
    line-height: 1.5;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.replay-build-selection {
    min-height: 36px;
}

.replay-build-timeline {
    --build-label-width: 148px;
    max-height: 440px;
    overflow: auto;
    overscroll-behavior-x: contain;
    border: 1px solid #89552b;
    background: #422303;
    scrollbar-color: #a36a36 #422303;
}

.replay-build-timeline:focus-visible {
    outline: 1px solid #ffc18a;
    outline-offset: 2px;
}

.replay-build-tracks {
    position: relative;
    width: calc(var(--build-label-width) + var(--build-plot-width) + 40px);
    isolation: isolate;
}

.replay-build-track {
    display: grid;
    grid-template-columns: var(--build-label-width) 1fr;
    height: 54px;
    border-bottom: 1px solid #71451f;
}

.replay-build-track-label {
    position: sticky;
    left: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
    box-sizing: border-box;
    min-width: 0;
    padding: 5px 7px;
    background: #422303;
    border-right: 1px solid #89552b;
    color: #fff;
    font-size: 12px;
    font-weight: normal;
}

.replay-build-object {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.replay-build-object small {
    display: block;
    margin-top: 3px;
    color: #e7bd8f;
    font-size: 10px;
}

.replay-build-track-header {
    position: sticky;
    top: 0;
    z-index: 3;
    height: 34px;
    background: #422303;
}

.replay-build-track-axis,
.replay-build-track-plot {
    position: relative;
    box-sizing: content-box;
    width: var(--build-plot-width);
    margin: 0 20px;
}

.replay-build-track-plot {
    background: repeating-linear-gradient(to right, #89552b66 0 1px, transparent 1px 40px);
}

.replay-build-tick {
    position: absolute;
    top: 9px;
    transform: translateX(-50%);
    color: #e7bd8f;
    font-size: 11px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.replay-build-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    color: #ffc18a;
    font-size: 23px;
    line-height: 1;
}

.replay-build-icon img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.replay-build-event {
    position: absolute;
    top: 8px;
    transform: translateX(-50%);
    width: 36px;
    height: 36px;
    padding: 1px;
    border: 1px solid #a36a36;
    border-radius: 3px;
    background: #291600;
    font: inherit;
    cursor: pointer;
}

.replay-build-event:hover,
.replay-build-event.is-selected {
    border-color: #ffb000;
    background: #763b12;
}

.replay-build-event:focus-visible {
    outline: 2px solid #ffc18a;
    outline-offset: 2px;
}

.replay-build-count {
    position: absolute;
    right: -4px;
    top: -6px;
    min-width: 12px;
    padding: 1px 3px;
    border-radius: 3px;
    background: #763b12;
    color: #fff;
    font-size: 10px;
    line-height: 13px;
}

.replay-build-cursor {
    position: absolute;
    z-index: 1;
    top: 34px;
    bottom: 0;
    left: calc(var(--build-label-width) + 20px);
    border-left: 1px dashed #ffc18a;
    pointer-events: none;
}

@media (max-width: 480px) {
    .replay-build-timeline {
        --build-label-width: 120px;
    }

    .replay-build-track-label {
        gap: 4px;
        padding-inline: 4px;
        font-size: 11px;
    }
}
