/* --- Style Général --- */
body {
    background-color: #0c0a1a;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 1s ease-in-out;
    color: #e0e0e0;
    font-family: sans-serif;
    margin: 0;
}

#overlay {
    background-color: rgba(0, 0, 0, 0.5);
    width: 100%;
    min-height: 100vh; /* Garantit que l'overlay prend au moins toute la hauteur de l'écran */
    display: flex; /* On reste en flexbox, c'est parfait */
    align-items: center; /* Pour le centrage horizontal du contenu */
    justify-content: flex-start; /* IMPORTANT : On ancre toujours le contenu en haut */
    flex-direction: column; /* On s'assure que les enfants s'empilent verticalement */
    padding: 5vh 0; /* On ajoute un "air" en haut et en bas */
    box-sizing: border-box; /* Pour que le padding n'augmente pas la taille totale */
    overflow-y: auto; /* Permet le scroll si le contenu dépasse */
}

#creator-container {
    width: 90%;
    max-width: 1200px;
    text-align: center;
    /* On retire la marge verticale automatique pour laisser l'overlay gérer */
}
.narrator {
    font-size: 1.8em;
    font-style: italic;
    min-height: 1.5em;
    margin: 10px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}
.input-group {
    margin-top: 20px;
}
.input-group input, .input-group button, .input-group select {
    padding: 10px;
    font-size: 1em;
    border-radius: 5px;
    border: 1px solid #555;
    margin: 5px;
}
#submit-age, #regenerate-name {
    cursor: pointer;
    border: none;
    background-color: #4a90e2;
    color: white;
    padding: 10px 15px;
}
.hidden {
    display: none !important;
}
.creator-step {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: none;
}
.creator-step.active {
    opacity: 1;
    display: block;
}

.career-period {
    display: none; /* Toutes les périodes sont cachées par défaut */
}

.career-period.active {
    display: block; /* Seule la période active s'affiche */
}



