
#card-container {
  margin-top: 25px;
  margin-right: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  user-select: text;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: clip;
  touch-action: auto;
}

#card-container:has(#loading-screen) {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
}

#loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  text-align: center;
}
.card {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 300px;
  overflow: hidden;
}

.card img {
  max-width: 80%;
  height: auto;
  object-fit: contain;
  display: block;
  pointer-events: none;
  z-index: 0;
}

.overall {
  font-family: cruyffMedium;
  font-size: 40px;
  position: absolute;
  top: 40px;
  left: 52px;
  padding: 6px 12px;
  border-radius: 6px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 10;
}

.position {
  font-family: cruyffMedium;
  font-size: 18px;
  position: absolute;
  top: 80px;
  right: 69px;
  text-align: center;
  width: 100%;
  padding: 6px 12px;
  border-radius: 6px;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}

.altposition {
  font-family: cruyffRegular;
  opacity: 100%;
  letter-spacing: 0.8px;
  font-size: 10px;
  display: grid;
  grid-template-rows: repeat(3, auto);
  row-gap: 4px;
  position: absolute;
  top: 104px;
  left: 22px;
  text-align: left;
  padding: 6px 12px;
  border-radius: 6px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  z-index: 10;
}

.stats {
  position: absolute;
  bottom: 57px;
  right: 0px;
  display: grid;
  grid-template-columns: repeat(6, auto);
  text-align: center;
  padding: 0px 64px;
  gap: 9px;
  z-index: 2;
}

.player-name {
  font-family: cruyffSansMedium;
  z-index: 2;
  position: absolute;
  bottom: 84px;
  text-align: center;
  font-size: 20px;
  letter-spacing: 0.4px;
}

.stat-label {
  font-family: cruyffMedium;
  font-size: 14px;
  word-spacing: 6px;
}

.stat-value {
  font-family: cruyffMedium;
  font-weight: 100;
  margin-top: 1px;
  font-size: 20px;
  line-height: 0.6;
}

.badges {
  position: absolute;
  bottom: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  z-index: 2;
}

.badges .badge {
  width: auto;
  height: 18px;
  object-fit: contain;
  pointer-events: none;
}

.badges .flag {
  height: 14px;
  width: auto;
  object-fit: contain;
}

.badges .league,
.badges .club {
  height: 24px;
  width: 24px;
  object-fit: contain;
}

.face-image {
  Width: 30px;
  Height: auto;
  Object-Fit: cover;
  Border-Radius: 6px;
}

/* Normal mode (also applies inside the social post canvas and the card detail page, which live outside #card-container) */
#card-container .player-face,
#detail-card-slot .player-face:not(.normal-face),
.post-canvas-root .player-face:not(.normal-face) {
  display: block;
  position: absolute;
  top: 30px;
  right: 60px;
  height: 155px;
  width: auto;
  max-width: none;
  object-fit: contain;
  pointer-events: none;
  z-index: 1; /* above the card design (0), below all text/badges (2+) */
}

/* Small card mode */
#card-container.small-card-mode .player-face {
  top: 14px;
  right: 12px;
  height: 86px;
  z-index: 1; /* above the card design, below text in small mode too */
}

.normal-face {
  position: absolute;
  top: -25px;
  right: 31px;
  height: 200px;
  width: auto;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.fatals {
  position: absolute;
  top: 60px;
  right: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  width: auto;
  height: auto;
  font-size: 14px;
}

.fatal-bg {
  width: 35%;
  max-width: 50px;
  height: auto;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;
}

.fatal-value-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  z-index: 2;
}

.fatal-value {
  font-family: robotoSemiBold;
  font-size: 1em;
  color: #ffffff;
  text-align: center;
}

.fatal-meta-badge {
  position: absolute;
  bottom: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #e8000d, #ff6a00);
  color: #fff;
  border-radius: 6px;
  padding: 2px 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  z-index: 10;
  min-width: 30px;
  line-height: 1;
  pointer-events: none;
}

.fatal-meta-label {
  font-size: 6px;
  font-weight: 700;
  letter-spacing: 0.5px;
  opacity: 0.85;
  text-transform: uppercase;
  font-family: robotoSemiBold;
}

.fatal-meta-value {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.5px;
  font-family: robotoSemiBold;
}

