body {
        font-family: "Trebuchet MS", sans-serif;
        margin: 0;
        padding: 0;
        background: #0f0f0f;
        color: #fff;
    }

    h1 {
        text-align: center;
        padding: 25px 0;
        font-size: 2.6em;
        font-weight: bold;
        text-transform: uppercase;
        color: #fff;
        background: linear-gradient(90deg, #8b0000, #b30000, #8b0000);
        border-bottom: 4px solid #d4af37;
        letter-spacing: 2px;
        text-shadow: 3px 3px 6px rgba(0,0,0,0.6);
        margin-top: 0px;
    }

    h2 {
        margin-top: 45px;
        margin-bottom: 15px;
        font-size: 1.6em;
        text-transform: uppercase;
        font-weight: bold;
        color: #d4af37;
        border-left: 8px solid #b30000;
        padding-left: 12px;
        text-shadow: 2px 2px 3px rgba(0,0,0,0.9);
    }

    .anime-picker {
        width: 90%;
        max-width: 900px;
        margin: 30px auto;
    }

    .anime-mode-switch {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 20px;
    }

    .anime-mode-switch input {
        width: 20px;
        height: 20px;
        accent-color: #d4af37;
        cursor: pointer;
    }

    .anime-mode-switch label {
        font-weight: bold;
        cursor: pointer;
    }

    .anime-picker > label {
        display: block;
        margin-bottom: 10px;
        font-weight: bold;
    }

    #anime-search {
        box-sizing: border-box;
        width: 100%;
        padding: 12px 14px;
        border: 2px solid #d4af37;
        border-radius: 8px;
        background: #1b1b1b;
        color: #fff;
        font: inherit;
    }

    #anime-search:focus {
        outline: 2px solid #ffdf4f;
        outline-offset: 2px;
    }

    #anime-search-help {
        max-width: none;
        margin: 8px 0 14px;
        color: #ccc;
        text-align: left;
    }

    #anime-search-results {
        display: grid;
        gap: 8px;
        max-height: 420px;
        overflow-y: auto;
    }

    .anime-search-result {
        display: flex;
        align-items: center;
        width: 100%;
        margin: 0;
        padding: 8px 12px;
        border: 1px solid #d4af37;
        border-radius: 8px;
        background: rgba(255,255,255,0.05);
        color: #fff;
        font: inherit;
        letter-spacing: normal;
        text-align: left;
        text-transform: none;
        cursor: pointer;
        transition: box-shadow 0.2s ease, background 0.2s ease;
    }

    .anime-search-result:hover,
    .anime-search-result:focus-visible {
        z-index: 1;
        margin: 0;
        transform: none;
        background: rgba(255, 215, 0, 0.15);
        outline: 2px solid #ffdf4f;
        box-shadow: 0 6px 15px rgba(0,0,0,0.8);
    }

    .anime-search-result img {
        width: 48px;
        height: 64px;
        flex: 0 0 auto;
        object-fit: cover;
        border-radius: 4px;
    }

    #anime-browse-help {
        max-width: none;
        margin: 8px 0 14px;
        color: #ccc;
        text-align: left;
    }

    #anime-browse-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
        padding: 8px 4px;
    }

    .anime-browse-card {
        display: flex;
        flex-direction: column;
        gap: 10px;
        box-sizing: border-box;
        min-width: 0;
        padding: 8px 10px;
        border: none;
        border-radius: 10px;
        overflow: hidden;
        background: rgba(255,255,255,0.05);
        text-align: center;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0,0,0,0.6);
        transition: background 0.2s ease, box-shadow 0.2s ease;
    }

    .anime-browse-card:hover {
        background: rgba(255,255,255,0.1);
        box-shadow: 0 6px 15px rgba(0,0,0,0.8);
    }

    .anime-browse-card.selected {
        background: rgba(255, 215, 0, 0.15);
        box-shadow: 0 6px 18px rgba(255, 215, 0, 0.3);
    }

    .anime-browse-card > img {
        display: block;
        width: 100%;
        min-width: 0;
        height: 200px;
        object-fit: cover;
        border-radius: 6px;
    }

    .anime-browse-name {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        min-width: 0;
        min-height: 40px;
        text-align: left;
    }

    .anime-browse-name input {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
        accent-color: #d4af37;
    }

    .anime-browse-name span {
        flex: 1 1 0;
        min-width: 0;
        overflow-wrap: anywhere;
        font-weight: bold;
    }

    .selected-anime img {
        width: 100%;
        height: 220px;
        object-fit: cover;
        border-radius: 4px;
    }

    .anime-search-result span {
        margin-left: 12px;
        font-weight: bold;
    }

    #selected-animes {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }

    #selected-animes > p {
        grid-column: 1 / -1;
        max-width: none;
        margin: 0;
        text-align: left;
    }

    .selected-anime {
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-width: 0;
        padding: 8px 12px;
        border: 2px solid #d4af37;
        border-radius: 8px;
        background: rgba(255, 215, 0, 0.1);
        cursor: pointer;
    }

    .selected-anime-name {
        display: flex;
        align-items: flex-start;
        gap: 8px;
        min-height: 40px;
    }

    .selected-anime input[type="checkbox"] {
        width: 20px;
        height: 20px;
        flex: 0 0 auto;
        accent-color: #d4af37;
    }

    .selected-anime span {
        flex: 1 1 0;
        min-width: 0;
        overflow-wrap: anywhere;
        font-weight: bold;
    }

    button {
        display: block;
        margin: 40px auto 60px auto;
        padding: 14px 45px;
        font-size: 1.5em;
        font-weight: bold;
        color: #000;
        background: linear-gradient(45deg, #d4af37, #f5e29e, #d4af37);
        border: none;
        border-radius: 35px;
        cursor: pointer;
        box-shadow: 0 5px 15px rgba(0,0,0,0.7);
        transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s;
        text-transform: uppercase;
        letter-spacing: 2px;
    }

    button:hover {
        transform: scale(1.09);
        box-shadow: 0 7px 20px rgba(0,0,0,0.9);
        filter: brightness(1.2);
    }

    @media (max-width: 500px) {
        .anime-picker {
            width: 92%;
        }

        #anime-browse-list {
            grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
            gap: 10px;
        }

        .anime-browse-card > img {
            height: 170px;
        }
    }

    #user-name{
        padding: 10px;
        font-size: 1em;
        border-radius: 5px;
        border: 2px solid #d4af37;
        width: 250px;
        max-width: 90%;
        text-align: center;
    }

    p{
        max-width: 60%;
        margin: auto;
        text-align: justify;
    }

    #categories {
        width: 90%;
        max-width: 900px;
        margin: 30px auto;
        padding-bottom: 40px;
    }

    .vote-card {
        margin-bottom: 14px;
        padding: 12px;
        border-radius: 10px;
        background: rgba(255,255,255,0.04);
        border: 2px solid #d4af37;
        box-shadow: 0 4px 12px rgba(0,0,0,0.6);
        transition: transform 0.2s ease;
    }

    .vote-card:hover {
        transform: scale(1.02);
    }

    .vote-card strong {
        font-size: 1.15em;
        display: block;
        margin-bottom: 10px;
        text-shadow: 2px 2px 3px rgba(0,0,0,0.8);
    }

    .category-subtitle {
        max-width: none;
        margin: -5px 0 16px 20px;
        color: #ccc;
        text-align: left;
    }

    #voter-name{
        text-align:center;
        font-size:1.3em;
        font-weight:bold;
        margin-bottom:20px;
        color:#d4af37;
    }

    .choices label {
        margin-right: 10px;
        font-weight: bold;
        cursor: pointer;
        background: #8b0000;
        color: #fff;
        padding: 6px 12px;
        border-radius: 6px;
        border: 2px solid #d4af37;
        transition: background 0.2s, transform 0.2s;
        font-size: 0.9em;
        display: inline-block;
        margin-bottom: 6px;
    }

    .choices label:hover {
        background: #b30000;
        transform: scale(1.06);
    }

    input[type="radio"] { display: none; }

    input[type="radio"]:checked + label {
        background: #d4af37;
        color: #000;
        font-weight: bold;
    }

    .suggestion {
        width: 100%;
        margin-top: 10px;
        resize: vertical;
        min-height: 45px;
        max-height: 120px;
        padding: 10px;
        border-radius: 5px;
        border: 2px solid #d4af37;
        background: #1a1a1a;
        color: #fff;
        font-size: 0.95em;
    }

    .suggestion::placeholder {
        color: #cfcfcf;
    }
    
    @media (max-width: 550px) {
        .choices label {
            display: block;
            width: fit-content;
            margin-bottom: 6px;
        }

        h1 { font-size: 1.8em; }
        h2 { font-size: 1.3em; }
    }

    /* Grille à 2 colonnes : les cartes d'une même ligne ont la même hauteur. */
    .vote-cards {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
        margin-bottom: 12px;
    }

    /* Chaque carte partage 3 rangées avec sa voisine (titre, boutons, champ de
       précision) : les boutons sont alignés sous le titre le plus long, et le
       champ de précision s'ouvre en dessous sans les déplacer. */
    .category-wrapper .vote-card {
        box-sizing: border-box;
        display: grid;
        grid-row: span 3;
        grid-template-rows: subgrid;
        row-gap: 0;
        min-width: 0;
        margin: 0;
    }

    .category-wrapper .vote-card .choices {
        align-self: end;
    }

    .vote-detail {
        margin-top: 10px;
    }

    /* Lien vers la vidéo d'un opening / ending */
    /* L'attribut hidden doit l'emporter sur les display définis plus haut (button...). */
    [hidden] {
        display: none !important;
    }

    /* Saisie du pseudo (1re page) : carte centrée */
    .profile-form {
        box-sizing: border-box;
        width: 90%;
        max-width: 520px;
        margin: 30px auto 10px;
        padding: 22px 26px 18px;
        border: 2px solid #d4af37;
        border-radius: 12px;
        background: rgba(255,255,255,0.05);
        box-shadow: 0 4px 16px rgba(0,0,0,0.6);
        text-align: center;
    }

    .profile-form > label {
        display: block;
        margin-bottom: 4px;
        color: #d4af37;
        font-size: 1.15em;
        font-weight: bold;
    }

    .profile-form-hint {
        max-width: none;
        margin: 0 0 16px;
        color: #ccc;
        font-size: 0.9em;
        text-align: center;
    }

    .profile-form-row {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        justify-content: center;
        align-items: stretch;
    }

    .profile-form #user-name {
        box-sizing: border-box;
        flex: 1 1 200px;
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 10px 14px;
        border: 2px solid #d4af37;
        border-radius: 8px;
        background: #1b1b1b;
        color: #fff;
        font: inherit;
        text-align: left;
    }

    .profile-form #user-name:focus {
        outline: 2px solid #ffdf4f;
        outline-offset: 2px;
    }

    .profile-form button {
        flex: 0 0 auto;
        margin: 0;
        padding: 10px 24px;
        border-radius: 8px;
        font-size: 1em;
        letter-spacing: 1px;
    }

    .profile-form button:hover {
        transform: scale(1.04);
    }

    #profile-status {
        max-width: none;
        margin: 14px 0 0;
        color: #f5e29e;
        font-size: 0.95em;
        text-align: center;
    }

    #profile-status:empty {
        display: none;
    }

    .back-link {
        color: #d4af37;
        font-size: 0.9em;
    }

    /* Case "Pas vu" (openings / endings) : grise la carte et bloque les boutons. */
    .not-seen {
        display: flex;
        align-items: center;
        gap: 6px;
        width: fit-content;
        margin-top: 8px;
        color: #ccc;
        font-size: 0.85em;
        cursor: pointer;
    }

    .not-seen input {
        width: 16px;
        height: 16px;
        margin: 0;
        accent-color: #d4af37;
        cursor: pointer;
    }

    .vote-card.not-seen-card {
        border-color: #555;
        background: rgba(255,255,255,0.02);
        box-shadow: none;
    }

    .vote-card.not-seen-card strong {
        color: #777;
    }

    .vote-card.not-seen-card .choices {
        opacity: 0.3;
        filter: grayscale(1);
        pointer-events: none;
    }

    /* Bouton play doré, en haut à droite de la carte. */
    .category-wrapper .vote-card {
        position: relative;
    }

    .vote-card strong:has(.theme-link) {
        padding-right: 40px;
    }

    .theme-link {
        position: absolute;
        top: 8px;
        right: 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 30px;
        height: 30px;
        padding-left: 2px;
        box-sizing: border-box;
        border-radius: 50%;
        background: linear-gradient(45deg, #d4af37, #f5e29e, #d4af37);
        color: #000;
        font-size: 13px;
        line-height: 1;
        text-decoration: none;
        text-shadow: none;
        box-shadow: 0 2px 6px rgba(0,0,0,0.7);
        transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
    }

    .theme-link:hover,
    .theme-link:focus-visible {
        transform: scale(1.15);
        filter: brightness(1.15);
        box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
    }

    .vote-detail label {
        display: block;
        margin-bottom: 6px;
        color: #ccc;
        font-size: 0.9em;
    }

    .detail-field {
        box-sizing: border-box;
        display: block;
        width: 100%;
        min-height: 45px;
        max-height: 120px;
        padding: 10px;
        resize: vertical;
        border: 2px solid #d4af37;
        border-radius: 5px;
        background: #1a1a1a;
        color: #fff;
        font: inherit;
        font-size: 0.95em;
    }

    .vote-intro {
        margin-bottom: 20px;
        text-align: center;
    }
