/* 卡牌版 Team Sheet (2026-10-08). Its own file: the main stylesheet's Team Sheet tail is guarded by tests.
   The board is a fixed 1920×1080 picture (always dark, like a game screenshot); the dialog shows it scaled down. */

/* 表格版｜卡牌版 switch in the 陣容總覽 header. */
.v4-sheet-style { display: inline-flex; flex: 0 0 auto; border: 1px solid var(--lineup-line-strong); border-radius: var(--lineup-radius-sm); overflow: hidden; }
.v4-sheet-style button { min-height: 38px; padding: 0 11px; border: 0; background: transparent; color: var(--lineup-text-soft); font-size: 12.5px; font-weight: 750; white-space: nowrap; }
.v4-sheet-style button + button { border-left: 1px solid var(--lineup-line-strong); }
.v4-sheet-style button:hover { color: var(--lineup-text); }
.v4-sheet-style button[aria-pressed="true"] { background: var(--lineup-clay); color: #17110d; }

#rosterOverviewContent[hidden], .v4-card-sheet-frame[hidden] { display: none !important; }

.v4-card-sheet-frame { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 14px 18px 16px; background: var(--lineup-surface); }
.v4-card-sheet-stage { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 8px; background: #0b0d0e; }
.v4-card-sheet-stage > .v4-card-sheet { position: absolute; top: 0; left: 0; transform-origin: 0 0; transform: scale(var(--card-sheet-scale, .5)); }
.v4-card-sheet-caption { margin: 8px 0 0; color: var(--lineup-muted); font-size: 12px; line-height: 1.5; }

@media (max-width: 960px) {
  .v4-card-sheet-frame { padding: 10px 12px 14px; }
  /* Phones: the switch takes its own line under 下載 PNG ×, so the header columns keep their old widths (the title
     「陣容總覽」 must not be squeezed into one character per line). A two-column grid, because a wrapping row would
     still ask the header for its one-line width. */
  .roster-overview-header-actions { display: grid; grid-template-columns: auto auto; justify-content: end; gap: 8px; }
  .v4-sheet-style { grid-column: 1 / -1; grid-row: 2; }
  .v4-sheet-style button { flex: 1 1 0; }
}

/* ---- The board itself (fixed size, fixed colours) ---- */
.v4-card-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  width: 1920px;
  height: 1080px;
  padding: 26px 40px 34px;
  overflow: hidden;
  background-color: #0b0d0e;
  color: #f4ede6;
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", system-ui, sans-serif;
  text-align: left;
}
.v4-card-sheet *, .v4-card-sheet *::before, .v4-card-sheet *::after { box-sizing: border-box; }
.v4-card-sheet [hidden] { display: none !important; }
.v4-card-sheet-watermark { position: absolute; right: -30px; bottom: -70px; z-index: 0; width: auto; height: 720px; opacity: .1; pointer-events: none; }
.v4-card-sheet-watermark.is-badge { right: 20px; bottom: 20px; width: 820px; height: 620px; background-position: right bottom; background-repeat: no-repeat; background-size: contain; opacity: .14; }
.v4-card-sheet > :not(.v4-card-sheet-watermark) { position: relative; z-index: 1; }

.v4-card-sheet-header { display: flex; align-items: center; justify-content: space-between; height: 48px; }
.v4-card-sheet-brand { display: flex; align-items: center; gap: 12px; }
.v4-card-sheet-brand img { width: auto; height: 42px; }
.v4-card-sheet-brand b { color: #f4ede6; font: 700 24px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; letter-spacing: .14em; }
.v4-card-sheet-brand span { color: #c9b8a8; font-size: 20px; font-weight: 700; }
.v4-card-sheet-date { color: #c9b8a8; font: 700 20px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; letter-spacing: .08em; }

.v4-card-sheet-row.is-pitchers { display: flex; justify-content: center; gap: 44px; }
.v4-card-sheet-lower { display: grid; grid-template-columns: 1324px minmax(0, 1fr); column-gap: 44px; }
.v4-card-sheet-batters { display: flex; flex-direction: column; align-items: center; gap: 26px; }

.v4-card-sheet-group { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.v4-card-sheet-group h3 { margin: 0; color: #ffffff; font-size: 26px; font-weight: 700; line-height: 32px; letter-spacing: .1em; }
.v4-card-sheet-cards { display: flex; gap: 8px; }

.v4-card-sheet-card { position: relative; width: 140px; height: 244px; overflow: hidden; border: 3px solid #79c8ff; border-radius: 10px; background-color: #161b20; }
.v4-card-sheet-art { position: absolute; top: 40px; right: 0; bottom: 54px; left: 0; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.v4-card-sheet-art img { flex: 0 0 auto; width: auto; max-width: none; height: 100%; }
.v4-card-sheet-fallback { display: flex; align-items: center; justify-content: center; width: 86px; height: 86px; margin-bottom: 34px; border: 2px solid rgba(255, 255, 255, .28); border-radius: 50%; background: rgba(255, 255, 255, .1); color: #ffffff; font-size: 28px; font-weight: 700; }
/* Logo + OVR strip: the art starts below it, so the OVR never covers a face. */
.v4-card-sheet-top { position: absolute; top: 0; right: 0; left: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 7px; background: rgba(6, 8, 10, .55); }
.v4-card-sheet-logo { display: block; height: 30px; }
.v4-card-sheet-logo img { display: block; width: auto; height: 30px; }
.v4-card-sheet-ovr { color: #ffb36b; font: 700 32px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; }
.v4-card-sheet-badges { position: absolute; right: 6px; bottom: 60px; left: 6px; display: flex; align-items: flex-end; justify-content: space-between; gap: 4px; }
.v4-card-sheet-position { padding: 4px 7px; border-radius: 5px; background: rgba(0, 0, 0, .66); color: #ffffff; font: 700 18px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; }
.v4-card-sheet-tag { padding: 5px 7px; border-radius: 5px; font-size: 14px; font-weight: 700; line-height: 1; white-space: nowrap; }
.v4-card-sheet-tag.is-fa { background: #c48e55; color: #17110d; }
.v4-card-sheet-tag.is-external { background: #5d6670; color: #ffffff; }
.v4-card-sheet-tag.is-national { background: #3f63a8; color: #ffffff; }
.v4-card-sheet-nameplate { position: absolute; right: 0; bottom: 0; left: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; height: 54px; padding: 0 6px; background: rgba(6, 8, 10, .86); }
.v4-card-sheet-nameplate strong, .v4-card-sheet-nameplate span { display: block; width: 100%; text-align: center; white-space: nowrap; }
.v4-card-sheet-nameplate strong { color: #ffffff; font-size: 19px; font-weight: 700; line-height: 1.12; }
.v4-card-sheet-nameplate span { color: #cfd6dc; font-size: 13.5px; font-weight: 700; line-height: 1.12; }

.v4-card-sheet-card.is-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 2px dashed rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .04); }
.v4-card-sheet-empty-code { color: rgba(255, 255, 255, .6); font: 700 26px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; }
.v4-card-sheet-empty-note { color: rgba(255, 255, 255, .5); font-size: 16px; font-weight: 700; }

/* Deck panel: right of 先發打者 / 候補打者. */
.v4-card-sheet-panel { display: flex; flex-direction: column; gap: 16px; padding: 20px 24px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 16px; background: rgba(6, 8, 10, .58); }
.v4-card-sheet-panel small { display: block; color: #b9aa9c; font-size: 16px; font-weight: 700; line-height: 1.2; letter-spacing: .06em; }
.v4-card-sheet-deck strong { display: block; width: 100%; margin-top: 6px; color: #ffffff; font-size: 34px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.v4-card-sheet-average strong { display: block; margin-top: 6px; color: #ffb36b; font: 700 64px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; }
.v4-card-sheet-average span { display: block; margin-top: 6px; color: #b9aa9c; font-size: 15px; font-weight: 700; }
.v4-card-sheet-bonus { display: flex; flex-direction: column; gap: 10px; }
.v4-card-sheet-bonus h4, .v4-card-sheet-extras h4 { margin: 0; color: #b9aa9c; font-size: 16px; font-weight: 700; letter-spacing: .06em; }
.v4-card-sheet-bonus-row { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; }
.v4-card-sheet-bonus-role { color: #ffffff; font-size: 19px; font-weight: 700; }
.v4-card-sheet-bonus-chips { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.v4-card-sheet-bonus-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 2px 6px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 8px; background: rgba(255, 255, 255, .07); }
.v4-card-sheet-bonus-chip small { color: #c9b8a8; font-size: 14px; letter-spacing: 0; }
.v4-card-sheet-bonus-chip b { color: #ffffff; font: 700 23px/1 Bahnschrift, "Arial Narrow", Arial, sans-serif; }
.v4-card-sheet-bonus-none { color: #b9aa9c; font-size: 17px; font-weight: 700; }
.v4-card-sheet-bonus-note { margin: 0; color: #9d9087; font-size: 13.5px; font-weight: 700; line-height: 1.4; }
.v4-card-sheet-extras { display: flex; flex-direction: column; gap: 4px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, .12); }
.v4-card-sheet-extras p { display: flex; gap: 10px; margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }
.v4-card-sheet-extras b { flex: 0 0 34px; color: #ffb36b; font-family: Bahnschrift, "Arial Narrow", Arial, sans-serif; }
.v4-card-sheet-extras span { color: #f4ede6; }
.v4-card-sheet-tag.is-obsidian { background: #3b2063; color: #ffffff; border: 1px solid #b48cff; }
