/* ===== VARIABLES ===== */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: #12121a;
    --bg-nav: #0d0d14;
    --color-gold: #c9a84c;
    --color-gold-light: #e8c97a;
    --color-purple: #7B2FBE;
    --color-purple-light: #9d4ee0;
    --color-text: #e8e0d0;
    --color-text-muted: #8a8090;
    --border-color: #2a2535;
    --border-gold: rgba(201, 168, 76, 0.3);
}

/* ===== RESET ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Raleway', sans-serif;
    background-color: var(--bg-dark);
    color: var(--color-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===== NAVBAR ===== */
.navbar {
    background: var(--bg-nav);
    border-bottom: 1px solid var(--border-gold);
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    width: 100%;
    max-width: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.nav-logo {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    color: var(--color-gold);
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover { color: var(--color-gold); }

.nav-username {
    color: var(--color-gold);
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== BOUTONS ===== */
.btn-primary {
    background: linear-gradient(135deg, var(--color-purple), var(--color-purple-light));
    color: white;
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: inline-block;
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-secondary {
    background: transparent;
    color: var(--color-gold);
    padding: 0.6rem 1.4rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-gold);
    cursor: pointer;
    transition: background 0.2s;
    display: inline-block;
}

.btn-secondary:hover { background: rgba(201, 168, 76, 0.1); }

.btn-nav {
    background: var(--color-purple);
    color: white !important;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    font-weight: 600;
}

.btn-full { width: 100%; text-align: center; padding: 0.8rem; font-size: 1rem; }

/* ===== FLASH MESSAGES ===== */
.flash-messages { padding: 0 2rem; margin-top: 1rem; }
.flash {
    padding: 0.8rem 1.2rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}
.flash-success { background: rgba(40, 167, 69, 0.15); border: 1px solid rgba(40, 167, 69, 0.4); color: #5cb85c; }
.flash-danger  { background: rgba(220, 53, 69, 0.15);  border: 1px solid rgba(220, 53, 69, 0.4);  color: #e06c75; }
.flash-warning { background: rgba(186, 117, 23, 0.15); border: 1px solid rgba(186, 117, 23, 0.4); color: #e8a030; }

/* ===== HERO ===== */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a0f 70%);
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%239C92AC' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    padding: 2rem;
}

.hero-title {
    font-family: 'Cinzel', serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--color-gold);
    text-shadow: 0 0 40px rgba(201, 168, 76, 0.3);
    margin-bottom: 1.2rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* ===== FEATURES ===== */
.features {
    padding: 5rem 2rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.features-container {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.3s, transform 0.2s;
}

.feature-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
}

.feature-icon { font-size: 2.5rem; margin-bottom: 1rem; }

.feature-card h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

.feature-card p { color: var(--color-text-muted); line-height: 1.6; font-size: 0.95rem; }

/* ===== AUTH ===== */
.auth-container {
    min-height: calc(100vh - 64px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: radial-gradient(ellipse at center, #1a0a2e 0%, #0a0a0f 70%);
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}

.auth-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.8rem;
    margin-bottom: 0.4rem;
    text-align: center;
}

.auth-subtitle {
    color: var(--color-text-muted);
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

.form-group { margin-bottom: 1.2rem; }

.form-group label {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-purple);
}

.form-group input::placeholder { color: var(--color-text-muted); }

.auth-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.auth-link a { color: var(--color-gold); text-decoration: none; font-weight: 600; }
.auth-link a:hover { text-decoration: underline; }

/* ===== DASHBOARD ===== */
.dashboard-container {
    width: 100%;
    padding: 2rem 2.5rem;
}

.dashboard-container h1 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* ===== FOOTER ===== */
.footer {
    margin-top: auto;
    text-align: center;
    padding: 1.5rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
}

/* ===== PAGES GÉNÉRALES ===== */
.page-container {
    width: 100%;
    padding: 2rem 2.5rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
}

.page-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 2rem;
}

.page-subtitle {
    color: var(--color-text-muted);
    margin-top: 0.3rem;
    font-size: 0.95rem;
}

/* ===== LISTE DES DECKS ===== */
.decks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.deck-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
    display: block;
}

.deck-card:hover {
    border-color: var(--border-gold);
    transform: translateY(-4px);
}

.deck-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: #1a1025;
}

.deck-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.deck-card-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

.deck-card-info {
    padding: 1rem;
}

.deck-card-info h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1rem;
    margin-bottom: 0.3rem;
}

.deck-commander {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.3rem;
}

.deck-count {
    color: var(--color-purple-light);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-icon { font-size: 3rem; margin-bottom: 1rem; }

.empty-state h2 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    margin-bottom: 0.5rem;
}

.empty-state p { margin-bottom: 1.5rem; }

/* ===== CRÉATION DECK ===== */
.create-deck-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    align-items: start;
}

.create-deck-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.create-deck-form textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    resize: vertical;
}

.create-deck-form textarea:focus {
    outline: none;
    border-color: var(--color-purple);
}

.commander-preview {
    position: sticky;
    top: 80px;
}

.card-preview-empty {
    background: var(--bg-card);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    gap: 0.5rem;
}

.card-preview-empty span { font-size: 2rem; }

.commander-preview-img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-gold);
}

/* ===== RECHERCHE DE CARTES ===== */
.commander-search { position: relative; }

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    z-index: 200;
    display: none;
    max-height: 320px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.15s;
}

.search-item:hover { background: rgba(201, 168, 76, 0.08); }
.search-item:last-child { border-bottom: none; }

.search-item img {
    width: 36px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.search-item-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.search-item-type {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* ===== VUE DECK ===== */
.view-deck-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1.5rem;
    align-items: start;
    width: 100%;
}

@media (max-width: 800px) {
    .view-deck-layout { grid-template-columns: 1fr; }
    .deck-sidebar { position: static; }
}

.deck-sidebar {
    position: sticky;
    top: 80px;
}

.commander-big-img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-gold);
    margin-bottom: 1.5rem;
}

.add-card-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
}

.add-card-section h3 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.add-card-section input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
}

.add-card-section input:focus {
    outline: none;
    border-color: var(--color-purple);
}

/* ===== LISTE CARTES ===== */
.deck-stats-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.card-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.card-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s;
}

.card-list-item:hover { border-color: var(--border-gold); }

.card-thumbnail {
    width: 36px;
    height: 50px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
}

.card-list-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.card-list-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.card-list-type {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.card-list-mana {
    font-size: 0.75rem;
    color: var(--color-gold);
}

.card-list-qty {
    color: var(--color-purple-light);
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 28px;
    text-align: center;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
}

.btn-remove:hover {
    color: #e06c75;
    background: rgba(220, 53, 69, 0.1);
}

/* ===== DASHBOARD ===== */
.deck-selector {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

.deck-selector select {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 0.6rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 280px;
}

.deck-selector select:focus { outline: none; }

/* Stats rapides */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid transparent;
}

.stat-purple { background: rgba(123, 47, 190, 0.15); border-color: rgba(123, 47, 190, 0.3); }
.stat-teal   { background: rgba(29, 158, 117, 0.15); border-color: rgba(29, 158, 117, 0.3); }
.stat-amber  { background: rgba(186, 117, 23, 0.15); border-color: rgba(186, 117, 23, 0.3); }
.stat-coral  { background: rgba(216, 90, 48, 0.15);  border-color: rgba(216, 90, 48, 0.3);  }

.stat-value {
    font-family: 'Cinzel', serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-gold);
    line-height: 1;
    margin-bottom: 0.4rem;
}

.stat-label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Graphiques */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.chart-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.chart-wrapper {
    position: relative;
    height: 360px;
}

/* Suggestions */
.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 280px;
    overflow-y: auto;
}

.suggestions-loading {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    text-align: center;
    padding: 2rem;
}

.suggestion-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s;
}

.suggestion-item:hover { border-color: var(--border-gold); }

.suggestion-img {
    width: 36px;
    height: 50px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
    flex-shrink: 0;
}

.suggestion-info { flex: 1; }

.suggestion-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
    margin-bottom: 0.2rem;
}

.suggestion-reason {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}

/* ===== IMPORT ===== */
.import-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
    align-items: start;
}