.regions-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 15px;
}
#main-regions { grid-template-columns: repeat(6, 1fr); }
#other-regions { grid-template-columns: repeat(7, 1fr); }
.region-btn {
    border: 2px solid #555;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    background-size: cover;
    background-position: center;
    min-height: 110px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    text-shadow: 2px 2px 4px #000;
    padding: 4px;
}
.region-btn h3 {
    margin: 0;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 3px;
    text-align: center;
    font-size: 0.8em;
    width: 100%;
}
.region-btn:hover { border-color: #8ec3ff; }
.region-btn.selected {
    border-color: #4a90e2;
    transform: scale(1.05);
    box-shadow: 0 0 15px #4a90e2;
}
#region-description-panel {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
    min-height: 9em;
    max-height: 9em;
    overflow-y: auto;
}
#region-description-panel h2 {
    margin-top: 0;
    font-size: 1.2em;
    color: #8ec3ff;
}
.inline-narrator-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}
.inline-narrator-group .narrator { margin: 0; min-height: 0; }
#hero-appearance, #hero-name {
    font-size: 1em;
    background-color: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border: 1px solid #888;
    border-radius: 5px;
    padding: 8px 12px;
}
#hero-name::placeholder { color: #aaa; font-style: italic; }
.period-title {
    font-size: 1.5em;
    color: #8ec3ff;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
    margin-bottom: 15px;
}
.career-description-panel {
    background-color: rgba(0, 0, 0, 0.7);
    padding: 20px;
    border-radius: 5px;
    margin: 20px auto;
    width: 90%;
    min-height: 5em;
    text-align: left;
    font-style: italic;
    border: 1px solid #444;
}
.career-bonus-display {
    color: #8ec3ff;
    font-weight: bold;
    font-size: 1.1em;
    align-self: center;
}
.form-group {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
#hero-morphologie {
    font-size: 1em;
    background-color: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border: 1px solid #888;
    border-radius: 5px;
    padding: 8px 12px;
    cursor: pointer;
}
#hero-description {
    font-size: 1em;
    background-color: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border: 1px solid #888;
    border-radius: 5px;
    padding: 8px 12px;
    width: 50%;
    resize: vertical;
}
#traits-container {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    width: 80%;
    margin: 0 auto;
}
.traits-group { flex: 1; text-align: left; }
.traits-group h4 {
    text-align: center;
    font-size: 1.2em;
    color: #8ec3ff;
    margin-bottom: 10px;
}
.trait-input-positif, .trait-input-negatif {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 10px;
    background-color: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border: 1px solid #888;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 1em;
}
.suggestions-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #444;
}
.trait-suggestion {
    background-color: #3a3f4c;
    color: #e0e0e0;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9em;
    cursor: pointer;
    transition: background-color 0.2s;
}
.trait-suggestion:hover { background-color: #4a90e2; }
.trait-suggestion.used {
    background-color: #282c34;
    color: #6c757d;
    cursor: not-allowed;
    text-decoration: line-through;
}
#step-meridiens {
    max-width: 1000px;
    margin: 0 auto;
    background-color: rgba(10, 10, 20, 0.7);
    padding: 20px;
    border-radius: 10px;
}
#main-stats-grid {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    margin-bottom: 30px;
}
.stat-column {
    flex: 1;
    background-color: rgba(20, 20, 30, 0.5);
    border-radius: 8px;
    padding: 15px;
}
.stat-column.internal { border: 1px solid #4a90e2; }
.stat-column.external { border: 1px solid #d06767; }
.vrill-gauge-header { text-align: center; margin-bottom: 20px; }
.vrill-gauge-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.2em;
    letter-spacing: 1px;
    text-transform: uppercase;
}
.internal .vrill-gauge-header h3 { color: #8ec3ff; }
.external .vrill-gauge-header h3 { color: #f09a9a; }
.vrill-gauge {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-size: 1.8em;
    font-weight: bold;
}
.vrill-value {
    background-color: rgba(0,0,0,0.5);
    padding: 5px 15px;
    border-radius: 5px;
    min-width: 50px;
    text-align: center;
}
.internal .vrill-value { border: 1px solid #4a90e2; color: #8ec3ff; }
.external .vrill-value { border: 1px solid #d06767; color: #f09a9a; }
.meridiens-list { display: flex; flex-direction: column; gap: 15px; }
.meridien-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.4);
    padding: 10px;
    border-radius: 5px;
}
.meridien-item h4 { margin: 0; font-size: 1.1em; flex-grow: 1; }
.points-control { display: flex; align-items: center; gap: 10px; }
.points-control .score { font-size: 1.5em; font-weight: bold; min-width: 30px; text-align: center; }
.internal .score { color: #8ec3ff; }
.external .score { color: #f09a9a; }
.points-control button {
    background: #333;
    color: white;
    border: 1px solid #555;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background-color 0.2s, border-color 0.2s;
}
.points-control button:hover { background-color: #444; border-color: #777; }
#details-section { display: flex; justify-content: center; gap: 20px; margin-bottom: 30px; }
.detail-panel {
    background-color: rgba(20, 20, 30, 0.5);
    border: 1px solid #555;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.detail-panel h4 { margin: 0 0 10px 0; color: #e0e0e0; }
#points-reserve { font-size: 2em; font-weight: bold; margin: 0; color: #aaffee; }
#vrill-arts-narrator { font-style: italic; color: #aaffee; font-size: 1.1em; }
#vrill-arts-list { display: flex; gap: 15px; justify-content: center; margin-top: 10px; }
.vrill-art-item { font-size: 1em; }
#aptitudes-section {
    background-color: rgba(10, 10, 20, 0.5);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}
#aptitudes-section .narrator { font-size: 1.2em; }
.aptitude-points-counter {
    text-align: center;
    font-size: 1.1em;
    margin-bottom: 20px;
    color: #aaffee;
}
#aptitudes-layout { display: flex; gap: 20px; align-items: flex-start; }
#meridian-aptitudes-column { flex: 3; display: flex; flex-direction: column; gap: 15px; }
#arcane-aptitudes-column { flex: 1; }
.aptitude-row { display: flex; justify-content: center; gap: 15px; }
.aptitude-group {
    background-color: rgba(20, 20, 30, 0.8);
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #333;
    flex: 1;
}
#arcane-aptitudes-column .aptitude-group { width: 100%; }
.aptitude-group h5 {
    margin: 0 0 10px 0;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}
.internal .aptitude-group h5 { color: #8ec3ff; }
.external .aptitude-group h5 { color: #f09a9a; }
.aptitude-group.arcane h5 { color: #aaffee; }
.aptitude-item { display: flex; justify-content: space-between; align-items: center; margin-bottom: 5px; }
.aptitude-item label { font-size: 0.9em; }
.objectives-container {
    display: flex;
    justify-content: space-around;
    gap: 30px;
    width: 80%;
    margin: 40px auto 0 auto;
}
.objective-group { flex: 1; display: flex; flex-direction: column; text-align: left; }
.objective-group label {
    font-size: 1.2em;
    color: #8ec3ff;
    margin-bottom: 10px;
    text-align: center;
}
.objective-group textarea {
    font-size: 1em;
    background-color: rgba(0, 0, 0, 0.5);
    color: #e0e0e0;
    border: 1px solid #888;
    border-radius: 5px;
    padding: 12px;
    resize: vertical;
    min-height: 100px;
    font-family: sans-serif;
}
.objective-group textarea::placeholder { color: #aaa; font-style: italic; font-size: 0.9em; }
.weapon-selection-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 25px;
    width: 80%;
    margin: 40px auto 20px auto;
    align-items: end;
}
.form-group-column { display: flex; flex-direction: column; text-align: left; }
.form-group-column label {
    font-size: 1.1em;
    color: #8ec3ff;
    margin-bottom: 8px;
    padding-left: 5px;
}
.custom-select {
    font-size: 1.1em;
    background-color: rgba(0, 0, 0, 0.7);
    color: #e0e0e0;
    border: 1px solid #888;
    border-radius: 5px;
    padding: 12px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    cursor: pointer;
}
.weapon-details-container {
    width: 70%;
    margin: 20px auto 0 auto;
}
#weapon-naming-section {
    padding-top: 20px;
    border-top: 1px solid #444;
}
#weapon-naming-section .narrator.small-narrator {
    font-size: 1.2em;
    color: #e0e0e0;
    text-transform: none;
    font-weight: normal;
    font-style: italic;
    margin-bottom: 10px;
}
#weapon-naming-section .input-group {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    justify-content: center;
    display: flex;
}
#custom-weapon-name {
    flex-grow: 1;
    color: #8ec3ff;
    font-size: 1.2em;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    background-color: rgba(0, 0, 0, 0.5);
    border: 1px solid #888;
    width: auto;
}
#generate-weapon-name {
    cursor: pointer;
    border: none;
    background-color: #6c757d;
    color: white;
    padding: 10px 15px;
    border-radius: 5px;
    flex-shrink: 0;
}
#weapon-final-description-panel {
    width: 100%;
    margin: 20px 0 0 0;
    background-color: rgba(10, 10, 20, 0.8);
    border: 1px solid #4a90e2;
    border-radius: 8px;
    padding: 20px;
    text-align: left;
    min-height: 100px;
}
.property-description-block {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #333;
}
.property-description-block:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}
.property-description-block h4 {
    margin: 0 0 5px 0;
    color: #aaffee;
    font-size: 1.2em;
}
.property-description-block p {
    margin: 0;
    font-style: italic;
}
#shop-initial-choice {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 10vh;
}
.choice-button {
    padding: 30px 50px;
    font-size: 1.5em;
    font-weight: bold;
    color: white;
    background-color: rgba(10, 10, 20, 0.7);
    border: 2px solid #8ec3ff;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}
.choice-button:hover {
    background-color: rgba(74, 144, 226, 0.5);
    transform: translateY(-5px);
}
#shop-kits-view {
    width: 60%;
    margin: 5vh auto 0 auto;
}
.description-panel {
    margin-top: 20px;
    background-color: rgba(10, 10, 20, 0.8);
    border: 1px solid #6c757d;
    border-radius: 8px;
    padding: 20px;
    min-height: 150px;
    text-align: left;
}
#shop-header {
    text-align: center;
    margin-bottom: 20px;
}
#shop-header p {
    font-style: italic;
    color: #e0e0e0;
}
#shop-budget-display {
    font-size: 1.8em;
    font-weight: bold;
    color: #aaffee;
    background-color: rgba(0,0,0,0.5);
    padding: 10px 20px;
    border-radius: 5px;
    display: inline-block;
}
#shop-budget-input {
    font-size: 1em;
    font-weight: bold;
    color: #aaffee;
    background-color: transparent;
    border: none;
    width: 80px;
    text-align: left;
    padding: 5px;
}
#shop-budget-input::-webkit-outer-spin-button,
#shop-budget-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
#shop-budget-input[type=number] {
    -moz-appearance: textfield;
}
#shop-inventory {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 95%;
    margin: 0 auto;
}
.inventory-column h4 {
    font-size: 1.3em;
    color: #8ec3ff;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}
.item-list {
    background-color: rgba(0,0,0,0.3);
    border-radius: 5px;
    padding: 10px;
    height: 50vh;
    overflow-y: auto;
}
.shop-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #333;
}
.shop-item:last-child {
    border-bottom: none;
}
.shop-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 15px;
    flex-shrink: 0;
}
.item-details {
    flex-grow: 1;
    text-align: left;
}
.item-details .item-name {
    font-weight: bold;
    color: #e0e0e0;
}
.item-details .item-desc {
    font-size: 0.85em;
    font-style: italic;
    color: #aaa;
}
.item-price {
    font-weight: bold;
    color: #aaffee;
    margin-left: 15px;
}
#atout-container {
    margin-top: 5vh;
}
#atout-draw-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}
.card-back {
    width: 250px;
    height: 350px;
    background-image: url('https://avantis.world/gen/perso/IMG/atouts/atout_verso.jpg');
    background-size: cover;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
}
#atout-reveal-view {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
    width: 80%;
    max-width: 900px;
    margin: 0 auto;
    background-color: rgba(10, 10, 20, 0.7);
    padding: 20px;
    border-radius: 10px;
}
.card-front {
    width: 250px;
    height: 350px;
    background-color: #111;
    border: 2px solid #aaffee;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}
.card-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.atout-description {
    text-align: left;
}
.atout-description h3 {
    font-size: 2em;
    color: #aaffee;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid #555;
    padding-bottom: 10px;
}
.atout-description p {
    font-size: 1.1em;
    line-height: 1.6;
    white-space: pre-wrap;
}
#redraw-atout-btn {
    background-color: #6c757d;
}
#character-sheet-container {
    background-color: #f4f0e8;
    color: #333;
    border: 2px solid #5a4a3a;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    font-family: serif;
}
.sheet-page h3, .sheet-page h4, .sheet-page h5 {
    color: #5a4a3a;
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1em;
    border-bottom: 1px solid #c9bfae;
    padding-bottom: 5px;
}
.sheet-page h3 {
    font-size: 1.1em;
    border-bottom-width: 2px;
    border-bottom-color: #9c8b7b;
}
.sheet-header {
    display: grid;
    grid-template-columns: auto 3fr 2fr 1fr;
    gap: 15px;
    align-items: stretch;
    margin-bottom: 15px;
}
.header-block {
    background-color: rgba(224, 217, 203, 0.5);
    border: 1px solid #c9bfae;
    border-radius: 3px;
    padding: 10px;
    height: 100%;
    box-sizing: border-box;
}
#summary-logo {
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
#summary-logo img {
    max-width: 100%;
    max-height: 60px;
}
#summary-name { text-align: left; }
.summary-large-text {
    font-size: 1.8em;
    font-weight: bold;
    color: #5a4a3a;
    padding-top: 5px;
}
.vital-gauges { display: flex; justify-content: space-around; align-items: center; height: 100%; font-size: 1.1em; font-weight: bold; text-align: center; }
.summary-gauge-value {
    font-size: 1.4em;
    color: #333;
    width: 50px;
    border: 1px dotted #7c6b5b;
    background: white;
    text-align: center;
    font-family: serif;
    font-weight: bold;
}
.summary-large-input {
    font-size: 1.8em;
    width: 60px;
    text-align: center;
    border: 1px solid #c9bfae;
    background-color: white;
    color: #333;
}
.sheet-body-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 15px;
    align-items: start;
}
.sheet-block {
    background-color: rgba(224, 217, 203, 0.5);
    border: 1px solid #c9bfae;
    border-radius: 3px;
    padding: 10px;
    margin-bottom: 10px;
}
.sheet-main-column .sheet-block:last-child {
    margin-bottom: 0;
}
#summary-combat, #summary-traits {
    text-align: left;
}
.meridien-apt-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}
.meridien-apt-row:last-child { margin-bottom: 0; }
.meridien-apt-col { padding: 8px; border-radius: 3px; }
.meridien-header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid; margin-bottom: 8px; padding-bottom: 4px; }
.meridien-header h5 { border: none; padding: 0; margin: 0; font-size: 0.9em; }
.meridien-header .meridien-value { font-size: 1.2em; font-weight: bold; }
#summary-aptitudes-internal .meridien-apt-col { background-color: rgba(74, 144, 226, 0.1); }
#summary-aptitudes-internal .meridien-header { border-color: rgba(74, 144, 226, 0.4); }
#summary-aptitudes-external .meridien-apt-col { background-color: rgba(208, 103, 103, 0.1); }
#summary-aptitudes-external .meridien-header { border-color: rgba(208, 103, 103, 0.4); }
.aptitude-item-summary { display: flex; justify-content: space-between; align-items: center; font-size: 0.9em; margin-bottom: 3px; }
.aptitude-item-summary .apt-name { flex-grow: 1; text-align: left; }
.aptitude-item-summary .apt-value, .aptitude-item-summary .apt-bonus {
    font-weight: bold;
    margin-left: 5px;
    width: 25px;
    text-align: center;
    border: 1px solid #c9bfae;
    background-color: white;
    padding: 2px;
}
.aptitude-item-summary .apt-bonus { color: #006400; }
.weapon-item { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.weapon-item input:first-child { flex-grow: 1; }
.weapon-item input:last-child { width: 120px; }
#summary-defenses {
    font-size: 0.9em;
    padding-top: 5px;
}
#summary-defenses h5 {
    font-size: 1em;
    color: #5a4a3a;
    margin-top: 15px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid #c9bfae;
    padding-bottom: 5px;
    text-align: center;
}
.defenses-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 5px;
}
.defense-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(0,0,0,0.03);
    padding: 4px 8px;
    border-radius: 3px;
    border: 1px solid #e0d9cd;
}
.defense-item strong {
    margin-right: 5px;
    color: #5a4a3a;
}
.defense-item label {
    flex-grow: 1;
}
.summary-small-input {
    width: 35px;
    text-align: center;
    font-weight: bold;
    border: 1px solid #c9bfae;
    background-color: white;
    padding: 2px;
    font-family: serif;
    font-size: 1em;
}
input[type=number]::-webkit-outer-spin-button,
input[type=number]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type=number] {
    -moz-appearance: textfield;
}
.trait-columns { display: flex; gap: 10px; }
.trait-list { flex: 1; font-size: 0.9em; }
.trait-list h5 { text-align: center; }
.trait-list input { font-size: 0.9em; margin-bottom: 2px; width: 100%; }
#summary-careers-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
#summary-careers-list .career-item { display: flex; flex-direction: column; text-align: center; }
#summary-careers-list .career-period { font-weight: bold; color: #7c6b5b; font-size: 0.8em; margin-bottom: 5px; }
.sheet-block input, .sheet-block textarea {
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    border-bottom: 1px dotted #7c6b5b;
    color: #333;
    font-family: serif;
    width: 98%;
    padding: 2px 4px;
    box-sizing: border-box;
    text-align: center;
}
#summary-hero-name,
#summary-weapons input,
#summary-traits input {
    text-align: left;
}
#summary-hero-name {
    padding: 0;
    border-bottom: none;
    background-color: transparent;
}
.navigation-buttons {
    display: flex;
    justify-content: space-between;
    width: 80%;
    margin: 40px auto 0 auto;
}
.navigation-buttons button {
    padding: 12px 25px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4a90e2;
    color: white;
}

