@import url("https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@700;800;900&family=Inter:wght@500;700;800;900&display=swap");

:root {
  color-scheme: dark;
  --bg: #0e1214;
  --panel: #151a1d;
  --panel-2: #1d2428;
  --line: #303a40;
  --text: #f2f7f4;
  --muted: #9aa6a1;
  --green: #35c46f;
  --lime: #c9e66f;
  --gold: #d9b35d;
  --pitch: #0f6d43;
  --pitch-dark: #0a5334;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button { font: inherit; }

.version-badge {
  position: fixed;
  left: 8px;
  bottom: 6px;
  z-index: 50;
  color: rgba(242, 247, 244, .42);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
  pointer-events: none;
}

h1,
h2,
.mode-btn strong,
.primary-btn,
.ghost-btn,
.match-btn,
.winner-banner,
.live-score,
.scoreboard,
.run-meta,
.slot {
  font-family: "Barlow Condensed", Impact, "Arial Narrow", sans-serif;
  letter-spacing: 0.03em;
}

.setup-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 9, 10, 0.86);
}

.setup-overlay.hidden { display: none; }

.setup-modal {
  display: grid;
  width: min(560px, 100%);
  gap: 14px;
  padding: 24px;
  background: #151a1d;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.setup-modal h2 {
  font-size: 34px;
}

.team-name-input {
  width: 100%;
  min-height: 54px;
  padding: 0 14px;
  color: var(--text);
  background: #10181c;
  border: 1px solid var(--line);
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  outline: none;
}

.team-name-input:focus { border-color: rgba(53, 196, 111, 0.72); }

.team-name-input.invalid {
  border-color: #ef6a5b;
  box-shadow: 0 0 0 2px rgba(239, 106, 91, .14);
}

.manager-name-input {
  margin-top: -4px;
}

.setup-error {
  min-height: 18px;
  margin: -6px 0 0;
  color: #ef6a5b;
  font-size: 12px;
  font-weight: 900;
}

.team-custom-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}

.random-btn {
  min-height: 46px;
  padding: 0 14px;
  color: #08140d;
  background: var(--gold);
  border: 0;
  cursor: pointer;
  font-weight: 1000;
}

.color-picker {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
}

.color-swatch {
  aspect-ratio: 1;
  min-height: 28px;
  background: var(--sw);
  border: 2px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.color-swatch.selected {
  border-color: var(--lime);
  box-shadow: 0 0 0 2px rgba(201, 230, 111, 0.24);
}

.setup-crest-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  color: var(--text);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-title {
  margin: 2px 0 0;
  color: var(--gold);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mode-btn {
  display: grid;
  min-height: 108px;
  gap: 6px;
  align-content: center;
  padding: 16px;
  color: var(--text);
  text-align: left;
  background: #10181c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

.mode-btn:hover,
.mode-btn:focus-visible {
  border-color: rgba(53, 196, 111, 0.8);
}

.mode-btn strong {
  color: var(--lime);
  font-size: 24px;
}

.mode-btn span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.mode-btn em {
  width: fit-content;
  margin-top: 6px;
  padding: 6px 10px;
  color: #08140d;
  background: var(--lime);
  font-style: normal;
  font-weight: 1000;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(430px, 0.9fr) minmax(480px, 1.1fr);
  gap: 14px;
  height: 100vh;
  padding: 14px;
  overflow: hidden;
}

.match-screen { display: none; }

.app-shell.view-match,
.app-shell.view-final {
  grid-template-columns: 1fr;
}

.app-shell.view-match .draft-panel,
.app-shell.view-match .pitch-panel,
.app-shell.view-final .draft-panel,
.app-shell.view-final .match-screen {
  display: none;
}

.app-shell.view-match .match-screen {
  display: grid;
}

.app-shell.view-final .pitch-panel {
  display: grid;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.app-shell.view-final .summary-panel {
  order: 1;
}

.app-shell.view-final .pitch {
  order: 2;
  min-height: 420px;
}

.match-screen {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.07);
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.match-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.match-feed {
  min-height: 0;
  overflow: hidden;
}

.match-feed .live-match {
  min-height: 100%;
}

.draft-panel,
.pitch-panel {
  min-width: 0;
  min-height: 0;
  padding: 18px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.draft-panel,
.pitch-panel,
.player-list,
.summary-panel {
  display: grid;
  gap: 12px;
}

.draft-panel { grid-template-rows: auto auto auto minmax(0, 1fr); overflow: hidden; }
.pitch-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.app-shell.view-build .pitch-panel {
  grid-template-rows: auto minmax(0, 1fr);
}

.app-shell.view-build .summary-panel {
  display: none;
}

.topbar,
.pitch-header,
.draw-surface,
.run-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--lime);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(30px, 4vw, 48px); line-height: 1; }
h2 { font-size: 24px; }

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: uppercase;
}

.brand-logo span { color: var(--text); }
.brand-logo strong { color: var(--lime); }
.brand-logo i {
  position: relative;
  width: 32px;
  height: 40px;
  background: var(--lime);
  clip-path: polygon(24% 0, 76% 0, 70% 58%, 58% 70%, 58% 84%, 78% 84%, 78% 100%, 22% 100%, 22% 84%, 42% 84%, 42% 70%, 30% 58%);
}

.brand-logo i::before,
.brand-logo i::after {
  position: absolute;
  top: 9px;
  width: 18px;
  height: 20px;
  content: "";
  border: 5px solid var(--lime);
  border-radius: 50%;
}

.brand-logo i::before { right: 21px; }
.brand-logo i::after { left: 21px; }
}

.run-meta span,
.league-pill,
.slot,
.stat,
.score-card,
.versus-card div {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel-2);
}

.run-meta span {
  min-width: 90px;
  padding: 9px 12px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.run-meta span:empty { display: none; }

.slot-row {
  display: grid;
  grid-template-columns: repeat(11, minmax(0, 1fr));
  gap: 6px;
}

.slot {
  min-height: 40px;
  padding: 7px 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.slot.filled {
  color: var(--text);
  border-color: rgba(53, 196, 111, 0.45);
}

.draw-surface {
  padding: 10px;
  background: linear-gradient(135deg, #11171a, #172024);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.draw-result { display: grid; gap: 8px; min-width: 0; }

.wheel-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 8px;
}

.wheel-box {
  display: grid;
  align-items: start;
  height: 58px;
  overflow: hidden;
  padding: 8px 10px;
  color: var(--text);
  font-size: clamp(15px, 1.7vw, 22px);
  line-height: 1;
  white-space: nowrap;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 36%, transparent 64%, rgba(0, 0, 0, 0.18)),
    #10181c;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.wheel-box span {
  display: block;
  max-width: 100%;
  height: 40px;
  overflow: hidden;
  margin: 0;
  font-weight: 900;
  line-height: 40px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-box.spinning span { animation: reelMove 0.42s linear infinite; }

.locked-choice { color: var(--lime); }

.wheel-box .locked-choice {
  height: auto;
  min-height: 40px;
  overflow: visible;
  line-height: 1.15;
  text-overflow: clip;
  white-space: normal;
}

.wheel-box:has(.locked-choice) {
  height: auto;
  min-height: 58px;
  overflow: visible;
  white-space: normal;
}

.flag-img {
  width: 24px;
  height: 17px;
  margin-right: 6px;
  object-fit: cover;
  vertical-align: middle;
}

@keyframes reelMove {
  from { transform: translateY(calc(var(--spin-offset, 120px) * -1)); }
  to { transform: translateY(calc((var(--spin-offset, 120px) + 240px) * -1)); }
}

.team-swatch {
  display: inline-block;
  width: 17px;
  height: 17px;
  margin-right: 6px;
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--c1) 0 50%, var(--c2) 50% 100%);
  vertical-align: -3px;
}

.team-crest {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  object-fit: contain;
  vertical-align: -5px;
}

.custom-team-badge {
  display: inline-block;
  position: relative;
  width: 42px;
  height: 46px;
  margin-right: 10px;
  background:
    linear-gradient(90deg, var(--tc1) 0 34%, var(--tc2) 34% 66%, var(--tc1) 66% 100%);
  border: 3px solid rgba(255, 255, 255, 0.82);
  border-radius: 14px 14px 18px 18px;
  clip-path: polygon(50% 0, 92% 16%, 86% 78%, 50% 100%, 14% 78%, 8% 16%);
  vertical-align: -9px;
}

.custom-team-badge span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 15px;
  height: 15px;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.86);
  border-radius: 50%;
}

.team-identity {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.75fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 30px;
  font-weight: 900;
  text-transform: uppercase;
}

.team-identity-main {
  display: flex;
  align-items: center;
  min-width: 0;
}

.team-identity strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.league-pill,
.source-link,
.position-tag {
  width: fit-content;
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
}

.league-pill { padding: 6px 9px; }
.source-link { color: var(--muted); text-decoration: none; }

.primary-btn,
.ghost-btn,
.pick-btn {
  border: 0;
  cursor: pointer;
  font-weight: 900;
}

.primary-btn {
  min-width: 112px;
  height: 58px;
  color: #08140d;
  background: var(--green);
}

.ghost-btn {
  padding: 10px 13px;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
}

.player-list {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  gap: 8px;
}

.player-group {
  display: grid;
  gap: 6px;
}

