/* =========================================================
   Deck pages shared (global)
   Purpose:
   - Reuse same look for user decks + admin base decks
   - Avoid CSS isolation duplication
   ========================================================= */

/* =========================================
   Decks list page (from Decks.razor.css)
   ========================================= */
.decks-root {
    padding-bottom: 1.25rem;
}
.decks-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.35rem 0 1rem 0;
}
.decks-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.decks-panel {
    border-radius: var(--fc-radius-lg);
}
.decks-empty-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}
/* Groups (collapsible) */
.decks-group {
    margin-top: 1.1rem;
    padding: 0.35rem 0.35rem 0.55rem;
    border-radius: var(--fc-radius-lg);
    background: linear-gradient(
            180deg,
            rgba(48, 44, 78, 0.85) 0%,
            rgba(24, 22, 40, 0.90) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0.4rem 1.1rem rgba(0, 0, 0, 0.65);
}
/* --- Summary header --- */
.decks-summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: calc(var(--fc-radius-lg) - 0.2rem);
    background: linear-gradient(
            180deg,
            rgba(72, 66, 110, 0.95) 0%,
            rgba(42, 38, 66, 0.95) 100%
    );
    border: 1px solid rgba(255, 215, 140, 0.35);
    user-select: none;
    transition: background 160ms ease,
    box-shadow 160ms ease,
    transform 120ms ease;
}
.decks-summary:hover {
    background: linear-gradient(
            180deg,
            rgba(88, 80, 135, 1) 0%,
            rgba(52, 46, 82, 1) 100%
    );
    box-shadow: 0 0 0 2px rgba(255, 231, 160, 0.18),
    0 0.45rem 1.25rem rgba(0, 0, 0, 0.75);
}
.decks-summary::-webkit-details-marker {
    display: none;
}
.decks-summary-title {
    font-family: var(--fc-font-title);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #fdf5d0;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}
.decks-summary-count {
    font-size: 0.85rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.92);
}
.decks-summary::after {
    content: "▾";
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--fc-gold-1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
    transition: transform 180ms ease;
}
details[open] > .decks-summary::after {
    transform: rotate(180deg);
}
details.decks-group > *:not(summary) {
    padding: 0.8rem 0.35rem 0.25rem;
}
.decks-empty-inline {
    padding: 0.6rem 0.4rem;
    color: rgba(255, 255, 255, 0.78);
}
/* Grid */
.decks-grid {
    margin-top: 0.25rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.85rem;
}
@media (max-width: 640px) {
    .decks-group {
        padding: 0.3rem 0.3rem 0.45rem;
    }
    .decks-summary {
        padding: 0.6rem 0.7rem;
    }
    .decks-summary-title {
        font-size: 0.95rem;
    }
}
@media (min-width: 920px) {
    .decks-grid {
        grid-template-columns: 1fr 1fr;
    }
}
@media (min-width: 1280px) {
    .decks-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
}
/* Tile */
.deck-tile {
    text-align: left;
    padding: 0.9rem 0.9rem 0.85rem 0.9rem;
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--fc-radius-lg);
    box-shadow: var(--fc-shadow-soft);
}
.deck-tile-default {
    opacity: 0.95;
}
.deck-top {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.75rem;
    align-items: start;
}
.deck-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.deck-meta {
    margin-top: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.deck-desc {
    margin-top: 0.7rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.80);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.deck-desc-muted {
    color: rgba(255, 255, 255, 0.62);
}
/* Modal actions */
.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1rem;
}

/* =========================================
   Deck editor page (from DeckEditor.razor.css)
   ========================================= */
