/*
 * Garde-fou de rendu local pour les pages de decks.
 * Les composants conservent leurs styles scoped comme source de vérité ; ces
 * règles globales empêchent un navigateur de mélanger un DOM reconstruit par
 * dotnet watch avec une ancienne feuille scoped encore en cache.
 */
.decks-native-page:not(.decks-shared-search-page) .decks-native-card {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 152px;
    flex-direction: column;
    gap: 8px;
    padding: 12px 11px 11px;
    overflow: hidden;
}

.decks-native-page:not(.decks-shared-search-page) .decks-native-card-head {
    display: flex;
    min-width: 0;
    align-items: start;
    justify-content: space-between;
    gap: 8px;
}

.decks-native-page:not(.decks-shared-search-page) .decks-native-monsters {
    display: flex;
    min-width: 0;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: visible;
}

.decks-native-page:not(.decks-shared-search-page) .decks-native-monster {
    position: relative;
    display: grid;
    min-width: 0;
    flex: 1 1 0;
    place-items: center;
}

.decks-native-page:not(.decks-shared-search-page) .decks-native-monster img {
    display: block;
    width: 100%;
    max-width: 50px;
    height: auto;
    aspect-ratio: 1;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 7px;
    object-fit: cover;
}

.decks-native-page:not(.decks-shared-search-page) .decks-native-card-foot {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

/* Les deux visualiseurs sont des composants partagés : même coque et mêmes
   contraintes de défilement, quel que soit l'appelant. */
.rune-viewer-backdrop,
.artifact-viewer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(4, 0, 15, .76);
    backdrop-filter: blur(3px);
}

.rune-viewer-modal,
.artifact-viewer-modal {
    display: flex;
    width: min(1320px, calc(100vw - 48px));
    max-height: min(92vh, 980px);
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(139, 92, 246, .72);
    border-radius: 14px;
    background: linear-gradient(145deg, #211040, #120521);
    color: #f4efff;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .64);
}

.rune-viewer-modal-body,
.artifact-viewer-modal-body {
    min-height: 0;
    overflow: auto;
    padding: 12px 14px 14px;
}

.ro-rune-viewer-grid,
.artifact-viewer-grid {
    display: grid;
    gap: 10px;
    align-items: start;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ro-rune-viewer-grid--1 .ro-rune-viewer-card { grid-column: 2; }
.artifact-viewer-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.ro-rune-viewer-card {
    display: grid;
    min-width: 0;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(169, 132, 245, .45);
    border-radius: 10px;
    background: rgba(32, 15, 62, .9);
}

@media (max-width: 720px) {
    .rune-viewer-backdrop,
    .artifact-viewer-backdrop { padding: 10px; }

    .rune-viewer-modal,
    .artifact-viewer-modal { width: 100%; max-height: 96vh; }

    .ro-rune-viewer-grid,
    .artifact-viewer-grid,
    .artifact-viewer-grid--2 { grid-template-columns: minmax(0, 1fr); }

    .ro-rune-viewer-grid--1 .ro-rune-viewer-card { grid-column: 1; }
}