.import-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.import-form-card textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', monospace;
    font-size: 0.85rem;
    resize: vertical;
    line-height: 1.6;
    transition: border-color 0.2s;
}

.import-form-card textarea:focus {
    outline: none;
    border-color: var(--color-purple);
}

.format-examples {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.format-title {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.format-list { display: flex; flex-direction: column; gap: 0.4rem; }

.format-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
}

.format-tag {
    background: rgba(123, 47, 190, 0.2);
    color: var(--color-purple-light);
    padding: 0.1rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    min-width: 100px;
    text-align: center;
}

.format-item code {
    color: var(--color-gold);
    font-family: monospace;
    font-size: 0.85rem;
}

.format-auto {
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.import-footer {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.import-count {
    color: var(--color-gold);
    font-weight: 600;
    font-size: 0.9rem;
}

.import-warning {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    padding: 0.5rem 0.75rem;
    background: rgba(186, 117, 23, 0.1);
    border: 1px solid rgba(186, 117, 23, 0.2);
    border-radius: 6px;
}

.import-help {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
}

.help-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
}

.help-steps {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    line-height: 1.8;
    padding-left: 1.2rem;
}

.help-steps strong { color: var(--color-text); }

.auto-categories {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.auto-cat {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.cat-badge {
    padding: 0.15rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 90px;
    text-align: center;
}

.cat-creature  { background: rgba(123,47,190,0.2); color: #9d4ee0; }
.cat-land      { background: rgba(99,153,34,0.2);  color: #7ab832; }
.cat-instant   { background: rgba(55,138,221,0.2); color: #60aaef; }
.cat-sorcery   { background: rgba(216,90,48,0.2);  color: #e87a45; }
.cat-artifact  { background: rgba(136,135,128,0.2);color: #b4b2a9; }
.cat-enchant   { background: rgba(29,158,117,0.2); color: #2ec99a; }

/* Barre de progression */
.import-progress {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 12px;
    padding: 1.2rem;
}

.progress-title {
    color: var(--color-gold);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.progress-bar-container {
    background: var(--bg-dark);
    border-radius: 6px;
    height: 8px;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-purple), var(--color-purple-light));
    border-radius: 6px;
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    color: var(--color-text-muted);
    font-size: 0.8rem;
}

/* ===== CONTRÔLE QUANTITÉ ===== */
.card-qty-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.6rem;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.qty-btn:hover {
    color: var(--color-gold);
    background: rgba(201, 168, 76, 0.1);
}

.card-list-qty {
    color: var(--color-purple-light);
    font-weight: 600;
    font-size: 0.9rem;
    min-width: 20px;
    text-align: center;
}


.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 1rem;
    background: rgba(123, 47, 190, 0.15);
    border-bottom: 1px solid var(--border-color);
}

.category-name {
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    color: var(--color-gold);
    font-weight: 600;
}

.category-count {
    background: rgba(123, 47, 190, 0.3);
    color: var(--color-purple-light);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

.category-cards {
    display: flex;
    flex-direction: column;
}

/* Ligne de carte */




/* Barre de progression 100 cartes */
.sidebar-stats {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.sidebar-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sidebar-stat-label {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.sidebar-stat-value {
    color: var(--color-gold);
    font-weight: 700;
    font-size: 0.85rem;
}

.progress-100 {
    background: var(--bg-dark);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}

.progress-100-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-purple), var(--color-purple-light));
    border-radius: 6px;
    transition: width 0.3s ease;
}

/* ===== VUE DECK RESPONSIVE ===== */
.view-deck-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    align-items: start;
}


@media (max-width: 800px) {
    .view-deck-layout { grid-template-columns: 1fr; }
    .deck-sidebar { position: static; }
}


/* Preview carte — toujours visible */
.card-hover-wrapper {
    position: static;
    flex-shrink: 0;
}




/* ===== VUE DECK PAR CATÉGORIE ===== */
.view-deck-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .view-deck-layout { grid-template-columns: 1fr; }
    .deck-sidebar { position: static; }
}

.deck-categories {
    columns: 4;
    column-gap: 1rem;
}

@media (max-width: 1600px) { .deck-categories { columns: 3; } }
@media (max-width: 1200px) { .deck-categories { columns: 2; } }
@media (max-width: 900px)  { .deck-categories { columns: 1; } }

.category-column {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    break-inside: avoid;
    margin-bottom: 1rem;
    display: inline-block;
    width: 100%;
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background: rgba(123, 47, 190, 0.15);
    border-bottom: 1px solid var(--border-color);
}

.category-name {
    font-family: 'Cinzel', serif;
    font-size: 0.82rem;
    color: var(--color-gold);
    font-weight: 600;
}

.category-count {
    background: rgba(123, 47, 190, 0.3);
    color: var(--color-purple-light);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.1rem 0.5rem;
    border-radius: 10px;
}

.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
    gap: 0.5rem;
    cursor: default;
}

.card-row:hover { background: rgba(201, 168, 76, 0.06); }
.card-row:last-child { border-bottom: none; }

.card-row-name {
    flex: 1;
    font-size: 0.82rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-row-right {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Quantité */
.card-qty-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.qty-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.55rem;
    padding: 1px 4px;
    border-radius: 3px;
    line-height: 1;
    transition: color 0.2s, background 0.2s;
}

.qty-btn:hover {
    color: var(--color-gold);
    background: rgba(201, 168, 76, 0.1);
}

.card-list-qty {
    color: var(--color-purple-light);
    font-weight: 700;
    font-size: 0.82rem;
    min-width: 16px;
    text-align: center;
}

/* Sidebar stats */
.sidebar-stats {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
}

.sidebar-stat {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.sidebar-stat-label { color: var(--color-text-muted); font-size: 0.85rem; }
.sidebar-stat-value { color: var(--color-gold); font-weight: 700; font-size: 0.85rem; }

.progress-100 {
    background: var(--bg-dark);
    border-radius: 6px;
    height: 8px;
    overflow: hidden;
}

.progress-100-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-purple), var(--color-purple-light));
    border-radius: 6px;
    transition: width 0.3s ease;
}


.card-row-ghost {
    opacity: 0.3;
    background: rgba(123, 47, 190, 0.2);
    border: 1px dashed var(--color-purple);
}


/* ===== EXPORT ===== */
.export-layout {
    max-width: 800px;
}

.export-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.export-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.export-textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    color: var(--color-text);
    font-family: monospace;
    font-size: 0.85rem;
    line-height: 1.7;
    resize: vertical;
    min-height: 500px;
}

/* ===== PAGE RECHERCHE AVANCÉE ===== */
.search-main-bar {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.search-main-bar input {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
}

.search-main-bar input:focus { outline: none; border-color: var(--color-purple); }

.advanced-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.advanced-toggle {
    padding: 0.75rem 1rem;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 0.9rem;
    transition: background 0.15s;
    user-select: none;
}

.advanced-toggle:hover { background: rgba(255,255,255,0.03); }

.advanced-content {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.advanced-group { display: flex; flex-direction: column; gap: 0.5rem; }

.advanced-label {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.advanced-select {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
}

.advanced-input {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    width: 80px;
}

/* Couleurs */
.color-filters { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.color-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.15s, border-color 0.15s;
    opacity: 0.6;
}

.color-btn:hover { transform: scale(1.1); opacity: 1; }
.color-btn.active { border-color: var(--color-gold); opacity: 1; transform: scale(1.1); }

.color-w { background: #f9f3e3; }
.color-u { background: #3b8bd4; }
.color-b { background: #444441; }
.color-r { background: #d85a30; }
.color-g { background: #3b6d11; }
.color-c { background: #888780; }

.color-logic { display: flex; gap: 1rem; font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.3rem; }
.color-logic label { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; }

/* Rareté */
.rarity-filters { display: flex; gap: 0.4rem; }

.rarity-btn {
    width: 32px; height: 32px;
    border-radius: 6px;
    border: 2px solid var(--border-color);
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    background: var(--bg-dark);
    color: var(--color-text-muted);
    transition: all 0.15s;
}

.rarity-btn:hover { border-color: var(--color-text-muted); color: var(--color-text); }
.rarity-btn.active { border-color: var(--color-gold); color: var(--color-gold); }
.rarity-u { color: #60aaef; }
.rarity-r { color: #e8c97a; }
.rarity-m { color: #e87a45; }

/* Résultats */
.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

.view-toggle { display: flex; gap: 0.5rem; }

.view-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.15s;
}

.view-btn.active { border-color: var(--color-gold); color: var(--color-gold); }

.search-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Carte résultat grille */
.result-card { position: relative; cursor: pointer; }

.result-img-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
}

.result-img-wrapper:hover { border-color: var(--color-gold); transform: translateY(-4px); }

.result-img { width: 100%; border-radius: 8px; display: block; }

.result-no-img {
    height: 220px;
    background: var(--bg-card);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem;
    border-radius: 8px;
}

.result-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex; align-items: flex-end; justify-content: center;
    padding-bottom: 0.75rem;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 8px;
}

.result-img-wrapper:hover .result-overlay { opacity: 1; }

.result-add-btn {
    background: var(--color-purple);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
}

.result-badge {
    position: absolute; top: 8px; left: 8px;
    background: rgba(29,158,117,0.9);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.result-name {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-in-deck .result-img-wrapper { border-color: rgba(29,158,117,0.5); }

/* Liste */
.search-results-list .result-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.2s;
}

.search-results-list .result-card:hover { border-color: var(--border-gold); }

.result-list-img { width: 36px; height: 50px; object-fit: cover; border-radius: 4px; }
.result-list-info { flex: 1; display: flex; flex-direction: column; }
.result-list-name { font-weight: 600; font-size: 0.9rem; }
.result-list-type { font-size: 0.78rem; color: var(--color-text-muted); }
.result-list-mana { font-size: 0.82rem; color: var(--color-gold); }
.result-badge-list { color: #2ec99a; font-size: 0.78rem; font-weight: 600; }

.search-loading, .search-empty {
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
    font-size: 0.95rem;
}

/* Popup */
.popup-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.popup-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 2rem;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

.popup-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.5rem;
}

.popup-card-img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border-gold);
}

.popup-card-name {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.2rem;
    margin-bottom: 0.3rem;
}

.popup-card-type {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
}

.popup-card-text {
    font-size: 0.82rem;
    color: var(--color-text);
    line-height: 1.6;
    margin-bottom: 1rem;
    max-height: 120px;
    overflow-y: auto;
}

.popup-category {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.popup-category label {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cmc-filter { display: flex; gap: 0.5rem; align-items: center; }

/* ===== POPUP CATÉGORIES ===== */
.popup-card {
    max-width: 680px;
}

.popup-layout {
    grid-template-columns: 220px 1fr;
}

.popup-cats-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    min-height: 36px;
}

.cat-tag {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(123, 47, 190, 0.2);
    border: 1px solid rgba(123, 47, 190, 0.4);
    border-radius: 6px;
    padding: 0.3rem 0.6rem;
    font-size: 0.85rem;
    color: var(--color-purple-light);
}

.cat-tag button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.75rem;
    padding: 0;
    line-height: 1;
    transition: color 0.15s;
}

.cat-tag button:hover { color: #e06c75; }

.popup-add-cat {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.popup-warning {
    color: #e8a030;
    font-size: 0.85rem;
    background: rgba(186, 117, 23, 0.1);
    border: 1px solid rgba(186, 117, 23, 0.3);
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    display: block;
    margin-bottom: 0.75rem;
}

.popup-already { margin-bottom: 0.5rem; }

/* ===== POPUP DÉTAIL CARTE ===== */
.popup-detail-card {
    max-width: 820px;
    width: 95%;
    position: relative;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.popup-close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    z-index: 10;
}

.popup-close-btn:hover { color: var(--color-text); }

.popup-detail-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 1.5rem;
    overflow: hidden;
    flex: 1;
}

.popup-detail-left {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.popup-detail-right {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    overflow-y: auto;
    max-height: 600px;
    padding-right: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 190, 0.3) transparent;
}

.popup-detail-right::-webkit-scrollbar {
    width: 4px;
}

.popup-detail-right::-webkit-scrollbar-track {
    background: transparent;
}

.popup-detail-right::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 190, 0.3);
    border-radius: 4px;
}

.popup-detail-right::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 47, 190, 0.5);
}

.detail-qty-section, .detail-cat-section {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.detail-qty-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.4rem 0.75rem;
    width: fit-content;
}

.detail-qty-btn {
    background: none;
    border: none;
    color: var(--color-gold);
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 0 0.25rem;
    line-height: 1;
    transition: opacity 0.2s;
}

.detail-qty-btn:hover { opacity: 0.7; }

#detail-qty {
    color: var(--color-text);
    font-weight: 700;
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.detail-mana {
    color: var(--color-gold);
    font-size: 0.9rem;
}

.detail-divider {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 0.25rem 0;
}

.detail-oracle-text {
    color: var(--color-text);
    font-size: 0.88rem;
    line-height: 1.7;
    white-space: pre-line;
}

.detail-section-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.detail-rulings {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ruling-item {
    background: var(--bg-dark);
    border-left: 2px solid var(--color-purple);
    border-radius: 0 6px 6px 0;
    padding: 0.5rem 0.75rem;
}

.ruling-date {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.ruling-item p {
    font-size: 0.82rem;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0;
}

.cat-add-plus {
    width: 32px;
    height: 32px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.cat-add-plus:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

/* ===== SUGGESTIONS AMÉLIORÉES ===== */
.suggestions-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 190, 0.3) transparent;
}

.suggestions-list::-webkit-scrollbar {
    width: 4px;
}

.suggestions-list::-webkit-scrollbar-track {
    background: transparent;
}

.suggestions-list::-webkit-scrollbar-thumb {
    background: rgba(123, 47, 190, 0.3);
    border-radius: 4px;
}

.suggestions-list::-webkit-scrollbar-thumb:hover {
    background: rgba(123, 47, 190, 0.5);
}

.suggestion-item {
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.suggestion-item:hover {
    border-color: var(--border-gold);
    background: rgba(201, 168, 76, 0.05);
}

.suggestion-added {
    border-color: rgba(29, 158, 117, 0.5) !important;
    background: rgba(29, 158, 117, 0.05) !important;
}

.suggestion-added .suggestion-name::after {
    content: ' ✓';
    color: #2ec99a;
    font-size: 0.8rem;
}

/* ===== SUPPRESSION DECK ===== */
.deck-card-wrapper {
    position: relative;
}

.deck-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(220, 53, 69, 0.85);
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    color: white;
    font-size: 0.8rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    z-index: 10;
}

.deck-card-wrapper:hover .deck-delete-btn {
    display: flex;
}

.deck-delete-btn:hover {
    background: rgba(220, 53, 69, 1);
    transform: scale(1.1);
}

/* ===== DASHBOARD REFONTE ===== */
.stats-grid-2 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    max-width: 750px;
}

.dash-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.chart-card-wide { grid-column: span 1; }

.chart-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.chart-subtitle {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

/* Filtre catégories mana */
.mana-filter-dropdown { position: relative; }

.mana-filter-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.3rem 0.75rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    transition: border-color 0.2s;
    font-family: 'Raleway', sans-serif;
}

.mana-filter-btn:hover { border-color: var(--color-gold); color: var(--color-gold); }

.mana-filter-panel {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 10px;
    padding: 0.75rem;
    z-index: 100;
    min-width: 200px;
    max-height: 280px;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 190, 0.3) transparent;
}

.mana-filter-panel::-webkit-scrollbar { width: 4px; }
.mana-filter-panel::-webkit-scrollbar-track { background: transparent; }
.mana-filter-panel::-webkit-scrollbar-thumb { background: rgba(123, 47, 190, 0.3); border-radius: 4px; }

.mana-filter-actions {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.mana-filter-actions button {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    transition: all 0.15s;
}

.mana-filter-actions button:hover { border-color: var(--color-gold); color: var(--color-gold); }

.mana-cat-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--color-text);
}

.mana-cat-check input { cursor: pointer; accent-color: var(--color-purple); }

/* Breakdown catégories et couleurs */
.categories-breakdown, .colors-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 320px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.cat-breakdown-item { display: flex; flex-direction: column; gap: 0.25rem; }

.cat-breakdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cat-breakdown-name {
    font-size: 0.82rem;
    color: var(--color-text);
}

.cat-breakdown-count {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.cat-breakdown-bar {
    height: 5px;
    background: var(--bg-dark);
    border-radius: 3px;
    overflow: hidden;
}

.cat-breakdown-fill {
    height: 100%;
    border-radius: 3px;
    opacity: 0.8;
    transition: width 0.3s ease;
}

.chartjs-legend li span {
    color: #e8e0d0 !important;
}

/* ===== CHATBOT ===== */
.chat-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
}

.chat-header { margin-bottom: 1.5rem; }

.chat-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 1.5rem;
    flex: 1;
    min-height: 0;
}

.chat-main {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.chat-msg { display: flex; max-width: 85%; }
.chat-msg-user { align-self: flex-end; }
.chat-msg-bot { align-self: flex-start; }

.chat-msg-content {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.chat-msg-user .chat-msg-content {
    background: var(--color-purple);
    color: white;
    border-bottom-right-radius: 4px;
}

.chat-msg-bot .chat-msg-content {
    background: var(--bg-dark);
    color: var(--color-text);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

/* Indicateur de frappe */
.chat-typing { display: flex; gap: 4px; align-items: center; padding: 0.75rem 1rem; }
.chat-typing span {
    width: 8px; height: 8px;
    background: var(--color-text-muted);
    border-radius: 50%;
    animation: typing 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%,60%,100% { opacity: 0.3; transform: scale(1); } 30% { opacity: 1; transform: scale(1.2); } }

/* Input */
.chat-input-area {
    border-top: 1px solid var(--border-color);
    padding: 1rem;
    background: var(--bg-card);
}

.chat-suggestions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.chat-suggestion {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    transition: all 0.15s;
}

.chat-suggestion:hover { border-color: var(--color-gold); color: var(--color-gold); }

.chat-input-row { display: flex; gap: 0.75rem; }

.chat-input-row textarea {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    resize: none;
    min-height: 44px;
    max-height: 150px;
    overflow-y: auto;
    line-height: 1.5;
}
.chat-input-row textarea:focus { outline: none; border-color: var(--color-purple); }

.chat-input-row input:focus { outline: none; border-color: var(--color-purple); }

#chat-send {
    background: var(--color-purple);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.7rem 1.5rem;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    transition: opacity 0.2s;
}

#chat-send:hover { opacity: 0.85; }

/* Sidebar */
.chat-sidebar { display: flex; flex-direction: column; gap: 1rem; overflow-y: auto; }

.chat-sidebar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
}

.card-display-empty {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    text-align: center;
    padding: 1rem;
}

.chat-deck-list { display: flex; flex-direction: column; gap: 0.4rem; }

.chat-deck-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    transition: border-color 0.15s;
}

.chat-deck-item:hover { border-color: var(--border-gold); }

.chat-deck-name { font-size: 0.85rem; color: var(--color-text); }
.chat-deck-count { font-size: 0.78rem; color: var(--color-purple-light); font-weight: 600; }

/* ===== CHAT WIDGET FLOTTANT ===== */
#chat-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

#chat-toggle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-purple);
    border: none;
    cursor: pointer;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(123, 47, 190, 0.5);
    transition: transform 0.2s, opacity 0.2s;
    flex-shrink: 0;
}

#chat-toggle:hover { transform: scale(1.1); }

#chat-window {
    width: min(420px, calc(100vw - 2rem));
    height: min(580px, calc(100vh - 120px));
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}

.chat-win-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: rgba(123, 47, 190, 0.2);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-gold);
    flex-shrink: 0;
}

.chat-win-header button {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.2s;
    padding: 0.2rem 0.4rem;
}

.chat-win-header button:hover { color: var(--color-text); }

.chat-win-messages {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
    min-height: 0;
}

.cw-msg { display: flex; max-width: 100%; }
.cw-msg-user { justify-content: flex-end; }
.cw-msg-bot { justify-content: flex-start; }

.cw-msg-content {
    max-width: 88%;
    padding: 0.55rem 0.8rem;
    border-radius: 12px;
    font-size: 0.83rem;
    line-height: 1.5;
    word-break: break-word;
}

.cw-msg-user .cw-msg-content {
    background: var(--color-purple);
    color: white;
    border-bottom-right-radius: 4px;
}

.cw-msg-bot .cw-msg-content {
    background: var(--bg-dark);
    color: var(--color-text);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
}

.chat-win-suggestions {
    display: flex;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.cw-suggestion {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.2rem 0.6rem;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    transition: all 0.15s;
    white-space: nowrap;
}

.cw-suggestion:hover { border-color: var(--color-gold); color: var(--color-gold); }

.chat-win-input {
    display: flex;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.chat-win-input textarea {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    resize: none;
    min-height: 38px;
    max-height: 120px;
    overflow-y: auto;
    line-height: 1.5;
}
.chat-win-input textarea:focus { outline: none; border-color: var(--color-purple); }

.chat-win-input input:focus { outline: none; border-color: var(--color-purple); }

.chat-win-input button {
    background: var(--color-purple);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    font-size: 0.95rem;
    transition: opacity 0.2s;
    flex-shrink: 0;
}

.chat-win-input button:hover { opacity: 0.85; }

/* Card area - inline dans les messages */
.cw-card-area {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-dark);
    flex-shrink: 0;
}

.cw-card-area img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    object-position: top;
    border-radius: 4px;
    border: 1px solid var(--border-gold);
    flex-shrink: 0;
}

.cw-card-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    min-width: 0;
}