.sheet-body-grid-verso {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Colonne gauche plus large pour les Arts */
    gap: 15px;
    align-items: start;
}

#summary-background h5, #summary-objectives h5 {
    border: none;
    padding: 0;
    margin: 10px 0 5px 0;
    font-size: 0.9em;
    text-align: left;
}
#summary-background h5:first-child { margin-top: 0; }

.inline-input {
    display: inline-block;
    width: 60% !important;
    margin-left: 10px;
    text-align: left !important;
    font-weight: normal;
}

#summary-background textarea, #summary-inventory textarea, #summary-objectives textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9em;
    text-align: left !important;
    padding: 8px !important;
    border: 1px dotted #7c6b5b !important;
    background-color: rgba(255, 255, 255, 0.7) !important;
    resize: vertical;
}

.vrill-arts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.vrill-art-col {
    background-color: rgba(74, 144, 226, 0.1);
    padding: 8px;
    border-radius: 3px;
}
.vrill-art-col.rydan, .vrill-art-col.bliss { background-color: rgba(208, 103, 103, 0.1); }


.vrill-art-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid rgba(74, 144, 226, 0.4);
    margin-bottom: 8px;
    padding-bottom: 4px;
}
.vrill-art-col.rydan .vrill-art-header, .vrill-art-col.bliss .vrill-art-header { border-bottom-color: rgba(208, 103, 103, 0.4); }

