/* ── Cards ──────────────────────────────────────────────────── */
.app-root .eleven-card {
  background: var(--card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.app-root .eleven-card--hero {
  border-radius: var(--r-lg);
  padding: 18px 20px;
}

.app-root .eleven-panel-dark {
  background: var(--ink);
  color: var(--text-on-dark);
  border-radius: var(--r-lg);
  padding: 20px;
  position: relative;
  overflow: hidden;
}

.app-root .eleven-panel-dark .eleven-eyebrow { color: var(--gold); }
.app-root .eleven-panel-dark .accent         { color: var(--gold); }

/* ── Pitch ──────────────────────────────────────────────────── */
.app-root .eleven-pitch {
  position: relative;
  background: linear-gradient(180deg, var(--pitch-top) 0%, var(--pitch-bot) 100%);
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: 30px 16px 20px;
}

.app-root .eleven-pitch::before {
  content: '';
  position: absolute; inset: 0;
  background: repeating-linear-gradient(180deg,
    rgba(255,255,255,.08) 0 30px,
    rgba(0,0,0,0)         30px 60px);
  opacity: 0.18;
  pointer-events: none;
}

.app-root .eleven-pitch__field {
  position: absolute; inset: 14px;
  border: 1.5px solid var(--pitch-line);
  border-radius: 8px;
  pointer-events: none;
}

.app-root .eleven-pitch__half {
  position: absolute; left: 14px; right: 14px; top: 50%;
  height: 1px; background: var(--pitch-line);
}

.app-root .eleven-pitch__circle {
  position: absolute; left: 50%; top: 50%;
  width: 80px; height: 80px;
  transform: translate(-50%, -50%);
  border: 1.5px solid var(--pitch-line);
  border-radius: 50%;
  pointer-events: none;
}

.app-root .eleven-pitch__box {
  position: absolute; left: 50%;
  width: 55%; height: 60px;
  transform: translateX(-50%);
  pointer-events: none;
}

.app-root .eleven-pitch__box--top {
  top: 14px;
  border: 1.5px solid var(--pitch-line);
  border-top: none;
}

.app-root .eleven-pitch__box--bot {
  bottom: 14px;
  border: 1.5px solid var(--pitch-line);
  border-bottom: none;
}

.app-root .eleven-pitch__rows {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
}

.app-root .eleven-pitch__row {
  display: flex; gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Player card ────────────────────────────────────────────── */
.app-root .eleven-player {
  width: 78px;
  position: relative;
  flex-shrink: 0;
}

.app-root .eleven-player__pos {
  position: absolute; top: -9px; left: 50%;
  transform: translateX(-50%);
  background: var(--paper);
  color: var(--ink);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 2px 7px;
  border: 1px solid #bbb;
  border-radius: 4px;
  z-index: 2;
  white-space: nowrap;
}

.app-root .eleven-player__body {
  width: 78px;
  height: 86px;
  background: #FAF8F5;
  border-radius: 10px 10px 0 0;
  border: 3px solid var(--paper);
  border-bottom: none;
  display: flex; flex-direction: column; align-items: center;
  padding-top: 5px;
  overflow: hidden;
  position: relative;
}

.app-root .eleven-player__name {
  font-size: 10px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 1px;
  text-align: center;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

/* Standard chip (score + stars) */
.app-root .eleven-player__foot {
  margin-top: 0;
  background: #0F2A4A;
  color: #fff;
  border-radius: 0 0 6px 6px;
  border: 3px solid var(--paper);
  border-top: none;
  padding: 3px 4px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

/* Upcoming/future fixture — slightly lighter blue */
.app-root .eleven-player__foot--upcoming {
  background: #0F2A4A;
  justify-content: center;
}

/* Double game week — stacked layout */
.app-root .eleven-player__foot--dgw {
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 3px 5px 4px;
}

.app-root .eleven-player__foot--dgw .eleven-player__scores {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.app-root .eleven-player__pts {
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 0.917;
  transform: translateY(-1px);
}

.app-root .eleven-player__foot .eleven-stars { margin-top: 2px; }

/* Star-man indicator badge */
/* Star man — bright yellow border matching star colour */
.app-root .eleven-player--starman .eleven-player__body {
  border-color: #FFC83A;
}
.app-root .eleven-player--starman .eleven-player__foot {
  border-color: #FFC83A;
}

/* Subs — no opacity reduction (was 0.82 but let green pitch bleed through) */

/* ── Pick-mode card variants ────────────────────────────────── */

/* Empty slot — single full-height dashed box (body + footer area combined).
   126px matches the visual height of a filled card (body 86 + 3px top
   border outside + ~37px foot) — was 123px which read as ~3px short. */
.app-root .eleven-player__slot-empty {
  width: 78px;
  height: 126px;
  border: 1px dashed rgba(255,255,255,0.35);
  border-radius: 10px;
  background: rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

@media (min-width: 700px) {
  .app-root .eleven-player__slot-empty { width: 88px; height: 131px; }
}

.app-root .eleven-player__plus {
  font-size: 26px;
  font-weight: 300;
  color: rgba(255,255,255,0.45);
  line-height: 1;
}

/* Pick-mode footer — opponent + ownership */
.app-root .eleven-player__foot--pick {
  padding: 7px 4px 7px;
  gap: 1px;
}

/* Pick-card fixture line — "ENG v CRO".
   Wrapper sits as one child of the flex-column foot so the three inline
   spans inside stay on the same row. Nowrap + ellipsis keeps DGW
   strings (e.g. "BIH v CZE & ENG") from breaking the card layout. */
.app-root .eleven-player__fixture {
  display: block;
  font-size: 10px;
  letter-spacing: 0.02em;
  text-align: center;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.app-root .eleven-player__team {
  /* Player's own team — primary, white. */
  color: var(--paper);
  font-weight: 700;
}

.app-root .eleven-player__vs {
  /* Separator — muted. */
  color: var(--paper);
  opacity: 0.4;
  margin: 0 0.25em;
}

.app-root .eleven-player__opp {
  /* Opponent — muted grey. */
  color: var(--paper);
  opacity: 0.55;
  font-weight: 700;
}

.app-root .eleven-player__nogame {
  /* "No Game" label — muted italic, same treatment as the 'v' separator. */
  color: var(--paper);
  opacity: 0.4;
  margin-left: 0.4em;
  font-style: italic;
}

.app-root .eleven-player__own {
  font-size: 10px;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-mono);
  line-height: 1;
}

/* Delete (×) button — top-right corner of the card */
.app-root .eleven-player__delete {
  position: absolute;
  top: 0;
  right: 2px;
  background: none;
  border: none;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 3px 2px 0;
  z-index: 3;
}

/* ── Fixtures accordion ─────────────────────────────────────── */
.app-root .eleven-accordion {
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 8px;
  background: var(--card);
}

.app-root .eleven-accordion__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 14px;
  background: var(--card);
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: left;
}

.app-root .eleven-accordion__trigger:hover { background: var(--paper-warm); }

.app-root .eleven-accordion__content {
  border-top: 1px solid var(--paper-edge);
}

/* Round nav row inside fixtures accordion */
.app-root .eleven-fix-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--paper-edge);
}

.app-root .eleven-fix-nav__btn {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--ink);
  border: none;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.app-root .eleven-fix-nav__btn[style*="hidden"] { visibility: hidden; }

/* ── Player picker modal ─────────────────────────────────────── */
.eleven-picker-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
  width: min(360px, 92vw);
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 9999;
}

.eleven-picker-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 12px;
  border-bottom: 1px solid var(--paper-edge);
  flex-shrink: 0;
}

.eleven-picker-modal__title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.eleven-picker-modal__close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.eleven-picker-modal__body {
  overflow-y: auto;
  flex: 1;
  padding: 16px 18px 0;
}

.eleven-picker-modal__select {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-sm);
  font-size: 14px;
  background: var(--card);
  color: var(--ink);
  -webkit-appearance: none;
  appearance: none;
}

.eleven-picker-modal__auto-btn {
  flex: 1;
  padding: 9px 4px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.eleven-picker-modal__auto-btn:hover { background: var(--paper-warm); }
.eleven-picker-modal__auto-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.eleven-picker-modal__auto-btn:disabled:hover { background: var(--card); }

.eleven-picker-modal__foot {
  padding: 12px 18px 16px;
  border-top: 1px solid var(--paper-edge);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.eleven-picker-modal__cancel {
  flex: 1;
  padding: 11px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.eleven-picker-modal__confirm {
  flex: 1;
  padding: 11px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

/* ── Stars ──────────────────────────────────────────────────── */
.app-root .eleven-stars {
  display: inline-flex;
  gap: 0;
  line-height: 1;
}

.app-root .eleven-stars__s {
  font-size: 13px;
  color: rgba(255,255,255,.22);
  line-height: 1;
}

.app-root .eleven-stars__s--on { color: #FFC83A; }

/* ── Bonus panel rows (five-star / star-man) — old bottom layout ── */
.app-root .eleven-bonus-row {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 20px;
}

.app-root .eleven-bonus-row__label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 26px;
  font-family: var(--font-mono);
}

/* ── Bonus cards (Five Star / Star Man flanking GK on pitch) ── */

/* Wider pill modifier for longer labels */
.app-root .eleven-player__pos--wide {
  padding-left: 10px;
  padding-right: 10px;
}

.app-root .eleven-bonus-card {
  position: relative;
  display: flex;
  flex-direction: column;
}

.app-root .eleven-bonus-card__body {
  background: #0F2A4A;
  border: 3px solid #FFC83A;
  border-radius: 10px;
  box-shadow: 0 2px 0 rgba(0,0,0,.15), 0 6px 14px rgba(0,0,0,.18);
  padding: 16px 10px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
}

.app-root .eleven-bonus-card__rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
}

.app-root .eleven-bonus-card__row {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.app-root .eleven-bonus-card__label {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  min-width: 22px;
}

.app-root .eleven-bonus-card__divider {
  width: 100%;
  height: 1px;
  background: rgba(255,255,255,0.12);
  margin: 6px 0 4px;
}

.app-root .eleven-bonus-card__total {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  text-align: center;
}

/* Stars inside bonus cards on dark background */
.app-root .eleven-bonus-card .eleven-stars__s     { color: rgba(255,255,255,0.18); font-size: 14px; }
.app-root .eleven-bonus-card .eleven-stars__s--on { color: #FFC83A; }
/* translateY nudges the stars to align with the mono-font label baseline.
   The ★ glyph sits slightly below its line-box centre when paired with
   the small mono label, so a pure align-items:center on the row leaves
   the stars looking low vs labels like ALL/GK/DEF/MID/ATT. Lift them
   1.5px to bring the visual centres in line. */
.app-root .eleven-bonus-card .eleven-stars        { gap: 0; transform: translateY(-1.5px); }

/* Inset margins — mobile base, desktop override below */
.app-root .eleven-bonus-card--left  { margin-left:  12px; }
.app-root .eleven-bonus-card--right { margin-right: 12px; }

/* ── Mobile-only overrides ───────────────────────────────────── */
@media (max-width: 699px) {
  .app-root .eleven-title { font-size: 32px; }
  .app-root .eleven-player__name { font-size: 11px; transform: translateY(-2px); }
  .app-root .eleven-bonus-card--left  { margin-left:  4px; }
  .app-root .eleven-bonus-card--right { margin-right: 4px; }
  .app-root .eleven-bonus-card__body  { padding: 14px 6px 6px; }
  .app-root .eleven-bonus-card__row   { gap: 2px; }
  .app-root .eleven-bonus-card .eleven-stars__s { font-size: 12px; }
}

/* ── Tables ─────────────────────────────────────────────────── */
.app-root .eleven-table {
  background: var(--card);
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-md);
  overflow: hidden;
}

/* Leaderboard column-width tokens.
   Mobile values are the tighter ones we land on at narrow viewports;
   the @media block above 700px restores the pre-tightening desktop
   widths. Both the white-table CSS grid AND the inline grids in
   leaderboards.php read from these vars so all surfaces flip
   together. */
.app-root {
  --lb-pos-w:        32px;
  --lb-rem-w:        26px;
  --lb-pts-w:        46px;
  --lb-star-w:       36px;
  --lb-team-pad:     6px;   /* team-name data cell + header padding-left */
  --lb-rem-head-pad: 8px;   /* REM column header padding-left */
  --lb-pos-y:        0px;
}
@media (min-width: 700px) {
  .app-root {
    --lb-pos-w:        40px;
    --lb-rem-w:        36px;
    --lb-pts-w:        56px;
    --lb-star-w:       46px;
    --lb-team-pad:     3px;
    --lb-rem-head-pad: 12px;
    --lb-pos-y:        1px;
  }
}

.app-root .eleven-table__head,
.app-root .eleven-table__row {
  display: grid;
  grid-template-columns: var(--lb-pos-w) 1fr var(--lb-pts-w) var(--lb-star-w);
  padding: 7px 14px 7px 6px;
  align-items: center;
}

/* REM-column variant — round-view non-community leaderboards add a 4th
   numeric column (REM = picks with at least one fixture not FT yet)
   between Team and Pts. Apply by adding 'eleven-table--rem' to the
   parent .eleven-table. Tournament/community views stay 4-col. */
.app-root .eleven-table--rem .eleven-table__head,
.app-root .eleven-table--rem .eleven-table__row {
  grid-template-columns: var(--lb-pos-w) 1fr var(--lb-rem-w) var(--lb-pts-w) var(--lb-star-w);
}

/* Numeric columns (3rd+ child) nudged 6px right of column center so
   they don't read flush-left next to the team-name column. Targets
   data cells via .eleven-num / .eleven-table__num AND header cells
   inside .eleven-table__head. nth-child(n+3) skips rank (col 1) and
   team (col 2). Community cells with inline padding-left win over
   this rule (their 8/10/12px stays). */
.app-root .eleven-table__num:nth-child(n+3),
.app-root .eleven-num:nth-child(n+3),
.app-root .eleven-table__head > :nth-child(n+3) {
  padding-left: 12px;
}

/* REM column header sits at child:3 inside a --rem table. Targeted
   override (higher specificity than the nth-child(n+3) rule above)
   so REM header reads --lb-rem-head-pad (9px mobile / 12px desktop)
   while PTS/★ headers stay at 12px. */
.app-root .eleven-table--rem .eleven-table__head > :nth-child(3) {
  padding-left: var(--lb-rem-head-pad);
}

.app-root .eleven-table__head {
  font-size: 9px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--paper-edge);
}

.app-root .eleven-table__row {
  font-size: 12px;
  border-bottom: 1px solid var(--paper-edge);
}

.app-root .eleven-table__row:last-child { border-bottom: none; }

.app-root .eleven-table__head > :first-child,
.app-root .eleven-table__row > :first-child { text-align: center; }

/* No padding-right on the last numeric column — values are
   center-aligned now, the column width already supplies breathing
   room. The old 2px nudge was for right-aligned ★ values. */

.app-root .eleven-table__row--you {
  background: rgba(201,162,74,0.12);
  font-weight: 700;
}

.app-root .eleven-table__num { font-family: var(--font-mono); }

/* ── Tabs ───────────────────────────────────────────────────── */
.app-root .eleven-tabs { display: flex; gap: 6px; }

.app-root .eleven-tab {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 700;
  border: 1px solid var(--paper-edge);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.app-root .eleven-tab--active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

.app-root .eleven-chip {
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 10px; font-weight: 700;
  background: transparent;
  border: 1px solid var(--paper-edge);
  color: var(--ink);
  text-decoration: none;
}

.app-root .eleven-chip--active {
  background: var(--gold);
  border-color: var(--gold);
  color: #fff;
}

/* ── Live indicator ─────────────────────────────────────────── */
.app-root .eleven-live {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 700; color: var(--red);
  letter-spacing: 0.08em; text-transform: uppercase;
}

.app-root .eleven-live::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--red);
  animation: eleven-pulse 1.5s infinite;
}

@keyframes eleven-pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

/* ── Nav logo — desktop nudge ───────────────────────────────── */
@media (min-width: 768px) {
  .app-nav-logo { transform: translateX(-6px); }
}

/* ── Nav left icons — desktop nudge ────────────────────────── */
@media (min-width: 768px) {
  .app-nav-left { transform: translateX(-4px); }
  .app-nav-left-pair { transform: translateX(-2px); }
}

/* ── Kicker spacing (tighter than default) ──────────────────── */
.app-root .eleven-section-head .eleven-kicker { line-height: 1; margin-bottom: 4px; }

/* ── Leaderboard rank pill ──────────────────────────────────── */
.app-root .eleven-rank {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700; font-size: 12px;
  flex-shrink: 0; color: #000;
}

.app-root .eleven-rank--1 { background: #FFC83A; }
.app-root .eleven-rank--2 { background: #A8A8A8; }
.app-root .eleven-rank--3 { background: #956F4A; }

/* ── Pagination buttons ─────────────────────────────────────── */
.app-root .eleven-pg-btn {
  font-family: var(--font-mono);
  font-size: 13px; font-weight: 700;
  padding: 8px 18px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  text-decoration: none;
}

.app-root .eleven-pg-btn:hover { background: var(--paper-warm); }

/* ── Private league form inputs ─────────────────────────────── */
.app-root .eleven-pl-input {
  width: 100%; box-sizing: border-box;
  padding: 9px 12px;
  border: 1px solid var(--paper-edge);
  border-radius: var(--r-sm);
  /* 16px stops iOS Safari from auto-zooming the viewport when the input is
     focused. Anything smaller triggers the zoom-to-input behaviour, which
     breaks our layout on mobile. */
  font-size: 16px; margin-bottom: 10px;
  background: var(--card); color: var(--ink);
}

.app-root .eleven-pl-input--code {
  text-transform: uppercase;
  letter-spacing: 4px;
  text-align: center;
  font-size: 18px; font-weight: 700;
  font-family: var(--font-mono);
}

.app-root .eleven-pl-btn {
  width: 100%;
  background: var(--ink); color: var(--paper);
  border: none; border-radius: var(--r-sm);
  padding: 10px 0; font-size: 14px; font-weight: 700;
  cursor: pointer;
}

/* ── Page body padding — mobile base, overridden on desktop ─── */
.app-root .app-page-body { padding: 0 14px; }

/* ── Two-column responsive grid (rules page, bonus cards) ──── */
.app-root .eleven-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 380px) {
  .app-root .eleven-two-col { grid-template-columns: 1fr; }
}

/* ── Desktop stadium background (v2 gutters only) ──────────── */
@media (min-width: 700px) {
  /* Body becomes transparent so ::before image shows through */
  body:has(.app-root) {
    position: relative;
    background: transparent;
  }

  /* Blurred image + dark overlay in one pseudo-element.
     inset: -30px extends beyond viewport to hide the blur edge halo. */
  body:has(.app-root)::before {
    content: '';
    position: fixed;
    inset: -30px;
    background:
      linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)),
      url('/assets/images/elevens_background.jpg') center top / cover no-repeat;
    filter: none;
    z-index: -1;
  }

  /* Day background (6am–6pm local time — class set by inline JS) */
  body.day-bg:has(.app-root)::before {
    background:
      linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)),
      url('/assets/images/elevens_background_day.jpg') center top / cover no-repeat;
  }

  /* Sunset background (8pm–10pm local time) */
  body.sunset-bg:has(.app-root)::before {
    background:
      linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)),
      url('/assets/images/elevens_background_sunset.jpg') center top / cover no-repeat;
  }

  /* Night background */
  body.night-bg:has(.app-root)::before {
    background:
      linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)),
      url('/assets/images/elevens_background_night.jpg') center top / cover no-repeat;
  }

  /* Sunrise background */
  body.sunrise-bg:has(.app-root)::before {
    background:
      linear-gradient(rgba(0,0,0,0.15), rgba(0,0,0,0.15)),
      url('/assets/images/elevens_background_sunrise.jpg') center top / cover no-repeat;
  }
}

