:root {
  --accent: #574FD9;
  --accent-dark: #423BB0;
  --accent-tint: #ECEBFB;
  --ink: #16161D;
  --muted: #6C6C78;
  --line: #E5E5EC;
  --bg: #F7F7F4;
  --card: #FFFFFF;
  --pitch: #1F8A55;
  --gold: #C8973B;
  --shadow: 0 1px 2px rgba(22,22,29,.05), 0 6px 20px rgba(22,22,29,.06);
  --radius: 10px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Archivo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}

a { color: inherit; }

/* ---------- Header / hero ---------- */
.hero {
  background: var(--ink);
  color: #fff;
  padding: 56px 24px 64px;
  position: relative;
  overflow: hidden;
}
.hero__inner {
  max-width: 1080px; margin: 0 auto; position: relative; z-index: 1;
  display: flex; align-items: center; gap: 40px;
}
.hero__content { flex: 1; min-width: 0; }
.hero__trophy {
  flex: none;
  display: flex; align-items: center; justify-content: center;
}
.trophy-emoji {
  font-size: clamp(100px, 14vw, 160px);
  line-height: 1;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.45));
  animation: trophy-float 5s ease-in-out infinite;
  display: block;
}
@keyframes trophy-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@media (max-width: 600px) {
  .hero__trophy { display: none; }
}
.hero__kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  padding: 6px 12px;
  border-radius: 999px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 60px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 20px 0 14px;
  max-width: 16ch;
}
.hero p {
  font-size: clamp(16px, 2.2vw, 20px);
  color: #C9C9D2;
  max-width: 56ch;
  margin: 0 0 28px;
}
.hero__stats { display: flex; gap: 32px; flex-wrap: wrap; }
.hero__stat .n { font-size: 30px; font-weight: 800; letter-spacing: -.01em; display: block; }
.hero__stat .l { font-size: 13px; color: #9B9BA6; text-transform: uppercase; letter-spacing: .08em; }
.hero__pitch {
  position: absolute; inset: 0; opacity: .5;
  background:
    repeating-linear-gradient(90deg, transparent 0 64px, rgba(255,255,255,.025) 64px 128px);
}

/* ---------- Sticky nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(247,247,244,.9);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav__inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 24px;
  display: flex; align-items: center; gap: 8px;
}
.tab {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-weight: 600; color: var(--muted);
  padding: 8px 14px; border-radius: 999px;
  transition: background .15s ease-out, color .15s ease-out;
}
.tab:hover { color: var(--ink); background: var(--accent-tint); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.tab[aria-selected="true"] { color: #fff; background: var(--accent); }
.nav__spacer { flex: 1; }
.nav__note { font-size: 12.5px; color: var(--muted); }

/* ---------- Layout ---------- */
main { max-width: 1080px; margin: 0 auto; padding: 32px 24px 80px; }
.view[hidden] { display: none; }
.section-head { margin: 8px 0 22px; }
.section-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; margin: 0 0 4px; }
.section-head p { margin: 0; color: var(--muted); font-size: 14.5px; }

/* preview banner */
.preview-flag {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-tint); color: var(--accent-dark);
  border-radius: var(--radius); padding: 11px 14px; margin-bottom: 24px;
  font-size: 13.5px; font-weight: 600;
}
.preview-flag svg { flex: none; }