/* ============================================================
   FCM BREAKDOWN
   ============================================================ */

.card-and-breakdown {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.fcm-breakdown {
  width: 100%;
  background: var(--bg-grey);
  border-radius: 6px;
  padding: 6px 8px;
  margin-top: 4px;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 11px;
  color: var(--muted);
}

.fcm-breakdown-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--dark);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 5px;
}

.fcm-tier-chip {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  padding: 1px 6px;
  border-radius: 3px;
  letter-spacing: 0.4px;
}

.fcm-section-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--icon-grey);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 5px 0 2px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.fcm-scale-note {
  font-size: 9px;
  font-weight: 400;
  color: var(--icon-grey);
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.7;
}

.fcm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.fcm-row:last-of-type {
  border-bottom: none;
}

.fcm-label {
  color: var(--mid);
}

.fcm-val {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fcm-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 5px;
  padding-top: 4px;
  border-top: 1px solid rgba(0,0,0,0.12);
  font-weight: 700;
  color: var(--dark);
  font-size: 11px;
}

.alt-positions {
  position: absolute;
  top: 110px;
  left: 34px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}

.alt-pos {
  background-color: var(--alt-badge-bg, rgba(87, 87, 87, 0.8));
  color: var(--alt-badge-text, #fff);
  padding: 2px 0;
  width: 35px;
  height: 20px;
  border: 1px solid var(--alt-badge-border, rgba(255, 255, 255, 0.5));
  border-radius: 4px;
  font-family: robotoSemiBold;
  font-size: 12px;
  text-align: center;
  box-sizing: border-box;
}

.specialChem,
.totwNumber {
  z-index: 2;
  color: rgb(104, 104, 104);
  position: absolute;
  bottom: 2px;
  left: 145px;
  right: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0px;
  font-family: robotoSemiBold;
  font-weight: bold;
}

.untradable-badge {
  position: absolute;
  top: 8px;
  right: 250px;
  width: 25px;
  height: 25px;
  object-fit: contain;
  z-index: 9;
}

.picks-badge {
  position: absolute;
  top: 8px;
  right: 200px;
  width: 25px;
  height: 25px;
  object-fit: contain;
  z-index: 9;
}

.tokens-badge {
  position: absolute;
  top: 8px;
  right: 225px;
  width: 25px;
  height: 25px;
  object-fit: contain;
  z-index: 9;
}

.card-wrapper {
  position: relative;
  transition: transform ease 0.3s;
  overflow: visible;
  width: fit-content;
  margin: 0 auto;
  touch-action: auto;
}

.download-btn {
  position: absolute;
  top: 5px;
  right: 30px;
  width: 25px;
  height: 25px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(8.9px);
  -webkit-backdrop-filter: blur(8.9px);
  border: 1px solid rgba(155, 155, 155, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s ease;
}

.download-btn:hover {
  background: rgba(83, 255, 163, 0.5);
}

.download-btn svg {
  width: 12px;
  height: 12px;
  fill: #000000;
}

.download-face-btn {
  position: absolute;
  top: 5px;
  right: 60px;
  width: 25px;
  height: 25px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  backdrop-filter: blur(8.9px);
  -webkit-backdrop-filter: blur(8.9px);
  border: 1px solid rgba(155, 155, 155, 0.3);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s ease;
}

.download-face-btn svg {
  width: 12px;
  height: 12px;
  fill: #000000;
}

.download-face-btn:hover {
  background: rgba(165, 207, 255, 0.9);
}

/* Card Link */
.card-link {
  text-decoration: none;
  color: inherit;
  display: block;
  outline: none;
}

.card-link:focus .card-wrapper,
.card-link:hover .card-wrapper {
  filter: brightness(1.05);
}

/* Generations specific styles */
.generations-container {
  margin-top: 50px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 12px;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.generations-title {
  font-family: 'robotoBold', sans-serif;
  font-size: 1.8rem;
  margin-bottom: 25px;
  color: #1a1a1a;
  text-align: center;
}

.generations-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.gen-card-item {
  width: 200px;
  height: 210px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.2s;
}

.gen-card-header {
  font-family: 'cruyffEx', sans-serif;
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.gen-card-item:hover {
  transform: scale(1.0);
}

.gen-card-item .card-wrapper {
  transform: scale(0.6);
  width: 300px;
  margin-bottom: -150px;
  transform-origin: top center;
}

@media screen and (max-width: 900px) {
  .generations-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    gap: 0px !important;
    padding: 0 !important;
    justify-items: center;
  }

  .generations-year-title {
    display: block !important;
    margin: 15px 0 5px !important;
  }

  .gen-card-item {
    width: 250px !important;
    height: 230px !important;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
  }

  .gen-card-item .card-wrapper {
    transform: scale(0.84) !important;
    margin-bottom: -100px !important;
    margin-top: 5px !important;
  }

  .generations-container {
    padding: 5px !important;
    margin-top: 10px !important;
  }
}

  @media (max-width: 768px) {
#card-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)) !important;
  gap: 4px 0;
  justify-content: center;
  justify-items: center;
  overflow-x: hidden;
  overflow-y: clip;
  width: 100%;
  box-sizing: border-box;
}
.card {
  transform: scale(0.5);
  transform-origin: top center;
  margin-bottom: -150px;
}

#card-container .card-and-breakdown {
  width: 150px;
  position: relative;
  overflow: visible;
}

#card-container .card-wrapper {
  width: 150px;
  overflow: visible;
  position: relative;
}

#card-container .card-wrapper {
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#card-container .card-wrapper .card {
  position: relative;
  left: auto;
  margin-left: 0;
  flex-shrink: 0;
}


