*, *::before, *::after {
    box-sizing: border-box;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    margin: 10px 0;
    box-sizing: border-box;
    font-size: 16px;
}

#modifiers-container {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

#modifiers {
    display: flex;
    flex-direction: column;
    width: 50%;
}

#abilities {
    width: 42.5%;
}

body {
    background-image: url("/trlstats/static/img/trlbg1.jpg");
    background-repeat: no-repeat;
    background-attachment: fixed;
    background-size: cover;
    position: relative;
    z-index: -1;
    font-family: Arial, sans-serif;
    margin: 20px;
}

header nav {
    margin-bottom: 20px;
}

header nav a {
    color: red;
    text-decoration: none;
    font-weight: bold;
    padding: 10px 20px;
}

header nav a:hover {
    color: red;
}

h1 {
    color: #333;
    margin-bottom: 20px;
}

.background-roster {
    background-color: rgba(255, 255, 255, 0.8); /* Semi-transparent background for better readability */
    padding: 20px;
    border-radius: 10px;
    z-index: 1;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
    overflow: hidden;
    background-color: rgba(255, 255, 255, 0.8);
}

table, th, td {
    border: 1px solid #ddd;
}

th, td {
    padding: 10px;
    text-align: left;
}

th {
    color: #333;
    background-color: rgba(255, 255, 255, 0.9);
}

button {
    padding: 5px 10px;
    background-color: red;
    color: white;
    border: none;
    cursor: pointer;
}

button:hover {
    background-color: red;
}

input {
    padding: 5px;
    margin-bottom: 20px;
}

#result {
    margin-top: 20px;
}

#search {
    width: 100%;
    padding: 6px;
    border: 2px black solid;
    margin-top: 8px;
    margin-right: 16px;
    font-size: 17px;
}


main {
    position: relative;
    z-index: -1;
    background-color: rgba(255, 255, 255, 0.9);
    margin-top: 10%;
    padding: 20px 35px 35px 35px;
    border-radius: 10px;
    border: 2px solid black;
    overflow: auto;
}

nav {
    top: 0;
    left: 0;
    width: 100%
}

.divider {
    top: 0;
    width: 80%
}

.topnav {
    position: absolute;
    right: 50px;
    top: 10px;
    background-color: #333;
    overflow: visible;
    z-index: 1000;
}

.topnav a {
    color: #f2f2f2;
    text-align: center;
    text-decoration: none;
    font-size: 17px;
}

.dropdown .dropbtn {
    font-size: 17px;
    border: none;
    outline: none;
    color: white;
    background-color: inherit;
    padding: 14px 16px;
    cursor: pointer;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f9f9f9;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    right: 0;
    z-index: 2000;
}

.dropdown-content a {
    float: none;
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    text-align: left;
}

.topnav a:hover, .dropdown:hover .dropbtn {
    background-color: #555;
    color: white;
}

.dropdown-content a:hover {
    background-color: #ddd;
    color: black;
}

.dropdown.show .dropdown-content {
    display: block;
}

@media screen and (max-width: 600px) {
    .topnav {
        right: 0;
        top: 0;
        width: 100%;
        position: relative;
    }

    .dropdown .dropbtn {
        width: 100%;
        text-align: center;
    }

    .dropdown-content {
        width: 100%;
        position: relative;
    }
}

.topnav .icon {
    display: none;
}

.about_us_text {
    font-size: 20px;
    width: 50%;
    overflow: auto;
}

@media screen and (max-width: 600px) {
    #search {
        width: 100%
    }

    .about_us_text {
        font-size: 14px;
        width: 100%;
    }

    .suggestion-title {
        font-size: 16px;
    }

}

.button1 {
    background-color: black;
}

main h1 {
    font-size: 2.5em;
    color: black;
    text-align: center;
    margin-bottom: 20px;
}

.suggestion-title {
    font-size: 1.5em;
    color: black;
    text-align: center;
    margin-bottom: 30px;
}

article label {
    font-weight: bold;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

input[type="text"], input[type="number"], textarea {
    width: 95%;
    padding: 12px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus, input[type="number"]:focus, textarea:focus {
    border-color: black;
    box-shadow: 0 0 5px darkred;
    background-color: #fff;
    outline: none;
}

textarea {
    resize: none;
    height: 150px;
}

.button1 {
    background-color: darkred;
    color: white;
    font-size: 1.2em;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: block;
    margin: 0 auto;
    transition: background-color 0.3s ease, transform 0.3s ease;
}

.button1:hover {
    background-color: red;
    transform: scale(1.05);
}

#successMessage {
    font-size: 1.1em;
    color: green;
    text-align: center;
    margin-top: 20px;
}

@media screen and (max-width: 600px) {
    input[type="text"], input[type="number"], textarea {
        width: 80%;
        font-size: 0.95em;
    }

    .suggestion-title {
        font-size: 1.2em;
    }

    #modifiers {
        width: 100%;
    }

    #abilities {
        width: 100%;
    }

    #abilities label {
        display: block;
        margin-bottom: 10px;
        line-height: 1.2;
        white-space: nowrap;
    }

    #abilities input[type="checkbox"] {
        margin-right: 5px;
    }
}

.weapon-stats-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.weapon-stats-table th, .weapon-stats-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

