:root {
  --margin: 0.25in;
  --page-w: 11in;
  --page-h: 8.5in;

  --row-1-top: 6.11in;  /* anchor for Player 1 */
  --row-gap:   0.174in;  /* change this once to tighten/loosen spacing */

  --font: Arial, Helvetica, sans-serif;
  --text: #000;
}

@page {
  size: Letter landscape;
  margin: var(--margin);
}

@media print {
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .screen-only { display: none !important; }
  .guide { outline: none !important; }
}

html, body {
  height: 100%;
  margin: 0;
  background: #fff;
  font-family: var(--font);
  color: var(--text);
}

.toolbar.screen-only {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  border-bottom: 1px solid #ddd;
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn {
  border: 1px solid #bbb;
  background: #f7f7f7;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
}
.btn:hover { background: #eee; }

/* Printable area */
.printable {
  width: calc(var(--page-w) - 2 * var(--margin));
  height: calc(var(--page-h) - 2 * var(--margin));
  margin: 0 auto;
  position: relative;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 108% 108%;
}
.overlay { position: absolute; inset: 0; }

.cell {
  position: absolute;
  display: flex;
  align-items: center;
  padding: 0 0.08in;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
  font-size: 10pt;
}
.small { font-size: 10pt; font-weight: 700; }
/* Utility class: center content */
.center { justify-content: center; text-align: center; }


/* ======= HEADER CELLS ======= */
.cell-home-team { left: 0.52in; top: 0.90in; width: 4.555in; height: 0.195in; }
.cell-away-team { left: 5.68in; top: 0.90in; width: 4.555in; height: 0.195in; }
.cell-week      { left: 6.33in; top: 0.63in; width: 0.94in; height: 0.25in; }
.cell-date      { left: 7.435in; top: 0.63in; width: 2.80in; height: 0.25in; }
.cell-header    { left: 0.10in; top: 0.63in; width: 6.05in; height: 0.25in; }
.cell-top-header { left: 2.48in; top: 0.05in; width: 5.29in; height: 0.20in; }

/* ======= HOME PLAYER ROWs (driven by 2 variables) ======= */
/* P1 = anchor */
.cell-home-player-1-running-average { left: 0.10in; top: var(--row-1-top); width: 0.46in; height: 0.155in; }
.cell-home-player-1-name            { left: 0.69in; top: var(--row-1-top); width: 2.34in; height: 0.155in; }
.cell-home-player-1-wins            { left: 3.26in; top: var(--row-1-top); width: 0.51in; height: 0.155in; }
.cell-home-player-1-losses          { left: 3.94in; top: var(--row-1-top); width: 0.45in; height: 0.155in; }
.cell-home-player-1-season-average  { left: 4.56in; top: var(--row-1-top); width: 0.51in; height: 0.155in; }

/* P2 = P1 + 1*gap */
.cell-home-player-2-running-average { left: 0.10in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-2-name            { left: 0.69in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-2-wins            { left: 3.26in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-2-losses          { left: 3.94in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-2-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P3 = P1 + 2*gap */
.cell-home-player-3-running-average { left: 0.10in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-3-name            { left: 0.69in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-3-wins            { left: 3.26in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-3-losses          { left: 3.94in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-3-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P4 = P1 + 3*gap */
.cell-home-player-4-running-average { left: 0.10in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-4-name            { left: 0.69in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-4-wins            { left: 3.26in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-4-losses          { left: 3.94in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-4-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P5 = P1 + 4*gap */
.cell-home-player-5-running-average { left: 0.10in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-5-name            { left: 0.69in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-5-wins            { left: 3.26in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-5-losses          { left: 3.94in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-5-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P6 = P1 + 5*gap */
.cell-home-player-6-running-average { left: 0.10in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-6-name            { left: 0.69in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-6-wins            { left: 3.26in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-6-losses          { left: 3.94in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-6-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P7 = P1 + 6*gap */
.cell-home-player-7-running-average { left: 0.10in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-7-name            { left: 0.69in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-7-wins            { left: 3.26in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-7-losses          { left: 3.94in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-7-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P8 = P1 + 7*gap */
.cell-home-player-8-running-average { left: 0.10in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-8-name            { left: 0.69in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-8-wins            { left: 3.26in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-8-losses          { left: 3.94in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-8-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P9 = P1 + 8*gap */
.cell-home-player-9-running-average { left: 0.10in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-9-name            { left: 0.69in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-9-wins            { left: 3.26in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-9-losses          { left: 3.94in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-9-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P10 = P1 + 9*gap */
.cell-home-player-10-running-average { left: 0.10in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-home-player-10-name            { left: 0.69in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 2.34in; height: 0.155in; }
.cell-home-player-10-wins            { left: 3.26in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.51in; height: 0.155in; }
.cell-home-player-10-losses          { left: 3.94in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.45in; height: 0.155in; }
.cell-home-player-10-season-average  { left: 4.56in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.51in; height: 0.155in; }


/* ======= AWAY PLAYER ROWs (driven by 2 variables) ======= */

/* P1 (anchor row) */
.cell-away-player-1-running-average { left: 5.26in; top: var(--row-1-top); width: 0.46in; height: 0.155in; }
.cell-away-player-1-name            { left: 5.85in; top: var(--row-1-top); width: 2.385in; height: 0.155in; }
.cell-away-player-1-wins            { left: 8.455in; top: var(--row-1-top); width: 0.485in; height: 0.155in; }
.cell-away-player-1-losses          { left: 9.11in; top: var(--row-1-top); width: 0.44in; height: 0.155in; }
.cell-away-player-1-season-average  { left: 9.72in; top: var(--row-1-top); width: 0.51in; height: 0.155in; }

/* P2 */
.cell-away-player-2-running-average { left: 5.26in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-2-name            { left: 5.85in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-2-wins            { left: 8.455in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-2-losses          { left: 9.11in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.44in; height: 0.155in; }
.cell-away-player-2-season-average  { left: 9.72in; top: calc(var(--row-1-top) + 1 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P3 */
.cell-away-player-3-running-average { left: 5.26in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-3-name            { left: 5.85in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-3-wins            { left: 8.455in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-3-losses          { left: 9.11in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.44in; height: 0.155in; }
.cell-away-player-3-season-average  { left: 9.72in; top: calc(var(--row-1-top) + 2 * var(--row-gap)); width: 0.51in; height: 0.155in; }

/* P4 */
.cell-away-player-4-running-average { left: 5.26in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-4-name            { left: 5.85in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-4-wins            { left: 8.455in; top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-4-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-4-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 3 * var(--row-gap)); width: 0.51in;  height: 0.155in; }

/* P5 */
.cell-away-player-5-running-average { left: 5.26in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-5-name            { left: 5.85in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-5-wins            { left: 8.455in; top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-5-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-5-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 4 * var(--row-gap)); width: 0.51in;  height: 0.155in; }

/* P6 */
.cell-away-player-6-running-average { left: 5.26in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-6-name            { left: 5.85in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-6-wins            { left: 8.455in; top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-6-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-6-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 5 * var(--row-gap)); width: 0.51in;  height: 0.155in; }

/* P7 */
.cell-away-player-7-running-average { left: 5.26in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-7-name            { left: 5.85in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-7-wins            { left: 8.455in; top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-7-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-7-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 6 * var(--row-gap)); width: 0.51in;  height: 0.155in; }

/* P8 */
.cell-away-player-8-running-average { left: 5.26in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-8-name            { left: 5.85in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-8-wins            { left: 8.455in; top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-8-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-8-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 7 * var(--row-gap)); width: 0.51in;  height: 0.155in; }

/* P9 */
.cell-away-player-9-running-average { left: 5.26in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-9-name            { left: 5.85in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-9-wins            { left: 8.455in; top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-9-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-9-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 8 * var(--row-gap)); width: 0.51in;  height: 0.155in; }

/* P10 */
.cell-away-player-10-running-average { left: 5.26in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.46in; height: 0.155in; }
.cell-away-player-10-name            { left: 5.85in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 2.385in; height: 0.155in; }
.cell-away-player-10-wins            { left: 8.455in; top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.485in; height: 0.155in; }
.cell-away-player-10-losses          { left: 9.11in;  top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.44in;  height: 0.155in; }
.cell-away-player-10-season-average  { left: 9.72in;  top: calc(var(--row-1-top) + 9 * var(--row-gap)); width: 0.51in;  height: 0.155in; }


/* Guides */
.show-guides .cell {
  outline: 1px dashed rgba(50, 120, 255, .6);
  background: rgba(46, 95, 192, 0.05);
}