.player-group h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 9px 10px;
  color: var(--lime);
  background: #151a1d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  text-transform: uppercase;
}

.empty-state,
.final-card {
  display: grid;
  min-height: 140px;
  place-items: center;
  padding: 18px;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--line);
}

.player-card {
  display: grid;
  grid-template-columns: 46px 52px 1fr auto;
  gap: 9px;
  align-items: center;
  padding: 8px;
  background: #11181c;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
}

.avatar.fallback-avatar,
.token-avatar.fallback-avatar,
.summary-avatar.fallback-avatar {
  padding: 4px;
  object-fit: cover;
  background: #242b30;
}

.ovr-badge {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  color: #08140d;
  font-size: 23px;
  font-weight: 1000;
}

.ovr-green { background: #35c46f; }
.ovr-elite { background: #6ee7b7; }
.ovr-yellow { background: #d9b35d; }
.ovr-red { background: #ef6a5b; }

.player-main { min-width: 0; }
.player-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; margin-bottom: 6px; }
.player-line strong { font-size: 15px; }
.position-tag { color: var(--gold); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(42px, 1fr));
  gap: 4px;
}

.stat { padding: 5px; }
.stat span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; }
.stat strong { font-size: 13px; }

.pick-btn {
  align-self: stretch;
  min-width: 64px;
  color: #08140d;
  background: var(--lime);
}

.pitch {
  position: relative;
  height: 100%;
  min-height: 500px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.045) 50%, transparent 50%),
    repeating-linear-gradient(0deg, var(--pitch), var(--pitch) 82px, var(--pitch-dark) 82px, var(--pitch-dark) 164px);
  border: 2px solid rgba(255, 255, 255, 0.48);
}

.pitch::before,
.pitch::after { position: absolute; content: ""; pointer-events: none; }
.pitch::before { inset: 22px; border: 2px solid rgba(255, 255, 255, 0.42); }
.pitch::after { left: 50%; top: 50%; width: 150px; height: 150px; transform: translate(-50%, -50%); border: 2px solid rgba(255, 255, 255, 0.42); border-radius: 50%; }

