body {
    font-family: sans-serif;
    margin: 0;
    padding: 10px;
    background-color: #f0f0f0;
}

.character-sheet {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    max-width: 1200px;
    margin: auto;
    background: white;
    padding: 20px;
    border-radius: 10px;
}

section {
    border: 1px solid #ccc;
    padding: 10px;
    border-radius: 5px;
}

.header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f2f2f2;
    padding: 10px;
    border-bottom: 2px solid #ddd;
}

.char-info {
    display: flex;
    align-items: center;
    width: 100%;
}

.char-name {
    width: 30%;
}

.char-portrait {
    width: 150px;
    height: 150px;
    margin: 0 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#portrait-preview {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 2px solid #ddd;
    object-fit: cover;
}

.portrait-upload-label {
    margin-top: 10px;
    cursor: pointer;
    background-color: #4CAF50;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8em;
}

.char-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    flex-grow: 1;
}

.main-stats {
    grid-column: 1 / 2;
}

.attributes {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.attr-box {
    text-align: center;
}

.attr-modifier {
    font-size: 1.5em;
    font-weight: bold;
}

.saving-throws, .skills {
    margin-top: 20px;
}

.combat-info {
    grid-column: 2 / 3;
}

.passive-skills, .proficiencies-languages {
    grid-column: 1 / 2;
}

.attacks-spellcasting {
    grid-column: 2 / -1;
}

.equipment {
    grid-column: 1 / 2;
}

.features-traits {
    grid-column: 2 / 3;
}

.character-appearance, .character-backstory, .personality {
    grid-column: 1 / -1;
}

textarea {
    width: 100%;
    min-height: 100px;
    resize: vertical;
}

input[type="text"] {
    width: 100%;
    padding: 5px;
    box-sizing: border-box;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
