:root {
  --primary: #f5f5f5;
  --secondary: #e0e0e0;
  --accent: #424242;
  --neutral: #ffffff;
  --text: #424242;
  --radius: 10px;
  --shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 18px;
  background: var(--primary);
  font-family: "Poppins", Arial, sans-serif;
  color: var(--text);
}

button,
input,
select,
textarea {
  font-family: inherit;
}

.hidden {
  display: none;
}

#main {
  max-width: 900px;
  margin: 0 auto;
  padding: 6px;
}

.logoWrap {
  display: flex;
  justify-content: center;
  margin: 0 0 14px;
}

.topLogo {
  width: min(100%, 280px);
  height: auto;
}

#seasonHeader {
  background: var(--accent);
  color: var(--neutral);
  text-align: center;
  padding: 18px 18px;
  border-radius: var(--radius);
  margin: 0 0 20px 0;
}

.seasonTitle {
  display: block;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.25;
}

.seasonSub {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 400;
  opacity: 0.9;
}

.seasonSub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

#viewTabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.leftTabs,
.rightTabs {
  display: flex;
  gap: 8px;
}

button {
  padding: 11px 14px;
  border-radius: var(--radius);
  border: none;
  background: var(--secondary);
  color: var(--text);
  cursor: pointer;
  font-weight: 600;
}

button.active {
  background: var(--accent);
  color: var(--neutral);
}

h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

#overallControls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

#speciesControls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.speciesModeBtn {
  min-width: 130px;
}

.tableWrap {
  width: 100%;
  overflow-x: hidden;
  border-radius: var(--radius);
}

.leaderTable {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--neutral);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.leaderTable th {
  background: var(--secondary);
  padding: 12px;
  text-align: left;
  font-weight: bold;
}

.leaderTable td {
  padding: 12px;
  border-bottom: 1px solid var(--secondary);
  vertical-align: top;
  word-break: break-word;
}

.leaderTable tr:last-child td {
  border-bottom: none;
}

#monthSelectWrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 16px;
}

.monthlyTitle {
  text-align: left;
}

#monthSelect {
  width: 100%;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: none;
  background: var(--secondary);
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-align-last: center;
}

.timestamp {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  opacity: 0.7;
}

@media (max-width: 760px) {
  body {
    padding: 14px;
  }

  #seasonHeader {
    font-size: 17px;
  }

  #viewTabs {
    flex-direction: column;
    align-items: stretch;
  }

  .leftTabs,
  .rightTabs {
    width: 100%;
  }

  .leftTabs button,
  .rightTabs button {
    flex: 1;
  }

  #speciesControls .speciesModeBtn {
    flex: 1;
    min-width: 0;
  }

  #monthSelectWrap {
    align-items: center;
    justify-content: center;
    flex-direction: column;
  }

  #monthSelect {
    width: 100%;
  }

}

#speciesView .tableWrap {
  overflow-x: hidden;
}

#speciesTable {
  min-width: 0;
  table-layout: fixed;
}

#speciesTable th,
#speciesTable td {
  word-break: break-word;
}

#speciesTable th:nth-child(1),
#speciesTable td:nth-child(1) {
  width: 40%;
}

#speciesTable th:nth-child(2),
#speciesTable td:nth-child(2) {
  width: 40%;
}

#speciesTable th:nth-child(3),
#speciesTable td:nth-child(3) {
  width: 20%;
  text-align: right;
  white-space: nowrap;
}

#overallTable th:nth-child(1),
#overallTable td:nth-child(1) {
  width: 10%;
  text-align: center;
  white-space: nowrap;
}

#overallTable th:nth-child(2),
#overallTable td:nth-child(2) {
  width: 35%;
}

#overallTable th:nth-child(3),
#overallTable td:nth-child(3) {
  width: 35%;
}

#overallTable th:nth-child(4),
#overallTable td:nth-child(4) {
  width: 20%;
  text-align: right;
  white-space: nowrap;
}

#monthlyTable th:nth-child(1),
#monthlyTable td:nth-child(1) {
  width: 40%;
}

#monthlyTable th:nth-child(2),
#monthlyTable td:nth-child(2) {
  width: 40%;
}

#monthlyTable th:nth-child(3),
#monthlyTable td:nth-child(3) {
  width: 20%;
  text-align: right;
  white-space: nowrap;
}
