/* Premier League game screen (epl-match.js). Everything is prefixed em-. */
body.em-open { overflow: hidden; }
.em {
  position: fixed; inset: 0; z-index: 50; overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: var(--bg); color: var(--text); font-family: var(--font);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
}
.em button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.em-muted { color: var(--muted); }
.em-small { font-size: 12px; }
.em-right { text-align: right; }
.em-good { color: var(--accent); }
.em-bad { color: #f59e0b; }

.em-top {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  padding: calc(6px + env(safe-area-inset-top)) 6px 4px;
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(12px);
}
.em-ibtn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; }
.em-ibtn:active { background: var(--card); }
.em-league { font-size: 13px; font-weight: 700; color: var(--muted); }

.em-hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; padding: 8px 12px 14px; }
.em-side { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.em-crest { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; }
.em-crest.big { width: 56px; height: 56px; font-size: 14px; }
.em-crest img { width: 100%; height: 100%; object-fit: contain; }
.em-tname { font-weight: 700; font-size: 15px; line-height: 1.2; }
.em-tname.lost { color: var(--muted); }
.em-tsub { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.em-mid { display: grid; justify-items: center; gap: 4px; min-width: 112px; text-align: center; }
.em-score { font-size: 42px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -1px; line-height: 1.05; }
.em-score.sm { font-size: 28px; letter-spacing: -.5px; }
.em-kick { font-size: 11px; font-weight: 800; color: var(--accent); letter-spacing: .06em; }
.em-when { font-size: 12px; font-weight: 600; color: var(--muted); }
.em-live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; color: var(--live); }
.em-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); animation: pulse 1.4s ease-in-out infinite; }
.em-goals { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 0 16px 12px; font-size: 13px; }
.em-goalcol { display: grid; gap: 2px; align-content: start; justify-items: center; }
.em-link { padding: 2px 0; text-align: left; color: var(--text); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--text) 30%, transparent); text-underline-offset: 3px; }

.em-tabs { display: flex; margin: 0 8px; border-bottom: 1px solid var(--line); position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 1; background: var(--bg); }
.em-tab { flex: 1; padding: 12px 0 10px; font-size: 13px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent !important; }
.em-tab.on { color: var(--accent); border-bottom-color: var(--accent) !important; }

