@font-face {
  font-family: "CruyffSansCondensed";
  src: url("fonts/CruyffSansCondensed-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "CruyffSansCondensed";
  src: url("fonts/CruyffSansCondensed-Medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

/* Более жирные начертания пока маппим на Medium — Bold/Black не нашлись в открытых источниках */
@font-face {
  font-family: "CruyffSansCondensed";
  src: url("fonts/CruyffSansCondensed-Medium.woff2") format("woff2");
  font-weight: 600 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #0a0e14;
  --bg-soft: #121822;
  --panel: #182231;
  --panel-2: #1f2c3e;
  --line: #2a3a52;
  --text: #eaf1fb;
  --muted: #8aa0bd;
  --accent: #14e08e;
  --accent-2: #12b6ff;
  --gold: #f5d15b;
  --danger: #ff5d6c;
  --radius: 16px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --font: "CruyffSansCondensed", "Montserrat", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #070b10;
  color: var(--text);
  font-family: var(--font);
  height: 100%;
  min-height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

body {
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  position: relative;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: rgba(10, 14, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  flex-shrink: 0;
}
.brand { font-weight: 900; font-size: 20px; letter-spacing: 1px; }
.brand-foot { color: var(--text); }
.brand-draft {
  color: var(--accent);
  margin-left: 2px;
}

/* Screens */
#app {
  flex: 1;
  min-height: 0;
  margin: 0;
  padding: 0;
  width: 100%;
}
.game {
  position: relative;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #111c2b;
}
.screen { display: none; animation: fade 0.35s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.screen-title { font-size: 26px; font-weight: 800; margin: 6px 0 4px; }
.screen-sub { color: var(--muted); margin: 0 0 20px; }

/* Hero */
.hero { text-align: center; padding: 48px 12px; }
.hero-title {
  font-size: clamp(32px, 8vw, 56px);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 14px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub { color: var(--muted); max-width: 520px; margin: 0 auto 28px; font-weight: 600; }
.hero-stats { display: flex; justify-content: center; gap: 26px; margin-top: 32px; color: var(--muted); font-size: 13px; }
.hero-stats b { display: block; color: var(--text); font-size: 22px; font-weight: 800; }

/* Buttons */
.btn {
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.2s ease, opacity 0.2s;
  color: #04120b;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: linear-gradient(90deg, var(--accent), #2ff0a4); box-shadow: 0 8px 24px rgba(20, 224, 142, 0.35); }
.btn-lg { padding: 16px 40px; font-size: 17px; }

/* Formation grid */
.formation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.formation-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.formation-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: var(--shadow); }
.formation-card .fc-name { font-size: 22px; font-weight: 900; letter-spacing: 1px; text-align: center; }
.formation-mini {
  position: relative;
  height: 100px;
  border-radius: 10px;
  background-size: cover;
  background-position: 0;
  background-repeat: no-repeat;
  background-image: url('/img/field-bg.jpeg');
  overflow: hidden;
  mix-blend-mode: lighten;
}
.mini-dot {
  position: absolute;
  width: 9px; height: 9px;
  margin: -4.5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px rgba(20, 224, 142, 0.6);
}

/* Draft head */
.draft-head { margin-bottom: 14px; }
.draft-progress { display: flex; align-items: center; gap: 12px; }
.draft-formation-name { font-weight: 900; font-size: 18px; letter-spacing: 1px; min-width: 72px; }
.progress-track { flex: 1; height: 8px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width 0.4s ease; }
.draft-counter { color: var(--muted); font-size: 13px; font-weight: 700; min-width: 48px; text-align: right; }

/* HUD — компактный оверлей поверх поля */
.hud {
  position: relative;
  width: 20%;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: start;
  gap: 16px;
  padding: 16px;
  background: rgba(8, 12, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  backdrop-filter: blur(10px);
  pointer-events: none;
}
.hud > * { pointer-events: auto; }
.hud-metrics { display: flex; gap: 14px; margin-left: auto; }
.hud-metric { display: flex; flex-direction: column; align-items: center; line-height: 1; }
.hud-metric span { font-size: 18px; font-weight: 900; color: var(--gold); }
.hud-metric small { font-size: 9px; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-top: 2px; letter-spacing: 0.5px; }
.btn-sm { padding: 8px 14px; font-size: 12px; }


.pitch-perspective {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  perspective: 420px;
  perspective-origin: 28% 88%;
}
.pitch-formation {
  position: absolute;
  left: 20%;
  bottom: 19%;
  z-index: 4;
  margin: 0;
  padding: 0;
  color: rgba(236, 242, 248, 0.38);
  font-weight: 800;
  font-style: normal;
  font-size: clamp(22px, 4vw, 40px);
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  transform-origin: left bottom;
  transform: rotateX(20deg);
  transform-style: preserve-3d;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}
.pitch-formation:empty { display: none; }

/* Pitch — почти весь экран */
.pitch-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
}
.pitch{
  position: relative;
  width: 70%;
  height: 85vh;
  max-width: none;
  aspect-ratio: unset;
  background: url("img/new_field_bg.webp") center / cover no-repeat;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}
.pitch::after{
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  display: block;
  background: linear-gradient(to left, rgba(17, 28, 43, 1) 0%, rgba(17, 28, 43, 0) 20%, rgba(17, 28, 43, 0) 80%, rgba(17, 28, 43, 1) 100%);
}
.pitch::before{
  content: "";
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 7;
  display: block;
  background: linear-gradient(to top, rgba(17, 28, 43, 1) 0%, rgba(17, 28, 43, 0) 20%, rgba(17, 28, 43, 0) 80%, rgba(17, 28, 43, 1) 100%);
}
.game::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 120px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to top, rgba(5, 8, 12, 0.75), transparent);
  opacity: 1;
  transition: opacity 0.3s;
}
.game.tray-open::after { opacity: 0.35; }

/* Pitch slot */
.slot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  cursor: pointer;
  z-index: 10;
}
.slot-bubble {
  width: clamp(68px, 12vmin, 100px);
  aspect-ratio: 504 / 699;
  height: auto;
  border: none;
  border-radius: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 800; color: rgba(255, 255, 255, 0.85);
  background: url("img/placeholder-card.webp") center / contain no-repeat;
  transition: all 0.2s;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45));
}
.slot.active .slot-bubble {
  filter: drop-shadow(0 0 8px rgba(245, 209, 91, 0.7));
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { transform: scale(1);} 50% { transform: scale(1.08);} }
.slot-pos { font-size: 10px; font-weight: 800; color: rgba(255, 255, 255, 0.9); position: relative; line-height: 1; margin-top: -3px; }
.slot-pos::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 70px;
  height: 40px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -55%) scale(0.5);
  border: 1px solid rgba(255, 255, 255, 0.5);
  opacity: 0.5;
  transition: all 0.2s;
  z-index: -1;
}
.slot .card {
  width: clamp(72px, 12vmin, 108px);
  filter: drop-shadow(0 5px 9px rgba(0,0,0,0.55));
}
.captain-row { justify-content: center; }

