/* ============================================================
   MST Player Card v3.0 — FIFA FC25-accurate themes
   Card logical size: 240 × 336px, scaled via --fc-s CSS var
   ============================================================ */

/* ── Card wrapper (handles scaling) ──────────────────────────────────────── */
.fut-wrap {
  display: inline-block;
  width: calc(240px * var(--fc-s, 1));
  height: calc(336px * var(--fc-s, 1));
  flex-shrink: 0;
}

/* ── Card base ──────────────────────────────────────────────────────────── */
.fut-card {
  position: relative;
  width: 240px;
  height: 336px;
  transform-origin: top left;
  transform: scale(var(--fc-s, 1));
  border-radius: 4px;
  overflow: hidden;
  /* FIFA shield shape */
  clip-path: path('M 16,0 L 224,0 L 240,16 L 240,292 C 240,314 173,336 120,336 C 67,336 0,314 0,292 L 0,16 Z');
  user-select: none;
  transition: transform .2s, filter .2s;
  cursor: default;
}

.fut-card:hover {
  filter: brightness(1.08) saturate(1.1);
}

/* ── Frame SVG (positioned over card) ───────────────────────────────────── */
.fut-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

/* ── Background layer ───────────────────────────────────────────────────── */
.fut-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.fut-sheen {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

/* ── Top info (OVR/POS/flag/badge) ──────────────────────────────────────── */
.fut-top {
  position: absolute;
  top: 12px;
  left: 14px;
  z-index: 5;
}
.fut-tl {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.fut-ovr {
  font-size: 50px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: -2px;
  font-family: 'Anton', 'Impact', sans-serif;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.fut-pos {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1;
  margin-top: 1px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.fut-flag-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
}
.fut-flag {
  font-size: 18px;
  line-height: 1;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}
.fut-badge {
  width: 24px;
  height: 24px;
  object-fit: contain;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* ── Photo area ─────────────────────────────────────────────────────────── */
.fut-photo-area {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 220px;
  z-index: 3;
  overflow: hidden;
}
.fut-photo {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  height: 100%;
  max-width: 200%;
  object-fit: contain;
  object-position: bottom center;
}

/* ── Bottom section ─────────────────────────────────────────────────────── */
.fut-btm {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 122px;
  z-index: 6;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 10px;
  backdrop-filter: blur(2px);
}

.fut-name {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 1.5px;
  text-align: center;
  line-height: 1;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
  font-family: 'Oswald', 'Anton', 'Impact', sans-serif;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.fut-stats {
  display: flex;
  justify-content: center;
  gap: 0;
  width: 100%;
  padding: 0 10px;
}
.fut-stat {
  flex: 1;
  text-align: center;
  border-right: 1px solid rgba(255,255,255,0.08);
  padding: 2px 0;
}
.fut-stat:last-child { border-right: none; }

.fut-sv {
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  font-family: 'Oswald', 'Anton', 'Impact', sans-serif;
  text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.fut-sk {
  font-size: 7px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  margin-top: 1px;
}

.fut-brand-tag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  opacity: 0.5;
  margin-top: 4px;
}

/* ── Edit button ────────────────────────────────────────────────────────── */
.fut-edit {
  position: absolute;
  top: 6px;
  right: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.8);
  font-size: 11px;
  padding: 3px 7px;
  border-radius: 4px;
  cursor: pointer;
  z-index: 10;
  transition: background .15s;
}
.fut-edit:hover { background: rgba(255,255,255,0.28); }

/* ═══════════════════════════════════════════════════════
   THEME: MST (dark navy/green — our brand)
   ═══════════════════════════════════════════════════════ */
.fut-card--mst .fut-bg {
  background:
    radial-gradient(ellipse 180% 100% at 70% 10%, rgba(40,100,200,0.5) 0%, transparent 55%),
    radial-gradient(ellipse 120% 80% at 15% 80%,  rgba(20,100,70,0.4)  0%, transparent 50%),
    linear-gradient(170deg, #0d1428 0%, #0c1a2a 50%, #091520 100%);
}
.fut-card--mst .fut-sheen {
  background:
    linear-gradient(135deg,
      rgba(74,163,255,0.08) 0%,
      rgba(74,163,255,0.0)  40%,
      rgba(74,163,255,0.05) 70%,
      rgba(74,163,255,0.0)  100%);
}

/* ═══════════════════════════════════════════════════════
   THEME: Gold Rare
   ═══════════════════════════════════════════════════════ */
.fut-card--gold .fut-bg {
  background:
    radial-gradient(ellipse 80% 60% at 62% 35%, rgba(255,250,210,0.7) 0%, transparent 60%),
    conic-gradient(from 270deg at 62% 33%,
      #b87e08 0deg, #d8a830 8deg, #b87e08 16deg, #d8a830 24deg, #b87e08 32deg,
      #d8a830 40deg, #b87e08 48deg, #d8a830 56deg, #b87e08 64deg, #d8a830 72deg,
      #b87e08 80deg, #d8a830 88deg, #b87e08 96deg, #d8a830 104deg, #b87e08 112deg,
      #d8a830 120deg, #b87e08 128deg, #d8a830 136deg, #b87e08 144deg, #d8a830 152deg,
      #b87e08 160deg, #d8a830 168deg, #b87e08 176deg, #d8a830 184deg, #b87e08 192deg,
      #d8a830 200deg, #b87e08 208deg, #d8a830 216deg, #b87e08 224deg, #d8a830 232deg,
      #b87e08 240deg, #d8a830 248deg, #b87e08 256deg, #d8a830 264deg, #b87e08 272deg,
      #d8a830 280deg, #b87e08 288deg, #d8a830 296deg, #b87e08 304deg, #d8a830 312deg,
      #b87e08 320deg, #d8a830 328deg, #b87e08 336deg, #d8a830 344deg, #b87e08 352deg,
      #d8a830 360deg
    ),
    linear-gradient(160deg, #c8940c, #a87010, #c8940c);
}
.fut-card--gold .fut-sheen {
  background: linear-gradient(125deg, rgba(255,255,220,0.25) 0%, transparent 50%, rgba(200,148,12,0.1) 100%);
}

/* ═══════════════════════════════════════════════════════
   THEME: Silver Rare
   ═══════════════════════════════════════════════════════ */
.fut-card--silver .fut-bg {
  background:
    radial-gradient(ellipse 75% 55% at 60% 30%, rgba(255,255,255,0.5) 0%, transparent 60%),
    conic-gradient(from 270deg at 60% 30%,
      #909aa0 0deg, #c0c8d0 8deg, #909aa0 16deg, #c0c8d0 24deg, #909aa0 32deg,
      #c0c8d0 40deg, #909aa0 48deg, #c0c8d0 56deg, #909aa0 64deg, #c0c8d0 72deg,
      #909aa0 80deg, #c0c8d0 88deg, #909aa0 96deg, #c0c8d0 104deg, #909aa0 112deg,
      #c0c8d0 120deg, #909aa0 128deg, #c0c8d0 136deg, #909aa0 144deg, #c0c8d0 152deg,
      #909aa0 160deg, #c0c8d0 168deg, #909aa0 176deg, #c0c8d0 184deg, #909aa0 192deg,
      #c0c8d0 200deg, #909aa0 208deg, #c0c8d0 216deg, #909aa0 224deg, #c0c8d0 232deg,
      #909aa0 240deg, #c0c8d0 248deg, #909aa0 256deg, #c0c8d0 264deg, #909aa0 272deg,
      #c0c8d0 280deg, #909aa0 288deg, #c0c8d0 296deg, #909aa0 304deg, #c0c8d0 312deg,
      #909aa0 320deg, #c0c8d0 328deg, #909aa0 336deg, #c0c8d0 344deg, #909aa0 360deg
    ),
    linear-gradient(160deg, #b0b8c0, #909aa4, #b0b8c0);
}
.fut-card--silver .fut-sheen {
  background: linear-gradient(125deg, rgba(255,255,255,0.3) 0%, transparent 50%);
}

/* ═══════════════════════════════════════════════════════
   THEME: Bronze Rare
   ═══════════════════════════════════════════════════════ */
.fut-card--bronze .fut-bg {
  background:
    radial-gradient(ellipse 75% 55% at 60% 32%, rgba(255,220,180,0.55) 0%, transparent 60%),
    conic-gradient(from 270deg at 60% 30%,
      #a05820 0deg, #d08040 8deg, #a05820 16deg, #d08040 24deg, #a05820 32deg,
      #d08040 40deg, #a05820 48deg, #d08040 56deg, #a05820 64deg, #d08040 72deg,
      #a05820 80deg, #d08040 88deg, #a05820 96deg, #d08040 104deg, #a05820 112deg,
      #d08040 120deg, #a05820 128deg, #d08040 136deg, #a05820 144deg, #d08040 152deg,
      #a05820 160deg, #d08040 168deg, #a05820 176deg, #d08040 184deg, #a05820 192deg,
      #d08040 200deg, #a05820 208deg, #d08040 216deg, #a05820 224deg, #d08040 232deg,
      #a05820 240deg, #d08040 248deg, #a05820 256deg, #d08040 264deg, #a05820 272deg,
      #d08040 280deg, #a05820 288deg, #d08040 296deg, #a05820 304deg, #d08040 312deg,
      #a05820 320deg, #d08040 328deg, #a05820 336deg, #d08040 344deg, #a05820 360deg
    ),
    linear-gradient(160deg, #c07030, #904a10, #c07030);
}
.fut-card--bronze .fut-sheen {
  background: linear-gradient(125deg, rgba(255,200,150,0.25) 0%, transparent 50%);
}

/* ═══════════════════════════════════════════════════════
   THEME: TOTW (Team of the Week — black/gold)
   ═══════════════════════════════════════════════════════ */
.fut-card--totw .fut-bg {
  background:
    radial-gradient(ellipse 60% 45% at 70% 25%, rgba(200,152,16,0.25) 0%, transparent 60%),
    radial-gradient(ellipse 30% 30% at 30% 70%, rgba(100,70,0,0.2)    0%, transparent 50%),
    linear-gradient(160deg, #0a0a0e, #101010, #0a0a08);
}
.fut-card--totw .fut-sheen {
  background: linear-gradient(120deg, rgba(244,196,48,0.07) 0%, transparent 40%);
}

/* ═══════════════════════════════════════════════════════
   THEME: Champions League (UCL RTTK style — deep blue)
   ═══════════════════════════════════════════════════════ */
.fut-card--champions .fut-bg {
  background:
    radial-gradient(ellipse 70% 55% at 55% 40%, rgba(0,80,220,0.4)   0%, transparent 65%),
    radial-gradient(ellipse 40% 30% at 80% 15%, rgba(0,180,255,0.15) 0%, transparent 50%),
    linear-gradient(160deg, #040818, #060d28, #04101e);
}
.fut-card--champions .fut-sheen {
  background:
    radial-gradient(ellipse 60% 50% at 50% 45%,
      rgba(0,80,255,0.12) 0%, transparent 70%),
    linear-gradient(130deg, rgba(0,120,255,0.08) 0%, transparent 50%);
}

/* ═══════════════════════════════════════════════════════
   THEME: Icon (premium cream/bronze)
   ═══════════════════════════════════════════════════════ */
.fut-card--icon .fut-bg {
  background:
    radial-gradient(ellipse 75% 60% at 60% 30%, rgba(255,240,180,0.5) 0%, transparent 60%),
    linear-gradient(160deg, #2c2010, #ded0a0 50%, #c0a050 75%, #90600a 100%);
}
.fut-card--icon .fut-sheen {
  background: linear-gradient(130deg,
    rgba(255,245,200,0.3) 0%, transparent 40%,
    rgba(180,140,40,0.1) 70%, transparent 100%);
}

/* ── Theme swatch previews (for pickers) ────────────────────────────────── */
.mst-theme-swatch {
  width: 50px; height: 70px; border-radius: 6px;
  display: inline-block;
  box-shadow: 0 3px 10px rgba(0,0,0,0.4);
  clip-path: path('M 3,0 L 47,0 L 50,3 L 50,62 C 50,67 26,70 25,70 C 24,70 0,67 0,62 L 0,3 Z');
}
.mst-theme-swatch.s-mst       { background: linear-gradient(160deg,#0d1428,#0c1a2a); }
.mst-theme-swatch.s-gold      { background: linear-gradient(160deg,#c8940c,#f0c840); }
.mst-theme-swatch.s-silver    { background: linear-gradient(160deg,#909aa0,#d0d8e0); }
.mst-theme-swatch.s-bronze    { background: linear-gradient(160deg,#a05820,#d08040); }
.mst-theme-swatch.s-totw      { background: linear-gradient(160deg,#0a0a0e,#101010); }
.mst-theme-swatch.s-champions { background: linear-gradient(160deg,#040818,#0620a0); }
.mst-theme-swatch.s-icon      { background: linear-gradient(160deg,#2c2010,#c0a050); }

/* ── FUTBIN-style badges on card ─────────────────────────── */
.fut-badges-row {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
  margin-bottom: 1px;
}
.fut-xbadge {
  font-size: calc(8px * var(--fc-s, 1));
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.3px;
  line-height: 1.3;
}
