@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&family=Uncial+Antiqua&display=swap');

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

body {
    font-family: 'Cinzel', serif;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 0, 139, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    color: #f4f4f4;
    overflow: auto;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 20%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(255, 0, 0, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 1;
}

/* Overlay de chargement */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 0, 139, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loading-content {
    text-align: center;
    color: #f4f4f4;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(212, 175, 55, 0.3);
    border-top: 4px solid #d4af37;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    font-weight: 600;
    color: #d4af37;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
}

/* Page d'explication */
.welcome-page {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(139, 0, 0, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 0, 139, 0.3) 0%, transparent 50%),
        linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 9998;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0;
}

.welcome-page.hidden {
    display: none;
}

.welcome-content {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(22, 33, 62, 0.95) 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    padding: 20px 30px;
    margin-top: 0;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.7),
        0 0 40px rgba(212, 175, 55, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-align: center;
    box-sizing: border-box;
    overflow: visible;
    min-width: 0;
}

.welcome-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 700;
    color: #d4af37;
    text-shadow: 
        0 0 20px rgba(212, 175, 55, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.8);
    margin-bottom: 15px;
    letter-spacing: 3px;
}

.welcome-highlight {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2) 0%, rgba(212, 175, 55, 0.1) 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 10px;
    box-shadow: 0 0 30px rgba(212, 175, 55, 0.3);
}

.welcome-subtitle {
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 600;
    color: #ffd700;
    text-shadow: 0 2px 8px rgba(212, 175, 55, 0.5);
    margin: 0;
    letter-spacing: 2px;
}

.welcome-section {
    text-align: left;
    margin-bottom: 15px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border-left: 4px solid #d4af37;
}

.welcome-section-with-image {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.welcome-section-content {
    flex: 1;
}

.welcome-section-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.welcome-section-image img {
    max-width: 100%;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
    border: 2px solid #d4af37;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.welcome-section h2 {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 8px;
    text-shadow: 0 2px 6px rgba(212, 175, 55, 0.4);
}

.games-count {
    font-size: 14px;
    font-weight: 400;
    color: #b8941f;
    font-style: italic;
}

.welcome-section p {
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
    margin-bottom: 5px;
}

.rules-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rules-list li {
    font-size: 14px;
    line-height: 1.5;
    color: #e0e0e0;
    margin-bottom: 6px;
    padding-left: 25px;
    position: relative;
}

.rules-list li::before {
    content: '▸';
    position: absolute;
    left: 0;
    color: #d4af37;
    font-weight: bold;
}

.rules-list li strong {
    color: #d4af37;
    font-weight: 600;
}

.welcome-cta {
    margin-top: 10px;
    padding-top: 10px;
    overflow: visible;
    min-width: 0;
}

.create-game-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: #1a1a2e;
    border: none;
    border-radius: 12px;
    padding: 12px 30px;
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(212, 175, 55, 0.4),
        0 0 20px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    display: inline-flex;
    white-space: nowrap;
    align-items: center;
    gap: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    min-width: 280px;
    flex-shrink: 0;
    box-sizing: border-box;
}

