:root {
    --bg-gradient-start: #0f2027;
    --bg-gradient-mid: #203a43;
    --bg-gradient-end: #2c5364;
    --header-gradient-start: #1a1a2e;
    --header-gradient-end: #16213e;
    --table-header-start: #5a7fa5;
    --table-header-end: #4a6f95;
    --primary-color: #2c5364;
    --secondary-color: #0f2027;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --text-dark: #1a1a2e;
    --text-light: #ffffff;
    --bg-light: #f8f9fa;
    --bg-white: #ffffff;
    --border-color: #e0e0e0;
    --shadow-color: rgba(0,0,0,0.4);
    --transition-speed: 0.3s;
}

[data-theme="dark"] {
    --bg-gradient-start: #1a1a2e;
    --bg-gradient-mid: #16213e;
    --bg-gradient-end: #0f3460;
    --header-gradient-start: #0f0f1e;
    --header-gradient-end: #1a1a2e;
    --table-header-start: #2d4059;
    --table-header-end: #1f2f45;
    --primary-color: #16a085;
    --secondary-color: #1a1a2e;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --text-dark: #ecf0f1;
    --text-light: #ffffff;
    --bg-light: #2c3e50;
    --bg-white: #34495e;
    --border-color: #4a5f7f;
    --shadow-color: rgba(0,0,0,0.7);
}

[data-theme="ocean"] {
    --bg-gradient-start: #0a3d62;
    --bg-gradient-mid: #1e6091;
    --bg-gradient-end: #3282b8;
    --header-gradient-start: #0a2e4d;
    --header-gradient-end: #0a3d62;
    --table-header-start: #1e6091;
    --table-header-end: #0a3d62;
    --primary-color: #3282b8;
    --secondary-color: #0a3d62;
    --success-color: #2ecc71;
    --danger-color: #e74c3c;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #bbe1fa;
    --bg-white: #ffffff;
    --border-color: #3282b8;
    --shadow-color: rgba(0,0,0,0.3);
}

[data-theme="sunset"] {
    --bg-gradient-start: #7f1734;
    --bg-gradient-mid: #b33939;
    --bg-gradient-end: #ff7b54;
    --header-gradient-start: #5c1226;
    --header-gradient-end: #7f1734;
    --table-header-start: #b33939;
    --table-header-end: #7f1734;
    --primary-color: #ff7b54;
    --secondary-color: #7f1734;
    --success-color: #2ecc71;
    --danger-color: #c0392b;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --bg-light: #ffe5d9;
    --bg-white: #ffffff;
    --border-color: #ff7b54;
    --shadow-color: rgba(0,0,0,0.4);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-mid) 50%, var(--bg-gradient-end) 100%);
    min-height: 100vh;
    padding: 20px;
    transition: background var(--transition-speed) ease;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: 0 20px 80px var(--shadow-color);
    overflow: hidden;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

header {
    background: linear-gradient(135deg, var(--header-gradient-start) 0%, var(--header-gradient-end) 100%);
    color: var(--text-light);
    padding: 40px;
    text-align: center;
    transition: background var(--transition-speed) ease;
}

.header-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.theme-selector {
    padding: 8px 16px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.theme-selector:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    opacity: 0.9;
    font-size: 1.2em;
}

.main-content {
    padding: 40px;
    background: var(--bg-light);
    transition: background var(--transition-speed) ease;
}

.section {
    margin-bottom: 30px;
    padding: 25px;
    background: var(--bg-white);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all var(--transition-speed) ease;
}

.section:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.section-title {
    font-size: 1.8em;
    color: var(--text-dark);
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    transition: color var(--transition-speed) ease;
}

.section-title-main {
    font-size: 1.8em;
    color: var(--text-dark);
}

.form-group {
    margin-bottom: 20px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-10px); }
    to { opacity: 1; transform: translateX(0); }
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 1.05em;
    transition: color var(--transition-speed) ease;
}

input, select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    transition: all var(--transition-speed);
    background: var(--bg-white);
    color: var(--text-dark);
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(44, 83, 100, 0.1);
    transform: scale(1.01);
}

input[type="file"] {
    padding: 8px;
    cursor: pointer;
}

.players-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.player-input {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: all var(--transition-speed);
}

.player-input:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
}

