/* Baseball Forever - JS/HTML/CSS version */
:root {
  --bg-main: #9CBC3D;
  --bg-sidebar: #E9AF27;
  --bg-content: #fff;
  --text-dark: #333;
  --font-main: Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-main);
  font-family: var(--font-main);
  color: var(--text-dark);
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 8px;
}

.banner {
  text-align: center;
  padding: 0 0 8px;
}
.banner img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.bf-update-ribbon {
  text-align: center;
  font-size: 14px;
  line-height: 1.45;
  margin: 0 0 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff9e6 0%, #fff3cc 100%);
  border: 1px solid #e9af27;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  color: #1a3a5c;
}
.bf-update-ribbon-news {
  margin: 0 0 8px;
}
.bf-update-ribbon-cta {
  margin: 0;
  color: #333;
}
.bf-update-ribbon-cta a {
  color: #b45309;
  font-weight: 700;
  text-decoration: underline;
}
.bf-update-ribbon-cta a:hover {
  color: #92400e;
}

.main-layout {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: center;
}

.sidebar {
  width: 200px;
  min-width: 200px;
  background: var(--bg-sidebar);
  padding: 8px;
  font-size: 12px;
}
.sidebar .panel {
  background: #fff;
  padding: 8px;
  margin-bottom: 12px;
  width: 180px;
}
.sidebar .panel h3 {
  margin: 0 0 6px;
  font-size: 13px;
}
.sidebar table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
}
.sidebar td {
  padding: 2px 4px;
}
.sidebar-empty {
  margin: 0;
  font-size: 12px;
  color: #888;
  font-style: italic;
}
.sidebar-min {
  font-size: 11px;
  color: #666;
  font-weight: normal;
}

/* Career stats hover (player name) */
.career-hover {
  cursor: help;
  border-bottom: 1px dotted rgba(0, 0, 0, 0.35);
}
.card-head .career-hover {
  border-bottom-color: rgba(0, 0, 0, 0.45);
}

.bf-career-tooltip {
  position: fixed;
  z-index: 10050;
  max-width: min(320px, calc(100vw - 16px));
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  line-height: 1.35;
  pointer-events: none;
  color: #222;
}
.bf-career-tooltip[hidden] {
  display: none !important;
}
.bf-career-tooltip-title {
  margin: 0 0 4px;
}
.bf-career-tooltip-pos {
  font-weight: normal;
  color: #555;
}
.bf-career-tooltip-years {
  margin: 0 0 8px;
  font-size: 11px;
  color: #555;
}
.bf-career-tooltip-muted {
  margin: 0;
  color: #666;
  font-size: 11px;
}
.bf-career-tooltip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.bf-career-tooltip-table td {
  padding: 2px 8px 2px 0;
  vertical-align: top;
}
.bf-career-tooltip-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.sidebar-most-hr,
.sidebar-most-hits,
.sidebar-most-wins,
.sidebar-most-so,
.sidebar-most-saves {
  margin-top: 12px;
}

.sidebar-most-titles {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}
.sidebar-most-titles-head {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.3;
}
.sidebar-daily-gm-yesterday .sidebar-yesterday-top-gm-row {
  margin-bottom: 10px;
}
.sidebar-daily-gm-yesterday .sidebar-yesterday-top-gm-row:last-child {
  margin-bottom: 0;
}
.sidebar-daily-gm-yesterday .sidebar-yesterday-top-gm-name {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0 0 3px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #111;
}
.sidebar-daily-gm-yesterday .sidebar-yesterday-top-gm-row--rest .sidebar-yesterday-top-gm-name {
  font-size: 13px;
  font-weight: 700;
  color: #222;
}
.sidebar-daily-gm-yesterday .sidebar-yesterday-top-gm-pts {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  color: #444;
}
.sidebar-daily-gm-yesterday .sidebar-yesterday-top-gm-row--rest .sidebar-yesterday-top-gm-pts {
  font-size: 10px;
  font-weight: 500;
  color: #666;
}
.sidebar-most-titles-table {
  width: 100%;
  font-size: 11px;
  border-collapse: collapse;
  margin: 0;
}
.sidebar-most-titles-table td {
  padding: 2px 4px;
  word-break: break-all;
}
.sidebar-most-titles-table thead th {
  font-size: 10px;
  font-weight: 600;
  text-align: left;
  padding: 2px 4px;
  border-bottom: 1px solid #ddd;
}
.sidebar-most-titles-table th.num,
.sidebar-most-titles-table td.num {
  text-align: right;
  width: 1%;
  white-space: nowrap;
}
.sidebar-most-titles-table td.sidebar-most-titles-meta {
  font-size: 10px;
  color: #555;
  font-style: italic;
}