.cw-card-actions select {
    font-size: 0.78rem;
    padding: 0.25rem 0.4rem;
    width: 100%;
}

.cw-card-actions button {
    font-size: 0.78rem;
    padding: 0.25rem 0.5rem;
}

#cw-add-status {
    font-size: 0.75rem;
    text-align: center;
}

/* ===== AMIS ===== */
.friends-search-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.friends-search-bar {
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.friends-search-bar input {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.7rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s;
}

.friends-search-bar input:focus {
    outline: none;
    border-color: var(--color-purple);
}

.friend-search-results {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.friend-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.friend-search-empty {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    padding: 0.5rem;
}

.friends-section { margin-bottom: 2rem; }

.friends-section-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.pending-badge {
    background: rgba(216, 90, 48, 0.2);
    color: #e87a45;
    border: 1px solid rgba(216, 90, 48, 0.3);
    border-radius: 12px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    font-family: 'Raleway', sans-serif;
}

.friends-count {
    background: rgba(123, 47, 190, 0.2);
    color: var(--color-purple-light);
    border: 1px solid rgba(123, 47, 190, 0.3);
    border-radius: 12px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
    font-family: 'Raleway', sans-serif;
}

.friends-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.friend-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s;
}

.friend-card:hover { border-color: var(--border-gold); }

.friend-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: white;
    flex-shrink: 0;
}

