body {
    font-family: Verdana, Arial, sans-serif;
    text-align: center;
    min-height: 100vh;
    margin: 0;
    background: radial-gradient(circle at top, #e3e8ff 0%, #c7d0ff 45%, #b8c2ff 100%);
}

.hideme {
    display: none !important;
}

.hide-pbk {
    display: none !important;
}

.binary {
    display: none;
}

.seeme {
    display: block;
}

#encode-img {
   padding-top: 80px;
}

#encode-img svg {
    pointer-events: none;
    display: block;
    margin: 0 auto;
    height: auto;
    width: 100%;
    max-width: 700px;
}

#encode-img svg .zone {
    pointer-events: all;
    cursor: pointer;
}

#image img {
    width: 700px;
}

.zone {
    /*fill: rgba(255, 0, 0, 0.25);*/
    /*stroke: red;*/
    stroke-width: 2;
    cursor: pointer;
    pointer-events: all;
}

.zone.active {
    fill: rgba(120, 140, 255, 0.3);
}

.zone:hover {
    fill: rgba(120, 140, 255, 0.3);
}

@media (min-width: 1101px) {
    #encode-img svg {
        max-width: 950px;
    }
}

@media (max-width: 1100px) {
    #image-mg {
        display: none;
    }
    #encode-img svg {
        max-width: 750px;
    }
}


@media (max-width: 800px) {
    #image img {
        width: 400px;
    }
    #encode-img svg {
        max-width: 600px;
    }
}

#text-header {
    margin-top: 10px;
    margin-bottom: 8px;
    filter: drop-shadow(2px 0 white) drop-shadow(-1px 0 white) drop-shadow(0 2px white)
        drop-shadow(0 -1px white);
}

#head {
    position: relative;
    margin: 5px -2px 0px 0px;
}

#head::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #144390;
    z-index: -1; /* reste derrière le contenu de la div */
    margin: -3px -2px -4px -2px;
}

.but,
textarea {
    border-radius: 5px;
}

.scripsit {
    background-image: url('scripsit.webp');
    background-size: 60px;
    background-position: right 0px center;
    background-repeat: no-repeat;
    padding-right: 65px; /* évite que le texte passe dessous */
}

.wheels {
    background-image: url('wheels.webp');
    background-size: 60px;
    background-position: right 0px center;
    background-repeat: no-repeat;
    padding-right: 65px; /* évite que le texte passe dessous */
    background-color: #fffed1;
}

textarea.no-decode {
    background-image: url('wheels-red.webp');
    background-size: 60px;
    background-position: right 0px center;
    background-repeat: no-repeat;
    padding-right: 65px; /* évite que le texte passe dessous */
    background-color: #fff5f5;
    color: red;
    border: 2px solid red;
}

.but {
    box-sizing: border-box;
    width: 200px;
    height: 32px;

    text-align: center;
    line-height: 0.3;
    white-space: nowrap;
    vertical-align: middle;
    font-size: 14px;       /* fixe la métrique */
    padding: 0;               /* important */
    border-color: #666;
    background-color: #fff;
}

.but:hover {
    cursor: pointer;
}

.but2 {
    width: 84%;
    padding: 10px 20px;
    border: 1px solid #fff;
    border-radius: 5px;
    color: white;
    background-color: #00f;
    margin-bottom: 15px;
}

.but2:hover {
    cursor: pointer;
    width: 84%;
    padding: 10px 20px;
    border: 1px solid #fff;
    color: #fff;
    background-color: #c00000;
}

.yellow {
    color: #ff0;
}

.blue {
    padding-top: 5px;
    color: #fff;
    font-size: 0.8rem;
}

.fichier {
    color: #ffe7e5;
}

textarea {
    overflow-y: hidden;
    resize: none;
    min-height: 2.5em;
    box-sizing: border-box;
    width: 70%;
    padding: 15px;
    border: 2px solid #00f;
    font-size: 1rem;
    color: #00f;
    background-color: #f7fbff;
}

.inp {
    margin: 20px;
}

#display1,
#display2,
body {
    color: #fff;
}

#menu button,
.max,
.maxUrl {
    border: 1px solid #fff;
    border-radius: 5px;
}

img {
    border-radius: 8px;
}

.max {
    font-size: small;
    color: #fff;
    background-color: red;
    display: inline-block;
    padding: 6px 12px;
}

.maxUrl {
    font-size: small;
    color: #fff;
    background-color: red;
    display: inline-block;
    padding: 6px 12px;
    position: relative;
    top: -32px;
}

.cadre,
.cadreHash,
.cadreUrl {
    margin: auto;
    width: 65%;
    border: 2px solid;
    border-color: #fff;
    border-radius: 10px;
    background-color: #6b84ff;
}