.deck-page-title {
    font-family: var(--fc-font-title), serif;
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-bottom: 1rem;
    color: #fdf5d0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}
.deck-readonly-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.16);
}
.deck-readonly-hint {
    font-size: 0.82rem;
    opacity: 0.9;
}
.deck-editor-root {
    --card-width: clamp(4.8rem, 6.4vw, 6.6rem);
    border-radius: 0.75rem;
    padding: 0.75rem 0.75rem 1rem;
    color: #f5f5f5;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
}
.deck-editor-readonly .deck-strip {
    cursor: default;
}
.deck-editor-readonly .deck-card-count-badge {
    cursor: default;
    opacity: 0.75;
}
.deck-editor-root ::-webkit-scrollbar {
    width: 8px;
}
.deck-editor-root ::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
}
.deck-editor-root ::-webkit-scrollbar-thumb {
    background: rgba(255, 216, 128, 0.85);
    border-radius: 4px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.9);
}
.deck-editor-root {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 216, 128, 0.85) rgba(0, 0, 0, 0.6);
}
.deck-header {
    margin-bottom: 0.5rem;
}
.deck-label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.7);
}
.deck-header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
}
.deck-buttons {
    display: flex;
    justify-content: flex-start;
}
.deck-editor {
    margin-top: 0.5rem;
    flex: 1;
    overflow: hidden;
}
.deck-column-deck,
.deck-column-collection {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.deck-column {
    margin-top: 0.5rem;
}
.deck-column-title {
    font-family: var(--fc-font-title), serif;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: baseline;
    gap: .25rem;
}
.deck-column-count {
    font-size: 0.85rem;
    opacity: 0.8;
}
.deck-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-right: 0.3rem;
    padding-top: 0.15rem;
    padding-left: 0.15rem;
    padding-bottom: 0.5rem;
    overflow-y: auto;
    min-height: 0;
}
.deck-row {
    display: flex;
    align-items: stretch;
    gap: 0.3rem;
}

/* Deck strip */
.deck-strip {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    height: 3.1rem;
    border-radius: 0.6rem;
    border: var(--fc-card-border);
    box-shadow: var(--fc-shadow-soft);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0 0.65rem 0 0.55rem;
    isolation: isolate;
}

/* IMPORTANT: remove strip dimming layer (requested) */
.deck-strip::before {
    content: none;
}

.deck-strip-mana {
    position: relative;
    z-index: 1;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.92rem;
    color: #041623;
    background: radial-gradient(circle at 30% 20%, #c9f2ff 0, #6cc7ff 42%, #1f66d1 100%);
    border: 2px solid rgba(0, 0, 0, 0.85);
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.28);
    flex: 0 0 auto;
}
.deck-strip-title {
    position: relative;
    z-index: 1;
    min-width: 0;
    font-family: var(--fc-font-title);
    font-weight: 700;
    font-size: 0.95rem;
    color: #f5e6c8;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.deck-strip-service {
    position: relative;
    z-index: 1;
    margin-left: auto;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    line-height: 1.3;
    white-space: nowrap;
    color: #ffd2d2;
    border: 1px solid rgba(255, 80, 80, 0.7);
    background: rgba(0, 0, 0, 0.55);
}
.deck-card-count-badge {
    flex: 0 0 auto;
    text-align: center;
    padding: 0 0.4rem;
    border-radius: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15);
    font-weight: 800;
    font-size: 0.85rem;
    height: 3.1rem;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    outline: none;
    cursor: pointer;
    position: relative;
    color: #f5f5f5;
}
.deck-card-count-badge:disabled {
    cursor: default;
    opacity: 0.7;
}
.deck-card-count-badge::before {
    content: attr(data-count);
}
.deck-card-count-badge:hover::before {
    content: attr(data-hover);
}
.deck-card-count-badge-max {
    background: rgba(80, 0, 0, 0.7);
    box-shadow: 0 0 0 1px rgba(255, 120, 120, 0.7);
}

/* Collection host */
.deck-collection-host {
    flex: 1;
    min-height: 0;
    display: flex;
}
/* global (no ::deep needed) */
.deck-collection-host .card-browser-root {
    --card-width: clamp(4.8rem, 6.4vw, 6.6rem);
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.deck-collection-host .card-browser-grid {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.3rem;
    padding-bottom: 0.5rem;
    padding-top: 0.15rem;
    padding-left: 0.15rem;
    align-content: start;
}
.deck-editor-readonly .deck-collection-host .card-browser-grid {
    opacity: 0.85;
}
@media (max-width: 768px) {
    .deck-editor-root {
        --card-width: clamp(4.4rem, 8.2vw, 6.0rem);
    }
    .deck-collection-host .card-browser-root {
        --card-width: clamp(4.4rem, 8.2vw, 6.0rem);
    }
    .deck-card-count-badge {
        height: 3.1rem;
    }
}
