/**
 * Man of the Match banner compose + list UI (modern season UI).
 * Canvas base: 768 × 1024 (banner asset). Positions use % for easy debug tweaks.
 */

/* —— Compose canvas —— */
.mom-banner {
  --mom-w: 768px;
  --mom-h: 1024px;
  position: relative;
  width: var(--mom-w);
  height: var(--mom-h);
  max-width: 100%;
  aspect-ratio: 768 / 1024;
  overflow: hidden;
  background: #fff;
  color: #0a2a6b;
  font-family: "Arial Narrow", "Helvetica Neue Condensed", Arial, sans-serif;
  user-select: none;
}

.mom-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  pointer-events: none;
}

.mom-banner__layer {
  position: absolute;
  z-index: 2;
}

/* Player name bar — between >> << on template (768×1024 canvas) */
.mom-banner__name {
  left: 5.2%;
  top: 44.4%;
  width: 40.2%;
  height: 4.4%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  /* Clear decorative chevrons on both sides of the bar */
  padding: 0 11%;
  /* Base size for short names; JS shrinks for long names before html2canvas */
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0a2a6b;
  line-height: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: clip;
}

.mom-banner__name-text {
  display: inline-block;
  max-width: 100%;
  white-space: nowrap;
  line-height: 1;
}

/* Season / group meta under name / near VS — unused (logos + name only on banner) */
.mom-banner__meta {
  display: none;
}

/* Team logos in shield slots */
.mom-banner__home-logo,
.mom-banner__away-logo {
  top: 51.5%;
  width: 10.5%;
  height: 9.5%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mom-banner__home-logo {
  left: 6.5%;
}

.mom-banner__away-logo {
  left: 34%;
}

/* Player action photo in right frame */
.mom-banner__photo {
  left: 51.5%;
  top: 22.5%;
  width: 45%;
  height: 40%;
  border-radius: 6%;
  overflow: hidden;
  /* Avoid flex + object-fit: html2canvas stretches those. */
  display: block;
}

.mom-banner__photo img {
  position: absolute;
  display: block;
  max-width: none;
  max-height: none;
  /* Sized in JS (cover crop) so debug + html2canvas match. */
  width: 100%;
  height: auto;
  top: 0;
  left: 0;
}

.mom-banner__home-logo img,
.mom-banner__away-logo img {
  max-width: 88%;
  max-height: 88%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* Offscreen render host */
.mom-banner-host {
  position: fixed;
  left: -10000px;
  top: 0;
  width: 768px;
  height: 1024px;
  pointer-events: none;
  opacity: 1;
  z-index: -1;
}

/* —— Modal row MoM controls —— */
.ctm__col--award-kind,
.ctm__col--match {
  margin-top: 8px;
}

.ctm__award-kind,
.ctm__match-select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 10px;
  padding: 0 12px;
  background: #fff;
  font: inherit;
  color: #0f172a;
}

.ctm__match-select:disabled {
  opacity: 0.55;
}

.ctm__row[data-award-kind="mom"] .ctm__col--award {
  opacity: 0.85;
}

.ctm__expert-hint {
  margin-top: 8px;
  font-size: 12px;
  color: #b45309;
}

/* —— List MoM cards —— */
.ctm-component--modern .ctm-card--mom,
.ctm-card--mom {
  grid-column: span 1;
}

.ctm-component--modern .ctm-card--mom .ctm-card__stage,
.ctm-card--mom .ctm-card__stage {
  position: relative;
  height: auto !important;
  min-height: 0;
  aspect-ratio: 3 / 4;
  padding: 0;
  overflow: hidden;
  background: #0b1220;
  display: block;
  align-items: stretch;
  justify-content: stretch;
}

.ctm-component--modern .ctm-card--mom .ctm-card__trophy,
.ctm-component--modern .ctm-card--mom .ctm-card__mom-img,
.ctm-card--mom .ctm-card__trophy,
.ctm-card--mom .ctm-card__mom-img {
  position: absolute !important;
  inset: 0;
  z-index: 1;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center top;
  display: block;
  filter: none !important;
  transform: none !important;
}

.ctm-component--modern .ctm-card--mom:hover .ctm-card__trophy,
.ctm-component--modern .ctm-card--mom:hover .ctm-card__mom-img {
  transform: none !important;
}

.ctm-card__mom-actions {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(8, 15, 30, 0.45);
  opacity: 0;
  transition: opacity 0.18s ease;
  z-index: 3;
  pointer-events: none;
}

.ctm-card--mom:hover .ctm-card__mom-actions,
.ctm-card--mom:focus-within .ctm-card__mom-actions {
  opacity: 1;
}

.ctm-card__mom-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  background: #fff;
  color: #0b1220;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.ctm-card__mom-btn:hover {
  background: #e8eefc;
}

.ctm-card__mom-btn--share {
  background: #0a2a6b;
  color: #fff;
}

.ctm-card__mom-btn--share:hover {
  background: #123a8a;
}

.ctm-card--mom .ctm-card__badge {
  z-index: 4;
}

.ctm-card--mom .ctm-card__body {
  display: none;
}

/* League aggregate list: show competition name under MoM banner. */
.aleagues-competition-trophies .ctm-card--mom .ctm-card__body--mom-meta {
  display: block;
  padding-top: 0.65rem;
}

.aleagues-competition-trophies .ctm-card--mom .ctm-card__body--mom-meta .ctm-card__recipient-name {
  font-size: 12px;
  opacity: 0.72;
}

/* Preview modal */
.mom-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 100050;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 12, 24, 0.78);
}

.mom-preview-modal.is-open {
  display: flex;
}

.mom-preview-modal__dialog {
  position: relative;
  max-width: min(92vw, 520px);
  width: auto;
  max-height: 80vh;
}

.mom-preview-modal__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  max-height: 80vh;

}

.mom-preview-modal__close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #0b1220;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.mom-preview-modal__close:hover {
  background: #f0f4ff;
}

/* Overlay actions on banner white space (bottom-right) */
.mom-preview-modal__actions,
.mom-share__actions {
  position: absolute;
  right: 3.8%;
  bottom: -6.4%;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  pointer-events: none;
}

.mom-preview-modal__actions[hidden],
.mom-share__actions[hidden] {
  display: none;
}

.mom-preview-modal__action,
.mom-share__action {
  pointer-events: auto;
  border: 0;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  line-height: 1.2;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  white-space: nowrap;
}

.mom-preview-modal__action--share,
.mom-share__action--share {
  background: #0a2a6b;
  color: #fff;
}

.mom-preview-modal__action--share:hover,
.mom-share__action--share:hover {
  background: #123a8a;
}

.mom-preview-modal__action--copy,
.mom-share__action--copy {
  background: #fff;
  color: #0a2a6b;
  border: 1px solid rgba(10, 42, 107, 0.18);
}

.mom-preview-modal__action--copy:hover,
.mom-share__action--copy:hover {
  background: #e8eefc;
}

.mom-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100060;
  background: #0b1220;
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.mom-toast.is-visible {
  opacity: 1;
}