.create-game-btn:hover {
    background: linear-gradient(135deg, #ffd700 0%, #d4af37 100%);
    transform: translateY(-3px);
    box-shadow: 
        0 12px 35px rgba(212, 175, 55, 0.6),
        0 0 30px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.create-game-btn:active {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 20px rgba(212, 175, 55, 0.4),
        0 0 15px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.create-game-btn .btn-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.create-game-btn .btn-text {
    font-size: 18px;
    flex-shrink: 0;
    white-space: nowrap;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-width: 0;
    overflow: visible;
    width: auto;
}

/* Modal pour saisir les armées */
.army-input-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.army-input-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid #d4af37;
    border-radius: 12px;
    padding: 30px;
    max-width: 90%;
    width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 175, 55, 0.3);
}

.army-input-content h2 {
    color: #d4af37;
    font-size: 24px;
    margin-bottom: 10px;
    text-align: center;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

.army-input-description {
    color: #f4f4f4;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    opacity: 0.9;
}

.army-inputs-container {
    margin-bottom: 20px;
}

.army-input-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.army-input-section label {
    color: #d4af37;
    font-size: 16px;
    font-weight: 600;
}

.army-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 8px;
    color: #f4f4f4;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.army-textarea:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

.army-input-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.army-confirm-btn {
    background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
    color: #0a0a0a;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.army-confirm-btn:hover {
    background: linear-gradient(135deg, #e5c158 0%, #d4af37 100%);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
    transform: translateY(-2px);
}

.army-confirm-btn:active {
    transform: translateY(0);
}

.army-cancel-btn {
    background: linear-gradient(135deg, #666 0%, #444 100%);
    color: #f4f4f4;
    border: 2px solid #666;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.army-cancel-btn:hover {
    background: linear-gradient(135deg, #777 0%, #555 100%);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
    transform: translateY(-2px);
}

.army-cancel-btn:active {
    transform: translateY(0);
}

.game-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.game-header {
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 40, 0.9) 100%) !important;
    padding: 20px 30px 20px 0;
    border-bottom: 4px solid #d4af37;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 5;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 120px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.faction-section {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 20px;
    flex: 1;
}

.header-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.game-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.game-header h1 {
    margin-bottom: 15px;
    text-align: center;
    color: #d4af37 !important;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(212, 175, 55, 0.5);
    letter-spacing: 2px;
    font-family: 'Uncial Antiqua', cursive;
    position: relative;
    z-index: 10;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Turn Tracker */
.turn-tracker {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    padding: 0 15px;
    flex: 1;
    max-width: 600px;
}

.turn-info {
    display: flex;
    gap: 15px;
    align-items: center;
}

.turn-display,
.player-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
}

.deployment-display {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.turn-label,
.player-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #d4af37;
    font-weight: 600;
}

.deployment-label {
    font-size: 28px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #d4af37;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.9);
}

.battleplan-select {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 6px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 140px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 28px;
}

.battleplan-select:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-color: #ffd700;
    color: #ffd700;
}

.battleplan-select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 12px rgba(255, 215, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.battleplan-select option {
    background: rgba(0, 0, 0, 0.95);
    color: #d4af37;
    padding: 8px;
}

.turn-number {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    text-align: center;
    white-space: nowrap;
}

.player-select {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 6px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    padding: 4px 8px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 120px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23d4af37' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    padding-right: 28px;
}

.player-select.player-red {
    border-color: #dc143c;
    color: #ff6b6b;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ff6b6b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 8px rgba(220, 20, 60, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-select.player-blue {
    border-color: #4169e1;
    color: #6ba3ff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236ba3ff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        0 0 8px rgba(65, 105, 225, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.player-select:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border-color: #ffd700;
    color: #ffd700;
}

.player-select.player-red:hover {
    border-color: #ff4757;
    color: #ff8787;
    box-shadow: 
        0 4px 12px rgba(220, 20, 60, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.player-select.player-blue:hover {
    border-color: #5b8cff;
    color: #8bb5ff;
    box-shadow: 
        0 4px 12px rgba(65, 105, 225, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.player-select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.player-select.player-red:focus {
    border-color: #ff4757;
    box-shadow: 
        0 4px 12px rgba(220, 20, 60, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.player-select.player-blue:focus {
    border-color: #5b8cff;
    box-shadow: 
        0 4px 12px rgba(65, 105, 225, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.player-select option {
    background: rgba(0, 0, 0, 0.95);
    color: #d4af37;
    padding: 8px;
}

.player-select option.option-red {
    background: rgba(220, 20, 60, 0.2);
    color: #ff6b6b;
    border-left: 3px solid #dc143c;
}

.player-select option.option-blue {
    background: rgba(65, 105, 225, 0.2);
    color: #6ba3ff;
    border-left: 3px solid #4169e1;
}

/* Scoring Panel Styles */
.scoring-round-section {
    margin-bottom: 6px;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
}

.round-title {
    color: #d4af37;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 3px;
    margin-top: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 2px;
    line-height: 1.2;
}

.scoring-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.scoring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 2px 6px;
    background: transparent;
    border-radius: 0;
    border: none;
    line-height: 1.3;
}

.scoring-label {
    color: #f4f4f4;
    font-size: 11px;
    font-weight: 600;
    flex: 1;
}

.score-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.score-btn {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border: 1px solid #d4af37;
    border-radius: 3px;
    color: #d4af37;
    font-size: 10px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.score-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.2));
    border-color: #ffd700;
    color: #ffd700;
    transform: scale(1.1);
}

.score-btn:active {
    transform: scale(0.95);
}

.score-value {
    color: #d4af37;
    font-size: 13px;
    font-weight: 700;
    min-width: 25px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.phase-tracker {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
}

.phase-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1.5px solid rgba(212, 175, 55, 0.3);
    transition: all 0.3s ease;
    min-width: 65px;
    position: relative;
}

.phase-step.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.3), rgba(212, 175, 55, 0.1));
    border-color: #d4af37;
    box-shadow: 
        0 0 10px rgba(212, 175, 55, 0.4),
        inset 0 0 8px rgba(212, 175, 55, 0.2);
}


.phase-icon {
    font-size: 16px;
    line-height: 1;
}

.phase-name {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #fff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.phase-step.active .phase-name {
    color: #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.phase-connector {
    width: 20px;
    height: 1px;
    background: transparent;
    position: relative;
}

.phase-connector::after {
    content: '→';
    position: absolute;
    right: 0;
    top: -8px;
    color: rgba(212, 175, 55, 0.6);
    font-size: 14px;
}


.next-phase-btn {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(212, 175, 55, 0.1));
    border: 2px solid #d4af37;
    border-radius: 8px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.next-phase-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.4), rgba(212, 175, 55, 0.2));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.next-phase-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.next-phase-btn .btn-icon {
    font-size: 14px;
    line-height: 1;
}

.next-phase-btn .btn-text {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.faction-info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    padding: 12px 10px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.faction {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
}

.faction:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.faction.stormcast {
    background: linear-gradient(135deg, #4169e1, #1e3a8a);
    border: 2px solid #87ceeb;
    color: #e6f3ff;
}

.faction.chaos {
    background: linear-gradient(135deg, #8b0000, #4b0000);
    border: 2px solid #ff4500;
    color: #ffcccc;
}

.faction.red {
    background: linear-gradient(135deg, #8b0000, #4b0000);
    border: 2px solid #ff4500;
    color: #ffcccc;
}

.faction.blue {
    background: linear-gradient(135deg, #4169e1, #1e3a8a);
    border: 2px solid #87ceeb;
    color: #e6f3ff;
}


.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: transparent;
    border-radius: 0;
    border: none;
}

.score-line {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
}

.score-value {
    color: #d4af37;
    font-size: 18px;
    min-width: 25px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
}

.score-value.clickable {
    cursor: pointer;
    user-select: none;
}

.score-value.clickable:hover {
    color: #ffd700;
    transform: scale(1.1);
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

.score-label {
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.vs {
    font-size: 20px;
    font-weight: 700;
    color: #d4af37;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.8);
}

.controls-info {
    display: flex !important;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 12px;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative;
    z-index: 10;
}

.controls-info p {
    margin: 2px 0;
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 15px;
    border-radius: 15px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-weight: 500;
}

.game-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px;
    background: 
        radial-gradient(circle at 50% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 70%);
    position: relative;
    min-height: 600px;
    gap: 10px;
    align-items: stretch;
    flex-wrap: wrap;
}


#gameCanvas {
    border: 6px solid #d4af37;
    border-radius: 15px;
    background: 
        radial-gradient(circle at 30% 30%, rgba(139, 0, 0, 0.2) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(0, 0, 139, 0.2) 0%, transparent 50%),
        linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    cursor: crosshair;
    box-shadow: 
        0 0 40px rgba(212, 175, 55, 0.3),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    width: 1200px;
    height: 880px;
    flex-shrink: 0;
    order: 2;
}

#gameCanvas::before {
    content: '';
    position: absolute;
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(45deg, #d4af37, #ffd700, #d4af37);
    border-radius: 15px;
    z-index: -1;
    opacity: 0.3;
}


.control-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 25px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.control-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.control-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-btn:disabled,
.control-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(20, 20, 40, 0.5));
    border-color: #666;
    color: #999;
}

.control-btn:disabled:hover,
.control-btn.disabled:hover {
    transform: none;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.4), rgba(20, 20, 40, 0.5));
    border-color: #666;
    color: #999;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-btn.active {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    border-color: #ffd700;
    text-shadow: none;
}

.btn-icon {
    font-size: 16px;
    font-weight: bold;
}

.btn-text {
    font-size: 12px;
}

/* Voyant de connexion */
.connection-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #d4af37, #ffd700);
    border: 2px solid #d4af37;
    border-radius: 25px;
    cursor: default;
    transition: all 0.3s ease;
    color: #000;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.3);
}

.status-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px currentColor;
}

.status-green {
    background-color: #4caf50;
    color: #4caf50;
    box-shadow: 0 0 15px rgba(76, 175, 80, 0.8);
}

.status-red {
    background-color: #f44336;
    color: #f44336;
    box-shadow: 0 0 15px rgba(244, 67, 54, 0.8);
    animation: pulse-red 1.5s ease-in-out infinite;
}

.status-yellow {
    background-color: #ffc107;
    color: #ffc107;
    box-shadow: 0 0 15px rgba(255, 193, 7, 0.8);
    animation: pulse-yellow 1s ease-in-out infinite;
}

.status-orange {
    background-color: #ff9800;
    color: #ff9800;
    box-shadow: 0 0 15px rgba(255, 152, 0, 0.8);
    animation: pulse-orange 1s ease-in-out infinite;
}

@keyframes pulse-red {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes pulse-yellow {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

@keyframes pulse-orange {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.game-status {
    background: 
        linear-gradient(135deg, rgba(0, 0, 0, 0.8) 0%, rgba(20, 20, 40, 0.9) 100%);
    padding: 15px 30px;
    border-top: 4px solid #d4af37;
    box-shadow: 
        0 -4px 20px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.battle-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
}

.army-stats {
    display: flex;
    gap: 30px;
}

.army {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.stormcast-army {
    background: linear-gradient(135deg, #4169e1, #1e3a8a);
    border: 2px solid #87ceeb;
    color: #e6f3ff;
}

.chaos-army {
    background: linear-gradient(135deg, #8b0000, #4b0000);
    border: 2px solid #ff4500;
    color: #ffcccc;
}

.army-icon {
    font-size: 20px;
    filter: drop-shadow(0 0 5px currentColor);
}

.selection-info {
    color: #d4af37;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.selection-info span {
    color: #ffd700;
    font-size: 18px;
}

/* Conteneur d'onglets */
.tabs-container {
    min-width: 315px;
    height: 880px; /* Hauteur fixe correspondant à la hauteur du canvas */
    min-height: 880px;
    max-height: 880px; /* Limiter à la hauteur du canvas */
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    flex-grow: 1;
    order: 1;
    max-width: calc(100% - 1220px);
}

.tabs-header {
    display: flex;
    gap: 0;
    margin-bottom: 0;
    border-radius: 15px 15px 0 0;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 40, 0.95) 100%);
    border: 3px solid #d4af37;
    border-bottom: none;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: none;
    border-right: 1px solid rgba(212, 175, 55, 0.3);
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    color: #ffd700;
}

.tab-btn.active {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    text-shadow: none;
    font-weight: 700;
}

.tabs-content {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden; /* Pas de scroll ici, le scroll est dans chaque panneau */
}

/* Panneau de détail */
.detail-panel {
    width: 100%;
    height: calc(880px - 50px); /* Hauteur fixe : canvas - header tabs */
    min-height: calc(880px - 50px); /* Hauteur minimale correspondant à la hauteur du canvas */
    max-height: calc(880px - 50px); /* Hauteur maximale */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 40, 0.95) 100%);
    border: 3px solid #d4af37;
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    /* Le scroll se fait dans detail-content à l'intérieur */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
    overflow: hidden; /* Pas de scroll sur le panneau lui-même */
}

.detail-panel.active {
    opacity: 1;
    pointer-events: all;
}

.detail-header {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    padding: 0;
    border-radius: 12px 12px 0 0;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    text-shadow: none;
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100px;
}

.detail-header h3 {
    margin: 0;
    flex: 1;
    text-align: center;
}

.detail-header h3 .player-name {
    display: block;
    font-size: 12px;
    color: rgba(0, 0, 0, 0.7);
    font-weight: 400;
    margin-bottom: 2px;
}

.detail-header h3 .allegiance-name {
    display: block;
    font-size: 18px;
    color: #000;
    font-weight: 700;
}

.detail-header h3 .model-count {
    display: block;
    font-size: 12px;
    color: #666;
    font-weight: normal;
    margin-top: 2px;
}

#headerStats {
    margin: 0;
    order: -1;
}

.detail-content {
    flex: 1;
    padding: 20px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    color: #f4f4f4;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Style de la scrollbar */
    scrollbar-width: thin; /* Pour Firefox */
    scrollbar-color: rgba(212, 175, 55, 0.6) rgba(0, 0, 0, 0.3); /* Pour Firefox */
}

/* Style de la scrollbar pour detail-content (Webkit) */
.detail-content::-webkit-scrollbar {
    width: 8px;
}

.detail-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.detail-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.6);
    border-radius: 4px;
}

