/* =========================
   Initiative Module
   ========================= */

/* Initiative container lives inside the left panel */
.panel-initiative > .initiative-container {
    display: flex;
    flex-direction: column;
    gap: 10px;

    flex: 1 1 auto;
    width: 100%;
    height: 100%;

    padding: 10px;
    margin: 0;

    background: transparent;
    border: none;

    overflow-y: auto;
    overflow-x: hidden;
}

/* Main header */
.initiative-header {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* =========================
   Section cards (Players / Enemies / NPCs / Order)
   ========================= */

.initiative-player-container,
.initiative-enemy-container,
.initiative-npc-container,
.initiative-order-container {
    padding: 10px;
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);

    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* Section headers */
.initiative-player-header,
#initiative-enemy-header,
#initiative-npc-header,
#initiative-order-header {
    display: flex;
    align-items: center;
    gap: 10px;

    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;

    opacity: 0.9;

    position: sticky;
    top: 0;
    z-index: 5;

    padding: 6px 8px;
    margin: -4px -4px 8px -4px;
    background: rgba(15, 15, 15, 0.78);
    border-radius: 10px;

    backdrop-filter: blur(8px);
}

/* Indicator dots */
.initiative-player-header::before,
#initiative-enemy-header::before,
#initiative-npc-header::before,
#initiative-order-header::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.initiative-player-header::before { background: rgba(80, 210, 255, 0.8); }
#initiative-enemy-header::before   { background: rgba(255, 95, 95, 0.8); }
#initiative-npc-header::before     { background: rgba(170, 130, 255, 0.8); }
#initiative-order-header::before   { background: rgba(160, 255, 140, 0.8); }

/* =========================
   Inner lists
   ========================= */

.initiative-player-inner_container,
.initiative-enemy-inner_container,
.initiative-npc-inner_container,
.initiative-order-inner_container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* =========================
   Rows (flex-wrap, no overflow)
   ========================= */

.initiative-player-row,
.initiative-enemy-row {
    display: flex;
    align-items: center;
    gap: 8px;

    padding: 8px 10px;
    /*width: 100%;*/

    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 10px;

    transition: background 120ms ease, border-color 120ms ease;
}

.initiative-player-row:hover,
.initiative-enemy-row:hover {
    background: rgba(0, 0, 0, 0.32);
    border-color: rgba(255, 255, 255, 0.18);
}

/* Name */
.initiative-player-row-name,
.initiative-enemy-row-name {
    flex: 1 1 auto;
    min-width: 0px;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.initiative-player-row-name.is-editable {
    cursor: text;
}

.initiative-player-row-name.is-editable:hover {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    opacity: 0.95;
}

.initiative-player-row-name.is-editable:focus {
    outline: none;
    text-decoration: underline;
    text-decoration-style: solid;
}

/* =========================
   Inputs
   ========================= */

.initiative-player-row-initiative,
.initiative-enemy-row-initiative {
    /*flex: 0 1 84px;*/
    min-width: 56px;
    text-align: center;

    width: 56px;
    padding: 4px 6px;
    font-size: 12px;

}

.initiative-player-row-cell,
.initiative-enemy-row-cell {
    /*flex: 0 1 72px;*/
    /*min-width: 62px;*/
    /*text-align: center;*/

    width: 46px;
    min-width: 46px;
    padding: 4px 6px;
    font-size: 12px;
    text-align: center;
}

.initiative-player-row-initiative,
.initiative-enemy-row-initiative,
.initiative-player-row-cell,
.initiative-enemy-row-cell {
    padding: 8px 10px;

    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);

    color: rgba(245, 245, 245, 0.95);
    font-size: 13px;
    font-weight: 700;

    outline: none;
}

.initiative-player-row-initiative:focus,
.initiative-enemy-row-initiative:focus,
.initiative-player-row-cell:focus,
.initiative-enemy-row-cell:focus {
    border-color: rgba(255, 255, 255, 0.32);
    background: rgba(255, 255, 255, 0.09);
}

/* =========================
   Checkboxes
   ========================= */

.initiative-player-row-visible,
.initiative-enemy-row-visible,
.initiative-enemy-row-dead {
    flex: 0 0 18px;
    width: 16px;
    height: 16px;

    accent-color: rgba(210, 255, 140, 0.95);
    cursor: pointer;
}

.initiative-enemy-row-dead {
    accent-color: rgba(255, 95, 95, 0.95);
}

/* =========================
   Buttons
   ========================= */

.initiative-enemy-row-roll,
.initiative-enemy-roll-all {
    flex: 0 1 92px;
    min-width: 74px;

    padding: 4px 8px;
    border-radius: 8px;

    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(245, 245, 245, 0.95);

    font-size: 11px;
    font-weight: 800;

    cursor: pointer;
}

.initiative-enemy-row-roll:hover,
.initiative-enemy-roll-all:hover {
    background: rgba(255, 255, 255, 0.10);
}

/* Roll-all footer button */
.initiative-enemy-roll-all {
    width: 100%;
    margin-top: 10px;
}

/* Ghost row: looks like a normal row, just lighter */
.initiative-player-row.ghost {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.10);
    opacity: 0.75;

    cursor: text;

    min-height: 36px;
}

/* Hover = stronger affordance */
.initiative-player-row.ghost:hover {
    background: rgba(255, 255, 255, 0.07);
    opacity: 1;
}

/* Ghost text */
.initiative-player-row.ghost .initiative-player-row-name {
    color: rgba(245, 245, 245, 0.65);
    font-style: normal;
}

.ghost-text {
    font-style: italic;
}

.initiative-player-remove {
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    opacity: 0;
    cursor: pointer;
    color: rgba(255, 120, 120, 0.9);

    transition: opacity 120ms ease;
}

.initiative-player-row:hover .initiative-player-remove {
    opacity: 0.8;
}

.initiative-player-remove:hover {
    opacity: 1;
}