button {
    padding: 14px 30px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--text-light);
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 15px rgba(44, 83, 100, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(44, 83, 100, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

button.secondary {
    background: linear-gradient(135deg, #636e72 0%, #2d3436 100%);
}

button.danger {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
}

button.danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.5);
}

button.success {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

button.warning {
    background: linear-gradient(135deg, #fdcb6e 0%, #f39c12 100%);
}

button.info {
    background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
}

.button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    border-left: 5px solid #2196f3;
    line-height: 1.6;
    animation: slideIn 0.3s ease;
}

.info-box strong {
    color: #1565c0;
}

#gameSetup {
    display: block;
}

#gamePlay {
    display: none;
}

.scores-table-container {
    overflow-x: auto;
    margin-top: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    transition: all var(--transition-speed) ease;
}

th, td {
    padding: 15px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

tr {
    transition: background var(--transition-speed) ease;
}

th {
    background: linear-gradient(135deg, var(--table-header-start) 0%, var(--table-header-end) 100%);
    color: var(--text-light);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 15px 10px;
    vertical-align: top;
    min-width: 120px;
}

th.mene-column {
    min-width: 100px;
}

.mene-header-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.abandon-toggle-btn {
    padding: 6px 12px;
    font-size: 0.9em;
    background: #e74c3c;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: white;
    font-weight: 600;
}

.abandon-toggle-btn:hover {
    background: #c0392b;
    transform: scale(1.05);
}

.abandon-toggle-btn.active {
    background: #27ae60;
}

.abandon-toggle-btn.active:hover {
    background: #229954;
}

th.player-column {
    padding: 12px 8px;
}

.th-player-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    min-width: 110px;
}

.th-player-name {
    font-size: 1.6em;
    font-weight: bold;
    color: var(--text-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.th-player-score {
    font-size: 1.7em;
    font-weight: bold;
    padding: 4px 0;
    color: var(--text-light);
    transition: all 0.5s ease;
}

.th-player-score.positive {
    color: #4caf50;
}

.th-player-score.negative {
    color: #f44336;
}

.th-player-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-size: 0.75em;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.th-player-status {
    font-size: 0.95em;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

.th-player-status.joue {
    background: #4caf50;
    color: white;
}

.th-player-status.donneur {
    background: #ffc107;
    color: #1a1a2e;
}

.th-player-status.mort {
    background: #f44336;
    color: white;
}

.th-player-status.donneur-mort {
    background: #ff9800;
    color: white;
}

.th-player-status.abandonne {
    background: #78909c;
    color: white;
}

.th-abandon-btn, .th-reinstate-btn {
    padding: 3px 6px;
    font-size: 1.2em;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all var(--transition-speed);
    box-shadow: none;
    color: white;
    line-height: 1;
}

.th-abandon-btn {
    background: #e74c3c;
}

.th-abandon-btn:hover {
    background: #c0392b;
    transform: scale(1.1);
}

.th-reinstate-btn {
    background: #27ae60;
}

.th-reinstate-btn:hover {
    background: #229954;
    transform: scale(1.1);
}

.th-abandon-btn:active, .th-reinstate-btn:active {
    transform: scale(0.95);
}

th.player-abandoned {
    background: linear-gradient(135deg, #78909c 0%, #546e7a 100%);
    opacity: 0.8;
}

th.player-abandoned .th-player-name {
    text-decoration: line-through;
    opacity: 0.7;
}

th.player-dead {
    opacity: 0.6;
}

.status-badge {
    display: inline-block;
    font-size: 1em;
    margin: 0 2px;
}

td {
    position: relative;
    padding: 20px 8px 26px 8px;
}

.cell-top-left {
    position: absolute;
    top: 2px;
    left: 2px;
    display: flex;
    gap: 2px;
    align-items: center;
}

.contrat-badge {
    font-size: 0.7em;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    text-transform: uppercase;
    transition: all var(--transition-speed);
}

.contrat-badge.reussi {
    background: #28a745;
    color: white;
}

.contrat-badge.chute {
    background: #dc3545;
    color: white;
}

.partenaire-icon {
    font-size: 0.9em;
}

.cell-top-right {
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 0.8em;
    line-height: 1;
}

.cell-bottom-left {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.bonus-icon {
    font-size: 0.68em;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
    transition: all var(--transition-speed);
}

.bonus-icon.success {
    background: #28a745;
    color: white;
}

.bonus-icon.error {
    background: #dc3545;
    color: white;
}

.player-mort {
    background: #ffebee !important;
}

.player-donneur {
    background: #fff9c4 !important;
}

.player-mort-donneur {
    background: #ffe0b2 !important;
}

.player-abandoned-cell {
    background: #eceff1 !important;
    color: #90a4ae;
    font-style: italic;
}

.cell-preneur {
    font-weight: bold;
    border: 3px solid #2196f3 !important;
}

.cell-partenaire {
    font-weight: bold;
    border: 2px solid #00bcd4 !important;
}

.score-positive {
    color: #28a745;
    font-weight: 600;
    transition: all 0.5s ease;
}

.score-negative {
    color: #dc3545;
    font-weight: 600;
    transition: all 0.5s ease;
}

tr:nth-child(even) {
    background: var(--bg-light);
}

tr:hover:not(.total-row) {
    background: #fff9e6;
    cursor: pointer;
    transform: scale(1.01);
}

.total-row {
    font-weight: bold;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%) !important;
    font-size: 1.15em;
    border-top: 3px solid #28a745;
}

.mene-form-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    align-items: start;
}

.mene-form-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.mene-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.radio-option:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
    transform: scale(1.02);
}

.radio-option input[type="radio"] {
    width: auto;
    cursor: pointer;
}

.radio-option label {
    display: flex;
    align-items: center;
    gap: 5px;
}

.success-symbol {
    color: #28a745;
    font-weight: bold;
}

.error-symbol {
    color: #dc3545;
    font-weight: bold;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-white);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all var(--transition-speed);
}

.checkbox-group:hover {
    background: var(--bg-light);
    transform: translateX(5px);
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.bonus-section {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 10px;
    transition: all var(--transition-speed);
}

.bonus-title {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
}

.bonus-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all var(--transition-speed);
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.5);
}

