:root {
    --bg-gradient-light: linear-gradient(135deg, #f5f7fa, #c3cfe2);
    --bg-gradient-dark: linear-gradient(135deg, #1e2227, #2d3436);
    --text-color-light: #333;
    --text-color-dark: #fff;
    --chat-bg: rgba(0, 0, 0, 0.8);
    --transition-speed: 0.3s;
    --border-radius: 10px;
    --spacing-unit: 1rem;
    --gameboy-green: #8bac0f;
    --gameboy-dark: #306230;
    --gameboy-darker: #0f380f;
    --gameboy-lightest: #9bbc0f;
    --gameboy-bg: #1f2f1f;
    --pixel-size: 2px;
}

/* Ajouter les styles pour la nouvelle page de connexion */
.auth-container {
    width: 100%;
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--gameboy-bg);
    border: var(--pixel-size) solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest);
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    max-width: 400px;
    margin: 0;
    z-index: 100;
}

.auth-header {
    background: var(--gameboy-darker);
    color: var(--gameboy-lightest);
    padding: 1rem;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: -2rem -2rem 2rem -2rem;
    border-bottom: var(--pixel-size) solid var(--gameboy-dark);
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.auth-input {
    background: var(--gameboy-bg);
    border: var(--pixel-size) solid var(--gameboy-dark);
    color: var(--gameboy-green);
    padding: 0.8rem;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
}

.auth-button {
    background: var(--gameboy-dark);
    color: var(--gameboy-lightest);
    border: var(--pixel-size) solid var(--gameboy-darker);
    padding: 1rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-button:hover {
    background: var(--gameboy-darker);
    color: var(--gameboy-green);
}

.auth-switch {
    text-align: center;
    margin-top: 1rem;
    color: var(--gameboy-lightest);
}

.auth-switch a {
    color: var(--gameboy-green);
    text-decoration: none;
}

.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.profile-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gameboy-bg);
    border: var(--pixel-size) solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest);
    border-radius: 8px;
    padding: 2rem;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-header {
    background: var(--gameboy-darker);
    border-bottom: var(--pixel-size) solid var(--gameboy-dark);
    padding: 1rem;
    color: var(--gameboy-lightest);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.profile-modal input,
.profile-modal textarea {
    width: 100%;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.profile-modal button {
    background: #2196F3;
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    width: 100%;
    margin: 5px 0;
    border-radius: 4px;
}

.profile-modal button:hover {
    background: #1976D2;
}

.profile-modal .error-message {
    color: red;
    margin-top: 10px;
}

.profile-modal .input-group {
    margin-bottom: 15px;
}

.profile-modal label {
    display: block;
    margin-bottom: 5px;
}

.profile-modal .submit-btn {
    background: #4CAF50;
    color: white;
    transition: background 0.3s;
}

.profile-modal .submit-btn:hover {
    background: #3e8e41;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Arial', sans-serif;
    background: var(--bg-gradient-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    padding: 2rem 0;
    color: white;
    transition: background 0.3s ease;
    padding-bottom: 100vh; /* Permet le scroll jusqu'en bas */
}

body.light-theme {
    background: var(--bg-gradient-light);
    color: var(--text-color-light);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 10px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.game-container {
    background: rgba(255, 255, 255, 0.1);
    padding: var(--spacing-unit);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: none;
    transition: transform 0.5s ease, box-shadow 0.3s ease;
    will-change: transform;
    width: min(95%, 800px);
    margin: auto;
    margin-bottom: 60vh; /* Espace pour le chat */
    width: min(95%, 800px);
    margin: 0 auto;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.2),
        inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: visible;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-container:hover {
    transform: none;
    box-shadow: none;
}

.score-board {
    display: flex;
    justify-content: space-around;
    margin-bottom: 2rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--border-radius);
}

.score {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    min-width: 100px;
    animation: slideUp 0.6s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    padding: 2rem;
    text-align: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius);
    transition: transform 0.3s ease;
}

.score:hover {
    transform: translateY(-2px);
}

.player-score-label,
.computer-score-label {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--theme-color, #4CAF50);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.3);
}

#player-score,
#computer-score {
    font-size: 2.5rem;
    font-weight: bold;
    transition: transform 0.3s ease, opacity 0.3s ease;
    font-size: 3rem;
    font-weight: bold;
    color: var(--gameboy-green);
    text-shadow: 0 0 10px rgba(139, 172, 15, 0.3);
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.score span {
    font-size: 2rem;
    font-weight: bold;
}

.choices {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
    padding: 1rem;
}

.choice {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    font-size: 2.5rem;
    color: white;
    cursor: pointer;
    padding: 1rem;
    border-radius: 50%;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), 
                background-color 0.2s ease;
    position: relative;
    overflow: hidden;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    will-change: transform;
    aspect-ratio: 1;
    width: 100%;
    max-width: 120px;
    margin: 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transition: all 0.3s ease, transform 0.1s ease;
}

.choice:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.choice:hover:not(:disabled) {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--gameboy-green);
    box-shadow: 0 5px 15px rgba(139, 172, 15, 0.3);
}

.choice:active:not(:disabled) {
    transform: translateY(1px);
}

.choice.hover {
    background: rgba(255, 255, 255, 0.2);
}

.choice.selected {
    background: rgba(139, 172, 15, 0.3);
    border: 2px solid var(--gameboy-green);
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(139, 172, 15, 0.5);
}