.cadreHashTextResult {
    width: 100%;
}

.algo p,
.seeme {
    display: block;
}

#menu {
    display: flex;
    position: relative;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background-color: #333;
    border-top: 1px solid white;
    border-bottom: 1px solid white;
}

#menu button {
    background-color: #555;
    color: #ff0;
    padding: 7px 12px;
    cursor: pointer;
}

#menu button:hover {
    background-color: #fff;
    color: #000;
    padding: 7px 12px;
    cursor: pointer;
}

#menu button.active {
    background-color: red;
    color: #fff;
    border: 1px solid #fff;
}

hr {
    border: 1px solid white;
}

a {
    text-decoration: none;
}

.blck {
    color: #000;
}

.brwn {
    color: brown;
}

.base64,
.hashs {
    margin: auto;
    width: 95%;
    background-color: #ff9;
    font-size: 0.8em;
}

a,
a:hover {
    color: red;
}

.algo {
    margin-top: 15px;
}

.modeSelect,
.modeSelect2,
.modeSelectHash,
.modeSelectb64File {
    color: #00f;
}

#image {
    margin-top: 50px;
}

.algo p {
    max-width: 100%;
    word-break: break-all;
    overflow-wrap: anywhere;
    font-family: monospace;
}

.error {
    color: #7eff70;
    font-style: italic;
    font-size: 1rem;
}

#hexaViewMode {
    color: #ff332f;
    margin: 15px;
    font-weight: 700;
}

#hashEncodeForm {
    margin-bottom: 8px;
}

#selectFile-b64,
#selectFile-b64-decode,
#selectFile-hash {
    padding: 8px;
}

#image-mg {
    width: 100px;
    position: absolute;
    left: 40px;
    top: 50%;
    transform: translateY(-50%);
}

#base64-txt {
    user-select: none;
}

#base64-txt:focus {
    user-select: text;
}

.warning-b64 {
    color: yellow;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

#copyB64Raw,
#button-for-blob {
    width: 340px;
    padding: 9px 12px;
    color: #fff;
    background-color: #000;
    border: 2px solid #fff;
    border-radius: 3px;
}

.between-hr {
    background-color: #3838ff;
    padding: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.between-hr p {
    margin: 0;
}

#calcEncode64,
#calcDecode64 {
    margin-top: 1px;
    margin-bottom: 9px;
}

.hash-table {
    width: 95%;
    max-width: 900px;     /* clé du centrage visible desktop */
    margin: 1rem auto;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.hash-table th,
.hash-table td {
    border: 1px solid #fff;
    padding: 0.4rem 0.6rem;
    vertical-align: middle;
}

.hash-table th {
    text-align: center;
    background-color: rgba(0, 0, 255, 0.4);
    width: 25%;
}

.hash-table td {
    word-break: break-all;
    text-align: left;
}

.pbkdf2-iters {
    width: 60%;
    margin: 1rem auto; /* centre horizontalement */
    border: 1px solid yellow;
    padding-bottom: 10px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.2); /* obscurcissement */
}

.pbkdf2-controls {
    margin-top: 15px;
}

.pbkdf2-table {
    width: 93%;
    margin: 20px auto 0;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.pbkdf2-table th,
.pbkdf2-table td {
    border: 1px solid #fff;
    padding: 0.4rem 0.6rem;
    vertical-align: top;
}

.pbkdf2-table th {
    text-align: center; /* centrage horizontal */
    vertical-align: middle; /* centrage vertical */
    background-color: rgba(0, 0, 255, 0.4);
    width: 30%;
}

.pbkdf2-table td {
    word-break: break-all; /* indispensable pour le hash */
    text-align: left;
}

#pbkdf2-salt {
    padding: 8px;
    margin-top: 2px;
    border: 1px solid white;
    border-radius: 5px;
    width: 310px;
}

#salt {
    background-color: yellow;
    color: red;
    padding: 8px;
    border-radius: 5px;
    width: 380px;
    margin: 0 auto;
    font-size: 0.9rem;
}

#pbkdf2-calc {
    margin-bottom: 20px;

}

.pbk {
    width: 93%;
    border: 1px solid white;
    border-radius: 5px;
    margin: 0 auto;
    padding: 20px 0;
    background-color: #4d6aff;
}

.pbkdf2-table {
    min-width: 650px;
    margin: 1rem 8px 1rem 8px;
}

#hash-table-text {
    /*margin: 10px 0; */
    margin: 10px 4px 10px 0px;
}