.vrill-art-header h5 { border: none; padding: 0; margin: 0; font-size: 0.9em; }
.vrill-art-header .art-value { font-size: 1.2em; font-weight: bold; }

.arcane-item-summary {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 5px;
    align-items: center;
    font-size: 0.9em;
    margin-bottom: 3px;
}

.arcane-item-summary .arcane-name { text-align: left; }
.arcane-item-summary .arcane-value, .arcane-item-summary .arcane-bonus {
    width: 30px;
    text-align: center;
    border: 1px solid #c9bfae;
    background-color: white;
    padding: 2px;
}

.sheet-nav-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    border: 1px solid #5a4a3a;
    border-radius: 5px;
    cursor: pointer;
    background-color: #e0d9cd;
    color: #5a4a3a;
    margin-right: 5px;
}
.sheet-nav-btn.active {
    background-color: #5a4a3a;
    color: #f4f0e8;
}

.nav-group-left {
    display: flex;
    align-items: center;
    gap: 20px; /* Espace entre le bouton "Précédent" et le groupe "Recto/Verso" */
}
h5.atout-header {
    margin-top: 15px; /* Espace au-dessus du titre Atouts */
}

#summary-atouts-list {
    display: flex;
    flex-direction: column;
    gap: 3px; /* Petit espace entre chaque champ d'atout */
}

