:root {
  --primary: #041e42;
  --accent: #ff4c00;
  --ink: #152236;
  --muted: #667085;
  --border: #e6e9ee;
  --canvas: #f5f6f8;
  --tint: #fff3ed;
  --radius: 20px;
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  scroll-padding-top: 22px;
}
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font:
    16px/1.55 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Arial,
    sans-serif;
}
button,
input,
select {
  font: inherit;
}
button,
a,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 0;
  background: none;
  color: inherit;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
[hidden] {
  display: none !important;
}
.topbar {
  height: 72px;
  background: var(--primary);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.topbar-inner {
  max-width: 1336px;
  height: 100%;
  margin: auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 21px;
  font-weight: 850;
  letter-spacing: -0.8px;
  display: flex;
  gap: 10px;
  align-items: center;
}
.brand-symbol {
  font-size: 30px;
  font-weight: 500;
  color: var(--accent);
}
.brand-tag {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 500;
  border-left: 1px solid #ffffff35;
  padding-left: 18px;
  margin-left: 8px;
  color: #bac4d3;
}
.league {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 1.5px;
  color: #d1d7e1;
}
.league span {
  color: var(--accent);
  margin: 0 10px;
}
.source-link {
  font-size: 14px;
  color: #d1d7e1;
}
main {
  max-width: 1336px;
  margin: auto;
  padding: 0 28px;
}
.breadcrumb {
  font-size: 14px;
  color: var(--muted);
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 26px 0;
}
.breadcrumb span:last-child {
  color: var(--ink);
}
.team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 0 29px;
}
.team-identity {
  display: flex;
  gap: 24px;
  align-items: center;
}
.team-logo {
  height: 90px;
  width: 90px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-weight: 850;
  font-size: 25px;
  color: var(--primary);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 15px;
}
.team-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: 1.7px;
  font-weight: 700;
  color: var(--muted);
}
h1 {
  font-size: 36px;
  letter-spacing: -1.4px;
  line-height: 1.15;
  margin: 8px 0;
  font-weight: 780;
}
.team-identity p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}
.team-controls {
  width: 225px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 7px;
}
.team-controls label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1px;
}
select {
  width: 100%;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #d9dee7;
  border-radius: 7px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
}
.refresh {
  font-size: 14px;
  color: var(--muted);
  padding: 3px 0;
}
.refresh:hover {
  color: var(--ink);
}
.refresh:disabled {
  cursor: wait;
}
.data-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  gap: 18px;
}
#data-status:before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a8b1bf;
  margin-right: 7px;
}
#data-status[data-state="live"]:before {
  background: #219776;
}
#data-status[data-state="error"]:before {
  background: #d38c39;
}
.local-label > span {
  margin: 0 6px;
}
.overview {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 10px 0 28px;
}
.overview > a {
  display: flex;
  align-items: center;
  gap: 15px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 17px 20px;
  transition:
    transform 0.15s,
    border 0.15s;
}
.overview > a:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}
.overview-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  color: var(--primary);
  background: var(--canvas);
  border-radius: 9px;
  font-size: 20px;
}
.overview-label {
  font-size: 11px;
  letter-spacing: 1.2px;
  color: var(--muted);
  font-weight: 700;
}
.overview strong {
  font-size: 22px;
  display: block;
  letter-spacing: -0.6px;
  font-weight: 700;
}
.overview small {
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
  margin-left: 4px;
}
.overview-arrow {
  margin-left: auto;
  color: #b8bfca;
  font-size: 20px;
}
.hot-overview .overview-icon {
  background: #fff0e6;
  color: #e05b24;
}
.page-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 17px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.7px;
  gap: 15px;
}
.subtle {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0;
  margin-left: 5px;
}
.page-tools > div {
  display: flex;
  gap: 22px;
  align-items: center;
}
.toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  cursor: pointer;
}
.toggle input {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}
.text-button {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: 0;
  padding: 0;
}
.panel {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  scroll-margin-top: 20px;
}
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  padding: 19px 23px;
  border-bottom: 1px solid var(--border);
}
.section-head > div {
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-index {
  font-size: 13px;
  color: var(--accent);
  background: var(--tint);
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  border-radius: 5px;
  padding: 3px 6px;
  font-weight: 700;
}
.section-head h2 {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 0;
}
.section-count {
  font-size: 11px;
  color: #929aa6;
  margin-left: 3px;
  letter-spacing: 1px;
}
.section-help {
  font-size: 13px;
  color: var(--muted);
}
.position-labels {
  display: grid;
  grid-template-columns: 48px repeat(3, minmax(0, 1fr));
  padding: 13px 23px 0;
  gap: 12px;
  color: #929aa6;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 1px;
}
.position-labels > span:not(:first-child) {
  text-align: center;
}
.position-labels b {
  color: #adb5c1;
  font-weight: 500;
  margin-left: 5px;
}
.line-row {
  display: grid;
  grid-template-columns: 48px repeat(3, minmax(0, 1fr));
  padding: 15px 23px;
  gap: 12px;
  align-items: stretch;
  border-bottom: 1px solid #f0f1f4;
}
.line-row:last-child {
  border-bottom: 0;
  padding-bottom: 22px;
}
.line-number {
  align-self: center;
  color: #acb4c0;
  font-size: 23px;
  font-weight: 300;
  line-height: 1.2;
}
.line-number small {
  display: block;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 600;
  margin-top: 5px;
}
.player-card {
  display: flex;
  align-items: center;
  position: relative;
  text-align: left;
  width: 100%;
  padding: 11px 13px;
  gap: 13px;
  border: 1px solid transparent;
  background: #f8f9fb;
  border-radius: 9px;
  min-width: 0;
  min-height: 102px;
  transition:
    background 0.15s,
    border-color 0.15s,
    transform 0.15s;
}
.player-card:hover {
  background: var(--tint);
  border-color: color-mix(in srgb, var(--accent) 40%, white);
  transform: translateY(-2px);
}
.player-card:focus-visible {
  outline-offset: 0;
}
.portrait {
  height: 96px;
  width: 96px;
  flex-shrink: 0;
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #e9ecf1, #f5f6f8);
  overflow: hidden;
  color: #8b97aa;
  font-size: 23px;
  font-weight: 650;
}
.portrait img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
}
.portrait-fallback {
  font-size: 19px;
  color: #a3aab6;
}
.player-copy {
  min-width: 0;
  flex: 1;
}
.player-meta {
  display: flex;
  gap: 5px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.player-meta span + span:before {
  content: "·";
  margin-right: 5px;
}
.player-name {
  display: block;
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  margin: 4px 0 6px;
  letter-spacing: -0.3px;
  overflow-wrap: anywhere;
}
.player-name .first-name {
  display: block;
  font-size: 13px;
  font-weight: 400;
  color: #7c8594;
  letter-spacing: 0;
  margin-bottom: 1px;
}
.player-stats {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}
.player-stats b {
  color: #516073;
  font-weight: 650;
}
.form-badge {
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  padding: 3px 6px;
  border-radius: 4px;
  display: inline-flex;
  gap: 3px;
  align-items: center;
  line-height: 1.3;
}
.form-badge.hot {
  color: #c45c24;
  background: #fff0e5;
}
.form-badge.cold {
  background: #ebf2fb;
  color: #5781ad;
}
.form-badge.normal {
  background: #eaf5ef;
  color: #4f896a;
}
.form-badge.neutral {
  background: #eff1f5;
  color: #939ba7;
}
.form-badge.stale {
  background: #f3f0e8;
  color: #a18b58;
}
.lower-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  margin-top: 20px;
}
.pair-labels,
.pair-row {
  grid-template-columns: 35px repeat(2, minmax(0, 1fr));
}
.pair-row {
  padding-top: 12px;
  padding-bottom: 12px;
}
.lower-grid .player-card {
  padding: 10px;
  gap: 9px;
  min-height: 92px;
}
.lower-grid .portrait {
  height: 76px;
  width: 76px;
}
.lower-grid .player-name {
  font-size: 16px;
}
.lower-grid .section-help {
  display: none;
}
.goalie-slots {
  padding: 24px 23px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}
