.lineup-content {
  --ink: #f2f5fa;
  --muted: #aebed1;
  --panel: #171e29;
  --line: #3c4c62;
  --mint: #70f2ce;
  --gold: #ffc073;
}
.lineup-content, .lineup-content *, .lineup-content *::before, .lineup-content *::after {
  box-sizing: border-box;
}
.lineup-content :is(button, a, input, summary):focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}
.lineup-content :is(button, input) { font: inherit; }
.lineup-content :is(button, a) { touch-action: manipulation; }
.lineup-content button:disabled { cursor: default; }
.lineup-content a { text-underline-offset: .2em; }
.lineup-intro { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.lineup-game :is(h2, p) { margin: 0; }
.lineup-intro p { max-width: 55ch; }
.mode-nav { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: #202938; flex-shrink: 0; }
.mode-nav a {
  min-height: 44px;
  display: grid;
  align-items: center;
  padding: 0 14px;
  border-radius: 7px;
  color: var(--ink);
  font-size: .88rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}
.mode-nav a[aria-current] { background: var(--mint); color: #122d24; }
.mode-nav a:not([aria-current]):hover { background: #33445a; }

.lineup-game { padding: 17px; border: 1px solid #283140; border-radius: 16px; background: var(--panel); }
.match-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 15px;
}
.match-info { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 13px; row-gap: 3px; min-width: 0; }
.match-info strong { font: 700 1.05rem/1.3 Inter, sans-serif; }
.match-info span { font-size: .89rem; color: var(--muted); }
.round-actions, .round-bottom { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.round-actions { flex-shrink: 0; }
.lineup-game :is(.secondary, .primary, .flag-choice) {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 680;
  font-size: .83rem;
  background: #293950;
  color: var(--ink);
}
.flag-choice:hover:enabled { background: #384a5f; }
.lineup-game .secondary:disabled { opacity: .55; }
.game-layout { display: grid; grid-template-columns: minmax(0, 1.32fr) minmax(306px, 1fr); gap: 18px; align-items: start; }
.pitch {
  position: relative;
  min-width: 0;
  min-height: 520px;
  isolation: isolate;
  border-radius: 13px;
  overflow: hidden;
  background: repeating-linear-gradient(180deg, #1c5d48 0 12.5%, #215f47 12.5% 25%);
  box-shadow: inset 0 -13px 28px #0f29237a, 0 4px #101d2b;
}
.pitch-markings {
  position: absolute;
  z-index: -1;
  inset: 16px 19px;
  border: 1px solid #b0e6c386;
  background: linear-gradient(180deg, transparent calc(50% - .5px), #b0e6c386 0 calc(50% + .5px), transparent 0);
}
.pitch-markings .centre-circle {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #b0e6c386;
  border-radius: 50%;
}
.goal-area {
  position: absolute;
  width: 39%;
  height: 16%;
  left: 50%;
  transform: translateX(-50%);
  border: 1px solid #b0e6c386;
}
.goal-area.top { top: -1px; }
.goal-area.bottom { bottom: -1px; }
.goal-area::after {
  content: "";
  position: absolute;
  left: 27%;
  width: 46%;
  height: 42%;
  border: 1px solid #b0e6c386;
}
.goal-area.top::after { top: -1px; }
.goal-area.bottom::after { bottom: -1px; }
.pitch-players {
  min-height: inherit;
  display: grid;
  grid-template-rows: repeat(var(--rows, 4), minmax(0, 1fr));
  align-items: center;
  gap: 6px;
  padding: 28px 17px;
}
.pitch-row { display: flex; justify-content: space-evenly; align-items: center; gap: 6px; min-width: 0; }
.player-tile {
  display: grid;
  grid-template-rows: minmax(23px, auto) auto;
  place-items: center;
  align-content: center;
  gap: 4px;
  width: min(18.4%, 107px);
  min-width: 0;
  min-height: 60px;
  padding: 6px 3px;
  border-radius: 9px;
  border: 1px solid #85bca1;
  background: #16352df2;
  color: #effaf1;
  box-shadow: 0 3px 0 #0c2b22;
  transition: background 150ms, border-color 150ms;
}
.player-tile:hover, .player-tile[aria-pressed="true"] { background: #2c5d4c; border-color: var(--gold); }
.player-tile[aria-pressed="true"] { outline: 2px solid var(--gold); outline-offset: 2px; }
.player-tile[data-state="correct"] { background: #224a3b; border-color: var(--mint); }
.player-tile[data-state="shown"] { background: #2d3d36; border-color: #b3c8ba; }
.player-tile .tile-text {
  min-width: 0;
  max-width: 100%;
  line-height: 1.2;
  font-size: .71rem;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}
.player-tile .role-text { font-size: .68rem; color: #c1e5cf; }
.player-tile .compact-role { display: none; }
.flag { width: 48px; height: 30px; object-fit: contain; display: block; filter: drop-shadow(0 1px 1px #111e25a1); }
.player-tile .flag { width: 37px; height: 24px; }

.side-panel { min-width: 0; display: grid; gap: 13px; }
.club-panel, .player-panel { background: #1a2230; border-radius: 12px; padding: 16px; }
.lineup-game h2 { font: 700 1.15rem/1.24 Inter, sans-serif; }
.panel-top { display: flex; justify-content: space-between; align-items: start; gap: 8px; margin-bottom: 13px; }
.lineup-game .score { color: var(--mint); white-space: nowrap; font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.answer-form { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 8px; }
.answer-form :is(input, .gn-answer-suggestions) { width: 100%; }
.answer-form input {
  min-height: 44px;
  font-size: 1rem;
  color: var(--ink);
  background: #202938;
  border: 1px solid #536780;
  border-radius: 8px;
  padding: 7px 10px;
}
.answer-form input::placeholder { color: #bccbd4; opacity: 1; }
.answer-form .gn-answer-suggestions { min-width: 0; }
.club-hints { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.club-hints button { min-height: 40px; }
.lineup-game .feedback { min-height: 19px; margin-top: 9px; color: #dbe7eb; line-height: 1.4; font-size: .85rem; }
.lineup-game .feedback[data-result=correct] { color: var(--mint); }
.lineup-game .feedback[data-result=wrong] { color: #ffccb5; }
.player-clue { display: flex; align-items: center; gap: 9px; min-height: 42px; margin-bottom: 11px; }
.player-clue strong { display: block; font-weight: 750; }
.player-clue small { color: var(--muted); display: block; font-size: .79rem; margin-top: 3px; }
.flag-choice {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 60px;
  padding: 6px;
}
.flag-choice img { max-width: 100%; }
.flag-choice[data-result=correct] { background: #234d40; border-color: var(--mint); }
.flag-choice[data-result=wrong] { background: #572f3a; border-color: #f6a5a7; }
.flag-choice:disabled:not([data-result]) { opacity: .52; }
.round-bottom { justify-content: space-between; gap: 8px; }
.lineup-game .source { color: var(--mint); font-size: .85rem; }

.lineup-rules {
  margin-top: 23px;
  padding: 12px 17px;
  max-width: 69ch;
  color: var(--muted);
  background: var(--panel);
  border-radius: 10px;
}
.lineup-rules summary { line-height: 1.8; color: var(--ink); cursor: pointer; font-weight: 700; }
.lineup-rules p { line-height: 1.6; margin-top: 9px; font-size: .92rem; }

@media (max-width: 1080px) {
  .lineup-intro { align-items: start; flex-direction: column; gap: 14px; }
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .pitch { min-height: 420px; }
}
@media (max-width: 490px) {
  .lineup-intro p { font-size: .9rem; }
  .lineup-game { padding: 9px; }
  .match-bar { align-items: start; }
  .match-info { flex-direction: column; }
  .match-info span { font-size: .75rem; }
  .round-actions { gap: 4px; }
  .round-actions button { padding: 7px 8px; }
  .pitch { min-height: 354px; }
  .pitch-markings { inset: 11px 10px; }
  .pitch-players { padding: 14px 9px; }
  .pitch-row { gap: 3px; }
  .player-tile { width: 19%; gap: 3px; min-height: 50px; }
  .player-tile .flag { width: 31px; height: 20px; }
  .player-tile .tile-text { font-size: .67rem; }
  .player-tile[data-clue="flag"] .tile-text { display: none; }
  .player-tile[data-clue="flag"] .compact-role { display: block; }
  .club-panel, .player-panel { padding: 12px; }
}
@media (prefers-reduced-motion: reduce) { .player-tile { transition: none; } }

.flag-picker {
  box-sizing: border-box;
  inline-size: min(680px, calc(100% - 28px));
  max-block-size: min(670px, 88dvh);
  padding: clamp(12px, 3vw, 22px);
  border: 1px solid #536581;
  border-radius: 14px;
  color: var(--ink);
  background: var(--panel);
  overflow: hidden;
}
.flag-picker[open] { display: grid; grid-template-rows: auto auto auto auto minmax(0, 1fr); gap: 10px; }
.flag-picker::backdrop { background: #080d18c9; }
.flag-picker-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.flag-picker-head h2 { margin: 0; font-size: clamp(1.05rem, 3vw, 1.3rem); }
.flag-picker-head button { --arc-button: #c6adff; --arc-button-edge: #8e71c5; }
.flag-picker label { font-size: .88rem; color: var(--muted); }
.flag-picker input {
  min-block-size: 44px;
  min-inline-size: 0;
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #778dae;
  border-radius: 8px;
  color: var(--ink);
  background: #202938;
  font-size: 1rem;
}
.flag-picker input::placeholder { color: #b7c8de; }
.flag-picker #flag-count { color: var(--muted); font-size: .8rem; }
.flag-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 116px), 1fr));
  align-items: stretch;
  gap: 8px;
  min-height: 0;
  max-height: min(450px, 57dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  margin: 0;
  padding: 4px 7px 4px 4px;
  list-style: none;
}
.flag-picker-grid .flag-choice { width: 100%; height: 100%; min-height: 69px; gap: 4px; overflow-wrap: anywhere; }
.flag-picker-grid .flag-choice:disabled { opacity: .6; }
.flag-picker-grid .flag-choice small { font: inherit; font-weight: 500; }
.flag-picker:dir(rtl) input { text-align: start; }
@media (max-width: 390px) {
  .flag-picker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
