body {
    background-color: #f9f9f9;
    color: black;
}

/* Grundlegende typografische Formatierungen */
body {
    font-family: Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    padding: 0;
}

div {
    margin: 20px;
    padding: 20px;

    border-radius: 8px;
    background-color: #f9f9f9;
}

/* Einheitliche Formatierung für Überschriften */
h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    color: #333;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

/* Tabellen-Design */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1em;
    table-layout: fixed;
}

/* Scoreboard: flexible Spaltenbreite */
#scoreboardTable {
    table-layout: fixed;    /* changed from auto to fixed to allow percentage widths */
    width: 100%;
}

/* Scoreboard table as card */
#scoreboardTable {
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden; /* round corners on inner borders */
    box-shadow: 0 6px 24px rgba(0,0,0,.06);
    background: #fff;
}

#scoreboardTable th,
#scoreboardTable td {
    border-color: #eee; /* softer borders */
    padding: 10px 12px;
}

/* Set percentage widths for columns */
#scoreboardTable th:nth-child(1),
#scoreboardTable td:nth-child(1) {
    width: 6%;
    text-align: center;
}

#scoreboardTable th:nth-child(2),
#scoreboardTable td:nth-child(2) {
    width: 44%;
    min-width: 150px;
    text-align: left;
    white-space: normal; /* removed nowrap to allow wrapping */
}

#scoreboardTable th:nth-child(n+3),
#scoreboardTable td:nth-child(n+3) {
    width: 12%;
    text-align: center;
}

/* Zebra rows for readability */
#scoreboardTable tbody tr:nth-child(odd) { background: #fff; }
#scoreboardTable tbody tr:nth-child(even) { background: #fcfcfc; }

/* Reduce generic div padding around scoreboard blocks */
div:has(> #scoreboardTable) {
    background: transparent;
    padding: 0;
    margin: 20px auto;
    max-width: 1000px; /* align with other pages' width */
}

/* Remove white-space nowrap for Name column only */
/* Already handled by white-space: normal above */

/* Inner scorecard table styling */
.inner-scorecard {
    width: 100% !important;
    table-layout: fixed;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden; /* rounded corners visible */
    box-sizing: border-box;
    margin: 0; /* spacing handled by parent cell padding to avoid overflow */
    --side-col: 84px; /* label + sum columns width */
}

.inner-scorecard th,
.inner-scorecard td {
    width: auto;
    text-align: center;
    white-space: normal;   /* override global nowrap */
    padding: 10px 12px;    /* match outer table padding */
}

/* Scorecard column sizing */
.inner-scorecard th:first-child,
.inner-scorecard td:first-child {
    width: var(--side-col);
    text-align: left;
}

.inner-scorecard th:last-child,
.inner-scorecard td:last-child {
    width: var(--side-col);
    text-align: center;
}

.inner-scorecard th:not(:first-child):not(:last-child),
.inner-scorecard td:not(:first-child):not(:last-child) {
    width: calc((100% - (2 * var(--side-col))) / 18);
    text-align: center;
}

/* Remove padding around embedded scorecard so left/right spacing is equal */
#scoreboardTable td:has(> .inner-scorecard) { padding: 8px; }
#scoreboardTable td:has(> .inner-scorecard) { box-sizing: border-box; }

/* Pos.-Spalte: fixe Zeichenbreite statt Prozent */
/* Removed fixed ch widths and replaced with percentages above */

/* Name-Spalte bekommt den restlichen Platz */
/* Already handled above */

/* Zahlen-Spalten: feste Zeichenbreite, stabil auf großen Screens */
/* Replaced with percentage widths above */

@supports (width: min-content) {
    /* Keine zusätzlichen Overrides notwendig – feste ch-Breiten sind stabil */
}

th, td {
    border: 1px solid #ccc;
    padding: 0.5em;
    text-align: center;
    white-space: nowrap;
}

th {
    background-color: #f0f0f0;
    font-weight: bold;
}

.hole-navigation {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
}

/* Buttons */
button {
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 0.5em 1em;
    font-size: 1em;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease-in-out;
}

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

html {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    font-weight: lighter;
}

img.logo {
    display: block;
    max-width: 140px;
    height: auto;
    margin: 24px auto 8px;
}
ul, ol {
    list-style-type: none;
    padding-left: 0;
}
select {
    font-size: 1.5em; /* Match h2 size */
    padding: 0.5em;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: white;
    color: black;
}
select {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid #ddd;
}
label {
    font-size: 1.5em; /* Match select and h2 size */
    margin-right: 0.5em;
}

.player-entry {
    padding: 10px;
    border: 1px solid #ccc;
    margin-bottom: 5px;
    cursor: pointer;
}
.player-entry.selected {
    background-color: #cce5ff;
}

/* Flight overview */
.player-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border: 1px solid #ccc;
    margin: 4px 0;
    border-radius: 5px;
    cursor: pointer;
}

.player-item.selected {
    background-color: #e0f0ff;
}

.remove-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
}
/* Links styling */
a {
    font-size: 1.17em; /* Approximate h3 size */
    text-decoration: none;
    color: #007BFF;
}

a:hover {
    text-decoration: underline;
}

.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
}