/* ── Desktop column ─────────────────────────────────────────── */
@media (min-width: 700px) {
  .app-root { background: transparent; }
  .app-root .eleven-main {
    max-width: 520px;
    margin: 16px auto 32px auto;
    border-radius: var(--r-xl);
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06), 0 8px 30px rgba(0,0,0,0.18), 0 0 80px rgba(0,0,0,0.25);
    background: var(--paper);
  }
  .app-root .app-page-body { padding: 0 24px; }
  .app-root .eleven-player { width: 88px; }
  .app-root .eleven-player__body { width: 88px; height: 92px; }
  .app-root .eleven-player__name { font-size: 12px; margin-top: -1px; }
  .app-root .eleven-stars { gap: 1px; }
  .app-root .eleven-pitch__row { gap: 8px; }
}

/* ── Auth pages ─────────────────────────────────────────────── */

/* Hero panel containing kicker + headline */
.app-root .eleven-auth-hero {
  text-align: center;
  padding: 28px 24px 24px;
  margin-bottom: 20px;
  border-radius: var(--r-lg);
}
.app-root .eleven-auth-hero .eleven-title { color: #fff; }

/* Form card */
.app-root .eleven-auth-card { padding: 24px 20px 20px; }

/* Input focus */
.app-root .eleven-pl-input:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(14, 26, 20, 0.08);
}