.stat-value {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    opacity: 0.9;
    font-size: 1em;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-top: 15px;
    font-weight: 500;
    animation: messageSlide 0.3s ease;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.error {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    color: #c62828;
    border-left: 5px solid #d32f2f;
}

.message.success {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    color: #2e7d32;
    border-left: 5px solid #43a047;
}

.hidden {
    display: none !important;
}

.calculation-preview {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #43a047;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    transition: all var(--transition-speed);
}

.calculation-preview.invalid {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left-color: #d32f2f;
}

.calculation-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #2e7d32;
}

.calculation-preview.invalid .calculation-title {
    color: #c62828;
}

.calculation-steps {
    display: grid;
    gap: 10px;
    margin-bottom: 15px;
}

.calc-step {
    background: white;
    padding: 12px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-speed);
}

.calc-step:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.calc-label {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 0.95em;
}

.calc-value {
    font-size: 1.1em;
    font-weight: bold;
    color: #2c5364;
    transition: all 0.3s;
}

.calc-detail {
    font-size: 0.85em;
    color: #666;
    margin-top: 3px;
}

.scores-distribution {
    margin-top: 15px;
    background: white;
    padding: 15px;
    border-radius: 10px;
}

.scores-distribution h4 {
    margin-bottom: 12px;
    color: #1a1a2e;
    font-size: 1.1em;
}

.player-score-preview {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 6px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    font-size: 0.95em;
    transition: all var(--transition-speed);
}

.player-score-preview:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.player-score-preview.preneur {
    border-left-color: #2196f3;
    background: #e3f2fd;
}

.player-score-preview.partenaire {
    border-left-color: #00bcd4;
    background: #e0f7fa;
}

.player-score-preview.defenseur {
    border-left-color: #f44336;
    background: #ffebee;
}

.player-score-preview.mort {
    border-left-color: #9e9e9e;
    background: #f5f5f5;
    opacity: 0.6;
}

.player-score-preview .role {
    color: #666;
    font-size: 0.85em;
}

[data-theme="dark"] .player-mort {
    background: #4a3838 !important;
}

[data-theme="dark"] .player-donneur {
    background: #4a4838 !important;
}

[data-theme="dark"] .player-mort-donneur {
    background: #4a4238 !important;
}

