/* Layout: one-column phone app. Sticky top bar with player card, scrolling view, fixed bottom tab bar.
   Look: floodlit night match. Deep navy stand, chalk-white lines, amber floodlight accent. Single dark theme by choice. */
:root {
  /* Screen edges (notch, status bar, gesture bar). The Android app (Capacitor) also passes them as --safe-area-inset-*
     because older Android WebViews report env() as 0. */
  --sat: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --sab: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --stand: #0c1524;
  --surface: #14213a;
  --surface-2: #1b2b48;
  --line: #2a3d5a;
  --chalk: #eef2f7;
  --muted: #8b9bb4;
  --flood: #ffb547;
  --flood-ink: #2a1a00;
  --good: #4cc38a;
  --bad: #f06a6a;
  --warn: #f2c94c;
  --bronze: #cd8a4f;
  --silver: #c8d0db;
  --display: 'Barlow Condensed', 'Arial Narrow', 'Roboto Condensed', sans-serif;
  --body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --nav-h: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--stand);
  color: var(--chalk);
  font: 15px/1.45 var(--body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
/* The open list of a dropdown can't show a gradient, so it falls back to white under white text: give every option a solid panel. */
select option { background: var(--surface-2); color: var(--chalk); }
select option:checked { background: var(--flood); color: var(--flood-ink); }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--flood); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }

#app { max-width: 520px; margin: 0 auto; min-height: 100%;
  /* Start below the status bar. The sticky top bar stops at the same line, so it never slides down over the page. */
  padding-top: var(--sat); padding-bottom: calc(var(--nav-h) + var(--sab) + 16px); }
.wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- top bar ---------- */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: var(--sat); z-index: 10; background: var(--stand); }
.topbar {
  position: sticky; top: var(--sat); z-index: 5;
  background: linear-gradient(180deg, var(--stand) 70%, rgba(12, 21, 36, .92));
  padding-block: 12px 10px;
  border-bottom: 1px solid var(--line);
}
.idrow { display: flex; align-items: center; gap: 12px; }
.ovr {
  flex: none; width: 58px; height: 64px; border-radius: 10px;
  background: var(--flood); color: var(--flood-ink);
  display: grid; place-items: center; align-content: center; line-height: 1;
  font-family: var(--display);
}
.ovr b { font-size: 30px; font-weight: 800; }
.ovr span { font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.who { min-width: 0; flex: 1; }
.who h1 { margin: 0; font: 700 22px/1.1 var(--display); letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who p { margin: 2px 0 0; color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.chip b { color: var(--chalk); font-weight: 600; }
.chip.flood { border-color: var(--flood); color: var(--flood); }
.chip.bad { border-color: var(--bad); color: var(--bad); }
.chip.good { border-color: var(--good); color: var(--good); }
.energy { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--muted); }
/* Scrolled down on a phone: the top bar shrinks to OVR, name and energy so it covers less of the game (js/ui.js adds .compact). */
body.compact .topbar { padding-block: 6px; }
body.compact .topbar .chips, body.compact .topbar .who p, body.compact .topbar .altpos { display: none; }
body.compact .topbar .ovr { width: 40px; height: 40px; border-radius: 8px; }
body.compact .topbar .ovr b { font-size: 20px; }
body.compact .topbar .ovr span { font-size: 9px; }
body.compact .topbar .who h1 { font-size: 18px; }
body.compact .topbar .energy { margin-top: 6px; }
.bar { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--good); border-radius: 3px; transition: width .3s; }
.bar i.low { background: var(--bad); }
.bar i.mid { background: var(--warn); }

/* ---------- content ---------- */
main { display: grid; gap: 14px; padding-block: 14px; }
h2 { margin: 0; font: 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card.hero { background: linear-gradient(160deg, var(--surface-2), var(--surface)); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.flood { color: var(--flood); }

.fixture { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; text-align: center; }
.team { display: grid; gap: 2px; justify-items: center; min-width: 0; }
.crest { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 800 14px var(--display); letter-spacing: .04em; background: var(--surface-2); border: 2px solid var(--line); }
.crest.me { border-color: var(--flood); color: var(--flood); }
.team b { font-size: 14px; font-weight: 600; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team span { font-size: 12px; color: var(--muted); }
.vs { font: 800 30px var(--display); color: var(--muted); }
.score { font: 800 40px/1 var(--display); letter-spacing: .04em; }

.btn {
  border: 0; border-radius: 10px; padding: 12px 16px; font-weight: 700;
  background: var(--surface-2); color: var(--chalk); border: 1px solid var(--line);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
}
.btn.primary { background: var(--flood); color: var(--flood-ink); border-color: var(--flood); font-family: var(--display); font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
.btn.good { background: var(--good); color: #062014; border-color: var(--good); }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 13px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.block { width: 100%; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btns .btn { flex: 1; }

/* attributes */
.attrs { display: grid; gap: 10px; }
.attr { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.attr .name { font-weight: 600; }
.attr .val { font: 800 26px/1 var(--display); text-align: right; }
.attr .bar { grid-column: 1 / -1; }
.attr .bar i { background: var(--flood); }
.attr .meta { font-size: 12px; color: var(--muted); }
.attr .key { font-size: 11px; color: var(--flood); text-transform: uppercase; letter-spacing: .08em; margin-left: 6px; }

/* shop */
.item { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.item + .item { border-top: 1px solid var(--line); padding-top: 12px; }
.item .t { font-weight: 700; }
.pips { display: flex; gap: 3px; margin-top: 4px; }
.pips i { width: 14px; height: 6px; border-radius: 2px; background: var(--surface-2); border: 1px solid var(--line); }
.pips i.on { background: var(--flood); border-color: var(--flood); }
.house { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: transparent; width: 100%; text-align: left; }
.house.on { border-color: var(--flood); background: rgba(255, 181, 71, .08); }

/* tables */
.tablewrap { overflow-x: auto; margin: 0 -14px; padding: 0 14px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { padding: 7px 4px; border-bottom: 1px solid rgba(42, 61, 90, .5); white-space: nowrap; }
td.r, th.r { text-align: right; }
tr.me td { color: var(--flood); font-weight: 700; }
td.clubname { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
/* A club name too long for its cell slides sideways inside the cell; the rest of the table stays put. */
td.clubname .clubcell { overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
td.clubname .clubcell::-webkit-scrollbar { display: none; }
/* Spacing after shorter names so every name in a table slides the same distance (set by evenNameCells in ui.js). */
td.clubname .clubcell { padding-right: var(--namepad, 0px); }
.zone-cl td:first-child { box-shadow: inset 3px 0 0 var(--good); }
.zone-po td:first-child { box-shadow: inset 3px 0 0 var(--flood); }
.zone-out td { opacity: .6; }
/* league phase table: compact like a phone stats app */
table.lp { font-size: 11px; width: 100%; table-layout: auto; }
table.grp.lp td, table.grp.lp th { padding: 5px 1px; }
table.lp th { font-size: 10px; letter-spacing: 0; text-transform: none; }
table.grp.lp td:first-child, table.grp.lp th:first-child { padding-left: 4px; width: 12px; }
table.lp .clubcell { max-width: 74px; gap: 3px; }
table.lp .crest.mini { width: 16px; height: 16px; flex: none; }
table.lp .tname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.last5 { display: inline-flex; gap: 1px; }
.last5 i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font: 700 7px/1 var(--body); font-style: normal; color: var(--flood-ink); }
table.grp.lp td:last-child, table.grp.lp th:last-child { padding: 5px 4px 5px 5px; }
/* the league table uses the card's full width */
.card .tablewrap:has(table.lp) { margin: 0 -14px; }
.last5 i.fW { background: var(--good); border-color: var(--good); }
.last5 i.fD { background: var(--muted); border-color: var(--muted); }
.last5 i.fL { background: var(--bad); border-color: var(--bad); }
.legs { padding: 0 8px; text-align: center; }
.zone-rel td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
.pos-tag { display: inline-block; min-width: 34px; text-align: center; font: 700 11px var(--display); letter-spacing: .06em; padding: 2px 4px; border-radius: 4px; background: var(--surface-2); color: var(--muted); }

/* Segmented tabs stay on one line; when they do not fit (phones) the row slides sideways. */
.seg { display: flex; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 4px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; white-space: nowrap; border: 0; background: transparent; padding: 8px 10px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface-2); color: var(--chalk); }
.md-tabs { margin-bottom: 10px; }

/* inbox */
.inbox { display: grid; gap: 8px; }
.msg { font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); border-left: 3px solid var(--line); }
.msg.good { border-left-color: var(--good); color: var(--chalk); }
.msg.bad { border-left-color: var(--bad); color: var(--chalk); }
.msg small { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }

.offer { border: 1px solid var(--flood); border-radius: var(--radius); padding: 12px; display: grid; gap: 8px; background: rgba(255, 181, 71, .05); }
.offer .club { font: 700 20px/1.1 var(--display); }
.kv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
/* Label at the top, value at the bottom, so the values line up even when a label wraps ("National team"). */
.kv div { background: var(--surface-2); border-radius: 8px; padding: 6px 8px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 2px; }
.kv small { display: block; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.kv b { font-size: 14px; }

.form { display: flex; gap: 4px; }
.form span { font: 800 13px var(--display); min-width: 34px; padding: 3px 0; }

/* ---------- bottom nav ---------- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: var(--sab);
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
}
/* Buttons take the width of their label and share the space left over, so the gaps between labels are even. */
nav.tabs .in { max-width: 520px; margin: 0 auto; display: flex; justify-content: space-evenly; height: var(--nav-h); padding: 0 2px; }
nav.tabs button { flex: 0 1 auto; min-width: 36px; padding: 0 2px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; position: relative; white-space: nowrap; }
@media (max-width: 340px) { nav.tabs button { font-size: 9.5px; min-width: 32px; } }
nav.tabs button svg { width: 22px; height: 22px; }
nav.tabs button.on { color: var(--flood); }
nav.tabs .dot { position: absolute; top: 10px; right: calc(50% - 18px); width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }

/* ---------- create screen ---------- */
.create { padding-block: 32px 24px; display: grid; gap: 18px; }
.brand { font: 800 44px/0.95 var(--display); text-transform: uppercase; letter-spacing: .01em; margin: 0; text-wrap: balance; }
.brand em { font-style: normal; color: var(--flood); }
.lede { color: var(--muted); margin: 0; max-width: 40ch; }
.field { display: grid; gap: 6px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.field input, .field select { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; min-height: 46px; height: 48px; width: 100%; }
/* iOS Safari draws date fields its own way: wider than the box, centred text, a different height.
   Strip that so it lines up with the other fields. */
.field { min-width: 0; }
.field input[type="date"] { -webkit-appearance: none; appearance: none; display: block; min-width: 0; max-width: 100%; line-height: 22px; text-align: left; font: inherit; color: inherit; }
.field input[type="date"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 20px; }
.posgrid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.posgrid button { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 10px 0; font: 700 15px var(--display); letter-spacing: .06em; }
.posgrid button.on { background: var(--flood); color: var(--flood-ink); border-color: var(--flood); }

/* ---------- modal ---------- */
#modal { position: fixed; inset: 0; z-index: 20; background: rgba(5, 10, 18, .72); display: grid; align-items: end; justify-items: center; padding-top: var(--sat); }
#modal[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 520px; max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--line); border-radius: 18px 18px 0 0;
  padding-block: 20px calc(20px + var(--sab));
  padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px));
  display: grid; gap: 14px;
  animation: up .22s ease-out;
}
.sheet h3 { margin: 0; font: 800 26px/1.05 var(--display); text-transform: uppercase; }
.scorers { font-size: 13px; color: var(--muted); display: grid; grid-template-columns: 1fr 1fr; gap: 7px 12px; }
.scorers .g { display: grid; gap: 1px; min-width: 0; }
.scorers .g > div { display: flex; align-items: center; gap: 5px; min-width: 0; }
.scorers .g span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scorers .g.a > div { flex-direction: row-reverse; text-align: right; }
.scorers .g b { color: var(--chalk); font-weight: 700; }
.scorers .ico { width: 14px; height: 14px; flex: none; }
.scorers .ball { color: var(--chalk); }
.scorers .ast { font-size: 11.5px; opacity: .7; padding-left: 2px; }
.scorers .g.a .ast { padding: 0 2px 0 0; }
.scorers .ast .ico { width: 12px; height: 12px; }
.scorers .me { color: var(--flood); font-weight: 700; }
.scorers .me .ball { color: var(--flood); }
.scorers .ev { font-size: 12px; opacity: .85; }
.scorers .ev .ast { opacity: .8; }
.scorers .subon { color: #4cd07d; }
.scorers .suboff { color: #ff6b6b; }
.scorers .inj { color: #ff6b6b; width: 12px; height: 12px; }
.mcard { display: inline-block; flex: none; width: 9px; height: 12px; border-radius: 2px; vertical-align: -1px; margin-left: 3px; }
.mcard.y { background: #f5c518; }
.mcard.r { background: #e5383b; }
.mcard.y2 { background: linear-gradient(135deg, #f5c518 50%, #e5383b 50%); }
.scorers .mcard { margin: 0 2px; }
.bigstat { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }
/* keepers show six stats: two rows of three */
.bigstat.six { grid-template-columns: repeat(3, 1fr); }
.bigstat div { background: var(--surface-2); border-radius: 10px; padding: 8px 4px; }
.bigstat b { display: block; font: 800 26px/1 var(--display); }
.bigstat small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.award { padding: 8px 10px; border-radius: 8px; background: rgba(255, 181, 71, .12); color: var(--flood); font-weight: 700; }
@keyframes up { from { transform: translateY(30px); opacity: .4; } to { transform: none; opacity: 1; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--sab) + 14px); transform: translateX(-50%); background: var(--chalk); color: var(--stand); padding: 8px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; z-index: 30; animation: up .2s ease-out; white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.attr .val .dec { font-size: 15px; color: var(--muted); font-weight: 700; }

/* EA-style card colour on the OVR badge */
.ovr.card-bronze { background: var(--bronze); color: #2b1606; }
.ovr.card-silver { background: var(--silver); color: #1a2230; }
.ovr.card-gold { background: var(--flood); color: var(--flood-ink); }
.tier-bronze .tiername { color: var(--bronze); }
.tier-silver .tiername { color: var(--silver); }
.tier-gold .tiername { color: var(--flood); }
.house:disabled { opacity: .45; cursor: not-allowed; }

/* Club logos: image when the file exists, short name otherwise */
.crest { overflow: hidden; flex: none; }
.crest img { width: 80%; height: 80%; object-fit: contain; }
.crest.haslogo { background: transparent; }
.crest.haslogo span { display: none; }
.crest.small { width: 38px; height: 38px; font-size: 12px; }
.crest.mini { width: 22px; height: 22px; font-size: 8px; border-width: 1px; }
.crest.mini.haslogo, .crest.small.haslogo { border-color: transparent; }
.crest.mini img, .crest.small img { width: 100%; height: 100%; }
.clubcell { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* Manager objectives and match instructions */
.obj { display: grid; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.order { border: 1px dashed var(--flood); border-radius: 10px; padding: 10px; display: grid; gap: 8px; background: rgba(255, 181, 71, .05); }

/* Event pop-ups: fireworks for good news, rain for bad news */
#fx {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  padding: max(16px, var(--sat)) max(16px, env(safe-area-inset-right, 0px)) max(16px, var(--sab)) max(16px, env(safe-area-inset-left, 0px));
}
#fx[hidden] { display: none; }
#fx.good { background: radial-gradient(circle at 50% 38%, rgba(255, 181, 71, .2), rgba(5, 10, 18, .88) 70%); }
#fx.bad { background: radial-gradient(circle at 50% 30%, rgba(44, 52, 70, .7), rgba(2, 4, 8, .95) 75%); }
#fx canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pop {
  position: relative; width: 100%; max-width: 340px; text-align: center; display: grid; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 24px 20px 20px;
}
#fx.good .pop { border-color: var(--flood); box-shadow: 0 0 48px rgba(255, 181, 71, .28); animation: pop-in .4s cubic-bezier(.2, 1.4, .4, 1); }
#fx.bad .pop { border-color: #3a4558; background: #121b2c; animation: sink .7s ease-out; }
.pop-icon { justify-self: center; width: 64px; height: 64px; }
.pop-icon svg { width: 100%; height: 100%; }
#fx.good .pop-icon { color: var(--flood); animation: glow 1.8s ease-in-out infinite; }
#fx.bad .pop-icon { color: var(--muted); }
.pop h3 { margin: 0; font: 800 28px/1.05 var(--display); text-transform: uppercase; text-wrap: balance; }
#fx.bad .pop h3 { color: #b7c2d4; }
.pop p { margin: 0; color: var(--muted); }
/* goal and assist celebrations: more goals, bigger show */
#fx.haul { background: radial-gradient(circle at 50% 38%, rgba(255, 181, 71, .22), rgba(5, 10, 18, .9) 70%); }
#fx.haul.assist { background: radial-gradient(circle at 50% 38%, rgba(76, 195, 138, .2), rgba(5, 10, 18, .9) 70%); }
#fx.haul .pop { border-color: var(--flood); box-shadow: 0 0 48px rgba(255, 181, 71, .28); animation: pop-in .4s cubic-bezier(.2, 1.4, .4, 1); }
#fx.haul.assist .pop { border-color: var(--good); box-shadow: 0 0 40px rgba(76, 195, 138, .25); }
.haul-icons { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; }
.haul-icons span { width: 40px; height: 40px; opacity: 0; animation: drop-in .45s cubic-bezier(.2, 1.5, .4, 1) forwards; }
.haul-icons svg { width: 100%; height: 100%; }
.haul-icons .hb { color: var(--chalk); }
.haul-icons .hs { width: 28px; height: 28px; color: var(--good); opacity: 0; }
/* keepers and defenders: blue gloves and tackles, a big gold clean-sheet shield */
.haul-icons .hg, .haul-icons .ht { width: 28px; height: 28px; color: #7cc7ff; opacity: 0; }
.haul-icons .hcs { width: 56px; height: 56px; color: var(--flood); opacity: 0; filter: drop-shadow(0 0 10px rgba(255, 181, 71, .6)); }
.haul-more { align-self: center; font: 800 18px var(--display); color: #7cc7ff; }
#fx.haul.defend { background: radial-gradient(circle at 50% 38%, rgba(124, 199, 255, .2), rgba(5, 10, 18, .9) 70%); }
#fx.haul.defend .pop { border-color: #7cc7ff; box-shadow: 0 0 40px rgba(124, 199, 255, .25); }
#fx.haul.lvl3 .hb, #fx.haul.lvl4 .hb, #fx.haul.lvl5 .hb, #fx.haul.lvl6 .hb { color: var(--flood); filter: drop-shadow(0 0 8px rgba(255, 181, 71, .7)); }
#fx.haul.lvl2 h3 { font-size: 32px; }
#fx.haul.lvl3 h3 { font-size: 36px; color: var(--flood); }
#fx.haul.lvl4 h3, #fx.haul.lvl5 h3 { font-size: 38px; color: var(--flood); animation: glow 1.4s ease-in-out infinite; }
#fx.haul.lvl6 h3 { font-size: 40px; background: linear-gradient(90deg, #ffb547, #ff9ec7, #7cc7ff, #4cc38a, #ffb547); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 2s linear infinite; }
#fx.haul.lvl4 .pop, #fx.haul.lvl5 .pop, #fx.haul.lvl6 .pop { animation: pop-in .4s cubic-bezier(.2, 1.4, .4, 1), shake .5s .4s ease-in-out 2; }
@keyframes drop-in { from { transform: translateY(-24px) scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-6px) rotate(-1deg); } 40%, 80% { transform: translateX(6px) rotate(1deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .haul-icons span { animation: none; opacity: 1; } #fx.haul .pop, #fx.haul h3 { animation: none !important; } }
@keyframes pop-in { from { transform: scale(.7); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes sink { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes glow { 50% { filter: drop-shadow(0 0 10px rgba(255, 181, 71, .8)); transform: scale(1.06); } }

/* Cups, tournaments, save tools */
.crest.nation { border-radius: 8px; color: var(--chalk); }
.attr .key.brief { color: var(--good); }
.cupgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.tie { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; font-size: 13px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.tie .r { text-align: right; }
.tie b.w { color: var(--chalk); }
.tie span { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.savebox { width: 100%; min-height: 120px; font: 12px/1.4 ui-monospace, monospace; background: var(--surface-2); color: var(--chalk); border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.tie.me { box-shadow: inset 3px 0 var(--flood); padding-left: 8px; }
.tie.me span { color: var(--chalk); }
/* contract talks: one card per ask with big, colour-coded odds */
.neghead { display: flex; align-items: center; gap: 10px; }
.tries { display: inline-flex; gap: 3px; vertical-align: middle; }
.tries i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.tries i.on { background: var(--flood); }
.asks { display: grid; gap: 8px; }
.askcard { display: grid; gap: 6px; text-align: left; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--chalk); font: inherit; cursor: pointer; }
.askcard:disabled { opacity: .55; cursor: default; }
.askcard.good { border-color: rgba(76, 195, 138, .55); }
.askcard.mid { border-color: rgba(242, 201, 76, .55); }
.askcard.low { border-color: rgba(240, 106, 106, .55); }
.asktop { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.oddsbox { display: grid; justify-items: end; line-height: 1; }
.oddsbox small { font-size: 11px; font-weight: 700; margin-top: 3px; }
.odds { font: 800 30px/1 var(--display); }
.odds.none { color: var(--muted); }
.askcard.good .odds, .askcard.good .oddsbox small { color: var(--good); }
.askcard.mid .odds, .askcard.mid .oddsbox small { color: var(--warn); }
.askcard.low .odds, .askcard.low .oddsbox small { color: var(--bad); }
.oddsbar { height: 6px; border-radius: 3px; background: var(--surface); overflow: hidden; }
.oddsbar i { display: block; height: 100%; border-radius: 3px; }
.askcard.good .oddsbar i { background: var(--good); }
.askcard.mid .oddsbar i { background: var(--warn); }
.askcard.low .oddsbar i { background: var(--bad); }
/* results */
.results { display: grid; gap: 6px; }
.result { border-radius: 10px; background: var(--surface-2); }
/* Champions League nights stand out */
.result.ucl { box-shadow: inset 0 0 0 1.5px #7cc7ff; background: linear-gradient(rgba(124, 199, 255, .07), rgba(124, 199, 255, .07)), var(--surface-2); }
.result summary, .result .natres { list-style: none; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "meta badge" "line line"; gap: 4px 8px; padding: 8px 10px; cursor: pointer; }
.result summary::-webkit-details-marker { display: none; }
.rmeta { grid-area: meta; display: flex; align-items: center; gap: 8px; min-width: 0; }
.rcomp { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--surface); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rcomp.cup { color: var(--flood); }
.rcomp.euro { color: #7cc7ff; }
/* Derbies: a red banner on the fixture and match report, a red tag in Results */
.derby { justify-self: center; text-align: center; font-family: "Barlow Condensed", sans-serif; font-weight: 800; font-size: 15px; letter-spacing: .06em; text-transform: uppercase; color: var(--bad); }
.rderby { font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Loyalty deal: the club's pitch, written like a quote */
.loyal { margin: 2px 0; padding: 10px 12px; border-left: 3px solid var(--good); border-radius: 8px; background: var(--surface); }
.loyal p { margin: 0 0 6px; font-size: 13px; font-style: italic; line-height: 1.45; }
.loyal span { font-size: 12px; color: var(--muted); }
.loyal.away { border-left-color: var(--flood); }
.rline { grid-area: line; }
.rline .tie2, .rline .tie2.me { background: transparent; padding: 0; box-shadow: none; }
/* Your goals, assists (or bench) and rating, then W/D/L: every box 40 × 22 */
.rright { grid-area: badge; justify-self: end; display: flex; align-items: center; gap: 4px; }
.rstat, .rate-box.rr { box-sizing: border-box; width: 40px; min-width: 40px; height: 22px; padding: 0 4px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; gap: 2px; }
.rstat { background: none; color: var(--chalk); font: 800 12px var(--display); }
.rstat .ico { width: 14px; height: 14px; flex: none; }
.rstat .bench { color: var(--muted); }
.rate-box.rr { font-size: 12px; line-height: 1; }
.rbadge { justify-self: end; width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font: 800 13px var(--display); color: var(--flood-ink); }
.rbadge.good { background: var(--good); }
.rbadge.bad { background: var(--bad); }
.rbadge.draw { background: var(--muted); }
.rbody { display: grid; gap: 8px; padding: 4px 10px 10px; border-top: 1px solid var(--line); }
/* legacy tags */
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface); color: var(--muted); border: 1px solid var(--line); }
.tag.legend { background: var(--flood); color: var(--flood-ink); border-color: var(--flood); }
.tag.gold { color: var(--flood); border-color: var(--flood); }
/* commitments */
.commits { display: grid; gap: 6px; }
.commit { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.commit.on { box-shadow: inset 0 0 0 1px var(--flood); }
.commit .chip { font-size: 11px; padding: 1px 7px; margin-left: 4px; }
.commit > b { flex: none; }
/* cups: competition chips, rounds and ties */
.cuptabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: thin; scrollbar-color: var(--line) transparent; cursor: grab; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.cuptabs::-webkit-scrollbar { height: 5px; }
.cuptabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 3px; }
.cuptabs.drag { cursor: grabbing; user-select: none; }
.cuptabs button { flex: none; border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 7px 12px; font: 600 13px var(--body); white-space: nowrap; position: relative; }
.cuptabs button.on { background: var(--flood); border-color: var(--flood); color: var(--flood-ink); }
.cuptabs button.mine:not(.on)::after { content: ''; position: absolute; top: 4px; right: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--flood); }
.cupstatus { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); }
.cupstatus.good { color: var(--good); }
.cupstatus.bad { color: var(--bad); }
.round { display: grid; gap: 6px; }
.roundhead { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: var(--flood); border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.roundhead .muted { font-size: 12px; }
.tie2 { display: grid; grid-template-columns: 1fr 56px 1fr; gap: 6px; align-items: center; font-size: 13px; padding: 6px 8px; border-radius: 8px; background: var(--surface-2); }
.tie2.me { box-shadow: inset 0 0 0 1px var(--flood); }
.tside { display: flex; align-items: center; gap: 6px; min-width: 0; color: var(--chalk); }
.tside.r { justify-content: flex-end; text-align: right; }
.tside.w { font-weight: 700; }
.tside.l { color: var(--muted); }
.tside.l .crest { opacity: .55; }
.tname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tscore { display: grid; justify-items: center; font-weight: 800; font-size: 15px; line-height: 1.1; }
.tscore small { font-size: 10px; font-weight: 600; color: var(--muted); }
table.grp th:first-child { width: 100%; }
table.grp td, table.grp th { padding-left: 4px; padding-right: 4px; }

/* Career history: one block per season, clubs side by side */
details.season { min-width: 0; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
details.season > summary { list-style: none; cursor: pointer; }
details.season > summary::-webkit-details-marker { display: none; }
details.season[open] { background: var(--surface-2); }
.spells { display: grid; gap: 8px; margin-top: 8px; }
.spells.n2 { grid-template-columns: 1fr 1fr; }
.spell { min-width: 0; }
.spell .club { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spellstats { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; margin-top: 4px; }
.spellcomps { min-width: 0; }
table.comps td, table.comps th { font-size: 12px; }
details.season .tablewrap { margin: 0 -12px; padding: 0 12px; }
table.comps td:first-child { white-space: normal; }
.compline { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.compline:last-child { border-bottom: 0; }

/* Honours, Wikipedia style */
.honteam { margin-top: 10px; }
.honhead { font-size: 15px; }
.honline { font-size: 14px; padding: 3px 0 3px 12px; border-left: 2px solid var(--flood); margin: 4px 0 0 2px; }
.honline b { color: var(--flood); }

select.pick { width: 100%; margin: 8px 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
.stint { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 8px; }
.stint .club { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pastrow { display: flex; gap: 8px; align-items: stretch; }
.pastrow .house { flex: 1; min-width: 0; }
.pastrow .btn { flex: none; }

/* Release clauses: club inquiries and the transfer-talks alert */
.offer.talks { border-color: var(--good); box-shadow: 0 0 0 1px var(--good) inset; }
.inq-opts { display: grid; gap: 6px; }
.inq-opts .odds { font-size: 22px; }
.inq-opts .odds.mid { color: var(--flood); }
.inq-opts .odds.good { color: var(--good); }
.inq-opts .odds.bad { color: var(--bad); }
#fx.talks { background: radial-gradient(circle at 50% 38%, rgba(76, 195, 138, .24), rgba(5, 10, 18, .9) 70%); }
#fx.talks .pop { border-color: var(--good); box-shadow: 0 0 56px rgba(76, 195, 138, .35); }
#fx.talks .pop-icon { color: var(--good); }
.talks-tag { justify-self: center; font: 800 12px/1 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--good); padding: 4px 10px; border-radius: 999px; box-shadow: inset 0 0 0 1px var(--good); }

/* Housing: each home can be rented or bought */
.home-row { flex-wrap: wrap; }
.home-acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.home-acts .btn { white-space: nowrap; }

/* Asking the manager for a chance to start */
.chance-ask { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px dashed var(--flood); }
.chance-ask .btn { justify-self: start; }

/* Extra positions beside your main one, like the little chips on a player card */
.altpos { display: flex; flex-direction: column; gap: 3px; margin-left: auto; }
.altpos span { font: 700 11px/1 var(--display); letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); text-align: center; }
.altpos span.next { color: var(--flood); box-shadow: inset 0 0 0 1px var(--flood); background: transparent; }
/* Career history: the season's main position stands out; secondaries are smaller and outlined */
.posline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
.pos-main { font: 800 12px/1 var(--display); letter-spacing: .04em; padding: 4px 8px; border-radius: 6px; background: var(--flood); color: var(--flood-ink); }
.pos-also { font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-left: 2px; }
.pos-alt { font: 700 10px/1 var(--display); letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }

/* Matchday team sheets */
.sheet-tabs { display: grid; gap: 12px; }
.sheet-tabs h4 { margin: 0 0 6px; font: 800 13px/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pitch { display: grid; gap: 8px; padding: 10px 6px; border-radius: 12px; background: linear-gradient(#1f5a37, #17492c); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .12); }
.lp-row { display: flex; justify-content: space-around; gap: 4px; }
.lp-chip { display: grid; justify-items: center; gap: 1px; min-width: 0; flex: 1; max-width: 72px; }
.lp-chip b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #eef2f7; color: #0c1524; font-size: 12px; }
.lp-chip span { font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.lp-chip small { font-size: 9px; color: rgba(255, 255, 255, .7); }
.lp-chip.me b { background: var(--flood); box-shadow: 0 0 0 3px rgba(255, 181, 71, .35); }
.lp-chip.me span { color: var(--flood); }
.lp-bench { display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; font-size: 12px; }
.lp-bench b { width: 100%; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.lp-bench small { color: var(--muted); }
.lp-bench .me { color: var(--flood); font-weight: 700; }

/* A position the club's formation has no place for */
.pos-tag.off { opacity: .55; text-decoration: line-through; }

/* Investments */
.stocks { display: grid; gap: 8px; }
.stock { display: grid; gap: 6px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.stock .btns { flex-wrap: wrap; }
.spark polyline { stroke: var(--muted); }
.spark.up polyline { stroke: var(--good); }
.spark.down polyline { stroke: var(--bad); }
.mid { color: var(--flood); }

/* Showroom: three boxes a row, each with a photo */
.lux-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.lux-card { position: relative; display: grid; align-content: start; gap: 2px; padding: 6px 6px 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); color: var(--chalk); text-align: left; min-width: 0; cursor: pointer; }
.lux-card:disabled { opacity: .5; cursor: not-allowed; }
.lux-card:not(:disabled):hover { border-color: var(--flood); }
.lux-pic { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; background: #e9edf3; margin-bottom: 4px; }
.lux-pic img { width: 100%; height: 100%; object-fit: cover; }
.lux-pic.icon { background: var(--surface); color: var(--muted); }
.lux-pic.icon svg { width: 46%; height: 46%; }
.lux-brand { font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lux-name { font-size: 12px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; }
.lux-price { font-size: 13px; color: var(--flood); }
.lux-owned { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: var(--good); color: #062014; }

/* Week calendar and the midweek game on the home card */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.wd { display: grid; justify-items: center; align-content: start; gap: 2px; padding: 6px 0; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); min-width: 0; }
.wd small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.wd b { font-size: 15px; font-weight: 700; }
.wd span { font-size: 9px; font-weight: 700; color: var(--muted); }
.wd .crest.mini { width: 18px; height: 18px; }
.wd.game { border-color: var(--flood); }
.wd.game span { color: var(--flood); }
.wd.today { background: var(--surface-2); border-color: var(--chalk); }
.wd.today small { color: var(--chalk); }
.wd.past { opacity: .5; }
.midweek { border: 1px solid var(--flood); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: rgba(255, 181, 71, .06); }
.midweek .mw-title { color: var(--flood); margin: 0; }

/* Retirement Icon card (art in ICON_ART): gold rim, white marble. OVR and positions top left, the
   silhouette, then the name, the six stats in a row (labels over numbers) and the flag, club crest
   and Icon badge along the bottom. */
.icon-card {
  --ink: #3a2a06; --sub: #7a5410; --rule: rgba(122, 84, 16, .35);
  position: relative; width: 230px; height: 330px; margin: 4px auto 12px; padding: 34px 22px 26px;
  display: flex; flex-direction: column; color: var(--ink); font-family: var(--display); isolation: isolate;
  clip-path: path('M0 46C17 46 27 36 27 17C62 19 92 13 115 3C138 13 168 19 203 17C203 36 213 46 230 46V270C230 290 214 299 190 305C160 312 132 317 115 329C98 317 70 312 40 305C16 299 0 290 0 270Z');
}
.ic-art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }
.ic-top { display: flex; position: relative; padding-left: 6px; }
.ic-ovr { display: grid; justify-items: center; line-height: 1; }
.ic-ovr b { font-size: 44px; font-weight: 800; }
.ic-ovr span { font-size: 17px; font-weight: 800; letter-spacing: .06em; }
.ic-ovr i { font-style: normal; font-size: 11px; font-weight: 700; margin-top: 3px; padding: 1px 6px; border-radius: 6px; background: rgba(90, 62, 8, .12); }
.ic-man { width: 104px; margin: -44px auto 0; fill: rgba(18, 12, 2, .95); }
.ic-foot { margin-top: auto; display: grid; gap: 4px; }
.ic-name { text-align: center; font-size: 21px; font-weight: 800; letter-spacing: .02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic-row { display: grid; grid-template-columns: repeat(var(--n), 1fr); text-align: center; line-height: 1.05; }
.ic-row small { font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--sub); }
.ic-row b { font-size: 17px; font-weight: 800; }
.ic-badges { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 2px; }
.ic-flag { width: 24px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(90, 60, 10, .3); }
.ic-badges .crest, .ic-badges .crest.haslogo { width: auto; height: auto; border: 0; background: none; }
.ic-badges .crest img { width: 22px; height: 22px; object-fit: contain; }
.ic-badges .crest span { font: 800 10px var(--display); color: var(--sub); }
.ic-badges .crest.haslogo span { display: none; }
.ic-emblem { width: 19px; height: 22px; fill: #b08433; }
.ic-em-shield { fill: #f6f0dc; stroke: #c99b3f; stroke-width: 2.2; }
.ic-em-ball { fill: none; stroke: #b08433; stroke-width: 1.6; }
.ic-em-seam { fill: none; stroke: #b08433; stroke-width: 1.1; }

/* ---------- penalty shootout ---------- */
.so { display: grid; gap: 14px; }
.so .btn { width: 100%; }
.so-board { display: grid; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.so-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; gap: 10px; }
.so-row b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.so-row .num { font: 800 22px var(--display); text-align: right; }
.so-dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; max-width: 170px; }
.so-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line); }
.so-dots i.in { background: var(--good); border-color: var(--good); }
.so-dots i.out { background: var(--bad); border-color: var(--bad); }
.so-last, .so-res, .so-ask { margin: 0; font-weight: 700; }
.so-last.good, .so-res.good { color: var(--good); }
.so-last.bad, .so-res.bad { color: var(--bad); }
.so-res { font: 800 24px/1.1 var(--display); text-transform: uppercase; }
/* The goal as seen from the spot: posts and bar in white, netting behind. */
.so-goal { display: grid; grid-template-columns: repeat(3, 1fr); aspect-ratio: 3 / 1.15; border: 5px solid #f4f6fa; border-bottom: 0;
  background: repeating-linear-gradient(0deg, transparent 0 9px, rgba(255,255,255,.12) 9px 10px), repeating-linear-gradient(90deg, transparent 0 9px, rgba(255,255,255,.12) 9px 10px), #20324f; }
.so-goal.shoot { grid-template-rows: repeat(2, 1fr); }
.so-goal button { border: 1px dashed rgba(255,255,255,.22); background: transparent; color: var(--chalk); font: 700 15px var(--display); text-transform: uppercase; letter-spacing: .05em; cursor: pointer; }
.so-goal button:hover, .so-goal button:focus-visible { background: rgba(255,181,71,.28); }
.so-goal.shoot button::after { content: ''; display: block; width: 18px; height: 18px; margin: auto; border-radius: 50%; border: 2px solid rgba(255,255,255,.5); }

/* National teams: the flag itself, in its own shape. */
.crest.nation.hasflag { background: transparent; border-color: transparent; border-radius: 0; }
.crest.nation.hasflag span { display: none; }
.crest.nation.hasflag img { width: 100%; height: auto; border-radius: 3px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .18); }
.crest.nation.hasflag { height: auto; }
.crest.nation.hasflag.mini { width: 30px; }
/* Club crests stand on their own: no circle around them. Clubs without a logo just show their short name. */
.crest:not(.nation), .crest.me:not(.nation) { border-color: transparent; background: transparent; }

/* League table, laid out like Google's standings: even rows, every crest whole in the same small
   square, muted positions, bold points, a thin coloured bar for the top and bottom places. */
table.lgt { font-size: 13.5px; }
table.lgt th { font-size: 11px; text-transform: none; letter-spacing: 0; padding: 8px 4px; white-space: nowrap; }
table.lgt td { padding: 0 4px; height: 40px; vertical-align: middle; }
table.lgt td:first-child, table.lgt th:first-child { width: 26px; text-align: center; color: var(--muted); padding-left: 6px; }
table.lgt tr.me td:first-child { color: var(--flood); }
table.lgt td.r, table.lgt th.r { width: 26px; text-align: center; }
table.lgt .pts { width: 30px; font-weight: 800; }
table.lgt .clubcell { gap: 10px; }
/* The Results and Cups wrapper only marks crests for the table look; it takes no part in layout. */
.lgcrest { display: contents; }
table.lgt .crest.mini, .sqmove .crest.mini, .lgcrest .crest.mini:not(.nation), .spell .crest.mini, .stint .crest.mini, .honteam .crest.mini:not(.nation), .offer .clubcell .crest:not(.nation) { width: 22px; height: 22px; border: 0; border-radius: 0; overflow: visible; background: none; }
table.lgt .crest.mini img, .lgcrest .crest.mini:not(.nation) img, .spell .crest.mini img, .stint .crest.mini img, .honteam .crest.mini:not(.nation) img, .offer .clubcell .crest:not(.nation) img { width: 100%; height: 100%; object-fit: contain; }
/* League tables always fit the screen: the club column takes the width left after the number columns. */
table.lgt td.clubname { width: 100%; max-width: 0; }
table.lgt td.clubname .clubcell { max-width: 100%; }
/* On a phone the W, D and L columns make way for the form. */
@media (max-width: 479px) { table.lgt .wdl { display: none; } }
/* Last 5: green tick for a win, red cross for a loss, grey dash for a draw; the latest is ringed.
   Only games already played are shown. */
table.lgt th.l5 { text-align: left; padding-left: 8px; }
table.lgt td.l5 { padding-left: 8px; padding-right: 2px; width: 72px; }
.fmrow { display: flex; align-items: center; gap: 2px; height: 18px; }
.fm { flex: none; display: grid; place-items: center; width: 12px; height: 12px; border-radius: 50%;
  font: 800 8px/1 var(--body); font-style: normal; color: #0c1524; }
.fm.w { background: var(--good); --ring: var(--good); } .fm.w::after { content: '✓'; }
.fm.l { background: var(--bad); --ring: var(--bad); } .fm.l::after { content: '✕'; }
.fm.d { background: var(--muted); --ring: var(--muted); } .fm.d::after { content: '–'; }
.fm.last { width: 14px; height: 14px; margin-left: 1px; box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--ring); }
/* Career history: the crest sits beside the club name, not in the middle of the whole block. */
.spell .clubcell, .stint .clubcell { align-items: flex-start; }
.spell .clubcell > .crest.mini, .stint .clubcell > .crest.mini { margin-top: 2px; }
/* Squad nationality as a flag; top scorers' and assisters' club as its crest. */
.natflag { display: block; width: 22px; height: auto; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .15); }
.honteam .natflag { width: 28px; flex: none; }
td.natcell, td.clubcrest, th.clubcrest { width: 34px; }
td.clubcrest .crest { margin: 0; }
/* Saved-career card and player header: the club crest whole, not cropped to a circle. */
.hero .crest.small { width: 46px; height: 46px; border: 0; border-radius: 0; overflow: visible; }
.hero .crest.small img { width: 44px; height: 44px; object-fit: contain; }
/* The base card (your card during a career) has a smooth top: its own outline. */
.icon-card.base-card { clip-path: path('M0 38C0 20 10 12 28 11C62 9 92 7 115 3C138 7 168 9 202 11C220 12 230 20 230 38V270C230 290 214 299 190 305C160 312 132 317 115 329C98 317 70 312 40 305C16 299 0 290 0 270Z'); }
/* Hero cards: a clipped-corner rectangle; dark designs get light text. */
.icon-card.hero-card { clip-path: path('M16 0H98L106 7H124L132 0H214L230 16V314L214 330H16L0 314V16Z'); }
.icon-card.hero-card.dark { --ink: #fff; --sub: #cfe3ff; --rule: rgba(255, 255, 255, .35); }
.icon-card.hero-card.dark .ic-man { fill: rgba(3, 6, 14, .95); }
/* Under the retirement card: the Legacy score and the fans' vote side by side. */
.legacy-sum { display: flex; justify-content: center; gap: 28px; text-align: center; }
.legacy-sum small { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.legacy-sum b { font: 800 26px var(--display); }
.legacy-sum span { display: block; font-size: 12px; color: var(--muted); }
.ic-emblem.hero-emblem { width: 20px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .45)); }
/* Competition badges in the career tables: a short code on the competition kind's colour. */
.comp-badge { display: inline-grid; place-items: center; min-width: 26px; height: 16px; padding: 0 4px; border-radius: 4px; background: var(--cb); color: #fff; font: 800 9px/1 var(--display); letter-spacing: .04em; flex: none; }
.comp-name { display: inline-flex; align-items: center; gap: 6px; }
.comp-head { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.comp-badges { display: inline-flex; gap: 3px; flex-wrap: wrap; }
/* Shirt number picker: a grid of free numbers, the ones that suit your position highlighted. */
.shirt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: 6px; }
.shirt-no { height: 40px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--chalk); font: 800 17px var(--display); cursor: pointer; }
.shirt-no.pref { border-color: var(--flood); color: var(--flood); }
.shirt-no:hover, .shirt-no:focus-visible { background: rgba(255, 181, 71, .2); }
/* Shirt numbers on the team sheet sit on a little shirt instead of a circle. */
.lp-chip b.shirt { width: 34px; height: 30px; border-radius: 0; padding-top: 5px; place-items: start center;
  clip-path: polygon(30% 0, 40% 0, 50% 12%, 60% 0, 70% 0, 100% 20%, 88% 42%, 78% 36%, 78% 100%, 22% 100%, 22% 36%, 12% 42%, 0 20%); }
/* Your shirt number beside the club in the career history, on the same little shirt. */
.clubline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.clubline .club { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shirt-tag { display: grid; flex: none; place-items: start center; width: 24px; height: 21px; padding-top: 4px; background: #eef2f7; color: #0c1524; font: 800 10px var(--display);
  clip-path: polygon(30% 0, 40% 0, 50% 12%, 60% 0, 70% 0, 100% 20%, 88% 42%, 78% 36%, 78% 100%, 22% 100%, 22% 36%, 12% 42%, 0 20%); }
/* Competition logos in the career tables: shown whole, at badge height. */
.comp-logo { height: 18px; width: auto; max-width: 40px; object-fit: contain; flex: none; }
.comp-badges .comp-logo { height: 16px; max-width: 34px; }
/* Competition logos sit on a small light tile so dark ones stay visible on the dark background. */
.comp-logo { box-sizing: border-box; height: 22px; max-width: 44px; padding: 2px 3px; border-radius: 5px; background: #f2f4f8; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.comp-badges .comp-logo { height: 20px; max-width: 38px; }
/* Rating boxes: SofaScore-style colours by rating. */
.rate-box { display: inline-block; min-width: 38px; padding: 2px 5px; border-radius: 4px; text-align: center; font: 800 12px/1.3 var(--display); color: #fff; }
.rate-box.r5 { background: #dc0c00; } .rate-box.r6 { background: #ed7e07; } .rate-box.r65 { background: #d9af00; color: #1d1d1d; }
.rate-box.r7 { background: #00c424; } .rate-box.r8 { background: #00adc4; } .rate-box.r9 { background: #374df5; }
.rate-box.none { background: #a4a9b3; }
.bigstat .rate-box { min-width: 46px; font-size: 20px; padding: 2px 6px; }
/* Manager card: two dropdowns, Board and Manager */
.mgrcard { gap: 0; padding: 4px 14px; }
.mdrop { padding: 10px 0; }
.mbody { display: grid; gap: 10px; margin-top: 10px; min-width: 0; }
.mdrop + .mdrop { border-top: 1px solid var(--line); }
.mdrop[open] { padding-bottom: 14px; }
.mdrop > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.mdrop > summary::-webkit-details-marker { display: none; }
.mdrop > summary > .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-left: auto; }
.mdrop > summary::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); margin: -4px 2px 0 4px; transition: transform .15s; }
.mdrop[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.mbody > * { margin: 0; }
/* 2–3 goals or assists in a result: the icons overlap, the first one on top */
.rstat .stack { display: inline-flex; align-items: center; }
.rstat .stack i { position: relative; display: inline-flex; font-style: normal; }
.rstat .stack i + i { margin-left: -7px; }
.rstat .stack .ico { fill: var(--surface-2); }
/* Squad changes card: one row per player who left or arrived */
.sqmove { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sqmove > div:not(.crest) { flex: 1; }
.sqmove .sqname { font-weight: 700; overflow-wrap: anywhere; }
.sqmove.me .sqname { color: var(--flood); }
.sqmove .pos-chip { flex: none; width: 36px; text-align: center; font: 800 11px var(--display); padding: 2px 0; border-radius: 4px; background: var(--surface-2); color: var(--chalk); }
.sqmove .chip { flex: none; }
.crest img.ink { filter: brightness(0) invert(1); }

/* Nickname, milestones, achievements, hall of fame, captain's armband */
.nick { font: 700 18px var(--display); color: var(--flood); margin: -4px 0 8px; letter-spacing: .02em; }
.kv small + small, .kv b + small { display: block; }
.msrow { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 0; border-bottom: 1px solid var(--line); }
.msrow:last-child { border-bottom: 0; }
.achv { display: grid; gap: 6px; max-height: 60vh; overflow-y: auto; margin: 10px 0; }
.achvrow { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 8px; background: var(--surface-2); opacity: .55; }
.achvrow.on { opacity: 1; }
.achvdot { font-size: 18px; line-height: 1.2; color: var(--muted); }
.achvrow.on .achvdot { color: var(--flood); }
.hof { display: flex; align-items: center; gap: 10px; text-align: left; }
.hofrank { flex: none; width: 24px; font: 800 18px var(--display); color: var(--muted); text-align: center; }
.captag { display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 3px; background: var(--flood); color: var(--flood-ink); font: 800 10px var(--display); vertical-align: 2px; }
.natchip { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; max-width: 100%; }
/* Flag and country side by side when they fit; otherwise the name goes under the flag as a whole word. */
.kv .natchip { margin-right: 4px; min-width: 0; flex-wrap: wrap; row-gap: 2px; }
@media (max-width: 400px) { .kv b { font-size: 12.5px; } .kv .natchip { column-gap: 4px; } .kv .natchip .natflag { width: 17px; } }
.natchip .natflag { width: 20px; }
summary .natflag { display: inline-block; vertical-align: middle; }

/* Free agent calendar: the month you are in, this game week highlighted. */
.facal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.facal span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.facal i { font-style: normal; font: 600 13px/30px var(--body); border-radius: 8px; color: var(--muted); font-variant-numeric: tabular-nums; }
.facal i.wk { background: var(--surface-2); color: var(--chalk); border: 1px solid var(--line); }
.facal i.today { background: var(--flood); color: var(--flood-ink); border-color: var(--flood); }
.facal i.past { opacity: .45; }
.faprompt { border-color: var(--flood); }

/* =====================================================================================
   THEMES: a matchday-at-night game look laid over the base styles above.
   Stadium dark, mown-grass stripes, a glowing HUD accent, italic condensed headings,
   angled "game menu" buttons and player-card OVR shields. Everything above still works;
   this block only re-skins it.
   Each theme is just a set of colours on <html data-theme="...">. Arena is the default;
   the league themes take their palettes from each league's look, with no logos (the store
   app lists them as English, Spanish, Italian, German and French).
   --acc: the accent. --acc-rgb: the same as "r, g, b" for glows. --acc-hi / --acc-lo:
   the top and bottom of the accent's gradient. --acc2: the second accent.
   --tint-rgb: the colour of the grass stripes. --panel-a / --panel-b: card gradient.
   --hero-a / --hero-b: the big card's gradient. --btn-a / --btn-b / --btn-line: plain buttons.
   ===================================================================================== */
html:not([data-theme="original"]) {
  --stand: #060d0b;
  --surface: #0e1a17;
  --surface-2: #15261f;
  --line: #22392f;
  --chalk: #f1f7f3;
  --muted: #86a597;
  --acc: #c8ff2e; --acc-rgb: 200, 255, 46; --acc-hi: #e2ff7a; --acc-lo: #9fd600;
  --acc2: #2ee6ff; --acc2-rgb: 46, 230, 255;
  --tint-rgb: 53, 224, 138;
  --panel-a: rgba(21, 38, 31, .92); --panel-b: rgba(10, 20, 17, .94);
  --hero-a: #13281f; --hero-b: #0b1713;
  --btn-a: #1c3329; --btn-b: #13241d; --btn-line: #2c4a3c;
  --flood: var(--acc);
  --flood-ink: #0a1400;
  --good: #35e08a;
  --bad: #ff4d6a;
  --warn: #ffd23f;
  --gold: #ffcf4a;
  --glow: 0 0 18px rgba(var(--acc-rgb), .35);
  --radius: 10px;
  --nav-h: 66px;
}

/* Premier League: royal purple, light blue, neon green. */
html[data-theme="pl"] {
  --stand: #12001a; --surface: #1e0629; --surface-2: #2a0b38; --line: #3f1a52; --chalk: #f8f1ff; --muted: #b39cc4;
  --acc: #38d6ff; --acc-rgb: 56, 214, 255; --acc-hi: #92eaff; --acc-lo: #0aa6e0;
  --acc2: #00ff85; --acc2-rgb: 0, 255, 133; --tint-rgb: 160, 60, 210;
  --panel-a: rgba(46, 12, 62, .92); --panel-b: rgba(22, 3, 32, .95);
  --hero-a: #3a0a4e; --hero-b: #1a0226; --btn-a: #3a1450; --btn-b: #26093a; --btn-line: #57286f;
  --flood-ink: #001a26;
}
/* Bundesliga: warm charcoal, sunset orange, gold. */
html[data-theme="bundesliga"] {
  --stand: #120a09; --surface: #1d1210; --surface-2: #2a1916; --line: #43271f; --chalk: #fff5f0; --muted: #c09a8c;
  --acc: #ff7a3d; --acc-rgb: 255, 122, 61; --acc-hi: #ffad80; --acc-lo: #e0521a;
  --acc2: #ffb400; --acc2-rgb: 255, 180, 0; --tint-rgb: 255, 120, 60;
  --panel-a: rgba(44, 26, 22, .92); --panel-b: rgba(20, 11, 9, .95);
  --hero-a: #3a1712; --hero-b: #170a08; --btn-a: #3b211b; --btn-b: #281511; --btn-line: #5a3227;
  --flood-ink: #fff;
}
/* Serie A: deep Italian blue, turquoise, azure. */
html[data-theme="seriea"] {
  --stand: #040b22; --surface: #0b1634; --surface-2: #112048; --line: #1f3366; --chalk: #eef4ff; --muted: #8fa4cf;
  --acc: #00e0c6; --acc-rgb: 0, 224, 198; --acc-hi: #6ff5e4; --acc-lo: #00a893;
  --acc2: #3d7bff; --acc2-rgb: 61, 123, 255; --tint-rgb: 61, 123, 255;
  --panel-a: rgba(17, 32, 72, .92); --panel-b: rgba(6, 14, 38, .95);
  --hero-a: #10275e; --hero-b: #050f2c; --btn-a: #18306a; --btn-b: #0f2150; --btn-line: #2a4688;
  --flood-ink: #00201c;
}
/* LaLiga: black, red, white. */
html[data-theme="laliga"] {
  --stand: #08080a; --surface: #141417; --surface-2: #1d1d22; --line: #34343c; --chalk: #ffffff; --muted: #a3a3ad;
  --acc: #ff1e2d; --acc-rgb: 255, 30, 45; --acc-hi: #ff6670; --acc-lo: #c4000f;
  --acc2: #ffffff; --acc2-rgb: 255, 255, 255; --tint-rgb: 255, 255, 255;
  --panel-a: rgba(30, 30, 34, .92); --panel-b: rgba(12, 12, 14, .95);
  --hero-a: #2a1012; --hero-b: #0c0a0b; --btn-a: #26262c; --btn-b: #19191d; --btn-line: #3d3d46;
  --flood-ink: #fff;
}
/* Ligue 1: night navy, electric blue, French red. */
html[data-theme="ligue1"] {
  --stand: #050a1f; --surface: #0c1430; --surface-2: #131e44; --line: #243266; --chalk: #f0f3ff; --muted: #9aa5cc;
  --acc: #4d8bff; --acc-rgb: 77, 139, 255; --acc-hi: #94b8ff; --acc-lo: #2160e0;
  --acc2: #ff4b5c; --acc2-rgb: 255, 75, 92; --tint-rgb: 120, 140, 255;
  --panel-a: rgba(19, 30, 68, .92); --panel-b: rgba(7, 12, 34, .95);
  --hero-a: #16245a; --hero-b: #070c26; --btn-a: #1b2a5e; --btn-b: #121d46; --btn-line: #2e4184;
  --flood-ink: #fff;
}

/* Everything below is the re-skin. It is nested under the selector so the Original theme (data-theme="original")
   switches all of it off and gets the game's first look back; :where() keeps the specificity of each rule as written. */
:where(html:not([data-theme="original"])) {
/* The stadium: floodlight haze at the top, mown stripes under everything, a faint halfway line and centre circle. */
body {
  background:
    radial-gradient(120% 55% at 50% -12%, rgba(var(--acc-rgb), .13), transparent 60%),
    radial-gradient(60% 40% at 0% 0%, rgba(var(--acc2-rgb), .07), transparent 70%),
    radial-gradient(60% 40% at 100% 0%, rgba(var(--acc2-rgb), .07), transparent 70%),
    repeating-linear-gradient(180deg, rgba(var(--tint-rgb), .035) 0 64px, transparent 64px 128px),
    var(--stand);
  background-attachment: fixed;
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 50% 58%, transparent 118px, rgba(255, 255, 255, .045) 119px 121px, transparent 122px),
    linear-gradient(180deg, transparent calc(58% - 1px), rgba(255, 255, 255, .045) calc(58% - 1px) calc(58% + 1px), transparent calc(58% + 1px));
}
body::before { background: var(--stand); }

/* Headings: italic, condensed, leaning forward like a broadcast graphic. */
h2 {
  font: italic 800 15px/1.2 var(--display); letter-spacing: .12em; color: var(--chalk);
  display: flex; align-items: center; gap: 8px;
}
h2::before { content: ""; flex: none; width: 4px; height: 14px; background: var(--acc); transform: skewX(-16deg); box-shadow: var(--glow); }
.brand { font-style: italic; font-weight: 900; letter-spacing: -.005em; text-shadow: 0 3px 0 rgba(0, 0, 0, .4); }
.brand em { color: var(--acc); text-shadow: 0 0 22px rgba(var(--acc-rgb), .55); }
.sheet h3, .pop h3, .so-res, .offer .club { font-style: italic; }

/* ---------- top bar: a HUD strip ---------- */
.topbar {
  background: linear-gradient(180deg, var(--stand) 60%, color-mix(in srgb, var(--stand) 88%, transparent));
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 0;
}
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--acc) 30%, var(--acc2) 70%, transparent);
  opacity: .7; box-shadow: 0 0 12px rgba(var(--acc-rgb), .4);
}
.who h1 { font-style: italic; font-weight: 800; font-size: 24px; text-transform: uppercase; letter-spacing: .02em; }
.chip { background: rgba(255, 255, 255, .04); border-color: var(--line); border-radius: 4px; }
.chip.flood { background: rgba(var(--acc-rgb), .08); }

/* OVR: a player-card shield with a metallic finish. */
.ovr {
  border-radius: 0; width: 56px; height: 66px; padding-bottom: 6px;
  clip-path: polygon(50% 0, 100% 10%, 100% 78%, 50% 100%, 0 78%, 0 10%);
  background: linear-gradient(160deg, #fff6c9, var(--gold) 35%, #b8871a 75%, #ffe08a);
  color: #2a1a00;
}
.ovr b { font-style: italic; font-weight: 900; font-size: 31px; }
.ovr.card-gold { background: linear-gradient(160deg, #fff6c9, var(--gold) 35%, #b8871a 75%, #ffe08a); color: #2a1a00; }
.ovr.card-silver { background: linear-gradient(160deg, #ffffff, #c9d3dd 40%, #8793a1 78%, #e6ecf2); color: #141c26; }
.ovr.card-bronze { background: linear-gradient(160deg, #ffd9b0, #d08a4c 40%, #8a4f22 78%, #e8a66d); color: #2b1606; }
body.compact .topbar .ovr { width: 40px; height: 46px; border-radius: 0; }

/* Energy and progress bars: segmented, slanted. Energy keeps green / amber / red whatever the theme. */
.bar { height: 8px; border-radius: 2px; background: rgba(255, 255, 255, .06); transform: skewX(-20deg); }
.bar i { border-radius: 0; background: linear-gradient(90deg, #1fbf6e, var(--good));
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px); mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 12px); }
.bar i.mid { background: linear-gradient(90deg, #e0a800, var(--warn)); }
.bar i.low { background: linear-gradient(90deg, #c4203a, var(--bad)); }
.attr .bar i { background: linear-gradient(90deg, var(--acc-lo), var(--acc)); }

/* ---------- cards: glass panels with a lit top edge ---------- */
.card, .attr {
  position: relative;
  background: linear-gradient(180deg, var(--panel-a), var(--panel-b));
  border: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.card::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, var(--acc), rgba(var(--acc2-rgb), .8) 55%, transparent);
  opacity: .55;
}
.card.hero {
  background:
    radial-gradient(90% 70% at 50% 0%, rgba(var(--acc-rgb), .10), transparent 70%),
    repeating-linear-gradient(90deg, rgba(var(--tint-rgb), .05) 0 36px, transparent 36px 72px),
    linear-gradient(180deg, var(--hero-a), var(--hero-b));
  border-color: rgba(var(--acc-rgb), .28);
}
.card.hero::before { opacity: 1; box-shadow: 0 0 14px rgba(var(--acc-rgb), .6); }

/* Matchday fixture: a big broadcast VS. */
.vs {
  font: italic 900 42px/1 var(--display);
  background: linear-gradient(180deg, #ffffff, var(--acc)); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 12px rgba(var(--acc-rgb), .45));
}
.score { font-style: italic; font-weight: 900; text-shadow: 0 0 18px rgba(var(--acc-rgb), .35); }
.fixture .crest { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .6)); }
.team b { font-family: var(--display); font-size: 17px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-style: italic; }

/* ---------- buttons: angled game-menu plates ---------- */
.btn {
  border-radius: 4px; font-family: var(--display); font-size: 16px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  background: linear-gradient(180deg, var(--btn-a), var(--btn-b)); border-color: var(--btn-line);
  transition: transform .12s, filter .15s, border-color .15s;
}
.btn:not(:disabled):active { transform: translateY(1px) scale(.985); }
.btn:not(:disabled):hover { border-color: var(--acc); }
.btn.sm { font-size: 14px; }
.btn.primary {
  position: relative; overflow: hidden; border: 0; border-radius: 0;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  background: linear-gradient(180deg, var(--acc-hi), var(--acc) 45%, var(--acc-lo));
  color: var(--flood-ink); font-style: italic; font-weight: 900; font-size: 21px; letter-spacing: .08em; min-height: 52px;
}
.btn.primary::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .55) 50%, transparent 65%);
  transform: translateX(-120%); animation: sheen 3.2s ease-in-out infinite;
}
.btn.primary:not(:disabled):hover { filter: brightness(1.08); }
.btn.good { background: linear-gradient(180deg, #5cf2a4, var(--good) 50%, #19b366); color: #032013; border: 0; }
.btn.danger { background: rgba(255, 77, 106, .06); }

/* Segmented tabs: lit plate on the chosen one. */
.seg { background: rgba(0, 0, 0, .3); border-radius: 6px; }
.seg button { border-radius: 3px; font-family: var(--display); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.seg button.on { background: var(--acc); color: var(--flood-ink); box-shadow: var(--glow); font-style: italic; }
.cuptabs button { border-radius: 4px; }
.cuptabs button.on { box-shadow: var(--glow); }
.posgrid button { border-radius: 4px; font-style: italic; }
.posgrid button.on { background: var(--acc); box-shadow: var(--glow); }

/* Inputs */
.field input, .field select, select.pick { background: rgba(0, 0, 0, .35); border-color: var(--line); border-radius: 4px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--acc); box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .18); }

/* ---------- tables: scoreboard rows ---------- */
th { color: var(--acc); font-family: var(--display); font-size: 12px; letter-spacing: .08em; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .022); }
tr.me td { background: linear-gradient(90deg, rgba(var(--acc-rgb), .16), rgba(var(--acc-rgb), .04)) !important; color: var(--acc); }
table.lgt .pts { color: var(--chalk); font-family: var(--display); font-size: 15px; }
tr.me .pts { color: var(--acc); }

/* Week strip, offers, messages */
.wd { border-radius: 4px; background: rgba(0, 0, 0, .25); }
.wd.today { background: linear-gradient(180deg, rgba(var(--acc-rgb), .2), rgba(var(--acc-rgb), .04)); border-color: var(--acc); box-shadow: var(--glow); }
.wd.today small, .wd.today b { color: var(--acc); }
.wd b { font-family: var(--display); font-size: 19px; font-weight: 800; font-style: italic; }
.offer { border-radius: 6px; background: linear-gradient(180deg, rgba(var(--acc-rgb), .07), rgba(0, 0, 0, .2)); box-shadow: inset 4px 0 0 var(--acc); }
.kv div { border-radius: 4px; background: rgba(0, 0, 0, .3); }
.kv b { font-family: var(--display); font-size: 17px; font-weight: 800; }
.msg { border-radius: 4px; background: rgba(0, 0, 0, .28); }
.bigstat div { border-radius: 4px; background: rgba(0, 0, 0, .3); border-top: 2px solid var(--acc); }
.bigstat b { font-style: italic; }
.attr .val { font-style: italic; font-weight: 900; color: var(--chalk); }
.result { border-radius: 6px; background: rgba(0, 0, 0, .28); }
.tie2, .commit, .stock, .askcard, .lux-card, .achvrow, .cupstatus { border-radius: 6px; }
.award { border-radius: 4px; background: rgba(255, 207, 74, .12); color: var(--gold); }
/* Accent tints the base styles wrote in the old amber */
.house.on { background: rgba(var(--acc-rgb), .08); }
.order, .midweek { background: rgba(var(--acc-rgb), .05); }
.shirt-no:hover, .shirt-no:focus-visible { background: rgba(var(--acc-rgb), .2); }
.so-goal button:hover, .so-goal button:focus-visible { background: rgba(var(--acc-rgb), .28); }

/* Lineup pitch: proper grass with stripes and markings (grass stays green in every theme). */
.pitch {
  border-radius: 6px;
  background:
    linear-gradient(180deg, transparent calc(50% - 1px), rgba(255, 255, 255, .25) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)),
    radial-gradient(circle at 50% 50%, transparent 38px, rgba(255, 255, 255, .25) 39px 41px, transparent 42px),
    repeating-linear-gradient(180deg, #2a8a4a 0 34px, #237a40 34px 68px);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .3), 0 10px 30px rgba(0, 0, 0, .4);
}
.lp-chip.me b { box-shadow: 0 0 0 3px rgba(var(--acc-rgb), .4), 0 0 14px rgba(var(--acc-rgb), .7); }

/* ---------- bottom nav: a glowing console dock ---------- */
nav.tabs {
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 92%, transparent), var(--stand));
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(var(--acc-rgb), .18);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, .5);
}
nav.tabs button { font-family: var(--display); font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; transition: color .15s; }
@media (max-width: 340px) { nav.tabs button { font-size: 10.5px; } }
nav.tabs button.on { color: var(--acc); text-shadow: 0 0 10px rgba(var(--acc-rgb), .6); }
nav.tabs button.on svg { filter: drop-shadow(0 0 6px rgba(var(--acc-rgb), .8)); }
nav.tabs button.on::before {
  content: ""; position: absolute; top: 0; left: 50%; width: 30px; height: 3px; margin-left: -15px;
  background: var(--acc); transform: skewX(-20deg); box-shadow: 0 0 12px var(--acc);
}

/* ---------- modal sheets and pop-ups ---------- */
#modal { background: rgba(2, 4, 6, .78); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.sheet {
  background: radial-gradient(90% 40% at 50% 0%, rgba(var(--acc-rgb), .08), transparent 70%), linear-gradient(180deg, var(--surface-2), var(--stand));
  border-top: 2px solid var(--acc); border-radius: 14px 14px 0 0; box-shadow: 0 -10px 40px rgba(var(--acc-rgb), .12);
}
.pop { border-radius: 8px; background: linear-gradient(180deg, var(--surface-2), var(--stand)); }
#fx.good .pop, #fx.haul .pop { border-color: var(--acc); box-shadow: 0 0 60px rgba(var(--acc-rgb), .3); }
#fx.good, #fx.haul { background: radial-gradient(circle at 50% 38%, rgba(var(--acc-rgb), .2), rgba(2, 4, 6, .92) 70%); }
.toast { background: var(--acc); color: var(--flood-ink); border-radius: 4px; font-family: var(--display); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; box-shadow: var(--glow); }

/* Gold stays gold: honours, trophies, achievements. */
.honline { border-left-color: var(--gold); }
.honline b, .achvrow.on .achvdot, .lux-price { color: var(--gold); }
.tag.legend { background: var(--gold); border-color: var(--gold); color: #2a1a00; }

}
@keyframes sheen { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* Theme picker (dev only). Works in every theme, Original included, so its colours fall back to the base ones. */
.themepick { display: grid; gap: 6px; }
.themepick label { font: 700 12px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.themepick select { background: linear-gradient(180deg, var(--btn-a, var(--surface-2)), var(--btn-b, var(--surface))); color: var(--chalk); border: 1px solid var(--btn-line, var(--line)); border-radius: 6px; min-height: 46px; padding: 0 12px;
  font: 700 16px var(--display); letter-spacing: .05em; text-transform: uppercase; }
.themepick select:focus { outline: none; border-color: var(--flood); }
/* The open list: the phone draws it itself, so give each option the theme's dark panel and white text. */
.themepick option { background: var(--surface-2); color: var(--chalk); font: 600 15px var(--body); text-transform: none; }
.themepick option:checked { background: var(--flood); color: var(--flood-ink); }

@media (prefers-reduced-motion: reduce) { .btn.primary::after { animation: none; display: none; } }
