/* Reset et variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0e27;
    --bg-secondary: #151b3d;
    --bg-tertiary: #1f2847;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --accent-primary: #3b82f6;
    --accent-danger: #ef4444;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --border-color: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #1a1f3a 100%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 20px;
}

@media (max-width: 805px) {
    body {
        padding: 10px !important;
    }
}

@media (max-width: 600px) {
    body {
        padding: 5px !important;
    }
}

#app {
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

/* Écran d'enregistrement */
.registration-screen {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    max-height: calc(100vh - 40px);
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.registration-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.logo-container {
    flex: 1;
    display: flex;
    justify-content: center;
}

.game-logo {
    width: 100%;
    max-width: 400px;
    height: 120px;
    object-fit: cover;
    object-position: center 35%;
    border-radius: 8px;
}

.registration-screen h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 10px;
    color: var(--accent-danger);
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
}

.btn-help-registration {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 24px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-weight: bold;
    font-family: serif;
}

.btn-help-registration:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

.subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.game-settings {
    background: var(--bg-tertiary);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.setting-group {
    margin-bottom: 16px;
}

.setting-group:last-child {
    margin-bottom: 0;
}

.setting-group label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.setting-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
}

.setting-group select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.checkbox-group label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    color: var(--text-primary);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--accent-primary);
}