.choice.selected::after {
    content: '✓';
    position: absolute;
    top: -10px;
    right: -10px;
    background: var(--gameboy-green);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.result {
    text-align: center;
    font-size: 1.5rem;
    margin: 1rem 0;
    min-height: 2em;
    animation: fadeInScale 0.5s ease;
}

@keyframes fadeInScale {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.result.win { color: #4CAF50; }
.result.lose { color: #f44336; }
.result.draw { color: #FFC107; }

.game-history {
    margin-top: 2rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.game-history h3 {
    margin-bottom: 1rem;
}

.game-history ul {
    list-style: none;
}

.game-history li {
    padding: var(--spacing-unit);
    margin-bottom: calc(var(--spacing-unit) / 2);
    background: rgba(255, 255, 255, 0.1);
    border-radius: calc(var(--border-radius) / 2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.game-history li::before {
    content: '';
    position: absolute;
    left: 0;
    width: 3px;
    height: 100%;
    background: linear-gradient(transparent, #4CAF50, transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.game-history li:hover::before {
    opacity: 1;
}

.level-info {
    text-align: center;
    margin-bottom: 1rem;
}

.xp-bar {
    width: 100%;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    overflow: hidden;
    margin-top: 0.5rem;
}

#xp-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    background-size: 200% 100%;
    animation: gradientMove 3s linear infinite;
}

@keyframes gradientMove {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.game-modes {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin: 1rem 0;
}

.mode-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.mode-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: -100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.mode-btn:hover::after {
    left: 100%;
}

.multiplayer-controls {
    text-align: center;
    margin-top: 1rem;
}

.join-room {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.join-room input {
    padding: 0.5rem;
    border: none;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.join-room input:focus {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    outline: none;
}

.profile-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    :root {
        --spacing-unit: 0.8rem;
    }

    .game-container {
        margin: 1rem;
        padding: var(--spacing-unit);
        width: 100%;
        max-width: 100%;
        border-radius: 15px;
        padding: 1rem;
        margin: 1rem;
    }
    
    .choices {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 0.5rem;
    }

    .game-history {
        margin-bottom: calc(var(--spacing-unit) * 4);
        max-height: 150px;
        -webkit-overflow-scrolling: touch;
    }

    .choices {
        gap: 0.5rem;
    }

    .choice {
        --choice-size: 60px;
        width: var(--choice-size);
        height: var(--choice-size);
        font-size: calc(var(--choice-size) * 0.4);
        padding: 0.8rem;
        max-width: 80px;
    }

    /* Ajustement des boutons de contrôle pour mobile */
    .profile-btn,
    .theme-toggle {
        width: 40px;
        height: 40px;
        top: 10px;
    }

    /* Optimisation du score board pour mobile */
    .score-board {
        gap: 1rem;
        padding: 0.5rem;
    }

    .score {
        min-width: 80px;
        padding: 0.8rem;
        padding: 1rem;
    }

    /* Gestion des superpositions */
    .profile-modal .profile-content {
        width: 95%;
        max-height: 80vh;
        padding: 1rem;
    }

    /* Ajustement de la taille des inputs pour mobile */
    .join-room input {
        font-size: 16px; /* Évite le zoom automatique sur iOS */
        padding: 0.8rem;
    }

    body {
        padding-bottom: 60vh;
    }

    .game-container {
        margin-bottom: 200px;
    }
}

/* Optimisations mobiles */
@media (max-width: 320px) {
    .choices {
        flex-direction: row;
        justify-content: center;
    }

    .choice {
        font-size: 1.8rem;
        padding: 0.6rem;
    }
}

@media (min-width: 769px) {
    .chat-toggle {
        display: none !important;
    }
}

@media (max-width: 768px) {
    .chat-toggle {
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
    }
}

/* Supprimer toutes les styles liés au chat */
.chat-container,
.chat-toggle,
.chat-header,
.chat-content,
.chat-messages,
.chat-input,
.chat-input-container {
    display: none !important;
}

.achievements {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1rem;
}

.achievement-card {
    background: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s ease;
}

.achievement-card.unlocked {
    border: 2px solid #4CAF50;
    animation: unlockAchievement 0.5s ease;
}

@keyframes unlockAchievement {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.leaderboard {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 1rem;
    margin-top: 2rem;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.3s ease;
}

.leaderboard-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.room-info {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.room-id-display {
    font-family: monospace;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.room-id-display:hover {
    background: rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.room-id-label {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.room-id-value {
    color: #4CAF50;
    font-weight: bold;
    letter-spacing: 1px;
}

.copy-indicator {
    position: absolute;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.copy-indicator.show {
    opacity: 1;
}

.leave-room-btn {
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    border: none;
    border-radius: 5px;
    background: rgba(244, 67, 54, 0.2);
    color: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto;
}

.leave-room-btn:hover {
    background: rgba(244, 67, 54, 0.4);
    transform: translateY(-2px);
}

.leave-room-btn i {
    font-size: 0.9rem;
}

/* Styles pour la sélection de produits Shopify */
.product-select-container {
    background: var(--gameboy-bg);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: var(--pixel-size) solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest);
    position: relative;
    overflow: hidden;
}

.product-select-container.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Courier New', monospace;
    color: var(--gameboy-lightest);
}

#product-select {
    width: 100%;
    padding: 0.8rem;
    background: var(--gameboy-bg);
    border: var(--pixel-size) solid var(--gameboy-dark);
    color: var(--gameboy-green);
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

#product-select option:disabled {
    color: var(--gameboy-darker);
    font-style: italic;
}

.product-select-container button {
    width: 100%;
    padding: 0.8rem;
    background: var(--gameboy-dark);
    border: var(--pixel-size) solid var(--gameboy-darker);
    color: var(--gameboy-lightest);
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.product-select-container button:hover {
    background: var(--gameboy-darker);
    color: var(--gameboy-green);
}

.product-select-container button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--gameboy-darker);
}

/* Modal de confirmation */
.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gameboy-bg);
    padding: 2rem;
    border: var(--pixel-size) solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest);
    z-index: 1000;
    font-family: 'Courier New', monospace;
}

.confirm-modal .modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.confirm-modal button {
    flex: 1;
    padding: 0.8rem;
    border: var(--pixel-size) solid var(--gameboy-darker);
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-modal .confirm {
    background: var(--gameboy-dark);
    color: var(--gameboy-lightest);
}

.confirm-modal .cancel {
    background: var(--gameboy-darker);
    color: var(--gameboy-green);
}

.confirm-modal.hidden {
    display: none;
}

/* Styles pour les détails des produits */
.product-details {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gameboy-bg);
    border-radius: var(--border-radius);
    border: var(--pixel-size) solid var(--gameboy-dark);
}

.product-summary {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.product-image {
    max-width: 150px;
    border-radius: var(--border-radius);
    border: var(--pixel-size) solid var (--gameboy-dark);
}

.product-info {
    text-align: center;
}

.price {
    color: var(--gameboy-green);
    font-size: 1.2em;
    font-weight: bold;
}

.stock {
    margin-top: 0.5rem;
    font-size: 0.9em;
}

.stock.in-stock {
    color: var(--gameboy-lightest);
}

.stock.out-of-stock {
    color: #f44336;
}

.product-display {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gameboy-bg);
    border: var(--pixel-size) solid var(--gameboy-dark);
    border-radius: var(--border-radius);
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
}

.product-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius);
    border: var(--pixel-size) solid var(--gameboy-dark);
}

.product-title {
    font-size: 1.2em;
    margin-bottom: 0.5rem;
    color: var(--gameboy-lightest);
}

.product-price {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--gameboy-green);
    margin-bottom: 0.5rem;
}

.product-stock {
    font-size: 0.9em;
}

.product-stock.in-stock {
    color: var(--gameboy-green);
}

.product-stock.out-of-stock {
    color: #f44336;
}

/* Styles pour le modal de livraison */
.delivery-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.delivery-modal.hidden {
    display: none;
}

.delivery-content {
    background: var(--gameboy-bg);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
}

.delivery-content h2 {
    color: var(--gameboy-lightest);
    text-align: center;
    margin-bottom: 1rem;
}

.delivery-content .form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.delivery-content input {
    padding: 0.8rem;
    border: var(--pixel-size) solid var(--gameboy-dark);
    background: var(--gameboy-bg);
    color: var(--gameboy-green);
}

.form-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.form-buttons button {
    flex: 1;
    padding: 0.8rem;
    cursor: pointer;
}

/* Styles pour le formulaire de paiement */
.stripe-form {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--gameboy-bg);
    padding: 2rem;
    border-radius: 10px;
    width: 90%;
    max-width: 500px;
    z-index: 1001;
}

#card-element {
    padding: 1rem;
    background: var(--gameboy-dark);
    border: var(--pixel-size) solid var(--gameboy-darker);
    border-radius: 5px;
    margin-bottom: 1rem;
}

.error-message {
    color: #f44336;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

/* Styles pour le formulaire de paiement Stripe */
/* SUPPRESSION et RECONSTRUCTION du modal Stripe */
/* Suppression des anciens styles problématiques */
/* Les sélecteurs suivants sont reconstruits individuellement plus bas dans le CSS */

/* Construction d'un nouveau modal qui sera toujours visible et centré */
.stripe-payment-container {
    position: fixed;
    inset: 0; /* Remplace top/right/bottom/left: 0 */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 9999;
    padding: 1rem;
    overflow-y: auto;
}

.stripe-form {
    position: relative;
    width: 100%;
    max-width: 500px;
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    margin: auto;
    animation: stripeFormIn 0.3s ease-out;
    transform: none; /* Supprime toute transformation qui pourrait interférer */
}

@keyframes stripeFormIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustement mobile */
@media (max-width: 768px) {
    .stripe-payment-container {
        padding: 0.5rem;
    }

    .stripe-form {
        padding: 1.5rem;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

.waiting-room-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--gameboy-bg);
    border: var(--pixel-size) solid var(--gameboy-dark);
    border-radius: var(--border-radius);
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.match-info {
    text-align: center;
}

.product-details {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

.product-details img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: var(--border-radius);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gameboy-dark);
    border-top-color: var(--gameboy-green);
    border-radius: 50%;
    margin: 2rem auto;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.game-page {
    background: linear-gradient(135deg, #1a1c20 0%, #2d3436 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.game-container {
    width: 100%;
    max-width: 1200px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: grid;
    gap: 2rem;
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    width: 100%;
    margin-bottom: 1rem;
}

.players-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 2rem;
    align-items: center;
}

.player-info {
    text-align: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    transition: transform 0.3s ease;
}

.player-info:hover {
    transform: translateY(-5px);
}

.player-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.vs-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs-circle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5253 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px rgba(238, 82, 83, 0.3);
}

.gameplay-area {
    text-align: center;
    padding: 2rem;
    position: relative;
}

.gameplay-area::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.1;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path fill="white" d="M10,10L90,10L90,90L10,90Z"/></svg>');
    background-size: 30px 30px;
}

.choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin: 2rem 0;
}

.choice {
    padding: 2rem;
    border: none;
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.choice:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.choice i {
    font-size: 2rem;
}

/* Stripe Payment Modal - Enhanced Styles */
.stripe-payment-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 10000; /* Ensure it's above all other elements */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.stripe-form {
    width: 100%;
    max-width: 500px;
    background: var(--gameboy-bg);
    padding: 2rem;
    border-radius: 12px;
    border: var(--pixel-size) solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest),
        0 10px 30px rgba(0, 0, 0, 0.4);
    margin: auto;
    color: var(--gameboy-lightest);
}

.stripe-form h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--gameboy-green);
    text-transform: uppercase;
    letter-spacing: 1px;
}

#card-element {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: var(--pixel-size) solid var(--gameboy-dark);
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.pay-button {
    width: 100%;
    padding: 1rem;
    background: var(--gameboy-dark);
    color: var(--gameboy-lightest);
    border: var(--pixel-size) solid var(--gameboy-darker);
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    text-shadow: 1px 1px 0 var(--gameboy-darker);
    position: relative;
    overflow: hidden;
}

.pay-button:hover {
    background: var(--gameboy-green);
    color: var (--gameboy-darker);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.pay-button:active {
    transform: translateY(0);
}

.pay-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--gameboy-darker);
}

