/* ═══════════════════════════════════════════════════════════
   REPLAY CONTROL BAR
   ═══════════════════════════════════════════════════════════ */

.replay-bar {
    position: absolute;
    bottom: 10px;          /* sits above chart bottom */
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: none;
    align-items: center;
    gap: 6px;
    background: var(--ui-panel);
    border: 1px solid var(--ui-primary, #2962ff);
    border-radius: 10px;
    padding: 5px 10px;
    box-shadow: 0 4px 24px rgba(41,98,255,0.28), 0 2px 8px rgba(0,0,0,0.35);
    user-select: none;
    white-space: nowrap;
}

.replay-bar.rb-visible {
    display: flex;
    animation: rb-slide-up 0.2s ease;
}

@keyframes rb-slide-up {
    from { opacity: 0; transform: translateX(-50%) translateY(8px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Generic replay button */
.rb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 28px;
    min-width: 28px;
    padding: 0 6px;
    background: var(--ui-button);
    border: 1px solid var(--ui-panel-border);
    border-radius: 6px;
    color: var(--ui-fg);
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.12s ease, border-color 0.12s ease;
    flex-shrink: 0;
}

.rb-btn:hover {
    background: var(--ui-button-hover);
    border-color: var(--ui-primary, #2962ff);
}

/* Play button – accent color */
.rb-play {
    background: var(--ui-primary, #2962ff);
    border-color: var(--ui-primary, #2962ff);
    color: #fff;
    min-width: 34px;
}

.rb-play:hover {
    background: var(--ui-primary, #2962ff);
    opacity: 0.9;
}

/* Exit button */
.rb-exit {
    border-color: rgba(239,68,68,0.5);
    color: #ef4444;
}

.rb-exit:hover {
    background: rgba(239,68,68,0.12);
    border-color: #ef4444;
}

/* Speed button */
.rb-speed {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 8px;
    background: var(--ui-button);
    border: 1px solid var(--ui-panel-border);
    border-radius: 6px;
    color: var(--ui-primary, #2962ff);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.12s ease;
    flex-shrink: 0;
}

.rb-speed:hover {
    background: var(--ui-button-hover);
}

/* Progress bar */
.rb-progress {
    width: 120px;
    height: 4px;
    background: var(--ui-button-hover);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.rb-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #1d4ed8, #3b82f6);
    border-radius: 2px;
    transition: width 0.15s linear;
}

/* Candle counter label */
.rb-label {
    font-size: 11px;
    color: var(--ui-muted);
    min-width: 60px;
    text-align: center;
    flex-shrink: 0;
}

/* Icon-only for Alert and Replay on small screens */
@media (max-width: 992px) {
    #replayBtn span { display: none; }
}

@media (max-width: 768px) {
    #replayBtn span { display: none; }

    .replay-bar {
        bottom: 10px;
        gap: 4px;
        padding: 4px 8px;
    }
    .rb-progress { width: 60px; }
    .rb-label    { display: none; }
}

/* Small Mobile — show text labels on row 2 */
@media (max-width: 480px) {
    .topbar-group-primary #replayBtn {
        flex-shrink: 0;
        height: 36px;
        display: flex;
        align-items: center;
    }
    #replayBtn span { display: inline; }
}
