/* Uniform Select page styles. fbUniforms.py copies this file to html/stats/football/uniforms/. */

/* The game's pixel type, subset and self-hosted by fbUniforms.py (license beside it) */
@font-face { font-family: 'Press Start 2P'; src: url('fonts/PressStart2P.woff') format('woff');
  font-weight: 400; font-display: swap; }

:root {
  --bg:          #101118;   /* the room around the screen */
  --ink:         #0c0d16;   /* pixel outlines and hard borders */
  --tech-blue:   #123d8f;
  --tech-red:    #b3262f;
  --paper:       #e6dec6;
  --paper-ink:   #2b2a26;
  --white:       #f4f4ef;
  --muted:       #b9bdc9;
  --win:         #2f9e44;
  --loss:        #d6333f;
  --pixel: 'Press Start 2P', ui-monospace, Menlo, monospace;
  /* Sprite scales: each art pixel drawn this many CSS pixels wide */
  --hs: 6;                  /* helmet */
  --ps: 6;                  /* player */
  --ss: 2;                  /* stickers */
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--white);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
button { font: inherit; color: inherit; }
main { max-width: 1240px; margin: 0 auto; padding: 18px 16px 40px; }

/* ----------------------------------------------------------------- page */
.pagehead { position: relative; text-align: center; margin-bottom: 18px; }
.pagehead h1 { margin: 0; font: 400 26px/1.4 var(--pixel); letter-spacing: 0.02em;
  color: var(--white); text-shadow: 3px 3px 0 var(--tech-red), 6px 6px 0 var(--ink); }
