* {
    box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', monospace;
}
body {
    background: #0b1a2f;
    color: #e0e0e0;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 100%;
    overflow-x: auto;
}
h1 {
    font-size: 1.8rem;
    border-left: 5px solid #ffaa44;
    padding-left: 15px;
}
.upload-area {
    background: #1e2a3a;
    padding: 15px;
    border-radius: 12px;
    margin: 20px 0;
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}
.btn {
    background: #2c3e4e;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    border: none;
    font-weight: bold;
}
.btn:hover { background: #3e5a6c; }
input[type="file"] { display: none; }
.controls {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}
.game-level {
    display: flex;
    gap: 15px;
    align-items: center;
    background: #1e2a3a;
    padding: 5px 15px;
    border-radius: 20px;
}
.game-level label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
}
.advanced-toggle {
    margin-left: auto;
    background: #1e2a3a;
    padding: 5px 15px;
    border-radius: 20px;
}
.stats {
    margin: 15px 0;
    font-size: 0.9rem;
    color: #bbccdd;
}
.counters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 8px;
    font-size: 0.9rem;
}
.counter-sell { color: #ff8888; }
.counter-gem { color: #f0ad4e; }
.counter-keep { color: #8bc34a; }
.counter-upgrade { color: #5bc0de; }
.counter-reapp { color: #d98cf0; }
.counter-finish { color: #4caf50; }
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: #0f1a24;
}
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}
th, td {
    text-align: left;
    padding: 8px 6px;
    border-bottom: 1px solid #2a3a44;
    white-space: nowrap;
}
th {
    background: #16232e;
    color: #ffcc88;
    position: sticky;
    top: 0;
    cursor: pointer;
}
tr:hover { background: #1e2e3c; }
.high-score {
    background-color: #2a5f3a;
}
/* Styles pour les actions */
.btn-sell { background-color: #a94442; color: white; padding: 2px 8px; border-radius: 12px; display: inline-block; }
.btn-keep { background-color: #3c763d; color: white; padding: 2px 8px; border-radius: 12px; display: inline-block; }
.btn-gem { background-color: #f0ad4e; color: black; padding: 2px 8px; border-radius: 12px; display: inline-block; }
.btn-reapp { background-color: #5bc0de; color: black; padding: 2px 8px; border-radius: 12px; display: inline-block; }
.btn-finish { background-color: #5cb85c; color: white; padding: 2px 8px; border-radius: 12px; display: inline-block; }
.btn-upgrade { background-color: #337ab7; color: white; padding: 2px 8px; border-radius: 12px; display: inline-block; }
.sort-arrow {
    margin-left: 4px;
}

/* ==================== DECISION FILTERS ==================== */
.decision-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    background: #1e2a3a;
    padding: 5px 15px;
    border-radius: 20px;
    margin-top: 10px;
}
.decision-filters label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
}
.btn-small {
    background: #2c3e4e;
    color: white;
    padding: 2px 10px;
    border-radius: 12px;
    cursor: pointer;
    border: none;
    font-size: 0.7rem;
}
.btn-small:hover {
    background: #3e5a6c;
}

/* ==================== ICÔNES DES SETS ==================== */
.set-icon {
    width: 24px;
    height: 24px;
    vertical-align: middle;
    margin-right: 6px;
    border-radius: 4px;
}

/* ==================== MODAL COMPACT ==================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}
.modal-content {
    background-color: #1e2a3a;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 1000px;
    border-radius: 12px;
    color: #e0e0e0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}
.modal-buttons-fixed {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a3a44;
    flex-shrink: 0;
}
.modal-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    flex-shrink: 0;
}
.tab-btn {
    background: #0f1a24;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    color: #bbccdd;
    cursor: pointer;
    font-weight: bold;
}
.tab-btn.active {
    background: #ffaa44;
    color: #1e2a3a;
}
.settings-form-container {
    overflow-y: auto;
    flex-grow: 1;
    padding-right: 5px;
}
.settings-section {
    background: #0f1a24;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 15px;
}
.settings-section h3 {
    margin: 0 0 10px 0;
    color: #ffcc88;
    font-size: 1.1rem;
}
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
}
.settings-grid label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    background: #16232e;
    padding: 4px 8px;
    border-radius: 4px;
}
.settings-grid input {
    width: 60px;
    padding: 2px 4px;
    text-align: center;
    background: #1e2a3a;
    border: 1px solid #2a3a44;
    color: white;
    border-radius: 4px;
}
.duo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}
.duo-category {
    background: #16232e;
    padding: 8px;
    border-radius: 6px;
}
.duo-category h4 {
    margin: 0 0 8px 0;
    color: #ffaa88;
}
.duo-category label {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    margin-bottom: 4px;
}
.duo-category input {
    width: 55px;
    text-align: center;
    background: #1e2a3a;
    border: 1px solid #2a3a44;
    color: white;
    border-radius: 4px;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    top: 15px;
    right: 20px;
}
.close:hover {
    color: white;
}
/* Réduction des espacements */
/* Réduction maximale des espacements */
th, td {
    padding: 4px 2px;   /* très serré */
    font-size: 0.75rem; /* légèrement plus petit */
}

/* Top-bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    background: #1e2a3a;
    padding: 5px 15px;
    border-radius: 20px;
    margin-bottom: 15px;
    font-size: 0.8rem;
    color: #ffcc88;
}

/* Pour un tableau plus compact, on peut aussi fixer la largeur des colonnes */
#runeTable {
    table-layout: auto;
    width: 100%;
}
/* Supprimer les marges internes du wrapper si nécessaire */
.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    background: #0f1a24;
}