.content {
  flex: 0 0 600px;
  width: 600px;
  min-width: 0;
  background: var(--bg-content);
  padding: 12px 16px;
  max-width: 600px;
}

.seo-home-copy {
  background: #fff;
  padding: 4px 2px 8px;
}
.seo-home-copy h1 {
  font-size: 1.6rem;
  margin: 0 0 10px;
  color: #1a1a1a;
}
.seo-home-copy h2 {
  font-size: 1.15rem;
  margin: 16px 0 8px;
  color: #2c5282;
}
.seo-home-copy p {
  margin: 0 0 10px;
  line-height: 1.6;
  color: #333;
}

.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  margin-bottom: 12px;
  min-height: 50px;
}
.header-bar .team-name { font-size: 1.2em; font-weight: bold; }
.header-bar .sub { font-size: 0.85em; opacity: 0.9; }

.intro-callout {
  background: linear-gradient(135deg, #f8f6e8 0%, #fff 100%);
  border-left: 4px solid var(--bg-sidebar);
  padding: 14px 16px;
  margin-bottom: 16px;
  border-radius: 0 6px 6px 0;
}
.intro-lead {
  font-size: 1.25em;
  font-weight: bold;
  margin: 0 0 4px;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}
.intro-daily-ws {
  font-size: 0.95rem;
  color: #555;
  margin: 10px 0 0;
  line-height: 1.35;
}
.intro-daily-ws-more {
  font-size: 0.88em;
  color: #777;
  font-weight: normal;
}
.champions-banner .intro-daily-ws {
  color: var(--champ-text);
  opacity: 0.95;
  margin-top: 12px;
  text-align: center;
}

.intro-sub {
  margin: 0;
  font-size: 1em;
  color: #444;
  line-height: 1.4;
}

/* Front page (pick team) — content-rich layout for AdSense */
.front-page {
  max-width: 560px;
}
.front-page-title {
  font-size: 1.5rem;
  margin: 0 0 4px;
  color: #1a1a1a;
  font-weight: 700;
}
.front-page-tagline {
  margin: 0 0 16px;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
}
.front-page-about,
.front-page-how,
.front-page-stats,
.front-page-pick {
  margin-bottom: 20px;
}
.front-page h2 {
  font-size: 1.1rem;
  margin: 0 0 8px;
  color: #2c5282;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 4px;
}
.front-page-about p,
.front-page-stats p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: #333;
}
.front-page-how ul {
  margin: 0;
  padding-left: 20px;
  font-size: 0.95rem;
  line-height: 1.6;
  color: #333;
}
.front-page-how li {
  margin-bottom: 6px;
}
.front-page-pick .teams-pick {
  margin-top: 8px;
}

.manager-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.manager-identity {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  line-height: 1.3;
}
.manager-identity .gm-line {
  font-size: 1.08em;
  font-weight: 700;
  color: #3d3d3d;
}
.manager-identity .manager-line {
  font-size: 0.88em;
  font-weight: 600;
  color: #555;
}
.manager-identity .gm-line .gm-id-link {
  color: inherit;
  text-decoration: none;
}
.manager-identity .gm-line .gm-id-link:hover {
  text-decoration: underline;
}
.manager-identity .gm-line .gm-id-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}
.manager-form { margin: 0; }

