/* ============================================================
   Combat replay player + combat log styles.
   Source of truth: Starborne.Shared.CombatReplay\combat-replay.css.
   Copied into each host's wwwroot/css at build time (see the
   CopyCombatReplayCss target in the WebAdmin / Codex
   csproj files). Do not edit the copied file directly.
   ============================================================ */

.skill-owner {
    font-weight: bold;
}

.team-one, .team-one span {
    color: var(--rz-info-dark) !important;
}

.team-two, .team-two span {
    color: var(--rz-danger-darker) !important;
}

.skill-name {
    overflow-wrap: anywhere;
    font-weight: bold;
    display: block;
    line-height: 1.1;
}

.skill-def-raw {
    display: block;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.72rem;
    color: var(--rz-text-disabled-color, #6c757d);
    word-break: break-all;
    cursor: pointer;
    line-height: 1.1;
    margin-top: 0.15rem;
}

.skill-def-raw:hover {
    color: var(--rz-info) !important;
}

.combat-log-card {
    margin-bottom: 1rem;
}

.combat-log-card-left {
    border: 1px solid var(--rz-info-darker);
}

.combat-log-card-right {
    border: 1px solid var(--rz-danger-darker);
}

.unit-name, .skill-name {
    font-weight: bold;
    font-size: 1.15rem;
    cursor: pointer;
    transition: color 0.2s ease-in-out, background-color 0.2s ease-in-out;
    padding: 0.1rem 0.2rem;
    margin: -0.1rem -0.2rem 0.1rem -0.2rem;
    border-radius: 3px;
}

.tag {
    background-color: var(--rz-secondary-lighter);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-right: 0.4rem;
    margin-bottom: 0.2rem;
    display: inline-block;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
    color: var(--rz-text-secondary-color, #6c757d);
}

.team-one:hover {
    background-color: var(--rz-info-darker);
    color: var(--rz-on-info-darker) !important;
}

.team-two:hover {
    background-color: var(--rz-danger-darker);
    color: var(--rz-on-danger-darker) !important;
}

.skill-name:hover,
.unit-id:hover,
.skill-id:hover {
    color: var(--rz-on-base) !important;
    background-color: var(--rz-base);
}

.tag:hover {
    background-color: var(--rz-secondary);
    color: var(--rz-info);
}

.unit-name.team-left:hover,
.unit-name.team-right:hover {
    color: var(--rz-info);
}

.calculation-details-table {
    font-size: 0.9em;
}

.intermediate-summary {
    color: var(--rz-text-disabled-color);
}

.skill-definition-id {
    font-weight: 600; /* Slightly bolder than normal bold maybe */
    cursor: pointer;
    transition: color 0.2s ease-in-out;
}

.skill-definition-id:hover, .localization-hint:hover {
    color: var(--rz-info) !important;
    cursor: pointer;
}

.skill-definition-id {
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    /* Allow breaking long definition IDs */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-all; /* More aggressive break for IDs */
    flex-shrink: 1; /* Allow shrinking if needed, but prioritize */
    /* margin-right: 0.5rem; */ /* Replaced by gap */
}

.skill-definition-id:hover {
    color: var(--rz-info) !important;
}

.unit-name {
    font-weight: bold; /* Make unit name stand out */
    cursor: pointer;
    transition: color 0.2s ease-in-out;
    flex-shrink: 0; /* Don't shrink unit name */
    /* padding: 0.1rem 0.2rem; */ /* Optional padding for visual separation */
    /* margin: -0.1rem -0.2rem; */
}

.unit-name:hover {
    /* Optional: Override team color on hover for consistency */
    /* color: var(--rz-info); */
    filter: brightness(1.2); /* Or just brighten */
}

.effect-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.25rem 0.4rem;
    line-height: 1.4;
}

.effect-line .skill-definition-id {
    font-size: 0.92rem;
}

.effect-meta {
    font-size: 0.82rem;
    color: var(--rz-text-secondary-color, #6c757d);
}

/* ── Effect-centric ability result cards (skill -> affected units) ── */
.ability-effects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.effect-card {
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.28));
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    background-color: var(--rz-card-background-color, var(--rz-base-background-color, #fafafa));
}

.effect-card-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}

.effect-card-title {
    font-weight: 600;
}

.effect-card-units {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

/* Lightweight ability section (no nested box) */
.ability-section {
    margin-top: 1rem;
}

.ability-section-head {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--rz-text-secondary-color, #6c757d);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding-bottom: 0.25rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.25));
}

.replay-resolved-head {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

/* Unit portrait chip (team-coloured border: blue = left, red = right) */
.unit-portrait-chip {
    width: 30px;
    height: 30px;
    border-radius: 5px;
    object-fit: cover;
    border: 2px solid var(--rz-info, #2196f3);
    background: var(--rz-base-200, rgba(127, 127, 127, 0.15));
    cursor: default;
}

.unit-portrait-chip.team-two {
    border-color: var(--rz-danger, #e53935);
}

/* Skill card header */
.skill-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--rz-border-color, var(--rz-base-lighter));
    line-height: 1.4;
}

.skill-card-owner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.skill-card-arrow {
    color: var(--rz-text-secondary-color, #6c757d);
}

.skill-card-skill {
    margin-left: auto;
    text-align: right;
    min-width: 0;
}

.skill-card-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: flex-end;
    margin: 0.2rem 0;
}

/* ── Experimental combat replay player ────────────────────── */
.replay-player {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 100%;
    overflow-x: clip;
}

/* Reserve scroll room below the detail panel so stepping between skills of
   different heights doesn't make the page jump around. */
.replay-bottom-spacer {
    height: 75vh;
    flex: none;
}

.replay-main {
    display: grid;
    grid-template-columns: minmax(380px, 1fr) minmax(420px, 1.2fr);
    gap: 1rem;
    align-items: start;
    max-width: 100%;
}

@media (max-width: 1100px) {
    .replay-main {
        grid-template-columns: minmax(0, 1fr);
    }
}

.replay-board-col {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.replay-topbar {
    position: sticky;
    /* Stack below the sticky app nav (measured into --main-header-height by js.js)
       so the whole topbar stays visible, not just its bottom rows. */
    top: var(--main-header-height, 0px);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.6rem 0.7rem;
    margin-bottom: 0.75rem;
    background: var(--rz-base-background-color, #fff);
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.28));
    border-radius: 6px;
}

.replay-turnorder {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.2rem;
    min-width: 0;
    max-width: 100%;
    padding: 0.35rem 0;
    margin-bottom: 0.5rem;
}

.replay-turnorder-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0.4rem 0;
}

.replay-turnorder-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rz-text-secondary-color, #6c757d);
    white-space: nowrap;
    flex: none;
}

.replay-turn-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    flex: none;
    cursor: pointer;
}

