body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

.container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    width: 300px;
    padding: 1rem;
    background-color: #f9f9f9;
    border-right: 1px solid #ccc;
    overflow-y: auto;
    top: 0;
    height: 100vh;
}

.content {
    flex-grow: 1;
    padding: 1rem;
    min-width: 0; /* helps avoid overflow issues */
}

fieldset {
    border: 1px solid #ccc;
    padding: 0.5em;
    margin-bottom: 1rem;
}

select {
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    max-width: 100%;
    overflow-x: auto;
}

th, td {
    padding: 0.5em;
    border: 1px solid #ddd;
    text-align: left;
}

button {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: #eee;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    margin-top: 1rem;
}
button:hover {
    background-color: #ddd;
}
legend {
    font-weight: bold;
}
a.button {
    display: inline-block;
    padding: 0.5em 1em;
    background-color: #eee;
    border: 1px solid #ccc;
    text-decoration: none;
    color: #333;
    border-radius: 4px;
    margin-top: 1rem;
}
a.button:hover {
    background-color: #ddd;
}

.pill-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;
}

.pill {
    display: inline-block;
    padding: 0.4em 0.8em;
    border: 1px solid #ccc;
    border-radius: 999px;
    cursor: pointer;
    background-color: #f0f0f0;
    user-select: none;
    transition: background-color 0.2s, border-color 0.2s;
}

.pill:hover {
    background-color: #e0e0e0;
}

input[type="checkbox"]:checked + .pill {
    background-color: #0077cc;
    color: white;
    border-color: #0077cc;
}

.battle-builder {
    width: 400px;
    padding: 1rem;
    background-color: #f9f9f9;
    border-left: 1px solid #ccc;
    flex-shrink: 0; /* don’t let it shrink */
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.battle-builder input[type="number"] {
    width: 60px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.3rem;
    font-size: 1rem;
}

.main {
    display: flex;
    flex-grow: 1;
    flex-shrink: 1;
    flex-wrap: nowrap; /* prevent wrapping */
    min-width: 0;
}

.adversary-row {
    cursor: pointer;
}
.adversary-row:hover {
    background-color: #eef;
}

#selectedAdversariesTable {
    width: 100%;
    margin-top: 1rem;
    border-collapse: collapse;
}
#selectedAdversariesTable th, #selectedAdversariesTable td {
    border: 1px solid #ccc;
    padding: 0.4rem;
    font-size: 0.95rem;
}

.add-button, .remove-button {
    padding: 2px 6px;
    font-size: 0.85rem;
    cursor: pointer;
}
.remove-button {
    color: #fff;
    background-color: #c00;
    border: none;
    border-radius: 4px;
}
.add-button {
    color: #fff;
    background-color: #28a745;
    border: none;
    border-radius: 4px;
}

#selectedAdversariesTable > tbody > tr {
    cursor: pointer;
}

#selectedAdversariesTable > thead > tr {
    cursor: default;
}

#selectedAdversariesTable > tbody > tr:hover {
    background-color: #ffecec;
}

.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.4);
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 800px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* The Close Button */
.close {
    color: #aaaaaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
}