.friend-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.friend-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--color-text);
}

.friend-sub {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.friend-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-accept {
    background: rgba(29, 158, 117, 0.2);
    border: 1px solid rgba(29, 158, 117, 0.4);
    color: #2ec99a;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.btn-accept:hover { background: rgba(29, 158, 117, 0.4); }

.btn-decline {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #e06c75;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.btn-decline:hover { background: rgba(220, 53, 69, 0.3); }

.friend-badge-friend {
    color: #2ec99a;
    font-size: 0.82rem;
    font-weight: 600;
}

.friend-badge-pending {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    font-style: italic;
}

/* ===== DECK CIRCLES ===== */
.friend-search-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.friend-deck-previews {
    display: flex;
    gap: 0.3rem;
    align-items: center;
}

.friend-deck-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-gold);
    flex-shrink: 0;
}

.friend-deck-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
}

.friend-deck-circle-empty {
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.friend-deck-more {
    background: rgba(123, 47, 190, 0.3);
    border: 2px solid var(--color-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-purple-light);
}

/* ===== PROFIL ===== */
.profile-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 80px;
}

.profile-avatar-card {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-gold);
}

.profile-username {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.3rem;
    margin-bottom: 0.3rem;
}

.profile-email {
    color: var(--color-text-muted);
    font-size: 0.82rem;
    margin-bottom: 0.75rem;
}

.profile-bio {
    color: var(--color-text);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    font-style: italic;
}