.detail-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.8);
}

.detail-content .no-selection {
    text-align: center;
    color: #888;
    font-style: italic;
    margin-top: 50px;
}

/* Panneau de Rolls */
.rolls-panel {
    width: 100%;
    height: calc(880px - 50px); /* Hauteur fixe : canvas - header tabs */
    min-height: calc(880px - 50px); /* Hauteur minimale correspondant à la hauteur du canvas */
    max-height: calc(880px - 50px); /* Hauteur maximale */
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.9) 0%, rgba(20, 20, 40, 0.95) 100%);
    border: 3px solid #d4af37;
    border-top: none;
    border-radius: 0 0 15px 15px;
    box-shadow: 
        0 0 30px rgba(212, 175, 55, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    /* Le scroll se fait dans rolls-content à l'intérieur */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    overflow: hidden; /* Pas de scroll sur le panneau lui-même */
    box-sizing: border-box;
}

.rolls-panel.active {
    opacity: 1;
    pointer-events: all;
}

/* Mode split : panneaux séparés */
.game-area.mode-split .rolls-panel {
    position: relative;
    min-width: 315px;
    height: 880px; /* Hauteur fixe correspondant à la hauteur du canvas */
    min-height: 880px;
    max-height: 880px;
    border: 3px solid #d4af37;
    border-radius: 15px;
    border-top: 3px solid #d4af37;
    opacity: 1;
    pointer-events: all;
    flex-shrink: 0;
    flex-grow: 1;
    order: 3;
    max-width: calc((100% - 1220px) / 2);
    overflow: hidden; /* Pas de scroll sur le panneau lui-même */
}