.player-token {
  position: absolute;
  z-index: 2;
  width: min(27%, 160px);
  min-height: 92px;
  transform: translate(-50%, -50%);
  padding: 8px;
  text-align: center;
  background: rgba(12, 18, 16, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.player-token.empty { color: rgba(255, 255, 255, 0.58); border-style: dashed; }
.token-avatar {
  display: block;
  width: 34px;
  height: 34px;
  margin: 0;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 50%;
}

.token-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 2px;
}

.match-rating {
  display: grid;
  min-width: 34px;
  height: 28px;
  place-items: center;
  color: #08140d;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 20px;
  font-weight: 900;
}

.rating-elite { background: #0f7a3d; color: #f2f7f4; }
.rating-high { background: #35c46f; }
.rating-mid { background: #c9e66f; }
.rating-low { background: #d9b35d; }
.rating-bad { background: #ef6a5b; }
.rating-star {
  background: #7dd3fc;
  color: #06283a;
  box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.42);
}
.player-token strong { display: block; overflow: hidden; margin: 2px 0; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.player-token span { display: block; font-size: 11px; font-weight: 900; }
.player-token small { color: var(--muted); font-size: 10px; }

.versus-card,
.projection,
.final-grid {
  display: grid;
  gap: 8px;
}

.summary-panel {
  min-height: 0;
  overflow: auto;
}

.versus-card { grid-template-columns: 1fr 0.8fr 1fr; }
.projection { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.final-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.versus-card div,
.score-card,
.projection div {
  padding: 12px;
  text-align: center;
}

.score-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.winner-banner {
  padding: 16px;
  color: #08140d;
  background: linear-gradient(135deg, var(--lime), var(--green));
  font-size: clamp(26px, 4vw, 44px);
  font-weight: 1000;
  text-align: center;
}

.final-scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  background: #10181c;
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.final-scoreboard div {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(24px, 4vw, 48px);
  font-weight: 900;
  text-transform: uppercase;
}

.final-scoreboard strong {
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(54px, 8vw, 96px);
  line-height: 0.9;
}

.final-scoreboard small {
  grid-column: 1 / -1;
  color: var(--gold);
  font-weight: 900;
}

.facts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.facts-grid section {
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.facts-grid h3 {
  margin: 0 0 8px;
  color: var(--lime);
  font-size: 14px;
  text-transform: uppercase;
}

.facts-grid h4 {
  margin: 10px 0 6px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.facts-grid p {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 13px;
}

.facts-grid p span {
  grid-column: 2;
  color: var(--muted);
}

.lineup-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.lineup-tabs button {
  min-height: 48px;
  color: var(--text);
  background: #10181c;
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 24px;
  font-weight: 900;
  text-transform: uppercase;
}

.lineup-tabs button.active {
  color: #08140d;
  background: var(--lime);
}

.versus-card span,
.score-card span,
.projection span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.versus-card strong,
.score-card strong,
.projection strong {
  color: var(--lime);
  font-size: 28px;
  line-height: 1;
}

.summary-list { display: grid; gap: 6px; }
.summary-list p { display: grid; grid-template-columns: 30px 42px 1fr; gap: 8px; align-items: center; margin: 0; padding: 7px 9px; background: rgba(255, 255, 255, 0.045); }
.summary-avatar {
  width: 28px;
  height: 28px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}
.summary-list span { grid-column: 3; color: var(--muted); font-size: 12px; }
.final-grid h3 { margin: 6px 0 8px; font-size: 14px; }

.match-panel {
  display: grid;
  min-height: 52px;
}

.match-btn {
  width: 100%;
  min-height: 180px;
  border: 0;
  color: #08140d;
  background: var(--lime);
  cursor: pointer;
  font-size: clamp(58px, 7vw, 92px);
  font-weight: 1000;
}

.extra-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  color: #08140d;
  background: var(--gold);
  cursor: pointer;
  font-weight: 1000;
}

.match-btn-large {
  min-height: 260px;
}

.live-match,
.match-report {
  display: grid;
  gap: 14px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 30%),
    #10181c;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.live-match {
  grid-template-rows: auto auto auto minmax(0, 1fr);
  min-height: 100%;
}

.scoreboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.75fr) minmax(0, 1fr);
  min-height: 170px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(53, 196, 111, 0.14), transparent 34%),
    linear-gradient(225deg, rgba(217, 179, 93, 0.14), transparent 34%),
    #141b1f;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.score-team,
.score-core {
  display: grid;
  place-items: center;
  padding: 18px;
  text-align: center;
}

.score-team span {
  max-width: 100%;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(30px, 5vw, 64px);
  font-weight: 900;
  line-height: 0.95;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.score-core {
  background: rgba(0, 0, 0, 0.26);
  border-inline: 1px solid rgba(255, 255, 255, 0.12);
}

.score-label {
  color: var(--muted);
  font-size: 14px;
  font-weight: 900;
}

.score-numbers {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  color: var(--lime);
  font-size: clamp(58px, 9vw, 112px);
  font-weight: 900;
  line-height: 0.9;
}

.score-numbers small {
  color: var(--gold);
  font-size: 0.45em;
}

.score-extra {
  min-height: 24px;
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
}

.live-score {
  color: var(--lime);
  font-size: 22px;
  font-weight: 1000;
}

.live-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.live-actions:empty { display: none; }

.skip-match-btn {
  background: #1f2933;
  color: var(--text);
  border: 1px solid rgba(255,255,255,.18);
}
.pen-score { color: var(--gold); }

.current-call {
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  min-height: 82px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.075);
  border-left: 5px solid var(--green);
}

.current-call span {
  color: var(--gold);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 34px;
  font-weight: 900;
}

.current-call strong {
  color: var(--text);
  font-size: clamp(20px, 2.6vw, 34px);
}

.live-clock { display: none; }

.live-events {
  display: grid;
  max-height: none;
  gap: 7px;
  overflow: auto;
  align-content: start;
  padding-right: 4px;
}

.live-events p {
  display: grid;
  grid-template-columns: 48px 36px 1fr;
  gap: 9px;
  margin: 0;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 15px;
}

.live-events p b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 24px;
  font-size: 16px;
}

.live-events p.home { border-left: 3px solid var(--green); }
.live-events p.away { border-left: 3px solid var(--gold); }
.live-events p {
  color: var(--event-fg, var(--muted)) !important;
  background: var(--event-bg, rgba(255, 255, 255, 0.045)) !important;
  border-left: 0 !important;
}
.live-events p.neutral {
  color: var(--muted) !important;
  background: rgba(255,255,255,.055) !important;
}
.match-report > strong { font-size: 18px; }
.shootout-note { color: var(--gold); font-weight: 900; }

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  overflow: hidden;
  pointer-events: none;
}

.confetti-layer i {
  position: absolute;
  left: var(--x);
  top: -20px;
  width: 10px;
  height: 16px;
  background: var(--c);
  animation: confettiDrop 5s ease-in forwards;
  animation-delay: var(--d);
  transform: rotate(var(--r));
}

@keyframes confettiDrop {
  0% { transform: translateY(-30px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(var(--r)); opacity: 0; }
}

@media (max-width: 1040px) {
  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }
  .pitch-panel { grid-template-rows: auto 500px auto; }
}

@media (max-width: 680px) {
  .app-shell { padding: 10px; }
  .topbar,
  .pitch-header,
  .draw-surface { align-items: stretch; flex-direction: column; }
  .team-identity { grid-template-columns: 1fr; }
  .slot-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .player-card { grid-template-columns: 1fr; }
  .avatar { display: none; }
  .ovr-badge { width: 64px; height: 48px; }
  .wheel-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .versus-card,
  .projection,
  .final-grid { grid-template-columns: 1fr; }
  .mode-grid { grid-template-columns: 1fr; }
}

/* Requested match-flow and mobile corrections */
.password-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 9, 10, 0.94);
}

.password-overlay.hidden { display: none; }

.password-modal {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  padding: 24px;
  background: #151a1d;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.password-modal h2 { margin: 0; font-size: 32px; }
.password-error { min-height: 20px; margin: 0; color: #ef6a5b; font-weight: 900; }

body { overflow-x: hidden; }

.app-shell,
.match-screen,
.match-feed,
.summary-panel,
.player-list {
  scrollbar-width: thin;
}

.app-shell {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

.match-screen {
  min-height: calc(100vh - 28px);
  overflow: visible;
}

.match-feed {
  overflow: visible;
}

.match-feed .live-match,
.live-match {
  min-height: auto;
}

.app-shell.view-final .pitch-panel {
  grid-template-rows: auto auto auto auto;
}

.app-shell.view-final .summary-panel { order: 1; }
.app-shell.view-final .lineup-tabs-mount { order: 2; }
.app-shell.view-final .pitch { order: 3; }

.lineup-tabs-mount:empty { display: none; }

.shootout-live:empty { display: none; }

.shootout-board {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.shootout-board h3 {
  margin: 0;
  color: var(--gold);
  font-size: 14px;
  text-transform: uppercase;
}

.pen-head,
.pen-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.pen-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.pen-row b {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.pen-row div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pen-cell {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-weight: 1000;
}

.pen-cell.scored { color: #08140d; background: var(--lime); }
.pen-cell.missed { color: #f2f7f4; background: #7a263a; }
.pen-cell.pending { color: var(--muted); background: #10181c; }

.shootout-board > strong {
  justify-self: end;
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 34px;
}

.shootout-board.compact { margin-bottom: 10px; }

@media (max-width: 680px) {
  .app-shell { padding: 8px; gap: 10px; }
  .draft-panel,
  .pitch-panel,
  .match-screen { padding: 10px; }
  .pitch-panel { grid-template-rows: auto auto minmax(560px, auto) auto; }
  .app-shell.view-final .pitch { min-height: 560px; }
  .player-token {
    width: 31%;
    min-height: 82px;
    padding: 6px;
  }
  .player-token strong { font-size: 11px; }
  .player-token small { font-size: 9px; }
  .scoreboard {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .score-core { border-inline: 0; border-block: 1px solid rgba(255,255,255,0.12); }
  .score-team span { white-space: normal; }
  .final-scoreboard {
    grid-template-columns: 1fr;
  }
  .facts-grid { grid-template-columns: 1fr; }
  .pen-head,
  .pen-row {
    grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1fr);
  }
  .pen-cell {
    width: 26px;
    height: 26px;
  }
}

/* Round crests, CL-style cup mark, fixed build pitch, result actions */
.custom-team-badge {
  width: 44px;
  height: 44px;
  margin-right: 10px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,0.18) 0 18%, transparent 19%),
    linear-gradient(135deg, var(--tc1) 0 50%, var(--tc2) 50% 100%);
  border: 0;
  border-radius: 50%;
  clip-path: none;
  box-shadow: inset 0 0 0 2px rgba(0,0,0,0.28), 0 0 0 1px rgba(255,255,255,0.12);
}

.custom-team-badge span { display: none; }

.psg-badge {
  width: 46px;
  height: 46px;
  margin-right: 10px;
  object-fit: contain;
  vertical-align: -12px;
}

.team-crest {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.brand-logo i {
  width: 34px;
  height: 42px;
  background: none;
  clip-path: none;
  border: 4px solid var(--lime);
  border-top-width: 6px;
  border-radius: 0 0 13px 13px;
}

.brand-logo i::before,
.brand-logo i::after {
  top: 8px;
  width: 17px;
  height: 18px;
  background: transparent;
  border: 4px solid var(--lime);
  border-radius: 50%;
}

.brand-logo i::before { right: 24px; }
.brand-logo i::after { left: 24px; }

.brand-logo i { box-shadow: inset 0 -8px 0 -4px var(--lime); }

.lineup-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.lineup-tabs button .custom-team-badge,
.lineup-tabs button .psg-badge {
  width: 30px;
  height: 30px;
  margin-right: 0;
  vertical-align: middle;
}

.lineup-tabs button span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.final-scoreboard .psg-badge,
.scoreboard .psg-badge,
.scoreboard .custom-team-badge {
  width: clamp(42px, 5vw, 68px);
  height: clamp(42px, 5vw, 68px);
  margin: 0 0 10px;
}

.ratings-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ratings-card h3 {
  margin: 0;
  color: var(--lime);
  font-size: 16px;
  text-transform: uppercase;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.result-actions .primary-btn,
.result-actions .ghost-btn {
  width: 100%;
  min-height: 52px;
}

@media (min-width: 1041px) {
  .app-shell.view-build {
    height: 100vh;
    min-height: 100vh;
    overflow: hidden;
  }

  .app-shell.view-build .draft-panel {
    height: calc(100vh - 28px);
    overflow: auto;
    grid-template-rows: auto auto auto auto;
  }

  .app-shell.view-build .player-list {
    min-height: auto;
    overflow: visible;
  }

  .app-shell.view-build .pitch-panel {
    position: sticky;
    top: 14px;
    height: calc(100vh - 28px);
    overflow: hidden;
  }
}

@media (max-width: 680px) {
  .custom-team-badge,
  .psg-badge {
    width: 34px;
    height: 34px;
  }

  .result-actions {
    grid-template-columns: 1fr;
  }

  .summary-list p {
    grid-template-columns: 28px 34px 1fr;
    font-size: 13px;
  }
}

/* Result screen cleanup: no separate player-rating list; share buttons stay compact. */
.result-actions-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.result-actions-card .result-actions {
  margin-top: 0;
}


/* custom tweaks */
.share-btn,.share-button,#shareBtn{display:none !important;}

.pitch-player,.player-rating-card,.formation-player{
transform:scale(0.88);
transform-origin:center;
}

.new-game-btn,#newGameBtn,#matchResetBtn{
background:linear-gradient(135deg,#9dfc22,#35c46f)!important;
color:#08140d!important;
border:none!important;
font-weight:900!important;
box-shadow:0 0 18px rgba(157,252,34,.35);
}

.brand-logo{
background:url('./logo.png') no-repeat left center;
background-size:contain;
padding-left:110px;
min-height:60px;
}
.brand-logo span,.brand-logo strong,.brand-logo i{display:none!important;}


.brand-logo {
  width: clamp(150px, 20vw, 250px) !important;
  min-height: 78px !important;
  padding: 0 !important;
  background: url("./assets/logo.png") no-repeat left center !important;
  background-size: contain !important;
  filter: drop-shadow(0 0 10px rgba(157, 252, 34, 0.22));
}

.brand-logo span,
.brand-logo strong,
.brand-logo i {
  display: none !important;
}

.player-token {
  width: min(22%, 126px) !important;
  min-height: 72px !important;
  padding: 6px !important;
  border-radius: 10px;
}

.token-avatar {
  width: 28px !important;
  height: 28px !important;
}

.token-head {
  gap: 4px !important;
  margin-bottom: 1px !important;
}

.match-rating {
  min-width: 28px !important;
  height: 23px !important;
  font-size: 16px !important;
  border-radius: 5px;
}

.player-token strong {
  margin: 1px 0 !important;
  font-size: 10.5px !important;
  line-height: 1.05 !important;
}

.player-token span {
  font-size: 10px !important;
  line-height: 1.05 !important;
}

.player-token small {
  font-size: 8.5px !important;
  line-height: 1.05 !important;
}

.result-actions.single-action {
  grid-template-columns: minmax(220px, 420px) !important;
  justify-content: center;
}

.new-game-action,
#finalNewGameBtn,
#matchResetBtn {
  min-height: 58px !important;
  color: #071209 !important;
  background: linear-gradient(135deg, #caff26 0%, #8cff00 46%, #35c46f 100%) !important;
  border: 0 !important;
  border-radius: 14px !important;
  font-size: clamp(24px, 4vw, 38px) !important;
  font-weight: 1000 !important;
  letter-spacing: 0.03em !important;
  text-transform: uppercase;
  box-shadow: 0 0 0 1px rgba(255,255,255,.18) inset, 0 14px 34px rgba(140, 255, 0, .22) !important;
}

@media (max-width: 700px) {
  .brand-logo {
    width: 155px !important;
    min-height: 58px !important;
  }

  .player-token {
    width: min(21%, 92px) !important;
    min-height: 58px !important;
    padding: 4px !important;
    border-radius: 8px;
  }

  .token-avatar {
    width: 22px !important;
    height: 22px !important;
  }

  .match-rating {
    min-width: 23px !important;
    height: 20px !important;
    font-size: 13px !important;
  }

  .player-token strong {
    font-size: 8.5px !important;
  }

  .player-token span {
    font-size: 8.5px !important;
  }

  .player-token small {
    display: none !important;
  }
}


/* Stadium + mockup-style final report refresh */
:root {
  --stadium-bg: url("./assets/stadium-bg.svg");
}

html,
body {
  min-height: 100%;
}

body {
  background:
    linear-gradient(180deg, rgba(2, 5, 7, .36), rgba(2, 5, 7, .88)),
    var(--stadium-bg) center / cover fixed no-repeat,
    #030708 !important;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 25%, rgba(140, 255, 0, .09), transparent 31%),
    radial-gradient(circle at 12% 36%, rgba(210, 240, 255, .11), transparent 18%),
    radial-gradient(circle at 88% 36%, rgba(210, 240, 255, .10), transparent 18%),
    linear-gradient(180deg, rgba(0,0,0,.05), rgba(0,0,0,.58));
}

.draft-panel,
.pitch-panel,
.match-screen,
.setup-modal,
.password-modal {
  background: rgba(6, 12, 14, .80) !important;
  border: 1px solid rgba(201, 230, 111, .16) !important;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .36);
  backdrop-filter: blur(8px);
}

.brand-logo {
  background-image: url("./assets/logo-transparent.png") !important;
}

.app-shell.view-final {
  height: auto !important;
  min-height: 100vh;
  overflow-y: auto !important;
  padding: clamp(10px, 2.4vw, 24px);
}

.app-shell.view-final .pitch-panel {
  width: min(1060px, 100%) !important;
  min-height: auto !important;
  padding: 0 clamp(8px, 1.8vw, 18px) clamp(16px, 3vw, 28px) !important;
  gap: 0 !important;
  overflow: visible !important;
  background:
    linear-gradient(180deg, rgba(4, 12, 16, .80), rgba(3, 8, 10, .90)),
    rgba(4, 8, 10, .74) !important;
  border-radius: 22px;
}

.app-shell.view-final .pitch-header,
.app-shell.view-final .lineup-tabs-mount {
  display: none !important;
}

.app-shell.view-final .summary-panel {
  display: contents !important;
}

.mockup-scoreboard {
  order: 1;
  position: relative;
  display: grid;
  gap: 10px;
  padding: clamp(18px, 3.3vw, 34px) clamp(12px, 3vw, 30px) clamp(12px, 2.5vw, 26px);
  min-height: 375px;
  overflow: hidden;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .08), rgba(0, 0, 0, .30)),
    radial-gradient(circle at 50% 5%, rgba(255, 255, 255, .08), transparent 20%);
  border-bottom: 1px solid rgba(255,255,255,.09);
}

.mockup-scoreboard::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(3, 8, 10, .04), rgba(3, 8, 10, .50)),
    var(--stadium-bg) center top / cover no-repeat;
  opacity: .82;
}

.mockup-scoreboard > * {
  position: relative;
  z-index: 1;
}

.mockup-logo-top {
  position: absolute;
  left: clamp(14px, 3vw, 34px);
  top: clamp(14px, 2vw, 22px);
  width: clamp(128px, 17vw, 210px);
  height: auto;
  filter: drop-shadow(0 0 14px rgba(140, 255, 0, .26));
}

.mockup-trophy {
  width: clamp(56px, 9vw, 92px);
  justify-self: center;
  margin-top: -4px;
  filter: drop-shadow(0 10px 18px rgba(255,255,255,.14));
}

.mockup-kicker {
  margin: 12px 0 0;
  color: #adff2d;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 900;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.mockup-score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(10px, 3vw, 38px);
  margin-top: 2px;
}

.mockup-team {
  display: grid;
  place-items: center;
  gap: 8px;
  min-width: 0;
}

.mockup-team-logo {
  display: grid;
  place-items: center;
  width: clamp(84px, 13vw, 142px);
  height: clamp(84px, 13vw, 142px);
  border-radius: 999px;
  background: radial-gradient(circle, rgba(5, 8, 7, .92), rgba(5, 8, 7, .62));
  border: 1px solid rgba(173, 255, 45, .30);
  box-shadow: inset 0 0 24px rgba(140,255,0,.08), 0 0 24px rgba(0,0,0,.30);
  overflow: hidden;
}

.mockup-team-logo .custom-team-badge {
  width: 78% !important;
  height: 78% !important;
  border-radius: 999px !important;
}

.mockup-team-logo .psg-badge {
  width: 88% !important;
  height: 88% !important;
  object-fit: contain;
}

.mockup-team strong {
  max-width: 100%;
  color: #fff;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(21px, 3vw, 34px);
  font-weight: 900;
  line-height: .95;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 16px rgba(0,0,0,.8);
}

.mockup-score-main b {
  display: block;
  color: #fff;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(66px, 12vw, 128px);
  line-height: .82;
  letter-spacing: .02em;
  text-shadow: 0 8px 30px rgba(0,0,0,.75);
}

.mockup-pen-score {
  margin-top: 10px;
  color: #adff2d;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(23px, 3.5vw, 38px);
  font-weight: 900;
  line-height: 1;
}

.mockup-goals {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: clamp(10px, 3vw, 32px);
  align-items: start;
  width: min(650px, 92%);
  margin: 4px auto 0;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}

.mockup-goals > div {
  display: grid;
  gap: 3px;
}

.mockup-goals p {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 0;
  color: #f3f8f4;
  font-size: clamp(13px, 1.8vw, 18px);
  font-weight: 800;
}

.mockup-goals b {
  color: #fff;
}

.mockup-goals i {
  color: #fff;
  font-size: clamp(24px, 3vw, 32px);
  font-style: normal;
  line-height: 1.1;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.65));
}

.mockup-goals .empty-goal {
  color: rgba(242,247,244,.55);
}

.app-shell.view-final .shootout-board.compact {
  order: 2;
  width: min(560px, 94%);
  justify-self: center;
  margin: -6px 0 16px;
  padding: 10px 14px;
  background: rgba(5, 10, 12, .56);
  border: 1px solid rgba(173, 255, 45, .18);
  border-radius: 16px;
}

.app-shell.view-final .pitch {
  order: 3 !important;
  width: min(990px, 100%);
  min-height: clamp(500px, 68vw, 740px) !important;
  justify-self: center;
  margin-top: 6px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(5, 20, 10, .04), rgba(2, 7, 4, .26)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 12.5%, rgba(0,0,0,.055) 12.5% 25%),
    linear-gradient(180deg, #135d2b, #0b3c21) !important;
  box-shadow:
    0 20px 44px rgba(0,0,0,.42),
    inset 0 0 0 2px rgba(173,255,45,.16),
    inset 0 0 60px rgba(0,0,0,.32);
}

.app-shell.view-final .pitch::after {
  opacity: .62;
}

.app-shell.view-final .player-token {
  width: min(18.8%, 112px) !important;
  min-height: 62px !important;
  padding: 5px 6px !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(10, 17, 18, .92), rgba(4, 9, 9, .90)) !important;
  border: 1px solid rgba(221,255,200,.22) !important;
  box-shadow: 0 9px 18px rgba(0,0,0,.32);
}

.app-shell.view-final .token-avatar {
  width: 26px !important;
  height: 26px !important;
}

.app-shell.view-final .match-rating {
  min-width: 26px !important;
  height: 22px !important;
  font-size: 15px !important;
  color: #adff2d !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

.app-shell.view-final .player-token span {
  color: #d7ff37;
  font-size: 10px !important;
  font-weight: 900;
}

.app-shell.view-final .player-token strong {
  color: #fff;
  font-size: 10px !important;
  line-height: 1.02 !important;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-shell.view-final .player-token small {
  display: none !important;
}

.app-shell.view-final .result-actions-card {
  order: 4 !important;
  width: min(420px, 88%);
  justify-self: center;
  margin: 24px 0 4px;
  padding: 0 !important;
  background: transparent !important;
  border: 0 !important;
}

.app-shell.view-final .result-actions.single-action {
  display: grid;
  grid-template-columns: 1fr !important;
}

.app-shell.view-final .new-game-action {
  min-height: 70px !important;
  border-radius: 18px !important;
  font-size: clamp(28px, 5vw, 44px) !important;
  box-shadow:
    0 0 0 1px rgba(255,255,255,.22) inset,
    0 16px 40px rgba(140, 255, 0, .24),
    0 0 32px rgba(140, 255, 0, .16) !important;
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll !important;
  }

  .app-shell.view-final {
    padding: 8px;
  }

  .app-shell.view-final .pitch-panel {
    border-radius: 16px;
  }

  .mockup-scoreboard {
    min-height: 310px;
    padding-top: 16px;
  }

  .mockup-logo-top {
    width: 118px;
    top: 12px;
    left: 12px;
  }

  .mockup-trophy {
    width: 50px;
    margin-top: 0;
  }

  .mockup-score-row {
    grid-template-columns: .88fr auto .88fr;
    gap: 8px;
  }

  .mockup-team-logo {
    width: 72px;
    height: 72px;
  }

  .mockup-score-main b {
    font-size: clamp(54px, 18vw, 78px);
  }

  .mockup-goals {
    width: 100%;
    gap: 8px;
  }

  .mockup-goals p {
    font-size: 12px;
    gap: 5px;
  }

  .app-shell.view-final .pitch {
    min-height: 520px !important;
  }

  .app-shell.view-final .player-token {
    width: min(19%, 74px) !important;
    min-height: 52px !important;
    padding: 4px !important;
  }

  .app-shell.view-final .token-avatar {
    width: 20px !important;
    height: 20px !important;
  }

  .app-shell.view-final .match-rating {
    min-width: 20px !important;
    height: 18px !important;
    font-size: 12px !important;
  }

  .app-shell.view-final .player-token span,
  .app-shell.view-final .player-token strong {
    font-size: 8px !important;
  }

  .app-shell.view-final .new-game-action {
    min-height: 60px !important;
  }
}

@media (max-width: 440px) {
  .mockup-logo-top {
    width: 100px;
  }

  .mockup-kicker {
    margin-top: 4px;
  }

  .mockup-team strong {
    font-size: 17px;
  }

  .mockup-team-logo {
    width: 62px;
    height: 62px;
  }

  .app-shell.view-final .pitch {
    min-height: 475px !important;
  }

  .app-shell.view-final .player-token {
    width: min(19%, 66px) !important;
  }
}

/* User stadium background + final report readability pass */
:root {
  --stadium-bg: url("./assets/stadium-real-dark.jpg") !important;
}

body {
  background:
    linear-gradient(180deg, rgba(1, 5, 9, .58), rgba(1, 5, 9, .88)),
    var(--stadium-bg) center center / cover fixed no-repeat,
    #020608 !important;
}

body::before {
  background:
    radial-gradient(circle at 50% 32%, rgba(140, 255, 0, .045), transparent 34%),
    linear-gradient(90deg, rgba(0,0,0,.40), rgba(0,0,0,.10) 38%, rgba(0,0,0,.10) 62%, rgba(0,0,0,.42)),
    linear-gradient(180deg, rgba(0,0,0,.20), rgba(0,0,0,.72)) !important;
}

.mockup-scoreboard::before {
  background:
    linear-gradient(180deg, rgba(2, 8, 13, .22), rgba(2, 8, 13, .62)),
    var(--stadium-bg) center 42% / cover no-repeat !important;
  opacity: .96 !important;
}

.draft-panel,
.pitch-panel,
.match-screen,
.setup-modal,
.password-modal {
  background: rgba(3, 9, 13, .78) !important;
  backdrop-filter: blur(7px);
}

/* Align logos inside circular badges */
.mockup-team-logo {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
  aspect-ratio: 1 / 1;
}

.mockup-team-logo .custom-team-badge,
.mockup-team-logo .psg-badge {
  display: block !important;
  width: 86% !important;
  height: 86% !important;
  margin: 0 !important;
  border-radius: 999px !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}

.mockup-team-logo .custom-team-badge span {
  inset: 16% !important;
}

/* Larger, readable final pitch cards without overlap */
.app-shell.view-final .pitch {
  min-height: clamp(560px, 70vw, 780px) !important;
  width: min(1040px, 100%) !important;
}

.app-shell.view-final .player-token {
  width: min(18.4%, 132px) !important;
  min-height: 76px !important;
  padding: 7px 8px !important;
  border-radius: 14px !important;
  gap: 2px !important;
}

.app-shell.view-final .token-head {
  gap: 7px !important;
  justify-content: center !important;
}

.app-shell.view-final .token-avatar {
  width: 38px !important;
  height: 38px !important;
  border-radius: 999px !important;
  object-fit: cover !important;
  object-position: top center !important;
}

.app-shell.view-final .match-rating {
  min-width: 34px !important;
  height: 28px !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: #adff2d !important;
}

.app-shell.view-final .player-token span {
  font-size: 12px !important;
  line-height: 1 !important;
}

.app-shell.view-final .player-token strong {
  font-size: 12px !important;
  line-height: 1.05 !important;
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(1, 5, 9, .64), rgba(1, 5, 9, .90)),
      var(--stadium-bg) center center / cover scroll no-repeat,
      #020608 !important;
  }

  .app-shell.view-final .pitch {
    min-height: 540px !important;
  }

  .app-shell.view-final .player-token {
    width: min(20%, 88px) !important;
    min-height: 62px !important;
    padding: 5px !important;
  }

  .app-shell.view-final .token-avatar {
    width: 28px !important;
    height: 28px !important;
  }

  .app-shell.view-final .match-rating {
    min-width: 27px !important;
    height: 22px !important;
    font-size: 16px !important;
  }

  .app-shell.view-final .player-token span,
  .app-shell.view-final .player-token strong {
    font-size: 9px !important;
  }

  .mockup-team-logo .custom-team-badge,
  .mockup-team-logo .psg-badge {
    width: 88% !important;
    height: 88% !important;
  }
}