.btn {
  display: inline-block;
  padding: 8px 16px;
  margin: 4px 4px 4px 0;
  font-family: var(--font-main);
  font-size: 14px;
  cursor: pointer;
  border: 1px solid #999;
  background: #f0f0f0;
  border-radius: 4px;
  touch-action: manipulation;
}
.btn:hover { background: #e0e0e0; }
.btn-primary { background: #E9AF27; border-color: #c99a20; }

/* Themed preseason notice (e.g. duplicate field position) — ballpark palette */
.bf-preseason-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-family: var(--font-main);
}
.bf-preseason-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(35, 48, 28, 0.58);
  cursor: pointer;
}
.bf-preseason-modal-panel {
  position: relative;
  max-width: 440px;
  width: 100%;
  background: #fff;
  border-radius: 8px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.28),
    0 0 0 2px #E9AF27,
    0 0 0 4px #2c5282;
  overflow: hidden;
}
.bf-preseason-modal-head {
  background: linear-gradient(180deg, #C4E2FC 0%, #b0d8f8 100%);
  border-bottom: 3px solid #E9AF27;
  padding: 12px 16px;
  font-weight: bold;
  font-size: 1.05em;
  color: #1a3a5c;
  letter-spacing: 0.02em;
}
.bf-preseason-modal-body {
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
}
.bf-preseason-modal-body:empty {
  display: none;
}
.bf-preseason-modal-actions {
  padding: 0 18px 16px;
  text-align: right;
}
.bf-preseason-modal-actions .btn-primary {
  font-weight: bold;
}
.bf-preseason-modal-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}
.preseason-ut {
  font-weight: normal;
  color: #2c5282;
  white-space: nowrap;
}

/* Allow horizontal scroll on small screens when table is wide */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 12px 0;
}

.encyclopedia-section {
  margin-bottom: 0.75em;
}
.encyclopedia-section h3 {
  margin: 0 0 4px;
  font-size: 14px;
}
.encyclopedia-section .table-wrap {
  margin: 4px 0 8px;
}
.encyclopedia-section table.data th,
.encyclopedia-section table.data td {
  padding: 3px 6px;
}
.encyclopedia-section table.data tr.franchise-ws-win {
  background: linear-gradient(90deg, rgba(255, 215, 0, 0.5), rgba(255, 193, 37, 0.25), rgba(255, 215, 0, 0.15)) !important;
  font-weight: 700;
  border-left: 4px solid #daa520;
}

.encyclopedia-section table.data tr.franchise-ws-win td:first-child::before {
  content: "🏆 ";
}
.encyclopedia-section table.data td.ws-result-cell {
  line-height: 1.4;
  vertical-align: top;
}