.profile-badge {
    display: inline-block;
    background: rgba(123, 47, 190, 0.2);
    border: 1px solid rgba(123, 47, 190, 0.3);
    border-radius: 20px;
    padding: 0.2rem 0.75rem;
    font-size: 0.8rem;
    color: var(--color-purple-light);
    margin-bottom: 0.75rem;
}

.profile-since {
    color: var(--color-text-muted);
    font-size: 0.78rem;
}

.profile-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem;
}

.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.profile-stat {
    text-align: center;
    background: var(--bg-dark);
    border-radius: 8px;
    padding: 0.75rem 0.5rem;
}

.profile-stat-value {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 1.4rem;
    color: var(--color-gold);
    font-weight: 700;
}

.profile-stat-label {
    display: block;
    font-size: 0.72rem;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 0.2rem;
}

.profile-decks-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.75rem;
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.profile-deck-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-dark);
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.15s;
}

.profile-deck-item:hover { background: rgba(201,168,76,0.08); }

.profile-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.profile-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.profile-form-card textarea {
    width: 100%;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    resize: vertical;
}

.profile-form-card textarea:focus {
    outline: none;
    border-color: var(--color-purple);
}

.profile-danger-card {
    border-color: rgba(220, 53, 69, 0.3);
}

/* Color picker */
.color-picker-row {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.color-option input[type="radio"] {
    display: none;
}

.color-swatch {
    display: block;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
}

.color-option input[type="radio"]:checked + .color-swatch {
    border-color: var(--color-gold);
    transform: scale(1.2);
}

.color-swatch:hover { transform: scale(1.1); }


.profile-avatar-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1rem;
    border: 3px solid var(--border-gold);
}

.profile-avatar-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-zone {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px dashed var(--border-color);
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.avatar-upload-zone:hover { border-color: var(--color-gold); }

.avatar-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--color-text-muted);
    font-size: 0.72rem;
    text-align: center;
    padding: 0.5rem;
}

.avatar-upload-placeholder span { font-size: 1.5rem; }

/* ── ICÔNE MESSAGE ── */
#msg-btn {
    position: fixed;
    bottom: 1.5rem;
    right: 5rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--color-gold);
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(201,168,76,0.4);
    transition: transform 0.2s;
    z-index: 999;
}
#msg-btn:hover { transform: scale(1.1); }

#msg-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #e06c75;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
}

/* ── POPUP MESSAGERIE ── */
#msg-popup {
    position: fixed;
    top: 64px;
    right: 0;
    width: 33vw;
    min-width: 700px;
    height: calc(100vh - 64px);
    background: var(--bg-dark);
    border-left: 1px solid var(--border-gold);
    z-index: 998;
    display: grid;
    grid-template-columns: 200px 1fr 160px;
    grid-template-rows: 1fr;
    overflow: hidden;
    box-shadow: -8px 0 32px rgba(0,0,0,0.5);
    animation: slideFromRight 0.25s ease;
}

@keyframes slideFromRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

#msg-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1rem;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s;
}
#msg-close:hover { color: var(--color-text); }

/* ── COLONNE AMIS ── */
#msg-friends-col {
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
}

#msg-friends-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#msg-friends-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.msg-friend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.9rem;
    cursor: pointer;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s;
}
.msg-friend-item:hover { background: rgba(201,168,76,0.06); }
.msg-friend-item.active { background: rgba(123,47,190,0.15); border-left: 2px solid var(--color-purple); }

.msg-friend-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}
.msg-friend-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msg-friend-info {
    flex: 1;
    min-width: 0;
}
.msg-friend-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.msg-friend-preview {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-unread-badge {
    background: var(--color-purple);
    color: white;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── COLONNE CONVERSATION ── */
#msg-conv-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#msg-conv-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
    background: var(--bg-card);
}

#msg-conv-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.msg-bubble {
    max-width: 80%;
    padding: 0.5rem 0.8rem;
    border-radius: 12px;
    font-size: 0.84rem;
    line-height: 1.5;
    word-break: break-word;
}
.msg-bubble-me {
    align-self: flex-end;
    background: var(--color-purple);
    color: white;
    border-bottom-right-radius: 4px;
}
.msg-bubble-them {
    align-self: flex-start;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--color-text);
    border-bottom-left-radius: 4px;
}
.msg-bubble-time {
    font-size: 0.68rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.2rem;
    text-align: right;
}
.msg-bubble-them .msg-bubble-time { color: var(--color-text-muted); }

#msg-conv-input-area {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-card);
    flex-shrink: 0;
    align-items: flex-end;
}

#msg-input {
    flex: 1;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.88rem;
    resize: none;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.5;
}
#msg-input:focus { outline: none; border-color: var(--color-purple); }

/* ── COLONNE CARTES ── */
#msg-cards-col {
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-card);
}
#msg-cards-header {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}
#msg-cards-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.msg-card-thumb {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s;
    flex-shrink: 0;
}
.msg-card-thumb:hover { border-color: var(--border-gold); }

.msg-card-thumb-name {
    font-size: 0.78rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.msg-card-thumb-delete {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 0.7rem;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}
.msg-card-thumb-delete:hover { color: #e06c75; }

#msg-conv-input-area button {
    background: var(--color-purple);
    color: white;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.1s;
}
#msg-conv-input-area button:hover { 
    background: var(--color-purple-light); 
    transform: translateY(-1px);
}

/* ── COULEURS CARTES ── */
.card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 0.75rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    transition: background 0.15s, filter 0.15s;
    gap: 0.5rem;
    cursor: default;
}

.card-row:hover {
    filter: brightness(1.15);
}

.card-row:last-child { border-bottom: none; }

/* ── RULINGS SIDEBAR ── */
.sidebar-rulings-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 0.9rem;
    margin-top: 0.5rem;
}

.sidebar-rulings-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.sidebar-rulings-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

/* ── FILTRE DECK ── */
.deck-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.6rem 0.9rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    box-sizing: border-box;
}

.deck-filter-bar .advanced-select {
    width: auto;
    min-width: 200px;
}

.deck-filter-label {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    font-weight: 600;
    white-space: nowrap;
}

/* ── LÉGALITÉ ── */
.legality-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.legality-legal {
    background: rgba(46,201,154,0.15);
    border: 1px solid rgba(46,201,154,0.4);
    color: #2ec99a;
}

.legality-illegal {
    background: rgba(220,53,69,0.15);
    border: 1px solid rgba(220,53,69,0.4);
    color: #e06c75;
}

.card-row-illegal {
    background: rgba(220,53,69,0.12) !important;
    border-left-color: #e06c75 !important;
    outline: 1px solid rgba(220,53,69,0.4);
}

.card-illegal-badge {
    font-size: 0.68rem;
    background: rgba(220,53,69,0.2);
    color: #e06c75;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    font-weight: 700;
    flex-shrink: 0;
}

/* ── RECHERCHE AVANCÉE AMÉLIORÉE ── */
.adv-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.adv-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.adv-input-full {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: var(--color-text);
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    width: 100%;
}

.adv-input-full:focus {
    outline: none;
    border-color: var(--color-purple);
}

.adv-stat-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.adv-type-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.3rem;
}

.adv-type-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--color-text-muted);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    cursor: pointer;
    font-family: 'Raleway', sans-serif;
    transition: all 0.15s;
}

.adv-type-btn:hover { border-color: var(--color-gold); color: var(--color-gold); }
.adv-type-btn.active { border-color: var(--color-purple); color: var(--color-purple-light); background: rgba(123,47,190,0.15); }

.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.pagination-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--color-gold);
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 1rem;
    transition: border-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn:hover { border-color: var(--color-gold); }
.pagination-btn:disabled { opacity: 0.3; cursor: not-allowed; }

#pagination-info {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 0.95rem;
    min-width: 80px;
    text-align: center;
}

.detail-rulings {
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.detail-rulings::-webkit-scrollbar {
    width: 4px;
}

.detail-rulings::-webkit-scrollbar-track {
    background: transparent;
}

.detail-rulings::-webkit-scrollbar-thumb {
    background: rgba(123,47,190,0.3);
    border-radius: 4px;
}

.detail-rulings::-webkit-scrollbar-thumb:hover {
    background: rgba(123,47,190,0.5);
}

/* ── CALCULATEUR HYPERGÉOMÉTRIQUE ── */
.hyper-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: var(--bg-dark);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.hyper-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.hyper-label {
    color: var(--color-text-muted);
    font-size: 0.88rem;
    white-space: nowrap;
}

.hyper-counter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0.2rem 0.5rem;
}