.sub { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* -------------------------------------------------------------- screen */
/* Three bands like the game's matchup screen: Tech blue, a paper strip, Tech red, over a hint bar */
/* A fixed height, so flipping between combos never moves the page; the game log scrolls instead */
.screen { position: relative; display: grid; grid-template-columns: 34fr 22fr 44fr; grid-template-rows: minmax(0, 1fr) auto;
  height: 700px; overflow: hidden; font-family: var(--pixel); background: var(--paper);
  box-shadow: 0 0 0 4px var(--ink), 0 0 0 8px #2b2e3d, 0 20px 50px rgba(0, 0, 0, 0.55); }
/* A band never outgrows its row; the game log scrolls inside the paper band instead */
.band { position: relative; padding: 92px 20px 22px; min-width: 0; min-height: 0; }
/* The two team bands overlap the paper a little; fbUniforms.js tears their edges */
.band.blue { z-index: 1; margin-right: -10px; background-color: var(--tech-blue);
  display: flex; flex-direction: column; }
.band.red { z-index: 1; margin-left: -10px; padding-left: 30px; background-color: var(--tech-red);
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.band.paper { padding: 92px 22px 22px; background-color: var(--paper); color: var(--paper-ink); }
/* A grain of pixel noise over each band (drawn by fbUniforms.js) */
.band, .screen { background-size: 192px 192px; image-rendering: pixelated; }

/* Stickers slapped along the top edge, half off the screen */
.stickers { position: absolute; z-index: 2; left: 0; right: 0; top: 0; height: 84px; pointer-events: none; }
.sticker { position: absolute; image-rendering: pixelated;
  filter: drop-shadow(2px 0 0 #fff) drop-shadow(-2px 0 0 #fff) drop-shadow(0 2px 0 #fff) drop-shadow(0 -2px 0 #fff)
          drop-shadow(3px 4px 0 rgba(0, 0, 0, 0.35)); }

canvas { display: block; image-rendering: pixelated; image-rendering: crisp-edges; }

/* ------------------------------------------------------------- helmet */
.helmet { display: flex; justify-content: center; margin: 4px 0 18px; touch-action: pan-y; cursor: grab; }
.helmet canvas { width: calc(50px * var(--hs)); max-width: 100%; height: auto; }
/* The stickers are small pixel images blown up, so keep their pixels square */
.sticker { height: auto; }

/* The team card, laid out like the game's: tag, logo and name, then three numbers */
.team { position: relative; margin-top: auto; padding: 28px 14px 14px; border: 2px dashed rgba(255, 255, 255, 0.28); }
.tag { position: absolute; left: 14px; top: -14px; padding: 7px 10px; background: var(--ink); color: var(--white);
  font-size: 10px; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.35); }
.tag.never { background: #5b5f6e; }
.team-id { display: flex; align-items: center; gap: 14px; }
.team-logo canvas { width: calc(19px * 4); height: auto; }
.team-name { margin: 0; display: flex; flex-direction: column; gap: 8px; line-height: 1.1; }
.team-name b { font-weight: 400; font-size: 17px; text-shadow: 2px 2px 0 var(--ink); }
.team-name span { font-size: 12px; color: #cdd6ee; }
.stats { display: flex; justify-content: center; gap: 6px; margin: 16px auto 0; padding: 10px 12px; width: fit-content;
  background: var(--ink); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.35); transform: rotate(-1deg); }
.stat { min-width: 76px; text-align: center; }
.stat b { display: block; font-weight: 400; font-size: 24px; line-height: 1.2; }
.stat b::before { content: '\25B6'; font-size: 11px; vertical-align: 5px; margin-right: 4px; color: var(--muted); }
.stat span { font-size: 9px; color: var(--muted); }
.span { margin: 12px 0 0; text-align: center; font-size: 9px; line-height: 1.6; color: #cdd6ee; }

/* ------------------------------------------------------------ game log */
.paper { display: flex; flex-direction: column; align-items: center; }
.stamp { padding: 12px 16px 10px; background: var(--ink); color: var(--paper); font-size: 15px;
  transform: rotate(-2deg); box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.25); }
.paper .log { flex: 1; min-height: 0; }
.log { list-style: none; width: 100%; margin: 20px 0 0; padding: 0 2px 0 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--paper-ink) transparent; }
.log li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 8px;
  padding: 8px 6px 7px; font-size: 9px; line-height: 1.5; border-bottom: 2px dotted rgba(43, 42, 38, 0.35); }
.log .yr { color: #6b675c; }
.log .opp { min-width: 0; }
.log .note { display: block; margin-top: 4px; font-size: 7px; color: var(--loss); }
.log .res { padding: 3px 4px 2px; color: #fff; font-size: 9px; }
.log .res.W { background: var(--win); }
.log .res.L { background: var(--loss); }
.log .res.T { background: #77736a; }
.log .empty { display: block; text-align: center; line-height: 2; border: 0; color: #6b675c; }

/* ---------------------------------------------------------------- menu */
.menu { flex: 1; min-width: 0; align-self: center; }
.menu-tag { display: inline-block; padding: 8px 10px 7px; margin-bottom: 10px; background: var(--ink); font-size: 11px;
  transform: rotate(-1deg); }
.rows { display: flex; flex-direction: column; gap: 8px; }
/* Each row: a dark slot holding a plate with the piece's name; the picked row turns white with arrows */
.row { display: grid; grid-template-columns: 30px 1fr 30px; align-items: stretch;
  background: rgba(12, 13, 22, 0.55); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.12); touch-action: pan-y; }
.row .arrow { border: 0; background: transparent; font-size: 12px; cursor: pointer; opacity: 0.35; }
.row .arrow:hover { opacity: 1; }
.row .pick { margin: 6px 0; padding: 9px 6px 7px; border: 0; background: rgba(255, 255, 255, 0.1); cursor: pointer;
  text-align: center; line-height: 1.5; min-width: 0; }
/* Long names (Columbia Blue Jersey) wrap to a second line rather than getting cut off */
.row .label { display: block; font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.row .detail { display: block; margin-top: 3px; font-size: 8px; color: #e9c8cb; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; }
.row.active { background: rgba(255, 255, 255, 0.92); box-shadow: inset 0 0 0 2px #fff, 0 0 0 3px var(--ink); }
.row.active .arrow { color: var(--ink); opacity: 1; }
.row.active .pick { background: var(--ink); color: #fff; }
.row.active .detail { color: var(--muted); }
.row button:focus-visible { outline: 2px solid #ffd447; outline-offset: -2px; }

/* --------------------------------------------------------------- player */
.player { flex: none; align-self: flex-end; touch-action: pan-y; cursor: grab; }
.player canvas { width: calc(40px * var(--ps)); height: auto; }

/* ---------------------------------------------------------------- hints */
.hints { grid-column: 1 / -1; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px;
  padding: 14px 24px; background: #17181f; box-shadow: 0 -4px 0 var(--ink); font-size: 10px; }
.hint { display: inline-flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--white); }
button.hint, a.hint { cursor: pointer; text-decoration: none; }
button.hint:hover, a.hint:hover { color: #ffd447; }
button.hint:focus-visible, a.hint:focus-visible { outline: 2px solid #ffd447; outline-offset: 4px; }
.key { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 22px; padding: 0 5px;
  font-style: normal; font-size: 9px; color: var(--ink); background: var(--white); box-shadow: 2px 2px 0 #000; }
.key.round { min-width: 22px; border-radius: 50%; }

footer { text-align: center; }
footer .gtpdd { display: block; width: fit-content; margin: 34px auto 10px; }
footer .gtpdd img { display: block; width: 160px; height: auto; }

/* --------------------------------------------------------- narrower */
@media (max-width: 1100px) {
  :root { --hs: 5; --ps: 4; }
  .screen { grid-template-columns: 36fr 22fr 42fr; }
  .stat { min-width: 62px; }
  .stat b { font-size: 20px; }
}
/* Phones and small tablets: the bands stack, helmet and record first, then the menu, then the games */
@media (max-width: 860px) {
  :root { --hs: 5; --ps: 4; --ss: 1.5; }
  .screen { grid-template-columns: 1fr; grid-template-rows: none; height: auto; }
  .band { padding: 82px 16px 18px; }
  .band.blue { margin: 0 0 -10px; }
  .band.red { order: 2; margin: 0 0 -10px; padding: 34px 16px 26px; align-items: center; }
  .band.paper { order: 3; padding-top: 34px; }
  .hints { order: 4; gap: 8px 18px; padding: 12px 16px; font-size: 9px; }
  .paper .log { flex: none; height: 300px; }
  .pagehead h1 { font-size: 20px; }
}
@media (max-width: 430px) {
  :root { --hs: 4; --ps: 3; --ss: 1.25; }
  .row .label { font-size: 9px; }
  .team-name b { font-size: 13px; }
  .stat { min-width: 54px; }
  .stat b { font-size: 17px; }
}

/* ------------------------------------------------------- preview mode */
/* '?preview': just the screen at 1200x630, for the script's link-preview screenshot */
.preview body { background: var(--paper); }
.preview main { max-width: none; padding: 0; }
.preview .pagehead, .preview footer, .preview .hints { display: none; }
.preview .screen { height: 630px; box-shadow: none; grid-template-rows: minmax(0, 1fr); }
.preview .log { overflow: hidden; }