@media (max-width: 440px) {
  .app-shell.view-final .pitch {
    min-height: 500px !important;
  }

  .app-shell.view-final .player-token {
    width: min(20.5%, 76px) !important;
    min-height: 58px !important;
  }

  .app-shell.view-final .token-avatar {
    width: 25px !important;
    height: 25px !important;
  }

  .app-shell.view-final .match-rating {
    min-width: 24px !important;
    height: 20px !important;
    font-size: 14px !important;
  }
}


/* Final requested polish: remove top trophy, restore colored ratings, larger readable cards, PWA-safe layout */
.mockup-trophy { display: none !important; }
.mockup-scoreboard { padding-top: clamp(64px, 8vw, 92px) !important; }
.mockup-kicker { margin-top: 0 !important; }

.app-shell.view-final .pitch {
  min-height: clamp(610px, 73vw, 830px) !important;
  width: min(1080px, 100%) !important;
}

.app-shell.view-final .player-token {
  width: min(19.2%, 148px) !important;
  min-height: 90px !important;
  padding: 9px 9px 8px !important;
  border-radius: 15px !important;
  background: linear-gradient(180deg, rgba(12, 20, 20, .94), rgba(3, 8, 8, .94)) !important;
  border: 1px solid rgba(220,255,190,.26) !important;
  box-shadow: 0 12px 24px rgba(0,0,0,.38), inset 0 0 18px rgba(140,255,0,.045) !important;
}