#summary-atouts-list input {
    width: 100% !important; /* S'assurer que les champs prennent toute la largeur */
    box-sizing: border-box;
    text-align: left !important; /* Aligner le texte à gauche */
}

.welcome-choice-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 10vh; /* Espace sous le texte du narrateur */
}


/* --- AJOUT POUR L'ÉDITEUR DE PERSONNAGE --- */
#character-sheet-container-editor {
    /* Hérite de tous les styles de la fiche de base */
    background-color: #f4f0e8;
    color: #333;
    border: 2px solid #5a4a3a;
    border-radius: 5px;
    padding: 15px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    font-family: serif;
}
/* Applique les styles des en-têtes et blocs à l'éditeur également */
#character-sheet-container-editor .sheet-page h3,
#character-sheet-container-editor .sheet-page h4,
#character-sheet-container-editor .sheet-page h5 {
    color: #5a4a3a;
    margin-top: 0;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 1em;
    border-bottom: 1px solid #c9bfae;
    padding-bottom: 5px;
}
#character-sheet-container-editor .sheet-page h3 {
    font-size: 1.1em;
    border-bottom-width: 2px;
    border-bottom-color: #9c8b7b;
}

/* Duplique les styles spécifiques pour les colonnes de l'éditeur */
#summary-aptitudes-internal-editor .meridien-apt-col { background-color: rgba(74, 144, 226, 0.1); }
#summary-aptitudes-internal-editor .meridien-header { border-color: rgba(74, 144, 226, 0.4); }
#summary-aptitudes-external-editor .meridien-apt-col { background-color: rgba(208, 103, 103, 0.1); }
#summary-aptitudes-external-editor .meridien-header { border-color: rgba(208, 103, 103, 0.4); }

