.char-sheet-page {
    
    p, ul, ol {
        font-size: 1.2rem;
    }

    .disp-main {
        display: flex;
    }

    .edit-sidebar {
        position: sticky;
        top: 124px;
        
        display: flex;
        flex-direction: column;
        gap: 0px;
        width: 80px;
        min-width: 80px;
        padding: 5px;

        background-color: var(--light-red);

        .inner-side {
            position: sticky;
            top: 114px;
        }

        .blank-btn {
            background-color: transparent;
        }

        .blank-btn:hover {
            background-color: transparent;
            box-shadow: none;
            
            img {
                opacity: 100%;
                transition: 0.1s;
            }
        }

        img {
            display: block;
            width: 100%;
            opacity: 80%;

            transition: 0.1s;
        }

        hr {
            border: 2px solid var(--light-gold);
            width: 60%;
        }

        .sidebar-popout {
            position: absolute;
            left: 80px;

            display: flex;
            flex-direction: column;
            gap: 10px;

            width: 240px;

            background-color: var(--light-red);
            padding: 10px;
        }

        .sn-sect {
            .sidebar-popout {
                display: none;
            }

            #roll-popout {
                top: 267px;
            }

            #edit-popout {
                top: -10px;
            }

            #export-popout {
                top: 80px;
            }

            #clear-popout {
                top: 170px;
            }
        }

        .sn-sect:hover {
            .sidebar-popout {
                display: flex;
            }
        }

        .sn-sect.show {
            .sidebar-popout {
                display: flex;
            }
        }
    }

    .edit-menu {
        background-color: var(--dark-red);
        border: none;
        border-radius: 10px;

        padding: 16px;

        display: none;
        /* display: flex */
        flex-direction: column;
        gap: 16px;

        height: min-content;
        min-width: 15vw;

        #edit-btn {
            width: 100%;
        }

        #edit-dropdown {
            display: none;
        }
    }

    #roll-popout {

        .mid-popout {
            max-height: 400px;
            overflow: scroll;

            background-color: var(--light-gold);
            border-radius: 10px;
            padding: 10px;
            display: flex;
            flex-direction: column;
        }

        h4 {
            color: var(--dark-red);
            font-family: "EB Garamond";
            font-weight: bold;
            font-size: 1.4rem;
            text-align: center;
            margin: 0;
        }

        .rolly-results {
            border: 6px double var(--light-red);
            margin-bottom: 10px;
            text-align: center;

            p {
                margin: 0;
                padding: 5px;
            }
        }

        h5 {
            font-family: "EB Garamond";
            font-size: 1.2rem;
            font-weight: bold;
            margin: 0;
            line-height: 100%;
            padding: 5px;
            margin-top: 5px;
        }

        .inner-popout {
            margin: 10px 0px 10px 0px;
            text-align: center;
        }

        input {
            max-width: 30%;
            margin: 2px;
            border: 2px solid var(--gold);
            text-align: center;
        }

        button {
            text-align: center;
            border: 3px solid var(--light-red);
            justify-self: center;
        }
    }

    #overwrite-warning {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);

        max-width: 500px;

        h3 {
            font-size: 2rem;
            margin: 0;
            text-align: center;
        }

        p {
            margin: 0;
        }
    }

    #char-creation-popup {
        position: fixed;
        right: 10px;
        bottom: 10px;
        margin-top: auto;

        text-align: justify;

        max-width: 40vw;
        width: 30vw;
        max-height: 60vh;

        #cc-buttons {
            display: flex;
            justify-content: right;
            gap: 10px;

            text-align: center;

            width: 100%;
            padding: 0;

            button {
                margin: 0;
            }
        }

        p, h2 {
            margin: 0;
        }

        p {
            margin-bottom: 10px;
        }

        h4 {
            font-family: var(--p-font);
            font-size: 1.2rem;
            font-weight: bold;
            margin: 0;
        }

        ol {
            margin-top: 0;
        }

        .tutorial-text {
            background-color: var(--fill-cream);
            color: black;
            padding: 20px;
            border-radius: 10px;
            overflow: auto;

            scrollbar-width: 5px;
            scrollbar-color: var(--dark-red);
        }

        .tutorial-text::-webkit-scrollbar {
            width: 10px;
            height: 0;
            background-color: var(--fill-cream);
        }

        .tutorial-text::-webkit-scrollbar-track {
            background-color: var(--gold);
        }

        .tutorial-text::-webkit-scrollbar-thumb {
            background-color: var(--light-red);
            border-radius: 10px;
        }

        h3 {
            font-family: var(--p-font), "Times New Roman";
            margin-top: 10px;
            font-weight: bold;
            margin-bottom: 0;
            font-size: 1.3rem;
        }
    }

    #paste-popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);

        gap: 20px;

        max-width: 90vw;
        min-width: 30vw;
        text-align: center;

        h3 {
            margin: 0;
        }

        button {
            max-width: 100%;
            align-self: center;
            width: auto;
            flex-grow: 1;
        }

        textarea {
            align-self: center;
            width: 100%;
            min-height: 100px;
        }

        #paste-buttons {
            display: flex;
            flex-direction: row;
            justify-content: space-evenly;
            gap: 20px;
        }
    }

    #upload-popup {
        position: fixed;
        width: 500px;
        height: 30%;
        justify-self: center;

        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        
        h3 {
            font-size: 1.5rem;
            margin: 0;
            text-align: center;
            line-height: 100%;
        }

        input[type="file"]::file-selector-button {
            background-color: var(--light-gold);
            border: 3px solid var(--light-red);
            border-radius: 10px;
            padding: 5px;
            font-family: var(--p-font);
            font-weight: bold;
        }

        input[type="file"]::file-selector-button:hover {
            background-color: var(--gold);
        }

        input[type="file"] {
            padding: 10px;
            border: 3px solid var(--light-red);
        }
    }

    .sheet {
        display: flex;
        flex-direction: column;

        height: min-content;
        box-sizing: border-box;
        max-width: 100%;
        width: 100%;
        margin: 20px;
    }

    .sheet-main {
        display: grid;
        gap: 20px;

        grid-template-columns: 12.5fr 41fr 48fr;
        grid-template-rows: 1fr 0.5fr 0.5fr 1fr;
    }

    .main-item {
        border: 3px solid var(--dark-red);
        background-color: var(--fill-cream);
    }

    input, textarea {
        border: 1px solid var(--gold);
    }

    .sheet-head {
        display: grid;
        gap: 3px;
        background-color: var(--dark-red);
        grid-template-columns: 28fr 20fr 26fr 8fr 18fr;
        grid-template-rows: auto auto;

        height: min-content;
        /* padding: 3px; */

        margin-bottom: 20px;
        padding: 3px;

        .sh-val {
            display: block;

            text-align: left;
            margin: 0px;
            padding: 0;
        }

        .sh-in {
            display: none;

            margin: 0;
            height: 60%;
            width: 100%;
        }

        #name-in, #pronouns-in, #age-in, #position-in, #name-val, #age-val, #pronouns-val, #position-val {
            margin-left: 10px;
        }

        #name {
            grid-column-start: 1;
            grid-column-end: 3;

            grid-row: 1;
        }

        #pronouns, #age, #position, #sturdy, #wounds {
            h3 {
                font-family: var(--p-font);
                font-weight: bold;
            }
        }

        #pronouns {
            grid-column: 1;
            grid-row: 2;
        }

        #age {
            grid-column: 2;
            grid-row: 2;
        }

        #position {
            grid-column: 3;
            grid-row-start: 1;
            grid-row-end: 3;
            display: block;
            padding: 10px;

            .sh-in, .sh-val {
                margin: 0;
                margin-top: 10px;
            }

            h3 {
                margin-top: 5px;
            }

            input {
                max-width: 95%;
                height: auto;
            }
        }

        #sturdy {
            grid-column: 4;
            grid-row-start: 1;
            grid-row-end: 3;

            display: block;
            padding: 10px;

            .sh-in, .sh-val {
                margin: 0;
                margin-top: 10px;
                text-align: center;
                justify-self: center;
                border: 3px solid var(--gold);
            }

            #sturdy-in {
                width: 50%;
                padding: 5px;
            }

            h3 {
                margin-top: 5px;
                text-align: center;
            }

            p {
                padding: 5px 16px 5px 16px;
            }

            input {
                height: auto;
            }
        }

        #wounds {
            margin: 0;
            position: relative;

            grid-column: 5;
            grid-row-start: 1;
            grid-row-end: 3;

            display: flex;
            flex-direction: column;
            gap: 5px;
            text-align: center;

            h3 {
                /* border: 1px solid black; */
                grid-row: 1;
                grid-column-start: 1;
                grid-column-end: 4;

                text-align: center;
                margin: 0;
                margin-top: 5px;
            }

            label {
                font-family: var(--mono-font);
                font-size: 0.7rem;
            }

            .wound-big-div {
                width: 100%;
                display: grid;
                grid-template-columns: 1fr 1fr 1fr 1fr;
                justify-content: space-evenly;
            }

            .wound-div {

                display: flex;
                flex-direction: column;
                justify-content: center;
                align-content: center;
                align-items: center;
                text-align: center;
                margin: 0;
                margin-top: 10px;


                input[type="checkbox"] {
                    z-index: 0;
                    appearance: none;
                    -webkit-appearance: none;
                    background-color: var(--fill-cream);
                    margin: 0;
                    font: inherit;
                    width: 1.5rem;
                    height: 1.5rem;
                    border: 3px solid var(--dark-red);
                    border-radius: 50%;
                    transform: translateY(-0.075em);
                    transition-duration: 0.2s;
                }

                input[type="checkbox"]:checked {
                    background-color: var(--dark-red);
                }

                input[type="checkbox"]:not(:checked):hover {
                    background-color: var(--gold);
                    transition-duration: 0.2s;
                }

            }

            hr {
                border: 3px solid var(--light-red);
                width: 68%;

                position: absolute;
                top: 46px;
                left: 15%;
                text-align: center;
            }
        }
    }

    .sheet-header-item {
        display: flex;
        /* display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr; */

        height: auto;

        /* border: 3px solid black; */
        background-color: var(--fill-cream);

        max-height: 100%;
        max-width: 100%;
        margin: 0;

        padding: 10px;

        align-items: center;

        p {
            overflow-wrap: normal;
            word-break: break-word;
        }

        h2, h3 {
            line-height: 100%;
            margin: 0;
            /* border: 1px solid blue; */
        }
    }

    .sheet-head.edit-mode {
        .sh-val {
            display: none;
        }

        .sh-in {
            display: block;
        }
    }

    #abilities {
        grid-column: 1;
        grid-row-start: 1;
        grid-row-end: 5;

        display: flex;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        padding: 10px;
        height: min-content;

        .ab-val {
            display: block;

            border-radius: 10px;
            border: 3px solid var(--gold);


            width: min-content;
            justify-self: center;
            text-align: center;
            padding: 10px 15px 10px 15px;
        }

        .ab-in {
            display: none;
            max-width: 50px;
        }

        div {
            margin: 10px;
            width: 100px;
            border: 3px var(--light-red) solid;
            border-radius: 20px;

            align-self: center;
        }

        input {
            max-width: 60%;
            height: auto;
            border: 3px solid var(--gold);
            border-radius: 10px;
            text-align: center;

            font-family: 'Times New Roman', Times, serif;
            font-weight: bold;
            font-size: 1.2rem;

            
            justify-self: center;

            padding-top: 10px;
            padding-bottom: 10px;
            margin-bottom: 10px;
            margin-top: 0;
        }

        h2 {
            padding: 0;
            margin: 0;
        }

        h3, input {
            font-family: var(--p-font);
            font-weight: bold;
            margin: auto;
            margin-top: 10px;
            margin-bottom: 10px;
        }
    }

    #abilities.edit-mode {

        .ab-val {
            display: none;
        }

        .ab-in {
            display: block;
        }
    }

    #background {
        grid-column: 3;
        grid-row-start: 1;
        grid-row-end: 3;
        max-height: 347px;
    }

    #gear {
        grid-column: 2;
        grid-row: 4;
        max-height: 218px;
    }

    #notes {
        grid-column: 3;
        grid-row-start: 3;
        grid-row-end: 5;
        max-height: 347px;
    }

    .expertise {
        grid-column: 2;
        grid-row-start: 2;
        grid-row-end: 4;
        max-height: 238px;
    }

    .eccentricities {
        grid-column: 2;
        grid-row-start: 1;
        grid-row-end: 2;
        max-height: 218px;
    }

    .eccentricities.edit-mode, .expertise.edit-mode {
        .te-val {
            display: none;
        }

        .te-in {
            display: block;
        }
    }

    .eccentricities, .expertise {

        .te-val {
            display: block;
        }

        .te-in {
            display: none;
        }
    }

    #background, #gear, #notes, .eccentricities, .expertise {
        padding: 10px;
        overflow: scroll;
        
        .long-text-in {
            display: none;
        }

        .long-text-val {
            display: block;
        }

        h2 {
            margin: 0;
        }

        p {
            max-height: 100%;
            overflow-wrap: normal;
            word-break: break-word;
        }
    }

    #background.edit-mode, #gear.edit-mode, #notes.edit-mode {
        .long-text-in {
            display: block;
        }

        .long-text-val {
            display: none;
        }
    }

    .long-text-in, .te-in {
        resize: none;
        box-sizing: border-box;
        width: 100%;
        height: 70%;
    }

    .long-text-in, .te-in, .long-text-val, .te-val {
        margin-top: 10px;
        margin-bottom: 10px;
    }
}

