body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
 
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.4);
    padding: 20px;
}


header {
    background-color: #602463;
    border-bottom: 3px solid #B79C44;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 50px;
}

header img {
    height: 34px;
    width: auto;
    display: block;
}

.header-title {
    color: #fff;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.season-select {
    margin-left: auto;
    flex-shrink: 0;
    background: #4a1d50;
    color: #fff;
    border: 1px solid #B79C44;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
}

.season-select:hover {
    background: #58225f;
}

/* Coming-soon splash for a new season with no data yet */
.season-splash {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 20px;
}

/* Author-origin display:flex above always beats the UA's [hidden]{display:none}
   regardless of specificity, so toggling the hidden attribute alone does nothing --
   this override is required for hideSeasonSplash() to actually hide the card. */
.season-splash[hidden] {
    display: none;
}

.season-splash-card {
    background: #fff;
    border: 1px solid #e0d0e0;
    border-top: 4px solid #602463;
    border-radius: 10px;
    padding: 3em 2.5em;
    max-width: 480px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 18px rgba(96, 36, 99, 0.12);
}

.season-splash-icon {
    font-size: 2.6em;
    margin-bottom: 0.3em;
}

.season-splash-card h1 {
    margin: 0 0 0.4em;
    color: #602463;
    font-size: 1.4em;
    text-align: center; /* global h1 rule sets text-align: left, overriding inheritance */
}

.season-splash-card p {
    color: #555;
    line-height: 1.5;
    margin: 0 0 1.5em;
}

.season-splash-btn {
    background: #602463;
    color: #fff;
    border: 2px solid #602463;
    border-radius: 24px;
    padding: 10px 22px;
    font-size: 0.9em;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.season-splash-btn:hover {
    background: #fff;
    color: #602463;
}

.season-splash-btn:disabled {
    display: none;
}

h1 {
    font-size: 1.6em;
    color: #333;
    text-align: left;
    margin-bottom: 0.5em;
    margin-top: 1.5em;
}

footer {
    border-top: 3px solid #B79C44;
    background-color: #602463;
    color: #fff;
    padding: 1em;
    text-align: center;
}

.footer-content {
    max-width: 1140px;
    margin: 0 auto;
    padding: 3rem 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.footer-social {
    margin-bottom: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
}
th, td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}
th {
    background-color: #602463;
    color: white;
}
tr:nth-child(even) {
    background-color: #f2f2f2;
}
tr:hover {
    background-color: #ddd;
}

/* Rank change indicators */
.rank-change {
    text-align: center;
    font-weight: bold;
    min-width: 60px;
}

.rank-up {
    color: #28a745;
    font-weight: bold;
}

.rank-down {
    color: #dc3545;
    font-weight: bold;
}

.rank-same {
    color: #6c757d;
}

tr.high-week td {
    background-color: #fff8e1;
    font-weight: bold;
}

tr.low-week td {
    background-color: #fdecea;
    font-weight: bold;
}

td.qualifying-cell {
    font-weight: bold;
}

tr.seed-locked td {
    background-color: #f0faf0;
}

tr.seed-wildcard td {
    background-color: #f0f4ff;
}

tr.seed-eliminated td {
    background-color: #f9f9f9;
    color: #888;
}

tr.eliminated-divider td {
    border-top: 2px solid #602463;
}

/* Stat cards */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 0.5em 0 1.5em;
}

@media (max-width: 600px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-card {
  background: #f9f4f9;
  border: 1px solid #e0d0e0;
  border-top: 3px solid #602463;
  border-radius: 6px;
  padding: 12px 14px;
  min-width: 0;
}

.stat-card-icon {
  font-size: 1.3em;
  margin-bottom: 4px;
}

.stat-card-label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #888;
  font-weight: 600;
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 0.95em;
  font-weight: 700;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-card-sub {
  font-size: 0.8em;
  color: #666;
  margin-top: 3px;
}

/* Playoff odds */
.odds-table {
  border-collapse: collapse;
  width: 100%;
}

.odds-table td {
  padding: 7px 8px;
  border: none;
  border-bottom: 1px solid #eee;
  background: transparent;
  vertical-align: middle;
}

.odds-table tr:nth-child(even) td {
  background-color: transparent;
}

.odds-table tr:hover td {
  background-color: #f9f4f9;
}

.odds-team-cell {
  font-weight: 600;
  font-size: 0.9em;
  white-space: nowrap;
  width: 1%;
}

.odds-record-cell {
  font-size: 0.82em;
  color: #666;
  white-space: nowrap;
  width: 1%;
}

.odds-bar-cell {
  width: 100%;
  min-width: 80px;
}

.odds-bar-stacked {
  display: flex;
  height: 12px;
  background: #eee;
  border-radius: 4px;
  overflow: hidden;
}

.odds-bar-seg {
  height: 100%;
  transition: width 0.4s ease;
}

.odds-pct-cell {
  font-size: 0.88em;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  width: 1%;
}

.odds-status-cell {
  white-space: nowrap;
  width: 1%;
}

.odds-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.odds-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78em;
  color: #555;
}

.odds-legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  display: inline-block;
}

.odds-badge {
  font-size: 0.75em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.odds-clinched { background: #d4edda; color: #155724; }
.odds-eliminated { background: #f8d7da; color: #721c24; }
.odds-bubble { background: #e8d8e8; color: #602463; }

.odds-placeholder {
  color: #888;
  font-style: italic;
  font-size: 0.9em;
  margin: 0.5em 0;
}

/* League analysis */
.analysis-card {
  background: #f9f4f9;
  border-left: 4px solid #602463;
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  margin-bottom: 1em;
}

.analysis-body {
  color: #333;
  font-size: 0.95em;
  line-height: 1.7;
}

.analysis-body p {
  margin: 0 0 0.8em;
}

.analysis-body p:last-child {
  margin-bottom: 0;
}

.analysis-body strong {
  color: #602463;
  font-weight: 700;
}

.analysis-meta {
  margin-top: 12px;
  font-size: 0.75em;
  color: #999;
  border-top: 1px solid #e0d0e0;
  padding-top: 8px;
}

/* Week pill selector */
.week-track-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 12px;
    margin-bottom: 1em;
    position: sticky;
    top: 53px; /* header height (50px) + border (3px) */
    z-index: 90;
    background-color: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid #e0d0e0;
    margin-left: -20px;
    margin-right: -20px;
    padding-left: 20px;
    padding-right: 20px;
}

.week-track {
    display: flex;
    gap: 6px;
    padding: 4px 1em;
    min-width: max-content;
    margin: 0 auto;
}

.week-pill {
    background: #f5eef5;
    border: 2px solid #602463;
    color: #602463;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    line-height: 1.2;
}

.week-pill.active {
    background: #602463;
    color: #fff;
}

.week-pill:hover:not(.active) {
    background: #e8d8e8;
}

.week-pill.future {
    background: #f5f5f5;
    border-color: #ccc;
    color: #bbb;
    cursor: not-allowed;
}

/* Chart container */
.chart-container {
    position: relative;
    height: 420px;
    margin: 1em 0 2em;
}

@media (max-width: 600px) {
    .chart-container {
        height: 300px;
    }
    .hide-mobile {
        display: none;
    }
    th, td {
        padding: 5px 4px;
        font-size: 0.85em;
    }
}

.table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