#see-pbkdf2 {
    margin: 0px auto 20px auto;
    padding: 8px 4px;
    width: 350px;
    background-color: black;
    color: white;
    border: 1px solid black;
    border-radius: 5px;
    font-size: 0.9rem;
    user-select: none;
}

#see-pbkdf2:hover {
    cursor: pointer;
    margin: 0px auto 20px auto;
    padding: 8px 4px;
    width: 350px;
    background-color: #c00000;
    color: white;
    border: 1px solid white;
    border-radius: 5px;
    font-size: 0.9rem;
    user-select: none;
}

.no-transition textarea {
    transition: none !important;
}

.table-scroll-hint {
    position: relative;
    width: 100%;
    margin: 0 auto;
}

.table-wrapper {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-wrapper table {
    min-width: 650px;
    border-collapse: collapse;
}

.scroll-hint {
    display: none;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 6px;
    user-select: none;
}

/* uniquement quand pas de scroll nécessaire */
@media (min-width: 481px) {
    .table-wrapper {
        text-align: center;
    }

    .table-wrapper table {
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 480px) {
    .scroll-hint {
        display: block;
    }
}


/* ==========================================================
   MOBILE 375px-like
   ========================================================== */
@media (max-width: 420px) {

    body {
        font-size: 14px;
    }

    #menu {
        margin-top: 15px;     /* espace sous l’image de titre */
        padding-top: 10px;    /* respiration interne */
    }

    .binary {
        display: block;
        border-radius: 3px;
        margin: 14px auto 0 auto;
        width: 98%;
    }

    /* ===== HEADER ===== */
    #text-header {
        width: 90%;
        max-width: 320px;
        height: auto;
    }

    #head {
        margin: 8px;
    }

    /* ===== MENU ===== */
    #menu {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }

    #menu button {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px;
        margin: 4px 0;
    }

    #menu button:hover {
        width: 100%;
        font-size: 0.9rem;
        padding: 10px;
    }

    #image-mg {
        display: none;
    }

    /* ===== SVG / IMAGE ACCUEIL ===== */
    #encode-img {
        padding-top: 30px;
    }

    #encode-img svg {
        max-width: 100%;
    }

    /* ===== CADRES ===== */
    .cadre,
    .cadreHash,
    .cadreUrl {
        width: 95%;
        padding: 10px;
    }

    /* ===== TEXTAREAS ===== */
    textarea {
        width: 95%;
        font-size: 0.9rem;
        padding: 10px;
        padding-right: 55px;
        background-size: 40px;
    }

    /* ===== BOUTONS ===== */
    .but,
    .but2,
    .but2:hover,
    #copyB64Raw,
    #button-for-blob,
    #see-pbkdf2,
    #see-pbkdf2:hover {
        width: 90%;
        font-size: 0.9rem;
        padding: 10px;
    }

    .inp {
        margin: 10px 0;
    }

    .pbk {
        width: 97%;
    }

    /* ===== HASH TABLES ===== */

    .hash-table,
    .pbkdf2-table {
        min-width: 600px; /* force le scroll */
        font-size: 0.75rem;
        border-collapse: collapse;
    }

    .hash-table th,
    .hash-table td,
    .pbkdf2-table th,
    .pbkdf2-table td {
        white-space: nowrap;
        margin: 1rem auto 1rem 5px;
    }

    /* ===== PBKDF2 ===== */
    #pbkdf2-salt,
    #salt {
        width: 88%;
        font-size: 0.85rem;
    }

    .pbkdf2-iters {
        width: 70%;
        margin: 1rem auto;
        font-size: 0.75rem;
    }

    /* ===== BASE64 FILE ===== */
    #base64-txt {
        width: 95%;
        font-size: 0.75rem;
    }

    .between-hr {
        white-space: normal;
        text-overflow: unset;
    }

    /* ===== MAX SIGNATURE ===== */
    .max,
    .maxUrl {
        font-size: 0.7rem;
        padding: 4px 8px;
    }

 /* cacher l’écran SVG d’accueil */
    #svg-div,
    #encode-img {
        display: none !important;
    }

    /* afficher le menu directement */
    #menu {
        display: flex !important;
    }

    /* Radios : une option par ligne */
    label {
        display: block;
        margin-bottom: 6px;
    }

    label input[type="radio"] {
        margin-right: 6px;
    }

    #see-pbkdf2,
    #see-pbkdf2:hover {
        width: 90%;
        max-width: 100%;
        font-size: 0.85rem;
        padding: 10px 8px;
    }
  .between-hr {
        white-space: normal;      /* autorise les retours à la ligne */
        overflow-wrap: anywhere;  /* casse les chaînes longues */
        word-break: break-word;
        text-overflow: unset;
    }

    #hexaViewMode {
    text-align: left;
}
}
