.page {
    max-width: 100% !important;
}

.arena-calc-container {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    width: 100%;
    max-width: 100%;
    padding: 20px;
    height: 100%;
}

.folder-control {
    width: 100%;
    max-width: 100%;
    margin-bottom: 5px;
    background-color: var(--background-light);
    display: flex;
    flex-direction: column;
}

.headers {
    display: flex;
}

.header {
    padding: 10px;
    cursor: pointer;
    background-color: var(--dark-red);
    border: 2px solid var(--primary-red);
    border-radius: 5px;
    margin-right: 4px;
}

.header.active-header {
    background-color: var(--primary-red);
}

.coords-header {
    text-align: center;
    padding: 10px;
    background-color: var(--background-light);
}

.coords-header h2 {
    margin: 0;
}

.header h2 {
    margin: 0;
}

.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 5px 0px;
    overflow: auto;
    border: 2px solid var(--primary-red);
    border-radius: 5px;
}

canvas {
    width: 300px;
    height: 150px;
    display: block;
    /* Default behavior */
}

.coords {
    font-family: Arial, sans-serif;
    font-size: 14px;
    display: inline-block;
    margin-left: 20px;
}

.input-section {
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    height: 100%;
    /* Take full height of parent */
    min-height: 0;
    /* Allow shrinking within flexbox */
    margin-bottom: 16px;
    /* for version */
}

.input-row {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    /* Ensure the items wrap into the next row if necessary */
    column-gap: 10px;
    row-gap: 10px;
    height: 100%;
    overflow: auto;
}

.left-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.input-block {
    display: flex;
    gap: 5px;
    flex-direction: column;
    /* Stack label and buttons vertically */
}

.title-block {
    display: flex;
    flex-direction: row;
    gap: 5px;
    align-items: center;
    /* Vertically align label and buttons */
}

.buttons {
    display: flex;
    gap: 5px;
    flex: 1;
    justify-content: flex-end;
    /* Align buttons to the right */
}

.right-column {
    flex: 1;
    display: flex;
    gap: 5px;
    flex-direction: column;
    height: 100%;
    /* Ensure it takes full height of its parent */
    min-height: 0;
    /* Allow it to shrink within flexbox constraints */
}

.large-block {
    display: flex;
    gap: 5px;
    flex-direction: column;
    flex-grow: 1;
    /* Takes the full height of the right column */
    height: 100%;
    /* Ensure it takes full height of its parent */
    min-height: 0;
    /* Allow it to shrink within flexbox constraints */
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    /* Add spacing between items */
    overflow: auto;
    /* Enable scrolling */
    border: 2px solid var(--primary-red);
    border-radius: 5px;
    height: 100%;
    /* Take full height of parent */
    max-height: 100%;
    /* Constrain height */
    min-height: 200px;
    /* Minimum height */
    background-color: var(--background-color);
    width: 100%;
    /* Ensure it takes full width */
    max-width: 100%;
    /* Constrain width */
    overflow-x: auto;
    /* Enable horizontal scrolling */
}

.list-item {
    display: flex;
    justify-content: space-between;
    margin: 5px;
}

.list-item button {
    min-width: 0px;
    width: 40px;
    height: 24px;
}

.list-item label {
    margin-right: 10px;
}

.truncate-label {
    white-space: nowrap;
    /* Prevent wrapping */
    overflow: hidden;
    /* Hide overflow */
    text-overflow: ellipsis;
    /* Show ellipsis when text overflows */
    width: 200px;
    max-width: 100%;
    flex: auto;
    /* Allow it to shrink if needed */
}

h2 {
    color: var(--text-color);
}

textarea {
    width: 100%;
    height: 200px;
    resize: vertical;
    overflow: auto;
    /* Allow scrolling */
    box-sizing: border-box;
    /* Prevent overflow into the layout */
    border: 2px solid var(--primary-red);
    border-radius: 5px;
    color: var(--text-color);
    background-color: var(--background-color);
}

button {
    min-width: 80px;
    height: 28px;
    text-align: center;
    box-sizing: border-box;
    /* Include padding and border in total height */
    font-size: 14px;
    /* Ensure font size is the same */
}

input {
    height: 28px;
    width: 100%;
    border: 2px solid var(--primary-red);
    border-radius: 5px;
    box-sizing: border-box;
    /* Include padding and border in total height */
    font-size: 14px;
    /* Ensure font size is the same */
    color: var(--text-color);
    background-color: var(--background-color);
}

label {
    display: inline-block;
    /* Prevents the label from taking multiple lines */
    white-space: nowrap;
    /* Prevents text from wrapping to the next line */
}

hr {
    margin-top: 4px;
    margin-bottom: 2px;
}

#popupMenu {
    position: absolute;
    display: none;
    background-color: var(--background-color);
    border: 1px solid var(--primary-red);
    box-shadow: 0 4px 6px var(--shadow-red);
    padding: 10px;
    z-index: 1000;
}

#popupMenu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#popupMenu ul li {
    padding: 5px 10px;
    cursor: pointer;
}

#popupMenu ul li:hover {
    background-color: var(--background-light);
}

#version {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9em;
    color: var(--primary-red);
    position: absolute;
    bottom: 10px;
    right: 10px;
    text-align: right;
}