.pay-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -60%;
    width: 20%;
    height: 200%;
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(30deg);
    transition: all 0.6s ease;
}

.pay-button:hover::after {
    left: 100%;
}

.error-message {
    color: #f44336;
    background: rgba(244, 67, 54, 0.1);
    padding: 0.8rem;
    border-radius: 5px;
    margin: 1rem 0;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--gameboy-lightest);
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close-modal:hover {
    color: var(--gameboy-green);
    transform: rotate(90deg);
}

/* Styles for the order summary in the Stripe modal */
.order-summary {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.order-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.order-total {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: bold;
    color: var(--gameboy-green);
}

/* Ensure the Stripe elements are visible and nicely styled */
.StripeElement {
    background-color: rgba(255, 255, 255, 0.1);
    padding: 1rem;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.StripeElement--focus {
    background-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 2px var(--gameboy-green);
}

.StripeElement--invalid {
    box-shadow: 0 0 0 2px #f44336;
}

/* Styles pour l'état de chargement */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    font-size: 1.2rem;
    color: var(--gameboy-lightest);
}

#root {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#app {
    flex: 1;
    display: flex;
    flex-direction: column;
}

#main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem;
}

/* Styles pour les modals et formulaires */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: var(--gameboy-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    border: var(--pixel-size) solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-group input {
    padding: 0.8rem;
    border: var(--pixel-size) solid var(--gameboy-dark);
    background: var(--gameboy-bg);
    color: var(--gameboy-green);
    font-family: 'Courier New', monospace;
}

.form-buttons {
    display: flex;
    gap: 1rem;
}

.form-buttons button {
    flex: 1;
    padding: 0.8rem;
    cursor: pointer;
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease;
}

.form-buttons .submit {
    background: var(--gameboy-dark);
    color: var(--gameboy-lightest);
    border: var(--pixel-size) solid var(--gameboy-darker);
}

.form-buttons .cancel {
    background: var(--gameboy-darker);
    color: var(--gameboy-green);
    border: var(--pixel-size) solid var(--gameboy-dark);
}

/* Styles pour le modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background: var(--gameboy-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 500px;
    animation: modalFadeIn 0.3s ease;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Completely remove all existing Stripe payment styles that might conflict */
/* These selectors have been reset and redefined below:
   .stripe-payment-container
   .stripe-form
   .stripe-payment-form
   .payment-form-modal
*/

/* Create clean, simplified Stripe modal styles */
.stripe-payment-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    backdrop-filter: blur(5px) !important;
    z-index: 100000 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 1rem !important;
}