/* Poster canvas cards must always render at full desktop size,
   regardless of the mobile shrink rule above */
.post-canvas-root .card {
  transform: none !important;
  margin-bottom: 0 !important;
}

      .download-btn,
      .download-face-btn {
        width: 40px !important;
        height: 40px !important;
        top: 0 !important;
        /* Adjust if needed */
      }

      .download-btn svg,
      .download-face-btn svg {
        width: 20px !important;
        height: 20px !important;
      }

      .download-btn {
        right: 5px !important;
        /* Flipped: card on right */
      }

      /* Space them out */
      .download-face-btn {
        right: 45px !important;
        /* Flipped: face on left */
      }
    }









/* Evo chain list never shows on small cards */
#card-container.small-card-mode .evo-chain-list {
  display: none !important;
}

.card-menu-wrap {
  position: absolute;
  top: 8px;
  right: 2px;
  z-index: 50;
}

/* Lift the card whose menu is open above every other card's 3-dot button */
.card-menu-wrap:has(.card-menu-dropdown.open) {
  z-index: 1000;
}

  #card-container:not(.small-card-mode) .card-menu-wrap {
    right: 40px; /* was 2px */
  }

@media (max-width: 768px) {
  #card-container .card-menu-wrap {
    position: absolute;
    top: 8px;
    left: auto;
    right: 17px;
    transform: none;
  }

    #card-container:not(.small-card-mode) .card-menu-wrap {
    right: 22px; /* was 2px */
  }

  #card-container .card-three-dots {
    width: 20px;
    height: 20px;
    font-size: 15px;
  }

  /* Menu: bigger than before, but sized to fit. Positioning (left/right flip)
     comes from the base .card-menu-dropdown rules. */
  #card-container .card-menu-dropdown {
    min-width: 170px;
    max-width: calc(100vw - 32px);
    border-radius: 10px;
  }

  #card-container .card-menu-dropdown .card-menu-item {
    padding: 11px 14px;
    font-size: 14px;
  }

  /* Keep the open menu above other cards' buttons */
  #card-container .card-menu-wrap:has(.card-menu-dropdown.open) {
    z-index: 1000;
  }
}

.card-three-dots {
  background: var(--bg-light);
  border: 1px solid var(--bg-grey);
  color: var(--dark);
  font-size: 20px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 20;
  transition: background 0.15s;
  font-family: "Roboto", sans-serif;
}

.card-three-dots:hover {
  background: var(--bg-grey);
}

.card-menu-dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 0;
  right: 100%;
  margin-right: 6px;
  background: var(--bg-light);
  border: 1px solid var(--bg-grey);
  border-radius: 8px;
  overflow: hidden;
  min-width: 155px;
  max-width: min(155px, calc(100vw - 16px));
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  z-index: 500;
}

.card-menu-dropdown.flip-right {
  right: auto;
  left: 100%;
  margin-right: 0;
  margin-left: 6px;
}

.card-menu-dropdown.open { display: flex; }

