/* Missing XI - pixel retro with per-player wordle.
 * Three views share the match head + pitch frame:
 *   #mxi-diff-view    -> NORMAL / HARD picker
 *   #mxi-pitch-view   -> 4-x-x formation with guess kits
 *   #mxi-wordle-view  -> wordle grid + on-screen keyboard
 */

.mxi-body {
  background: #181436;
  color: #fff;
  font-family: "Courier New", "DejaVu Sans Mono", monospace;
  image-rendering: pixelated;
}
.mxi-wrap { max-width: 480px; margin: 0 auto; padding: 10px; }

/* ---------- match head ---------- */
.mxi-matchhead {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
  text-align: center;
  padding: 14px 0 10px;
}
.mxi-matchhead .team   { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.mxi-matchhead .team .name { font-size: 12px; letter-spacing: 1px; color: #ddd; }
.mxi-matchhead .middle .comp  { font-size: 11px; color: #b3b3ce; letter-spacing: 2px; }
.mxi-matchhead .middle .score { font-size: 26px; font-weight: 700; }
.mxi-matchhead .middle .date  { font-size: 10px; color: #8585a8; }
.kit-small { width: 36px; height: 36px; }

/* ---------- pitch frame (shared) ---------- */
.mxi-pitch-frame {
  background:
    linear-gradient(#2e8a3f 0 0) padding-box,
    repeating-linear-gradient(0deg, rgba(0,0,0,0.12) 0 2px, transparent 2px 20px) padding-box,
    #2e8a3f;
  padding: 6px;
  border: 4px solid #1b5d29;
  position: relative;
}
.mxi-pitch-inner {
  position: relative;
  min-height: 480px;
  background:
    radial-gradient(circle at center, transparent 60px, rgba(255,255,255,0.25) 62px, transparent 64px),
    repeating-linear-gradient(0deg, #2e8a3f 0 40px, #277a36 40px 80px);
  border: 3px solid #d4e8a8;
  padding: 14px 10px;
  display: flex;
  flex-direction: column-reverse;
  gap: 18px;
}
.mxi-row { display: flex; justify-content: space-around; align-items: flex-end; }

/* ---------- pixel kit (inline SVG) ---------- */
.kit {
  width: 78px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
}
.kit-svg {
  width: 60px;
  height: 56px;
  image-rendering: pixelated;
  shape-rendering: crispEdges;
}
.kit-svg .num {
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 7px;
  fill: #fff;
  text-anchor: middle;
  paint-order: stroke;
  stroke: #000;
  stroke-width: 0.6;
}

.kit .name-box {
  background: #fff;
  color: #111;
  font-size: 10px;
  letter-spacing: 1px;
  padding: 2px 4px;
  min-width: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 3px;
  border: 2px solid #000;
}
.kit .name-box .letters { flex: 1; text-align: left; white-space: nowrap; overflow: hidden; }
.kit .name-box .goals   { background: #111; color: #fff; font-size: 10px; padding: 0 3px; }
.kit.solved .name-box { background: #d4e8a8; }

/* ---------- difficulty selector ---------- */
.diff-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 160px;
  padding: 14px;
  font-family: inherit;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #fff;
  border: 3px solid #000;
  text-shadow: 1px 1px 0 #000;
  cursor: pointer;
  box-shadow: 4px 4px 0 #000;
}
.diff-btn.normal { top: 32%; background: #5a4bdf; }
.diff-btn.hard   { top: 62%; background: #e85a6e; }
.diff-btn:active { box-shadow: 1px 1px 0 #000; transform: translate(-50%, 2px); }

.mxi-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #d4ff00;
  font-weight: 700;
  padding: 10px 4px;
  letter-spacing: 1px;
}
.mxi-nav-link { color: #d4ff00; text-decoration: none; font-size: 14px; }
.mxi-nav-num  { color: #888; font-size: 13px; }

/* ---------- footer (progress + give up) ---------- */
.mxi-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px;
  margin-top: 6px;
}
.mxi-progress {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 2px;
}
.mxi-giveup {
  background: #e85a6e;
  color: #fff;
  border: 3px solid #000;
  box-shadow: 3px 3px 0 #000;
  padding: 8px 16px;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
}

/* ---------- wordle view ---------- */
.mxi-back {
  background: none;
  border: none;
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 14px;
  letter-spacing: 2px;
  cursor: pointer;
}
.mxi-wordle-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  padding: 10px 4px;
}
.mxi-wordle-row { display: flex; gap: 6px; }
.mxi-wordle-cell {
  width: 42px;
  height: 42px;
  border: 2px solid #3d3a62;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: #1d1a3e;
  transition: background 0.2s;
}
.mxi-wordle-cell.filled { border-color: #7d7ab5; }
.mxi-wordle-cell.correct { background: #4caf50; border-color: #4caf50; }
.mxi-wordle-cell.present { background: #e5b436; border-color: #e5b436; }
.mxi-wordle-cell.absent  { background: #4a4762; border-color: #4a4762; }

.mxi-keyboard {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: center;
  padding: 10px 4px;
}
.mxi-kbd-row { display: flex; gap: 4px; }
.mxi-kbd-key {
  min-width: 28px;
  height: 42px;
  padding: 0 6px;
  background: #4d4a6b;
  color: #fff;
  border: 2px solid #2d2a4c;
  font-family: inherit;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.mxi-kbd-key.wide { min-width: 54px; font-size: 12px; }
.mxi-kbd-key.correct { background: #4caf50; }
.mxi-kbd-key.present { background: #e5b436; }
.mxi-kbd-key.absent  { background: #2d2a4c; color: #888; }

/* ---------- end result ---------- */
#mxi-result:not(:empty) { margin: 14px 0; padding: 14px; background: #201c4a; text-align: center; }