.stripe-form {
    position: relative !important;
    width: 90% !important;
    max-width: 500px !important;
    background: var(--gameboy-bg) !important;
    color: var(--gameboy-lightest) !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    border: var(--pixel-size) solid var(--gameboy-dark) !important;
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest),
        0 10px 30px rgba(0, 0, 0, 0.4) !important;
    margin: auto !important;
    transform: none !important; /* Empêcher toute transformation qui pourrait affecter le positionnement */
    overflow: visible !important;
}

/* Assurez-vous que le contenu du formulaire est bien visible */
#payment-element {
    background-color: rgba(255, 255, 255, 0.1) !important;
    padding: 1rem !important;
    border-radius: 5px !important;
    margin-bottom: 1.5rem !important;
}

.stripe-buttons {
    display: flex !important;
    gap: 1rem !important;
    margin-top: 1.5rem !important;
}

.stripe-buttons button {
    flex: 1 !important;
    padding: 0.8rem !important;
    cursor: pointer !important;
    border: var(--pixel-size) solid var(--gameboy-darker) !important;
    font-family: 'Courier New', monospace !important;
    transition: all 0.3s ease !important;
}

.submit-button {
    background: var(--gameboy-dark) !important;
    color: var(--gameboy-lightest) !important;
}

.cancel-button {
    background: var(--gameboy-darker) !important;
    color: var(--gameboy-green) !important;
}

/* Ajustements spécifiques pour mobile */
@media (max-width: 768px) {
    .stripe-payment-container {
        padding: 0.5rem !important;
    }
    
    .stripe-form {
        width: 95% !important;
        padding: 1.5rem !important;
        max-height: 90vh !important;
        overflow-y: auto !important; /* Permettre le défilement sur petits écrans */
    }
}

/* ...existing code... */

/* Supprimer toutes les autres définitions de .stripe-payment-container et .stripe-form dans le fichier */

/* Modal Stripe - Style unifié et simplifié */
.stripe-payment-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: rgba(0, 0, 0, 0.85) !important;
    z-index: 99999 !important;
    padding: 0 !important;
    margin: 0 !important;
}

.stripe-form {
    position: relative !important;
    width: 90% !important;
    max-width: 500px !important;
    background: var(--gameboy-bg) !important;
    color: var(--gameboy-lightest) !important;
    padding: 2rem !important;
    border-radius: 12px !important;
    border: var(--pixel-size) solid var(--gameboy-dark) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    margin: auto !important;
    transform: none !important;
}

#payment-element {
    margin-bottom: 1.5rem !important;
}

.stripe-buttons {
    display: flex !important;
    gap: 1rem !important;
    margin-top: 1.5rem !important;
}

.stripe-buttons button {
    flex: 1 !important;
    padding: 0.8rem !important;
    cursor: pointer !important;
}

.submit-button {
    background: var(--gameboy-dark) !important;
    color: var(--gameboy-lightest) !important;
}

.cancel-button {
    background: var(--gameboy-darker) !important;
    color: var(--gameboy-green) !important;
}

@media (max-width: 768px) {
    .stripe-form {
        width: 95% !important;
        padding: 1.5rem !important;
    }
}

/* ...existing code... */

/* RESET COMPLET DES STYLES STRIPE */
/* Ces sélecteurs éliminent définitivement les styles problématiques */
.stripe-payment-container,
.stripe-form,
[class*="stripe-"],
[id*="stripe-"],
.StripeElement {
    all: initial; /* Reset radical de tous les styles */
    font-family: inherit;
    color: inherit;
}

/* Base fixe et prioritaire pour le modal */
.stripe-payment-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: rgba(0, 0, 0, 0.85) !important;
    z-index: 2147483647 !important; /* Valeur maximum pour z-index */
    padding: 0 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
}

/* Contenu du formulaire avec priorité absolue */
.stripe-form {
    position: relative !important;
    width: 90% !important;
    max-width: 500px !important;
    background: var(--gameboy-bg) !important;
    color: var(--gameboy-lightest) !important;
    border-radius: 12px !important;
    padding: 2rem !important;
    margin: 0 auto !important;
    transform: none !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4) !important;
    box-sizing: border-box !important;
}

/* Style spécifique pour l'élément de paiement Stripe */
#payment-element {
    background-color: rgba(255, 255, 255, 0.1) !important;
    padding: 1rem !important;
    border-radius: 4px !important;
    margin-bottom: 1.5rem !important;
    box-sizing: border-box !important;
}

/* Autres styles nécessaires avec priorité maximale */
.stripe-buttons {
    display: flex !important;
    gap: 1rem !important;
    width: 100% !important;
}

.submit-button, 
.cancel-button {
    flex: 1 !important;
    cursor: pointer !important;
    padding: 0.8rem 1rem !important;
    border-radius: 4px !important;
    font-family: inherit !important;
    font-size: 1rem !important;
}

.submit-button {
    background: var(--gameboy-dark) !important;
    color: var(--gameboy-lightest) !important;
    border: 2px solid var(--gameboy-darker) !important;
}

.cancel-button {
    background: var(--gameboy-darker) !important;
    color: var(--gameboy-green) !important;
    border: 2px solid var(--gameboy-dark) !important;
}

/* Correction spécifique pour mobile */
@media (max-width: 768px) {
    .stripe-payment-container {
        align-items: flex-start !important;
        padding-top: 10vh !important;
        overflow-y: auto !important;
    }
    
    .stripe-form {
        width: 95% !important;
        padding: 1.5rem !important;
        margin: 10vh auto auto auto !important;
    }
}

/* Amélioration du statut de connexion avec un point vert */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.connection-status.connected .status-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 8px #4CAF50;
    animation: pulse 2s infinite;
}