.goalie-slot > small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 12px;
}
.goalie-slot .player-card {
  display: flex;
  flex-direction: column;
  padding: 20px 8px;
  text-align: center;
  gap: 10px;
  min-height: 190px;
}
.goalie-slot .portrait {
  width: 112px;
  height: 112px;
}
.goalie-slot .player-meta {
  justify-content: center;
}
.goalie-note {
  display: flex;
  gap: 12px;
  padding: 20px 23px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  color: var(--muted);
}
.goalie-note > span {
  font-size: 24px;
  color: #adb7c6;
}
.goalie-note strong {
  font-size: 13px;
  font-weight: 600;
  color: #647083;
}
.goalie-note p {
  font-size: 13px;
  line-height: 1.6;
  margin: 4px 0 0;
  max-width: 290px;
}
.form-guide {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 23px 0 19px;
  border-bottom: 1px solid var(--border);
  margin-top: 10px;
  scroll-margin-top: 15px;
}
.guide-icon {
  font-size: 29px;
  color: #d58d63;
}
.form-guide h3 {
  font-size: 15px;
  margin: 0 0 5px;
}
.form-guide p {
  font-size: 13px;
  color: var(--muted);
  max-width: 600px;
  margin: 0;
  line-height: 1.7;
}
.legend {
  display: flex;
  gap: 7px;
  margin-left: auto;
}
.source-note {
  font-size: 12px;
  line-height: 1.8;
  color: #939ba6;
  margin: 14px 0 25px;
}
footer {
  border-top: 1px solid var(--border);
  padding: 23px 0 30px;
  display: flex;
  justify-content: space-between;
  color: #929aa6;
  font-size: 12px;
}
.footer-brand {
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.3px;
  font-size: 15px;
}
#extras {
  margin-top: 20px;
}
#extras-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 20px 23px;
}
.empty-slot {
  min-height: 102px;
  display: grid;
  place-items: center;
  font-size: 14px;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 9px;
  text-align: center;
  padding: 10px;
}
dialog {
  width: min(490px, 94vw);
  max-height: 90vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  color: var(--ink);
  box-shadow: 0 20px 90px #041e4233;
}
dialog::backdrop {
  background: #041e4280;
  backdrop-filter: blur(4px);
}
.dialog-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close {
  height: 30px;
  width: 30px;
  background: var(--canvas);
  border-radius: 50%;
  color: var(--muted);
}
.detail-identity {
  display: flex;
  gap: 20px;
  align-items: center;
  margin: 18px 0 24px;
}
.detail-identity .portrait {
  height: 140px;
  width: 140px;
}
.detail-identity h2 {
  font-size: 26px;
  letter-spacing: -0.8px;
  line-height: 1.2;
  margin: 5px 0 12px;
}
.detail-identity .player-meta {
  font-size: 14px;
}
.detail-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--canvas);
  padding: 17px 12px;
  border-radius: 9px;
  margin: 15px 0;
}
.detail-stats > div {
  text-align: center;
  border-right: 1px solid var(--border);
}
.detail-stats > div:last-child {
  border: 0;
}
.detail-stats strong {
  font-size: 25px;
  display: block;
}
.detail-stats span {
  font-size: 12px;
  color: var(--muted);
}
.detail-label {
  font-size: 13px;
  font-weight: 650;
  display: flex;
  justify-content: space-between;
}
.detail-label span {
  color: var(--muted);
  font-weight: 400;
}
.game-log {
  width: 100%;
  font-size: 14px;
  border-collapse: collapse;
  margin-top: 15px;
}
.game-log td,
.game-log th {
  padding: 9px 5px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
.game-log th {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.game-log td:first-child,
.game-log th:first-child {
  text-align: left;
}
.game-log .point-cell {
  font-weight: 700;
  color: var(--primary);
}
.detail-empty {
  background: var(--canvas);
  border-radius: 8px;
  padding: 20px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.primary-button {
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 7px;
  padding: 12px 16px;
  flex: 1;
}
.outline-button {
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px 16px;
}
.small-muted {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
#edit-form {
  border-top: 1px solid var(--border);
  padding-top: 20px;
  margin-top: 20px;
}
#edit-form label {
  display: block;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}
input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px;
  margin-top: 5px;
  color: var(--ink);
}
#edit-error {
  font-size: 14px;
  color: #b54728;
}
.swap-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  padding: 14px 20px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  display: flex;
  gap: 25px;
  align-items: center;
  box-shadow: 0 6px 30px #041e4244;
  font-size: 15px;
  z-index: 5;
  width: max-content;
  max-width: 94vw;
}
.swap-bar button {
  font-size: 14px;
  color: #d3dbe8;
  white-space: nowrap;
}
.swap-target .player-card {
  border: 1px dashed var(--accent);
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  padding: 13px 20px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 15px;
  z-index: 6;
  max-width: 90vw;
  box-shadow: 0 4px 20px #041e4233;
}
@media (min-width: 1400px) {
  .player-card {
    padding: 13px 18px;
    gap: 17px;
  }
  .portrait {
    height: 108px;
    width: 108px;
  }
  .player-name {
    font-size: 19px;
  }
  .line-row {
    padding-top: 17px;
    padding-bottom: 17px;
  }
  .lower-grid .player-card {
    min-height: 102px;
  }
}
@media (max-width: 1100px) {
  .portrait {
    height: 76px;
    width: 76px;
  }
  .player-card {
    padding: 9px;
    gap: 9px;
  }
  .player-name {
    font-size: 16px;
  }
  .player-stats {
    font-size: 11px;
  }
  .line-row,
  .position-labels {
    gap: 9px;
    padding-left: 18px;
    padding-right: 18px;
    grid-template-columns: 30px repeat(3, minmax(0, 1fr));
  }
  .pair-row,
  .pair-labels {
    grid-template-columns: 22px repeat(2, minmax(0, 1fr));
  }
  .lower-grid {
    grid-template-columns: 1.35fr 1fr;
    gap: 15px;
  }
  .lower-grid .portrait {
    width: 60px;
    height: 60px;
  }
  .lower-grid .player-card {
    padding: 8px;
    gap: 7px;
  }
  .lower-grid .player-name {
    font-size: 15px;
  }
  .goalie-slots {
    padding: 24px 18px;
    gap: 10px;
  }
  .goalie-slot .portrait {
    height: 94px;
    width: 94px;
  }
  .section-head {
    padding: 18px;
  }
  .overview > a {
    padding: 15px 13px;
    gap: 10px;
  }
  .overview-icon {
    height: 30px;
    width: 30px;
  }
  .overview strong {
    font-size: 20px;
  }
  .overview-arrow {
    display: none;
  }
  .legend {
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 210px;
  }
  .section-count {
    font-size: 11px;
  }
  .lower-grid .section-head > div {
    gap: 8px;
  }
}
@media (max-width: 780px) {
  .topbar-inner,
  main {
    padding-left: 18px;
    padding-right: 18px;
  }
  .brand-tag {
    display: none;
  }
  .league {
    font-size: 11px;
    letter-spacing: 0.7px;
  }
  .source-link {
    display: none;
  }
  .team-logo {
    width: 72px;
    height: 72px;
  }
  .team-identity {
    gap: 15px;
  }
  h1 {
    font-size: 28px;
  }
  .team-controls {
    width: 180px;
  }
  .team-header {
    gap: 15px;
  }
  .overview {
    gap: 9px;
  }
  .overview > a {
    gap: 8px;
    padding: 13px 10px;
  }
  .overview-icon {
    display: none;
  }
  .overview small {
    font-size: 11px;
  }
  .overview-label {
    font-size: 11px;
  }
  .overview strong {
    font-size: 20px;
  }
  .local-label {
    display: none;
  }
  .section-help {
    display: none;
  }
  .player-card {
    flex-direction: column;
    text-align: center;
    padding: 12px 6px;
    gap: 7px;
  }
  .player-meta {
    justify-content: center;
  }
  .portrait {
    height: 94px;
    width: 94px;
  }
  .player-name {
    font-size: 17px;
    margin: 3px 0 7px;
  }
  .line-row {
    grid-template-columns: 22px repeat(3, minmax(0, 1fr));
    padding: 12px 15px;
    gap: 9px;
  }
  .position-labels {
    grid-template-columns: 22px repeat(3, minmax(0, 1fr));
    padding: 12px 15px 0;
    font-size: 11px;
    letter-spacing: 0.4px;
  }
  .position-labels b {
    display: none;
  }
  .line-number {
    font-size: 20px;
  }
  .lower-grid {
    grid-template-columns: 1fr 1fr;
  }
  .pair-row,
  .pair-labels {
    grid-template-columns: 18px repeat(2, minmax(0, 1fr));
    padding-left: 12px;
    padding-right: 12px;
    gap: 6px;
  }
  .lower-grid .player-card {
    padding: 12px 5px;
    min-height: 160px;
  }
  .lower-grid .portrait {
    width: 78px;
    height: 78px;
  }
  .lower-grid .player-name {
    font-size: 15px;
  }
  .goalie-slots {
    padding: 23px 12px;
    gap: 9px;
  }
  .goalie-slot .player-card {
    min-height: 176px;
  }
  .goalie-note {
    padding: 18px 15px;
    gap: 10px;
  }
  .lower-grid .section-head {
    padding: 16px 12px;
  }
  .section-count {
    display: none;
  }
  .section-head h2 {
    font-size: 19px;
  }
  .form-guide {
    align-items: flex-start;
  }
  .legend {
    display: none;
  }
  .form-guide p {
    font-size: 13px;
  }
  .page-tools {
    font-size: 12px;
  }
  .page-tools > div {
    gap: 15px;
  }
  .subtle {
    display: none;
  }
  #extras-list {
    grid-template-columns: repeat(3, 1fr);
  }
  .detail-identity .portrait {
    height: 118px;
    width: 118px;
  }
}
@media (max-width: 480px) {
  .topbar {
    height: 61px;
  }
  .brand {
    font-size: 18px;
    gap: 7px;
  }
  .brand-symbol {
    font-size: 26px;
  }
  .league {
    font-size: 11px;
  }
  .league span {
    margin: 0 5px;
  }
  .breadcrumb {
    font-size: 12px;
    margin: 20px 0;
  }
  .team-header {
    flex-wrap: wrap;
    padding: 7px 0 20px;
  }
  .team-identity {
    gap: 13px;
  }
  .team-logo {
    height: 65px;
    width: 65px;
    padding: 10px;
  }
  .eyebrow {
    font-size: 11px;
    letter-spacing: 1.2px;
  }
  h1 {
    font-size: 27px;
    letter-spacing: -1px;
    margin: 7px 0;
  }
  .team-identity p {
    font-size: 14px;
  }
  .team-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px 15px;
    align-items: center;
  }
  .team-controls label {
    display: none;
  }
  .team-controls select {
    font-size: 14px;
    padding: 10px;
  }
  .refresh {
    font-size: 13px;
  }
  .data-bar {
    font-size: 12px;
  }
  .overview {
    gap: 7px;
    margin: 8px 0 22px;
  }
  .overview > a {
    padding: 11px 9px;
  }
  .overview-label {
    font-size: 10px;
    letter-spacing: 0.7px;
  }
  .overview strong {
    font-size: 19px;
  }
  .overview small {
    font-size: 11px;
    margin-left: 2px;
  }
  .page-tools {
    align-items: center;
    margin-bottom: 12px;
  }
  .page-tools > div {
    gap: 9px;
  }
  .toggle {
    font-size: 12px;
    gap: 3px;
  }
  .toggle input {
    width: 12px;
    height: 12px;
  }
  .text-button {
    font-size: 12px;
  }
  .section-head {
    padding: 15px;
  }
  .section-head h2 {
    font-size: 18px;
  }
  .section-index {
    font-size: 11px;
    padding: 2px 5px;
  }
  .section-head > div {
    gap: 9px;
  }
  .line-row {
    padding: 11px 10px;
    grid-template-columns: 16px repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .position-labels {
    padding: 12px 10px 0;
    grid-template-columns: 16px repeat(3, minmax(0, 1fr));
    gap: 6px;
    font-size: 10px;
  }
  .line-number {
    font-size: 20px;
  }
  .line-number small {
    font-size: 10px;
    letter-spacing: 0;
  }
  .portrait {
    width: 76px;
    height: 76px;
  }
  .player-card {
    padding: 10px 4px;
    gap: 6px;
    border-radius: 7px;
    min-height: 157px;
  }
  .player-name {
    font-size: 14px;
  }
  .player-name .first-name {
    font-size: 12px;
  }
  .player-meta {
    font-size: 11px;
  }
  .form-badge {
    font-size: 11px;
    padding: 3px 4px;
  }
  .player-stats {
    font-size: 11px;
    line-height: 1.6;
  }
  .lower-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-top: 15px;
  }
  .pair-row,
  .pair-labels {
    grid-template-columns: 20px repeat(2, minmax(0, 1fr));
    padding-left: 15px;
    padding-right: 15px;
    gap: 12px;
  }
  .lower-grid .player-card {
    flex-direction: row;
    text-align: left;
    min-height: 95px;
    padding: 9px;
    gap: 8px;
  }
  .lower-grid .portrait {
    width: 64px;
    height: 64px;
  }
  .lower-grid .player-name {
    font-size: 15px;
  }
  .lower-grid .player-meta {
    justify-content: flex-start;
  }
  .lower-grid .player-stats {
    font-size: 11px;
  }
  .lower-grid .section-head {
    padding: 15px;
  }
  .goalie-slots {
    padding: 20px 15px;
  }
  .goalie-slot .player-card {
    flex-direction: column;
    min-height: 180px;
    text-align: center;
  }
  .goalie-slot .portrait {
    width: 112px;
    height: 112px;
  }
  .goalie-slot .player-meta {
    justify-content: center;
  }
  .goalie-note {
    margin-top: 0;
  }
  .form-guide {
    gap: 13px;
  }
  .guide-icon {
    font-size: 25px;
  }
  .form-guide h3 {
    font-size: 14px;
  }
  .source-note {
    font-size: 11px;
  }
  footer {
    font-size: 11px;
    gap: 12px;
    align-items: center;
  }
  footer > span:nth-child(2) {
    display: none;
  }
  #extras-list {
    grid-template-columns: repeat(2, 1fr);
    padding: 15px;
  }
  .detail-identity {
    gap: 15px;
  }
  .detail-identity h2 {
    font-size: 23px;
  }
  .game-log {
    font-size: 13px;
  }
  .swap-bar {
    font-size: 13px;
    gap: 15px;
  }
  dialog {
    padding: 20px;
  }
}