/* --- 1. Correction de la hauteur de l'en-tête --- */
/* On s'assure que l'image du logo dans l'éditeur ne dépasse pas 60px de haut,
   tout comme dans la fiche de récapitulation. */
#summary-logo-editor img {
    max-height: 60px;
}

/* --- 2. Correction de l'affichage du "Parcours de Vie" --- */
/* On applique la même grille CSS à la liste des carrières de l'éditeur
   pour qu'elles s'affichent sur une seule ligne. */
#summary-careers-list-editor {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* On s'assure que chaque élément de carrière est bien formaté. */
#summary-careers-list-editor .career-item {
    display: flex;
    flex-direction: column;
    text-align: center;
}
#summary-careers-list-editor .career-period {
    font-weight: bold;
    color: #7c6b5b;
    font-size: 0.8em;
    margin-bottom: 5px;
}


/* --- 3. Correction de l'alignement du texte sur la Page 2 (Verso) --- */
/* On force l'alignement à gauche pour tous les champs de texte de la page 2
   de l'éditeur, pour une meilleure lisibilité. */
#summary-background-editor textarea,
#summary-inventory-editor textarea,
#summary-objectives-editor textarea,
#summary-atouts-list-editor input {
    text-align: left !important;
}

/* On s'assure que les titres (h5) de la page 2 de l'éditeur sont aussi alignés à gauche. */
#summary-background-editor h5, 
#summary-objectives-editor h5 {
    text-align: left;
}