[data-theme="dark"] .total-row {
    background: linear-gradient(135deg, #3d5a42 0%, #36523d 100%) !important;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg-white);
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

.modal-header h2 {
    color: var(--text-dark);
    font-size: 1.8em;
}

.close {
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.close:hover {
    color: #000;
    transform: rotate(90deg);
}

.history-list {
    display: grid;
    gap: 15px;
}

.history-item {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid var(--primary-color);
    transition: all var(--transition-speed);
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.history-item-title {
    font-weight: bold;
    font-size: 1.2em;
    color: var(--text-dark);
}

.history-item-date {
    font-size: 0.9em;
    color: #666;
}

.history-item-info {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.95em;
    color: var(--text-dark);
}

.history-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.history-item-actions button {
    padding: 8px 16px;
    font-size: 0.9em;
}

/* Statistiques avancées */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-box {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid var(--primary-color);
    transition: all var(--transition-speed);
}

.stat-box:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.stat-box-title {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-box-value {
    font-size: 2em;
    font-weight: bold;
    color: var(--text-dark);
}

.stat-box-detail {
    font-size: 0.85em;
    color: #888;
    margin-top: 5px;
}

/* Graphiques */
.chart-container {
    background: var(--bg-white);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--text-dark);
}

.bar-chart {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bar-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bar-label {
    min-width: 120px;
    font-weight: 500;
    color: var(--text-dark);
}

.bar-container {
    flex: 1;
    height: 30px;
    background: var(--bg-light);
    border-radius: 5px;
    overflow: hidden;
    position: relative;
}

.bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    color: white;
    font-weight: bold;
    font-size: 0.85em;
}

.line-chart {
    position: relative;
    height: 300px;
    padding: 20px 0;
}

.line-chart-canvas {
    width: 100%;
    height: 100%;
}

/* Comparaison */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.compare-card {
    background: var(--bg-light);
    padding: 20px;
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-speed);
    border: 2px solid transparent;
}

.compare-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.compare-card.selected {
    border-color: var(--primary-color);
    background: var(--bg-white);
}

.compare-results {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-white);
    border-radius: 10px;
}

.compare-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.compare-table th,
.compare-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.compare-table th {
    background: var(--bg-light);
    font-weight: bold;
}

.winner-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #ffd700;
    color: #000;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: bold;
}

/* Accessibilité */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

button:focus,
a:focus,
input:focus,
select:focus {
    outline: 3px solid var(--primary-color);
    outline-offset: 2px;
}

/* Animation de sauvegarde */
@keyframes saveAnimation {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.saving-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    animation: saveAnimation 0.3s ease;
    z-index: 2000;
}

/* Notification toast */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--text-dark);
    color: white;
    padding: 15px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast.success {
    background: var(--success-color);
}

.toast.error {
    background: var(--danger-color);
}

.toast.info {
    background: #2196f3;
}

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    header, .button-group, .section:not(#scoresSection), .mene-form-container {
        display: none !important;
    }
    
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 1200px) {
    .mene-form-container {
        grid-template-columns: 1fr;
    }

    .calculation-preview {
        position: static;
        max-height: none;
    }

    .bonus-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 20px;
    }

    h1 {
        font-size: 2em;
    }

    .mene-form {
        grid-template-columns: 1fr;
    }

    .stats {
        grid-template-columns: 1fr;
    }

    .th-player-content {
        min-width: 90px;
    }

    .th-player-name {
        font-size: 1.3em;
    }

    .th-player-score {
        font-size: 1.4em;
    }

    .th-player-bottom {
        font-size: 0.7em;
        gap: 4px;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════
   MODALE DE CONFIRMATION
   ═══════════════════════════════════════════════════════════════════════════ */

.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-modal.show {
    opacity: 1;
}

.confirm-modal-content {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 10px 40px var(--shadow-color);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.confirm-modal.show .confirm-modal-content {
    transform: scale(1);
}

.confirm-modal-title {
    margin: 0 0 16px 0;
    font-size: 1.5em;
    color: var(--text-dark);
}

.confirm-modal-message {
    margin: 0 0 24px 0;
    font-size: 1.1em;
    color: var(--text-dark);
    line-height: 1.5;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.confirm-modal-cancel,
.confirm-modal-confirm {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.confirm-modal-cancel {
    background: var(--bg-light);
    color: var(--text-dark);
}

.confirm-modal-cancel:hover {
    background: var(--border-color);
    transform: translateY(-1px);
}

.confirm-modal-confirm {
    background: var(--danger-color);
    color: var(--text-light);
}

.confirm-modal-confirm:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.confirm-modal-cancel:active,
.confirm-modal-confirm:active {
    transform: translateY(0);
}