.app-shell.view-final .token-head { gap: 8px !important; }
.app-shell.view-final .token-avatar {
  width: 46px !important;
  height: 46px !important;
  border-radius: 999px !important;
  background: #0a1110 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
}

.app-shell.view-final .match-rating {
  min-width: 42px !important;
  height: 32px !important;
  padding: 0 7px !important;
  border-radius: 9px !important;
  display: inline-grid !important;
  place-items: center !important;
  font-size: 22px !important;
  font-weight: 1000 !important;
  line-height: 1 !important;
  border: 1px solid rgba(255,255,255,.18) !important;
  box-shadow: 0 5px 12px rgba(0,0,0,.28) !important;
}

.app-shell.view-final .match-rating.rating-elite { background: #0f7a3d !important; color: #fff !important; }
.app-shell.view-final .match-rating.rating-high { background: #35c46f !important; color: #06130b !important; }
.app-shell.view-final .match-rating.rating-mid { background: #c9e66f !important; color: #101807 !important; }
.app-shell.view-final .match-rating.rating-low { background: #d9b35d !important; color: #171007 !important; }
.app-shell.view-final .match-rating.rating-bad { background: #ef6a5b !important; color: #180504 !important; }
.app-shell.view-final .match-rating.rating-star {
  outline: 2px solid #fff04f !important;
  box-shadow: 0 0 0 4px rgba(255,240,79,.14), 0 0 22px rgba(255,240,79,.32) !important;
}

.app-shell.view-final .player-token span {
  font-size: 13px !important;
  margin-top: 2px !important;
}
.app-shell.view-final .player-token strong {
  font-size: 13px !important;
  line-height: 1.08 !important;
}

.motm-card {
  order: 4 !important;
  width: min(520px, 92%);
  justify-self: center;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  padding: 12px 14px;
  color: var(--text);
  background: linear-gradient(180deg, rgba(9, 19, 17, .90), rgba(3, 9, 8, .88));
  border: 1px solid rgba(201, 230, 111, .30);
  border-radius: 18px;
  box-shadow: 0 16px 34px rgba(0,0,0,.34), inset 0 0 24px rgba(140,255,0,.05);
}
.motm-card > span {
  color: #d7ff37;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 22px;
  font-weight: 900;
  text-transform: uppercase;
  white-space: nowrap;
}
.motm-avatar {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
  object-position: top center;
  border: 1px solid rgba(255,255,255,.22);
  background: #07100d;
}
.motm-card strong {
  display: block;
  font-size: 17px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.motm-card small {
  display: block;
  color: rgba(242,247,244,.72);
  font-size: 12px;
  font-weight: 800;
}
.app-shell.view-final .result-actions-card { order: 5 !important; }

@media (max-width: 760px) {
  .mockup-scoreboard { padding-top: 54px !important; }
  .app-shell.view-final .pitch { min-height: 585px !important; }
  .app-shell.view-final .player-token {
    width: min(20.2%, 96px) !important;
    min-height: 72px !important;
    padding: 6px !important;
  }
  .app-shell.view-final .token-avatar { width: 34px !important; height: 34px !important; }
  .app-shell.view-final .match-rating {
    min-width: 32px !important;
    height: 25px !important;
    font-size: 17px !important;
  }
  .app-shell.view-final .player-token span,
  .app-shell.view-final .player-token strong { font-size: 10px !important; }
  .motm-card {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 9px;
    padding: 10px;
  }
  .motm-card > span { grid-column: 1 / -1; text-align: center; font-size: 19px; }
  .motm-avatar { width: 42px; height: 42px; }
}

@media (max-width: 440px) {
  .app-shell.view-final .pitch { min-height: 540px !important; }
  .app-shell.view-final .player-token {
    width: min(20.8%, 82px) !important;
    min-height: 66px !important;
  }
  .app-shell.view-final .token-avatar { width: 30px !important; height: 30px !important; }
  .app-shell.view-final .match-rating {
    min-width: 28px !important;
    height: 22px !important;
    font-size: 15px !important;
  }
}


/* Requested update: selectable position boxes, cleaner goal rows, blue MOTM, larger readable report cards */
.slot-row {
  grid-template-columns: repeat(11, minmax(72px, 1fr)) !important;
  gap: 8px !important;
  overflow-x: auto;
  padding-bottom: 4px;
}
.slot {
  min-height: 78px !important;
  display: grid !important;
  grid-template-rows: auto 1fr auto;
  justify-items: center !important;
  align-items: center !important;
  gap: 2px !important;
  padding: 7px 5px !important;
  color: rgba(242,247,244,.62) !important;
  background: linear-gradient(180deg, rgba(32,38,42,.92), rgba(15,19,21,.92)) !important;
  border: 1px solid rgba(255,255,255,.13) !important;
  border-radius: 13px !important;
  font-size: 15px !important;
  line-height: 1 !important;
}
.slot.empty { filter: grayscale(.7); opacity: .72; }
.slot.filled {
  color: var(--text) !important;
  background: linear-gradient(180deg, rgba(20,54,31,.96), rgba(8,26,15,.96)) !important;
  border-color: rgba(142,255,0,.78) !important;
  box-shadow: 0 0 0 1px rgba(142,255,0,.15), 0 0 18px rgba(142,255,0,.16) !important;
}
.slot-pos {
  color: inherit;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 18px;
  font-weight: 900;
}
.slot-avatar {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  object-fit: cover;
  object-position: top center;
  background: #07100d;
  border: 1px solid rgba(255,255,255,.22);
}
.slot strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-weight: 900;
}
.slot small {
  color: #baff26;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 19px;
  font-weight: 900;
}
.slot.empty strong {
  color: rgba(242,247,244,.55);
  font-size: 20px;
}

.mockup-goals { grid-template-columns: 1fr 1fr !important; gap: clamp(18px, 5vw, 78px) !important; }
.mockup-goals > div:first-child { text-align: right; }
.mockup-goals > div:last-child { text-align: left; }
.mockup-goals p {
  display: flex !important;
  align-items: baseline !important;
  gap: 8px !important;
  justify-content: inherit !important;
  min-height: 24px !important;
}
.mockup-goals p > i {
  display: inline-block !important;
  width: 18px !important;
  font-style: normal !important;
  font-size: 15px !important;
  color: #d7ff37 !important;
}
.mockup-goals p span { display: inline-flex !important; flex-direction: column !important; gap: 1px !important; }
.mockup-goals p em {
  display: block;
  color: rgba(242,247,244,.62);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.05;
}
.mockup-goals > i, .mockup-goals .empty-goal { display: none !important; }

.app-shell.view-final .player-token {
  width: min(21.2%, 170px) !important;
  min-height: 104px !important;
  padding: 11px 11px 10px !important;
}
.app-shell.view-final .token-avatar {
  width: 54px !important;
  height: 54px !important;
}
.app-shell.view-final .match-rating {
  min-width: 48px !important;
  height: 36px !important;
  font-size: 24px !important;
}
.app-shell.view-final .player-token span { font-size: 15px !important; }
.app-shell.view-final .player-token strong { font-size: 15px !important; }
.app-shell.view-final .player-token small { font-size: 11px !important; }
.app-shell.view-final .match-rating.rating-star {
  background: #38cfff !important;
  color: #041018 !important;
  outline: 2px solid #b8f3ff !important;
  box-shadow: 0 0 0 4px rgba(56,207,255,.16), 0 0 26px rgba(56,207,255,.44) !important;
}
.motm-card {
  border-color: rgba(56,207,255,.55) !important;
  box-shadow: 0 16px 34px rgba(0,0,0,.34), inset 0 0 28px rgba(56,207,255,.08) !important;
}
.motm-card > span { color: #38cfff !important; }

@media (max-width: 760px) {
  .slot-row { grid-template-columns: repeat(11, minmax(66px, 1fr)) !important; }
  .slot { min-height: 72px !important; }
  .slot-pos { font-size: 16px; }
  .slot-avatar { width: 30px; height: 30px; }
  .slot small { font-size: 17px; }
  .app-shell.view-final .player-token {
    width: min(22%, 110px) !important;
    min-height: 86px !important;
    padding: 7px !important;
  }
  .app-shell.view-final .token-avatar { width: 40px !important; height: 40px !important; }
  .app-shell.view-final .match-rating { min-width: 36px !important; height: 28px !important; font-size: 18px !important; }
  .app-shell.view-final .player-token span,
  .app-shell.view-final .player-token strong { font-size: 11px !important; }
}

@media (max-width: 440px) {
  .slot-row { grid-template-columns: repeat(11, minmax(62px, 1fr)) !important; }
  .app-shell.view-final .player-token {
    width: min(22.8%, 92px) !important;
    min-height: 78px !important;
  }
  .app-shell.view-final .token-avatar { width: 34px !important; height: 34px !important; }
  .app-shell.view-final .match-rating { min-width: 31px !important; height: 24px !important; font-size: 16px !important; }
}

/* Bigger selection slots and formation cards - user request */
.slot-row {
  grid-template-columns: repeat(11, minmax(92px, 1fr)) !important;
  gap: 10px !important;
  padding: 2px 0 8px !important;
}
.slot {
  min-height: 104px !important;
  padding: 8px 6px !important;
  border-radius: 16px !important;
}
.slot-pos {
  font-size: 21px !important;
  line-height: .95 !important;
}
.slot-avatar {
  width: 58px !important;
  height: 58px !important;
  object-fit: cover !important;
  object-position: top center !important;
  border-width: 2px !important;
  box-shadow: 0 6px 14px rgba(0,0,0,.35) !important;
}
.slot strong {
  font-size: 12.5px !important;
  line-height: 1.05 !important;
}
.slot small {
  font-size: 22px !important;
  line-height: .9 !important;
}
.slot.empty strong {
  font-size: 23px !important;
}

/* Right-side build formation: larger and more readable */
.app-shell.view-build .pitch {
  min-height: 560px !important;
}
.app-shell.view-build .player-token {
  width: min(25%, 178px) !important;
  min-height: 112px !important;
  padding: 11px 10px !important;
  border-radius: 16px !important;
  background: linear-gradient(180deg, rgba(13,22,18,.94), rgba(7,13,11,.94)) !important;
  border-color: rgba(186,255,38,.30) !important;
  box-shadow: 0 12px 22px rgba(0,0,0,.34), inset 0 0 20px rgba(142,255,0,.045) !important;
}
.app-shell.view-build .token-avatar {
  width: 64px !important;
  height: 64px !important;
  object-fit: cover !important;
  object-position: top center !important;
  border-radius: 50% !important;
  border: 2px solid rgba(255,255,255,.22) !important;
  background: #07100d !important;
}
.app-shell.view-build .player-token span {
  font-size: 17px !important;
  color: #d7ff37 !important;
  line-height: 1 !important;
}
.app-shell.view-build .player-token strong {
  font-size: 15px !important;
  line-height: 1.05 !important;
  margin-top: 4px !important;
}
.app-shell.view-build .player-token small {
  font-size: 11px !important;
  line-height: 1.05 !important;
}

/* Keep final/report cards readable too */
.app-shell.view-final .player-token {
  width: min(22.8%, 186px) !important;
  min-height: 116px !important;
  padding: 12px 11px !important;
  border-radius: 16px !important;
}
.app-shell.view-final .token-avatar {
  width: 62px !important;
  height: 62px !important;
  object-fit: cover !important;
  object-position: top center !important;
}
.app-shell.view-final .player-token span {
  font-size: 16px !important;
}
.app-shell.view-final .player-token strong {
  font-size: 15px !important;
}
.app-shell.view-final .match-rating {
  min-width: 50px !important;
  height: 38px !important;
  font-size: 25px !important;
}

@media (max-width: 900px) {
  .slot-row { grid-template-columns: repeat(11, minmax(86px, 1fr)) !important; }
  .slot { min-height: 96px !important; }
  .slot-avatar { width: 52px !important; height: 52px !important; }
  .app-shell.view-build .pitch { min-height: 520px !important; }
  .app-shell.view-build .player-token {
    width: min(24%, 148px) !important;
    min-height: 100px !important;
  }
  .app-shell.view-build .token-avatar { width: 54px !important; height: 54px !important; }
}

@media (max-width: 520px) {
  .slot-row { grid-template-columns: repeat(11, minmax(82px, 1fr)) !important; }
  .slot { min-height: 92px !important; }
  .slot-pos { font-size: 19px !important; }
  .slot-avatar { width: 50px !important; height: 50px !important; }
  .slot strong { font-size: 11.5px !important; }
  .slot small { font-size: 20px !important; }
  .app-shell.view-build .pitch { min-height: 500px !important; }
  .app-shell.view-build .player-token {
    width: min(25%, 116px) !important;
    min-height: 92px !important;
    padding: 8px 6px !important;
  }
  .app-shell.view-build .token-avatar { width: 48px !important; height: 48px !important; }
  .app-shell.view-build .player-token span { font-size: 14px !important; }
  .app-shell.view-build .player-token strong { font-size: 11.5px !important; }
  .app-shell.view-final .player-token {
    width: min(24%, 112px) !important;
    min-height: 92px !important;
    padding: 8px 6px !important;
  }
  .app-shell.view-final .token-avatar { width: 48px !important; height: 48px !important; }
  .app-shell.view-final .match-rating { min-width: 36px !important; height: 28px !important; font-size: 18px !important; }
  .app-shell.view-final .player-token span,
  .app-shell.view-final .player-token strong { font-size: 11.5px !important; }
}

/* Current polish pass: centered logo, split color selectors, tighter draft layout, report tabs */
.setup-overlay {
  overflow: auto !important;
  align-items: start !important;
}

.setup-modal {
  max-height: calc(100vh - 28px) !important;
  overflow: auto !important;
}

.team-custom-row {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.color-control-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.color-select {
  position: relative;
  min-width: 0;
}

.color-select summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 12px;
  color: var(--text);
  background: #10181c;
  border: 1px solid rgba(255, 255, 255, .12);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.color-select summary span {
  text-transform: none;
}

.color-select summary::-webkit-details-marker { display: none; }

.color-select summary i {
  width: 25px;
  height: 25px;
  background: var(--sw);
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 999px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .08);
}

.color-options {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 6px;
  padding: 8px;
  background: #0b1114;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow: 0 18px 34px rgba(0, 0, 0, .46);
}

.color-options .color-swatch {
  min-height: 30px;
  border-radius: 999px;
}

.custom-team-badge {
  width: 46px !important;
  height: 46px !important;
  margin-right: 10px !important;
  display: inline-grid !important;
  place-items: center !important;
  overflow: hidden !important;
  color: #06130b !important;
  background:
    radial-gradient(circle at 50% 50%, rgba(255,255,255,.92) 0 18%, transparent 19%),
    conic-gradient(from 30deg, var(--tc1) 0 25%, var(--tc2) 25% 50%, var(--tc1) 50% 75%, var(--tc2) 75% 100%) !important;
  border: 0 !important;
  border-radius: 999px !important;
  clip-path: none !important;
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.32), 0 0 0 2px rgba(255,255,255,.72), 0 8px 18px rgba(0,0,0,.28) !important;
}

.custom-team-badge span {
  position: absolute !important;
  inset: 7px !important;
  width: auto !important;
  height: auto !important;
  transform: none !important;
  background: transparent !important;
  border: 2px solid rgba(255,255,255,.64) !important;
  border-radius: 999px !important;
}

.custom-team-badge b {
  position: relative;
  z-index: 1;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #07100d;
  background: rgba(255,255,255,.88);
  border-radius: 999px;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
}

.topbar {
  position: relative;
  justify-content: center !important;
  min-height: 66px;
}

.brand-logo-img {
  display: block;
  width: min(190px, 48vw);
  height: auto;
  object-fit: contain;
}

.topbar .run-meta {
  position: absolute;
  right: 0;
}

.app-shell.view-build {
  grid-template-columns: minmax(560px, 1.14fr) minmax(360px, .86fr) !important;
}

.slot-row {
  grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
  overflow: visible !important;
  gap: 5px !important;
}

.slot {
  min-height: 70px !important;
  padding: 5px 3px !important;
  border-radius: 10px !important;
}

.slot-pos { font-size: 15px !important; }
.slot-avatar { width: 31px !important; height: 31px !important; }
.slot strong { font-size: 9px !important; }
.slot small { font-size: 16px !important; }
.slot.empty strong { font-size: 15px !important; }

.app-shell.view-build .pitch {
  min-height: 470px !important;
}

.app-shell.view-build .player-token {
  width: min(23%, 128px) !important;
  min-height: 78px !important;
  padding: 7px 6px !important;
}

.app-shell.view-build .token-avatar {
  width: 38px !important;
  height: 38px !important;
}

.app-shell.view-build .player-token span { font-size: 12px !important; }
.app-shell.view-build .player-token strong { font-size: 11px !important; }

.mockup-kicker { display: none !important; }

.mockup-logo-top {
  display: block !important;
  margin: 0 auto clamp(16px, 2vw, 24px) !important;
}

.mockup-team {
  gap: 8px;
}

.team-ovr {
  display: grid;
  width: 44px;
  height: 34px;
  place-items: center;
  color: #07100d;
  background: var(--lime);
  border-radius: 10px;
  font-style: normal;
  font-weight: 1000;
  box-shadow: 0 8px 18px rgba(0,0,0,.28);
}

.report-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.report-tabs button {
  min-height: 46px;
  color: var(--text);
  background: #10181c;
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(16px, 2.2vw, 23px);
  font-weight: 900;
  text-transform: uppercase;
}

.setup-crest-preview span {
  display: grid;
  gap: 2px;
  line-height: .95;
}

.setup-crest-preview small {
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0;
  text-transform: none;
}

.report-tabs button.active {
  color: #08140d;
  background: var(--lime);
}

.report-tab-panel {
  display: grid;
  gap: 10px;
}

.report-tab-panel h3 {
  margin: 2px 0;
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 26px;
  text-transform: uppercase;
}

.rating-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.match-stat-card {
  display: grid;
  gap: 7px;
  padding: 12px;
  color: var(--text);
  background: rgba(9, 16, 19, .76);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
}

.match-stat-head,
.match-stat-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  text-align: center;
}

.match-stat-head {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.match-stat-head strong {
  min-width: 0;
  overflow: hidden;
  color: var(--lime);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.match-stat-row {
  min-height: 34px;
  padding: 6px 8px;
  background: rgba(255,255,255,.05);
  border-radius: 8px;
}

.match-stat-row b {
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 24px;
}

.match-stat-row span {
  min-width: 104px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

@media (max-width: 1040px) {
  .app-shell.view-build {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 680px) {
  .setup-overlay {
    padding: 10px !important;
  }

  .setup-modal {
    width: 100% !important;
    max-height: calc(100vh - 20px) !important;
    padding: 16px !important;
    gap: 10px !important;
  }

  .mode-grid {
    grid-template-columns: 1fr !important;
  }

  .mode-btn {
    min-height: 78px !important;
    padding: 12px !important;
  }

  .topbar {
    align-items: center !important;
    flex-direction: row !important;
    padding-top: 4px;
  }

  .topbar .run-meta {
    position: static;
  }

  .brand-logo-img {
    width: 132px;
  }

  .slot-row {
    grid-template-columns: repeat(11, minmax(0, 1fr)) !important;
    gap: 3px !important;
  }

  .slot {
    min-height: 48px !important;
    padding: 3px 1px !important;
  }

  .slot-pos { font-size: 11px !important; }
  .slot-avatar { width: 20px !important; height: 20px !important; }
  .slot strong { display: none !important; }
  .slot small { font-size: 12px !important; }

  .report-tabs {
    grid-template-columns: 1fr !important;
  }

  .rating-list {
    grid-template-columns: 1fr;
  }

  .color-options {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Current gameplay update */
.settings-menu {
  position: absolute;
  left: 0;
  z-index: 10;
}

.settings-menu summary {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: #08140d;
  background: var(--lime);
  border-radius: 12px;
  cursor: pointer;
  list-style: none;
}

.settings-menu summary::-webkit-details-marker { display: none; }

.settings-menu label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  padding: 10px 12px;
  color: var(--text);
  background: #10181c;
  border: 1px solid rgba(255,255,255,.12);
  font-weight: 900;
}

.settings-menu[open] label:first-of-type { margin-top: 8px; }

.run-meta #pickCounter {
  min-width: 112px !important;
  padding: 12px 16px !important;
  color: #08140d !important;
  background: #8eff00 !important;
  border-color: rgba(255,255,255,.32) !important;
  border-radius: 14px !important;
  font-size: 30px !important;
  line-height: .9 !important;
}

.route-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.route-btn {
  display: grid;
  gap: 5px;
  align-content: center;
  min-height: 58px;
  color: var(--text);
  background: #10181c;
  border: 1px solid rgba(255,255,255,.14);
  cursor: pointer;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 26px;
  font-weight: 900;
  text-transform: uppercase;
}

.route-btn span {
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 12px;
  line-height: 1.25;
  text-transform: none;
  color: inherit;
  opacity: .82;
}

.route-btn.active {
  color: #08140d;
  background: var(--lime);
}

.custom-team-badge {
  width: 50px !important;
  height: 56px !important;
  border-radius: 18px 18px 24px 24px !important;
  clip-path: polygon(50% 0, 92% 15%, 86% 72%, 50% 100%, 14% 72%, 8% 15%) !important;
  background:
    linear-gradient(135deg, rgba(255,255,255,.16), transparent 34%),
    linear-gradient(90deg, var(--tc1) 0 44%, var(--tc2) 44% 56%, var(--tc1) 56% 100%) !important;
  background-clip: border-box !important;
}

.custom-team-badge span {
  inset: 9px !important;
  display: none !important;
}

.custom-team-badge b { display: none !important; }

.wheel-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) !important;
}

.wheel-box {
  height: 78px !important;
  padding: 12px 14px !important;
  border-radius: 18px !important;
  background:
    linear-gradient(180deg, rgba(142,255,0,.13), transparent 38%, rgba(0,0,0,.20)),
    linear-gradient(135deg, rgba(255,255,255,.08), transparent),
    #10181c !important;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05), 0 12px 24px rgba(0,0,0,.22);
}

.wheel-box span {
  height: 54px !important;
  line-height: 54px !important;
  font-size: clamp(20px, 2.2vw, 34px) !important;
}

.flag-img {
  width: 32px !important;
  height: 23px !important;
  border-radius: 5px;
}

.report-pitch {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255,255,255,.045) 50%, transparent 50%),
    repeating-linear-gradient(0deg, #0f6d43, #0f6d43 82px, #0a5334 82px, #0a5334 164px);
  border: 2px solid rgba(255,255,255,.42);
}

.app-shell.view-final .pitch-header,
.app-shell.view-final .lineup-tabs-mount,
.app-shell.view-final > .pitch-panel > .pitch {
  display: none !important;
}

.report-pitch::before {
  position: absolute;
  inset: 22px;
  content: "";
  border: 2px solid rgba(255,255,255,.34);
}

.report-token {
  position: absolute;
  z-index: 2;
  display: grid;
  width: min(21%, 150px);
  min-height: 118px;
  justify-items: center;
  gap: 3px;
  transform: translate(-50%, -65%);
  padding: 8px;
  text-align: center;
  background: rgba(8, 15, 13, .92);
  border: 1px solid rgba(220,255,190,.25);
  border-radius: 15px;
}

.report-token .token-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  object-position: top center;
}

.report-token strong {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 12px;
  line-height: 1.05;
}

.report-token span {
  color: var(--lime);
  font-weight: 900;
}

.tournament-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  background: rgba(255,255,255,.045);
  border: 1px solid rgba(255,255,255,.10);
  overflow-x: auto;
}

.tournament-card h3 {
  margin: 0;
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 28px;
}

.bracket-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  align-items: stretch;
}

.bracket-round {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  min-width: 0;
}

.bracket-round strong {
  display: block;
  color: var(--gold);
}

.bracket-stack {
  position: relative;
  display: grid;
  align-content: space-around;
  gap: 12px;
  min-height: 100%;
}

.bracket-round:not(.final) .bracket-stack::after {
  position: absolute;
  right: -16px;
  top: 14%;
  bottom: 14%;
  width: 2px;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(142,255,0,.48) 14%, rgba(142,255,0,.48) 86%, transparent);
}

.bracket-round.qf .bracket-stack::after { top: 24%; bottom: 24%; }
.bracket-round.sf .bracket-stack::after { top: 38%; bottom: 38%; }

.bracket-match {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 7px;
  background: rgba(0,0,0,.24);
  border: 1px solid rgba(255,255,255,.08);
}

.bracket-team {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bracket-round:not(:last-child) .bracket-match::after {
  position: absolute;
  left: 100%;
  top: 50%;
  width: 32px;
  height: 2px;
  content: "";
  background: rgba(142,255,0,.42);
}

.bracket-round:not(:first-child) .bracket-match::before {
  position: absolute;
  right: 100%;
  top: 50%;
  width: 32px;
  height: 2px;
  content: "";
  background: rgba(142,255,0,.42);
}

.bracket-match.active {
  border-color: rgba(142,255,0,.72);
  box-shadow: 0 0 0 1px rgba(142,255,0,.18);
}

.champion-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  color: #08140d;
  background: var(--lime);
  border-radius: 14px;
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 28px;
  font-weight: 900;
  text-transform: uppercase;
}

body.light-mode {
  --bg: #edf2ef;
  --panel: rgba(245, 248, 246, .88);
  --panel-2: #ffffff;
  --line: #c8d1cc;
  --text: #101816;
  --muted: #61706a;
  color-scheme: light;
}

body.light-mode .draft-panel,
body.light-mode .pitch-panel,
body.light-mode .match-screen,
body.light-mode .setup-modal {
  background: rgba(245, 248, 246, .88) !important;
}

@media (max-width: 680px) {
  .settings-menu {
    position: static;
    order: -1;
  }

  .run-meta #pickCounter {
    min-width: 82px !important;
    font-size: 22px !important;
    padding: 9px 10px !important;
  }

  .route-grid {
    grid-template-columns: 1fr;
  }

  .wheel-box {
    height: 68px !important;
  }

  .wheel-box span {
    height: 46px !important;
    line-height: 46px !important;
  }

  .report-pitch {
    min-height: 520px;
  }

  .report-token {
    width: min(23%, 92px);
    min-height: 90px;
    padding: 5px;
  }

  .report-token .token-avatar {
    width: 30px;
    height: 30px;
  }

  .report-token strong {
    font-size: 9px;
  }

  .bracket-grid {
    grid-template-columns: repeat(4, minmax(112px, 1fr));
    min-width: 540px;
    gap: 18px;
  }

  .bracket-match::before,
  .bracket-match::after {
    display: block;
    width: 18px;
  }
}

