/* theme.css - The league look for every page. Load it after all other styles.
   Colors come from the league logo. */
:root {
  --hp-bg: #081120;
  --hp-panel: #0f1b2e;
  --hp-panel-raised: #15253d;
  --hp-input: #0a1424;
  --hp-line: rgba(255, 255, 255, 0.09);
  --hp-text: #f1f4f8;
  --hp-muted: #9aa9bc;
  --hp-green: #16a97e;
  --hp-gold: #d9c765;
  --hp-red: #ff8080;
  --hp-display: "Barlow Condensed", "Roboto Condensed", sans-serif;
  --surface: var(--hp-panel);
  --team-accent: #0f8a66;
}

html,
body {
  background: var(--hp-bg);
  color: var(--hp-text);
  font-family: "Barlow", "Segoe UI", sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

body > main {
  flex: 1 0 auto;
  width: 100%;
}

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

a:hover {
  color: var(--hp-gold);
}

:focus-visible {
  outline: 2px solid var(--hp-gold);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--hp-display);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

h1,
h2 {
  text-transform: uppercase;
}

h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
}

h2 {
  border-bottom: 2px solid var(--hp-green);
  font-size: 1.6rem;
  font-weight: 700;
}

h3 {
  font-size: 1.3rem;
  font-weight: 700;
}