.weapon-stats-table th {
    background-color: #f2f2f2;
    color: black;
}

.horizontal-table tr:first-child th {
    text-align: center;
    font-weight: bold;
}

.hamburger {
    position: fixed;
    top: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    z-index: 2000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.hamburger .bar {
    width: 100%;
    height: 0.4rem;
    background-color: #fff;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger .bar {
    transform-origin: left center;
}

.hamburger .bar {
    width: 100%;
    height: 0.4rem;
    background-color: #fff;
    margin: 0.15rem 0;
    transition: transform 0.3s ease, width 0.3s ease, opacity 0.3s ease;
}

.hamburger.active .bar:nth-child(1) {
    transform: translate(8px, 8px) rotate(45deg);
    width: 60%;
}

.hamburger.active .bar:nth-child(2) {
    transform: translateX(10px);
    width: 80%;
}

.hamburger.active .bar:nth-child(3) {
    transform: translate(8px, -8px) rotate(-45deg);
    width: 60%;
}

.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 250px;
    height: 100vh;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    padding: 4rem 1.5rem;
    gap: 1.5rem;
    box-shadow: -4px 0 8px rgba(0, 0, 0, 0.1);
    transition: right 0.3s ease;
    z-index: 1500;
}

.nav-menu a {
    color: #333;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
}

.nav-menu.active {
    right: 0;
}

body.menu-open {
    overflow: hidden;
}

.select-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

.select-wrapper > input[type="text"],
.select-wrapper > select {
    width: 100%;
    padding: 8px 12px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 8px;
    background-color: #f9f9f9;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.select-wrapper > select {
    background-image: url("data:image/svg+xml;utf8,\
    <svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23666' viewBox='0 0 24 24'>\
      <path d='M7 10l5 5 5-5z'/>\
    </svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 1em;
}

.select-wrapper > input[type="text"]:focus,
.select-wrapper > select:focus {
    outline: none;
    border-color: darkred;
    box-shadow: 0 0 5px rgba(139, 0, 0, 0.5);
}

.select-wrapper > input[type="text"]::placeholder {
    color: #888;
}

#weapon-form {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 20px 0;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 2500;
    inset: 0;
    overflow-y: auto;
}

#weapon-form.show {
    display: flex;
}

#weapon-form > div {
    background: #fff;
    padding: 24px;
    border-radius: 8px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

#weapon-form h2 {
    margin-top: 0;
    color: #222;
    font-size: 1.75rem;
    text-align: center;
}

#weapon-form form input[type="text"],
#weapon-form form input[type="number"],
#weapon-form form select {
    width: 100%;
    padding: 8px 12px;
    margin-top: 4px;
    margin-bottom: 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background: #fafafa;
    transition: border-color 0.2s ease;
}

#weapon-form form select[multiple] {
    min-height: 120px;
}

#weapon-form form input:focus,
#weapon-form form select:focus {
    outline: none;
    border-color: darkred;
    box-shadow: 0 0 4px rgba(139, 0, 0, 0.4);
}

#weapon-form form button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    margin-right: 8px;
}

#weapon-form form button[type="submit"] {
    background-color: darkred;
    color: #fff;
}

#weapon-form form button[type="submit"]:hover {
    background-color: red;
}

#weapon-form form button#weapon-cancel {
    background-color: #666;
    color: #fff;
}

#weapon-form form button#weapon-cancel:hover {
    background-color: #444;
}

#weapon-create {
    margin: 0 0 20px;
    padding: 10px 16px;
    background-color: darkred;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

#weapon-edit {
    margin: 0 0 20px;
    padding: 10px 16px;
    background-color: darkred;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
}

#weapon-create:hover {
    background-color: red;
}

#weapon-edit:hover {
    background-color: red;
}

#weapon-edit:disabled {
    background-color: #666;
    cursor: not-allowed;
}

#copy-stats {
    background: darkred;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

#copy-stats:hover {
    background: red;
}

#copy-message {
    margin-top: 8px;
    font-size: 0.95rem;
    min-height: 1.2em;
}

#copy-message.success {
    color: green;
}

#copy-message.error {
    color: crimson;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
    border: none;
    padding: 0;
}

.checkbox-group legend {
    font-weight: bold;
    margin-bottom: 8px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-size: 0.95em;
}

.checkbox-group input {
    margin-right: 6px;
}

.about_us_main {
    background-color: rgba(255, 255, 255, 0.92);
    margin: 8vh auto;
    padding: 40px;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.about_us_h1 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 1.5rem;
    color: #111;
}

.about_us_h2 {
    margin-top: 2rem;
    color: #222;
    font-size: 1.8rem;
    border-left: 5px solid red;
    padding-left: 12px;
}

.about_us_h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    color: #333;
}

.about_us_text {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-top: 1rem;
    color: #444;
}

.highlight {
    font-weight: bold;
    color: #d32f2f;
}

a {
    color: red;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.team-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.team-member {
    background-color: #f7f7f7;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.thanks-section {
    background-color: #fff;
    padding: 20px;
    border-left: 4px solid red;
    border-radius: 6px;
    margin-top: 1.5rem;
}

.faq p {
    margin-top: 0.5rem;
}

@media screen and (max-width: 600px) {
    main {
        padding: 25px;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .about_us_text {
        font-size: 0.95rem;
    }
}