@media (max-width: 480px) {
  #forward-lines .portrait,
  #extras-list .portrait {
    width: min(76px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
}

/* A snap-to-center team crown: touch, trackpad, mouse drag and keyboard. */
.team-controls {
  width: auto;
}
.team-picker {
  margin: 0 0 20px;
  padding: 18px 20px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
}
.picker-caption {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
}
.picker-caption > span:first-child {
  letter-spacing: 1.4px;
  font-size: 12px;
  font-weight: 700;
}
.team-wheel-shell {
  position: relative;
  padding: 0 38px;
  margin-top: 7px;
}
.team-wheel {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 132px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 10px calc(50% - 44px);
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
  cursor: grab;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 12%,
    #000 88%,
    transparent
  );
}
.team-wheel::-webkit-scrollbar {
  display: none;
}
.team-wheel.dragging {
  cursor: grabbing;
  scroll-snap-type: none;
  user-select: none;
}
.wheel-team {
  flex: 0 0 88px;
  width: 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  scroll-snap-align: center;
  scroll-snap-stop: normal;
  transform: scale(var(--wheel-scale, 0.75));
  opacity: var(--wheel-opacity, 0.5);
  transform-origin: center;
  padding: 5px 0;
  user-select: none;
}
.wheel-logo {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: #f4f6f9;
  border: 1px solid #e9edf2;
  padding: 13px;
  transition:
    background 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
.wheel-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.wheel-fallback {
  color: var(--ink);
  font-size: 18px;
  font-weight: 750;
}
.wheel-code {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 1px;
  color: var(--muted);
}
.wheel-team.selected .wheel-logo {
  background: var(--tint);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 9%, transparent);
}
.wheel-team.selected .wheel-code {
  color: var(--primary);
}
.wheel-focus {
  position: absolute;
  height: 4px;
  width: 20px;
  border-radius: 4px;
  background: var(--accent);
  left: calc(50% - 10px);
  bottom: 0;
  pointer-events: none;
}
.wheel-arrow {
  position: absolute;
  top: 42px;
  left: 0;
  height: 34px;
  width: 30px;
  background: #f5f6f8;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 25px;
  line-height: 1;
  z-index: 1;
}
#team-next {
  left: auto;
  right: 0;
}
.wheel-arrow:disabled {
  opacity: 0.3;
  cursor: default;
}
.wheel-selection {
  text-align: center;
  font-size: 15px;
  font-weight: 650;
  margin: 11px 0 0;
}
@media (max-width: 780px) {
  .brand {
    font-size: 18px;
  }
  .team-controls {
    width: auto;
  }
}
@media (max-width: 480px) {
  .brand {
    font-size: 18px;
    gap: 5px;
  }
  .brand-symbol {
    font-size: 23px;
  }
  .league {
    font-size: 10px;
    letter-spacing: 0;
  }
  .team-controls {
    display: block;
    width: auto;
    margin-left: 80px;
  }
  .team-picker {
    padding: 14px 10px 12px;
  }
  .picker-caption {
    padding: 0 4px;
    font-size: 11px;
  }
  .picker-caption > span:first-child {
    font-size: 11px;
    letter-spacing: 0.8px;
  }
  .team-wheel-shell {
    padding: 0 25px;
  }
  .wheel-arrow {
    width: 25px;
    height: 32px;
    font-size: 23px;
  }
  .team-wheel {
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wheel-logo {
    transition: none;
  }
}

/* Clear type and larger portrait-led cards, using the platform system font. */
body {
  -webkit-font-smoothing: antialiased;
}
.panel {
  box-shadow: 0 4px 24px #172b4504;
}
.section-head {
  padding-top: 24px;
  padding-bottom: 24px;
}
.section-head h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.position-labels {
  font-size: 12px;
  letter-spacing: 0.5px;
  color: #667085;
}
.line-row {
  padding-top: 20px;
  padding-bottom: 20px;
}
.player-card,
.lower-grid .player-card {
  min-height: 178px;
  padding: 20px 16px;
  gap: 16px;
  border-radius: 20px;
  background: #f7f8fa;
  border: 1px solid #edf0f4;
  box-shadow: 0 2px 6px #12233d03;
}
.portrait {
  width: 128px;
  height: 128px;
  background: linear-gradient(145deg, #e7ecf2, #f0f3f7);
}
.portrait-fallback {
  font-size: 32px;
}
.player-name,
.lower-grid .player-name {
  font-size: 23px;
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 7px 0 10px;
}
.player-name .first-name {
  font-size: 16px;
  font-weight: 500;
  color: #667085;
  margin-bottom: 4px;
}
.player-meta {
  font-size: 12px;
  color: #667085;
}
.player-stats,
.lower-grid .player-stats {
  font-size: 12px;
  color: #667085;
  line-height: 1.65;
  margin-top: 8px;
}
.form-badge {
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 7px;
  line-height: 1.4;
  max-width: 100%;
  white-space: normal;
  text-align: left;
}
.lower-grid .portrait {
  width: 96px;
  height: 96px;
}
.lower-grid .player-name {
  font-size: 20px;
}
.lower-grid .player-card {
  padding: 16px 12px;
  gap: 12px;
  min-height: 154px;
}
.goalie-slot .portrait {
  width: 144px;
  height: 144px;
}
.goalie-slot .player-card {
  padding: 24px 12px;
  min-height: 290px;
}
.goalie-slot .player-name {
  font-size: 23px;
}
.detail-identity .portrait {
  width: 160px;
  height: 160px;
}
.detail-identity h2 {
  font-size: 30px;
}
.detail-identity {
  gap: 22px;
}
#extras-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#extras-list .player-card {
  min-height: 190px;
}
.section-help,
.section-count,
.source-note,
.data-bar,
.small-muted {
  color: #667085;
}
.page-tools {
  flex-wrap: wrap;
  row-gap: 12px;
}
.page-tools > div {
  flex-wrap: wrap;
  row-gap: 10px;
}
.picker-caption {
  flex-wrap: wrap;
}
.legend {
  max-width: 360px;
  flex-wrap: wrap;
}
footer {
  flex-wrap: wrap;
  gap: 12px;
}
.refresh {
  padding: 10px 14px;
  border-radius: 12px;
  background: #e9edf2;
  color: #475467;
}
@media (max-width: 1100px) {
  .player-card {
    flex-direction: column;
    text-align: center;
    min-height: 260px;
  }
  .portrait {
    width: 124px;
    height: 124px;
  }
  .player-meta {
    justify-content: center;
  }
  .player-name {
    font-size: 21px;
  }
  .form-badge {
    text-align: center;
  }
  .lower-grid .player-card {
    flex-direction: column;
    text-align: center;
    min-height: 235px;
  }
  .lower-grid .portrait {
    width: 108px;
    height: 108px;
  }
  .lower-grid .player-name {
    font-size: 19px;
  }
  .goalie-slot .portrait {
    width: 132px;
    height: 132px;
  }
  #extras-list .player-card {
    min-height: 260px;
  }
}
@media (max-width: 780px) {
  .overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .overview-label {
    font-size: 11px;
  }
  .overview small {
    font-size: 12px;
  }
  .overview > a {
    padding: 18px;
  }
  .portrait {
    width: 112px;
    height: 112px;
  }
  .player-card {
    padding: 18px 8px;
    min-height: 250px;
  }
  .player-name {
    font-size: 19px;
  }
  .player-name .first-name {
    font-size: 14px;
  }
  .lower-grid .player-card {
    flex-direction: column;
    text-align: center;
    padding: 18px 8px;
  }
  .lower-grid .player-meta {
    justify-content: center;
  }
  .lower-grid .portrait {
    width: 96px;
    height: 96px;
  }
  .lower-grid .player-name {
    font-size: 18px;
  }
  .goalie-slot .portrait {
    width: 116px;
    height: 116px;
  }
  .detail-identity .portrait {
    width: 132px;
    height: 132px;
  }
  .league {
    display: none;
  }
  .brand {
    font-size: 21px;
  }
  .section-count {
    display: none;
  }
  .form-guide {
    flex-wrap: wrap;
  }
  .form-guide > div:nth-child(2) {
    flex: 1;
  }
  .legend {
    display: flex;
    max-width: none;
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }
}
@media (max-width: 480px) {
  .team-header h1 {
    font-size: 28px;
  }
  .team-identity p {
    font-size: 14px;
  }
  .player-card {
    min-height: 230px;
    padding: 14px 5px;
    gap: 10px;
    border-radius: 16px;
  }
  #forward-lines .portrait {
    width: min(96px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
  .player-name {
    font-size: 16px;
    letter-spacing: -0.25px;
  }
  .player-name .first-name {
    font-size: 13px;
    line-height: 1.3;
  }
  .player-meta {
    font-size: 11px;
  }
  .player-stats {
    font-size: 11px;
  }
  .form-badge {
    font-size: 10px;
    padding: 5px 4px;
  }
  .position-labels {
    font-size: 10px;
    letter-spacing: 0;
  }
  .section-head h2 {
    font-size: 20px;
  }
  .lower-grid .player-card {
    flex-direction: column;
    text-align: center;
    min-height: 250px;
    padding: 18px 10px;
  }
  .lower-grid .portrait {
    width: 112px;
    height: 112px;
    max-width: 100%;
  }
  .lower-grid .player-name {
    font-size: 19px;
  }
  .lower-grid .player-stats {
    font-size: 12px;
  }
  .lower-grid .form-badge {
    font-size: 12px;
  }
  .goalie-slot .portrait {
    width: 128px;
    height: 128px;
  }
  .goalie-slot .player-card {
    min-height: 290px;
  }
  #extras-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  #extras-list .player-card {
    min-height: 265px;
  }
  #extras-list .portrait {
    width: min(112px, 100%);
    height: auto;
    aspect-ratio: 1;
  }
  #extras-list .player-name {
    font-size: 19px;
  }
  .detail-identity .portrait {
    width: 110px;
    height: 110px;
  }
  .detail-identity h2 {
    font-size: 25px;
  }
  .detail-identity {
    gap: 14px;
  }
  .overview strong {
    font-size: 25px;
  }
  .picker-caption {
    font-size: 11px;
  }
}