/* Create-form placeholder — input stays 16px (iOS no-zoom), but the
   placeholder shrinks to 13px so it sits in scale with the body copy
   on the dark Create panel. Scoped by id so other pl-inputs (login,
   register, etc.) keep their default placeholder size. */
.app-root #pl-tab-create-content .eleven-pl-input::placeholder {
  font-size: 13px;
}
.app-root #pl-tab-create-content .eleven-pl-input::-webkit-input-placeholder {
  font-size: 13px;
}

/* Primary button hover */
.app-root .eleven-pl-btn:hover { opacity: 0.85; }

/* Outline variant (register opt-in "No thanks") */
.app-root .eleven-pl-btn--outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--paper-edge);
}
.app-root .eleven-pl-btn--outline:hover { background: var(--paper-warm); opacity: 1; }

/* Field label */
.app-root .eleven-auth-label {
  display: block;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 5px;
}

/* Field wrapper */
.app-root .eleven-auth-field { margin-bottom: 14px; }
.app-root .eleven-auth-field .eleven-pl-input { margin-bottom: 0; }

/* State messages */
.app-root .eleven-auth-message {
  font-size: 13px;
  font-family: var(--font-body);
  padding: 10px 14px;
  border-radius: var(--r-sm);
  margin-bottom: 16px;
  line-height: 1.5;
}
.app-root .eleven-auth-message--error {
  color: var(--red);
  background: rgba(192, 57, 43, 0.07);
  border: 1px solid rgba(192, 57, 43, 0.2);
}
.app-root .eleven-auth-message--success {
  color: var(--gold-deep);
  background: rgba(140, 106, 32, 0.07);
  border: 1px solid rgba(140, 106, 32, 0.2);
}
.app-root .eleven-auth-message--warn {
  color: var(--ink);
  background: rgba(201, 162, 74, 0.1);
  border: 1px solid rgba(201, 162, 74, 0.3);
}

