/**
 * Solitaire Baron - Replay Viewer Styles
 *
 * Layered on top of solitaire.css. The replay container reuses the
 * .sol-game / .sol-field DOM and inherits the player's chosen theme
 * (felt color, card design, accent) via the same theme-* classes that
 * the in-game container uses. We only override what's specific to the
 * replay context: smaller cards and a compact control bar.
 */

.sol-replay {
    /* Compact card sizing — replay sits within gameover.php at small width */
    --card-w: 56px;
    --card-h: 80px;
    --card-fan-offset: 18px;
    --card-hide-offset: 5px;

    /* Wrap the replay in the existing felt; no extra background override. */
    border-radius: 8px;
    overflow: hidden;
}
/* Override .sol-game's tall min-height (sized for an in-game board). */
.sol-replay.sol-game {
    min-height: auto;
}
.sol-replay .sol-field {
    min-height: 240px;
    padding: 8px 10px;
}
.sol-replay .card {
    cursor: default;
}

/* Cards being animated by the FLIP technique — smooth movement between
 * positions instead of jumping. The transition class is added briefly
 * during animation and removed after. */
.sol-replay .card.replay-anim {
    transition: transform var(--replay-anim-ms, 380ms) cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 9999 !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.12);
    pointer-events: none;
}

/* Status / control bar above the felt */
.sol-replay-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0,0,0,0.5);
    color: #e0e0e0;
    font-size: 13px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}
.rep-counter {
    font-family: 'Courier New', monospace;
    color: #fff;
}
.rep-counter .rep-cur, .rep-counter .rep-tot { color: #ffc107; font-weight: bold; }
.rep-controls { display: flex; gap: 6px; align-items: center; }
.rep-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 14px;
    cursor: pointer;
    color: #fff;
    line-height: 1;
    min-width: 32px;
}
.rep-btn:hover { background: rgba(255,255,255,0.25); }
.rep-btn:active { background: rgba(255,255,255,0.10); }
.rep-btn.rep-play { min-width: 40px; font-size: 13px; }
.rep-speed {
    font-size: 12px;
    padding: 4px 6px;
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 4px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    margin-left: 4px;
}
.rep-speed option { background: #2a2a2a; color: #fff; }

/* Wrap the felt below the status bar so they share rounded corners */
.sol-replay.sol-game {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Top Solvers — dedicated Replay button per row, plus active-row highlight
 * applied to whichever row is currently loaded into the replay viewer. */
.ts-table tr {
    transition: background-color 0.12s ease;
}
.ts-table tr.ts-row-active {
    background-color: #eef6ee !important;
    box-shadow: inset 3px 0 0 #5d7d6f;
}
.ts-replay-btn {
    background: #1a4f33;
    color: #fff;
    border: 0;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
.ts-replay-btn:hover  { background: #2a8a55; }
.ts-replay-btn:active { background: #143d28; }

@media (max-width: 600px) {
    .sol-replay {
        --card-w: 44px;
        --card-h: 64px;
        --card-fan-offset: 14px;
    }
    .sol-replay-status { flex-direction: column; gap: 6px; align-items: stretch; }
}