.hyper-counter button {
    background: none;
    border: none;
    color: var(--color-gold);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.3rem;
    transition: opacity 0.2s;
    font-weight: 700;
}

.hyper-counter button:hover { opacity: 0.7; }

.hyper-counter span {
    font-family: 'Cinzel', serif;
    font-size: 1rem;
    color: var(--color-text);
    min-width: 24px;
    text-align: center;
    font-weight: 700;
}

.hyper-table-wrapper {
    overflow-x: auto;
}

.hyper-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.hyper-table thead tr {
    background: rgba(123,47,190,0.15);
    border-bottom: 1px solid var(--border-color);
}

.hyper-table th {
    padding: 0.6rem 0.9rem;
    text-align: left;
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    color: var(--color-gold);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hyper-table td {
    padding: 0.5rem 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--color-text);
}

.hyper-table tr:last-child td { border-bottom: none; }
.hyper-table tr:hover td { background: rgba(201,168,76,0.04); }

.hyper-td-pct {
    font-weight: 700;
    font-family: 'Cinzel', serif;
}

.hyper-bar-cell { width: 200px; }

.hyper-bar-bg {
    background: var(--bg-dark);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    width: 100%;
}

.hyper-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.4s ease, background 0.4s ease;
}

#deck-intention {
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

#deck-intention::-webkit-scrollbar {
    width: 4px;
}

#deck-intention::-webkit-scrollbar-track {
    background: transparent;
}

#deck-intention::-webkit-scrollbar-thumb {
    background: rgba(123,47,190,0.3);
    border-radius: 4px;
}

#deck-intention::-webkit-scrollbar-thumb:hover {
    background: rgba(123,47,190,0.5);
}

#deck-intention:focus {
    outline: none;
    border-color: var(--color-purple);
}

/* ── LAYOUT ── */
.sim-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.sim-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.sim-hint { color: var(--color-text-muted); font-size: 0.82rem; margin-bottom: 0.75rem; }

.sim-section-label {
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
}

.sim-deck-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.sim-deck-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.sim-deck-item:hover { border-color: var(--border-gold); background: rgba(201,168,76,0.05); }
.sim-deck-item.selected { border-color: var(--color-purple); background: rgba(123,47,190,0.12); }

.sim-deck-thumb {
  width: 36px; height: 50px;
  border-radius: 4px; overflow: hidden;
  flex-shrink: 0; background: var(--bg-card);
  display: flex; align-items: center; justify-content: center;
}
.sim-deck-thumb img { width: 100%; height: 100%; object-fit: cover; object-position: top; }

.sim-deck-info { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.sim-deck-name { font-weight: 600; font-size: 0.85rem; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-deck-sub { font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sim-deck-check { color: var(--color-purple-light); font-weight: 700; opacity: 0; transition: opacity 0.2s; flex-shrink: 0; }
.sim-deck-item.selected .sim-deck-check { opacity: 1; }

.sim-badge {
  background: rgba(123,47,190,0.25); color: var(--color-purple-light);
  border-radius: 12px; padding: 0.1rem 0.6rem;
  font-size: 0.78rem; font-family: 'Raleway', sans-serif; font-weight: 600; margin-left: 0.5rem;
}

.sim-arena {
  min-height: 80px; display: flex; flex-wrap: wrap;
  gap: 0.5rem; align-items: flex-start;
}

.sim-arena-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; width: 100%; padding: 1rem;
  color: var(--color-text-muted); font-size: 0.85rem; gap: 0.4rem; text-align: center;
}

.sim-arena-chip {
  display: flex; align-items: center; gap: 0.4rem;
  background: rgba(123,47,190,0.2); border: 1px solid rgba(123,47,190,0.4);
  border-radius: 20px; padding: 0.25rem 0.6rem 0.25rem 0.4rem;
  font-size: 0.82rem; color: var(--color-purple-light);
}

.sim-arena-chip img { width: 22px; height: 30px; object-fit: cover; object-position: top; border-radius: 3px; }
.sim-arena-chip button { background: none; border: none; color: var(--color-text-muted); cursor: pointer; font-size: 0.75rem; }

.sim-run-btn { font-size: 1rem; padding: 0.9rem; letter-spacing: 0.5px; }
.sim-error {
  margin-top: 0.75rem; padding: 0.6rem 0.9rem;
  background: rgba(220,53,69,0.1); border: 1px solid rgba(220,53,69,0.3);
  border-radius: 8px; color: #e06c75; font-size: 0.85rem;
}

.sim-results-empty {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 400px; text-align: center;
  color: var(--color-text-muted); background: var(--bg-card);
  border: 1px solid var(--border-color); border-radius: 12px; padding: 3rem; gap: 0.75rem;
}
.sim-results-empty-icon { font-size: 3rem; }
.sim-results-empty h3 { font-family: 'Cinzel', serif; color: var(--color-gold); font-size: 1.2rem; }

.sim-loading {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 400px;
  background: var(--bg-card); border: 1px solid var(--border-gold);
  border-radius: 12px; padding: 3rem; gap: 1rem; text-align: center;
}
.sim-loading h3 { font-family: 'Cinzel', serif; color: var(--color-gold); }
.sim-loading p { color: var(--color-text-muted); font-size: 0.9rem; }
.sim-loading-orb {
  width: 60px; height: 60px; border-radius: 50%;
  background: radial-gradient(circle, var(--color-purple-light), var(--color-purple));
  animation: pulse 1.5s ease-in-out infinite;
  box-shadow: 0 0 30px rgba(123,47,190,0.6);
}
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(123,47,190,0.6); }
  50% { transform: scale(1.15); box-shadow: 0 0 50px rgba(123,47,190,0.9); }
}

.sim-winner-banner {
  background: linear-gradient(135deg, rgba(201,168,76,0.15), rgba(123,47,190,0.15));
  border: 1px solid var(--border-gold); border-radius: 12px;
  padding: 1.5rem; display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1rem;
}
.sim-winner-crown { font-size: 2.5rem; }
.sim-winner-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 1px; color: var(--color-text-muted); font-weight: 600; }
.sim-winner-name { font-family: 'Cinzel', serif; font-size: 1.4rem; color: var(--color-gold); font-weight: 700; margin: 0.2rem 0; }
.sim-winner-condition { color: var(--color-text-muted); font-size: 0.88rem; font-style: italic; }

.sim-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.sim-stat {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 10px; padding: 0.9rem; text-align: center;
}
.sim-stat-value { font-family: 'Cinzel', serif; font-size: 1.3rem; font-weight: 700; color: var(--color-gold); }
.sim-stat-label { font-size: 0.72rem; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 0.2rem; }
.sim-stat-sub { font-size: 0.78rem; color: var(--color-text-muted); margin-top: 0.15rem; }

.sim-insights { display: flex; flex-direction: column; gap: 0.6rem; }
.sim-insight {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.6rem 0.75rem; background: var(--bg-dark);
  border-radius: 8px; border-left: 3px solid var(--color-purple);
  font-size: 0.85rem; color: var(--color-text); line-height: 1.5;
}
.sim-insight-num { font-family: 'Cinzel', serif; color: var(--color-purple-light); font-weight: 700; font-size: 0.9rem; flex-shrink: 0; }

.sim-elim-list { display: flex; flex-direction: column; gap: 0.5rem; }
.sim-elim-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.5rem 0.75rem; background: rgba(220,53,69,0.08);
  border: 1px solid rgba(220,53,69,0.2); border-radius: 8px; font-size: 0.85rem;
}
.sim-elim-turn { background: rgba(220,53,69,0.2); color: #e06c75; padding: 0.1rem 0.5rem; border-radius: 4px; font-size: 0.75rem; font-weight: 700; }

/* ── REPLAY ── */
/* ── REPLAY ── */
#replay-popup {
  background: #0d0a14 !important;
}

.replay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  background: #0d0a14;
  border-bottom: 2px solid var(--border-gold);
  height: 56px;
  position: relative;
  z-index: 1;
}

.replay-turn-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

#replay-turn-label {
  font-family: 'Cinzel', serif;
  color: var(--color-gold);
  font-size: 1.1rem;
  font-weight: 700;
}

