/* =========================================================================
   gameManager/MTG/turn.css — 2026-08-27 social + persistent games batch.

   Two things live here, both created entirely by JavaScript (index.php did
   not gain any markup for them):

     1. TURN CONTROLS — mechanics/turnControls.js: the Mulligan / End Turn
        column above the deck at the bottom right, the "whose turn" pill
        under the opponent's hand, the mulligan popup's number row, the
        concession request bar and the game-over dialog.

     2. THE LIFE DICE ROW — mechanics/lifeCounter.js: #lifeDiceOpp, the
        centered row of one die per opponent at the top of the screen.
        dice.css still owns .life-die-wrap and #lifeDieMe; this file loads
        AFTER it (see paths.json loadOrder) and only overrides what a die
        needs in order to sit in a flex row instead of being fixed on its
        own. Keep this file last in the CSS load order.

   THE PUSH: the social panel narrows the board by setting --chat-push
   (core/social.css keeps the variable and the body.chat-push class the old
   chat panel used), so every fixed, right-anchored thing here offsets by
   it. Horizontally centered things are positioned by JS on window.gameW().
   ========================================================================= */

/* -------------------------------------------------------------------------
   1. TURN CONTROLS — the button column
   ------------------------------------------------------------------------- */
#turnControls {
    position: fixed;
    right: calc(var(--chat-push, 0px) + 12px);
    bottom: calc(15vh + 10px);      /* just above the hand strip / deck */
    z-index: 7;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    pointer-events: none;           /* only the buttons take the mouse */
}

#turnControls.hidden {
    display: none;
}

#turnControls .turn-btn {
    pointer-events: auto;
    width: auto;
    min-width: 108px;
    height: 34px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 34px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
}

#turnControls #mulliganBtn {
    background-color: #7c3aed;
}

#turnControls #mulliganBtn:hover {
    background-color: #6d28d9;
}

/* -------------------------------------------------------------------------
   The "whose turn it is" pill — under the opponent's hand, fades away
   ------------------------------------------------------------------------- */
#turnBanner {
    position: fixed;
    top: 13vh;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    z-index: 7;
    padding: 6px 18px;
    border-radius: 999px;
    background: rgba(17, 24, 39, 0.86);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.04em;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, transform 0.35s ease;
    white-space: nowrap;
}

#turnBanner.turn-banner-in {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

#turnBanner.hidden {
    display: none;
}

/* -------------------------------------------------------------------------
   The mulligan popup (the overlay + dialog shells come from base.css)
   ------------------------------------------------------------------------- */
.mulligan-dialog {
    width: 380px;
}

.mulligan-dialog .instruction-text {
    margin: 8px 0 16px;
    color: #475569;
    font-size: 14px;
}

.mull-nums {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 20px;
}

.mull-num {
    flex: 1;
    height: 42px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mull-num:hover {
    background: #e2e8f0;
}

.mull-num.selected {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

/* -------------------------------------------------------------------------
   "<name> has asked you to concede this game."
   ------------------------------------------------------------------------- */
#concessionBar {
    position: fixed;
    top: 15vh;
    left: calc((100% - var(--chat-push, 0px)) / 2);
    transform: translateX(-50%);
    z-index: 8;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 92vw;
    padding: 10px 16px;
    border-radius: 10px;
    background: rgba(17, 24, 39, 0.94);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

#concessionBar.hidden {
    display: none;
}

#concessionBar .concession-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Compact button variant shared with the social panel's rows */
.soc-btn {
    width: auto;
    padding: 6px 14px;
    font-size: 13px;
    border-radius: 6px;
}

.game-over-dialog {
    width: 380px;
    text-align: center;
}

.game-over-dialog .deck-actions {
    display: flex;
    align-items: center;
    margin-top: 22px;
}

.game-over-dialog .spacer {
    flex: 1;
}

/* -------------------------------------------------------------------------
   2. THE OPPONENT LIFE DICE ROW (mechanics/lifeCounter.js)

   One die per OTHER seated player, in seat order, centered at the top of
   the board. lifeCounter.js sets `left` from window.gameW()/2 the same way
   it does for #lifeDieMe; the translateX(-50%) below is what centers it.
   Children are .life-die-wrap elements, which dice.css styles as FIXED,
   individually centered dice — the first block here undoes exactly that so
   they can flow inside the row, and nothing else about a die changes.
   ------------------------------------------------------------------------- */
#lifeDiceOpp {
    position: fixed;
    top: 6px;
    z-index: 6;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 20px;
    transform: translateX(-50%);
    pointer-events: none;       /* the gaps stay click-through */
}

#lifeDiceOpp.hidden {
    display: none;
}

#lifeDiceOpp .life-die-wrap {
    position: static;
    left: auto;
    top: auto;
    bottom: auto;
    transform: none;
    pointer-events: auto;       /* hovering a die switches the board */
    cursor: pointer;
    transition: opacity 0.25s ease, transform 0.2s ease;
}

#lifeDiceOpp .life-die-wrap .die {
    font-size: 46px;
}

/* The player whose board is on screen */
#lifeDiceOpp .life-die-wrap.life-die-active {
    opacity: 1;
}

/* Everyone else — hover one for a moment to switch to them */
#lifeDiceOpp .life-die-wrap.life-die-dim {
    opacity: 0.35;
}

#lifeDiceOpp .life-die-wrap.life-die-dim:hover {
    opacity: 0.8;
    transform: translateY(2px);
}

/* A subtle marker on whoever holds the turn */
#lifeDiceOpp .life-die-wrap.life-die-turn .life-die-label {
    color: #fde68a;
}

/* Conceded — out of the game, but still on the row so the seat is legible */
#lifeDiceOpp .life-die-wrap.life-die-out {
    opacity: 0.2;
}

#lifeDiceOpp .life-die-wrap.life-die-out .life-die-label {
    text-decoration: line-through;
}

@media (prefers-reduced-motion: reduce) {
    #turnBanner,
    #lifeDiceOpp .life-die-wrap,
    .mull-num,
    #turnControls .turn-btn {
        transition: none;
    }
}
