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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    transition: background 0.5s ease;
}

/* Couleurs pour le joueur 1 */
body.player1-turn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Couleurs pour le joueur 2 */
body.player2-turn {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 60px 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 600px;
    width: 100%;
    animation: fadeIn 0.5s ease-in;
}

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

.game-title {
    font-size: 3.5em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 40px;
    font-style: italic;
}

.game-rules {
    text-align: left;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 40px;
}

.game-rules p {
    margin: 12px 0;
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 50px;
    font-size: 1.4em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.6);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-icon {
    margin-right: 10px;
}

/* Game Screen */
.game-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    max-width: 900px;
    margin: 20px auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px 40px;
    border-radius: 20px 20px 0 0;
    max-width: 900px;
    margin: 0 auto;
    font-size: 1.3em;
    font-weight: bold;
    gap: 30px;
}

.round-info {
    color: #667eea;
}

.score-info {
    color: #764ba2;
}

.player-score {
    margin: 5px 0;
    font-size: 0.9em;
}

.target-section {
    text-align: center;
    margin-bottom: 30px;
}

.target-label {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 10px;
}

.target-number {
    font-size: 5em;
    font-weight: bold;
    color: #667eea;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-buzz {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-buzz:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 25px rgba(245, 87, 108, 0.6);
}

.btn-buzz:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.buzz-icon {
    margin-right: 8px;
}

/* Timer */
.timer-section {
    text-align: center;
    margin-bottom: 30px;
}

.timer-label {
    font-size: 1.1em;
    color: #666;
    margin-bottom: 10px;
}

.timer {
    font-size: 3em;
    font-weight: bold;
    color: #f5576c;
    margin: 10px 0;
}

.timer.warning {
    animation: pulse 1s infinite;
}

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

.timer-bar {
    width: 100%;
    height: 12px;
    background: #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 10px;
}

.timer-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #fbbf24 50%, #f5576c 100%);
    transition: width 1s linear;
    border-radius: 6px;
}

/* Numbers */
.numbers-section {
    margin-bottom: 30px;
}

.numbers-label {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.numbers-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-bottom: 20px;
}

.number-tile {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 2em;
    font-weight: bold;
    padding: 25px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    border: none;
}

.number-tile:hover:not(.used) {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.number-tile.used {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    opacity: 0.5;
}

.number-tile:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Calculation */
.calculation-section {
    margin-bottom: 20px;
}

.calc-label {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.calculation-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    font-size: 1.3em;
    min-height: 80px;
    margin-bottom: 20px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-weight: 500;
    word-wrap: break-word;
    line-height: 1.5;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.btn-operator {
    background: #667eea;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.5em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-operator:hover:not(:disabled) {
    background: #5568d3;
    transform: scale(1.05);
}

.btn-operator:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-undo {
    background: #fbbf24;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-column: span 2;
}

.btn-undo:hover:not(:disabled) {
    background: #f59e0b;
    transform: scale(1.02);
}

.btn-undo:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-save {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-column: span 2;
}

.btn-save:hover:not(:disabled) {
    background: #2563eb;
    transform: scale(1.02);
}

.btn-save:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.btn-secondary {
    background: #6c757d;
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-column: span 2;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-validate {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: white;
    border: none;
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    grid-column: span 2;
}

.btn-validate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(34, 197, 94, 0.4);
}

.btn-validate:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.number-tile.result-tile {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    position: relative;
    border: 3px solid #1d4ed8;
}

.number-tile.result-tile::after {
    content: '💾';
    position: absolute;
    top: 2px;
    right: 4px;
    font-size: 0.8em;
}

/* Round Result */
.round-result {
    background: white;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    margin-top: 20px;
}

.round-result.hidden {
    display: none;
}

.hidden {
    display: none;
}

.round-result h3 {
    font-size: 2em;
    margin-bottom: 15px;
}

.round-result.success h3 {
    color: #22c55e;
}

.round-result.close h3 {
    color: #fbbf24;
}

.round-result.fail h3 {
    color: #f5576c;
}

.round-result p {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 20px;
}

/* End Screen */
.final-score {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    margin: 30px 0;
}

.final-score-label {
    font-size: 1.3em;
    color: #666;
    margin-bottom: 10px;
}

.final-score-value {
    font-size: 5em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.final-score-max {
    font-size: 1.2em;
    color: #999;
    margin-top: 5px;
}

.performance {
    font-size: 1.5em;
    color: #555;
    margin: 20px 0 30px 0;
    font-weight: 500;
}

/* Configuration Screen */
.config-section {
    margin: 30px 0;
    text-align: left;
}

.config-section h3 {
    font-size: 1.5em;
    color: #667eea;
    margin-bottom: 15px;
    text-align: center;
}

.config-options {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.config-btn {
    background: white;
    border: 3px solid #e0e0e0;
    padding: 15px 30px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.config-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.config-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.player-inputs {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 400px;
    margin: 0 auto;
}

.player-input {
    padding: 15px;
    font-size: 1.2em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    transition: border-color 0.3s ease;
}

.player-input:focus {
    outline: none;
    border-color: #667eea;
}

.config-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
}

/* Duo Scores */
.final-scores-duo {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 12px;
    margin: 30px 0;
}

.winner-announcement {
    font-size: 2em;
    font-weight: bold;
    margin-bottom: 30px;
    text-align: center;
}

.winner-announcement.player1 {
    color: #667eea;
}

.winner-announcement.player2 {
    color: #764ba2;
}

.winner-announcement.tie {
    color: #fbbf24;
}

.duo-scores-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
}

.player-final-score {
    text-align: center;
}

.player-final-name {
    font-size: 1.5em;
    color: #666;
    margin-bottom: 10px;
    font-weight: bold;
}

.player-final-value {
    font-size: 4em;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.vs-separator {
    font-size: 2em;
    font-weight: bold;
    color: #999;
}

/* Responsive */
@media (max-width: 768px) {
    .game-title {
        font-size: 2.5em;
    }
    
    .game-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .numbers-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .calc-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .btn-undo,
    .btn-save,
    .btn-secondary,
    .btn-validate {
        grid-column: span 1;
    }
    
    .config-options {
        flex-direction: column;
    }
    
    .duo-scores-display {
        flex-direction: column;
        gap: 20px;
    }
    
    .leaderboard-entry {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .leaderboard-date {
        width: 100%;
        text-align: right;
        margin-left: 0;
    }
}