/* Mode split : panneau Replay (hérite des mêmes styles que rolls-panel) */
.game-area.mode-split .rolls-panel#replayPanel {
    position: relative;
    min-width: 315px;
    height: 880px;
    min-height: 880px;
    max-height: 880px;
    border: 3px solid #d4af37;
    border-radius: 15px;
    border-top: 3px solid #d4af37;
    opacity: 1;
    pointer-events: all;
    flex-shrink: 0;
    flex-grow: 1;
    order: 3;
    max-width: calc((100% - 1220px) / 2);
    overflow: hidden;
}

.game-area.mode-split .rolls-panel .rolls-header {
    border-radius: 12px 12px 0 0;
}

.game-area.mode-split .tabs-container {
    min-width: 315px;
    flex-grow: 1;
    max-width: calc((100% - 1220px) / 2);
    max-height: 880px; /* Limiter à la hauteur du canvas */
}

.game-area.mode-split .tabs-container .tabs-header {
    display: none;
}

.game-area.mode-split .tabs-container .tabs-content {
    height: 880px; /* Hauteur fixe correspondant au canvas en mode split */
    max-height: 880px;
    min-height: 880px; /* Hauteur minimale pour correspondre au canvas */
    overflow: hidden; /* Pas de scroll ici, le scroll est dans chaque panneau */
}

.game-area.mode-split .tabs-container .detail-panel {
    border-top: 3px solid #d4af37;
    border-radius: 15px;
    opacity: 1;
    pointer-events: all;
    position: relative;
    height: 880px; /* Hauteur fixe correspondant à la hauteur du canvas */
    min-height: 880px; /* Hauteur minimale correspondant à la hauteur du canvas */
    /* Le scroll se fait dans detail-content à l'intérieur */
}

.game-area.mode-split .tabs-container .rolls-panel {
    display: none !important;
}

.game-area.mode-split .tabs-container .rolls-panel#replayPanel {
    display: none !important;
}

.rolls-header {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    padding: 12px 20px;
    border-radius: 12px 12px 0 0;
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    text-shadow: none;
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: auto;
    height: auto;
}

.rolls-header h3 {
    margin: 0;
    flex: 1;
    text-align: center;
    font-size: 18px;
    color: #000;
    font-weight: 700;
}

.rolls-content {
    flex: 1;
    padding: 0;
    overflow-y: auto;
    overflow-x: hidden;
    color: #f4f4f4;
    display: flex;
    flex-direction: column;
    /* Style de la scrollbar */
    scrollbar-width: thin; /* Pour Firefox */
    scrollbar-color: rgba(212, 175, 55, 0.6) rgba(0, 0, 0, 0.3); /* Pour Firefox */
}

/* Style de la scrollbar pour rolls-content (Webkit) */
.rolls-content::-webkit-scrollbar {
    width: 8px;
}

.rolls-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.rolls-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.6);
    border-radius: 4px;
}

.rolls-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.8);
}

/* Onglets des rolls */
.rolls-tabs {
    display: flex;
    border-bottom: 2px solid #d4af37;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
}

.rolls-tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.rolls-tab-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    color: #ffd700;
}

.rolls-tab-btn.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-bottom-color: #ffd700;
    color: #ffd700;
}

.rolls-tab-content {
    flex: 1;
    padding: 15px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    flex-direction: column;
    gap: 5px;
    /* Style de la scrollbar */
    scrollbar-width: thin; /* Pour Firefox */
    scrollbar-color: rgba(212, 175, 55, 0.6) rgba(0, 0, 0, 0.3); /* Pour Firefox */
}

/* Style de la scrollbar pour rolls-tab-content (Webkit) */
.rolls-tab-content::-webkit-scrollbar {
    width: 8px;
}

.rolls-tab-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.rolls-tab-content::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.6);
    border-radius: 4px;
}

.rolls-tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.8);
}

.rolls-tab-content.active {
    display: flex;
}

#rollsTabContentAuto:not(.has-results) .dice-results-title,
#rollsTabContentAuto:not(.has-results) .dice-results,
#rollsTabContentAuto:not(.has-results) .dice-damage-title {
    display: none;
}

.hidden {
    display: none !important;
}

/* Conteneur de dés */
.dice-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 15px 20px 8px 20px;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

/* Sélecteurs de dés en grille */
.dice-selectors-grid {
    display: grid;
    grid-template-columns: auto repeat(5, 1fr);
    gap: 4px 6px;
    padding: 5px 15px;
    width: 100%;
    align-items: center;
    justify-items: center;
}

.dice-selector-row {
    display: contents;
}

.dice-action-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 6px 15px 0 15px;
}

.dice-results-title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 3px;
    margin-bottom: -2px;
    line-height: 1;
    padding: 0;
}

.dice-results-count {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    color: #f4f4f4;
    margin-left: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.dice-result-item.dice-next-step {
    position: relative;
    background: rgba(0, 191, 255, 0.18);
    border-radius: 6px;
    padding: 0;
    box-shadow: inset 0 0 8px rgba(0, 191, 255, 0.35);
}

.dice-result-item.dice-next-step .dice-result-dice {
    box-shadow: 0 0 10px rgba(0, 191, 255, 0.7);
    border-radius: 6px;
}

.dice-result-item.dice-next-step-red {
    background: rgba(255, 0, 0, 0.18);
    box-shadow: inset 0 0 8px rgba(255, 0, 0, 0.45);
}

.dice-result-item.dice-next-step-red .dice-result-dice {
    box-shadow: 0 0 10px rgba(255, 70, 70, 0.8);
}

.dice-damage-title {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    color: #ffd700;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.dice-action-btn {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border: 2px solid #d4af37;
    border-radius: 6px;
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px 12px;
    min-width: 70px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-action-btn:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.3), rgba(212, 175, 55, 0.2));
    border-color: #ffd700;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow:
        0 6px 16px rgba(212, 175, 55, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dice-action-btn:active {
    transform: translateY(0);
    box-shadow:
        0 3px 10px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-controls-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    grid-column: 2 / -1;
    width: 100%;
    max-width: 250px;
}

.dmg-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
    width: 100%;
    max-width: 200px;
}

.dice-selector-row:not(.dice-atk-row) .dmg-controls {
    grid-column: 2 / -1;
    justify-self: start;
    align-self: center;
}

.dmg-control-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex: 1;
}