.connection-status.disconnected .status-dot {
    background-color: #f44336;
    box-shadow: 0 0 8px #f44336;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* STYLES POUR LE MODAL DE FIN DE PARTIE */
.game-result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.game-result-overlay.show {
    opacity: 1;
    visibility: visible;
}

.game-result-modal {
    background: var(--gameboy-bg);
    border: 4px solid var(--gameboy-dark);
    box-shadow: 
        inset -4px -4px 0 var(--gameboy-darker),
        inset 4px 4px 0 var(--gameboy-lightest),
        0 0 30px rgba(0, 0, 0, 0.5);
    border-radius: 15px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.7) translateY(50px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.game-result-overlay.show .game-result-modal {
    transform: scale(1) translateY(0);
}

.result-icon-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.result-icon {
    font-size: 4rem;
    display: inline-block;
    animation: resultIconBounce 0.6s ease;
}

@keyframes resultIconBounce {
    0% { transform: scale(0) rotate(180deg); }
    50% { transform: scale(1.2) rotate(0deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.result-icon.victory::before {
    content: '👑';
    color: #FFD700;
    filter: drop-shadow(0 0 10px #FFD700);
}

.result-icon.defeat::before {
    content: '😔';
    filter: drop-shadow(0 0 10px #666);
}

.result-title {
    font-family: 'Press Start 2P', 'Courier New', cursive;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 0px var(--gameboy-darker);
}

.result-title.victory {
    color: var(--gameboy-green);
    animation: victoryGlow 2s infinite alternate;
}

.result-title.defeat {
    color: #ff6b6b;
}

@keyframes victoryGlow {
    from { text-shadow: 0 0 5px var(--gameboy-green), 2px 2px 0px var(--gameboy-darker); }
    to { text-shadow: 0 0 15px var(--gameboy-green), 2px 2px 0px var(--gameboy-darker); }
}

.result-message {
    font-size: 0.9rem;
    color: var(--gameboy-lightest);
    margin-bottom: 2rem;
    line-height: 1.4;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid var(--gameboy-dark);
}

.product-won {
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(139, 172, 15, 0.1);
    border: 2px solid var(--gameboy-green);
    border-radius: 10px;
    animation: productWonGlow 3s infinite alternate;
}

@keyframes productWonGlow {
    from { box-shadow: 0 0 5px rgba(139, 172, 15, 0.3); }
    to { box-shadow: 0 0 15px rgba(139, 172, 15, 0.6); }
}

.won-product-display {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.won-product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid var(--gameboy-green);
}

.won-product-info {
    flex: 1;
    text-align: left;
}

.won-product-title {
    font-family: 'Press Start 2P', 'Courier New', cursive;
    font-size: 0.7rem;
    color: var(--gameboy-green);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.won-product-price {
    font-family: 'Press Start 2P', 'Courier New', cursive;
    font-size: 0.8rem;
    color: var(--gameboy-lightest);
    margin-bottom: 1rem;
}

.delivery-info {
    text-align: center;
}

.delivery-info p {
    font-size: 0.7rem;
    color: var(--gameboy-green);
    margin: 0.3rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.result-actions .pixel-btn {
    flex: 1;
    margin: 0;
    font-size: 0.7rem;
    padding: 1rem;
    min-width: 120px;
    background: var(--gameboy-dark);
    color: var(--gameboy-lightest);
    border: 3px solid var(--gameboy-darker);
    font-family: 'Press Start 2P', 'Courier New', cursive;
    cursor: pointer;
    transition: all 0.3s ease;
}

#play-again-btn {
    background: var(--gameboy-green);
    color: var(--gameboy-darker);
    border-color: var(--gameboy-green);
}

#play-again-btn:hover {
    background: var(--gameboy-lightest);
    color: var(--gameboy-darker);
}

#back-home-btn {
    background: var(--gameboy-dark);
    color: var(--gameboy-lightest);
    border-color: var(--gameboy-darker);
}

#back-home-btn:hover {
    background: var(--gameboy-darker);
    color: var(--gameboy-green);
}

/* Styles pour le résultat final du match */
.final-result-banner {
    position: fixed; /* Changé de absolute à fixed pour assurer la visibilité */
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.5);
    background: linear-gradient(135deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.9) 100%);
    padding: 2rem 4rem;
    border-radius: 15px;
    text-align: center;
    z-index: 10000; /* Augmenté pour s'assurer qu'il est au-dessus de tout */
    opacity: 0;
    pointer-events: none; /* Par défaut, ignore les clics */
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 80%;
    max-width: 500px;
    backdrop-filter: blur(10px);
    border: 3px solid;
    display: block; /* Toujours visible, mais opacity:0 par défaut */
}

.final-result-banner.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    pointer-events: auto; /* Permet les interactions lorsque visible */
}

.final-result-banner.winner {
    border-color: #4CAF50;
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.5);
}

.final-result-banner.loser {
    border-color: #f44336;
    box-shadow: 0 0 30px rgba(244, 67, 54, 0.5);
}

.final-result-banner h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.final-result-banner.winner h1 {
    color: #4CAF50;
    text-shadow: 0 0 10px rgba(76, 175, 80, 0.7);
}

.final-result-banner.loser h1 {
    color: #f44336;
    text-shadow: 0 0 10px rgba(244, 67, 54, 0.7);
}

.result-icon {
    font-size: 4rem;
    margin: 1rem 0;
    animation: bounce 1s infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(-10px); }
    to { transform: translateY(10px); }
}

.final-result-message {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 1rem 0;
    padding: 0.5rem;
    border-radius: 5px;
}

.win-message {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.lose-message {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid #f44336;
}

/* Amélioration de l'écran de fin de jeu */
.game-over-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 2rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.game-over-screen h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
}

/* Style mobile pour les résultats finaux */
@media (max-width: 768px) {
    .final-result-banner {
        padding: 1.5rem;
        width: 90%;
    }
    
    .final-result-banner h1 {
        font-size: 2rem;
    }
    
    .result-icon {
        font-size: 3rem;
    }
}

/* Styles améliorés pour le statut de connexion automatique */
.connection-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    padding: 6px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.2);
    margin-top: 15px;
    transition: all 0.3s ease;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    transition: all 0.3s ease;
}

.connection-status.connected .status-dot {
    background-color: #4CAF50;
    box-shadow: 0 0 8px #4CAF50;
    animation: pulse 2s infinite;
}

.connection-status.connecting .status-dot {
    background-color: #FFC107;
    box-shadow: 0 0 8px #FFC107;
    animation: pulse 1s infinite;
}

.connection-status.disconnected .status-dot {
    background-color: #f44336;
    box-shadow: 0 0 8px #f44336;
}

@keyframes pulse {
    0% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.2); }
    100% { opacity: 1; transform: scale(1); }
}

/* Animation d'attente améliorée */
.waiting-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

/* Correction pour la taille de l'image du produit dans la salle d'attente */
.waiting-room-container .image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.waiting-room-container .small-image {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
    border-radius: var(--border-radius);
    border: var(--pixel-size) solid var(--gameboy-dark);
}

/* Correction pour le bouton d'annulation */
.waiting-room-container .cancel-button {
    max-width: 100%;
    width: auto;
    white-space: normal;
    padding: 0.8rem 1.5rem;
    background: rgba(244, 67, 54, 0.3);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    text-align: center;
    display: block;
    margin: 1rem auto;
}

.waiting-room-container .cancel-button:hover {
    background: rgba(244, 67, 54, 0.5);
}