@media (min-width: 1300px) {
    .char-sheet-page {
        .sheet {
            margin-left: 80px;
            margin-right: 80px;
        }
    }
}

@media (max-width: 1300px) {
    .char-sheet-page {
        .sheet-head {
            #sturdy {
                #sturdy-in {
                    width: 80%;
                }
            }
        }
    }
}

@media (max-width: 1050px) {
    .char-sheet-page {
        .disp-main {
            display: flex;
            flex-direction: row;
        }

        .sheet {
            display: flex;
            flex-direction: column;
            max-width: 100%;
            width: 100%;
        }

        .sheet-head {
            display: grid;
            grid-template-columns: 50fr 15fr 35fr;
            grid-template-rows: auto auto auto auto;

            margin-bottom: 20px;
            height: min-content;

            border: 10px red;

            p {
                margin-top: 0;
                margin-bottom: 0;
            }

            #name {
                grid-row: 1;
                grid-column: 1 / 4;
                

                #name-in {
                    width: 100%;
                    margin-right: 10px;
                }
            }

            #pronouns {
                grid-row: 2;
                grid-column: 1 / 3;
            }

            #age {
                grid-row: 2;
                grid-column: 3 / 4;
            }

            #position {
                grid-row: 3;
                grid-column: 1 / 3;
                display: flex;

                .sh-in, .sh-val {
                    margin: 0;
                    margin-left: 10px;
                }

                h3 {
                    margin: 0;
                }
            }

            #sturdy {
                grid-row: 3;
                grid-column: 3;

                display: flex;

                .sh-in, .sh-val {
                    margin: 0;
                    margin-left: 10px;
                    padding: 0;
                    border: none;
                }

                #sturdy-in {
                    border: 1px solid var(--gold);
                    text-align: left;
                    padding: 1px;
                    height: auto;
                }

                h3 {
                    margin: 0;
                }
            }

            #wounds {
                grid-row: 4;
                grid-column: 1 / 4;

                display: flex;
                flex-direction: row;
                justify-content: space-evenly;

                align-content: center;

                h3 {
                    grid-row: 1 / 3;
                    grid-column: 1;

                    margin: 0;
                }

                hr {
                    display: none;
                }
            }

            #name, #pronouns, #age, #position, #sturdy {
                height: auto;
                
                h3 {
                    line-height: 100%;
                }

                h2 {
                    line-height: 150%;
                }
            }

            .sh-in {
                height: 100%;
                margin-left: 10px;
            }
        }

        .sheet-main {
            display: flex;
            flex-direction: column;
        }

        #abilities {
            flex-direction: row;
            flex-wrap: wrap;
            justify-content: center;
            justify-items: center;
            align-items: center;
            padding-top: 10px;

            h2 {
                width: 100%;
                text-align: center;
                margin: 0;
            }

            input {
                text-align: center;
                max-width: 80%;
                width: 50%;
            }
        }

        .eccentricities {
            min-height: 100px;
        }

        #upload-popup, #overwrite-warning, #char-creation-popup {
            max-width: 500px;
            width: 85vw;

            #download-curr-char {
                display: none;
            }
        }
    }
}