.dmg-input-wrapper {
    display: flex;
    align-items: center;
    gap: 3px;
}

.dmg-input-buttons {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dmg-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 4px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    padding: 1px 4px;
    min-width: 20px;
    width: 20px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dmg-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-1px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dmg-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dmg-input {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 4px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 5px;
    width: 38px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    -moz-appearance: textfield;
}

.dmg-input-labeled {
    width: 48px;
}

.dmg-input::-webkit-outer-spin-button,
.dmg-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dmg-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dmg-label {
    color: #f4f4f4;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.dice-selector-row {
    display: contents;
}

.dice-atk-row {
    display: grid;
    grid-template-columns: auto 1fr auto 1fr 1fr 1fr;
    gap: 4px 6px;
    align-items: center;
    width: 100%;
    grid-column: 1 / -1;
    padding: 0;
    margin: 0;
}

.dice-atk-row .dice-hit-label:first-child {
    grid-column: 1;
    justify-self: start;
}

.dice-atk-row .dmg-controls {
    grid-column: 2;
    justify-self: start;
    padding-left: 24px;
}

.dice-atk-row .dice-hit-label:nth-of-type(2) {
    grid-column: 3;
    justify-self: start;
    padding-left: 20px;
}

.dice-atk-row .dice-crit-select {
    grid-column: 4 / -1;
    justify-self: start;
}

.dice-hit-label {
    color: #f4f4f4;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    justify-self: start;
}

.dice-crit-select {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 4px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 6px;
    min-width: 80px;
    width: 80px;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dice-crit-select:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
}

.dice-crit-select:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-crit-select option {
    background: rgba(0, 0, 0, 0.95);
    color: #d4af37;
}

.dice-hit-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 5px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 8px;
    min-width: 35px;
    width: 100%;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dice-hit-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-hit-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dice-hit-btn.selected,
.dice-wound-btn.selected,
.dice-save-btn.selected,
.dice-ward-btn.selected {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    border-color: #ffd700;
    color: #000;
    text-shadow: none;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.dice-wound-btn,
.dice-save-btn,
.dice-ward-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 5px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 3px 8px;
    min-width: 35px;
    width: 100%;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dice-wound-btn:hover,
.dice-save-btn:hover,
.dice-ward-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-wound-btn:active,
.dice-save-btn:active,
.dice-ward-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Contrôles du nombre de dés */
.dice-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 8px 20px 0 20px;
    width: 100%;
}

.dice-count-input-wrapper {
    display: flex;
    align-items: center;
}

.dice-count-input {
    width: 70px;
    padding: 4px 6px;
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(0, 0, 0, 0.4);
    color: #f4f4f4;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 14px;
}

.dice-count-input::-webkit-outer-spin-button,
.dice-count-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.dice-count-input[type=number] {
    -moz-appearance: textfield;
}

.manual-dice-section {
    margin-top: 15px;
    padding: 10px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.manual-roll-all {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.manual-dice-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.manual-dice-wrapper {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(212, 175, 55, 0.18);
    box-shadow: 0 0 4px rgba(212, 175, 55, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.manual-dice-wrapper:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.28);
}

.manual-dice-wrapper.selected {
    box-shadow: 0 0 14px rgba(255, 70, 70, 0.5), 0 0 4px rgba(255, 0, 0, 0.5);
    border-color: rgba(255, 70, 70, 0.7);
}

.manual-dice-wrapper.selected .dice {
    box-shadow: 0 0 14px rgba(255, 70, 70, 0.7);
    border-radius: 8px;
}

.manual-dice {
    width: 30px;
    height: 30px;
    transform-style: preserve-3d;
}


.manual-selection-title {
    margin-top: 10px;
    padding: 6px 0;
    text-align: center;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    color: #ffd700;
    letter-spacing: 0.5px;
}

.manual-selection-filters {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 4px;
}

.manual-selection-filters-minus {
    margin-top: 4px;
}

.manual-selection-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
}

.manual-action-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(20, 20, 40, 0.95));
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-radius: 6px;
    color: #ffd700;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.manual-action-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(255, 215, 0, 0.15));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-1px);
}

.manual-action-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.manual-filter-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid rgba(212, 175, 55, 0.5);
    border-radius: 6px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    min-width: 48px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.manual-filter-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-1px);
}

.manual-filter-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.manual-dice.manual-dice-rolled {
}

/* Résultats des dés */
.dice-results {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    padding: 0 10px 2px 10px;
    width: 100%;
    flex-wrap: nowrap;
    margin-top: 0px;
}

.dice-result-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.dice-result-count {
    color: #f4f4f4;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 700;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    min-width: 24px;
    text-align: right;
}

.dice-result-dice {
    width: 20px;
    height: 20px;
    position: relative;
    transform-style: preserve-3d;
}

.dice-result-dice .dice-face {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    font-size: 12px;
}

.dice-result-dice .dice-dots {
    padding: 2px;
}

.dice-result-dice .dot {
    width: 3px;
    height: 3px;
}

.dice-result-dice .dice-face-1 {
    transform: rotateY(0deg) translateZ(10px);
}

.dice-result-dice .dice-face-2 {
    transform: rotateY(90deg) translateZ(10px);
}

.dice-result-dice .dice-face-3 {
    transform: rotateX(90deg) translateZ(10px);
}

.dice-result-dice .dice-face-4 {
    transform: rotateX(-90deg) translateZ(10px);
}

.dice-result-dice .dice-face-5 {
    transform: rotateY(-90deg) translateZ(10px);
}

.dice-result-dice .dice-face-6 {
    transform: rotateY(180deg) translateZ(10px);
}