/* Запас / резерв — полускрытый трей снизу */
.squad-tray {
  --tray-peek: 78px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  max-height: min(42vh, 320px);
  background: linear-gradient(180deg, rgba(14, 20, 30, 0.92), rgba(8, 12, 18, 0.96));
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
  border-radius: 18px 18px 0 0;
  transform: translateY(calc(100% - var(--tray-peek)));
  transition: transform 0.34s cubic-bezier(0.2, 0.85, 0.25, 1);
  touch-action: pan-y;
  padding-bottom: env(safe-area-inset-bottom, 0);
  overflow: hidden;
  will-change: transform;
}
.squad-tray.is-open {
  transform: translateY(0);
}
.squad-tray-handle {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  margin: 0;
  padding: 10px 16px 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
  touch-action: none;
}
.squad-tray-grip {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}
.squad-tray-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: rgba(234, 241, 251, 0.72);
}
.squad-tray-dot { opacity: 0.45; }
.squad-tray-body {
  flex: 1;
  min-height: 0;
  overflow-x: auto;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 12px 12px;
}
.bench-block {
  margin: 0;
  min-width: 0;
}
.bench-label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.bench {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(48px, 1fr);
  gap: 6px;
  padding: 6px 4px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.bench-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
  cursor: pointer;
}
.bench-slot .slot-bubble { width: 44px; font-size: 12px; }
.bench-slot.active .slot-bubble {
  filter: drop-shadow(0 0 6px rgba(245, 209, 91, 0.7));
}
.bench-slot .card { width: 50px; filter: drop-shadow(0 4px 7px rgba(0,0,0,0.5)); }
.bench-slot .slot-pos { font-size: 9px; color: var(--muted); }

@media (min-width: 720px) {
  .squad-tray-body {
    flex-direction: row;
    align-items: flex-end;
    gap: 18px;
  }
  .bench-block { flex: 1; }
  .squad-tray { --tray-peek: 88px; max-height: min(38vh, 280px); }
}