.encyclopedia-section p {
  margin: 2px 0 6px;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.data th, table.data td {
  padding: 6px 8px;
  text-align: left;
  border: 1px solid #ddd;
}
table.data th { background: #f5f5f5; }
table.data .num { text-align: right; }
table.data thead.batters { background-color: #C4E2FC; }
table.data thead.pitchers { background-color: #FFFE61; }
table.data tbody.batters tr:nth-child(odd) { background-color: #E8F4FC; }
table.data tbody.batters tr:nth-child(even) { background-color: #fff; }
table.data tbody.pitchers tr:nth-child(odd) { background-color: #FFFDE0; }
table.data tbody.pitchers tr:nth-child(even) { background-color: #fff; }

.relief-label {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: #5b7fb8;
  border-radius: 3px;
  vertical-align: middle;
}

.teams-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}
.teams-pick .league-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.teams-pick .league-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--bg-sidebar, #2c5282);
}
.teams-pick section h3,
.teams-pick section h4 {
  margin: 0 0 6px;
  font-size: 14px;
  text-align: left;
  font-weight: 600;
}
.teams-pick .league-col section:not(.league-head) {
  padding-left: 4px;
}
.teams-pick label {
  display: block;
  padding: 4px 0;
  font-size: 13px;
  cursor: pointer;
}
.teams-pick input[type=radio] { margin-right: 8px; }

.spring-cards {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 12px 0;
}
.spring-card {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 110px;
  border: 1px solid #999;
  border-radius: 4px;
  padding: 6px;
  background: #fff;
  box-shadow: 2px 2px 0 #ccc;
}
.spring-card .card-head {
  padding: 6px 4px;
  margin: -6px -6px 6px -6px;
  border-radius: 4px 4px 0 0;
  font-weight: bold;
  font-size: 12px;
}
.spring-card .card-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 4px;
}
.spring-card .card-head-name-wrap {
  min-width: 0;
  flex: 1;
  text-align: left;
}
.spring-card .card-head-pos {
  flex-shrink: 0;
  text-align: right;
}
.spring-card .card-head.batter { background-color: #C4E2FC; }
.spring-card .card-head.pitcher { background-color: #FFFE61; }
.spring-card .name { font-weight: bold; font-size: 12px; }
.spring-card .pos { font-style: italic; font-size: 11px; color: #333; }
.spring-card .stats { font-size: 11px; margin-top: 4px; }
.spring-card .overall {
  font-weight: bold;
  text-align: center;
  padding: 4px;
  margin: auto -6px -6px -6px;
  border-radius: 0 0 4px 4px;
}
.spring-card .overall.batter { background-color: #C4E2FC; }
.spring-card .overall.pitcher { background-color: #FFFE61; }
.spring-card.relief {
  background: repeating-linear-gradient(
    -45deg,
    #fff,
    #fff 4px,
    #e8f0fa 4px,
    #e8f0fa 8px
  );
  border-color: #5b7fb8;
  border-left-width: 4px;
  border-left-style: solid;
  border-left-color: #5b7fb8;
}
.spring-card.relief.selected {
  border-left-color: #5b7fb8;
}
.spring-card.relief .pos {
  background-color: #5b7fb8;
  color: #fff;
  margin: 0 -6px;
  padding: 2px 6px;
  border-radius: 0 0 4px 4px;
  font-weight: 600;
}
.spring-card.relief .card-head.pitcher { background-color: #5b7fb8; color: #fff; }
.spring-card.relief .overall.pitcher { background-color: #4a6a9e; color: #fff; }
.spring-card .overall .rating-change {
  font-weight: normal;
  opacity: 0.75;
}
.spring-card[data-playerkey]:not(.selected) {
  opacity: 0.65;
  border-color: #ccc;
}
.spring-card[data-playerkey]:not(.selected):hover {
  opacity: 0.85;
}
.spring-card.selected {
  position: relative;
  border: 3px solid var(--team-color1, #c99a20);
  box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--team-color1, #E9AF27), 0 4px 12px rgba(0,0,0,0.2);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--team-color1, #E9AF27) 12%, transparent), transparent 30%);
  opacity: 1;
  transform: scale(1.02);
}
.spring-card input[type=checkbox] { margin: 4px 0; }
.spring-card[data-playerkey] {
  touch-action: manipulation;
}
.spring-card.spring-card-skill-blocked {
  cursor: not-allowed;
  opacity: 0.42;
  filter: grayscale(0.3);
}
.spring-card.spring-card-skill-blocked:not(.selected):hover {
  opacity: 0.5;
}
.spring-card.spring-card-skill-blocked.selected {
  opacity: 1;
  filter: none;
}

.roster-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  align-items: flex-start;
}
.roster-row .row-label {
  width: 100%;
  font-weight: bold;
  font-size: 13px;
  margin-bottom: 4px;
  padding: 4px 6px;
  border-radius: 4px;
}
.roster-row .row-label.batters { background-color: #C4E2FC; }
.roster-row .row-label.pitchers { background-color: #FFFE61; }

.standings-columns {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.standings-col {
  flex: 1;
  min-width: 180px;
}
.standings-table { margin: 0; }
.standings-table td.num { text-align: right; }
.standings-columns .standings-table { margin-bottom: 0; }
.standings-legend { margin: 8px 0 0; font-size: 0.9em; color: #666; }
.world-series { margin: 16px 0; padding: 12px; background: #f8f8f8; border-radius: 4px; }
.world-series .playoffs-flavor { margin: 6px 0 14px; font-size: 0.95em; color: #555; font-style: italic; }

.champions-banner {
  --champ-bg: #0c2340;
  --champ-accent: #c9a227;
  --champ-text: #ffffff;
  margin-top: 24px;
  padding: 28px 24px;
  background: var(--champ-bg);
  border: 2px solid var(--champ-accent);
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 6px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
}
.champions-trophy {
  font-size: 48px;
  margin-bottom: 10px;
  line-height: 1;
  opacity: 0.95;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.champions-text {
  font-size: 26px;
  font-weight: 700;
  color: var(--champ-text);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.champions-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--champ-text);
  text-transform: uppercase;
  letter-spacing: 0.2em;
  margin-top: 2px;
}
.champions-slogan {
  font-size: 15px;
  font-style: italic;
  color: var(--champ-text);
  opacity: 0.9;
  margin-top: 10px;
  letter-spacing: 0.02em;
}
.champions-congrats {
  margin-top: 14px;
  font-size: 15px;
  color: var(--champ-text);
  opacity: 0.9;
  font-style: italic;
}
.my-team-champs {
  --champ-accent: #e8c547;
  border-color: var(--champ-accent);
  box-shadow: 0 6px 28px rgba(0,0,0,0.4), 0 0 0 1px rgba(232, 197, 71, 0.15) inset;
}
.my-team-champs .champions-title {
  color: var(--champ-text);
}
.my-team-champs .champions-congrats {
  color: #9dd89d;
}
.world-series .ws-results-wrap { margin: 6px 0; }
.world-series table.ws-results { font-size: 12px; width: auto; }
.world-series table.ws-results th,
.world-series table.ws-results td { padding: 3px 10px; }

.pennant-banner {
  margin-top: 16px;
  padding: 20px;
  border: 2px solid;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.pennant-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 6px;
  line-height: 1;
}
.pennant-text {
  font-size: 22px;
  font-weight: bold;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  margin-bottom: 2px;
}
.pennant-title {
  font-size: 14px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}
.pennant-icon-inline {
  margin-left: 4px;
  font-size: 1em;
  vertical-align: middle;
}
tr.franchise-pennant td:first-child { font-weight: 600; }
.ds-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 4px;
  font-size: 0.85em;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  background: linear-gradient(145deg, #2a5a9e 0%, #1a4d8c 50%, #153a6b 100%);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  vertical-align: middle;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
}
.ds-badge:hover {
  background: linear-gradient(145deg, #3568b3 0%, #2a5a9e 50%, #1a4d8c 100%);
}
tr.franchise-ds-win td:first-child { font-weight: 600; }

.manager-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 32px;
  margin: 8px 0;
}
.manager-col {
  min-width: 140px;
}
.manager-col label {
  display: block;
  padding: 0;
  font-size: 13px;
  line-height: 1;
}

.footer {
  text-align: center;
  font-size: 12px;
  padding: 16px 0;
  color: #555;
}
.footer a { color: #333; }
.footer .btn-newgame { margin-bottom: 8px; }

.skills {
  font-size: 0.85em;
  color: #666;
  font-style: italic;
}

#year { font-weight: bold; }

/* --- Mobile / small screens --- */
@media (max-width: 768px) {
  /* Slightly larger base font for readability; layout widths unchanged */
  html {
    font-size: 17px;
  }

  .wrap {
    padding: 0 12px;
  }

  .main-layout {
    flex-direction: column;
    gap: 12px;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    order: 2;
    font-size: 13px;
  }
  .sidebar .panel {
    width: 100%;
    max-width: 100%;
  }
  .sidebar .panel h3 {
    font-size: 14px;
  }
  .sidebar table {
    font-size: 12px;
  }

  .content {
    max-width: 100%;
    order: 1;
    padding: 12px;
  }

  .header-bar {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    min-height: auto;
  }
  .header-bar .team-name {
    font-size: 1.15em;
  }
  .header-bar .sub {
    font-size: 0.85em;
  }

  .teams-pick {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .teams-pick .league-col:last-child {
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(0,0,0,0.1);
  }

  .spring-cards {
    gap: 8px;
    margin: 10px 0;
  }
  .spring-card {
    width: calc(50% - 4px);
    min-width: 0;
    padding: 4px;
  }
  .spring-card .card-head {
    padding: 4px 3px;
    margin: -4px -4px 4px -4px;
    font-size: 12px;
  }
  .spring-card .name {
    font-size: 12px;
  }
  .spring-card .pos {
    font-size: 11px;
  }
  .spring-card .stats {
    font-size: 11px;
    margin-top: 2px;
  }
  .spring-card .overall {
    padding: 3px;
    margin: auto -4px -4px -4px;
    font-size: 18px;
  }

  table.data {
    font-size: 13px;
  }
  table.data th,
  table.data td {
    padding: 6px 4px;
  }
  .encyclopedia-section h3 {
    font-size: 15px;
  }

  .btn {
    padding: 10px 18px;
    min-height: 44px;
    font-size: 15px;
  }

  .footer {
    padding: 12px 0;
    font-size: 12px;
  }
  .roster-row .row-label {
    font-size: 14px;
  }
  .teams-pick section h3,
  .teams-pick section h4 {
    font-size: 15px;
  }
  .teams-pick label {
    font-size: 14px;
  }

  .champions-banner {
    padding: 16px;
  }
  .champions-trophy {
    font-size: 48px;
  }
  .champions-text {
    font-size: 22px;
  }
  .champions-title {
    font-size: 16px;
    letter-spacing: 1px;
  }
  .champions-slogan {
    font-size: 15px;
    margin-top: 4px;
  }
  .champions-congrats {
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 16px;
  }
  .wrap {
    padding: 0 8px;
  }

  .banner img {
    max-width: 100%;
  }

  .spring-card {
    width: calc(50% - 4px);
    padding: 3px;
  }
  .spring-card .card-head {
    padding: 3px 2px;
    margin: -3px -3px 3px -3px;
    font-size: 11px;
  }
  .spring-card .name {
    font-size: 11px;
  }
  .spring-card .pos {
    font-size: 10px;
  }
  .spring-card .stats {
    font-size: 10px;
    margin-top: 2px;
  }
  .spring-card .overall {
    padding: 2px;
    margin: auto -3px -3px -3px;
    font-size: 18px;
  }

  table.data {
    font-size: 12px;
  }
  table.data th,
  table.data td {
    padding: 4px 3px;
  }

  .roster-row .row-label {
    font-size: 13px;
  }

  .champions-banner {
    padding: 12px;
    margin-top: 16px;
  }
  .champions-trophy {
    font-size: 40px;
    margin-bottom: 4px;
  }
  .champions-text {
    font-size: 18px;
  }
  .champions-title {
    font-size: 14px;
    letter-spacing: 0.5px;
  }
  .champions-slogan {
    font-size: 13px;
    margin-top: 4px;
  }
  .champions-congrats {
    font-size: 12px;
    margin-top: 8px;
  }
}

/* Narrow viewport: allow content to shrink so layout doesn't overflow */
@media (max-width: 820px) {
  .content {
    flex: 1;
    width: auto;
    max-width: none;
  }
}

/* Scrollable tables on mobile */
@media (max-width: 768px) {
  .standings-table,
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -4px;
    margin-right: -4px;
    padding-left: 4px;
    padding-right: 4px;
  }
}