#replay-player-label {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.replay-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.replay-nav button {
  background: #1a1225;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--color-gold);
  padding: 0.5rem 1.25rem;
  cursor: pointer;
  font-size: 0.85rem;
  font-family: 'Raleway', sans-serif;
  transition: all 0.2s;
}

.replay-nav button:hover { border-color: var(--color-gold); background: rgba(201,168,76,0.1); }
.replay-nav button:disabled { opacity: 0.3; cursor: not-allowed; }

#replay-progress {
  font-family: 'Cinzel', serif;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  min-width: 70px;
  text-align: center;
}

.replay-close {
  background: none;
  border: 1px solid rgba(220,53,69,0.4);
  border-radius: 8px;
  color: #e06c75;
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.replay-close:hover { background: rgba(220,53,69,0.15); }

.replay-board {
    height: calc(100vh - 56px);
    display: grid;
    grid-template-rows: 1.2fr 1.5fr auto;
    gap: 0.6rem;
    padding: 0.75rem;
    overflow: hidden;
    background: #0d0a14;
}

.replay-opponents {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
}

.replay-opponent-zone {
  background: #1a1225;
  border: 1px solid #2a2040;
  border-radius: 10px;
  padding: 0.6rem 0.75rem;
  flex: 1;
  max-width: 320px;
}

.replay-opponent-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.replay-opponent-name {
  font-family: 'Cinzel', serif;
  font-size: 0.78rem;
  color: var(--color-gold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.replay-life {
  background: rgba(220,53,69,0.2);
  color: #e06c75;
  border-radius: 4px;
  padding: 0.15rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

.replay-cards-row {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  min-height: 44px;
  align-items: flex-start;
}

.replay-middle {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 0.6rem;
    min-height: 0;
    overflow: hidden;
    max-height: 200px;  /* ← limiter la hauteur */
}

.replay-side-player {
  background: #1a1225;
  border: 1px solid #2a2040;
  border-radius: 10px;
  padding: 0.75rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.replay-turn-summary {
    background: #150f22;
    border: 1px solid rgba(123,47,190,0.4);
    border-radius: 10px;
    padding: 0.75rem 1rem;  /* ← padding réduit */
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(123,47,190,0.3) transparent;
}

.replay-turn-summary h4 {
  font-family: 'Cinzel', serif;
  color: var(--color-gold);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #2a2040;
}

#replay-phase-summary {
  font-size: 0.88rem;
  color: #c8c0d8;
  line-height: 1.8;
  white-space: pre-wrap;
}

.replay-active-player {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.replay-active-board {
  background: #0f1a16;
  border: 1px solid rgba(46,201,154,0.25);
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 80px;
}

.replay-active-hand {
  background: #1a160a;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
  padding: 0.75rem;
  min-height: 70px;
}

.replay-section-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  font-weight: 700;
  margin-bottom: 0.5rem;
  font-family: 'Cinzel', serif;
}

/* ── MINI CARTE ── */
.sim-mini-card {
  width: 36px;
  height: 50px;
  border-radius: 3px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  transition: transform 0.15s, border-color 0.15s;
  flex-shrink: 0;
  background: var(--bg-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.45rem;
  color: var(--color-text-muted);
  text-align: center;
}

.sim-mini-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.sim-mini-card:hover {
  transform: scale(1.4);
  border-color: var(--color-gold);
  z-index: 10;
  position: relative;
}

.sim-mini-card.tapped {
  transform: rotate(90deg);
  opacity: 0.7;
}

.sim-mini-card.tapped:hover {
  transform: rotate(90deg) scale(1.4);
}

/* Carte main (face cachée) */
.sim-hand-card {
  width: 36px;
  height: 50px;
  border-radius: 3px;
  background: linear-gradient(135deg, #1a0a3a, #2a1a5a);
  border: 1px solid rgba(123,47,190,0.4);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  color: rgba(123,47,190,0.6);
  transition: transform 0.15s;
  flex-shrink: 0;
}

.sim-hand-card:hover {
  transform: scale(1.2) translateY(-4px);
  border-color: var(--color-purple);
}

.sim-progress-bar {
    width: 100%;
    max-width: 300px;
    height: 6px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.sim-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-purple), var(--color-gold));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ── SALT SCORE ── */
.salt-bar-wrapper {
    margin-top: 0.4rem;
}

.salt-bar-bg {
    height: 6px;
    background: var(--bg-dark);
    border-radius: 4px;
    overflow: hidden;
}

.salt-bar-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s ease;
}

.top-card-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.top-card-row:hover {
    border-color: var(--color-gold);
}

.btn-explore-commander {
    margin-top: 0.6rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px dashed var(--color-gold);
    color: var(--color-gold);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.btn-explore-commander:hover {
    background: rgba(201,168,76,0.1);
}

/* Section résultats */
.section-header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 0.5rem;
}
.results-count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}
.commanders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}
.commander-card-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    background: var(--bg-card);
    position: relative;
}
.commander-card-item:hover {
    border-color: var(--color-gold);
    transform: translateY(-3px);
}
.commander-card-item img {
    width: 100%;
    display: block;
}
.commander-card-item .card-num-decks {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(0,0,0,0.75);
    color: var(--color-gold);
    font-size: 0.75rem;
    text-align: center;
    padding: 3px;
}
.commander-card-item .card-no-img {
    width: 100%;
    aspect-ratio: 0.716;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem;
}

/* Popup exploration */
.explore-popup-box {
    max-width: 640px;
    width: 95%;
}
.explore-filters { display: flex; flex-direction: column; gap: 1.5rem; padding: 1.5rem 0; }
.filter-section { display: flex; flex-direction: column; gap: 0.6rem; }
.filter-label { font-family: 'Cinzel', serif; color: var(--color-gold); font-size: 0.85rem; letter-spacing: 0.05em; }
.archetype-grid { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.archetype-btn {
    padding: 0.4rem 0.8rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--color-text-muted);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.archetype-btn:hover { border-color: var(--color-purple-light); color: var(--color-text); }
.archetype-btn.active { border-color: var(--color-purple); background: rgba(123,47,190,0.2); color: var(--color-text); }

.color-filter-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.color-filter-btn {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 2px solid transparent;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    opacity: 0.6;
}
.color-filter-btn.active { opacity: 1; transform: scale(1.05); }
.color-W { background: rgba(255,248,220,0.15); border-color: #f5e6a3; color: #f5e6a3; }
.color-W.active { background: rgba(245,230,163,0.25); }
.color-U { background: rgba(30,100,200,0.15); border-color: #6aabff; color: #6aabff; }
.color-U.active { background: rgba(106,171,255,0.25); }
.color-B { background: rgba(80,60,100,0.15); border-color: #b08fd4; color: #b08fd4; }
.color-B.active { background: rgba(176,143,212,0.25); }
.color-R { background: rgba(200,50,50,0.15); border-color: #ff7b7b; color: #ff7b7b; }
.color-R.active { background: rgba(255,123,123,0.25); }
.color-G { background: rgba(30,140,60,0.15); border-color: #6cd46c; color: #6cd46c; }
.color-G.active { background: rgba(108,212,108,0.25); }

.explore-popup-footer { display: flex; justify-content: flex-end; gap: 1rem; padding-top: 1rem; border-top: 1px solid var(--border-color); }

/* Popup détail commandant */
.commander-detail-box { max-width: 750px; width: 95%; }
.commander-detail-layout { display: flex; gap: 1.5rem; padding-top: 1rem; }
.commander-detail-img-col { flex: 0 0 240px; }
.commander-detail-img { width: 100%; border-radius: 12px; }
.commander-detail-info-col { flex: 1; display: flex; flex-direction: column; gap: 0.8rem; overflow-y: auto; max-height: 60vh; }
.detail-type-line { color: var(--color-text-muted); font-style: italic; }
.detail-colors { display: flex; gap: 0.3rem; flex-wrap: wrap; }
.detail-color-pip {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: bold;
}
.pip-W { background: #f5e6a3; color: #333; }
.pip-U { background: #6aabff; color: #fff; }
.pip-B { background: #b08fd4; color: #fff; }
.pip-R { background: #ff7b7b; color: #fff; }
.pip-G { background: #6cd46c; color: #fff; }
.pip-C { background: #ccc; color: #333; }
.detail-oracle-text {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.8rem;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-line;
}
.detail-rulings { display: flex; flex-direction: column; gap: 0.4rem; }
.detail-ruling-item {
    background: rgba(201,168,76,0.05);
    border-left: 2px solid var(--color-gold);
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-radius: 0 4px 4px 0;
}
.detail-num-decks { color: var(--color-text-muted); font-size: 0.85rem; }

/* Hover preview */


/* Loading */
.commanders-loading {
    grid-column: 1/-1;
    text-align: center;
    padding: 3rem;
    color: var(--color-text-muted);
}

/* ===== POPUP EXPLORER COMMANDANTS ===== */
.popup-box {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    padding: 2rem;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popup-header h2 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.2rem;
    margin: 0;
}

.popup-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.2s;
    line-height: 1;
    padding: 0.2rem 0.4rem;
}

.popup-close:hover { color: var(--color-text); }

/* Section résultats */
.section-header-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-gold);
    padding-bottom: 0.5rem;
}

.section-header-bar h2 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.1rem;
    margin: 0;
}

.results-count {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Grille commandants */
.commanders-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.commander-card-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    background: var(--bg-dark);
    position: relative;
}

.commander-card-item:hover {
    border-color: var(--color-gold);
    transform: translateY(-3px);
}

.commander-card-item img {
    width: 100%;
    display: block;
}

.card-num-decks {
    position: absolute;
    bottom: 0;
    left: 0; right: 0;
    background: rgba(0,0,0,0.75);
    color: var(--color-gold);
    font-size: 0.75rem;
    text-align: center;
    padding: 3px;
}

.card-no-img {
    width: 100%;
    aspect-ratio: 0.716;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-align: center;
    padding: 0.5rem;
}

/* Popup détail commandant (explorer) */
.commander-detail-box {
    max-width: 750px;
    width: 95%;
}

.commander-detail-layout {
    display: flex;
    gap: 1.5rem;
    padding-top: 1rem;
}

.commander-detail-img-col { flex: 0 0 240px; }

.commander-detail-img {
    width: 100%;
    border-radius: 12px;
}

.commander-detail-info-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    max-height: 60vh;
    padding-right: 0.5rem;
}

/* Bouton explorer */
.btn-explore-commander {
    margin-top: 0.6rem;
    width: 100%;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px dashed var(--color-gold);
    color: var(--color-gold);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-explore-commander:hover {
    background: rgba(201,168,76,0.1);
}

.card-hover-preview {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 220px;
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.7);
    display: none;
}

.card-hover-preview img { 
    width: 100%; 
    border-radius: 10px;
    border: 1px solid var(--border-gold);
}

.autocomplete-popup-box {
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 190, 0.3) transparent;
}



.need-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.need-badge {
    background: rgba(123,47,190,0.2);
    border: 1px solid rgba(123,47,190,0.4);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--color-purple-light);
}

.autocomplete-grid {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.autocomplete-section-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slot-count {
    background: rgba(201,168,76,0.15);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    font-size: 0.8rem;
    color: var(--color-gold);
}

.autocomplete-cards-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.autocomplete-card {
    width: 100px;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid var(--color-gold);
    transition: all 0.2s;
    position: relative;
}

.autocomplete-card img { width: 100%; display: block; }

.autocomplete-card.deselected {
    border-color: transparent;
    opacity: 0.35;
    filter: grayscale(60%);
}

.autocomplete-card-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.8);
    font-size: 0.65rem;
    padding: 2px 4px;
    text-align: center;
    color: var(--color-text);
}

.autocomplete-card-noimg {
    width: 100px;
    aspect-ratio: 0.716;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--color-text-muted);
    font-size: 0.7rem;
    text-align: center;
    padding: 0.3rem;
}

.autocomplete-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
}

.autocomplete-complete {
    text-align: center;
    padding: 2rem;
    color: #2ec99a;
    font-size: 1.1rem;
}


.autocomplete-summary {
    margin-bottom: 0.5rem;
}

.need-badges { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.need-badge {
    background: rgba(123,47,190,0.2);
    border: 1px solid rgba(123,47,190,0.4);
    border-radius: 20px;
    padding: 0.3rem 0.8rem;
    font-size: 0.8rem;
    color: var(--color-purple-light);
}

.autocomplete-list {
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    padding-right: 0.25rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(123, 47, 190, 0.3) transparent;
}

.autocomplete-section-title {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.slot-count {
    background: rgba(201,168,76,0.15);
    border-radius: 20px;
    padding: 0.1rem 0.5rem;
    font-size: 0.75rem;
    color: var(--color-gold);
    font-family: 'Raleway', sans-serif;
}

.autocomplete-card-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
}

.autocomplete-card-row:hover {
    border-color: var(--color-gold);
    background: rgba(201,168,76,0.05);
}

.autocomplete-card-row.removed {
    opacity: 0.3;
    text-decoration: line-through;
    pointer-events: none;
}

.autocomplete-card-color-bar {
    width: 4px;
    height: 36px;
    border-radius: 4px;
    flex-shrink: 0;
}

.autocomplete-card-info {
    flex: 1;
    min-width: 0;
}

.autocomplete-card-name {
    font-size: 0.9rem;
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.autocomplete-card-meta {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}

.autocomplete-card-qty {
    font-size: 0.8rem;
    color: var(--color-purple-light);
    font-weight: 600;
    flex-shrink: 0;
}

.autocomplete-remove-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.autocomplete-remove-btn:hover {
    color: #e06c75;
}

.autocomplete-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    margin-top: 1rem;
    flex-wrap: wrap;
}

.autocomplete-complete {
    text-align: center;
    padding: 2rem;
    color: #2ec99a;
    font-size: 1.1rem;
}

#autocomplete-detail-popup {
    z-index: 1100;  /* au dessus de l'autocomplete */
}

#autocomplete-detail-popup .popup-box {
    max-width: 550px;
    width: 95%;
    max-height: 85vh;
    overflow-y: auto;
}

/* ── Collection ── */
.collection-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.col-filter-btn {
    padding: 0.4rem 1rem;
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--color-text-muted);
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.col-filter-btn:hover { border-color: var(--color-purple-light); color: var(--color-text); }
.col-filter-btn.active { border-color: var(--color-purple); background: rgba(123,47,190,0.2); color: var(--color-text); }

.collection-color-section { margin-bottom: 2.5rem; }

.collection-color-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-gold);
}