/* The team wheel spans the viewport while the roster keeps its readable width. */
.team-picker {
  width: 100vw;
  position: relative;
  left: 50%;
  margin-left: -50vw;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  padding-left: max(20px, calc((100vw - 1280px) / 2));
  padding-right: max(20px, calc((100vw - 1280px) / 2));
}
.team-wheel-shell {
  margin-left: calc(-1 * max(20px, (100vw - 1280px)/2) + 20px);
  margin-right: calc(-1 * max(20px, (100vw - 1280px)/2) + 20px);
}
.injury-status {
  margin: -4px 0 18px;
  font-size: 12px;
  line-height: 1.6;
  color: #667085;
}
.injury-mark {
  display: inline-block;
  font-size: 0.85em;
  vertical-align: baseline;
  cursor: help;
  margin-left: 2px;
}
@media (max-width: 480px) {
  .team-picker {
    padding-left: 14px;
    padding-right: 14px;
  }
  .team-wheel-shell {
    margin-left: 0;
    margin-right: 0;
  }
}
.top-mark {
  display: inline-block;
  font-size: 0.85em;
  vertical-align: baseline;
  margin-left: 2px;
  cursor: help;
}
.leaders-status {
  margin: -10px 0 18px;
  font-size: 12px;
  color: #667085;
  line-height: 1.6;
}

