/* gameManager/MTG/cardControl.css
   CARD CONTROL — consent-based borrowing of opponent battlefield cards
   (2026-08-23h batch). Styles for the ghost request-drag, the borrowed-card
   amber ring, the Don't Allow / Allow prompt and the "Lent cards" tray.
   Everything here is scoped to cardControl's own classes/ids — nothing
   existing is restyled. */

/* ---------- Ghost drag ---------- */

.card-control-ghost {
    opacity: 0.85;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    will-change: left, top;
}

.card-control-ghost.cc-armed {
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.9),
                0 12px 28px rgba(0, 0, 0, 0.45);
}

.cc-badge {
    position: absolute;
    left: 50%;
    bottom: -30px;
    transform: translateX(-50%);
    white-space: nowrap;
    background: rgba(20, 20, 24, 0.9);
    color: #ffd27a;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    pointer-events: none;
}

/* The card being asked for: dimmed while dragged over, pulsing while the
   request waits for an answer */
.card-control-source {
    opacity: 0.55;
    filter: saturate(0.6);
}

.card-control-pending {
    animation: ccPendingPulse 1.2s ease-in-out infinite;
}

@keyframes ccPendingPulse {
    0%, 100% { box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.25); }
    50%      { box-shadow: 0 0 0 4px rgba(255, 176, 32, 0.85); }
}

/* Battle-area hint while the ghost hovers the command zone. The area keeps
   its permanent pointer-events:none frame — this only paints it. */
#battleArea.card-control-zone-hint {
    background: rgba(255, 176, 32, 0.08);
    outline: 2px dashed rgba(255, 176, 32, 0.75);
    outline-offset: -2px;
    border-radius: 10px;
}

/* ---------- Borrowed cards (both sides) ---------- */

/* The amber ring travels with the card: commandZone.place adds it in the
   zone and CardFan.removeCard clones the node when it is played, so the
   ring stays on the battlefield permanent too. */
.card-control-borrowed {
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.85),
                0 4px 10px rgba(0, 0, 0, 0.35) !important;
    border-radius: 8px;
}

/* ---------- Don't Allow / Allow prompt (non-blocking) ---------- */

#ccPrompt {
    position: fixed;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    display: flex;
    gap: 14px;
    align-items: center;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    padding: 14px 16px;
    max-width: 440px;
    animation: ccPromptIn 0.25s ease;
}

#ccPrompt.hidden {
    display: none;
}

@keyframes ccPromptIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-12px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

#ccPromptImage {
    width: 64px;
    border-radius: 5px;
    display: block;
    flex-shrink: 0;
}

.cc-prompt-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#ccPromptText {
    font-size: 14px;
    font-weight: 500;
    color: #333;
    line-height: 1.35;
}

.cc-prompt-buttons {
    display: flex;
    gap: 10px;
}

.cc-prompt-buttons button {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#ccPromptDeny {
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #e2e8f0;
}

#ccPromptDeny:hover {
    background: #e2e8f0;
}

#ccPromptAllow {
    background: #2563eb;
    color: #ffffff;
    border: none;
}

#ccPromptAllow:hover {
    background: #1d4ed8;
}

/* ---------- "Lent cards" tray (owner side) ---------- */

#ccTray {
    position: fixed;
    left: 10px;
    top: 42%;
    z-index: 900;
    background: rgba(20, 20, 24, 0.88);
    border: 1px solid rgba(255, 176, 32, 0.5);
    border-radius: 10px;
    padding: 8px 10px;
    max-width: 220px;
    color: #f4f4f5;
}

#ccTray.hidden {
    display: none;
}

.cc-tray-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffd27a;
    margin-bottom: 6px;
}

.cc-tray-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.cc-tray-row:last-child {
    margin-bottom: 0;
}

.cc-tray-row img {
    width: 28px;
    border-radius: 3px;
    display: block;
    flex-shrink: 0;
}

.cc-tray-row span {
    flex: 1;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cc-tray-row button {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 5px;
    border: none;
    background: #ffb020;
    color: #241a05;
    cursor: pointer;
}

.cc-tray-row button:hover {
    background: #ffc247;
}

.cc-tray-row button:disabled {
    background: #6b6b70;
    color: #d4d4d8;
    cursor: default;
}