/* Styles améliorés pour l'affichage du stock */
.product-stock {
    font-size: 0.9rem;
    padding: 4px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.5rem;
}

.product-stock.in-stock {
    background-color: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.product-stock.low-stock {
    background-color: rgba(255, 193, 7, 0.2);
    color: #FFC107;
    border: 1px solid rgba(255, 193, 7, 0.3);
}

.product-stock.out-of-stock {
    background-color: rgba(244, 67, 54, 0.2);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

/* Styles pour la liste déroulante de produits */
#product-select {
    font-size: 1rem;
    padding: 0.8rem;
}

#product-select option {
    padding: 8px;
    border-bottom: 1px solid rgba(139, 172, 15, 0.2);
}

#product-select option:last-child {
    border-bottom: none;
}

/* Styles améliorés pour le bouton de retour à l'accueil */
#back-home {
    display: inline-block; /* Assurez-vous qu'il est toujours visible */
    background: linear-gradient(45deg, var(--gameboy-dark), var(--gameboy-darker));
    color: var(--gameboy-lightest);
    border: none;
    padding: 12px 24px;
    border-radius: 50px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3), 
                inset 0 0 0 2px var(--gameboy-green);
}

#back-home:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 8px 25px rgba(139, 172, 15, 0.4),
                inset 0 0 0 3px var(--gameboy-green);
}

#back-home:active {
    transform: translateY(0) scale(0.98);
}

#back-home::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg, 
        transparent, 
        rgba(139, 172, 15, 0.3), 
        transparent
    );
    transition: left 0.7s ease;
}

#back-home:hover::before {
    left: 100%;
}

#back-home.pulse {
    animation: buttonPulse 0.6s infinite alternate;
}

@keyframes buttonPulse {
    from { transform: scale(1); box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2), inset 0 0 0 2px var(--gameboy-green); }
    to { transform: scale(1.05); box-shadow: 0 8px 25px rgba(139, 172, 15, 0.4), inset 0 0 0 3px var(--gameboy-green); }
}

/* Style spécial pour le message de victoire avec le produit */
.win-notice {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    background: rgba(76, 175, 80, 0.2);
    padding: 10px;
    border-radius: 5px;
    color: var(--gameboy-lightest);
    border: 1px solid rgba(76, 175, 80, 0.5);
}

/* Style responsive pour le bouton */
@media (max-width: 768px) {
    #back-home {
        padding: 10px 20px;
        font-size: 1rem;
    }
    
    .win-notice {
        font-size: 0.8rem;
        padding: 8px;
    }
}