.dice-control-btn {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.8), rgba(20, 20, 40, 0.9));
    border: 2px solid #d4af37;
    border-radius: 6px;
    color: #d4af37;
    font-family: 'Cinzel', serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 5px 12px;
    min-width: 35px;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dice-control-btn:hover {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.2), rgba(255, 215, 0, 0.1));
    border-color: #ffd700;
    color: #ffd700;
    transform: translateY(-2px);
    box-shadow: 
        0 4px 12px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.dice-control-btn:active {
    transform: translateY(0);
    box-shadow: 
        0 2px 6px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.dice-count-label {
    color: #f4f4f4;
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 60px;
    width: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dice-count-label:hover {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* Wrapper pour chaque dé (contient le halo) */
.dice-wrapper {
    width: 28px;
    height: 28px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s;
}

.dice-highlight-overlay {
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 10px;
    background: radial-gradient(circle, rgba(0, 191, 255, 0.55) 0%, rgba(0, 191, 255, 0) 70%);
    pointer-events: none;
    opacity: 0.8;
    animation: diceHighlightFade 2s ease-out forwards;
}

@keyframes diceHighlightFade {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

/* Le halo sera géré par JavaScript */

/* Dé */
.dice {
    width: 28px;
    height: 28px;
    position: relative;
    transform-style: preserve-3d;
    cursor: pointer;
    transition: transform 0.1s;
}

.dice.rolling {
    cursor: not-allowed;
    pointer-events: none;
    transition: none;
}

/* Transition pour la rotation finale après l'animation */
.dice:not(.rolling) {
    transition: transform 0.3s ease-out;
}

/* Faces du dé */
.dice-face {
    position: absolute;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
    border: 1px solid #d4af37;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 
        0 2px 4px rgba(0, 0, 0, 0.3),
        inset 0 1px 2px rgba(255, 255, 255, 0.5);
    backface-visibility: hidden;
}

.dice-dots {
    width: 100%;
    height: 100%;
    position: relative;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    padding: 2px;
    box-sizing: border-box;
}

.dot {
    width: 4px;
    height: 4px;
    background: #000;
    border-radius: 50%;
    margin: auto;
}

.dot.top-left {
    grid-column: 1;
    grid-row: 1;
}

.dot.top-right {
    grid-column: 3;
    grid-row: 1;
}

.dot.middle-left {
    grid-column: 1;
    grid-row: 2;
}

.dot.center {
    grid-column: 2;
    grid-row: 2;
}

.dot.middle-right {
    grid-column: 3;
    grid-row: 2;
}

.dot.bottom-left {
    grid-column: 1;
    grid-row: 3;
}

.dot.bottom-right {
    grid-column: 3;
    grid-row: 3;
}

/* Positionnement des faces en 3D */
.dice-face-1 {
    transform: rotateY(0deg) translateZ(14px);
}

.dice-face-2 {
    transform: rotateY(90deg) translateZ(14px);
}

.dice-face-3 {
    transform: rotateX(90deg) translateZ(14px);
}

.dice-face-4 {
    transform: rotateX(-90deg) translateZ(14px);
}

.dice-face-5 {
    transform: rotateY(-90deg) translateZ(14px);
}

.dice-face-6 {
    transform: rotateY(180deg) translateZ(14px);
}

/* Affichage de la face active selon la valeur (utilisé si pas de style inline) */
.dice[data-value="1"]:not([style*="transform"]) {
    transform: rotateX(0deg) rotateY(0deg);
}

.dice[data-value="2"]:not([style*="transform"]) {
    transform: rotateX(0deg) rotateY(-90deg);
}

.dice[data-value="3"]:not([style*="transform"]) {
    transform: rotateX(-90deg) rotateY(0deg);
}

.dice[data-value="4"]:not([style*="transform"]) {
    transform: rotateX(90deg) rotateY(0deg);
}

.dice[data-value="5"]:not([style*="transform"]) {
    transform: rotateX(0deg) rotateY(90deg);
}

.dice[data-value="6"]:not([style*="transform"]) {
    transform: rotateX(0deg) rotateY(180deg);
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.model-name {
    font-size: 20px;
    font-weight: 700;
    color: #d4af37;
    text-align: center;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.model-faction {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 10px;
}

.model-faction.stormcast {
    background: linear-gradient(135deg, #4169e1, #1e3a8a);
    border: 2px solid #87ceeb;
    color: #e6f3ff;
}

.model-faction.chaos {
    background: linear-gradient(135deg, #8b0000, #4b0000);
    border: 2px solid #ff4500;
    color: #ffcccc;
}

.model-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.model-stats-circular {
    display: flex;
    justify-content: center;
    margin: 20px 0;
}

.stats-dial {
    position: relative;
    width: 100px;
    height: 100px;
    border: 4px solid #d4af37;
    border-radius: 50%;
    background: #1a1a1a;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    overflow: hidden;
    transform: rotate(-45deg);
    box-shadow: 0 0 0 1px #000;
}

.circular-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.circular-text {
    font-size: 8px;
    font-weight: 700;
    fill: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.5);
    text-anchor: middle;
}

.dial-cross {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 4px;
    background: #d4af37;
    z-index: 10;
}

.dial-cross::before,
.dial-cross::after {
    content: '';
    position: absolute;
    background: #d4af37;
}

.dial-cross::before {
    width: 4px;
    height: 100px;
    top: -48px;
    left: -2px;
}

.dial-cross::after {
    width: 100px;
    height: 4px;
    top: -2px;
    left: -48px;
}

.stat-quadrant {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0;
    text-align: center;
}

/* Orientation boussole pour les quadrants */
.stat-health {
    grid-column: 1;
    grid-row: 1;
}

.stat-move {
    grid-column: 2;
    grid-row: 1;
}

.stat-control {
    grid-column: 1;
    grid-row: 2;
}

.stat-save {
    grid-column: 2;
    grid-row: 2;
}

.stat-health {
    background: #1a1a1a;
}

.stat-move {
    background: #1a1a1a;
}

.stat-control {
    background: #1a1a1a;
}

.stat-save {
    background: #2d5a2d;
}

/* Positionnement des valeurs plus près du centre */
.stat-health .stat-value {
    top: 40%;
    left: 40%;
}

.stat-move .stat-value {
    top: 50%;
    left: 12%;
}

.stat-control .stat-value {
    top: 10%;
    left: 40%;
}

.stat-save .stat-value {
    top: 12%;
    left: 8%;
}

.stat-quadrant .stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    text-align: center;
    position: absolute;
    z-index: 10;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: rotate(45deg);
}

.stat-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    text-align: center;
}

.stat-label {
    font-size: 12px;
    color: #d4af37;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 16px;
    color: #ffd700;
    font-weight: 700;
}

.model-abilities {
    margin-top: 20px;
    flex: 1;
}

.abilities-title {
    font-size: 16px;
    font-weight: 700;
    color: #d4af37;
    margin-bottom: 10px;
    border-bottom: 1px solid #d4af37;
    padding-bottom: 5px;
}

.ability-item {
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #d4af37;
}

.ability-name {
    font-weight: 600;
    color: #ffd700;
    font-size: 14px;
    margin-bottom: 4px;
}

.ability-description {
    font-size: 12px;
    color: #ccc;
    line-height: 1.4;
}

.model-position {
    background: rgba(0, 0, 0, 0.4);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    margin-top: 20px;
    flex-shrink: 0;
}

.position-title {
    font-size: 14px;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 8px;
}

.position-coords {
    font-size: 12px;
    color: #ccc;
    font-family: monospace;
}

/* Dialog d'aide */
.help-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.help-dialog.show {
    display: flex;
}

.help-content {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(20, 20, 40, 0.98) 100%);
    border: 3px solid #d4af37;
    border-radius: 20px;
    width: 95%;
    max-width: 1400px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 
        0 0 50px rgba(212, 175, 55, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.help-header {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    padding: 12px 20px;
    border-radius: 17px 17px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid rgba(0, 0, 0, 0.3);
}

.help-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    text-shadow: none;
    font-family: 'Uncial Antiqua', cursive;
}

.close-btn {
    background: none;
    border: none;
    font-size: 30px;
    color: #000;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.2);
    transform: scale(1.1);
}

.help-body {
    padding: 15px;
    color: #f4f4f4;
    display: flex;
    gap: 20px;
}

.help-left-column {
    flex: 2;
    padding-right: 15px;
    border-right: 2px solid rgba(212, 175, 55, 0.3);
}

.help-right-column {
    flex: 1;
    padding-left: 15px;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.help-main-title {
    color: #d4af37;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.5);
}

.help-subtitle {
    color: #ffd700;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 15px;
    font-family: 'Cinzel', serif;
}

.help-text-content {
    color: #f4f4f4;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 10px;
}

.help-text-content p {
    margin-bottom: 12px;
}

.help-link-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.help-link-box {
    flex: 1;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 10px 15px;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.help-link-text {
    color: #f4f4f4;
    font-size: 13px;
    font-family: monospace;
    word-break: break-all;
    user-select: all;
}

.help-copy-btn {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    border: 2px solid #d4af37;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Cinzel', serif;
    white-space: nowrap;
}

.help-copy-btn:hover {
    background: linear-gradient(135deg, #ffd700, #d4af37);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
}

.help-copy-btn:active {
    transform: scale(0.98);
}

.help-copy-btn.copied {
    background: linear-gradient(135deg, #4caf50, #66bb6a);
    border-color: #4caf50;
}

.help-section {
    margin-bottom: 12px;
}

.help-right-column .help-section {
    margin-bottom: 15px;
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    color: #d4af37;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: background 0.3s ease;
}

.help-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    padding-left: 10px;
    padding-right: 10px;
}

.help-item:last-child {
    border-bottom: none;
}

.help-key {
    background: linear-gradient(135deg, #d4af37, #ffd700);
    color: #000;
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 13px;
    min-width: 80px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.3);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.help-desc {
    color: #f4f4f4;
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    margin-left: 10px;
    line-height: 1.3;
}

/* Animation d'ouverture */
@keyframes helpDialogOpen {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-50px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.help-dialog.show .help-content {
    animation: helpDialogOpen 0.3s ease-out;
}

/* Responsive design - Mode tabs : panneaux passent en dessous si largeur < 1555px */
@media (max-width: 1555px) {
    .game-area:not(.mode-split) {
        flex-direction: column;
        align-items: center;
    }
    
    .game-area:not(.mode-split) .tabs-container {
        order: 2;
        width: 100%;
        max-width: 1200px;
        flex-grow: 0;
        max-width: 1200px;
    }
    
    .game-area:not(.mode-split) #gameCanvas {
        order: 1;
    }
}

/* Responsive design - Mode split : panneaux passent en dessous si largeur < 1870px */
@media (max-width: 1870px) {
    .game-area.mode-split {
        flex-direction: column;
        align-items: center;
    }
    
    .game-area.mode-split .tabs-container {
        order: 1;
        width: 100%;
        max-width: 1200px;
        flex-grow: 0;
    }
    
    .game-area.mode-split #gameCanvas {
        order: 2;
    }
    
    .game-area.mode-split .rolls-panel {
        order: 3;
        width: 100%;
        max-width: 1200px;
        flex-grow: 0;
    }
    
    .game-area.mode-split .rolls-panel#replayPanel {
        order: 3;
        width: 100%;
        max-width: 1200px;
        flex-grow: 0;
    }
}

/* Responsive design pour le header */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .faction-section {
        order: 1;
        width: 100%;
    }
    
    .turn-tracker {
        order: 2;
        max-width: 100%;
        padding: 0 10px;
    }
    
    .header-controls {
        order: 3;
        justify-content: center;
    }
    
    .faction-info {
        order: 1;
    }
    
    .control-btn {
        padding: 10px 15px;
        font-size: 13px;
    }
    
    .btn-text {
        display: none;
    }
    
    .create-game-btn .btn-text {
        display: inline-block !important;
    }
    
    .btn-icon {
        font-size: 18px;
    }
    
    /* Responsive pour le panneau de détails */
    .game-area {
        flex-direction: column;
        align-items: center;
    }
    
    .detail-panel {
        width: 100%;
        max-width: 500px;
        height: 400px;
        order: 2;
    }
    
    #gameCanvas {
        order: 1;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .game-header {
        padding: 15px 20px;
        min-height: 100px;
    }
    
    .faction {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    
    .score-display {
        padding: 6px 12px;
        gap: 6px;
    }
    
    .score-value {
        font-size: 16px;
        min-width: 20px;
    }
    
    .score-label {
        font-size: 11px;
    }
    
    .vs {
        font-size: 18px;
    }
    
    .turn-tracker {
        padding: 0 5px;
    }
    
    .turn-number,
    .player-name {
        font-size: 14px;
    }
    
    .phase-step {
        min-width: 50px;
        padding: 4px 6px;
    }
    
    .phase-name {
        font-size: 8px;
    }
    
    .phase-icon {
        font-size: 14px;
    }
    
    .phase-connector {
        width: 12px;
    }
}

/* Styles pour les tableaux d'armes */
.weapons-section {
    margin-bottom: 5px;
}

.weapons-title {
    font-size: 16px;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #d4af37;
}

.weapons-table {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(212, 175, 55, 0.6);
    border-collapse: collapse;
    box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.2);
}

.weapon-header {
    background: rgba(212, 175, 55, 0.2);
    font-weight: 600;
    font-size: 12px;
    color: #d4af37;
    text-align: center;
}

.weapon-header th {
    padding: 2px 8px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
}

.weapon-row {
    font-size: 11px;
    color: #ccc;
}

.weapon-row td {
    padding: 0px 8px;
    text-align: center;
    vertical-align: middle;
}

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

.weapon-row:hover {
    background: rgba(212, 175, 55, 0.1);
}

/* Hover pour tout le groupe d'armes (nom, caractéristiques, abilities) */
.weapon-group.highlighted {
    background: rgba(212, 175, 55, 0.1);
}

.weapon-name-row.highlighted,
.weapon-ability-row.highlighted {
    background: rgba(212, 175, 55, 0.1);
}

.weapon-name {
    text-align: left;
    font-weight: normal;
    color: #fff;
}

.weapon-ability {
    font-style: italic;
    color: #aaa;
    font-size: 10px;
    font-weight: normal;
}

.weapon-range,
.weapon-attacks,
.weapon-tohit,
.weapon-towound,
.weapon-rend,
.weapon-damage {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

.weapon-rend {
    color: #ff6b6b;
}

.weapon-damage {
    color: #4ecdc4;
}


.weapon-abilities {
    grid-column: 2 / -1;
    padding: 4px 12px 8px 12px;
    background: inherit;
    border: none;
    font-size: 0.85em;
    color: #aaa;
}

.weapon-ability-text {
    font-style: italic;
    line-height: 1.3;
}

.weapon-row:hover .weapon-abilities {
    background: rgba(255, 255, 0, 0.1);
}

.weapon-row:hover .weapon-ability-text {
    color: #ffd700;
}

/* Abilities Section */
.abilities-section {
    margin-top: 5px;
    overflow: visible;
}

.abilities-title {
    font-size: 14px;
    font-weight: 600;
    color: #d4af37;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.abilities-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow: visible;
}

.ability-item {
    padding: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
    overflow: visible;
}

.ability-item:hover {
    background: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.4);
    transform: translateX(2px);
}

.ability-name {
    font-size: 11px;
    font-weight: 600;
    color: white;
    padding: 4px 12px;
    border-radius: 6px 6px 0 0;
    margin: 0;
    text-align: left;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.ability-description {
    font-size: 11px;
    color: #ccc;
    line-height: 1.4;
    font-style: italic;
    padding: 10px;
    overflow: hidden;
}

.ability-description ul {
    margin: 0;
    padding-left: 20px;
    padding-right: 0;
    list-style-position: inside;
}

.ability-description li {
    margin: 4px 0;
    padding-left: 0;
}

.ability-description strong {
    font-weight: 600;
    font-style: normal;
}

.ability-description strong.ability-title {
    color: #d4af37;
}

.ability-description strong:not(.ability-title) {
    color: inherit;
}

.ability-icon {
    font-size: 12px;
    display: inline-block;
}

.chanting-value {
    background-color: #000;
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    border: 2px solid #d4af37;
    margin-left: auto;
    transform: rotate(45deg);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    line-height: 1;
    position: absolute;
    top: -4px;
    right: 8px;
    z-index: 10;
}

.chanting-value span {
    transform: rotate(-45deg);
    display: block;
}

.casting-value {
    background-color: #000;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 50%;
    border: 3px solid transparent;
    margin-left: 8px;
    transform: rotate(0deg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    line-height: 1;
    position: absolute;
    top: -4px;
    right: 8px;
    z-index: 10;
    background: linear-gradient(black, black) padding-box,
                linear-gradient(45deg, #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3) border-box;
}

.casting-value span {
    transform: rotate(0deg);
    display: block;
}

.keywords-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.keywords-title {
    background-color: #666;
    color: white;
    font-weight: 600;
    padding: 4px 6px;
    font-size: 9px;
    text-align: center;
    width: 30%;
}

.keywords-value {
    background-color: rgba(0, 0, 0, 0.2);
    color: #ccc;
    padding: 4px 6px;
    font-size: 9px;
    text-align: left;
    width: 70%;
}

.unit-keywords-section {
    margin-top: 2px;
    overflow: visible;
}

/* Army information styles */
.army-info {
    padding: 5px 2px;
}

.army-section {
    margin-bottom: 8px;
    padding: 8px 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.army-section h4 {
    color: #d4af37;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: 600;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.collapsible-header:hover {
    background-color: rgba(212, 175, 55, 0.1);
    border-radius: 4px;
}

.collapse-icon {
    color: #d4af37;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.collapsible-content {
    margin-top: 8px;
}

/* Styles pour les battle tactics */
.battle-tactic-item {
    margin-bottom: 15px;
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    border-left: 4px solid #d4af37;
}

.battle-tactic-name {
    font-weight: bold;
    color: #d4af37;
    margin-bottom: 8px;
    font-size: 14px;
}

.battle-tactic-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.battle-tactic-attribute {
    font-size: 12px;
    color: #ccc;
}

.battle-tactic-attribute strong {
    color: #d4af37;
}


.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #d4af37;
    font-size: 12px;
}

.info-value {
    color: #f4f4f4;
    font-size: 12px;
}

.army-section p {
    color: #f4f4f4;
    font-size: 12px;
    line-height: 1.4;
    margin: 5px 0;
}

/* Styles pour les régiments */
.regiment-section {
    margin-bottom: 15px;
    border: 1px solid #444;
    border-radius: 5px;
    overflow: hidden;
}

.regiment-header {
    background: #333;
    padding: 8px 12px;
    border-bottom: 1px solid #444;
}

.regiment-units {
    background: #2a2a2a;
    padding: 8px;
}

.unit-item {
    margin-bottom: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

.unit-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.unit-name {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
}

.unit-enhancements {
    margin-top: 4px;
}

/* Styles pour le bouton d'ajout d'unité */
.add-to-battlefield-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 80px !important;
    justify-content: center !important;
    font-family: 'Cinzel', serif !important;
}

.add-to-battlefield-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4) !important;
    color: #fff !important;
}

.add-to-battlefield-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3) !important;
}

.add-to-battlefield-btn span:first-child {
    font-size: 16px !important;
    filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.5)) !important;
}

.add-to-battlefield-btn span:last-child {
    font-size: 12px !important;
    font-weight: 600 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) !important;
}

.dice-damage-detail {
    font-family: 'Cinzel', serif;
    font-size: 12px;
    color: #f4f4f4;
    margin-top: 4px;
    text-transform: none;
    letter-spacing: 0;
}