.replay-turn-num {
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--rz-text-secondary-color, #6c757d);
    line-height: 1;
}

.replay-turn-num-past {
    opacity: 0.5;
}

.replay-turn-cell-current .replay-turn-num {
    color: var(--rz-warning, #ffb300);
    font-weight: 700;
}

.replay-turnorder-ellipsis {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--rz-text-secondary-color, #6c757d);
    flex: none;
    padding: 0 0.15rem;
}

.replay-turn-portrait {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex: none;
    border: 2px solid var(--rz-info, #2196f3);
    cursor: pointer;
    opacity: 0.85;
    transition: opacity 0.15s ease-in-out, transform 0.15s ease-in-out;
}

.replay-turn-portrait.team-two {
    border-color: var(--rz-danger, #e53935);
}

.replay-turn-portrait:hover {
    opacity: 1;
}

.replay-turn-portrait.replay-turn-past {
    opacity: 0.4;
    filter: grayscale(0.6);
}

.replay-turn-portrait.replay-turn-past:hover {
    opacity: 0.8;
    filter: grayscale(0);
}

.replay-turn-portrait.replay-turn-current {
    opacity: 1;
    filter: none;
    box-shadow: 0 0 0 2px var(--rz-warning, #ffb300);
    transform: scale(1.15);
    margin: 0 0.25rem;
}

.replay-turn-portrait.replay-turn-selected {
    outline: 2px dashed #fff;
    outline-offset: 1px;
}

.replay-board-toolbar {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-bottom: 0.4rem;
}

.replay-zoom-label {
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color, #6c757d);
    min-width: 2.5rem;
}

.replay-board-scale {
    position: relative;
    margin: 0 auto;
}

.replay-board-wrap {
    overflow: auto;
    max-width: 100%;
    background: radial-gradient(circle at 30% 20%, #20242e, #11131a);
    border: 1px solid var(--rz-base-300, #333);
    border-radius: 8px;
    padding: 1rem;
}

.replay-board {
    position: relative;
    margin: 0 auto;
}

/* Target lines from the actor to its targets on the current step */
.replay-lines {
    position: absolute;
    left: 0;
    top: 0;
    pointer-events: none;
    overflow: visible;
    z-index: 0;
}

.replay-line-foe,
.replay-line-ally {
    stroke-width: 2;
    opacity: 0.55;
    stroke-dasharray: 5 4;
    animation: replayDash 0.6s linear infinite;
}

.replay-line-foe {
    stroke: var(--rz-danger, #e53935);
}

.replay-line-ally {
    stroke: var(--rz-success, #43a047);
}

.replay-line-foe-dot {
    fill: var(--rz-danger, #e53935);
    opacity: 0.7;
}

.replay-line-ally-dot {
    fill: var(--rz-success, #43a047);
    opacity: 0.7;
}

@keyframes replayDash {
    to {
        stroke-dashoffset: -18;
    }
}

/* Damage / heal flash when stepping onto an action (tile is re-keyed per step) */
.replay-token-damage .replay-unit-card {
    animation: replayFlashDamage 0.7s ease-out;
}

.replay-token-heal .replay-unit-card {
    animation: replayFlashHeal 0.7s ease-out;
}

@keyframes replayFlashDamage {
    0% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
    25% { box-shadow: 0 0 16px 4px rgba(229, 57, 53, 0.95); }
    100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
}

@keyframes replayFlashHeal {
    0% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
    25% { box-shadow: 0 0 16px 4px rgba(67, 160, 71, 0.95); }
    100% { box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5); }
}

.replay-hex {
    position: absolute;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.05);
    clip-path: polygon(25% 5%, 75% 5%, 100% 50%, 75% 95%, 25% 95%, 0 50%);
}

/* Each unit is a token: a team-tinted hex tile with a neutral info card resting on it. */
.replay-token {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.replay-platform {
    position: absolute;
    inset: 4px;
    clip-path: polygon(25% 4%, 75% 4%, 100% 50%, 75% 96%, 25% 96%, 0 50%);
    transition: filter 0.15s ease-in-out;
}

.replay-token.team-one .replay-platform {
    background: radial-gradient(ellipse at center, rgba(33, 150, 243, 0.42), rgba(33, 150, 243, 0.14));
    filter: drop-shadow(0 0 2px rgba(33, 150, 243, 0.9));
}

.replay-token.team-two .replay-platform {
    background: radial-gradient(ellipse at center, rgba(229, 57, 53, 0.42), rgba(229, 57, 53, 0.14));
    filter: drop-shadow(0 0 2px rgba(229, 57, 53, 0.9));
}

.replay-token-actor .replay-platform {
    filter: drop-shadow(0 0 7px var(--rz-warning, #ffb300)) drop-shadow(0 0 2px var(--rz-warning, #ffb300));
}

.replay-token-selected .replay-platform {
    filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 2px #fff);
}

.replay-token-dead {
    opacity: 0.4;
    filter: grayscale(1);
}

.replay-dying-icon {
    color: var(--rz-danger, #e53935);
    font-size: 14px;
    margin-left: auto;
    animation: replayDyingPulse 1s ease-in-out infinite;
}

@keyframes replayDyingPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.replay-unit-card {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 3px 5px;
    border-radius: 7px;
    background: rgba(16, 19, 26, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.replay-token-actor .replay-unit-card {
    border-color: var(--rz-warning, #ffb300);
}

.replay-unit-head {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #fff;
    line-height: 1.1;
}

.replay-unit-portrait {
    width: 26px;
    height: 26px;
    border-radius: 4px;
    object-fit: cover;
    flex: none;
    background: rgba(255, 255, 255, 0.06);
    border: 1.5px solid var(--rz-info, #2196f3);
}

.replay-unit-portrait.team-two {
    border-color: var(--rz-danger, #e53935);
}

.replay-step-meta-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.replay-actor-portrait {
    width: 34px;
    height: 34px;
    border-radius: 5px;
    object-fit: cover;
    flex: none;
    background: rgba(0, 0, 0, 0.1);
    border: 2px solid var(--rz-info, #2196f3);
}

.replay-actor-portrait.team-two {
    border-color: var(--rz-danger, #e53935);
}

.replay-token-selected .replay-unit-card {
    border-color: #fff;
}

.replay-selected {
    margin: 0.75rem 0;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.28));
    border-radius: 6px;
    background: var(--rz-card-background-color, var(--rz-base-background-color));
}

.replay-selected-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.replay-selected-effects {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.replay-selected-effect {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.28));
    border-radius: 5px;
}

.replay-selected-effect-name {
    font-weight: 600;
    font-size: 0.85rem;
}

/* C# inspector */
.replay-script-hint {
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color, #6c757d);
    margin-bottom: 0.5rem;
}

.replay-script-hint code {
    background: var(--rz-base-background-color, rgba(127, 127, 127, 0.15));
    border-radius: 3px;
    padding: 0 0.25rem;
}

.replay-script-input {
    width: 100%;
    font-family: 'Consolas', monospace;
    font-size: 0.85rem;
    padding: 0.5rem;
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.35));
    border-radius: 4px;
    background: var(--rz-base-background-color, transparent);
    color: inherit;
    resize: vertical;
}

.replay-script-input-invalid {
    border-color: var(--rz-danger, #e53935);
}

.replay-script-diagnostics {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
}

.replay-script-diagnostics li {
    display: flex;
    align-items: flex-start;
    gap: 0.3rem;
    padding: 0.1rem 0;
}

.replay-script-diag-error {
    color: var(--rz-danger, #e53935);
}

.replay-script-diag-warning {
    color: var(--rz-warning, #f0ad4e);
}

.replay-script-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.5rem 0;
    flex-wrap: wrap;
}

.replay-script-saved {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.replay-script-select,
.replay-script-name {
    font-size: 0.82rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.35));
    border-radius: 4px;
    background: var(--rz-base-background-color, transparent);
    color: inherit;
}

.replay-script-name {
    width: 9rem;
}

.replay-script-output {
    font-family: 'Consolas', monospace;
    font-size: 0.82rem;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 320px;
    overflow: auto;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    background: var(--rz-base-background-color, rgba(127, 127, 127, 0.1));
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.35));
    margin: 0;
}

.replay-script-error {
    color: var(--rz-danger, #e53935);
    border-color: var(--rz-danger, #e53935);
}

.replay-fieldset-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

/* Fullscreen overlay for the unit-state table */
.replay-fullscreen-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: flex;
    flex-direction: column;
    background: var(--rz-base-background-color, #1a1d24);
    padding: 1rem;
}

.replay-fullscreen-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.35));
}

.replay-fullscreen-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.replay-fullscreen-body {
    flex: 1;
    overflow: auto;
}

.replay-fullscreen-body .replay-attr-table {
    font-size: 0.85rem;
    white-space: nowrap;
}

.replay-unit-char {
    font-weight: 700;
    font-family: 'Consolas', monospace;
    font-size: 0.8rem;
    color: var(--rz-warning, #ffb300);
}

.replay-unit-name {
    font-size: 0.72rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.replay-bar {
    position: relative;
    height: 11px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.replay-bar-fill {
    position: absolute;
    inset: 0 auto 0 0;
    height: 100%;
}

.replay-bar-shield .replay-bar-fill {
    background-color: var(--rz-info, #2196f3);
}

.replay-bar-label {
    position: relative;
    z-index: 1;
    display: block;
    text-align: center;
    font-size: 0.6rem;
    line-height: 11px;
    color: #fff;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.8);
}

.replay-unit-status {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.replay-status-icon {
    position: relative;
    display: inline-flex;
}

.replay-status-dur {
    position: absolute;
    right: -2px;
    bottom: -2px;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 2px;
    padding: 0 2px;
    line-height: 1;
}

.replay-detail {
    min-width: 0;
    max-width: 100%;
}

.replay-step-meta {
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.28));
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
}

.replay-meta-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    font-size: 0.85rem;
    align-items: center;
}

.replay-meta-ids {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.4rem;
}

/* This-turn reaction tree (or flat order for legacy replays) */
.replay-chain {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.2));
}

.replay-chain-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--rz-text-secondary-color, #6c757d);
    margin-bottom: 0.35rem;
}

.replay-chain-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.replay-chain-row {
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.replay-chain-branch {
    color: var(--rz-text-disabled-color, #999);
    font-size: 16px;
}

.replay-chain-step {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.1rem 0.5rem;
    border-radius: 5px;
    border: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.25));
    font-size: 0.82rem;
    cursor: pointer;
}

.replay-chain-left {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.replay-chain-step:hover {
    background: var(--rz-base-200, rgba(127, 127, 127, 0.12));
}

.replay-chain-current {
    border-color: var(--rz-warning, #ffb300);
    box-shadow: 0 0 0 1px var(--rz-warning, #ffb300);
}

.replay-chain-reactive {
    background: var(--rz-secondary-lighter, rgba(149, 117, 205, 0.18));
}

.replay-chain-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--rz-text-secondary-color, #6c757d);
}

.replay-chain-bolt {
    color: var(--rz-warning, #ffb300);
}

.replay-chain-hidden {
    border-style: dashed;
    opacity: 0.6;
}

.replay-chain-hidden .replay-chain-name {
    font-style: italic;
}

.replay-chain-hidden-icon {
    font-size: 0.95rem !important;
    color: var(--rz-text-secondary-color, #6c757d);
}

.replay-chain-hidden-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0 0.3rem;
    border-radius: 4px;
    background: var(--rz-base-300, rgba(127, 127, 127, 0.2));
    color: var(--rz-text-secondary-color, #6c757d);
}

.replay-chain-phase-tag {
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0 0.3rem;
    border-radius: 4px;
    white-space: nowrap;
    background: var(--rz-info-lighter, rgba(3, 155, 229, 0.15));
    color: var(--rz-info-dark, #0277bd);
}

.replay-chain-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.replay-chain-owner {
    font-size: 0.72rem;
    color: var(--rz-text-secondary-color, #6c757d);
    white-space: nowrap;
    flex: none;
}

.replay-chain-trigger {
    font-size: 0.7rem;
    color: var(--rz-text-secondary-color, #6c757d);
    font-style: italic;
    opacity: 0.85;
    cursor: pointer;
    white-space: nowrap;
}

.replay-chain-trigger:hover {
    text-decoration: underline;
    opacity: 1;
}

.replay-mono {
    font-family: 'Consolas', monospace;
    font-size: 0.78rem;
    color: var(--rz-text-secondary-color, #6c757d);
    cursor: pointer;
}

.replay-attr-scroll {
    overflow-x: auto;
}

.replay-attr-table {
    font-size: 0.78rem;
    white-space: nowrap;
}

.replay-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0 0.5rem 0;
    border-bottom: 1px solid var(--rz-border-color, rgba(127, 127, 127, 0.2));
}

.replay-slider {
    flex: 1 1 8rem;
    min-width: 0;
    cursor: pointer;
}

.replay-controls-label {
    font-size: 0.8rem;
    font-weight: 600;
    white-space: nowrap;
    flex: 0 1 22rem;
    width: 22rem;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

@media (max-width: 700px) {
    .replay-controls-label {
        flex: 1 1 100%;
        width: 100%;
        text-align: left;
    }
}

.replay-timeline {
    display: flex;
    align-items: flex-end;
    gap: 1px;
    height: 48px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(127, 127, 127, 0.12);
    overflow-x: auto;
}

.replay-cell {
    flex: 0 0 8px;
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    cursor: pointer;
}

.replay-cell-round {
    border-left: 1px solid var(--rz-base-400, #bbb);
}

.replay-cell-bar {
    width: 6px;
    background: var(--rz-danger, #e53935);
    border-radius: 1px;
}

.replay-cell-heal .replay-cell-bar {
    background: var(--rz-success, #43a047);
}

.replay-cell-death .replay-cell-bar {
    background: #000;
    outline: 1px solid var(--rz-danger, #e53935);
}

.replay-cell-active {
    background: var(--rz-warning-lighter, #fff3cd);
}

.replay-cell-active .replay-cell-bar {
    background: var(--rz-warning, #ffb300);
}

/* Reactive steps get a purple marker dot at the top of the timeline cell */
.replay-cell-reactive::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--rz-secondary, #9575cd);
}

.replay-cell {
    position: relative;
}

.replay-search-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    background: rgba(127, 127, 127, 0.12);
}

.replay-search {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    color: inherit;
}

.replay-search-count {
    font-size: 0.8rem;
    color: var(--rz-text-secondary-color, #6c757d);
    white-space: nowrap;
}

.replay-cell-match {
    background: var(--rz-info-lighter, #cfe8fb);
}

.replay-cell-match .replay-cell-bar {
    background: var(--rz-info, #2196f3);
}

.replay-cell-dim {
    opacity: 0.25;
}

/* ── Skill icons (from buff/debuff sprite sheet) ──────────── */
.skill-icon {
    display: inline-block;
    vertical-align: middle;
    flex: none;
    border-radius: 3px;
    background-repeat: no-repeat;
}

.effect-line .skill-icon {
    align-self: center;
}

.skill-name-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    justify-content: flex-end;
}

.precombat-skill-head .skill-icon {
    margin-right: 0.4rem;
}