/* Optimisation mobile - Améliorations */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 0.8rem;
    }

    /* Méta-viewport déjà défini dans le HTML, ajoutons des styles optimisés pour mobile */
    body {
        -webkit-text-size-adjust: 100%; /* Empêche l'ajustement automatique du texte sur iOS */
        touch-action: manipulation; /* Améliore la réactivité tactile */
        padding-bottom: 40vh; /* Réduit le padding excessif */
        overflow-x: hidden; /* Empêche le défilement horizontal */
    }

    .game-container {
        margin: 0.5rem auto;
        padding: 1rem;
        width: 100%;
        max-width: 100%;
        border-radius: 15px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }
    
    .choices {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
        padding: 0.5rem;
        margin: 1rem 0;
    }

    .choice {
        --choice-size: 60px;
        width: var(--choice-size);
        height: var(--choice-size);
        font-size: calc(var(--choice-size) * 0.4);
        padding: 0.5rem;
        max-width: 80px;
        touch-action: manipulation; /* Améliore les interactions tactiles */
        -webkit-tap-highlight-color: transparent; /* Supprime le surlignage au toucher */
    }

    /* Ajustement du score board pour mobile */
    .score-board {
        gap: 0.5rem;
        padding: 0.5rem;
        margin: 1rem 0;
    }

    .score {
        min-width: 80px;
        padding: 0.8rem;
    }
    
    #player-score,
    #computer-score {
        font-size: 2.2rem; /* Taille de police réduite pour mobile */
    }

    /* Amélioration des résultats de match sur mobile */
    .final-result-banner {
        padding: 1.5rem;
        width: 90%;
        max-width: 90%;
    }
    
    .final-result-banner h1 {
        font-size: 1.8rem;
        margin-bottom: 0.5rem;
    }
    
    .result-icon {
        font-size: 3rem;
        margin: 0.5rem 0;
    }
    
    .final-result-message {
        font-size: 1rem;
        margin: 0.5rem 0;
    }
    
    #back-home {
        padding: 10px 20px;
        font-size: 0.9rem;
        margin-top: 15px;
    }

    /* Optimisation des formulaires pour mobile - empêcher le zoom */
    input, 
    select, 
    textarea,
    button {
        font-size: 16px !important; /* Taille minimum pour éviter le zoom sur iOS */
        -webkit-appearance: none; /* Supprime l'apparence native */
        appearance: none;
        border-radius: 0; /* Restaurer explicitement après -webkit-appearance: none */
    }
    
    /* Restaurer les coins arrondis après reset */
    input, select, textarea {
        border-radius: 5px;
    }
    
    button {
        border-radius: 5px;
    }
    
    /* Style spécifique au bouton de retour */
    #back-home {
        border-radius: 50px;
    }
    
    /* Formulaire Stripe ajusté pour mobile */
    .stripe-payment-container {
        padding: 0.5rem;
    }
    
    .stripe-form {
        width: 95%;
        padding: 1.5rem;
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
    }
    
    /* Correction pour que les modals ne dépassent pas */
    .modal-content, 
    .stripe-form, 
    .delivery-content, 
    .profile-content {
        max-height: 85vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* Optimisations spécifiques pour les petits écrans */
@media (max-width: 360px) {
    .choices {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.3rem;
    }

    .choice {
        --choice-size: 50px;
        width: var(--choice-size);
        height: var(--choice-size);
        font-size: calc(var(--choice-size) * 0.4);
        padding: 0.4rem;
        max-width: 60px;
    }
    
    .final-result-banner {
        padding: 1rem;
    }
    
    .final-result-banner h1 {
        font-size: 1.5rem;
    }
    
    .result-icon {
        font-size: 2rem;
    }
}

/* Amélioration de l'affichage en orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding-bottom: 20vh;
    }
    
    .game-container {
        margin: 0.5rem auto;
        padding: 0.8rem;
    }
    
    .score-board {
        margin: 0.5rem 0;
    }
    
    .choices {
        margin: 0.5rem 0;
    }
    
    .final-result-banner {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ...existing code... */

/* ========= AMÉLIORATIONS MOBILE PROFESSIONNELLES ========= */
@media (max-width: 768px) {
    :root {
        --spacing-unit: 0.8rem;
    }

    /* Optimisations générales */
    body {
        -webkit-text-size-adjust: 100%;
        touch-action: manipulation;
        padding-bottom: 40vh;
        overflow-x: hidden;
        background: linear-gradient(145deg, #171f26 0%, #2c3e50 100%);
        background-attachment: fixed;
    }
    
    /* Container du jeu optimisé */
    .game-container {
        margin: 1rem auto;
        padding: 1.5rem;
        max-width: calc(100% - 2rem);
        border-radius: 16px;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    }
    
    /* Tableau des scores plus élégant */
    .score-board {
        gap: 1rem;
        padding: 1rem;
        background: rgba(0, 0, 0, 0.3);
        border-radius: 12px;
        backdrop-filter: blur(5px);
        border: 1px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    }
    
    .score {
        padding: 1rem;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
        transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    
    .score:active {
        transform: scale(0.98);
    }
    
    #player-score,
    #computer-score {
        font-size: 2.5rem;
        font-weight: 700;
        font-family: 'Arial', sans-serif;
        background: linear-gradient(to bottom, var(--gameboy-lightest), var(--gameboy-green));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        margin: 0.3rem 0;
    }
    
    /* Grille de choix améliorée */
    .choices {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0.8rem;
        padding: 0.5rem;
        margin: 1.5rem 0;
    }
    
    .choice {
        width: 100%;
        aspect-ratio: 1;
        max-width: none;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.08);
        border-radius: 16px;
        border: 2px solid rgba(255, 255, 255, 0.05);
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15),
                    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
        font-size: 2rem;
        transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                    background-color 0.15s ease,
                    box-shadow 0.15s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .choice:active:not(:disabled) {
        transform: scale(0.95);
        background: rgba(255, 255, 255, 0.12);
    }
    
    .choice.selected {
        background: rgba(139, 172, 15, 0.2);
        border: 2px solid var(--gameboy-green);
        box-shadow: 0 0 20px rgba(139, 172, 15, 0.3);
    }
    
    /* Résultats de match élégants */
    .final-result-banner {
        width: 90%;
        max-width: 90%;
        padding: 2rem;
        border-radius: 20px;
        background: rgba(0, 0, 0, 0.8);
        backdrop-filter: blur(15px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
    }
    
    .final-result-banner h1 {
        font-size: 2rem;
        margin-bottom: 1rem;
        font-family: 'Arial', sans-serif;
        font-weight: 800;
    }
    
    .result-icon {
        font-size: 3.5rem;
        margin: 1rem 0;
        filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
    }
    
    .final-result-message {
        font-size: 1.1rem;
        line-height: 1.5;
        margin: 1rem 0;
    }
    
    /* Bouton retour à l'accueil modernisé */
    #back-home {
        padding: 15px 30px;
        font-size: 1rem;
        font-weight: bold;
        text-transform: uppercase;
        letter-spacing: 1px;
        border-radius: 50px;
        background: linear-gradient(135deg, var(--gameboy-dark), var(--gameboy-darker));
        color: var(--gameboy-lightest);
        border: none;
        box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3),
                    inset 0 0 0 1px rgba(139, 172, 15, 0.5);
        transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        margin-top: 1.5rem;
        position: relative;
        overflow: hidden;
        transform: translateZ(0); /* Force hardware acceleration */
    }
    
    #back-home:active {
        transform: translateY(2px);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3),
                    inset 0 0 0 1px rgba(139, 172, 15, 0.5);
    }
    
    /* Formulaires optimisés */
    input, select, textarea, button {
        font-size: 16px !important;
        -webkit-appearance: none;
        appearance: none;
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(0, 0, 0, 0.2);
        color: white;
        padding: 0.8rem 1rem;
    }
    
    input:focus, select:focus, textarea:focus {
        outline: none;
        box-shadow: 0 0 0 2px var(--gameboy-green);
        border-color: transparent;
    }
    
    /* Stripe modal correction */
    .stripe-payment-container {
        padding: 1rem;
        align-items: center;
        background-color: rgba(0, 0, 0, 0.9) !important;
    }
    
    .stripe-form {
        width: 100% !important;
        max-width: 400px !important;
        padding: 1.5rem !important;
        border-radius: 16px !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5) !important;
    }

    /* Style d'animation pour l'interface */
    @keyframes shimmer {
        0% { background-position: -100% 0; }
        100% { background-position: 200% 0; }
    }
    
    .animate-shimmer {
        background: linear-gradient(
            90deg, 
            rgba(255, 255, 255, 0) 0%, 
            rgba(255, 255, 255, 0.08) 50%, 
            rgba(255, 255, 255, 0) 100%
        );
        background-size: 200% 100%;
        animation: shimmer 2s infinite;
    }
    
    /* Loader stylisé */
    .spinner {
        width: 40px;
        height: 40px;
        border: 3px solid rgba(139, 172, 15, 0.1);
        border-top: 3px solid var(--gameboy-green);
        border-radius: 50%;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
        margin: 1.5rem auto;
    }
}

/* Optimisations spécifiques pour les petits écrans */
@media (max-width: 360px) {
    .game-container {
        padding: 1rem;
        margin: 0.8rem auto;
    }
    
    .choices {
        gap: 0.5rem;
        margin: 1rem 0;
    }
    
    .score {
        padding: 0.8rem;
    }
    
    #player-score,
    #computer-score {
        font-size: 2.2rem;
    }
    
    .final-result-banner {
        padding: 1.5rem;
        width: 95%;
    }
}

/* Amélioration pour l'orientation paysage */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 0.5rem;
    }
    
    .game-container {
        display: grid;
        grid-template-columns: 30% 1fr;
        gap: 1rem;
        padding: 1rem;
        margin: 0.5rem auto;
        max-height: 90vh;
    }
    
    .score-board {
        grid-column: 1;
        display: flex;
        flex-direction: column;
        margin: 0;
    }
    
    .choices {
        grid-column: 2;
        margin: 0;
        align-self: center;
    }
    
    .final-result-banner {
        padding: 1.5rem;
        max-width: 400px;
    }
}

/* Animation des éléments de l'interface en entrée */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

/* ...existing code... */

