body.bp-replay-mode #import-modal,
body.bp-replay-mode #show-import-modal,
body.bp-replay-mode #export-pool {
    display: none !important;
}

/* 有效回放文件接管 OB 后隐藏实时观赛入口；选手状态顶栏保留为回放标识。 */
body.online-observer-mode.bp-replay-file-ready #online-role-gate,
body.online-observer-mode.bp-replay-mode #online-role-gate {
    display: none !important;
}

/*
 * 回放与普通离线导入复用同一份初始快照投影。模式样式可以在尚未生成角色池时
 * 隐藏容器，但回放接管快照后必须显示只读角色池，不能直接跳到首个BAN/PICK结果。
 */
body.bp-replay-mode #character-pool-container {
    display: block !important;
    opacity: 0.85;
}

body.bp-replay-mode #character-pool-container.character-pool > .character-pool-header {
    display: flex !important;
}

/* A/S共用列式标记；普通OB回放沿用观赛底栏，不恢复离线池操作行。 */
html:is([data-bp-theme-column-view="ob"], [data-bp-theme-g-view="ob"]) body.bp-replay-mode :is(#generate-pool-60-small, #generate-pool-75-small, #export-bp-btn, #import-bp-btn, #character-pool-container.character-pool > .character-pool-header) {
    display: none !important;
}

#bp-replay-modal {
    position: fixed;
    bottom: 80px;
    left: 50%;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px;
    background: rgba(12, 18, 30, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transform: translateX(-50%);
    cursor: move;
    user-select: none;
}

#bp-replay-modal.playing-mode {
    right: 12px;
    bottom: 12px;
    left: auto;
    transform: none;
    box-sizing: border-box;
    width: 244px;
    max-width: calc(100vw - 24px);
    gap: 4px;
    padding: 6px 8px;
}

#bp-replay-file-input {
    display: none;
}

#bp-replay-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 4px;
}

.bp-replay-speed {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 11px;
}

.bp-replay-speed select {
    width: 86px;
    height: 28px;
    padding: 0 5px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.04);
    color: #cbd5e1;
    font: inherit;
    cursor: pointer;
}

.bp-replay-speed > span {
    display: none;
}

.bp-replay-speed option {
    background: #1f2937;
    color: #e5e7eb;
}

.bp-replay-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    padding: 0;
    color: #aeb8c7;
    font-size: 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    box-shadow: none;
    transition: background-color 0.15s, color 0.15s;
    cursor: pointer;
}

.bp-replay-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.09);
    color: #f3f4f6;
}

.bp-replay-play {
    font-size: 14px;
}

.bp-replay-play.playing {
    color: #e5e7eb;
}

.bp-replay-btn:focus-visible,
.bp-replay-speed select:focus-visible {
    outline: 1px solid #cbd5e1;
    outline-offset: 2px;
}

.bp-replay-btn:disabled,
.bp-replay-speed select:disabled {
    opacity: 0.35;
    cursor: default;
}

#replay-progress {
    color: #9ca3af;
    font-size: 11px;
    line-height: 1.4;
    font-variant-numeric: tabular-nums;
}

#replay-text {
    max-width: 100%;
    margin: 0;
    color: #aeb8c7;
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
    overflow-wrap: anywhere;
}

#replay-text:empty {
    display: none;
}

/* 触屏只扩大热区，不增大图标、不使用醒目按钮底色。 */
@media (pointer: coarse) {
    #bp-replay-modal.playing-mode { width: 296px; }
    .bp-replay-btn { flex-basis: 44px; width: 44px; height: 44px; }
    .bp-replay-speed select { height: 44px; }
}

.bp-replay-summary {
    width: min(320px, calc(100vw - 48px));
    color: #e5edf8;
    cursor: default;
}

.bp-replay-summary h3 {
    margin: 0 0 10px;
    color: #f8fafc;
    font-size: 15px;
}

.bp-replay-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.bp-replay-summary-grid div {
    min-width: 0;
    padding: 7px 8px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.42);
}

.bp-replay-summary-grid span,
.bp-replay-summary-grid strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bp-replay-summary-grid span {
    margin-bottom: 3px;
    color: #94a3b8;
    font-size: 10px;
}

.bp-replay-summary-grid strong {
    color: #f8fafc;
    font-size: 12px;
}

.bp-replay-summary-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

.bp-replay-summary-actions button {
    padding: 7px 10px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 7px;
    background: rgba(51, 65, 85, 0.75);
    color: #e5edf8;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.bp-replay-summary-actions .bp-replay-summary-start {
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.1);
    color: #f3f4f6;
}

body.online-observer-mode.bp-replay-mode #timer {
    pointer-events: none;
    white-space: nowrap;
    background-color: rgba(31, 41, 55, 0.95);
    color: #ffd700;
    font-style: normal;
    font-variant-numeric: tabular-nums;
    transition-property: background-color, color;
}

body.online-observer-mode.bp-replay-mode #timer[data-replay-clock-state="paused"] {
    font-style: italic;
}

body.online-observer-mode.bp-replay-mode #timer:hover {
    background-color: rgba(31, 41, 55, 0.95);
}

/* 普通回放统一禁止本地盘面编辑； */
html body.bp-replay-mode :is(.character-grid, .slot, .confirm-btn, .swap-btn, .team-mode-btn, [data-action="generate-pool"], #generate-pool, #export-pool, #show-import-modal, #view-toggle, #peak-mode-btn, #third-ban-mode-btn, .generate-pool-btn, .generate-pool-btn-small) {
    pointer-events: none !important;
}
