:root {
    --blanc: #ffffff;
    --noir: #000000;
    --fushia15: #FF00CC;
    --fushia25: #D70077;
    --fushia35: #780041;
    --fushia45: #4D002B;
    --fushia55: #200011;
}

/* Base styles */
body {
    background: var(--noir);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    width: 100vw;
    overflow-x: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: Arial, sans-serif;
    color: var(--blanc);
}

.language-select {
    background: var(--noir);
    color: var(--fushia15);
    padding: 4px 20px;
    border: 2px solid var(--fushia45);
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    min-width: auto;
    transition: all 0.3s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    text-align: center;
}

.language-select::-ms-expand {
    display: none;
}

.language-select:hover {
    background: var(--fushia45);
    color: var(--blanc);
}

/* Choices container */
.choices-container {
    background: var(--fushia55);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
}

/* Categories Selection */
.categories-selection {
    margin-bottom: 30px;
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
}

.category-btn {
    background: var(--noir);
    color: var(--fushia15);
    border: 2px solid var(--fushia45);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s;
    min-width: 120px;
}

.category-btn:hover {
    background: var(--fushia45);
    color: var(--blanc);
}

.category-btn.active {
    background: var(--fushia15);
    color: var(--noir);
    border-color: var(--fushia25);
}

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

/* Game View */
.machine {
    background: var(--fushia55);
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Wheels */
.wheels-container {
    display: flex;
    flex-direction: row;
    justify-content: stretch;
    gap: 20px;
    padding: 20px;
    background: var(--noir);
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

.wheel-column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.wheel-viewport {
    width: 100%;
    height: 150px;
    position: relative;
    perspective: 1500px;
    background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.2), rgba(0,0,0,0.8));
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--fushia35);
}

.wheel {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.item {
    position: absolute;
    width: 100%;
    height: 83px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    font-size: 16px;
    backface-visibility: hidden;
    color: var(--blanc);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    text-align: center;
    border-top: 1px solid var(--fushia45);
    left: 50%;
    top: 50%;
    transform-origin: center center;
    padding: 0 15px;
    box-sizing: border-box;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.wheel-column.films-category {
    flex: 1.5;
}

.films-category .item {
    font-size: 14px;
}

.category-label {
    font-size: 18px;
    color: var(--fushia15);
    text-transform: uppercase;
    text-align: center;
}

.selected-item {
    width: 100%;
    min-height: 42px;
    padding: 5px 15px;
    background: var(--fushia45);
    border-radius: 5px;
    color: var(--blanc);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: 14px;
    box-sizing: border-box;
}

/* Controls */
.choices-controls,
.spin-control,
.bottom-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    width: 100%;
    margin-bottom: 16px;
}

button {
    padding: 10px 20px;
    font-size: 16px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--fushia15);
    color: var(--noir);
    border: 2px solid var(--fushia25);
    min-width: 120px;
}

button:hover {
    background: var(--blanc);
    color: var(--fushia35);
}

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

.refresh-btn,
.view-btn,
.back-btn {
    background: var(--noir);
    color: var(--fushia15);
    border: 2px solid var(--fushia45);
    font-size: 14px;
}

.refresh-btn:hover,
.view-btn:hover,
.back-btn:hover {
    background: var(--fushia45);
    color: var(--blanc);
}

/* Tables */
.choices-table,
.items-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 30px;
    background: var(--noir);
    border-radius: 10px;
    overflow: hidden;
}

.choices-table th,
.choices-table td,
.items-table th,
.items-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--fushia45);
}

.choices-table th,
.items-table th {
    background: var(--fushia45);
    color: var(--blanc);
    font-size: 16px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal {
    background: var(--fushia55);
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
}

.modal-close {
    float: right;
    background: none;
    border: none;
    color: var(--blanc);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    min-width: auto;
}

.modal-close:hover {
    color: var(--fushia15);
    background: none;
}

/* Media Queries */
@media (max-width: 768px) {
    .wheels-container {
        flex-direction: column;
        gap: 30px;
    }

    .wheel-column,
    .wheel-column.films-category {
        width: 100%;
        flex: 1;
    }

    .category-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        width: 100%;
    }

    .category-btn {
        width: 100%;
        padding: 10px;
        min-width: unset;
    }

    /* Le bouton Films prend toute la largeur */
    .category-btn[data-category="Films"] {
        grid-column: 1 / -1;
    }

    .choices-controls,
    .bottom-controls {
        flex-direction: column;
        width: 100%;
        gap: 15px;
    }

    .choices-controls button,
    .bottom-controls button {
        width: 100%;
        padding: 15px;
    }

    body {
        padding-top: 64px;
    }

    .language-controls {
        top: 74px;
        width: 100%;
        padding: 10px;
        background: var(--noir);
        box-sizing: border-box;
        display: flex;
        justify-content: center;
    }

    .language-select {
        font-size: 14px;
    }

    .choices-container,
    .machine {
        width: 100vw; /* Utilise la largeur de la fenêtre */
        max-width: 100%; /* S'assure de ne pas dépasser */
        border-radius: 0;
        padding: 20px;
        box-sizing: border-box; /* Inclut padding dans la largeur */
    }

    /* Styles existants pour le modal */
    .modal {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .modal-close {
        position: fixed;
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 480px) {
    /* Styles existants */
    .wheel-viewport {
        height: 120px;
    }

    .item {
        font-size: 14px;
    }

    /* Ajustements supplémentaires */
    .choices-container,
    .machine {
        padding: 15px;
    }

    .wheels-container {
        padding: 10px;
    }
}

/* Styles pour le mode portrait */
@media (max-width: 768px) and (orientation: portrait) {
    body {
        display: block;
    }

    .wheels-container {
        padding: 10px;
    }

    .wheel-viewport {
        height: 100px;
    }
}