/* Divider between a state message and the form below */
.app-root .eleven-auth-divider {
  height: 1px;
  background: var(--paper-edge);
  margin: 20px 0;
}

/* Secondary links */
.app-root .eleven-auth-links {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: rgba(14, 26, 20, 0.7);
  text-align: center;
  margin: 18px 0 0;
  line-height: 1.6;
}
.app-root .eleven-auth-links a {
  color: inherit;
  text-decoration: none;
}
.app-root .eleven-auth-links a:hover {
  color: var(--gold-deep);
  text-decoration: underline;
}

/* Opt-in copy (register step 2) */
.app-root .eleven-auth-optin {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
  margin-bottom: 20px;
  text-align: center;
}

/* ── Page footer ─────────────────────────────────────────────── */
.app-root .app-footer {
  margin-top: 24px;
  padding: 16px 0 24px;
  border-top: 1px solid var(--paper-edge);
  text-align: center;
}

.app-root .app-footer-links {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: rgba(14, 26, 20, 0.7);
  margin: 0 0 8px;
  line-height: 1.6;
}

.app-root .app-footer-links a {
  color: inherit;
  text-decoration: none;
}

.app-root .app-footer-links a:hover {
  color: var(--gold-deep);
  text-decoration: underline;
}

.app-root .app-footer-sep {
  margin: 0 8px;
  opacity: 0.4;
}