/* Drag & drop */
.dnd [data-slot] {
  touch-action: none;
  cursor: grab;
}
.dnd [data-slot]:active { cursor: grabbing; }
.dnd .slot:not(.filled),
.dnd .bench-slot:not(.filled) {
  cursor: pointer;
  touch-action: manipulation;
}
.dnd img,
.card img,
.drag-ghost img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
body.is-dragging,
body.is-dragging * {
  cursor: grabbing !important;
  user-select: none !important;
}
.dnd [data-slot].drag-source { opacity: 0.25; }
.dnd [data-zone][data-idx].drop-target .card,
.dnd [data-zone][data-idx].drop-target .slot-bubble {
  outline: 2px solid var(--accent-2);
  outline-offset: 2px;
  filter: drop-shadow(0 0 10px rgba(18, 182, 255, 0.55));
}
/* Специфичность выше .card { position:relative }, иначе ghost
   оказывается в потоке body и раздувает страницу чёрной областью */
.card.drag-ghost {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%) scale(1.12);
  filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.65));
  will-change: left, top, transform, opacity;
  margin: 0;
  max-width: none;
  width: auto;
  cursor: grabbing;
}
.card.drag-ghost:hover {
  transform: translate(-50%, -50%) scale(1.12);
}

/* Picker (bottom candidate sheet) */
.picker {
  margin-top: 18px;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
}
.picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.picker-title { font-weight: 800; font-size: 15px; }
.candidate-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(120px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scroll-snap-type: x mandatory;
}
.candidate-row.loading { min-height: 190px; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* Player card — оформление под EA FC */
.card {
  position: relative;
  container-type: inline-size;
  aspect-ratio: 504 / 699;
  width: 100%;
  max-width: 150px;
  margin-inline: auto;
  cursor: pointer;
  transition: transform 0.15s;
}
.card:hover { transform: translateY(-4px); }

.pick {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}
.pick .card { margin-inline: 0; }
.pick:hover .card { transform: translateY(-4px); }
.pick-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 22px;
}
.pick-badge {
  width: 20px;
  height: 20px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}