.portrait.is-fallback {
  background: linear-gradient(
    145deg,
    var(--team-primary, var(--primary)),
    color-mix(in srgb, var(--team-primary, var(--primary)) 78%, white)
  );
  box-shadow: inset 0 0 0 1px #ffffff18;
}
.portrait.is-fallback .portrait-fallback {
  color: var(--portrait-ink, #fff);
}
.line-source-banner {
  margin: 24px 0 18px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.line-source-banner h2 {
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 8px 0;
}
.line-source-banner p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.8;
}
.line-source-banner a {
  font-size: 13px;
  color: var(--primary);
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 15px;
}
.line-tabs {
  display: flex;
  justify-content: center;
  gap: 28px;
  width: fit-content;
  max-width: 100%;
  padding: 0;
  background: transparent;
  margin: 0 auto 28px;
}
.line-tabs button {
  padding: 14px 4px;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  font-weight: 650;
  font-size: 14px;
  color: #667085;
}
.line-tabs button[aria-selected="true"] {
  background: transparent;
  color: var(--primary);
  border-bottom-color: var(--accent);
}
.lines-empty {
  padding: 32px 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}
.special-unit {
  padding: 24px;
  border-bottom: 1px solid var(--border);
}
.special-unit:last-child {
  border-bottom: 0;
}
.special-unit h3 {
  font-size: 16px;
  margin: 0 0 18px;
  color: var(--primary);
}
.special-unit-players {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 15px;
}
.special-unit-players .player-card {
  grid-column: span 2;
}
.special-unit-players.count-5 .player-card:nth-child(n + 4),
.special-unit-players.count-4 .player-card {
  grid-column: span 3;
}
@media (max-width: 780px) {
  .line-source-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
@media (max-width: 480px) {
  .line-tabs {
    width: fit-content;
    gap: 18px;
  }
  .line-tabs button {
    padding: 12px 2px;
    font-size: 12px;
  }
  .line-source-banner {
    padding: 20px;
  }
  .line-source-banner h2 {
    font-size: 20px;
  }
  .special-unit {
    padding: 18px 12px;
  }
  .special-unit-players {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .special-unit-players .player-card,
  .special-unit-players.count-5 .player-card:nth-child(n + 4),
  .special-unit-players.count-4 .player-card {
    grid-column: span 1;
  }
  .special-unit-players.count-5 .player-card:last-child {
    grid-column: 1 / -1;
  }
}