@media (max-width: 700px) {

    .char-sheet-page {
        .disp-main {
            display: flex;
            flex-direction: column;
            justify-content: center;
        }

        .sheet {
            width: auto;
        }
    
        .edit-sidebar {
            display: none;
        }
        
        .edit-menu {
            display: flex;
            height: auto;
            max-width: 700px;

            margin: 20px 20px 0px 20px;

            #edit-div {
                display: flex;
                flex-direction: row;
                width: 100%;
                gap: 16px;

                #edit-dropdown {
                    display: block;
                    background-color: transparent;
                    border-radius: 0px;
                    padding: 0;
                    margin: 0;

                    width: 10%;
                    max-width: 40px;
                    rotate: 0deg;
                    transition-duration: 0.5s;

                    img {
                        width: 100%;
                    }

                }

                #edit-dropdown:hover {
                    background-color: transparent;
                    box-shadow: none;
                }
            }

            #edit-btn {
                width: 90%;
            }

            #copy-btn, #paste-btn, #clear-storage, #use-tutorial, #rand-char-btn {
                display: block;
            }

            #upload-btn, #download-btn {
                display: none;
            }
        }

        .edit-menu.hide {
            #download-btn, #upload-btn, #clear-storage, #use-tutorial, #rand-char-btn, #copy-btn, #paste-btn {
                display: none;
            }

            #edit-dropdown {
                transform: rotate(-180deg);
            }

            #edit-div {
                display: flex;
            }
        }

        #paste-popup {
            width: 80vw;
        }
    }
}