/* ═══════════════════════════════════════════════════════════════
   Dialog Theme — Dark Fantasy (matches TowerView palette)
   ───────────────────────────────────────────────────────────────
   Applied to MudBlazor dialogs via DialogOptions.BackgroundClass so
   the Phase 3 dashboard modals (ChestOpenModal, AscenderPickerModal,
   plus any future modal that needs the same look) inherit the
   tower's dark-blue + gold palette instead of MudBlazor's default
   white card.

   IMPORTANT — MudBlazor 8 DOM
   ──────────────────────────────────────────────────────────────
   In v8 `DialogOptions.BackgroundClass` is applied to the
   <MudOverlay> sibling of <div class="mud-dialog">, NOT an
   ancestor of it. The actual rendered structure is:

     <div class="mud-dialog-container ...">
       <div class="mud-overlay ... asc-dialog-theme">
         <div class="mud-overlay-scrim ..."></div>
       </div>
       <div class="mud-dialog ...">                <!-- sibling -->
         <div class="mud-dialog-title">...</div>
         <div class="mud-dialog-content">...</div>
         <div class="mud-dialog-actions">...</div>
       </div>
     </div>

   So we reach the dialog surface from the themed overlay using the
   general sibling combinator (`~`). A descendant selector
   (`.asc-dialog-theme .mud-dialog`) silently matches nothing — that
   was the bug in the first version.

   Color tokens are duplicated from src/Presentation/Ascend.Web/
   wwwroot/css/pages/tower-view.css (the .asc-tower-view --tw-*
   tokens are scoped to that selector, so they aren't visible
   inside MudBlazor's portal-rendered dialog).
   ═══════════════════════════════════════════════════════════════ */

/* ── Dialog surface ── */
/* `.asc-dialog-theme` is on `.mud-overlay`; `.mud-dialog` is its
   sibling under `.mud-dialog-container`. Use `~` (general sibling)
   to cross from one to the other. */
.asc-dialog-theme ~ .mud-dialog {
    background: linear-gradient(180deg, #161a33 0%, #111428 60%, #0d0f1a 100%);
    color: #e8e4dc;
    border: 1px solid rgba(212, 168, 67, 0.35);
    border-radius: 12px;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(13, 15, 26, 0.6),
        inset 0 1px 0 rgba(212, 168, 67, 0.12);
}

.asc-dialog-theme ~ .mud-dialog .mud-dialog-title,
.asc-dialog-theme ~ .mud-dialog .mud-dialog-content,
.asc-dialog-theme ~ .mud-dialog .mud-dialog-actions {
    background: transparent;
    color: #e8e4dc;
}

.asc-dialog-theme ~ .mud-dialog .mud-dialog-title {
    border-bottom: 1px solid rgba(212, 168, 67, 0.18);
    font-family: 'Cinzel', serif;
    letter-spacing: 0.04em;
    color: #f0d078;
}

.asc-dialog-theme ~ .mud-dialog .mud-dialog-actions {
    border-top: 1px solid rgba(212, 168, 67, 0.12);
}

/* Inner buttons (Tap to continue, Cancel) — visible on the dark
   surface with a gold-accent border + hover. */
.asc-dialog-theme ~ .mud-dialog .asc-chest-open__continue,
.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__cancel {
    border: 1px solid rgba(212, 168, 67, 0.5);
    background: rgba(212, 168, 67, 0.08);
    color: #f0d078;
    transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.asc-dialog-theme ~ .mud-dialog .asc-chest-open__continue:hover,
.asc-dialog-theme ~ .mud-dialog .asc-chest-open__continue:focus-visible,
.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__cancel:hover,
.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__cancel:focus-visible {
    background: rgba(212, 168, 67, 0.18);
    border-color: #f0d078;
}

/* Ascender picker cards — same dark-card treatment as TowerView's
   player-info panel, with a gold hover ring. */
.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__card {
    background: rgba(22, 26, 51, 0.85);
    border: 1px solid rgba(212, 168, 67, 0.2);
    color: #e8e4dc;
}

.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__card:hover,
.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__card:focus-visible {
    border-color: #d4a843;
    background: rgba(28, 33, 64, 0.95);
}

.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__title {
    color: #f0d078;
    font-family: 'Cinzel', serif;
}

.asc-dialog-theme ~ .mud-dialog .asc-ascender-picker__prompt {
    color: rgba(232, 228, 220, 0.78);
}

/* ── Backdrop scrim ──
   `.asc-dialog-theme` is itself the .mud-overlay; the visible
   dimmer is the .mud-overlay-scrim inside it. Slightly heavier
   than MudBlazor's default so the bright reward reveals read
   against a darker plate. */
.asc-dialog-theme .mud-overlay-scrim {
    background-color: rgba(5, 8, 18, 0.72);
}