/* ========= OPTIMISATION DE LA VISIBILITÉ SUR MOBILE ========= */
@media (max-width: 768px) {
    /* Ajustement du viewport et de la taille générale */
    body {
        /* Réduction du padding pour voir plus de contenu */
        padding: 0.5rem 0;
        padding-bottom: 30vh;
        /* Ajout d'un padding latéral pour meilleures marges */
        padding-left: env(safe-area-inset-left, 1rem);
        padding-right: env(safe-area-inset-right, 1rem);
        /* Empêcher les débordements */
        overflow-x: hidden;
        /* Fond plus neutre pour mettre le contenu en valeur */
        background: linear-gradient(145deg, #171f26 0%, #2c3e50 100%);
        background-attachment: fixed;
    }
    
    /* Conteneur de jeu avec meilleure visibilité des bords */
    .game-container {
        /* Réduire la largeur pour montrer les bords */
        width: 92%;
        max-width: 92%;
        /* Meilleures marges et padding pour respiration visuelle */
        margin: 1.5rem auto;
        padding: 1.2rem;
        /* Hauteur maximale pour éviter le débordement */
        max-height: 85vh;
        overflow-y: auto;
        /* Amélioration du style visuel */
        border-radius: 16px;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(10px);
        /* Bordure plus visible */
        border: 1px solid rgba(255, 255, 255, 0.15);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
        transform: scale(0.95); /* Légèrement reculé pour voir les bords */
    }
    
    /* Ajustement du header pour qu'il soit toujours visible */
    .game-header {
        position: sticky;
        top: 0;
        z-index: 5;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
        padding: 0.8rem;
        margin: -1.2rem -1.2rem 1rem -1.2rem;
        width: calc(100% + 2.4rem);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    /* Tableau des scores plus compact */
    .score-board {
        gap: 0.8rem;
        padding: 0.8rem;
        margin: 1rem 0;
    }
    
    /* Grille de choix plus accessible */
    .choices {
        gap: 1rem;
        padding: 0.8rem;
        margin: 1.2rem 0;
    }
    
    /* Boutons de choix avec meilleure taille */
    .choice {
        width: 85%;
        margin: 0 auto;
        aspect-ratio: 1;
        max-width: 100px;
        border-radius: 12px;
        /* Animation plus légère pour éviter les saccades */
        transition: transform 0.15s ease, background-color 0.15s ease;
    }
    
    /* Résultats mieux positionnés */
    .final-result-banner {
        transform: translate(-50%, -55%) scale(0.9);
        width: 85%;
        max-width: 400px;
        padding: 1.5rem;
        /* Ajout de safe-area pour les téléphones avec encoche */
        padding-top: max(1.5rem, env(safe-area-inset-top, 1.5rem));
        padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 1.5rem));
    }
    
    .final-result-banner.show {
        transform: translate(-50%, -55%) scale(0.95);
    }
    
    /* Amélioration de la lisibilité des scores */
    #player-score,
    #computer-score {
        font-size: 2.2rem;
        margin: 0.2rem 0;
        /* Texte plus lisible */
        background: linear-gradient(to bottom, var(--gameboy-lightest), var(--gameboy-green));
        -webkit-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7));
    }
}

/* Optimisations pour petits téléphones */
@media (max-width: 360px) {
    .game-container {
        width: 94%;
        transform: scale(0.9); /* Encore plus reculé pour les petits écrans */
        padding: 1rem;
        margin: 0.5rem auto;
    }
    
    .game-header {
        margin: -1rem -1rem 1rem -1rem;
        width: calc(100% + 2rem);
    }
    
    /* Scores plus petits mais lisibles */
    #player-score,
    #computer-score {
        font-size: 2rem;
    }
}

/* Optimisation pour l'orientation paysage sur mobile */
@media (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 0.5rem;
    }
    
    .game-container {
        transform: scale(0.9);
        width: 96%;
        display: grid;
        grid-template-columns: 30% 1fr;
        gap: 1rem;
        padding: 0.8rem;
        margin: 0.5rem auto;
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .game-header {
        grid-column: 1 / span 2;
        margin: -0.8rem -0.8rem 0.8rem -0.8rem;
        width: calc(100% + 1.6rem);
    }
    
    .score-board {
        grid-column: 1;
        display: flex;
        flex-direction: column;
        margin: 0;
    }
    
    .choices {
        grid-column: 2;
        margin: 0;
        align-self: center;
    }
}

/* ...existing code... */

/* Correction du formulaire de livraison pour mobile */
@media (max-width: 768px) {
    /* ...existing code... */
    
    /* Correction du modal de livraison pour qu'il soit scrollable */
    .delivery-modal {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.9);
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 10000;
        overflow-y: auto;
        padding: 1rem;
    }
    
    .delivery-content {
        position: relative;
        background: var(--gameboy-bg);
        padding: 1.5rem;
        border-radius: 10px;
        width: 90%;
        max-width: 500px;
        max-height: 85vh;
        overflow-y: auto;
        margin: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* S'assurer que le formulaire prend toute la hauteur disponible */
    #delivery-form {
        display: flex;
        flex-direction: column;
        max-height: 75vh;
        overflow-y: auto;
        padding-bottom: 1rem;
    }
    
    /* Rendre les boutons du formulaire toujours visibles */
    .form-buttons {
        position: sticky;
        bottom: 0;
        background: var(--gameboy-bg);
        padding-top: 1rem;
        margin-top: 1.5rem;
        z-index: 5;
        box-shadow: 0 -5px 10px rgba(0, 0, 0, 0.2);
    }
    
    /* Optimiser les inputs pour mobile */
    .delivery-content input {
        font-size: 16px !important;
        padding: 0.8rem;
        margin-bottom: 0.8rem;
        width: 100%;
        border: var(--pixel-size) solid var(--gameboy-dark);
        background: rgba(0, 0, 0, 0.2);
        color: var(--gameboy-green);
    }
    
    /* Espacer les champs du formulaire */
    .delivery-content .form-group {
        gap: 0.8rem;
        margin-bottom: 0.5rem;
    }
    
    /* Améliorer la lisibilité des étiquettes */
    .delivery-content label {
        display: block;
        margin-bottom: 0.3rem;
        color: var(--gameboy-lightest);
        font-weight: bold;
    }
    
    /* Ajustements du contenu du modal pour petit écran */
    .delivery-content h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        position: sticky;
        top: 0;
        background: var(--gameboy-bg);
        padding: 0.5rem 0;
        z-index: 5;
    }
}

/* Optimisations pour iPhone SE et autres petits écrans */
@media (max-width: 375px) and (max-height: 667px) {
    .delivery-content {
        padding: 1rem;
        width: 95%;
        max-height: 80vh;
    }
    
    .delivery-content h2 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
    
    .form-buttons button {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
    
    /* Réduire la taille du formulaire */
    #delivery-form {
        max-height: 70vh;
    }
}

/* Optimisations pour orientation paysage */
@media (max-height: 500px) and (orientation: landscape) {
    .delivery-modal {
        align-items: flex-start;
    }
    
    .delivery-content {
        margin: 1rem auto;
        max-height: 90vh;
    }
    
    #delivery-form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        max-height: 80vh;
    }
    
    /* Les boutons prennent toute la largeur */
    .form-buttons {
        grid-column: 1 / span 2;
    }
}
