﻿/* prisoner-exchange-modal.css
   Matches player-diplomacy-panel.css: dark surface, gold rationed to the primary
   action + selected state, tier/seat colours only as small accents. */

.pex-scrim {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, .61);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* app-toast: standalone toast. Named to avoid collision with the
   pre-existing global .toast in toasts.scss (which hides via .toast:not(.show)). */
.app-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
    background: var(--panel, #16130f);
    border: 1px solid var(--line, #2a241c);
    border-left: 3px solid var(--gold, #d8b25e);
    color: var(--ink, #efe7d8);
    padding: 12px 18px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .5);
    font-size: 13px;
    transition: opacity .2s ease, transform .2s ease;
}

.app-toast--in {
    opacity: 1;
    transform: translateY(0);
}

.app-toast--out {
    opacity: 0;
    transform: translateY(8px);
}

.preset-modal {
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    background: var(--panel, #16130f);
    border: 2px solid var(--line, #2a241c);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .61);
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--ink, #efe7d8);
}

.preset-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}
.preset-group {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0.5rem;
    gap: 0.35rem;
}
    .preset-group input {
        padding: 0.65rem 0.85rem;
        border: 1px solid rgba(213, 166, 66, 0.18);
        border-radius: 8px;
        background: rgba(5, 5, 6, 0.6);
        color: #f7ead0;
        font-family: 'Crimson Text', Georgia, serif;
        font-size: 0.9rem;
        outline: none;
        transition: border-color 140ms ease;
    }

.preset-actions {
    display: flex;
    align-self: end;
    gap: 8px;
}

.pex-dialog {
    width: 100%;
    max-width: 581px;
    max-height: 90vh;
    background: var(--panel, #16130f);
    border: 2px solid var(--line, #2a241c);
    border-radius: 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .61);
    display: flex;
    flex-direction: column;
    font-size: 13px;
    color: var(--ink, #efe7d8);
}

.pex-list::-webkit-scrollbar {
    width: 10px;
}

.pex-list::-webkit-scrollbar-track {
    background: transparent;
}

.pex-list::-webkit-scrollbar-thumb {
    background: var(--line, #2a241c);
    border-radius: 4px;
}

    .pex-list::-webkit-scrollbar-thumb:hover {
        background: #3a3226;
    }
/* Firefox */
.pex-list {
    scrollbar-width: thin;
    scrollbar-color: var(--line, #2a241c) transparent;
}

/* ---- header ---- */
.pex-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--line, #2a241c);
}

.pex-title {
    font-family: Georgia, serif;
    font-weight: 600;
    font-size: 15px;
}

.pex-x {
    background: transparent;
    border: none;
    color: var(--ink-faint, #6b6355);
    font-size: 15px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
}

    .pex-x:hover {
        color: var(--ink, #efe7d8);
    }

/* ---- two columns ---- */
.pex-cols {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: start;
    padding: 16px 18px;
}

.pex-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.pex-col-head {
    color: var(--ink-faint, #6b6355);
    font-size: 12px;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.pex-count {
    color: var(--ink-dim, #9a9082);
    font-weight: 600;
    margin-left: 4px;
}

.pex-swap {
    align-self: center;
    color: var(--ink-faint, #6b6355);
    font-size: 20px;
    padding-top: 24px;
}

.pex-empty {
    color: var(--ink-faint, #6b6355);
    font-size: 12px;
    font-style: italic;
    padding: 10px 0;
}

.pex-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 343px; /* ~7 pieces before scrolling */
    overflow-y: auto;
    overflow-x: hidden;
    /* room so the scrollbar doesn't overlap the piece rows */
    padding-right: 4px;
}

/* ---- a selectable prisoner ---- */
.pex-piece {
    display: grid;
    grid-template-columns: 26px 1fr auto;
    align-items: center;
    gap: 9px;
    text-align: left;
    background: var(--panel-2, #1c1813);
    border: 1px solid var(--line, #2a241c);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    transition: border-color .14s ease, background .14s ease;
}

    .pex-piece:hover:not(.is-disabled):not(.is-selected) {
        border-color: #3a3226;
    }

    .pex-piece.is-selected {
        background: var(--gold-soft, #3a2f18);
        border-color: #5a4a24;
    }

    .pex-piece.is-disabled {
        opacity: .35;
        cursor: not-allowed;
    }

.pex-piece-icon {
    font-size: 20px;
    width: 26px;
    max-width: 26px;
    line-height: 1;
    text-align: center;
}
/* seat colour tints for the piece glyph */
.pex-white {
    color: #e8dfce;
}

.pex-black {
    color: #b7a98d;
}

.pex-blue {
    color: #8fa9d0;
}

.pex-red {
    color: #c98d8d;
}

.pex-none {
    color: var(--ink-faint, #6b6355);
}

.pex-piece-label {
    color: var(--ink, #efe7d8);
    font-size: 13px;
    font-weight: 600;
}

.pex-piece.is-selected .pex-piece-label {
    color: var(--gold, #d8b25e);
}

.pex-piece-origin {
    color: var(--ink-faint, #6b6355);
    font-size: 11px;
}

/* ---- footer ---- */
.pex-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-top: 1px solid var(--line, #2a241c);
}

.pex-hint {
    color: var(--ink-faint, #6b6355);
    font-size: 12px;
    font-style: italic;
}

.pex-actions {
    display: flex;
    gap: 8px;
}

.pex-btn {
    border: 1px solid var(--line, #2a241c);
    background: transparent;
    color: var(--ink-dim, #9a9082);
    border-radius: 7px;
    padding: 8px 16px;
    font-size: 12.5px;
    cursor: pointer;
    transition: color .14s ease, border-color .14s ease, filter .14s ease;
}

.pex-btn--quiet {
    border-color: transparent;
    color: var(--ink-faint, #6b6355);
}

    .pex-btn--quiet:hover {
        color: var(--ink-dim, #9a9082);
    }

.pex-btn--min-width-263 {
    min-width: 263px;
}

.pex-btn--primary {
    background: var(--gold, #d8b25e);
    border-color: var(--gold, #d8b25e);
    color: #211907;
    font-weight: 600;
}

    .pex-btn--primary:hover:not(:disabled) {
        filter: brightness(1.07);
    }

    .pex-btn--primary:disabled {
        opacity: .4;
        cursor: not-allowed;
    }

@media (max-width: 560px) {
    .pex-cols {
        grid-template-columns: 1fr;
    }

    .pex-swap {
        transform: rotate(90deg);
        padding: 4px 0;
    }
}

.align-items-center {
    align-items: center !important;
}

/* ---- diplomatic proposal (target side) ---- */
.dpr-timer {
    color: var(--ink-dim, #9a9082);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}

    .dpr-timer.is-urgent {
        color: #c98d8d;
    }

.dpr-countdown {
    height: 3px;
    background: var(--line, #2a241c);
    overflow: hidden;
}

.dpr-countdown-fill {
    height: 100%;
    background: var(--gold, #d8b25e);
    transition: width .25s linear, background .2s ease;
}

    .dpr-countdown-fill.is-urgent {
        background: #c98d8d;
    }

.dpr-upgrade {
    color: var(--ink-faint, #6b6355);
    font-size: 11px;
    letter-spacing: .02em;
    text-transform: uppercase;
    margin-bottom: 6px;
}

/* read-only prisoner rows: no hover/cursor affordance */
.pex-piece.dpr-piece--static,
.pex-piece.dpr-piece--static:hover {
    cursor: default;
    border-color: var(--line, #2a241c);
}

.dpr-btn--decline:hover:not(:disabled) {
    color: #c98d8d;
    border-color: #4a2a2a;
}

.dpr-btn--decline:disabled {
    opacity: .4;
    cursor: not-allowed;
}