.hp-eyebrow {
  color: var(--hp-gold);
  font-family: var(--hp-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hp-logo {
  width: 26px;
  height: 26px;
  flex: none;
  object-fit: contain;
}

.hp-text-link {
  color: var(--hp-gold) !important;
  font-size: 0.9rem;
  font-weight: 600;
}

.hp-text-link:hover {
  text-decoration: underline !important;
}

/* Page layout */
.page-main {
  margin: 0 auto;
  max-width: 1280px;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.page-head {
  background: none;
  border: 0;
  margin-bottom: 1.5rem;
  padding: 0;
  text-align: left;
}

.page-head p:last-child:not(.hp-eyebrow) {
  color: var(--hp-muted);
  margin-top: 0.35rem;
}

/* Navigation */
.navbar {
  background: #050c18;
  border-bottom: 2px solid var(--hp-green);
  justify-content: space-between;
  padding: 0.6rem clamp(1rem, 3vw, 2.5rem);
}

.navbar-left {
  color: var(--hp-text);
}

.league-title {
  color: var(--hp-text);
  font-family: var(--hp-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.navbar-links {
  align-items: center;
  font-family: var(--hp-display);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.navbar-links a {
  font-weight: 600;
}

.navbar-links a:hover {
  color: var(--hp-gold);
  text-decoration: none;
}

.navbar-links a.active {
  border-bottom: 2px solid var(--hp-gold);
  color: var(--hp-gold);
  font-weight: 600;
}

.navbar-left.active {
  border-bottom: 0;
}

.dropdown-content {
  background: #050c18;
  border-color: var(--hp-line);
  text-transform: none;
}

.division-column h4 {
  border-color: var(--hp-line);
  color: var(--hp-gold);
}

.division-column a:hover {
  color: var(--hp-gold);
}

/* Buttons */
.hp-button {
  align-self: center;
  background: var(--hp-green);
  border: 2px solid var(--hp-green);
  border-radius: 6px;
  color: #04120d !important;
  display: inline-block;
  font-family: var(--hp-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.55rem 1.4rem;
  text-transform: uppercase;
  transition: background 0.15s, border-color 0.15s;
}

.hp-button:hover {
  background: var(--hp-gold);
  border-color: var(--hp-gold);
}

.hp-button.is-outline {
  background: transparent;
  color: var(--hp-text) !important;
}

.hp-button.is-outline:hover {
  background: var(--hp-gold);
  color: #04120d !important;
}

button,
.btn,
.tab-btn,
.tab-button,
.carousel-controls button {
  background: var(--hp-panel-raised);
  border: 1px solid var(--hp-line);
  border-radius: 6px;
  color: var(--hp-text);
  cursor: pointer;
  font-family: var(--hp-display);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.45rem 0.95rem;
  transform: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

button:hover:not(:disabled),
.btn:hover,
.tab-btn:hover,
.tab-button:hover {
  background: var(--hp-panel-raised);
  border-color: var(--hp-gold);
  color: var(--hp-gold);
  transform: none;
}

.btn.primary,
button.tab.active,
.tab-btn.active,
#saveAllBtn {
  background: var(--hp-green);
  border-color: var(--hp-green);
  color: #04120d;
  outline: 0;
}

.btn.primary:hover,
button.tab.active:hover,
.tab-btn.active:hover,
#saveAllBtn:hover:not(:disabled) {
  background: var(--hp-gold);
  border-color: var(--hp-gold);
  color: #04120d;
}

.tab-button.active,
.tab-button.active:hover {
  background: var(--team-accent);
  border-color: var(--team-accent);
  color: #fff;
}

/* Form fields */
input,
select,
textarea {
  background: var(--hp-input);
  border: 1px solid var(--hp-line);
  border-radius: 6px;
  color: var(--hp-text);
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.45rem 0.6rem;
}

label {
  color: var(--hp-muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.hamburger {
  color: var(--hp-text);
  font-size: 1.5rem;
}

/* Panels */
.card,
.playoff-box,
.team-stats-section,
.team-stats-entry,
.stat-card,
.standings-card,
.schedule-container,
.leaderboard-edit,
.rules-page .rules-toc,
.rules-page .rules-card,
.auth-wrap {
  background: var(--hp-panel);
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  box-shadow: none;
}

/* Tables */
table th {
  font-family: var(--hp-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.coaches-table thead th,
.admin-table thead th,
.editable-table thead th,
.team-stats-table th,
.player-stats-table th,
.stat-card th,
.standings-card th {
  background: var(--hp-panel-raised);
  border-color: var(--hp-line);
  color: var(--hp-text);
}

.coaches-table tbody td,
.admin-table tbody td,
.editable-table td,
.team-stats-table td,
.player-stats-table td,
.stat-card td,
.standings-card td {
  border-color: var(--hp-line);
  color: var(--hp-text);
}

.coaches-table td a,
.team-link,
.opponent-link,
.player-link,
.score-link,
.game-row a,
.schedule-item a,
.view-link {
  color: var(--hp-gold);
}

.coaches-table td a:hover,
.team-link:hover,
.opponent-link:hover,
.player-link:hover,
.score-link:hover,
.game-row a:hover,
.schedule-item a:hover,
.view-link:hover {
  color: var(--hp-gold);
  text-decoration: underline;
}

/* Schedule */
.schedule-filters-bar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin-bottom: 1.5rem;
}

.schedule-filters-bar label {
  margin-right: 0.35rem;
}

#gamesContainer {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}

#gamesContainer > .score-meta {
  grid-column: 1 / -1;
  text-align: left;
}

.game-card {
  background: var(--hp-panel);
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  text-align: center;
}

.game-card:hover {
  border-color: var(--hp-gold);
}

.game-card .score-row {
  align-items: center;
  display: flex;
  font-family: var(--hp-display);
  font-size: 1.2rem;
  font-weight: 700;
  gap: 0.8rem;
  justify-content: center;
}

.game-card .team-logo {
  height: 38px;
  object-fit: contain;
  width: 38px;
}

.score-text {
  font-family: var(--hp-display);
  font-size: 1.6rem;
  font-weight: 800;
}

.score-meta {
  color: var(--hp-muted);
  font-size: 0.85rem;
  margin-top: 0.3rem;
}

.view-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 0.45rem;
}

/* Team page */
.team-header {
  background-image: linear-gradient(100deg, rgba(8, 17, 32, 0.2), rgba(8, 17, 32, 0.82));
  border: 0;
  border-radius: 12px;
  box-shadow: none;
  margin: 0 0 1.25rem;
  max-width: none;
  padding: clamp(1rem, 3vw, 2rem);
}

.team-header-inner {
  gap: clamp(1rem, 3vw, 2rem);
  width: 100%;
}

.team-logo-container img {
  height: auto;
  max-width: 100%;
  object-fit: contain;
  width: clamp(96px, 14vw, 150px);
}

.team-meta {
  flex: 1;
  margin: 0;
  min-width: 0;
  padding: 0;
}

.team-meta .hp-eyebrow {
  color: var(--hp-text);
}

.team-facts,
.team-cap dl {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 0.75rem;
}

.team-facts dt,
.team-cap dt {
  color: rgba(241, 244, 248, 0.72);
  font-size: 0.8rem;
}

.team-facts dd,
.team-cap dd {
  font-family: var(--hp-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.team-cap {
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  flex: none;
  padding-left: clamp(1rem, 3vw, 2rem);
}

.team-cap > p {
  font-family: var(--hp-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.team-cap dl {
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.4rem;
}

.result-badge {
  border-radius: 5px;
  color: #04120d;
  display: inline-block;
  font-family: var(--hp-display);
  font-weight: 800;
  line-height: 1.6rem;
  text-align: center;
  width: 1.6rem;
}

.is-W {
  background: #54dcb0;
}

.is-L {
  background: var(--hp-red);
}

.is-T {
  background: var(--hp-gold);
}

.team-tabs-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-start;
  margin: 0 0 1.25rem;
}

.team-overview {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}

.team-overview-side,
.team-overview-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
}

.team-overview h2 {
  margin-bottom: 0.65rem;
}

.team-card-head {
  align-items: baseline;
  border-bottom: 2px solid var(--hp-green);
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.team-card-head h2 {
  border: 0;
  margin-bottom: 0;
}

.team-mini-logo {
  flex: none;
  height: 24px;
  object-fit: contain;
  vertical-align: middle;
  width: 24px;
}

.team-next-logo {
  flex: none;
  height: 40px;
  object-fit: contain;
  width: 40px;
}

.next-game-row {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.next-game-row em {
  color: var(--hp-muted);
  font-style: normal;
  margin-left: auto;
}

.result-row {
  align-items: center;
  border-bottom: 1px solid var(--hp-line);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: auto minmax(0, 1fr) auto;
  padding: 0.45rem 0;
}

.result-row:last-child {
  border-bottom: 0;
}

.result-row em {
  color: var(--hp-muted);
  font-size: 0.8rem;
  font-style: normal;
  grid-column: 2 / -1;
}

.team-table {
  border-collapse: collapse;
  width: 100%;
}

.team-table th,
.team-table td {
  border-bottom: 1px solid var(--hp-line);
  padding: 0.5rem 0.6rem;
  text-align: left;
  white-space: nowrap;
}

.team-table thead th {
  background: var(--hp-panel-raised);
}

.team-table tr:last-child td {
  border-bottom: 0;
}

.is-highlighted td {
  background: color-mix(in srgb, var(--hp-gold) 13%, transparent);
}

.ranking-number {
  color: var(--hp-gold);
  font-family: var(--hp-display);
  font-weight: 700;
}

.ranking-value {
  font-family: var(--hp-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.team-rank-groups {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-rank-groups h3 {
  color: var(--hp-gold);
  margin-bottom: 0.25rem;
}

.rank-row {
  align-items: center;
  border-bottom: 1px solid var(--hp-line);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto 2.6rem;
  padding: 0.5rem 0;
}

.rank-row strong {
  font-family: var(--hp-display);
  font-size: 1.1rem;
}

.rank-row em {
  color: var(--hp-gold);
  font-family: var(--hp-display);
  font-size: 1.1rem;
  font-style: normal;
  font-weight: 700;
  text-align: right;
}

.team-schedule {
  background: var(--hp-panel);
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  overflow: hidden;
}

.team-schedule > .mini {
  padding: 1rem;
}

.team-schedule-row {
  align-items: center;
  border-bottom: 1px solid var(--hp-line);
  display: grid;
  gap: 0.75rem;
  grid-template-columns: 11rem minmax(0, 1.6fr) minmax(0, 1fr) 7rem 3.5rem;
  min-height: 3rem;
  padding: 0.45rem 1rem;
}

.team-schedule-row:last-child {
  border-bottom: 0;
}

.team-schedule-row.is-bye {
  color: var(--hp-muted);
}

.team-schedule-week {
  font-family: var(--hp-display);
  font-size: 1.05rem;
  font-weight: 700;
}

.team-schedule-opponent {
  align-items: center;
  display: flex;
  font-weight: 600;
  gap: 0.5rem;
  min-width: 0;
}

.team-schedule-place {
  color: var(--hp-muted);
  flex: none;
  font-weight: 500;
  width: 1.1rem;
}

.team-schedule-coach,
.team-schedule-note {
  color: var(--hp-muted);
  font-size: 0.9rem;
}

.team-schedule-coach {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-schedule-recap a {
  color: var(--hp-gold);
  font-size: 0.9rem;
  font-weight: 600;
}

/* League rankings */
.ranking-card {
  overflow-x: auto;
  padding: 0;
}

.ranking-filter {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.team-cell {
  align-items: center;
  display: flex;
  gap: 0.5rem;
}

.ranking-table .team-logo {
  height: 28px;
  object-fit: contain;
  width: 28px;
}

.stats-container {
  max-width: none;
  padding: 0;
}

.stats-container h2 {
  text-align: left;
}

.stats-section h3 {
  border-color: var(--team-accent);
  color: var(--hp-text);
}

.stats-table {
  overflow-x: auto;
}

.player-stats-table {
  background: var(--hp-panel);
  border-radius: 10px;
  margin: 0;
}

.player-stats-table th,
.player-stats-table td {
  padding: 0.55rem 0.7rem;
  white-space: nowrap;
}

.player-stats-table th:hover {
  color: var(--hp-gold);
}

/* Game recap */
.game-container > h1 {
  margin-bottom: 1.25rem;
}

.recap-summary-flex {
  background: linear-gradient(100deg, #0d2a55, #0c1728 50%, #0b4a3e);
  border: 1px solid var(--hp-line);
  border-radius: 12px;
  max-width: none;
  padding: clamp(1rem, 3vw, 1.75rem);
}

.recap-city,
.recap-user,
.recap-record {
  color: rgba(241, 244, 248, 0.75);
  font-size: 0.9rem;
}

.recap-name {
  color: var(--hp-text);
  font-family: var(--hp-display);
  font-size: 1.8rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.recap-score-box .score-line {
  align-items: center;
  display: flex;
  gap: 0.75rem;
}

.recap-score-box .score-value {
  background: none;
  font-family: var(--hp-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  padding: 0;
}

.recap-score-box .vs {
  color: var(--hp-muted);
}

.recap-tabs {
  justify-content: flex-start;
  margin: 1.5rem 0 0;
}

#teamStatsContainer.active {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.team-stats-entry {
  max-width: none;
}

.team-stats-entry h3 {
  margin-bottom: 0.4rem;
}

.recap-players.active {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.recap-name a:hover {
  color: var(--hp-gold);
}

.team-stats-table th,
.team-stats-table td {
  border-left: 0;
  border-right: 0;
}

/* Stats page */
.stats-source {
  color: var(--hp-muted);
  font-size: 0.9rem;
  margin-top: -0.5rem;
}

.stat-card[hidden],
.stat-grid[hidden],
.stats-page h3[hidden] {
  display: none;
}

.stat-name {
  display: table-cell;
}

.stat-name img.logo {
  margin-right: 0.4rem;
  vertical-align: middle;
}

.stat-card,
.standings-card {
  overflow-x: auto;
  padding: 0;
}

.stat-card td:last-child,
.stat-card th:last-child {
  text-align: right;
  white-space: nowrap;
}

.stats-page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.stats-controls,
.tabbar {
  flex-wrap: wrap;
}

.stats-page section.tab > h2 {
  margin-bottom: 1rem;
}

.stats-page section.tab > h3 {
  color: var(--hp-gold);
}

.stat-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.stat-card h3,
.standings-card h3 {
  border-color: var(--hp-line);
  color: var(--hp-gold);
  font-size: 1.1rem;
}

.stat-card .empty,
.standings-card .empty {
  color: var(--hp-muted);
}

.standings-grid {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 480px), 1fr));
}

.standings-card {
  overflow-x: auto;
}

.award-card {
  background: var(--hp-panel);
  border: 1px solid var(--hp-line);
}

.award-card h3 {
  color: var(--hp-gold);
}

.award-card:hover {
  border-color: var(--hp-gold);
}

.award-position,
.award-stats {
  opacity: 1;
  color: var(--hp-muted);
}

/* Trade calculator */
.trade-wrap {
  max-width: 1280px;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.trade-wrap > .card,
.trade-grid {
  margin-bottom: 1rem;
}

.totals,
.result {
  background: var(--hp-panel-raised);
}

.divider {
  background: var(--hp-line);
}

.asset {
  border-color: var(--hp-line);
}

.result.good {
  color: #54dcb0;
}

.result.bad {
  color: var(--hp-red);
}

.mini,
.hint,
.mini-note {
  color: var(--hp-muted);
  opacity: 1;
}

.btn.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Coaches */
.wrap {
  max-width: 1280px;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
  margin: 0 auto;
}

.coaches-card {
  overflow-x: auto;
  padding: 0;
}

.coaches-table .team-logo {
  background: none;
}

.coaches-table td:first-child {
  font-weight: 600;
}

/* Rules */
.rules-wrap.rules-page {
  margin: 0 auto;
  max-width: 1280px;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.rules-page .rules-toc-list a,
.rules-page .rules-toc-list a:visited {
  color: var(--hp-text);
}

.rules-page .rules-toc-list a:hover {
  background: var(--hp-panel-raised);
  color: var(--hp-gold);
}

.rules-page .toc-title,
.rules-page .rules-card > h2 {
  color: var(--hp-gold);
}

.rules-page .search input {
  background: var(--hp-input);
  border-color: var(--hp-line);
}

.rules-page details.rule {
  background: var(--hp-bg);
  border-color: var(--hp-line);
}

.rules-page details.rule[open] > summary {
  background: var(--hp-panel-raised);
  border-color: var(--hp-line);
}

.rules-page .anchor {
  color: var(--hp-gold);
}

.rules-page mark {
  background: var(--hp-gold);
  color: #04120d;
}

.rules-page .muted {
  color: var(--hp-muted);
}

/* Sign in */
body > main.auth-wrap {
  flex: 0 0 auto;
  margin: 3rem auto;
  padding: 1.5rem;
  width: min(420px, calc(100% - 2rem));
}

.auth-wrap h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
}

.err {
  color: var(--hp-red);
}

/* Admin */
.admin-button {
  display: none;
}

html.is-admin .admin-button {
  display: list-item;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel .grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.panel .card h2 {
  margin-bottom: 0.75rem;
}

.list {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.pair {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 1fr 1fr auto;
}

.pair input {
  min-width: 0;
}

.admin-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.export-toolbar {
  align-items: flex-end;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.export-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.export-filter {
  align-items: center;
  display: flex;
  gap: 0.4rem;
}

.export-summary {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin-bottom: 1rem;
}

.export-tile {
  background: var(--hp-panel);
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

.export-tile.is-alert {
  border-color: var(--hp-red);
}

.export-tile strong {
  display: block;
  font-family: var(--hp-display);
  font-size: 2rem;
  line-height: 1.1;
}

.export-tile span {
  color: var(--hp-muted);
  font-size: 0.85rem;
}

.export-legend {
  margin-bottom: 1rem;
}

.export-legend span {
  margin-left: 0.75rem;
}

.export-legend span:first-child {
  margin-left: 0;
}

.export-section {
  margin-bottom: 1.5rem;
}

.export-section h3 {
  color: var(--hp-gold);
  margin-bottom: 0.5rem;
}

.export-scroll {
  overflow-x: auto;
}

.export-table {
  background: var(--hp-panel);
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 840px;
  width: 100%;
}

.export-table th,
.export-table td {
  border-bottom: 1px solid var(--hp-line);
  padding: 0.45rem 0.6rem;
  text-align: left;
  white-space: nowrap;
}

.export-table thead th {
  background: var(--hp-panel-raised);
}

.export-table .export-cell,
.export-table thead th:not(:first-child):not(:last-child) {
  text-align: center;
}

.export-row.is-upcoming th,
.export-row.is-upcoming td {
  color: var(--hp-muted);
}

.export-ok {
  color: #54dcb0;
  font-weight: 700;
}

.export-partial {
  color: var(--hp-gold);
  font-weight: 700;
}

.export-missing {
  color: var(--hp-red);
  font-weight: 700;
}

.export-none {
  color: var(--hp-muted);
}

.export-status {
  font-weight: 600;
}

.export-status.is-complete {
  color: #54dcb0;
}

.export-status.is-missing {
  color: var(--hp-red);
}

.export-status.is-upcoming {
  color: var(--hp-muted);
}

.export-detail td {
  color: var(--hp-gold);
  font-size: 0.85rem;
  white-space: normal;
}

.admin-container {
  margin: 0 auto;
  max-width: 1280px;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem) 3rem;
}

.admin-container .filters {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin: 1rem 0;
}

.editable-table {
  border-collapse: collapse;
  width: 100%;
}

.editable-table th,
.editable-table td {
  padding: 0.45rem;
}

.tree {
  background: var(--hp-input);
  border-color: var(--hp-line);
}

.tree-node:hover {
  background: var(--hp-panel-raised);
}

.key-pill {
  border-color: var(--hp-line);
}

/* League news */
.news-card {
  background: var(--hp-panel);
  border: 1px solid var(--hp-line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
}

.news-card:hover {
  border-color: var(--hp-gold);
}

.news-title {
  font-family: var(--hp-display);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.15;
}

.news-excerpt {
  color: var(--hp-muted);
  font-size: 0.95rem;
}

.news-card-foot {
  align-items: center;
  color: var(--hp-muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.85rem;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.4rem;
}

.news-team {
  align-items: center;
  display: inline-flex;
  font-size: 0.9rem;
  font-weight: 600;
  gap: 0.4rem;
}

.news-list {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.news-story {
  max-width: 800px;
}

.news-story-meta {
  color: var(--hp-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.news-story .news-team {
  margin-bottom: 0.75rem;
}

.news-paragraph {
  line-height: 1.65;
  margin-bottom: 1rem;
  white-space: pre-line;
}

.news-filter {
  align-items: center;
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.news-filter[hidden] {
  display: none;
}

.news-admin {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
}

.news-admin h2 {
  margin-bottom: 0.75rem;
}

.news-field {
  display: grid;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  min-width: 0;
}

.news-field-row {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.news-field textarea {
  resize: vertical;
  width: 100%;
}

#newsStatus {
  margin-top: 0.6rem;
}

.news-admin-row {
  align-items: center;
  border-bottom: 1px solid var(--hp-line);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 0.6rem 0;
}

.news-admin-row strong,
.news-admin-row small {
  display: block;
}

.news-admin-row small {
  color: var(--hp-muted);
}

.news-admin-row .btn {
  font-size: 0.9rem;
  padding: 0.25rem 0.6rem;
}

/* Pending trades */
.pending-list {
  display: grid;
  gap: 1rem;
}

.pending-trade .team-card-head h2 {
  font-size: 1.4rem;
}

.pending-votes {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0.75rem 0;
}

.pending-vote {
  background: var(--hp-panel-raised);
  border-left: 3px solid var(--hp-line);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
}

.pending-vote.is-approve {
  border-left-color: #54dcb0;
}

.pending-vote.is-deny {
  border-left-color: var(--hp-red);
}

.pending-vote strong {
  display: block;
  font-family: var(--hp-display);
  font-size: 1.8rem;
  line-height: 1.1;
}

.pending-vote small {
  color: var(--hp-muted);
  display: block;
  margin-top: 0.15rem;
}

.pending-sides {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pending-side h3 {
  color: var(--hp-gold);
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.pending-side li {
  display: flex;
  font-size: 0.92rem;
  gap: 0.75rem;
  justify-content: space-between;
}

.pending-side li span {
  color: var(--hp-muted);
}

.pending-side p {
  font-size: 0.92rem;
  margin-top: 0.25rem;
}

.pending-note {
  border-top: 1px solid var(--hp-line);
  color: var(--hp-muted);
  font-size: 0.92rem;
  margin-top: 0.75rem;
  padding-top: 0.6rem;
}

/* Discord tools */
.discord-table input {
  min-width: 13rem;
  width: 100%;
}

.is-invalid {
  border-color: var(--hp-red);
}

.trade-submit h2 {
  margin-bottom: 0.5rem;
}

.trade-submit-fields {
  display: grid;
  gap: 0 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 0.75rem;
}

.trade-submit textarea {
  width: 100%;
}

#tradeSubmitStatus {
  margin-top: 0.6rem;
}

/* Footer */
.hp-footer {
  background: #050c18;
  border-top: 2px solid var(--hp-green);
  color: var(--hp-muted);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 1.75rem clamp(1rem, 3vw, 2.5rem);
}

.hp-footer-top {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin: 0 auto 1rem;
  max-width: 1200px;
}

.hp-footer .hp-footer-top nav {
  background: none;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  font-family: var(--hp-display);
  font-size: 1rem;
  font-weight: 600;
  gap: 0.5rem 1.5rem;
  justify-content: flex-start;
  letter-spacing: 0.05em;
  padding: 0;
  text-transform: uppercase;
}

.hp-footer-top a {
  color: var(--hp-text);
}

.hp-footer-top a:hover {
  color: var(--hp-gold);
}

.hp-footer > p {
  margin: 0 auto;
  max-width: 1200px;
}

/* Smaller screens */
@media (max-width: 900px) {
  .news-admin,
  .news-field-row,
  .pending-sides,
  .trade-submit-fields,
  .team-overview,
  .team-rank-groups,
  .trade-grid,
  .recap-players.active,
  #teamStatsContainer.active {
    grid-template-columns: minmax(0, 1fr);
  }

  #gamesContainer {
    grid-template-columns: minmax(0, 1fr);
  }

  .leaderboard-edit .grid,
  .panel .grid,
  .grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 768px) {
  .navbar {
    align-items: flex-start;
  }

  .navbar-left {
    justify-content: flex-start;
    padding-right: 2.25rem;
  }

  .league-title {
    font-size: 1.15rem;
    line-height: 1.2;
  }

  .navbar-links {
    gap: 0.6rem;
  }

  .dropdown:focus-within .dropdown-content {
    display: flex;
  }

  .team-header-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .team-cap {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
    padding: 0.75rem 0 0;
    width: 100%;
  }

  .team-cap dl {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.6rem 1.75rem;
  }

  .team-schedule-row {
    grid-template-columns: 6.5rem minmax(0, 1fr) auto;
  }

  .team-schedule-coach,
  .team-schedule-recap {
    display: none;
  }

  .team-schedule-row.is-bye {
    grid-template-columns: 6.5rem minmax(0, 1fr);
  }

  .recap-summary-flex {
    justify-content: center;
    text-align: center;
  }

  .recap-team-info,
  .recap-team-info.right-align {
    min-width: 0;
    text-align: center;
  }

  .recap-team-side {
    display: none;
  }

  .recap-score-box {
    order: -1;
    width: 100%;
  }
}