.pick-badge--empty {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.card-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transform: scale(1.15); z-index: 0; }
.card-bg.fallback {
  border-radius: 9% 9% 7% 7%;
  background: linear-gradient(160deg, #ffe9a8, #f0cd76 45%, #d9ad4b 78%, #c69a3a);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.card.rare-icon .card-bg.fallback {
  background: linear-gradient(160deg, #fff8e6, #ece3cd 50%, #ccc1a4);
}

.card-face {
  position: absolute; bottom: -6%; left: 50%;
  width: 115%; transform: translateX(-50%);
  pointer-events: none; z-index: 1;
}
/* Квадратные лица (определяется по naturalWidth/Height) */
.card-face.img-face-squere {
  width: 70%;
  bottom: 35%;
  left: 60%;
  transform: translateX(-50%);
}
.card-face.placeholder {
  top: 13%; width: 44cqw; height: 44cqw; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.28); color: #fff; font-weight: 900; font-size: 15cqw;
}

.card-badges {
  position: absolute; top: 18%; left: 12%; z-index: 2;
  display: flex; flex-direction: column; align-items: center; line-height: 1;
  color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}
.card-rating { font-size: 18cqw; font-weight: 600; line-height: 1; }
.card-pos { font-size: 9cqw; font-weight: 800; margin-top: 0; letter-spacing: 0.3px; }

.card-name {
  position: absolute; bottom: 23%; left: 6%; right: 6%; z-index: 2;
  text-align: center; color: #fff; font-weight: 800;
  font-size: 13cqw; letter-spacing: 0.3px; text-shadow: 0 1px 3px rgba(0, 0, 0, 1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-stats {
  position: absolute; bottom: 9%; left: 8%; right: 8%; z-index: 2;
  display: grid; grid-template-columns: repeat(6, 1fr);
  color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}
.card-stats > div { display: flex; flex-direction: column-reverse; align-items: center; line-height: 1; }
.card-stats b { font-size: 10cqw; font-weight: 900; margin-top: 1cqw; }
.card-stats span { font-size: 7cqw; font-weight: 700; }

/* Цвет текста по стилю карточки */
.card--gold {
  --card-ink: #452d19;
}
.card--legend {
  --card-ink: #5f5532;
}
.card--gold .card-badges,
.card--gold .card-name,
.card--gold .card-stats,
.card--legend .card-badges,
.card--legend .card-name,
.card--legend .card-stats {
  color: var(--card-ink);
  text-shadow: none;
}

/* Компактный вариант на поле/скамейке — тот же фон-шаблон, что при выборе */
.card--mini .card-stats,
.card--mini .card-pos { display: none; }
.card--mini .card-bg {
  object-fit: contain;
  transform: scale(1.15);
  z-index: 0;
}
.card--mini .card-face {
  top: unset;
  bottom: -11%;
  left: 52%;
  width: 122%;
  height: auto;
  transform: translateX(-50%);
  z-index: 1;
}
.card--mini .card-face.img-face-squere {
  width: 62%;
  bottom: 28%;
  left: 50%;
  transform: translateX(-50%);
}
.card--mini .card-face.placeholder {
  top: 18%;
  bottom: unset;
  width: 44cqw;
  height: 44cqw;
  font-size: 15cqw;
}
.card--mini .card-badges {
  top: 18%;
  left: 12%;
  z-index: 2;
  gap: 1cqw;
}
.card--mini .card-rating { font-size: 18cqw; }
.card--mini .card-nation {
  width: 14cqw;
  height: auto;
  object-fit: contain;
  display: block;
  border: 1px solid #fff;
  object-fit: contain;
}
.card--mini .card-nation--empty {
  width: 9cqw;
  height: 9cqw;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.22);
}
.card--mini .card-name {
  bottom: 15%;
  left: 8%;
  right: 8%;
  font-size: 14cqw;
  font-weight: 800;
  letter-spacing: 0.2px;
  line-height: 1;
  z-index: 2;
}

/* Капитан + сыгранность (3 ромба) */
.pc-captain {
  position: absolute; top: 20%; right: -3%; z-index: 3;
  width: 26cqw; height: 18cqw; max-width: 16px; max-height: 16px;
  background: #fff; color: #2a1e05;
  font-size: 13cqw; font-weight: 900; border: 1px solid rgba(0, 0, 0, 0.4);
  display: flex; align-items: center; justify-content: center;
}
.pc-chem {
  position: absolute;
  bottom: 2%;
  left: 4%;
  z-index: 3;
  width: 28cqw;
  height: 28cqw;
  max-width: 22px;
  max-height: 22px;
  border-radius: 50%;
  background: rgba(22, 26, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 1cqw;
  padding: 3cqw;
  box-sizing: border-box;
}
.chem-diamond {
  width: 5cqw;
  height: 5cqw;
  max-width: 4.5px;
  max-height: 4.5px;
  background: #3a414d;
  transform: rotate(45deg);
  border-radius: 0.5px;
  flex-shrink: 0;
}
.chem-diamond:nth-child(1) {
  grid-column: 1 / -1;
  grid-row: 1;
  margin-top: 3cqw;
}
.chem-diamond:nth-child(2) {
  grid-column: 1;
  grid-row: 2;
  margin-top: -10cqw;
  margin-left: 2cqw;
}
.chem-diamond:nth-child(3) {
  grid-column: 2;
  grid-row: 2;
  margin-top: -10cqw;
  margin-right: 1cqw;
}
.chem-diamond.is-on {
  background: linear-gradient(145deg, #7ef0ff, #2bb8ff);
  box-shadow: 0 0 4px rgba(46, 200, 255, 0.85);
}

.card--mini .pc-chem {
  bottom: -5%;
  left: -5%;
  width: 32cqw;
  height: 32cqw;
}
.card--mini .chem-diamond {
  width: 6.5cqw;
  height: 6.5cqw;
}

/* Modals */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(5, 8, 12, 0.74);
  backdrop-filter: blur(6px);
  animation: fade 0.25s ease;
}
.modal {
  width: 100%; max-width: 860px; max-height: 90vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--panel), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 20px;
  box-shadow: var(--shadow);
  animation: pop 0.25s ease;
}
@keyframes pop { from { transform: translateY(12px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.modal-title { font-size: 22px; font-weight: 800; margin: 0; }
.modal-sub { color: var(--muted); margin: 4px 0 0; font-size: 18px; font-weight: 400; }
.modal-close {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-2); color: var(--text);
  font-size: 18px; cursor: pointer; line-height: 1;
}
.modal-close:hover { border-color: var(--danger); color: var(--danger); }

.modal-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.modal-cards.formations { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }


@media (max-width: 620px) {
  .modal-cards { grid-template-columns: repeat(3, 1fr); }
  :root{
    --radius: 8px;
  }
  .formation-mini{
    aspect-ratio: inherit;
    height: 100px;
  }
  .formation-card .fc-name{
    font-size: 18px;
    text-align: center;
  }
  .pitch{
    background-position: 10% 10%;
    height: 50%;
  }
}
@media (max-width: 420px) {
  .modal-cards { grid-template-columns: repeat(2, 1fr); }
}