.card-menu-item {
  padding: 7px 12px;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 12px;
  color: var(--mid);
  text-decoration: none;
  background: none;
  border: none;
  border-bottom: 1px solid var(--bg-grey);
  text-align: left;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}

.card-menu-item:last-child { border-bottom: none; }

.card-menu-item:hover {
  background: var(--bg-grey);
  color: var(--dark);
}

.card-dev-panel {
  background: var(--bg-light);
  border: 1px solid var(--bg-grey);
  border-radius: 8px;
  padding: 0;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25);
  position: fixed;
  top: 3vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 92vw);
  height: 94vh;
  max-height: 94vh;
  z-index: 1000;
}

.card-dev-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.card-dev-backdrop.open {
  display: block;
}

.dev-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--bg-grey);
  position: sticky;
  top: 0;
  background: var(--bg-light);
  z-index: 2;
}

.dev-title {
  font-family: cruyffSansMedium, sans-serif;
  font-size: 12px;
  color: var(--dark);
  letter-spacing: 0.4px;
}

.dev-export-btn {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 10px;
  background: var(--dark);
  border: none;
  color: var(--white);
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.dev-export-btn:hover { opacity: 0.8; }

.dev-close {
  background: var(--bg-grey);
  border: none;
  color: var(--dark);
  font-size: 14px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.dev-close:hover { background: #cacaca; }

.dev-db-tag {
  font-family: "Roboto Condensed", sans-serif;
  font-size: 10px;
  color: var(--muted);
  padding: 4px 10px 2px;
  border-bottom: 1px solid var(--bg-grey);
}

.dev-db-tag span {
  font-family: robotoSemiBold, sans-serif;
  color: var(--dark);
}

.dev-section-label {
  font-family: "Roboto", sans-serif;
  font-size: 9px;
  font-weight: 900;
  color: var(--icon-grey);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 5px 10px 3px;
}

.dev-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.dev-key {
  font-family: robotoSemiBold, sans-serif;
  color: var(--mid);
  padding: 2px 8px 2px 10px;
  white-space: nowrap;
  vertical-align: top;
  width: 40%;
}

.dev-val {
  font-family: "Roboto Condensed", sans-serif;
  color: var(--dark);
  padding: 2px 10px 2px 0;
  word-break: break-all;
}

.dev-table tr:nth-child(even) td { background: var(--bg-grey); }

.detail-tabs-wrap {
  width: 100%;
  margin-top: 12px;
}

.detail-tabs-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.detail-tab-btn {
  padding: 6px 14px;
  border-radius: 999px;
  border: none;
  background: var(--bg-grey);
  color: var(--muted);
  font-family: "Roboto Condensed", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.detail-tab-btn:hover { background: #d4d4d4; color: var(--mid); }

.detail-tab-btn.active {
  background: var(--dark);
  color: #fff;
}

.detail-tab-content {
  background: var(--bg-light);
  border-radius: 8px;
  padding: 12px;
  font-family: "Roboto Condensed", sans-serif;
}

.detail-tab-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-tab-label {
  font-size: 12px;
  color: var(--muted);
}

.detail-tab-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.detail-tab-action-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: var(--dark);
  color: #fff;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.detail-tab-action-btn:hover { opacity: 0.85; }

.scale-pick-btn {
  width: 28px;
  height: 24px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #fff;
  color: var(--mid);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  font-family: "Roboto Condensed", sans-serif;
}

.scale-pick-btn.active {
  background: var(--dark);
  color: #fff;
  border-color: var(--dark);
}

.creator-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 2px solid var(--bg-grey);
  margin-bottom: 18px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  max-width: 100%;
}

.creator-tab-btn {
  padding: 9px 16px;
  border: none;
  background: none;
  font-family: "Roboto Condensed", sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  flex-shrink: 0;
}

.creator-tab-btn:hover { color: var(--mid); }

.creator-tab-btn.active {
  color: var(--dark);
  border-bottom-color: var(--dark);
}

/* ── Small card mode ───────────────────────────────────────── */
#card-container.small-card-mode {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

#card-container.small-card-mode .card {
  width: 120px;
}

#card-container.small-card-mode .card > img:first-child {
  max-width: 100%;
}

/* Hide elements not shown in small mode */
#card-container.small-card-mode .stats,
#card-container.small-card-mode .stats-separator,
#card-container.small-card-mode .fatal-meta-badge,
#card-container.small-card-mode .specialChem,
#card-container.small-card-mode .totwNumber,
#card-container.small-card-mode .badges .league {
  display: none !important;
}

#card-container.small-card-mode .fatals {
  position: absolute;
  top: 32px;
  right: -17px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  width: auto;
  height: auto;
  font-size: 14px;
}

