.region {
	width: 95%;
	margin-left: 2%;
	margin-right: 1%;
	font-size: 0.4rem;
	
	border: 1px solid #dee2e6; /* Define border for the table */
	border-radius: 8px; /* Rounded corners */
	overflow: hidden; /* Ensures corners look smooth */
}

.region-table {
	width: 100%;
}

.region-table th {
	background-color: #f8f9fa; /* Light grey background for headers */
	text-transform: uppercase; /* Make headers uppercase */
	color: #6c757d; /* Subtle text color */
}

.region-table tbody tr:nth-child(even) {
    background-color: var(--bs-warning-bg-subtle);
}

.division-header {
	max-width: 94%;
	padding-top: 1em;
}

.division-presenting-sponsor-header {
	margin-bottom: 0.25rem;
}

.division-title-bracket {
	flex: 0 1 auto;
	min-width: 0;
}

.division-presenting-sponsor-logo {
	flex: 0 1 auto;
}

.presenting-sponsor-img {
	max-height: 4rem;
	max-width: 14rem;
}

thead {
	border-bottom: 1px solid #dee2e6;
}

img { 
	max-width: 100%; 
	height: auto; 
}

/* Classes */

.mailing-city {
	padding-left: 1.5em;
}
.average {
	font-weight: bold;
	text-align: center;
}
.points {
	text-align: center;
}
.popover-numbers {
	text-align: left;
	font-family: var(--bs-font-monospace);
	padding-left: 1em;
}

.gotw-container {
	padding: 1rem;
    padding-left: 2rem;
    border: 0.1rem solid #dee2e6;
    width: 33%;
    margin-left: 1rem;
    margin-right: 1rem;
    margin-bottom: 1rem;
}
.gotw-header {
	font-weight: 700;
}

.top-od-callout {
	align-items: center;
	border: 1px solid #dee2e6;
	display: flex;
	font-weight: 700;
	gap: 0.5rem;
	padding: 0.75rem 1rem;
	text-decoration: none;
}

.top-od-header-callout {
	align-items: flex-start;
	flex: 0 1 auto;
	flex-direction: column;
}

.division-header-callouts {
	margin-left: auto;
}

.top-od-page-header {
	padding-top: 1em;
}

.top-od-page-logo {
	vertical-align: middle;
}

.sponsor-img {
	height: auto;
	margin-left: auto;
	margin-right: auto;
	object-fit: contain;
}

.sponsor-img {
	padding-right: 0.5rem;
    padding-left: 0.5rem;
}

/* IDs */

#unofficial {
	text-decoration: underline;
	font-weight: bold;
}
#notes {
	text-align: left;
}

table.region-table, table.top-od-table {
	font-size: 1rem;
}

p.reg-warn-text { font-size: 0.5rem; }

@media (min-width: 310px) {
	p.reg-warn-text { font-size:0.4rem; }
	h5.top-od-header, .gotw-container {
		font-size: 0.25rem;
	}
	.sponsor-img { max-width: 64px; max-height: 24px; }
}

@media (min-width: 370px) {
	p.reg-warn-text { font-size:0.4rem; }
	h5.top-od-header, .gotw-container {
		font-size: 0.3rem;
	}
	.sponsor-img { max-width: 64px; max-height: 24px; }
}

@media (min-width: 574px) {
	p.reg-warn-text { font-size:0.5rem; }
	h5.top-od-header, .gotw-container {
		font-size: 0.55rem;
	}
	.sponsor-img { max-width: 64px; max-height: 24px; }
}

@media (min-width: 768px) {
	p.reg-warn-text { font-size:0.6rem; }
	h5.top-od-header, .gotw-container {
		font-size: 0.7rem;
	}
	.sponsor-img { max-width: 64px; max-height: 24px; }
}

@media (min-width: 1100px) {
	p.reg-warn-text { font-size:0.7rem; }
	h5.top-od-header, .gotw-container {
		font-size: 1rem;
	}

	.division-header, .division-footer, .inset-footer { padding-left: 2em; }
	.sponsor-img { max-width: 128px; max-height: 48px; }
}

@media (max-width: 768px) {
  .division-presenting-sponsor-logo {
    width: 100%;
  }

  .presenting-sponsor-img {
    max-height: 3rem;
    max-width: 10rem;
  }

  .division-header-callouts {
    justify-content: stretch;
    margin-left: 0;
    width: 100%;
  }

  .top-od-header-callout {
    align-items: center;
    text-align: center;
    width: 100%;
  }

  /* Make table horizontally scrollable */
  .region {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 auto;
  }

  .region-table {
    width: 100%;
    min-width: 600px; /* keeps numeric columns readable */
    font-size: 0.8rem;
    border-collapse: collapse;
  }

  /* Hide mailing city column */
  .region-table td:nth-child(3),
  .region-table th:nth-child(3) {
    display: none;
  }

  /* Tighten up padding & prevent wrapping for numeric columns */
  .region-table th,
  .region-table td {
    padding: 0.1rem 0.2rem;
    white-space: nowrap;
    vertical-align: middle;
  }

  /* Allow team name to wrap */
  .region-table td:nth-child(2),
  .region-table th:nth-child(2) {
    white-space: normal;
    word-break: break-word; /* break long names if needed */
    max-width: 80px; /* force column narrower to encourage wrapping */
  }

  /* Make header text slightly smaller for mobile */
  .region-table th {
    font-size: 0.75rem;
    font-weight: 600;
  }
}

/* Freeze Rank (col 1) and Team (col 2) */
.region-table th:nth-child(1),
.region-table td:nth-child(1) {
  position: sticky;
  left: 0;
  z-index: 2;
  /*background: #fff; /* match table background */*/
}

.region-table th:nth-child(2),
.region-table td:nth-child(2) {
  position: sticky;
  left: 3.5em; /* leave space equal to col 1 width */
  z-index: 2;
  /*background: #fff;*/
}

/* Ensure sticky cells inherit row background color */
.region-table tbody tr:nth-child(even) td:nth-child(1),
.region-table tbody tr:nth-child(even) td:nth-child(2) {
  background-color: var(--bs-warning-bg-subtle);
}

.region-table tbody tr:nth-child(odd) td:nth-child(1),
.region-table tbody tr:nth-child(odd) td:nth-child(2) {
  background-color: #fff; /* or whatever your default row color is */
}