.em-body { display: flex; flex-direction: column; gap: 18px; padding: 16px; }
.em-sec { margin: 0; }
.em-h { margin: 0 2px 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.em-hnote { margin-left: 6px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.em-card { background: var(--card); border-radius: 16px; padding: 14px; font-size: 14px; }
.em-stack { display: flex; flex-direction: column; gap: 12px; }
.em-err { color: var(--live); }
.em-foot { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 10px; }
.em-big { font-size: 22px; font-weight: 800; letter-spacing: -.3px; font-variant-numeric: tabular-nums; }
.em-prow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.em-pbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; gap: 2px; }
.em-pbar div { min-width: 2px; }
.em-chart { margin-top: 2px; }
.em-legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.em-legend span { display: inline-flex; align-items: center; gap: 6px; }
.em-legend i { width: 10px; height: 3px; border-radius: 2px; display: inline-block; }

.em-pills { display: flex; gap: 4px; }
.em-pill { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; background: #5b6677; color: #fff; }
.em-pill.W { background: var(--accent); color: #06281c; }
.em-pill.L { background: #f59e0b; color: #2a1800; }

.em-cmp { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.em-cmp-top { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; }
.em-cmp-top span { text-align: center; }
.em-cmp-top b:last-child { text-align: right; }
.em-cmp-top b { color: var(--muted); }
.em-cmp-top b.win { color: var(--text); }
.em-cmp-bars { display: flex; gap: 4px; height: 6px; }
.em-track { flex: 1; background: var(--line); border-radius: 3px; display: flex; }
.em-track.left { justify-content: flex-end; }
.em-fill { height: 6px; border-radius: 3px; }

.em-tl { gap: 14px; }
.em-ev { display: grid; grid-template-columns: 44px 1fr; gap: 10px; align-items: center; }
.em-min { font-weight: 800; font-variant-numeric: tabular-nums; color: var(--muted); text-align: right; font-size: 13px; }
.em-evbody { display: flex; align-items: center; gap: 8px; min-width: 0; }
.em-ic { flex: none; width: 14px; display: grid; place-items: center; color: var(--muted); }
.em-ic.goal { color: var(--accent); }
.em-ic.yellow::before { content: ""; width: 10px; height: 14px; border-radius: 2px; background: #facc15; }
.em-ic.red::before { content: ""; width: 10px; height: 14px; border-radius: 2px; background: var(--live); }
.em-ev .em-link { text-decoration-color: transparent; }

.em-mom { display: flex; gap: 3px; height: 84px; }
.em-momcol { flex: 1; display: flex; flex-direction: column; }
.em-momcol.future { opacity: .25; }
.em-momtop, .em-mombot { flex: 1; display: flex; }
.em-momtop { align-items: flex-end; border-bottom: 1px solid #3a4352; }
.em-momtop i, .em-mombot i { width: 100%; display: block; border-radius: 2px; }

.em-list { display: flex; flex-direction: column; gap: 8px; }
.em-ldr { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; width: 100%; text-align: left; background: var(--card) !important; border-radius: 14px; padding: 12px 14px; }
.em-ldr:active { filter: brightness(1.2); }
.em-ldr-name { font-weight: 700; font-size: 15px; }
.em-ldr-name .em-muted { font-weight: 500; font-size: 13px; }
.em-ldr-val { font-weight: 800; font-size: 17px; text-align: right; font-variant-numeric: tabular-nums; }
.em-ldr > :nth-child(4) { text-align: right; }

.em-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.em-grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.em-ins { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 14px; background: var(--card); }
.em-ins b { font-size: 22px; font-weight: 800; letter-spacing: -.3px; }
.em-trow { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; }
.em-trow span { text-align: center; font-size: 13px; }
.em-news { color: var(--text); text-decoration: none; line-height: 1.35; }
.em-news + .em-news { border-top: 1px solid var(--line); padding-top: 12px; }

.em-lineup { gap: 2px; padding: 6px; }
.em-lrow { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; text-align: left; padding: 10px 8px; border-radius: 10px; min-height: 44px; }
.em-lrow:active { background: var(--line) !important; }
.em-jersey { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; text-align: center; }
.em-lname { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.em-sub-h { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px 8px 4px; }

.em-tbl { display: grid; grid-template-columns: 24px 1fr 32px 40px 40px; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 8px; }
.em-tbl.hl { background: color-mix(in srgb, var(--accent) 16%, transparent); font-weight: 700; }

/* Player sheet */
.em-shade { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .6); display: flex; align-items: flex-end; animation: em-fade .15s; }
.em-sheet {
  width: 100%; max-width: 560px; margin: 0 auto; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--card); border-radius: 22px 22px 0 0; padding: 8px 16px calc(24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 18px; animation: em-up .22s ease-out;
}
.em-sheet .em-card, .em-sheet .em-tile { background: color-mix(in srgb, var(--text) 6%, var(--card)); }
.em-sheet .em-ibtn { background: color-mix(in srgb, var(--text) 8%, var(--card)); }
.em-grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); align-self: center; flex: none; }
.em-ptop { display: flex; align-items: center; gap: 14px; }
.em-pbadge { width: 60px; height: 60px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 21px; font-weight: 800; background: var(--line); }
.em-pname { flex: 1; min-width: 0; }
.em-pn { font-size: 21px; font-weight: 800; letter-spacing: -.3px; }
.em-tile { border-radius: 14px; padding: 12px; }
.em-radar { display: grid; justify-items: center; gap: 4px; }
.em-radar svg { max-width: 300px; }
@keyframes em-up { from { transform: translateY(40px); opacity: .4; } }
@keyframes em-fade { from { opacity: 0; } }
