body {
    font-family: Arial, sans-serif;
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
    background-color: #1a1a1a;
}

.container {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 8px;
}

label {
    display: block;
    margin: 10px 0 5px;
    color: #febf11;
}

input, select {
    padding: 8px;
    margin-bottom: 20px;
}

button {
    background-color: #febf11;
    border: 2px solid #1a1a1a;
    color: black;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin: 20px 0;
}

button:hover {
    background-color: #1a1a1a;
    border: 2px solid #febf11;
    color: white;
}

h1 {
    background-color: #1a1a1a;
    border: 2px solid #febf11;
    border-radius: 10px;
    height: 60px;
    color: #febf11;
    text-align: center;
    align-content: center;
}

h2 {
    color: #febf11;
    text-align: center;
}

#tournamentTable {
    margin-top: 20px;
}

table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 20px;
}
th {
    background-color: #febf11;
    border: 1px solid #1a1a1a;
    padding: 8px;
    text-align: center;
}

td {
    border: 1px solid #febf11;
    background-color: black;
    color: white;
    padding: 8px;
    text-align: center;
}

.score-cell {
    display: inline-block;
    width: 25px;
    padding: 2px;
    text-align: center;
    border: 1px solid #ccc;
    margin: 1px;
}

.white-game {
    background-color: #f2f2f2;
}

.black-game {
    background-color: #d9d9d9;
}

#tournamentForm {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center the button and form content horizontally */
    gap: 10px; /* Spacing between rows */
}

.form-row {
    display: flex;
    gap: 10px; /* Spacing between fields */
    justify-content: center;
}

/* Fixed width for the index column (#) */
.index-col {
    width: 40px;
}

/* Flexible width for the name column */
.name-col {
    width: auto;
    text-align: left;
}

/* Fixed width for score columns */
.score-col {
    width: 30px;
}

/* Double width for the total and ranking columns */
.total-col, .ranking-col {
    width: 60px;
}


  /* General print styles */
  @media print {

    * {
        -webkit-print-color-adjust: none !important;
        print-color-adjust: none !important;
        background-image: none !important;
        background-color: transparent !important;
    }
    
    /* Hide elements that should not be printed */
    #tournamentForm, button, h1, footer {
        display: none;
    }
    
    /* Print in black and white */
    body, h1, h2, table, td, th {
        color: black;
        background: white;
    }

    /* Ensure each section starts on a new page */
    h2 {
        page-break-before: always;
    }

    /* Center content on the page */
    body {
        margin: 0;
        padding: 20px;
        text-align: center;
    }
    
    /* Adjust table styles for print */
    table {
        width: 100%;
        border-collapse: collapse;
        margin: 0 auto;
    }

    th, td {
        border: 1px solid black;
        padding: 8px;
        text-align: center;
    }
}

footer {
    color: #febf11;
    text-align: center;
    font-style: italic;
    font-size: 12px;
}

.print-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: black;
}

.hidden {
    display: none;
}