.app-root .app-footer-meta {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11px;
  color: rgba(14, 26, 20, 0.45);
  margin: 0;
  letter-spacing: 0.03em;
}

@media (max-width: 360px) {
  .app-root .app-footer-links { font-size: 12px; }
  .app-root .app-footer-sep   { margin: 0 5px; }
}

/* ── Legal pages (terms, privacy) ───────────────────────────── */
.app-root .eleven-legal {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink);
}
.app-root .eleven-legal p { margin: 0 0 12px; }
.app-root .eleven-legal p:last-child { margin-bottom: 0; }
.app-root .eleven-legal h2 {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 22px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--paper-edge);
}
.app-root .eleven-legal a { color: var(--gold-deep); }
.app-root .eleven-legal ul {
  margin: 0 0 12px;
  padding-left: 22px;
}
.app-root .eleven-legal ul ul {
  margin: 6px 0 6px;
  padding-left: 20px;
}
.app-root .eleven-legal li {
  margin-bottom: 6px;
}
.app-root .eleven-legal li:last-child { margin-bottom: 0; }
.app-root .eleven-legal .legal-date {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 20px;
}
.app-root .eleven-legal .legal-foot {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Ultra-narrow viewport rescue ───────────────────────────────────
   Placed at end of file so source order beats earlier same-specificity
   rules (e.g. .eleven-player__body width: 78px at line ~137). Without
   this, the media query was being defeated by the later base rule.

   Targets Galaxy Fold cover screens + Android Display Zoom phones
   where the CSS viewport drops at or below 360px. Shrinks actual
   layout dimensions (not just visual scale) so 4 cards fit a single
   row even at the heaviest realistic zoom.

   Math at 360px viewport with reclaimed body padding:
     Available: 360 - 8 = 352px
     Need:      4×56 + 3×1 + 4 = 231px
     Spare:     121px

   Above 360px the block doesn't exist — render is byte-identical. */
/* ── Pitch responsive tiers ─────────────────────────────────────────
   Five tiers handle the spectrum from default phones (≥390px) down to
   Chrome-zoomed and Galaxy-Fold-class viewports. Pure CSS — selected
   automatically per viewport. Math budget for a 4-card row:
     row_width = 4×card + 3×gap + 2×pitch_h_pad + 2×body_h_pad

   Tier 1 ≥390   : default — 4×78 + 18 + 32 + 28 = 390 (just fits 390)
   Tier 2 361-389: pitch_h_pad 16→12, gap 6→4  → 376 (fits 384)
   Tier 3 321-360: card 78→74, etc.            → 336 (fits 360)
   Tier 4 281-320: card 74→62, tighter         → 277 (fits 281)
   Tier 5 ≤280   : card 62→56, tightest        → 242 (fits 280)
*/

/* Tier 2: 361-389px — middle band. Catches typical Android phones with
   modest Chrome zoom (~388-380 effective). Cards keep full 78px width;
   just shave padding+gap to recover the 14px deficit. iPhone (≥390)
   unaffected. */
@media (min-width: 361px) and (max-width: 389px) {
  .app-root .eleven-pitch      { padding: 30px 12px 20px; }
  .app-root .eleven-pitch__row { gap: 4px; }
}

/* Tier 3: 321-360px — narrow band. Cards shrink to 74px, page-body
   and pitch padding both reclaim a few px. 'Haaland' still fits in
   full. */
@media (min-width: 321px) and (max-width: 360px) {
  .app-root .app-page-body             { padding: 0 8px; }
  .app-root .eleven-pitch              { padding: 26px 6px 16px; }
  .app-root .eleven-pitch__row         { gap: 4px; }
  .app-root .eleven-player             { width: 72px; }
  .app-root .eleven-player__body       { width: 72px; box-sizing: border-box; }
  .app-root .eleven-player__slot-empty { width: 72px; }
  .app-root .eleven-player__foot--upcoming { padding-bottom: 9px; }
}

/* Tier 4: 281-320px — very narrow. Chrome Default Zoom 125% on a
   ~390-400px phone lands here. Card 64 + gap 2 keeps the 4-card row
   intact:
     4×64 + 3×2 (gap) + 4 (pitch h-pad) + 6 (body h-pad) = 272
     fits 281 with 9px spare.
   Stars shrunk 13 → 11px so the row fits inside the narrower card. */
@media (min-width: 281px) and (max-width: 320px) {
  .app-root .app-page-body             { padding: 0 3px; }
  .app-root .eleven-pitch              { padding: 24px 2px 14px; }
  .app-root .eleven-pitch__row         { gap: 2px; }
  .app-root .eleven-player             { width: 64px; }
  .app-root .eleven-player__body       { width: 64px; box-sizing: border-box; }
  .app-root .eleven-player__slot-empty { width: 64px; }
  .app-root .eleven-player__foot--upcoming { padding-bottom: 9px; }
  .app-root .eleven-stars__s           { font-size: 11px; }
  /* Bonus cards (FIVE STAR / STAR MAN panels) — keep the box at its
     normal mobile width; just bring the inner stars closer + a touch
     smaller so the content reads more centred inside the box. */
  .app-root .eleven-bonus-card .eleven-stars__s     { font-size: 11px; }
  .app-root .eleven-bonus-card .eleven-stars        { letter-spacing: -1px; }
}

/* Tier 5: ≤299px — extreme zoom. Pitch formation breaks down at this
   width, so abandon the "row" concept and stack each card vertically
   at a comfortable readable size. User has explicitly asked the
   browser for big UI (Chrome Default Zoom 150%+, or Galaxy Fold) —
   one-card-per-line at full readable size respects that ask better
   than continuing to crush 4 cards onto a row. The pitch background
   is still there, just laid out as a column.

   Layout order (top → bottom):
     1. FIVE STAR bonus card    (HTML order, order: 1)
     2. STAR MAN bonus card     (HTML order, order: 1)
     3. GK player card          (order: 2 — pushed below bonus cards)
     4. DEF cards               (next .eleven-pitch__row)
     5. MID cards               (next .eleven-pitch__row)
     6. ATT cards               (next .eleven-pitch__row)
   Between-group gap (.eleven-pitch__rows gap) is wider than the
   within-group gap (.eleven-pitch__row gap) so the position blocks
   read as distinct sections. */
@media (max-width: 299px) {
  .app-root .app-page-body             { padding: 0 6px; }
  .app-root .eleven-pitch              { padding: 16px 8px 16px; }
  /* Only the /select_team main pitch (the one that contains the
     CLEAR PLAYERS / QUICK SELECT corner buttons) becomes a 2-col
     grid so the buttons sit side-by-side at the top with the rows
     spanning both columns. Other pitches (subs, /teamscores) keep
     normal block flow so their eyebrow + content don't get
     auto-placed in left/right halves. */
  .app-root .eleven-pitch:has(.pitch-corner-btn)               { display: grid; grid-template-columns: 1fr 1fr; column-gap: 8px; row-gap: 12px; }
  .app-root .pitch-corner-btn                                  { position: static !important; justify-self: center; margin: 0; }
  .app-root .eleven-pitch:has(.pitch-corner-btn) .eleven-pitch__rows { grid-column: 1 / -1; }
  /* Wider between position groups, more breathing room within a group too */
  .app-root .eleven-pitch__rows        { gap: 30px; }
  .app-root .eleven-pitch__row         { flex-direction: column; gap: 14px; align-items: center; }
  .app-root .eleven-player             { width: 120px; }
  .app-root .eleven-player__body       { width: 120px; box-sizing: border-box; }
  .app-root .eleven-player__slot-empty { width: 120px; }
  .app-root .eleven-player__foot--upcoming { padding-bottom: 9px; }
  /* Force every row to flex-column with centred + ordered children.
     The GK row in teamscores.php has inline style="justify-content:
     space-between;align-items:stretch;..." — !important + direct-
     child selectors + negative order on bonus cards needed to push
     them above the GK reliably. */
  .app-root .eleven-pitch__row                    { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; }
  .app-root .eleven-pitch__row > .eleven-bonus-card { order: -1 !important; width: 120px; }
  .app-root .eleven-bonus-card__body              { width: 100%; box-sizing: border-box; }
  .app-root .eleven-bonus-card--left              { margin-left: 0; }
  .app-root .eleven-bonus-card--right             { margin-right: 0; }
}