.collection-color-header h2 {
    font-family: 'Cinzel', serif;
    color: var(--color-gold);
    font-size: 1.1rem;
    margin: 0;
}

.collection-type-section { margin-bottom: 1.5rem; }

.collection-type-title {
    font-family: 'Cinzel', serif;
    color: var(--color-text-muted);
    font-size: 0.85rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}

.collection-card-item {
    cursor: pointer;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: var(--bg-dark);
    position: relative;
}

.collection-card-item:hover {
    border-color: var(--color-gold);
    transform: translateY(-3px);
}

.collection-card-item img { width: 100%; display: block; }

.collection-card-qty {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.8);
    color: var(--color-purple-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    padding: 3px;
}

.collection-card-noimg {
    width: 100%;
    aspect-ratio: 0.716;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
    color: var(--color-text-muted);
    font-size: 0.75rem;
    text-align: center;
    padding: 0.5rem;
}

.import-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

@media (max-width: 768px) {
    .import-layout { grid-template-columns: 1fr; }
}

.autocomplete-total-price {
    text-align: right;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-gold);
    border-top: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.radio-option:hover {
    border-color: var(--color-purple);
    background: rgba(123, 47, 190, 0.05);
}

.radio-option input {
    margin-top: 0.15rem;
    accent-color: var(--color-purple);
}

.gc-btn {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    color: var(--color-text);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    min-width: 45px;
}

.gc-btn:hover {
    border-color: var(--color-purple);
}

.gc-btn.active {
    background: var(--color-purple);
    border-color: var(--color-purple);
    color: white;
}


#popup-img[style*="pointer"] {
    border: 2px solid var(--color-gold);
    border-radius: 12px;
    transition: transform 0.2s;
}
#popup-img[style*="pointer"]:hover {
    transform: scale(1.03);
}

#printing-popup {
    z-index: 10000;
}