.player-form {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.player-form input {
    flex: 1;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
}

.player-form input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-avatar-picker {
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-avatar-picker:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.temp-avatar-preview {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.player-avatar-mini {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.player-gender-badge {
    margin-left: auto;
    font-size: 16px;
}

button {
    padding: 12px 24px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover:not(:disabled) {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.player-list {
    margin: 20px 0;
    max-height: 300px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 8px;
}

.btn-remove {
    width: 32px;
    height: 32px;
    padding: 0;
    background: var(--accent-danger);
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
}

.btn-start {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    background: var(--accent-success);
    margin-top: 20px;
}

.btn-start:hover:not(:disabled) {
    background: #059669;
}

.error {
    color: var(--accent-danger);
    text-align: center;
    margin-top: 15px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid var(--accent-danger);
}

/* Bouton charger une partie */
.btn-load-game {
    width: 100%;
    padding: 12px;
    margin-bottom: 20px;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-load-game:hover {
    background: #2563eb;
}

.btn-new-game-bottom {
    width: 100%;
    padding: 12px;
    margin-top: 20px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-new-game-bottom:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

/* Liste des parties sauvegardées */
.saved-games-list {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

.saved-games-list h3 {
    flex-shrink: 0;
    margin-bottom: 15px;
    color: var(--text-primary);
    text-align: center;
}

.saved-games-scroll {
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    padding-right: 5px;
}

.saved-games-list .btn-new-game-bottom {
    flex-shrink: 0;
}

.no-games {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
}

.saved-game-item {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-game-item:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.saved-game-content {
    flex: 1;
}

.saved-game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.saved-game-date {
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
}

.saved-game-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
}

.saved-game-status.playing {
    background: rgba(16, 185, 129, 0.2);
    color: var(--accent-success);
}

.saved-game-status.finished {
    background: rgba(148, 163, 184, 0.2);
    color: var(--text-secondary);
}

.saved-game-info {
    display: flex;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.saved-game-players {
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

.btn-delete-game {
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.btn-delete-game:hover {
    opacity: 1;
}

/* Écran de jeu */
.game-screen {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: calc(100vh - 40px);
    width: 100%;
}

.game-header {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.turn-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.timer {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-warning);
    font-variant-numeric: tabular-nums;
}

.timer.danger {
    color: var(--accent-danger);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.players-panel {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: visible;
}

@media (max-width: 768px) {
    .players-panel {
        padding: 15px;
        margin-bottom: 15px;
    }
}

.players-list-container {
    overflow-y: auto;
}

.timer-panel {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.timer-section {
    text-align: center;
}

.turn-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.timer-display {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-warning);
    font-variant-numeric: tabular-nums;
}

.timer-display.danger {
    color: var(--accent-danger);
    animation: pulse 1s infinite;
}

.progress-section {
    padding-top: 5px;
    flex: 1;
}

.progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    text-align: center;
    font-weight: 600;
}

.progress-bar-container {
    position: relative;
    height: 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: visible;
    border: 1px solid var(--border-color);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-success));
    border-radius: 12px;
    transition: width 0.3s ease;
}

.progress-dots {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    padding: 0 8px;
}

.progress-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    z-index: 1;
}

.progress-dot.active {
    background: var(--accent-success);
    border-color: white;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.btn-resolve-turn {
    margin-top: 12px;
    width: 100%;
    padding: 10px;
    font-size: 13px;
    background: var(--accent-primary);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-resolve-turn:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.players-title {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.player-card {
    background: var(--bg-tertiary);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.player-card:hover,
.player-card.popup-open {
    border-color: var(--accent-primary);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.4);
}

.player-card.played {
    opacity: 0.5;
    background: var(--bg-secondary);
}

.player-card.played::after {
    content: '✓';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    font-size: 20px;
    color: var(--accent-success);
    font-weight: bold;
}

.player-card.dead {
    opacity: 0.3;
    filter: grayscale(100%);
    cursor: not-allowed;
}

.player-card.dead::after {
    content: '💀 ✕';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    font-size: 24px;
    color: var(--accent-danger);
}

.player-card.winner {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.player-name {
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 15px;
}

.player-points {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent-success);
}

.player-points.low {
    color: var(--accent-warning);
}

.player-points.critical {
    color: var(--accent-danger);
}

.winner-flag {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 24px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

@keyframes happy-bounce {
    0%, 100% {
        transform: translateY(0) scale(1);
    }
    25% {
        transform: translateY(-8px) scale(1.05);
    }
    50% {
        transform: translateY(0) scale(1);
    }
    75% {
        transform: translateY(-4px) scale(1.02);
    }
}

.player-dot.happy-bounce {
    animation: happy-bounce 0.8s ease-in-out infinite;
}

/* Plateau de jeu */
.board {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (max-width: 805px) {
    .board {
        padding: 10px !important;
        gap: 10px !important;
    }
}

@media (max-width: 768px) {
    .board {
        padding: 8px !important;
        gap: 8px !important;
    }
}

@media (max-width: 600px) {
    .board {
        padding: 5px !important;
        gap: 5px !important;
    }
}

.board-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: min-content;
    gap: min(15px, 1.5vw);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .board-grid {
        gap: min(10px, 1vw) !important;
    }
}

@media (max-width: 805px) {
    .board-grid {
        gap: 8px !important;
        grid-template-columns: repeat(5, 15vw) !important;
        grid-template-rows: repeat(5, 15vw) !important;
        justify-content: center;
    }

    .room {
        width: 15vw !important;
        height: 15vw !important;
        max-width: 15vw !important;
        max-height: 15vw !important;
    }
}

@media (max-width: 768px) {
    .board-grid {
        gap: 5px !important;
        grid-template-columns: repeat(5, 17vw) !important;
        grid-template-rows: repeat(5, 17vw) !important;
    }

    .room {
        width: 17vw !important;
        height: 17vw !important;
        max-width: 17vw !important;
        max-height: 17vw !important;
    }
}

@media (max-width: 600px) {
    .board-grid {
        grid-template-columns: repeat(5, 18vw) !important;
        grid-template-rows: repeat(5, 18vw) !important;
    }

    .room {
        width: 18vw !important;
        height: 18vw !important;
        max-width: 18vw !important;
        max-height: 18vw !important;
    }
}

.room {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: min(15px, 1.5vw);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
    font-size: clamp(12px, 1.2vw, 16px);
    min-height: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 805px) {
    .room {
        padding: 10px !important;
        border-radius: 8px !important;
        border-width: 1px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 768px) {
    .room {
        padding: 8px !important;
        font-size: 11px !important;
    }
}

@media (max-width: 600px) {
    .room {
        padding: 6px !important;
        font-size: 10px !important;
    }
}

.room.start {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.room.exit {
    /* Exit masquée - à deviner ! */
}

.room.visited {
    border-color: #2563eb;
}

.room.has-players {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.room-cost {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-danger);
}

.room-hidden {
    color: var(--text-secondary);
    font-size: 2rem;
}

.room-players {
    position: absolute;
    top: 5px;
    right: 5px;
    background: var(--accent-primary);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}

.room-doors {
    display: flex;
    gap: 5px;
    margin-top: 10px;
}

.door-indicator {
    width: clamp(6px, 0.8vw, 8px);
    height: clamp(6px, 0.8vw, 8px);
    border-radius: 50%;
    background: var(--border-color);
}

.door-indicator.open {
    background: var(--accent-success);
}

@media (max-width: 768px) {
    .door-indicator {
        width: 5px;
        height: 5px;
    }
}

/* Écran de fin */
.end-screen {
    max-width: 600px;
    margin: 100px auto;
    background: var(--bg-secondary);
    padding: 40px;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-color);
    text-align: center;
}

.end-screen h1 {
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.winners, .survivors, .dead, .defeat {
    margin: 20px 0;
    padding: 20px;
    border-radius: 12px;
}

.winners {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--accent-success);
}

.dead {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
}

.defeat {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--accent-danger);
}

.winner-item {
    padding: 10px;
    margin: 5px 0;
    background: var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 600;
}

.winners-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    overflow: hidden;
}

.winners-table thead {
    background: var(--accent-primary);
}

.winners-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: white;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
}

.winners-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}

.winners-table tbody tr:last-child {
    border-bottom: none;
}

.winners-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

.winners-table td {
    padding: 14px 16px;
    font-size: 15px;
}

.winners-table .rank {
    font-weight: 700;
    font-size: 18px;
    color: var(--accent-warning);
    width: 80px;
}

.winners-table .name {
    font-weight: 600;
    color: var(--text-primary);
}

.winners-table .points {
    color: var(--accent-success);
    font-weight: 600;
}

.winners-table .happiness {
    color: var(--accent-primary);
    font-weight: 600;
}

.dead-item {
    padding: 10px;
    margin: 5px 0;
    background: transparent;
    border-radius: 8px;
    font-weight: 600;
    opacity: 0.9;
}

.end-screen-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn-reset {
    flex: 1;
    background: var(--accent-primary);
}

.btn-reset:hover {
    background: #2563eb;
}

.btn-home-end {
    flex: 1;
    padding: 16px;
    font-size: 18px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-home-end:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

/* Modale de confirmation */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideIn 0.3s ease;
}

.modal-content h2 {
    margin-bottom: 15px;
    color: var(--text-primary);
    font-size: 24px;
}

.modal-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 15px;
}

.btn-modal-cancel,
.btn-modal-confirm {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-modal-cancel {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-modal-cancel:hover {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
}

.btn-modal-confirm {
    background: var(--accent-primary);
    color: white;
}

.btn-modal-confirm:hover {
    background: #2563eb;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Modale d'aide */
.modal-help {
    max-width: 800px;
    max-height: 85vh;
    overflow-y: auto;
}

.modal-help h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
}

.modal-help h3 {
    color: var(--accent-primary);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 18px;
}

.help-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.help-section p {
    margin: 0;
    line-height: 1.6;
}

.help-section ul {
    margin: 10px 0 0 0;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.help-section strong {
    color: var(--accent-primary);
}

.btn-close-modal {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 32px;
    color: var(--text-secondary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-close-modal:hover {
    color: var(--text-primary);
    transform: scale(1.1);
}

/* Modale de sélection d'avatar */
.modal-avatar-picker {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-avatar-picker h2 {
    text-align: center;
    margin-bottom: 20px;
}

.avatar-type-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-avatar-type {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    max-width: 200px;
}

.btn-avatar-type:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
    transform: translateY(-2px);
}

.btn-avatar-type.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.avatar-gender-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.btn-gender {
    padding: 12px 24px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 16px;
    color: var(--text-primary);
}

.btn-gender:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-gender.active {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    padding: 10px;
}

.avatar-option {
    position: relative;
    cursor: pointer;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    padding: 5px;
    transition: all 0.3s;
    background: var(--bg-tertiary);
}

.avatar-option:hover {
    border-color: var(--accent-primary);
    transform: scale(1.05);
}

.avatar-option.selected {
    border-color: var(--accent-danger);
    opacity: 0.5;
    cursor: not-allowed;
}

.avatar-option.selected:hover {
    transform: none;
}

.avatar-option img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.avatar-used-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: var(--accent-danger);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* Nouvelle interface de jeu */
.game-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    height: calc(100vh - 40px);
}

@media (max-width: 1024px) {
    .game-container {
        grid-template-columns: 280px 1fr;
        gap: 15px;
    }
}

@media (max-width: 805px) {
    .game-container {
        grid-template-columns: 250px 1fr !important;
        gap: 10px !important;
    }
}

@media (max-width: 768px) {
    .game-container {
        grid-template-columns: 1fr !important;
        height: auto !important;
        gap: 10px !important;
    }
}

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

.happiness-bar-container {
    margin-top: 8px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.happiness-bar-fill {
    height: 100%;
    transition: width 0.3s ease;
}

.happiness-bar-fill.positive {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.happiness-bar-fill.negative {
    background: linear-gradient(90deg, #ef4444, #f87171);
}

.happiness-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px;
    font-weight: bold;
    color: var(--text-primary);
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

.player-actions-popup {
    position: fixed;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    border-radius: 12px;
    padding: 15px;
    width: 320px;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

.popup-title {
    font-weight: bold;
    color: var(--accent-primary);
    margin-bottom: 12px;
    font-size: 14px;
}

.directions-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr 1fr;
    gap: 8px;
    margin: 20px 0;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.direction-cell {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    padding: 8px;
}

.direction-cell.north {
    grid-column: 2;
    grid-row: 1;
}

.direction-cell.west {
    grid-column: 1;
    grid-row: 2;
}

.direction-cell.center {
    grid-column: 2;
    grid-row: 2;
    background: var(--bg-secondary);
}

.direction-cell.east {
    grid-column: 3;
    grid-row: 2;
}

.direction-cell.south {
    grid-column: 2;
    grid-row: 3;
}

.direction-cell:hover:not(.disabled) {
    border-color: var(--accent-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.direction-cell.selected {
    background: rgba(59, 130, 246, 0.15);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.direction-cell.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.direction-icon {
    font-size: 28px;
    margin-bottom: 4px;
    line-height: 1;
}

.direction-info {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
}

.direction-capacity {
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    font-size: 12px;
}

.direction-key {
    font-size: 10px;
    color: var(--accent-danger);
    font-weight: bold;
}

.direction-label {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
    margin-top: 2px;
}

.give-up-action {
    margin-bottom: 15px;
    padding: 12px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    border: 1px solid var(--accent-danger);
}

.btn-give-up {
    width: 100%;
    padding: 10px;
    background: var(--accent-danger);
    border: 1px solid var(--accent-danger);
    border-radius: 6px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-give-up:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-give-up:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.room-header-row {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 30px;
    pointer-events: none;
    z-index: 1;
}

.room-label {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
}

.room-info-right {
    position: absolute;
    top: 6px;
    right: 6px;
    display: flex;
    align-items: center;
}

.start-flag,
.exit-flag {
    font-size: 18px;
    opacity: 0.8;
}

.cost-badge {
    background: var(--accent-danger);
    color: white;
    padding: clamp(2px, 0.3vw, 3px) clamp(6px, 0.8vw, 8px);
    border-radius: 10px;
    font-size: clamp(9px, 1vw, 11px);
    font-weight: bold;
}

.cost-hidden {
    color: var(--text-secondary);
    font-size: clamp(12px, 1.5vw, 16px);
    opacity: 0.5;
}

@media (max-width: 768px) {
    .cost-badge {
        padding: 2px 5px;
        font-size: 9px;
        border-radius: 6px;
    }
}

.room-players-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(28px, 1fr));
    gap: 5px;
    justify-items: center;
    margin-bottom: 8px;
    max-width: 100%;
}

@media (max-width: 805px) {
    .room-players-list {
        grid-template-columns: repeat(auto-fit, minmax(24px, 1fr)) !important;
        gap: 3px !important;
        margin-bottom: 4px !important;
    }
}

.player-dot {
    width: clamp(24px, 3vw, 32px);
    height: clamp(24px, 3vw, 32px);
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(10px, 1.2vw, 14px);
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
}

@media (max-width: 768px) {
    .player-dot {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }
}

.player-dot.heartbeat {
    animation: heartbeat 1.5s ease-in-out infinite;
}

.player-dot.heartbeat::before,
.player-dot.heartbeat::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px solid var(--accent-primary);
    opacity: 0;
    animation: ripple 1.5s ease-out infinite;
}

.player-dot.heartbeat::after {
    animation-delay: 0.75s;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    10% {
        transform: scale(1.15);
    }
    20% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.15);
    }
    40% {
        transform: scale(1);
    }
}

@keyframes ripple {
    0% {
        width: 100%;
        height: 100%;
        opacity: 1;
    }
    100% {
        width: 200%;
        height: 200%;
        opacity: 0;
    }
}

.doors-container {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.door-widget {
    position: absolute;
    display: flex;
    gap: 3px;
    align-items: center;
    background: var(--bg-primary);
    padding: 2px 3px;
    border-radius: 8px;
    border: 2px solid;
    font-size: 14px;
}

.door-widget.north {
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.door-widget.south {
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
}

.door-widget.east {
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
}

.door-widget.west {
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
}

.dice-result {
    width: clamp(20px, 2.5vw, 28px);
    height: clamp(20px, 2.5vw, 28px);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: clamp(12px, 1.5vw, 16px);
}

@media (max-width: 805px) {
    .dice-result {
        width: 22px;
        height: 22px;
        font-size: 13px;
        border-radius: 4px;
    }
}

@media (max-width: 600px) {
    .dice-result {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* Popup de perte de points */
.points-loss-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.points-loss-popup {
    width: 90%;
    max-width: 1400px;
    height: 50vh;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border: 3px solid var(--accent-primary);
    border-radius: 16px;
    padding: 40px 20px;
    animation: scaleIn 0.5s ease-out;
    overflow-y: auto;
}

@media (max-width: 805px) {
    .points-loss-popup {
        padding: 30px 15px;
        height: auto;
        max-height: 80vh;
    }
}

@media (max-width: 600px) {
    .points-loss-popup {
        padding: 20px 10px;
        width: 95%;
    }
}

.points-loss-popup h2 {
    text-align: center;
    color: var(--accent-primary);
    font-size: clamp(20px, 5vw, 32px);
    margin-bottom: clamp(20px, 4vh, 40px);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.players-points-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(20px, 4vw, 40px);
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
}

.player-points-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(8px, 1.5vw, 12px);
    min-width: clamp(100px, 15vw, 120px);
}

.player-avatar {
    width: clamp(60px, 10vw, 80px);
    height: clamp(60px, 10vw, 80px);
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(24px, 4vw, 36px);
    font-weight: bold;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    overflow: hidden;
}

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

.player-status-icon {
    font-size: clamp(32px, 6vw, 48px);
}

.player-name {
    font-size: clamp(14px, 2.5vw, 18px);
    font-weight: 600;
    color: var(--text-primary);
}

.player-points-value {
    display: flex;
    align-items: baseline;
    gap: 6px;
    position: relative;
    margin-top: clamp(10px, 2vh, 20px);
}

.points-number {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: bold;
    color: var(--accent-success);
    font-family: 'Courier New', monospace;
}

.points-label {
    font-size: clamp(14px, 2.5vw, 18px);
    color: var(--text-secondary);
}

.points-lost-indicator {
    position: absolute;
    top: clamp(-20px, -3vh, -30px);
    left: 50%;
    transform: translateX(-50%);
    font-size: clamp(24px, 5vw, 36px);
    font-weight: bold;
    color: #ef4444;
    font-family: 'Courier New', monospace;
    animation: fadeUpAndOut 3s ease-out forwards;
    pointer-events: none;
}

@keyframes fadeUpAndOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-60px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Anciens styles - conservés au cas où */

/* =====================================================
   NOUVELLE INTERFACE - Contrôles inline sur badges
   ===================================================== */

.game-container-fullscreen {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
    max-height: calc(100vh - 40px);
    gap: 12px;
    overflow: hidden;
}

.game-container-fullscreen .game-header {
    background: var(--bg-secondary);
    padding: 20px 32px 20px 80px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
    position: relative;
}

@media (max-width: 805px) {
    .game-container-fullscreen .game-header {
        padding: 15px 20px 15px 70px;
    }
}

@media (max-width: 600px) {
    .game-container-fullscreen .game-header {
        padding: 12px 15px 12px 65px;
    }
}

.game-nav-buttons {
    position: absolute;
    left: 20px;
    display: flex;
    gap: 10px;
}

/* Bouton hamburger en jeu */
.btn-game-menu {
    width: 44px;
    height: 44px;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0;
}

.btn-game-menu span {
    width: 24px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s;
}

.btn-game-menu:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-game-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(7px, 7px);
}

.btn-game-menu.active span:nth-child(2) {
    opacity: 0;
}

.btn-game-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Overlay du menu en jeu */
.game-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 999;
}

/* Panel du menu en jeu */
.game-menu-panel {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

.game-menu-panel.open {
    left: 0;
}

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

.game-menu-header h3 {
    font-size: 20px;
    color: var(--text-primary);
    margin: 0;
}

.btn-close-menu {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 32px;
    cursor: pointer;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-close-menu:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.game-menu-items {
    flex: 1;
    padding: 10px 0;
}

.game-menu-item {
    width: 100%;
    padding: 16px 20px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    transition: all 0.3s;
    text-align: left;
}

.game-menu-item:hover {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-primary);
}

.game-menu-item .menu-icon {
    font-size: 24px;
    width: 32px;
    text-align: center;
}

.btn-home,
.btn-help {
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 24px;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.btn-home:hover,
.btn-help:hover {
    border-color: var(--accent-primary);
    background: rgba(59, 130, 246, 0.1);
    transform: scale(1.05);
}

.btn-help {
    font-weight: bold;
    font-family: serif;
}

.game-container-fullscreen .turn-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

.game-container-fullscreen .turn-section .turn-label {
    font-size: 24px;
    font-weight: bold;
}

.game-container-fullscreen .timer-section {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-warning);
}

.game-container-fullscreen .timer-section.danger {
    color: var(--accent-danger);
    animation: pulse 1s infinite;
}

.game-container-fullscreen .board-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 15px;
    height: 100%;
    overflow: hidden;
}

/* Badges de joueurs interactifs */
.player-badge-interactive {
    width: clamp(28px, 4vw, 40px);
    height: clamp(28px, 4vw, 40px);
    border-radius: 50%;
    background: var(--accent-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: clamp(14px, 1.8vw, 18px);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid var(--bg-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    user-select: none;
    touch-action: manipulation;
    overflow: hidden;
    padding: 0;
    position: relative;
}

.player-badge-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.player-badge-death {
    font-size: 24px;
}

.player-badge-interactive:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.6);
    z-index: 100;
}

.player-badge-interactive.player-badge-active {
    transform: scale(1.3);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
    z-index: 101;
}

.player-badge-interactive.player-badge-dead {
    background: var(--accent-danger);
    cursor: default;
    opacity: 0.7;
}

.player-badge-interactive.player-badge-played {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

/* Overlay de contrôles directionnels */
.player-controls-overlay {
    position: fixed;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 10000;
    transform: translate(-50%, -50%);
}

.player-controls-overlay::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(10, 14, 39, 0.95) 0%, rgba(10, 14, 39, 0.85) 70%, transparent 100%);
    border-radius: 50%;
    pointer-events: auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(59, 130, 246, 0.3);
    z-index: 1;
}

.player-controls-center-avatar {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 162px;
    height: 162px;
    border-radius: 50%;
    object-fit: cover;
    opacity: 0.95;
    z-index: 2;
    pointer-events: none;
}

.player-controls-overlay .direction-button {
    position: absolute;
    background: var(--bg-primary);
    border: 2px solid var(--accent-primary);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    z-index: 3;
    min-width: 50px;
}

.player-controls-overlay .direction-button:hover:not(.disabled) {
    background: var(--accent-primary);
    border-color: white;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
}

.player-controls-overlay .direction-button.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: var(--border-color);
}

.player-controls-overlay .direction-arrow {
    font-size: 20px;
    font-weight: bold;
}

.player-controls-overlay .direction-details {
    display: flex;
    gap: 4px;
    align-items: center;
    font-size: 12px;
}

.player-controls-overlay .direction-capacity {
    padding: 2px 6px;
    border-radius: 4px;
    color: white;
    font-weight: bold;
    font-size: 13px;
}

.direction-happiness {
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 11px;
    margin-left: 4px;
}

.direction-happiness.positive {
    background-color: var(--accent-success);
    color: white;
}

.direction-happiness.negative {
    background-color: var(--accent-danger);
    color: white;
}

/* Positionnement des boutons directionnels */
.player-controls-overlay .direction-north {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.player-controls-overlay .direction-south {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.player-controls-overlay .direction-west {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.player-controls-overlay .direction-east {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.player-controls-overlay .direction-center {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-success);
    border-color: var(--accent-success);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    justify-content: center;
    opacity: 0.1;
    transition: opacity 0.3s ease;
}

.player-controls-overlay .direction-center.disabled {
    opacity: 0.05;
    cursor: not-allowed;
    pointer-events: none;
}

.player-controls-overlay .direction-center:hover:not(.disabled) {
    opacity: 1;
    background: #0d9668;
    border-color: white;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.8);
}

.player-controls-overlay .direction-stay-label {
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.player-controls-overlay .direction-give-up {
    top: -30px;
    right: -30px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-danger);
    border-color: var(--accent-danger);
    font-size: 20px;
    justify-content: center;
    padding: 0;
}

.player-controls-overlay .direction-give-up:hover {
    background: #dc2626;
    border-color: white;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.8);
}

/* Adaptation pour mobile */
@media (max-width: 805px) {
    .player-controls-overlay {
        width: 170px;
        height: 170px;
    }

    .player-controls-overlay::before {
        width: 150px;
        height: 150px;
    }

    .player-controls-overlay .direction-button {
        padding: 8px;
        min-width: 45px;
    }

    .player-controls-overlay .direction-arrow {
        font-size: 18px;
    }

    .player-controls-overlay .direction-details {
        font-size: 11px;
    }

    .player-controls-overlay .direction-capacity {
        font-size: 12px;
        padding: 1px 5px;
    }

    .direction-happiness {
        font-size: 10px;
        padding: 1px 5px;
    }

    .player-controls-overlay .direction-center {
        width: 55px;
        height: 55px;
    }

    .player-controls-overlay .direction-stay-label {
        font-size: 11px;
    }

    .player-controls-overlay .direction-give-up {
        width: 36px;
        height: 36px;
        font-size: 18px;
        top: -25px;
        right: -25px;
    }
}

@media (max-width: 768px) {
    .player-controls-overlay {
        width: 160px;
        height: 160px;
    }

    .player-controls-overlay::before {
        width: 140px;
        height: 140px;
    }

    .player-controls-overlay .direction-button {
        padding: 6px;
        min-width: 40px;
    }

    .player-controls-overlay .direction-arrow {
        font-size: 16px;
    }

    .player-controls-overlay .direction-details {
        font-size: 10px;
    }

    .player-controls-overlay .direction-capacity {
        font-size: 11px;
    }

    .direction-happiness {
        font-size: 9px;
    }

    .player-controls-overlay .direction-center {
        width: 50px;
        height: 50px;
    }

    .player-controls-overlay .direction-stay-label {
        font-size: 10px;
    }

    .player-controls-overlay .direction-give-up {
        width: 32px;
        height: 32px;
        font-size: 16px;
        top: -20px;
        right: -20px;
    }

    .player-badge-interactive {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
        border-width: 2px !important;
    }

    .room-players-list {
        gap: 2px !important;
        margin-bottom: 4px !important;
    }
}

@media (max-width: 600px) {
    .player-controls-overlay {
        width: 150px;
        height: 150px;
    }

    .player-controls-overlay::before {
        width: 130px;
        height: 130px;
    }

    .player-controls-overlay .direction-button {
        padding: 5px;
        min-width: 38px;
    }

    .player-controls-overlay .direction-arrow {
        font-size: 14px;
    }

    .player-controls-overlay .direction-center {
        width: 45px;
        height: 45px;
    }

    .player-controls-overlay .direction-stay-label {
        font-size: 9px;
    }
}

@media (max-width: 600px) {
    .player-badge-interactive {
        width: 24px !important;
        height: 24px !important;
        font-size: 11px !important;
        border-width: 2px !important;
    }

    .room-players-list {
        gap: 2px !important;
    }
}

/* Styles spécifiques pour le nouveau layout fullscreen */
.game-container-fullscreen .room {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
    font-size: 16px;
    width: 100%;
    height: 100%;
}

.game-container-fullscreen .room.start {
    border-color: var(--accent-success);
    background: rgba(16, 185, 129, 0.1);
}

.game-container-fullscreen .room.visited {
    border-color: #2563eb;
}

.game-container-fullscreen .room.has-players {
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}

.game-container-fullscreen .progress-section {
    padding-top: 0;
    flex: 1;
}

.game-container-fullscreen .progress-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 6px;
    font-weight: 600;
}

.game-container-fullscreen .progress-bar-container {
    position: relative;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 10px;
    overflow: visible;
    border: 1px solid var(--border-color);
}

.game-container-fullscreen .turn-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin: 0;
}

.game-container-fullscreen .timer-display {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-warning);
    font-variant-numeric: tabular-nums;
    margin: 0;
}

.game-container-fullscreen .timer-display.danger {
    color: var(--accent-danger);
    animation: pulse 1s infinite;
}

/* Nom du joueur au-dessus des contrôles */
.player-controls-name {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-primary);
    font-weight: bold;
    font-size: 18px;
    white-space: nowrap;
    z-index: 2;
    pointer-events: auto;
    background: rgba(10, 14, 39, 0.95);
    padding: 8px 16px;
    border-radius: 12px;
    border: 2px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}