.scoreboard .score-team .psg-badge,
.scoreboard .score-team .team-crest,
.scoreboard .score-team .custom-team-badge {
  width: clamp(72px, 8vw, 108px) !important;
  height: clamp(72px, 8vw, 108px) !important;
  margin: 0 !important;
  object-fit: contain !important;
}

.app-shell.view-final .result-actions-card {
  width: min(760px, 92%) !important;
}

.app-shell.view-final .result-actions {
  grid-template-columns: repeat(2, minmax(220px, 1fr)) !important;
  justify-content: center !important;
}

.app-shell.view-final .same-team-action {
  min-height: 70px !important;
  border-radius: 18px !important;
  font-size: clamp(20px, 3vw, 34px) !important;
}

@media (max-width: 680px) {
  .app-shell.view-final .result-actions {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

.round-label {
  margin: 0;
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(24px, 4vw, 42px);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.champion-title {
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: clamp(26px, 4.5vw, 48px);
  font-weight: 1000;
  text-align: center;
  text-transform: uppercase;
}

.bench-strip {
  position: absolute;
  z-index: 4;
  right: 8px;
  top: 50%;
  display: grid;
  width: min(21%, 150px);
  gap: 6px;
  transform: translateY(-50%);
  padding: 8px;
  background: rgba(3, 9, 13, .86);
  border: 1px solid rgba(201, 230, 111, .24);
  border-radius: 14px;
}

.bench-strip h3 {
  margin: 0;
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 18px;
  text-align: center;
  text-transform: uppercase;
}

.bench-player {
  display: grid;
  grid-template-columns: 28px 30px minmax(0, 1fr) auto;
  gap: 5px;
  align-items: center;
  min-height: 36px;
  padding: 5px;
  background: rgba(255,255,255,.055);
  border-radius: 9px;
}

.bench-player span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.bench-player img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  object-position: top center;
  border-radius: 999px;
}

.bench-player strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.bench-player small {
  color: var(--lime);
  font-family: "Barlow Condensed", Impact, sans-serif;
  font-size: 15px;
  font-weight: 900;
}

.mockup-team-logo {
  width: clamp(86px, 9vw, 124px) !important;
  height: clamp(86px, 9vw, 124px) !important;
}

.mockup-logo-top {
  position: static !important;
  inset: auto !important;
  transform: none !important;
}

.mockup-team-logo .psg-badge,
.mockup-team-logo .team-crest,
.mockup-team-logo .custom-team-badge {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
  object-fit: contain !important;
}

.setup-crest-preview .custom-team-badge {
  width: 72px !important;
  height: 82px !important;
}

@media (max-width: 680px) {
  .scoreboard .score-team .psg-badge,
  .scoreboard .score-team .team-crest,
  .scoreboard .score-team .custom-team-badge {
    width: 66px !important;
    height: 66px !important;
  }

  .mockup-team-logo {
    width: 74px !important;
    height: 74px !important;
  }

  .bench-strip {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 8px;
    width: auto;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    transform: none;
  }

  .bench-strip h3 {
    grid-column: 1 / -1;
  }

  .bench-player {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .bench-player strong {
    display: none;
  }
}

/* Team names: never hide with ellipsis; 20-char names fit by scaling/wrapping. */
.team-identity strong,
.lineup-tabs button span,
.score-team span,
.mockup-team strong,
.match-stat-head strong,
.bracket-team,
.champion-line strong,
.champion-title,
.setup-crest-preview strong,
.wheel-box span {
  min-width: 0;
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: normal !important;
  overflow-wrap: anywhere;
  word-break: normal;
}

.team-identity strong,
.lineup-tabs button span {
  font-size: clamp(13px, 1.45vw, 20px) !important;
  line-height: .95;
}

.score-team span,
.mockup-team strong {
  font-size: clamp(18px, 3.2vw, 34px) !important;
  line-height: .86;
}

.wheel-box span {
  height: auto;
  min-height: 40px;
  font-size: clamp(13px, 1.5vw, 21px);
  line-height: 1.05;
}

.bracket-team {
  font-size: clamp(10px, 1.1vw, 13px);
  line-height: 1.05;
}
