body {
        font-family: Arial, sans-serif;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        margin: 0;
        height: 100vh;
        background-color: #f0f0f0;
        overflow-y: auto;
    }

    h1 {
        margin-bottom: 2vw;
        font-size: 3vw;
        text-align: center;
    }

    a {
        color: #007BFF;
        text-decoration: none;
    }

    a:hover {
        text-decoration: underline;
    }

    .upload-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 2vw;
    }

    .upload-item {
        display: flex;
        align-items: center;
        margin-bottom: 1vw;
    }

    .upload-item label {
        margin-right: 1vw;
    }

    .upload-item input[type="file"] {
        margin-right: 1vw;
    }

    .chart-container {
        position: relative;
        width: 80vw;
        height: 80vh;
        max-width: 600px;
        max-height: 600px;
        border: 2px solid #ccc;
        background: repeating-linear-gradient(to bottom, #ffffff 0px, #ffffff 4vw, #f2f2f2 4vw, #f2f2f2 8vw);
        animation: pulse 3s infinite;
        margin-top: 20px;
        flex-shrink: 0;
    }

    @keyframes pulse {
        0%, 100% {
            background-color: #f0f0f0;
        }
        50% {
            background-color: #e0e0e0;
        }
    }

    .image-wrapper {
        position: absolute;
        bottom: 0;
        display: flex;
        justify-content: space-evenly;
        width: 100%;
        height: 100%;
        align-items: flex-end;
    }

    .uploaded-image {
        max-width: 45%;
        position: relative;
        bottom: 0;
        transition: height 0.3s ease-in-out;
    }

    .height-labels {
        position: absolute;
        width: 100%;
        height: 100%;
        pointer-events: none;
    }

    .height-label {
        position: absolute;
        left: 0;
        width: 100%;
        text-align: left;
        padding-left: 1vw;
        font-size: 1.5vw;
        color: #333;
        transform: translateY(50%);
        opacity: 0;
        animation: slideIn 1s forwards;
        animation-delay: calc(var(--index) * 0.1s);
    }

    @keyframes slideIn {
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    .image-buttons-container {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 600px;
        margin: 10px 0;
        text-align: center;
    }

    .image-buttons-row {
        display: flex;
        justify-content: space-evenly;
        margin-bottom: 10px;
    }

    .image-button {
        padding: 10px 15px;
        border: none;
        cursor: pointer;
        font-size: 1em;
        color: white;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }

    .image-button.upload {
        background-color: green;
    }

    .image-button.upload:hover {
        background-color: darkgreen;
    }

    .image-button.select {
        background-color: orange;
    }

    .image-button.select:hover {
        background-color: darkorange;
    }

    .image-button.edit {
        background-color: blue;
    }

    .image-button.edit:hover {
        background-color: darkblue;
    }

    .add-image-button {
        background: linear-gradient(to right, #ffffff, #add8e6);
        color: #333;
        padding: 10px;
        cursor: pointer;
        text-align: center;
        font-size: 1.2em;
        border-radius: 5px;
        transition: background 0.3s ease;
    }

    .add-image-button:hover {
        background: linear-gradient(to right, #add8e6, #ffffff);
    }

    .remove-btn {
        background-color: #ff4444;
        color: white;
        border: none;
        padding: 5px 10px;
        border-radius: 3px;
        margin-left: 10px;
        cursor: pointer;
    }

    .remove-btn:hover {
        background-color: #cc0000;
    }

    .edit-btn {
        background-color: #007BFF;
        color: white;
        border: none;
        padding: 5px 10px;
        border-radius: 3px;
        margin-left: 10px;
        cursor: pointer;
    }

    .edit-btn:hover {
        background-color: #0056b3;
    }

    /* Editor Modal Styles */
    #imageEditorModal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.8);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    #imageEditorModal > div {
        background: white;
        padding: 20px;
        border-radius: 8px;
        max-width: 90%;
        max-height: 90%;
    }

    #imageEditorModal img {
        max-height: 60vh;
        max-width: 100%;
    }

    #imageEditorModal button {
        transition: background-color 0.3s;
    }

    #imageEditorModal button:hover {
        opacity: 0.9;
    }

    /* Upload Modal Styles */
    #uploadModal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.8);
        z-index: 1000;
        justify-content: center;
        align-items: center;
    }

    #uploadModal > div {
        background: white;
        padding: 20px;
        border-radius: 8px;
        max-width: 90%;
        max-height: 90%;
    }

    /* Character Selection Modal Styles */
    .modal {
        display: none;
        position: fixed;
        z-index: 1;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgb(0,0,0);
        background-color: rgba(0,0,0,0.4);
    }

    .modal-content {
        background-color: #fefefe;
        margin: 15% auto;
        padding: 20px;
        border: 1px solid #888;
        width: 80%;
        max-width: 700px;
    }

    .close-button {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
    }

    .close-button:hover,
    .close-button:focus {
        color: black;
        text-decoration: none;
        cursor: pointer;
    }

    .category-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 20px;
    }

    .category-button {
        background-color: #007BFF;
        color: white;
        border: none;
        padding: 10px 20px;
        border-radius: 5px;
        cursor: pointer;
        transition: background-color 0.3s;
    }

    .category-button:hover {
        background-color: #0056b3;
    }

    .character-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }

    .character-grid img {
        width: 100px;
        height: auto;
        cursor: pointer;
        border: 2px solid transparent;
    }

    .character-grid img:hover {
        border: 2px solid #007BFF;
    }

    @media (max-width: 768px) {
        h1 {
            font-size: 5vw;
        }

        .upload-item input[type="file"],
        .upload-item input[type="number"] {
            width: 80%;
        }

        .chart-container {
            width: 95vw;
            height: 60vh;
        }

        .height-label {
            font-size: 3.5vw;
            padding-left: 3vw;
        }

        .image-buttons-container {
            flex-direction: column;
        }

        .image-buttons-row {
            flex-direction: column;
            gap: 10px;
        }

        .image-button {
            font-size: 0.9em;
            padding: 8px 10px;
        }

        .upload-item {
            flex-wrap: wrap;
        }

        .upload-item label {
            width: 100%;
            margin-bottom: 5px;
        }

        /* Hide the second upload item on mobile */
        #uploadContainer1 .upload-item:nth-child(2) {
            display: none;
        }
    }