/* ---------- Group grid ---------- */
.groups {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
}
.group {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden;
}
.group__head {
  display: flex; align-items: baseline; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.group__head h3 { margin: 0; font-size: 15px; font-weight: 800; letter-spacing: .02em; }
.group__head .label { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

.team {
  border-bottom: 1px solid var(--line);
}
.team:last-child { border-bottom: 0; }
.team__row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; text-align: left;
  appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; color: inherit; padding: 12px 16px;
  transition: background .14s ease-out;
}
.team__row:hover { background: #FAFAFB; }
.team__row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.flag {
  width: 30px; height: 20px; border-radius: 3px; flex: none;
  object-fit: cover; box-shadow: 0 0 0 1px rgba(22,22,29,.08);
  background: var(--line);
}
.team__name { font-weight: 700; font-size: 15px; flex: 1; }
.team__meta { font-size: 12px; color: var(--muted); }
.chev { flex: none; color: var(--muted); transition: transform .18s ease-out; }
.team[aria-expanded="true"] .chev { transform: rotate(90deg); }

.vote {
  display: inline-flex; align-items: center; gap: 7px;
  appearance: none; border: 1px solid var(--line); background: #fff; cursor: pointer;
  font: inherit; font-weight: 700; font-size: 13px; color: var(--ink);
  padding: 6px 11px; border-radius: 999px; flex: none;
  transition: border-color .14s ease-out, background .14s ease-out, transform .08s ease-out;
}
.vote:hover { border-color: var(--accent); background: var(--accent-tint); }
.vote:active { transform: scale(.95); }
.vote:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.vote[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.vote svg { flex: none; }
.vote .count { font-variant-numeric: tabular-nums; min-width: 1.5ch; text-align: right; }

/* squad reveal */
.squad { display: none; padding: 4px 16px 14px; background: #FCFCFD; }
.team[aria-expanded="true"] .squad { display: block; }
.squad ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.player {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.player .num {
  font-size: 11px; font-weight: 800; color: var(--accent);
  background: var(--accent-tint); border-radius: 5px;
  width: 20px; height: 20px; display: grid; place-items: center; flex: none; margin-top: 1px;
}
.player .pname { font-size: 13.5px; font-weight: 600; }

/* grayed / no-listings country */
.team--grayed .team__row { background: repeating-linear-gradient(135deg,#FAFAFA 0 10px,#F4F4F5 10px 20px); }
.team--grayed .flag { filter: grayscale(1) opacity(.7); }
.team--grayed .team__name { color: var(--muted); }
.squad--empty { padding: 10px 16px 16px; background: #FCFCFD; }
.linkdrop {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--accent-dark);
  text-decoration: none; padding: 9px 13px; border-radius: 8px;
  background: var(--accent-tint); transition: background .14s ease-out;
}
.linkdrop:hover { background: #DEDCF7; }
.squad--empty p { margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.lineup--retired { opacity: .7; }
.ltool-row { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.retired-label {
  display: inline-block;
  font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); background: #EDEDED; padding: 2px 7px; border-radius: 4px;
  flex-shrink: 0;
}

/* fixtures toggle */
.fixtures {
  border-top: 1px dashed var(--line); padding: 10px 16px; font-size: 12.5px; color: var(--muted);
}
.fixtures summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.fixtures table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.fixtures td { padding: 3px 0; vertical-align: top; }
.fixtures td:first-child { color: var(--muted); white-space: nowrap; padding-right: 10px; }

/* ---------- Bracket ---------- */
.bracket-scroll { overflow-x: auto; padding-bottom: 16px; }
.bracket { display: flex; gap: 28px; min-width: max-content; align-items: stretch; }
.round { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; width: 240px; position: relative; padding-top: 26px; }
/* Titles sit outside the flex flow so space-around centers ties on the
   column itself — with the title as a flex child the final tie sat low. */
.round__title {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); text-align: center; position: absolute; top: 0; left: 0; right: 0;
}
.tie {
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow); overflow: hidden;
}
.tie__slot {
  display: block; padding: 8px 10px; font-size: 12.5px; font-weight: 600;
}
.slot__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.slot__head .slot__name { white-space: normal; overflow: visible; text-overflow: clip; }
.slot__head .vote { margin-left: auto; }
.slot__lineup { margin-top: 7px; overflow: hidden; }
.slot__lineup .ltool { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.slot__lineup .lone { display: none; }
.tie__slot + .tie__slot { border-top: 1px solid var(--line); }
.tie__m { font-size: 10px; color: var(--muted); padding: 2px 10px 6px; }
.round--final { width: 300px; }
.tie--final { border-color: var(--gold); }
.tie--final .tie__slot { font-weight: 800; }
.flag--sm { width: 22px; height: 15px; }
.slot__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot__votes { font-size: 10px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.slot__label { color: var(--muted); font-weight: 500; font-size: 11.5px; }
.vote--ko { padding: 3px 6px; font-size: 11px; gap: 4px; border-radius: 6px; }

/* ---------- Footer ---------- */
.foot { border-top: 1px solid var(--line); padding: 28px 24px; color: var(--muted); font-size: 13px; }
.foot__inner { max-width: 1080px; margin: 0 auto; display: flex; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.foot a { color: var(--accent-dark); font-weight: 600; text-decoration: none; }
.foot a:hover { text-decoration: underline; }

/* ---------- Soccer ball minigame ---------- */
#ball-wrap {
  position: fixed;
  z-index: 9999;
  width: 80px;
  height: 80px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  pointer-events: none; /* block page clicks through wrapper; SVG re-enables */
}
#ball-wrap:focus-visible { outline: none; }
#ball-wrap svg {
  display: block;
  width: 80px;
  height: 80px;
  pointer-events: auto;
  filter: drop-shadow(0 4px 14px rgba(0,0,0,0.26));
  transform-origin: 50% 50%;
}
#ball-wrap svg:hover { filter: drop-shadow(0 4px 20px rgba(0,0,0,0.36)); }
#ball-ground-shadow { transition: opacity 0.06s linear; }

body[data-view="squad"] #ball-wrap,
body[data-view="squad"] #ball-ground-shadow,
body[data-view="squad"] .ball-goal,
body[data-view="squad"] .ball-goalie,
body[data-view="squad"] #ball-flash { display: none !important; }

@media (max-width: 560px) {
  .hero { padding: 40px 20px 48px; }
  main { padding: 24px 16px 64px; }
  .nav__note { display: none; }
  #ball-wrap { width: 40px; height: 40px; }
  #ball-wrap svg { width: 40px; height: 40px; }
  /* goalies touch nets on mobile — no gap */
  .ball-goalie--left  { left: 36px; }
  .ball-goalie--right { right: 36px; }
}

/* ================= Group stage v2: head-to-head matchups ================= */
.groups { display: block; }
.group { margin-bottom: 22px; padding-bottom: 6px; }
.group__sub {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); padding: 14px 16px 6px;
}

/* overall-vote strip */
.teams-strip {
  display: grid; gap: 10px; padding: 2px 16px 8px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.tchip {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff;
}
.tchip__name { font-weight: 700; font-size: 14px; flex: 1; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.tchip__name:hover { color: var(--accent-dark); }
.tchip .vote { margin-left: auto; }

/* matchup grid */
.matchups {
  display: grid; gap: 14px; padding: 4px 16px 14px;
  grid-template-columns: repeat(auto-fill, minmax(460px, 1fr));
}
.match {
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden;
}
.match__meta {
  display: flex; gap: 8px; align-items: baseline; justify-content: center;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: #FAFAFB;
}
.match__date { font-weight: 800; font-size: 12.5px; }
.match__city { font-size: 12px; color: var(--muted); }
.match__grid { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; position: relative; }
.vs {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; z-index: 2;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 10.5px; font-weight: 800; color: var(--muted); text-transform: uppercase;
}

.side { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.side:first-child { border-right: 1px solid var(--line); }
.side__head { display: flex; align-items: center; gap: 8px; }
.side__name { font-weight: 800; font-size: 14.5px; flex: 1; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; line-height: 1.2; }
.side__name:hover { color: var(--accent-dark); }
.side__head .vote { margin-left: auto; }
.side__note { font-size: 11.5px; color: var(--muted); margin-top: -2px; }
.ext { opacity: .55; flex: none; }

.lineup { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.lineup li { display: flex; flex-direction: column; gap: 1px; }
.ltool {
  font-size: 13px; font-weight: 700; color: var(--ink); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px; width: fit-content;
}
a.ltool:hover { color: var(--accent-dark); text-decoration: underline; }
.lone { font-size: 11.5px; color: var(--muted); line-height: 1.35; }

.side__refresh {
  appearance: none; border: 0; background: transparent; cursor: pointer;
  padding: 5px; border-radius: 5px; flex: none;
  color: #C8C8D4;
  display: inline-flex; align-items: center; justify-content: center;
  transition: color .14s ease-out, background .14s ease-out;
}
.side__refresh:hover { color: var(--muted); background: var(--accent-tint); }
.side__refresh:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@keyframes spin-once { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.side__refresh.spinning svg { animation: spin-once .4s ease-out; }

.side--grayed { background: repeating-linear-gradient(135deg,#FBFBFB 0 10px,#F5F5F6 10px 20px); }
.side--grayed .flag { filter: grayscale(1) opacity(.7); }
.side--grayed .side__name { color: var(--muted); }

@media (max-width: 720px) {
  .matchups { grid-template-columns: 1fr; padding: 4px 12px 12px; }
  .match__grid { grid-template-columns: 1fr; }
  .side:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
  .vs { position: relative; left: auto; top: auto; transform: none; justify-self: center; margin: -17px 0; }
  .teams-strip { padding: 2px 12px 8px; }
}

/* ================= Day-by-day fixtures nav ================= */
.daynav {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 10px 12px; margin: 0 0 18px;
  position: sticky; top: 53px; z-index: 10;
}
.daynav__arrow {
  appearance: none; cursor: pointer; flex: none;
  width: 40px; height: 40px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  display: grid; place-items: center;
  transition: background .14s ease-out, border-color .14s ease-out, transform .08s ease-out;
}
.daynav__arrow:hover:not(:disabled) { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-dark); }
.daynav__arrow:active:not(:disabled) { transform: scale(.93); }
.daynav__arrow:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.daynav__arrow:disabled { opacity: .35; cursor: not-allowed; }
.daynav__label { text-align: center; line-height: 1.2; }
.daynav__date { font-size: 16px; font-weight: 800; display: inline-flex; align-items: center; gap: 8px; }
.daynav__today {
  font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: var(--accent); padding: 2px 7px; border-radius: 999px;
}
.daynav__count { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }

.match__group { font-weight: 800; font-size: 12.5px; color: var(--accent-dark); }

.day-empty {
  text-align: center; color: var(--muted); font-size: 14.5px;
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px 20px; background: #fff;
}

@media (max-width: 560px) {
  .daynav { top: 49px; }
  .daynav__date { font-size: 15px; }
}

/* ---------- Feedback ---------- */
.feedback {
  max-width: 680px;
  margin: 40px auto 56px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.5rem 1.75rem 1.75rem;
}

/* ── Soccer goals ───────────────────────────────────── */
.ball-goal {
  position: fixed;
  bottom: 0;
  z-index: 9996;
  pointer-events: none;
  box-sizing: border-box;
  background-color: rgba(245,245,250,0.90);
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 11px, rgba(120,120,160,0.13) 11px, rgba(120,120,160,0.13) 12px),
    repeating-linear-gradient(90deg, transparent, transparent 11px, rgba(120,120,160,0.13) 11px, rgba(120,120,160,0.13) 12px);
}
.ball-goal--left  { left: 0;  border-top: 2.5px solid #9898b8; border-right: 2px solid #9898b8; }
.ball-goal--right { right: 0; border-top: 2.5px solid #9898b8; border-left:  2px solid #9898b8; }

.ball-goalie {
  position: fixed;
  bottom: 0;
  width: 28px;
  height: 66px;
  z-index: 9997;
  pointer-events: none;
  border-radius: 3px 3px 2px 2px;
}
.ball-goalie--left  { left: 61px;  background: linear-gradient(180deg, #00895a 0%, #005a38 100%); }
.ball-goalie--right { right: 61px; background: linear-gradient(180deg, #1a52c0 0%, #0a3594 100%); }

/* ── Score flash ────────────────────────────────────── */
#ball-flash {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10000;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: rgba(255,255,255,0.96);
  border-radius: 20px;
  padding: 28px 48px 32px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  min-width: 220px;
}
#ball-flash.ball-flash--visible { opacity: 1; }
.ball-flash__label {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 4px;
}
.ball-flash__score {
  font-family: 'Archivo', system-ui, sans-serif;
  font-size: 5rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.feedback h3 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.4rem;
}

.feedback-lead {
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0 0 1rem;
  line-height: 1.55;
}

.feedback-field {
  width: 100%;
  border: 1.5px solid #d8d5d6;
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  background: #fff;
  outline: none;
  line-height: 1.55;
  box-sizing: border-box;
  transition: border-color 0.15s;
  display: block;
}
.feedback-field:focus { border-color: var(--accent); }
.feedback-field::placeholder { color: #9CA3AF; }

textarea.feedback-field {
  min-height: 110px;
  resize: vertical;
  margin-bottom: 0.75rem;
}

.feedback-email-label {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.feedback-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  flex-wrap: wrap;
}

.feedback-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.55rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}
.feedback-btn:hover:not(:disabled) { transform: translateY(-1px); opacity: 0.9; }
.feedback-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.feedback-status { font-size: 0.85rem; color: var(--muted); }
.feedback-status.ok  { color: #16a34a; }
.feedback-status.err { color: #dc2626; }

.feedback.sent .feedback-form  { display: none; }
.feedback-thanks { display: none; }
.feedback.sent .feedback-thanks {
  display: block;
  color: #16a34a;
  font-size: 0.95rem;
  line-height: 1.55;
}

/* ═══════════════════════════════════════════════
   Build Your Squad
═══════════════════════════════════════════════ */

/* ── Country picker ── */
.squad-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.squad-picker-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 380px;
}

.squad-country-input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.squad-country-input:focus { border-color: var(--accent); }

.squad-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-height: 280px;
  overflow-y: auto;
  z-index: 100;
  padding: 4px 0;
  margin: 0;
  list-style: none;
}
.squad-dropdown.open { display: block; }

.squad-dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--ink);
}
.squad-dropdown-item:hover,
.squad-dropdown-item.active { background: var(--accent-tint); }

.squad-flag { margin: 0; }

.dropdown-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border-radius: 99px;
  padding: 1px 7px;
  white-space: nowrap;
}

.squad-share-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  background: var(--card);
  border: 1.5px solid var(--accent);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.squad-share-btn:hover { background: var(--accent-tint); }

/* ── Field layout ── */
.squad-field-wrap {
  display: flex;
  gap: 28px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.squad-field {
  flex: none;
  position: relative;
  width: 420px;
  height: 580px;
  background: var(--pitch);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 28px 20px;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18), 0 12px 40px rgba(0,0,0,0.12);
}

/* Pitch markings — half-pitch view (GK at bottom, Forwards at top/midfield) */
.pitch-markings { position: absolute; inset: 0; pointer-events: none; }

/* Midfield line across the top */
.pitch-midfield-line {
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  background: rgba(255,255,255,0.30);
}

/* Penalty area box around the goal at the bottom */
.pitch-penalty-area {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 55%;
  height: 22%;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,0.25);
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}

/* Goal box at the very bottom */
.pitch-goal {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 28%;
  height: 8%;
  transform: translateX(-50%);
  border: 2px solid rgba(255,255,255,0.35);
  border-bottom: none;
  border-radius: 3px 3px 0 0;
}

/* Rows */
.pitch-row {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 8px;
  z-index: 1;
}

/* ── Position slots ── */
.pitch-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 84px;
  min-height: 64px;
  background: rgba(255,255,255,0.15);
  border: 2px dashed rgba(255,255,255,0.45);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  padding: 6px 4px;
  text-align: center;
  overflow: hidden;
  position: relative;
}
.pitch-slot:hover,
.pitch-slot.drag-over,
.pitch-slot.touch-over {
  background: rgba(255,255,255,0.28);
  border-color: rgba(255,255,255,0.9);
  transform: scale(1.04);
}
.pitch-slot.filled {
  background: rgba(255,255,255,0.92);
  border: 2px solid rgba(255,255,255,0.9);
  cursor: default;
}

.pos-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

.slot-name {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  word-break: break-word;
  hyphens: auto;
}
.slot-remove {
  position: absolute;
  top: 2px; right: 3px;
  background: none;
  border: none;
  font-size: 14px;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.15s;
}
.pitch-slot.filled:hover .slot-remove { opacity: 1; }

/* ── Bench ── */
.squad-bench {
  flex: 1;
  min-width: 260px;
  max-width: 480px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.bench-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 16px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.bench-title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.bench-hint {
  font-size: 12px;
  color: var(--muted);
}

.bench-list {
  margin: 0;
  padding: 8px 0;
  list-style: none;
  max-height: 520px;
  overflow-y: auto;
}

.bench-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 20px;
  cursor: grab;
  border-bottom: 1px solid var(--line);
  transition: background 0.12s;
}
.bench-item:last-child { border-bottom: none; }
.bench-item:hover { background: var(--bg); }
.bench-item:active { cursor: grabbing; }
.bench-item.pending {
  background: var(--accent-tint);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.bench-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
a.bench-name:hover { text-decoration: underline; color: var(--accent); }

.bench-one {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

.bench-item-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.bench-plus {
  display: none;
  flex-shrink: 0;
  align-self: center;
  width: 30px;
  height: 30px;
  border-radius: 15px;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  transition: background 0.12s, transform 0.1s;
}
.bench-plus:active { transform: scale(0.92); }

.pos-picker-backdrop {
  position: fixed;
  inset: 0;
  z-index: 299;
}

.pos-picker {
  background: var(--card);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  z-index: 300;
  padding: 8px;
  min-width: 180px;
}

.pos-picker-row {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-bottom: 4px;
}
.pos-picker-row:last-child { margin-bottom: 0; }

.pos-chip {
  flex: 1;
  min-width: 0;
  padding: 6px 4px;
  border-radius: 6px;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  transition: background 0.12s, border-color 0.12s;
  overflow: hidden;
}
.pos-chip:hover { background: var(--accent-tint); border-color: var(--accent); }
.pos-chip.filled { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }

.pos-chip-name {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}

.bench-empty {
  padding: 24px 20px;
  color: var(--muted);
  font-size: 14px;
  margin: 0;
}

.bench-overflow {
  padding: 10px 20px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
  list-style: none;
  border-top: 1px solid var(--line);
}

/* ── Responsive ── */
@media (max-width: 560px) {
  .squad-field {
    width: 100%;
    max-width: 340px;
    height: 480px;
    padding: 20px 10px;
  }
  .pitch-slot { width: 68px; min-height: 54px; }
  .slot-name { font-size: 10px; }
  .squad-bench { min-width: 0; width: 100%; }
  .squad-field-wrap { flex-direction: column; align-items: center; }
  .squad-header { flex-direction: column; }
  .squad-picker-wrap { max-width: 100%; }
  .bench-item { flex-direction: row; align-items: center; gap: 10px; padding: 9px 14px; }
  .bench-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bench-one  { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bench-plus { display: flex; }
}