#card-container.small-card-mode .fatal-bg {
  width: 40%;
  max-width: 50px;
  height: auto;
  object-fit: contain;
  z-index: 1;
  pointer-events: none;}

#card-container.small-card-mode .fatal-value-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  z-index: 2;
}

#card-container.small-card-mode .fatal-value {
  font-size: 8px;
}

/* Rating + position — tighter */
#card-container.small-card-mode .overall {
  font-size: 22px;
  top: 16px;
  left: -0.5px;
}

#card-container.small-card-mode .position {
  font-size: 10px;
  top: 38px;
  right: 38px;
}

/* Player name */
#card-container.small-card-mode .player-name {
  font-size: 11px;
  bottom: 21px;
}

/* Alt positions — default (Fatal stats OFF): badge style, top area */
#card-container.small-card-mode .alt-positions {
  position: absolute;
  top: 35px;
  left: 98px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 10;
}

#card-container.small-card-mode .alt-pos {
  font-size: 7px;
  width: 22px;
  height: 13px;
  padding: 1px 0;
}

/* Alt positions — Fatal stats ON: plain text under player name, dimmed */
#card-container.small-card-mode.fatal-on .alt-positions {
  top: auto;
  left: 0;
  right: 0;
  bottom: 14px;
  flex-direction: row;
  justify-content: center;
  gap: 4px;
}

#card-container.small-card-mode.fatal-on .alt-pos {
  font-family: cruyffSansMedium;
  background: none !important;
  border: none !important;
  color: var(--alt-name-color, #fff) !important;
  width: auto;
  height: auto;
  padding: 0;
  font-size: 7px;
  opacity: 0.55;
}

/* Nation + club badges — left-aligned, no league */
#card-container.small-card-mode .badges {
  bottom: 10px;
  justify-content: flex-start;
  padding-left: 10px;
  gap: 5px;
}

/* Container for badges */
#card-container.small-card-mode .badges {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* Allows clicks to pass through if needed */
}

/* Move and size the Nation Flag independently */
#card-container.small-card-mode .badges .flag {
  position: absolute;
  top: 56px;          /* Adjust vertical position */
  left: 11.5px;         /* Adjust horizontal position */
  /* bottom: 10px; */  /* Use bottom instead of top if preferred */
  height: 12px;
  width: auto;
}

/* Move and size the Club Badge independently */
#card-container.small-card-mode .badges .club {
  position: absolute;
  top: 71px;          /* Adjust vertical position */
  left: 11.5px;         /* Adjust horizontal position */
  /* bottom: 10px; */  /* Use bottom instead of top if preferred */
  height: 20px;
  width: auto;
}


/* Face image — scaled for small card */
#card-container.small-card-mode .player-face {
  top: 14px;
  right: 12px;
  height: 86px;
}

#card-container.small-card-mode .normal-face {
  top: -6px;  
  left: 60px; 
  transform: translateX(-50%) scale(1); 
  height: 132px !important; 
  width: auto;
  max-width: none;         
}

@media (max-width: 768px) {
  #card-container.small-card-mode {
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)) !important;
    gap: 4px 0 !important;
    padding: 0 8px;
    justify-items: center;
    overflow-x: hidden;
    overflow-y: clip;
  }

  #card-container.small-card-mode .card-menu-wrap {
    position: absolute;
    top: 0;
    left: auto;
    right: 40px;
    transform: none;
  }

  #card-container.small-card-mode .card-and-breakdown {
    width: 159px;
    position: relative;
    overflow: visible;
  }

  #card-container.small-card-mode .card-wrapper {
    width: 159px;
    overflow: visible;
    position: relative;
  }

#card-container.small-card-mode .card-wrapper .card {
  position: relative;
  left: auto;
  margin-left: 0;
  flex-shrink: 0;
  transform: scale(0.53) !important;
  transform-origin: top center;
  margin-bottom: -65px !important;
  max-width: none;
}
}