#vrill-arts-container-summary-editor {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.vrill-art-col-editor {
    background-color: rgba(0,0,0,0.03);
    padding: 8px;
    border-radius: 3px;
    border: 1px solid #e0d9cd;
}

.vrill-art-header-editor {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px solid #c9bfae;
    margin-bottom: 8px;
    padding-bottom: 4px;
    gap: 10px;
}

/* Style pour le champ du nom de l'Art */
.vrill-art-header-editor .art-name-input {
    flex-grow: 1; /* Prend le plus de place possible */
    font-size: 0.9em;
    font-weight: bold;
    color: #5a4a3a;
    text-transform: uppercase;
    text-align: left !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
}

/* Style pour le champ de la valeur de l'Art */
.vrill-art-header-editor .art-value-input {
    font-size: 1.2em;
    font-weight: bold;
    width: 40px;
    text-align: center;
    border: 1px solid #c9bfae;
    background-color: white;
    padding: 2px;
}


#custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* Empêche les clics quand elle est cachée */
}

#custom-modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

#custom-modal-box {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 30px 40px;
    border-radius: 10px;
    border: 1px solid #4a90e2;
    box-shadow: 0 5px 25px rgba(74, 144, 226, 0.3);
    text-align: center;
    width: 90%;
    max-width: 450px;
    transform: scale(0.9);
    transition: transform 0.3s ease-in-out;
}

#custom-modal-overlay:not(.hidden) #custom-modal-box {
    transform: scale(1);
}

#custom-modal-title {
    margin-top: 0;
    color: #aaffee;
    font-size: 1.5em;
    font-family: serif;
    font-weight: normal;
}

#custom-modal-message {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 30px;
}

#custom-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modal-button {
    padding: 12px 30px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    background-color: #4a90e2;
    color: white;
    transition: background-color 0.2s;
    font-weight: bold;
}

.modal-button:hover {
    background-color: #63a0e4;
}


/* --- STYLES ADDITIONNELS POUR LA LIGNE MORPHOLOGIE & ÂGE --- */

.inline-form-group {
    display: flex;
    gap: 30px; /* Espace entre les deux champs */
    align-items: baseline;
    margin-bottom: 10px;
}

.form-item {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

/* On réduit la taille des titres sur cette ligne */
.form-item h5 {
    margin: 0;
    border: none;
    padding: 0;
    font-size: 0.9em !important; /* On force une taille plus petite */
    text-align: left !important;
}

/* On définit une largeur fixe pour chaque champ */
#summary-morphologie, #summary-morphologie-editor {
    width: 160px !important;
    text-align: left !important;
}
#summary-age, #summary-age-editor {
    width: 70px !important;
    text-align: center !important;
}

#tooltip {
    position: absolute; /* Positionné par rapport à la page, suivra le curseur */
    background-color: rgba(12, 10, 26, 0.9); /* Fond sombre, semi-transparent */
    color: #e0e0e0;
    border: 1px solid #8ec3ff;
    border-radius: 5px;
    padding: 10px 15px;
    max-width: 300px; /* Largeur maximale pour ne pas être trop envahissant */
    font-size: 0.9em;
    line-height: 1.5;
    z-index: 2000; /* Doit être au-dessus de tout le reste */
    pointer-events: none; /* La souris "passe à travers" pour ne pas gêner */
    transition: opacity 0.2s;
}

/* On réduit un peu l'espace pour faire de la place */
.inline-form-group {
    gap: 20px; 
}

/* On ajuste la largeur des champs existants */
#summary-morphologie, #summary-morphologie-editor {
    width: 140px !important;
}
#summary-age, #summary-age-editor {
    width: 60px !important;
}

/* On ajoute le style pour le nouveau champ "Sols" */
#summary-sol, #summary-sol-editor {
    width: 80px !important;
    text-align: center !important;
}


#prev-to-genesis, #prev-to-origin, #prev-to-appearance, #prev-to-careers, 
#prev-to-enfance, #prev-to-ado, #prev-to-jeune-adulte, #prev-to-traits,
#prev-to-meridiens, #prev-to-objectives, #prev-to-weapon, #prev-to-atout {
    background-color: #6c757d;
}