/* ══════════════════════════════════════════════════════════
   FootySocial v5 — Editor / Card Generator styles
   Extends: css/styles.css
   ══════════════════════════════════════════════════════════ */

/* Editor layout: fixed height, 3 columns */
body.fixed-layout .app {
  height: calc(100vh - var(--topbar-h));
}

/* ── Sidebar specific ─────────────────────────────────────── */
.sb-brand-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.sb-brand-label { font-size: 11px; color: var(--ui-text2); flex: 1; }
.sb-brand-link {
  font-size: 10px;
  color: var(--b2);
  text-decoration: none;
  font-weight: 600;
}
.sb-brand-link:hover { text-decoration: underline; }

.sb-sponsor-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--ui-text2);
}
.sb-sponsor-slot {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .5px;
  background: var(--ui-surface2);
  color: var(--ui-text3);
  padding: 1px 5px;
  border-radius: 3px;
  text-transform: uppercase;
}
.sb-sponsor-name { flex: 1; font-weight: 500; color: var(--ui-text); }

/* ── Editor header (title + actions) ─────────────────────── */
.ed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  background: var(--ui-surface);
  border-bottom: 1px solid var(--ui-border);
  flex-shrink: 0;
}
.ed-tpl-name {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .3px;
  color: var(--ui-text);
}
.ed-tpl-desc { font-size: 11px; color: var(--ui-text2); }
.ed-actions { display: flex; align-items: center; gap: 6px; }

/* Badge "💾 9:16" pokazuje format zapisany w Brand Studio */
.tpl-saved-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .4px;
  color: var(--b2);
  background: rgba(var(--b2-rgb, 201,162,39), .12);
  border: 1px solid rgba(var(--b2-rgb, 201,162,39), .25);
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  font-family: var(--font-body);
  margin-left: 6px;
}

/* ── Formation grid (Starting XI) ────────────────────────── */
.formation-grid {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

/* ── Card templates (HTML preview) ───────────────────────── */

/* Shared card root */
.pc-inner {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  font-family: var(--font-head);
  background: var(--bg-card);
}

/* ── Creative style layer ────────────────────────────────── */
.style-editor {
  border: 1px solid var(--ui-border);
  background: linear-gradient(180deg, var(--ui-surface), var(--ui-surface2));
  border-radius: 8px;
  padding: 12px;
}
.style-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.style-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 900;
  color: var(--ui-text);
  line-height: 1;
}
.style-subtitle {
  font-size: 10.5px;
  color: var(--ui-text3);
  margin-top: 3px;
  line-height: 1.25;
}
.plan-pill {
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .7px;
  text-transform: uppercase;
  color: var(--dark);
  background: var(--b2);
}
.plan-basic { background: var(--ui-border2); color: var(--ui-text2); }
.plan-pro { background: var(--b2); color: var(--dark); }
.plan-club { background: #111827; color: #fff; }
html[data-dark="1"] .plan-club { background: #fff; color: #111827; }
.style-plan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}
.plan-card {
  border: 1px solid var(--ui-border);
  background: var(--ui-surface);
  border-radius: 7px;
  min-height: 48px;
  padding: 7px 4px;
  color: var(--ui-text2);
  text-align: center;
}
.plan-card span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ui-text);
}
.plan-card small {
  display: block;
  margin-top: 1px;
  font-size: 9px;
  color: var(--ui-text3);
  text-transform: uppercase;
  letter-spacing: .4px;
}
.plan-card.active {
  border-color: var(--b2);
  background: color-mix(in srgb, var(--b2) 18%, var(--ui-surface));
}
.style-range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.style-range-row input[type=range] {
  width: 100%;
  accent-color: var(--b2);
}
.color-mini {
  max-width: 46px;
  min-width: 46px;
  padding: 3px;
}
.style-hint {
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--ui-text3);
  margin-top: 4px;
}

.fx-layer {
  position: absolute;
  inset: 0;
  z-index: 12;
  pointer-events: none;
  opacity: 1;
  overflow: hidden;
}
.fx-layer > * {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── User modules layer (Elementor-like blocks) ─────────── */
.custom-module {
  position: absolute;
  min-width: 64px;
  min-height: 34px;
  z-index: 80;
  color: var(--b1);
  font-family: var(--font-head);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.custom-module strong {
  display: block;
  color: inherit;
  font-size: 14px;
  line-height: 1.05;
}
.custom-module span {
  display: block;
  color: #171717;
  font-size: 9px;
  line-height: 1.1;
  letter-spacing: .12em;
}
.cm-text {
  color: var(--b1);
  font-size: 28px;
  line-height: .92;
}
.cm-title span {
  color: var(--b1);
  font-size: 42px;
  line-height: .9;
}
.cm-title span:nth-child(even) {
  color: var(--b2);
}
.cm-kicker {
  margin-bottom: 6px;
  color: var(--b1);
  font-size: 11px;
  letter-spacing: .45em;
}
.cm-stadium,
.cm-date,
.cm-time,
.cm-competition {
  display: grid;
  grid-template-columns: 26px auto;
  align-items: center;
  gap: 8px;
}
.cm-icon {
  width: 26px;
  height: 26px;
  border: 2px solid var(--b2);
  color: var(--b2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.cm-score {
  color: var(--b2);
  font-size: 46px;
  line-height: .9;
}
.cm-formation {
  display: inline-block;
  padding: 5px 10px;
  border: 1px solid var(--b2);
  color: var(--b2);
  font-size: 22px;
}
.cm-lineup {
  width: 210px;
  padding: 14px;
  background: var(--b1);
  color: #fff;
  box-shadow: 0 14px 35px rgba(0,0,0,.12);
}
.cm-lineup-title {
  margin-bottom: 9px;
  color: var(--b2);
  font-size: 18px;
}
.cm-lineup-row {
  border-top: 1px solid rgba(212,175,55,.45);
  padding: 7px 0;
  color: #fff;
  font-size: 14px;
}
.cm-crest {
  width: 58px;
  height: 58px;
  border: 2px solid var(--b2);
  background: #fff;
  color: var(--b1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  font-size: 19px;
}
.cm-crest img {
  max-width: 84%;
  max-height: 84%;
  object-fit: contain;
}
.cm-media {
  width: 170px;
  height: 210px;
  background: var(--b1);
  overflow: hidden;
}
.cm-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cm-media span {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.8);
}
.cm-social {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--b1);
}
.cm-social-dot {
  width: 24px;
  height: 24px;
  border: 2px solid var(--b2);
  border-radius: 50%;
  color: var(--b2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cm-gradient {
  width: 220px;
  height: 120px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--b1) 92%, #fff 8%), color-mix(in srgb, var(--b2) 85%, #fff 15%)),
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.35), transparent 34%);
  box-shadow: 0 18px 42px rgba(0,0,0,.16);
}
.cm-gradient span,
.cm-shape span,
.cm-sponsor span {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: rgba(255,255,255,.86);
  font-size: 9px;
}
.cm-shape {
  width: 170px;
  height: 100px;
  background: color-mix(in srgb, var(--b1) 90%, #000 10%);
  border: 2px solid var(--b2);
  clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
  box-shadow: 0 16px 32px rgba(0,0,0,.12);
}
.cm-big-icon {
  width: 52px;
  height: 52px;
  border: 2px solid var(--b2);
  border-radius: 50%;
  background: #fff;
  color: var(--b1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
}
.cm-divider {
  width: 220px;
  height: 6px;
  background: linear-gradient(90deg, var(--b2), transparent);
}
.cm-player {
  min-width: 180px;
  padding: 12px 14px;
  background: var(--b1);
  color: #fff;
  border-left: 5px solid var(--b2);
  box-shadow: 0 14px 35px rgba(0,0,0,.14);
}
.cm-player span {
  display: inline-block;
  margin-bottom: 7px;
  color: var(--b2);
  font-size: 24px;
  line-height: .9;
}
.cm-player strong {
  color: #fff;
  font-size: 18px;
}
.cm-player em {
  display: block;
  color: rgba(255,255,255,.72);
  font-size: 10px;
  font-style: normal;
  letter-spacing: .14em;
}
.cm-player-photo {
  width: 155px;
  height: 210px;
  background: color-mix(in srgb, var(--b1) 85%, #000 15%);
  border-bottom: 6px solid var(--b2);
  overflow: hidden;
}
.cm-player-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cm-player-photo span {
  height: 100%;
  color: rgba(255,255,255,.8);
  display: flex;
  align-items: center;
  justify-content: center;
}
.cm-stat {
  min-width: 88px;
  padding: 10px 12px;
  background: #fff;
  border: 2px solid var(--b2);
  color: var(--b1);
  text-align: center;
}
.cm-stat strong {
  color: var(--b1);
  font-size: 34px;
}
.cm-stat span {
  color: var(--b1);
  font-size: 10px;
}
.cm-sponsor {
  width: 170px;
  height: 54px;
  border: 1px solid rgba(255,255,255,.42);
  background: rgba(255,255,255,.14);
  backdrop-filter: blur(8px);
}
.cm-hashtag {
  color: var(--b2);
  font-size: 22px;
}
.fx-pattern {
  opacity: var(--fx-alpha);
  transform: rotate(var(--fx-rotate)) scale(1.18);
  transform-origin: center;
}
.fx-grain {
  opacity: var(--fx-grain);
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.75) 0 1px, transparent 1.4px),
    radial-gradient(circle at 65% 35%, rgba(0,0,0,.5) 0 1px, transparent 1.5px),
    radial-gradient(circle at 45% 75%, rgba(255,255,255,.45) 0 1px, transparent 1.3px);
  background-size: 17px 19px, 23px 29px, 31px 37px;
}
.fx-pattern-none .fx-pattern { background: none; }
.fx-pattern-diagonal .fx-pattern {
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--fx-density) * .55), var(--fx-color) calc(var(--fx-density) * .55) var(--fx-density));
}
.fx-pattern-hoops .fx-pattern {
  background: repeating-linear-gradient(0deg, transparent 0 calc(var(--fx-density) * .7), var(--fx-color) calc(var(--fx-density) * .7) var(--fx-density));
}
.fx-pattern-dots .fx-pattern {
  background-image: radial-gradient(circle, var(--fx-color) 0 2px, transparent 2.5px);
  background-size: var(--fx-density) var(--fx-density);
}
.fx-pattern-pinstripe .fx-pattern {
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--fx-density) * .82), var(--fx-color) calc(var(--fx-density) * .82) calc(var(--fx-density) * .9), transparent calc(var(--fx-density) * .9) var(--fx-density));
}
.fx-pattern-checker .fx-pattern {
  background-image:
    linear-gradient(45deg, var(--fx-color) 25%, transparent 25% 75%, var(--fx-color) 75%),
    linear-gradient(45deg, var(--fx-color) 25%, transparent 25% 75%, var(--fx-color) 75%);
  background-position: 0 0, calc(var(--fx-density) / 2) calc(var(--fx-density) / 2);
  background-size: var(--fx-density) var(--fx-density);
}
.fx-pattern-speed .fx-pattern {
  background:
    linear-gradient(100deg, transparent 0 18%, var(--fx-color) 18% 20%, transparent 20% 37%, var(--fx-color) 37% 39%, transparent 39%),
    repeating-linear-gradient(90deg, transparent 0 calc(var(--fx-density) * .8), var(--fx-color) calc(var(--fx-density) * .8) calc(var(--fx-density) * .9), transparent calc(var(--fx-density) * .9) var(--fx-density));
}
.fx-pattern-camo .fx-pattern {
  background:
    radial-gradient(ellipse at 18% 25%, var(--fx-color) 0 9%, transparent 10%),
    radial-gradient(ellipse at 72% 20%, var(--fx-color) 0 7%, transparent 8%),
    radial-gradient(ellipse at 42% 62%, var(--fx-color) 0 12%, transparent 13%),
    radial-gradient(ellipse at 80% 78%, var(--fx-color) 0 10%, transparent 11%);
  filter: blur(.4px);
}
.fx-pattern-topo .fx-pattern {
  background:
    radial-gradient(ellipse at 30% 35%, transparent 0 16%, var(--fx-color) 16.5% 17.3%, transparent 18% 24%, var(--fx-color) 24.5% 25.3%, transparent 26%),
    radial-gradient(ellipse at 78% 66%, transparent 0 14%, var(--fx-color) 14.5% 15.3%, transparent 16% 24%, var(--fx-color) 24.5% 25.3%, transparent 26%);
}
.fx-pattern-waves .fx-pattern {
  background:
    radial-gradient(ellipse at 10% 42%, transparent 0 30%, var(--fx-color) 30.5% 32%, transparent 32.5%),
    radial-gradient(ellipse at 55% 58%, transparent 0 28%, var(--fx-color) 28.5% 30%, transparent 30.5%),
    radial-gradient(ellipse at 95% 36%, transparent 0 26%, var(--fx-color) 26.5% 28%, transparent 28.5%);
  background-size: calc(var(--fx-density) * 5) calc(var(--fx-density) * 3);
}
.fx-pattern-halftone .fx-pattern {
  background-image: radial-gradient(circle, var(--fx-color) 0 18%, transparent 19%);
  background-size: var(--fx-density) var(--fx-density);
  background-position: 0 0;
}
.fx-pattern-tactical .fx-pattern {
  background:
    linear-gradient(rgba(255,255,255,.34) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.34) 1px, transparent 1px),
    radial-gradient(circle at center, transparent 0 15%, var(--fx-color) 15.5% 16.5%, transparent 17%),
    linear-gradient(90deg, transparent 0 49.5%, var(--fx-color) 49.5% 50.5%, transparent 50.5%);
  background-size: calc(var(--fx-density) * 1.6) calc(var(--fx-density) * 1.6), calc(var(--fx-density) * 1.6) calc(var(--fx-density) * 1.6), 100% 100%, 100% 100%;
}
.fx-pattern-mesh .fx-pattern {
  background-image:
    linear-gradient(30deg, var(--fx-color) 1px, transparent 1px),
    linear-gradient(150deg, var(--fx-color) 1px, transparent 1px);
  background-size: var(--fx-density) var(--fx-density);
}
.fx-pattern-shards .fx-pattern {
  background:
    linear-gradient(120deg, transparent 0 22%, var(--fx-color) 22% 23%, transparent 23% 100%),
    linear-gradient(35deg, transparent 0 47%, var(--fx-color) 47% 48.5%, transparent 48.5% 100%),
    linear-gradient(155deg, transparent 0 62%, var(--fx-color) 62% 63.5%, transparent 63.5% 100%);
}
.fx-pattern-carbon .fx-pattern {
  background:
    repeating-linear-gradient(45deg, var(--fx-color) 0 2px, transparent 2px 8px),
    repeating-linear-gradient(135deg, var(--fx-color) 0 2px, transparent 2px 8px);
  background-size: var(--fx-density) var(--fx-density);
}
.fx-pattern-glitch .fx-pattern {
  background:
    linear-gradient(90deg, transparent 0 8%, var(--fx-color) 8% 10%, transparent 10% 31%, var(--fx-color) 31% 33%, transparent 33%),
    linear-gradient(0deg, transparent 0 18%, var(--fx-color) 18% 19%, transparent 19% 46%, var(--fx-color) 46% 48%, transparent 48% 100%);
  background-size: 100% calc(var(--fx-density) * 1.8), calc(var(--fx-density) * 4) 100%;
}
.fx-shape {
  inset: auto;
  left: var(--fx-shape-x);
  top: var(--fx-shape-y);
  width: var(--fx-shape-size);
  height: var(--fx-shape-size);
  transform: translate(-50%, -50%) rotate(var(--fx-shape-rotate)) scaleX(var(--fx-shape-stretch));
  transform-origin: center;
  opacity: calc(var(--fx-alpha) * .9);
}
.fx-shape-slash .fx-shape {
  background: linear-gradient(115deg, transparent 0 57%, var(--fx-color) 57.5% 70%, transparent 70.5%);
}
.fx-shape-rings .fx-shape {
  background:
    radial-gradient(circle at 82% 22%, transparent 0 12%, var(--fx-color) 12.5% 14%, transparent 14.5%),
    radial-gradient(circle at 16% 78%, transparent 0 16%, var(--fx-color) 16.5% 18%, transparent 18.5%);
}
.fx-shape-bolt .fx-shape {
  clip-path: polygon(62% 0, 90% 0, 66% 38%, 86% 38%, 42% 100%, 54% 55%, 35% 55%);
  background: var(--fx-color);
}
.fx-shape-blobs .fx-shape {
  background:
    radial-gradient(ellipse at 12% 18%, var(--fx-color) 0 18%, transparent 19%),
    radial-gradient(ellipse at 86% 76%, var(--fx-color) 0 22%, transparent 23%);
  filter: blur(1px);
}
.fx-shape-sash .fx-shape {
  background: linear-gradient(130deg, transparent 0 40%, var(--fx-color) 40.5% 52%, transparent 52.5%);
}
.fx-shape-spotlight .fx-shape {
  background: radial-gradient(ellipse at 50% 42%, var(--fx-color) 0 18%, transparent 42%);
}
.fx-shape-chevron .fx-shape {
  background:
    linear-gradient(135deg, transparent 0 43%, var(--fx-color) 43.5% 46%, transparent 46.5%),
    linear-gradient(225deg, transparent 0 43%, var(--fx-color) 43.5% 46%, transparent 46.5%);
}
.fx-shape-panels .fx-shape {
  background:
    linear-gradient(90deg, var(--fx-color) 0 18%, transparent 18.5% 82%, var(--fx-color) 82.5%),
    linear-gradient(0deg, transparent 0 74%, var(--fx-color) 74.5% 86%, transparent 86.5%);
}
.fx-shape-triangles .fx-shape {
  background:
    linear-gradient(135deg, var(--fx-color) 0 18%, transparent 18.5%),
    linear-gradient(315deg, var(--fx-color) 0 16%, transparent 16.5%);
}
.fx-shape-crest .fx-shape {
  background: radial-gradient(ellipse at center, transparent 0 14%, var(--fx-color) 14.5% 16%, transparent 16.5% 30%, var(--fx-color) 30.5% 32%, transparent 32.5%);
}
.fx-frame {
  opacity: calc(var(--fx-alpha) + .18);
}
.fx-frame-thin .fx-frame {
  inset: 4%;
  border: 1.5px solid var(--fx-color);
}
.fx-frame-corner .fx-frame {
  inset: 4%;
  background:
    linear-gradient(var(--fx-color), var(--fx-color)) left top / 18% 2px no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) left top / 2px 18% no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) right top / 18% 2px no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) right top / 2px 18% no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) left bottom / 18% 2px no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) left bottom / 2px 18% no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) right bottom / 18% 2px no-repeat,
    linear-gradient(var(--fx-color), var(--fx-color)) right bottom / 2px 18% no-repeat;
}
.fx-frame-double .fx-frame {
  inset: 4%;
  border: 1.5px solid var(--fx-color);
  box-shadow: inset 0 0 0 7px rgba(255,255,255,.12), inset 0 0 0 9px var(--fx-color);
}
.fx-frame-poster .fx-frame {
  border: 10px solid var(--fx-color);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.65), inset 0 0 80px rgba(0,0,0,.25);
}

/* ── Editable geometry layer ─────────────────────────────── */
.geo-layer {
  position: absolute;
  inset: 0;
  z-index: 11;
  pointer-events: none;
  overflow: hidden;
}
.geo-el {
  position: absolute;
  pointer-events: none;
  background: var(--geo-color);
  transform-origin: center;
}
.geo-stripe {
  clip-path: polygon(24% 0, 100% 0, 76% 100%, 0 100%);
}
.geo-rectangle {
  border-radius: 2px;
}
.geo-circle {
  border-radius: 999px;
  background: radial-gradient(circle, transparent 0 38%, var(--geo-color) 39% 43%, transparent 44% 100%);
}
.geo-polygon {
  clip-path: polygon(50% 0, 100% 34%, 82% 100%, 16% 82%, 0 24%);
}
.geo-gradient {
  background: linear-gradient(115deg, transparent 0, var(--geo-color) 48%, transparent 100%);
}
.geo-grid {
  background-image:
    linear-gradient(var(--geo-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--geo-color) 1px, transparent 1px);
  background-size: var(--geo-density) var(--geo-density);
}
.geo-wave {
  background:
    radial-gradient(ellipse at 0% 50%, transparent 0 42%, var(--geo-color) 43% 46%, transparent 47%),
    radial-gradient(ellipse at 50% 50%, transparent 0 42%, var(--geo-color) 43% 46%, transparent 47%),
    radial-gradient(ellipse at 100% 50%, transparent 0 42%, var(--geo-color) 43% 46%, transparent 47%);
  background-size: calc(var(--geo-density) * 4) 100%;
}
.geo-corner {
  clip-path: polygon(100% 0, 100% 100%, 0 0);
}

/* Card footer sponsor bar */
.pc-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 10%;
  background: var(--dark);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 5%;
  gap: 4%;
  z-index: 25;
}

.pc-sponsor {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  overflow: hidden;
}
.pc-sponsor img {
  max-height: 40%;
  max-width: 90%;
  object-fit: contain;
  filter: brightness(0) invert(1);
  opacity: .85;
}
.pc-sponsor-text {
  font-family: var(--font-head);
  font-size: 2%;
  font-weight: 700;
  color: rgba(255,255,255,.6);
  letter-spacing: .5px;
}

/* ── Matchday template ───────────────────────────────────── */
.md-card {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 33% 31%, rgba(26,74,46,.08) 0 13%, transparent 14% 100%),
    radial-gradient(circle at 40% 49%, rgba(201,162,39,.07) 0 18%, transparent 19% 100%),
    linear-gradient(90deg, #f3f0e9 0 69%, #eeeae2 69% 100%);
  color: var(--b1);
}
.md-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .23;
  background-image:
    linear-gradient(0deg, rgba(0,0,0,.035) 1px, transparent 1px),
    radial-gradient(circle at 12% 18%, rgba(255,255,255,.8), transparent 18%),
    radial-gradient(circle at 80% 30%, rgba(0,0,0,.08), transparent 20%);
  background-size: 100% 7px, 100% 100%, 100% 100%;
  mix-blend-mode: multiply;
}
.md-bg-word {
  position: absolute;
  right: -7.5%;
  top: 2%;
  height: 78%;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 86px;
  line-height: .8;
  font-weight: 900;
  letter-spacing: 2px;
  color: transparent;
  -webkit-text-stroke: 1px rgba(26,74,46,.18);
  text-stroke: 1px rgba(26,74,46,.18);
  z-index: 1;
}
.md-faint-mark {
  position: absolute;
  left: 24%;
  top: 25%;
  width: 34%;
  aspect-ratio: 1;
  opacity: .045;
  filter: grayscale(1);
  z-index: 1;
}
.md-top {
  position: absolute;
  left: 4.7%;
  top: 3.6%;
  right: 49%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  z-index: 5;
}
.md-seasonline {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 3.1%;
  min-width: 49%;
  color: var(--b1);
}
.md-seasonline span,
.md-seasonline small {
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 5px;
  text-transform: uppercase;
  white-space: nowrap;
}
.md-seasonline small {
  font-size: 10px;
  letter-spacing: 2px;
  color: rgba(26,74,46,.6);
}
.md-seasonline i,
.md-seasonline::after {
  content: "";
  display: block;
  width: 82px;
  height: 1px;
  background: var(--b2);
}
.md-copy {
  position: absolute;
  left: 4.7%;
  top: 26%;
  width: 44%;
  z-index: 6;
}
.md-copy h1 {
  margin: 0;
  font-size: 56px;
  font-weight: 900;
  line-height: .91;
  letter-spacing: 0;
  text-transform: uppercase;
}
.md-copy h1 span,
.md-copy h1 strong {
  display: block;
}
.md-copy h1 span { color: var(--b1); }
.md-copy h1 strong { color: var(--b2); }
.md-subtitle {
  margin-top: 2.2%;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 11px;
  color: var(--b1);
}
.md-gold-rule {
  width: 42px;
  height: 3px;
  background: var(--b2);
  margin-top: 4.6%;
}
.md-versus {
  display: flex;
  align-items: center;
  gap: 5%;
  margin-top: 5.8%;
}
.md-crest {
  width: 14.5%;
  aspect-ratio: 1;
  border-radius: 5px;
  border: 2px solid var(--b2);
  background: var(--b1);
  color: #f8f4eb;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 8px 24px rgba(26,74,46,.1);
}
.md-crest.primary {
  width: 26%;
}
.md-crest.home,
.md-crest.away {
  width: 20%;
}
.md-crest.ghost {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.md-crest img {
  width: 88%;
  height: 88%;
  object-fit: contain;
}
.md-crest span {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 2px;
}
.md-crest.primary span,
.md-crest.home span,
.md-crest.away span {
  font-size: 16px;
}
.md-vs-stack {
  display: grid;
  gap: 5px;
  place-items: center;
  min-width: 11%;
  color: var(--b1);
}
.md-vs-stack strong {
  font-size: 20px;
  font-weight: 900;
  font-style: italic;
}
.md-vs-stack em {
  display: block;
  width: 20px;
  height: 1px;
  background: var(--b2);
  transform: rotate(-62deg);
}
.md-dot-grid {
  width: 72px;
  height: 44px;
  margin-top: 5.7%;
  background-image: radial-gradient(circle, var(--b2) 1.3px, transparent 1.6px);
  background-size: 12px 12px;
  opacity: .9;
}
.md-info {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  width: 94%;
  margin-top: 3.2%;
}
.md-info-item {
  min-width: 0;
  padding: 0 8%;
  text-align: center;
  border-right: 1px solid var(--b2);
}
.md-info-item:first-child { padding-left: 0; }
.md-info-item:last-child {
  border-right: 0;
  padding-right: 0;
}
.md-info-icon {
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--b2);
  font-size: 20px;
  font-weight: 900;
}
.md-info-item strong {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  color: var(--b1);
  text-transform: uppercase;
}
.md-info-item span {
  display: block;
  margin-top: 5px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1.15;
  color: #171717;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.md-player-panel {
  position: absolute;
  right: 0;
  top: 0;
  width: 56%;
  height: 86%;
  overflow: hidden;
  z-index: 4;
}
.md-player-backdrop {
  position: absolute;
  left: 8%;
  top: 0;
  width: 31%;
  height: 100%;
  background: var(--b1);
  z-index: 0;
}
.md-player-panel img,
.md-player-photo {
  position: absolute;
  left: 0;
  bottom: -2%;
  width: 100%;
  height: 108%;
  object-fit: contain;
  object-position: bottom right;
  z-index: 2;
  filter: contrast(1.04) saturate(.96);
}
.md-player-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(243,240,233,0) 0 53%, rgba(243,240,233,.18) 100%);
  z-index: 3;
  pointer-events: none;
}
.md-player-placeholder {
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    linear-gradient(140deg, transparent 0 32%, rgba(201,162,39,.08) 33% 44%, transparent 45%),
    radial-gradient(circle at 62% 35%, rgba(26,74,46,.08), transparent 24%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.md-player-placeholder span {
  width: 60%;
  color: rgba(26,74,46,.18);
  font-size: 42px;
  font-weight: 900;
  text-align: center;
  line-height: .95;
  text-transform: uppercase;
}
.md-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14%;
  background:
    linear-gradient(90deg, rgba(255,255,255,.04), transparent 32%),
    var(--b1);
  color: #fff;
  z-index: 28;
  padding: 2.1% 4.5% 2.2%;
  border-top: 1px solid rgba(201,162,39,.55);
}
.mdf-label {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 2.2%;
  margin-bottom: 1.4%;
  color: #f5f1e8;
}
.mdf-label span {
  height: 1px;
  background: var(--b2);
}
.mdf-label strong {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 9px;
  white-space: nowrap;
}
.mdf-row {
  display: grid;
  grid-template-columns: 1fr 24%;
  align-items: center;
  gap: 4%;
  height: 55%;
}
.mdf-sponsors {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: center;
  gap: 5%;
  min-width: 0;
}
.mdf-sponsor {
  min-width: 0;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.mdf-sponsor img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.mdf-sponsor span {
  color: #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: .95;
  text-transform: uppercase;
  text-align: center;
}
.mdf-social {
  height: 100%;
  border-left: 1px solid rgba(201,162,39,.62);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  min-width: 0;
}
.mdf-social span {
  width: 23px;
  height: 23px;
  border: 1px solid var(--b2);
  border-radius: 50%;
  color: var(--b2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-head);
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}
.mdf-social strong {
  min-width: 0;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.md-card + .md-footer + .geo-layer,
.md-card + .md-footer + .geo-layer + .fx-layer {
  display: none;
}

/* ── Full Time template ──────────────────────────────────── */
.ft-card {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,255,255,.12), transparent 58%),
    linear-gradient(145deg, var(--b1), var(--dark));
  color: #fff;
}
.ft-match-photo {
  position: absolute;
  z-index: 1;
  top: 15%;
  left: 7%;
  right: 7%;
  height: 49%;
  overflow: hidden;
  background: var(--dark);
  border: 2px solid rgba(255,255,255,.16);
  box-shadow: 0 18px 48px rgba(0,0,0,.34);
}
.ft-match-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.ft-photo-placeholder {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.22);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
}
.ft-photo-overlay {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.12) 0 44%, rgba(0,0,0,.7) 67%, rgba(0,0,0,.93) 100%),
    linear-gradient(90deg, rgba(0,0,0,.28), transparent 30% 70%, rgba(0,0,0,.28));
}
.ft-top {
  position: relative;
  z-index: 3;
  width: 100%;
  padding: 4.5% 8% 3%;
  text-align: center;
}
.ft-kicker {
  font-size: 52px;
  line-height: .85;
  font-weight: 900;
  letter-spacing: -1px;
  text-transform: uppercase;
  text-shadow: 0 3px 14px rgba(0,0,0,.45);
}
.ft-round {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--b2);
  text-transform: uppercase;
  margin-top: 10px;
}
.ft-result-stage {
  position: absolute;
  z-index: 4;
  left: 6%;
  right: 6%;
  top: 61%;
  height: 21%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px minmax(0, 1fr);
  align-items: center;
  gap: 4%;
}
.ft-team {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}
.ft-team-crest {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,.45));
}
.ft-team-crest img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.ft-team-crest span {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.92);
  color: var(--b1);
  border: 3px solid var(--b2);
  font-size: 24px;
  font-weight: 900;
}
.ft-team-name {
  width: 100%;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ft-score-wrap {
  min-width: 126px;
  padding: 12px 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3%;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(5,14,10,.72);
  box-shadow: 0 8px 28px rgba(0,0,0,.35);
}
.ft-score {
  font-size: 58px;
  font-weight: 900;
  color: var(--b2);
  line-height: .82;
}
.ft-score-sep { font-size: 34px; font-weight: 900; color: rgba(255,255,255,.55); line-height: 1; }
.ft-scorers {
  position: absolute;
  z-index: 4;
  top: 83%;
  left: 8%;
  right: 8%;
  bottom: 10%;
  display: grid;
  align-items: start;
}
.ft-scorer-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24%; }
.ft-scorer {
  font-size: 11px;
  color: rgba(255,255,255,.8);
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.25;
}
.ft-scorer span { display: block; }
.ft-scorer.home { text-align: left; }
.ft-scorer.away { text-align: right; }
.ft-scorers-empty {
  color: rgba(255,255,255,.28);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-align: center;
}
.ft-scorer.away { color: rgba(255,255,255,.5); font-style: italic; }
.ft-caption {
  position: absolute;
  z-index: 5;
  bottom: 11%;
  left: 0;
  right: 0;
  background: var(--b2);
  padding: 2% 8%;
  font-size: 3%;
  font-weight: 700;
  color: var(--dark);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 1px;
}

html.quick-publish-renderer .ft-card + .pc-footer + .geo-layer,
html.quick-publish-renderer .ft-card + .pc-footer + .geo-layer + .fx-layer {
  display: none;
}

/* ── Transfer template ───────────────────────────────────── */
.tr-card {
  width: 100%;
  height: 100%;
  background: var(--dark);
  display: flex;
  position: relative;
  overflow: hidden;
}
.tr-diagonal {
  position: absolute;
  top: 0;
  left: 52%;
  width: 60%;
  height: 110%;
  background: var(--b1);
  transform: skewX(-8deg);
  transform-origin: top left;
  z-index: 0;
}
.tr-left {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8% 6% 15%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.tr-right {
  position: relative;
  z-index: 1;
  width: 46%;
  overflow: hidden;
}
.tr-right img {
  position: absolute;
  bottom: 0;
  right: 0;
  height: 95%;
  width: auto;
  object-fit: cover;
  object-position: top;
}
.tr-type {
  font-size: 2.5%;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 3%;
  padding: 1.5% 3%;
  display: inline-block;
  border-radius: 2%;
}
.tr-type.in { background: #16A34A; color: #fff; }
.tr-type.out { background: #DC2626; color: #fff; }
.tr-type.contract { background: var(--b2); color: var(--dark); }
.tr-fname {
  font-size: 7%;
  font-weight: 900;
  color: rgba(255,255,255,.7);
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 1%;
}
.tr-lname {
  font-size: 10%;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 3%;
}
.tr-pos {
  font-size: 3%;
  font-weight: 600;
  color: var(--b2);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4%;
}
.tr-welcome {
  font-size: 3%;
  color: rgba(255,255,255,.6);
  line-height: 1.4;
  margin-bottom: 3%;
}
.tr-hashtag { font-size: 3%; font-weight: 700; color: var(--b2); }

/* ── MVP template ────────────────────────────────────────── */
.mvp-card {
  width: 100%;
  height: 100%;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.mvp-bg-accent {
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 80%;
  background: radial-gradient(ellipse, var(--b2) 0%, transparent 70%);
  opacity: .08;
}
.mvp-photo {
  width: 38%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--b1m);
  margin-top: 7%;
  overflow: hidden;
  border: 3px solid var(--b2);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.mvp-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.mvp-star {
  font-size: 6%;
  color: var(--b2);
  position: relative;
  z-index: 1;
  margin-top: 3%;
}
.mvp-label {
  font-size: 3%;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--b2);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  margin-bottom: 1%;
}
.mvp-name {
  font-size: 8%;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  padding: 0 5%;
  position: relative;
  z-index: 1;
  margin-bottom: 4%;
}
.mvp-stats {
  display: flex;
  gap: 4%;
  position: relative;
  z-index: 1;
  margin-bottom: 4%;
}
.mvp-stat {
  text-align: center;
  background: rgba(255,255,255,.06);
  border-radius: 3%;
  padding: 3% 4%;
  min-width: 15%;
}
.mvp-stat-val { font-size: 7%; font-weight: 900; color: var(--b2); line-height: 1; }
.mvp-stat-lbl { font-size: 2.2%; font-weight: 700; color: rgba(255,255,255,.5); letter-spacing: .5px; text-transform: uppercase; margin-top: 1%; }
.mvp-sponsor-bar {
  position: absolute;
  bottom: 11%;
  left: 0;
  right: 0;
  background: rgba(255,255,255,.06);
  padding: 2% 8%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3%;
  font-size: 2.5%;
  color: rgba(255,255,255,.4);
  font-weight: 600;
}

/* ── League Table template ───────────────────────────────── */
.tab-card {
  width: 100%;
  height: 100%;
  background: var(--b1);
  display: flex;
  flex-direction: column;
  padding: 6% 6% 15%;
}
.tab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4%;
}
.tab-league { font-size: 4%; font-weight: 900; color: #fff; text-transform: uppercase; }
.tab-round { font-size: 2.8%; font-weight: 700; color: var(--b2); }
.tab-cols {
  display: flex;
  padding: 0 2%;
  margin-bottom: 2%;
  font-size: 2.2%;
  font-weight: 700;
  letter-spacing: .5px;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
}
.tab-col-team { flex: 1; }
.tab-col-p, .tab-col-w, .tab-col-d, .tab-col-l, .tab-col-pts { width: 8%; text-align: center; }
.tab-col-pts { color: var(--b2); }
.tab-row {
  display: flex;
  align-items: center;
  padding: 1.8% 2%;
  border-radius: 2%;
  margin-bottom: 1%;
  font-size: 2.8%;
  color: rgba(255,255,255,.75);
  font-weight: 600;
}
.tab-row.highlight {
  background: var(--b2);
  color: var(--dark);
}
.tab-pos { width: 6%; font-weight: 900; }
.tab-team { flex: 1; font-weight: 700; }
.tab-val { width: 8%; text-align: center; }
.tab-pts { font-weight: 900; color: var(--b2); }
.tab-row.highlight .tab-pts { color: var(--dark); }

/* ── Birthday template ───────────────────────────────────── */
.bd-card {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.bd-top-stripe {
  width: 100%;
  height: 35%;
  background: var(--b1);
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bd-photo {
  position: absolute;
  bottom: -30%;
  width: 32%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3px solid var(--bg-card);
  overflow: hidden;
  background: var(--b1m);
  z-index: 2;
}
.bd-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.bd-confetti { font-size: 8%; position: absolute; top: 20%; opacity: .4; }
.bd-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 15% 8% 15%;
  text-align: center;
  position: relative;
  z-index: 1;
}
.bd-birthday-label {
  font-size: 2.5%;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--b2);
  margin-bottom: 2%;
}
.bd-age { font-size: 10%; font-weight: 900; color: var(--b1); font-family: var(--font-head); line-height: 1; }
.bd-age-label { font-size: 3%; font-weight: 700; color: var(--ui-text2); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2%; }
.bd-name { font-size: 7%; font-weight: 900; color: var(--dark); text-transform: uppercase; line-height: 1.1; margin-bottom: 3%; }
.bd-wish { font-size: 3%; color: var(--ui-text2); font-style: italic; line-height: 1.5; }

/* ── Training template ───────────────────────────────────── */
.tr2-card {
  width: 100%;
  height: 100%;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.tr2-bg {
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255,255,255,.02) 0px,
    rgba(255,255,255,.02) 2px,
    transparent 2px,
    transparent 14px
  );
}
.tr2-top-label {
  font-size: 3%;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--b2);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  margin-bottom: 4%;
}
.tr2-icon { font-size: 12%; position: relative; z-index: 1; margin-bottom: 3%; }
.tr2-next {
  font-size: 3.5%;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  z-index: 1;
  margin-bottom: 1%;
}
.tr2-opponent {
  font-size: 10%;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  line-height: 1;
  text-align: center;
  padding: 0 6%;
  position: relative;
  z-index: 1;
  margin-bottom: 4%;
}
.tr2-days-wrap {
  display: flex;
  align-items: baseline;
  gap: 2%;
  position: relative;
  z-index: 1;
  margin-bottom: 6%;
}
.tr2-days-num { font-size: 14%; font-weight: 900; color: var(--b2); line-height: 1; }
.tr2-days-label { font-size: 4%; font-weight: 700; color: rgba(255,255,255,.6); text-transform: uppercase; }
.tr2-meta { font-size: 2.8%; color: rgba(255,255,255,.5); position: relative; z-index: 1; }

/* ── Quote template ──────────────────────────────────────── */
.qt-card {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10% 9% 15%;
  position: relative;
}
.qt-mark-open, .qt-mark-close {
  font-family: Georgia, serif;
  font-size: 20%;
  font-weight: 900;
  color: var(--b1);
  opacity: .15;
  line-height: .6;
  position: absolute;
}
.qt-mark-open { top: 8%; left: 6%; }
.qt-mark-close { bottom: 18%; right: 6%; }
.qt-stripe {
  position: absolute;
  left: 0;
  top: 20%;
  width: 4%;
  height: 25%;
  background: var(--b2);
  border-radius: 0 3px 3px 0;
}
.qt-text {
  font-size: 5%;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.55;
  text-align: center;
  position: relative;
  z-index: 1;
  margin-bottom: 6%;
}
.qt-author {
  position: relative;
  z-index: 1;
  text-align: center;
}
.qt-author-name {
  font-size: 4%;
  font-weight: 900;
  color: var(--b1);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.qt-author-role {
  font-size: 2.8%;
  color: var(--ui-text2);
  margin-top: 1%;
}

/* ── Announcement template ───────────────────────────────── */
.an-card {
  width: 100%;
  height: 100%;
  background: var(--b1);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.an-top-bar {
  height: 8%;
  background: var(--b2);
  flex-shrink: 0;
}
.an-content {
  flex: 1;
  padding: 6% 8%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.an-category {
  font-size: 2.5%;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--b2);
  text-transform: uppercase;
  margin-bottom: 4%;
}
.an-title {
  font-size: 9%;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 4%;
}
.an-body {
  font-size: 3.5%;
  color: rgba(255,255,255,.75);
  line-height: 1.6;
  margin-bottom: 5%;
}
.an-cta {
  display: inline-block;
  background: var(--b2);
  color: var(--dark);
  font-size: 3%;
  font-weight: 900;
  padding: 2.5% 5%;
  border-radius: 3%;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.an-logo-area {
  position: absolute;
  bottom: 12%;
  right: 6%;
  opacity: .15;
  font-size: 12%;
}
.an-logo-area img {
  width: 100%;
  max-width: 130px;
  height: auto;
  object-fit: contain;
}

/* ── Fan of the Week template ────────────────────────────── */
.fw-card {
  width: 100%;
  height: 100%;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.fw-bg-stripe {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 40%;
  background: var(--b1);
}
.fw-photo {
  width: 40%;
  aspect-ratio: 1;
  border-radius: 50%;
  margin-top: 8%;
  overflow: hidden;
  border: 3px solid var(--b2);
  background: var(--b1m);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.fw-photo img { width: 100%; height: 100%; object-fit: cover; }
.fw-label {
  font-size: 3%;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--b2);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  margin: 3% 0 1%;
}
.fw-name {
  font-size: 8%;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: 1.1;
  padding: 0 5%;
}
.fw-handle {
  font-size: 3%;
  color: var(--b2);
  position: relative;
  z-index: 1;
  margin: 1% 0 3%;
}
.fw-reason {
  font-size: 3%;
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 0 8%;
  line-height: 1.5;
  position: relative;
  z-index: 1;
}

/* ── Milestone template ──────────────────────────────────── */
.ms-card {
  width: 100%;
  height: 100%;
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.ms-bg-circle {
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, var(--b1) 0%, transparent 70%);
  opacity: .06;
}
.ms-photo {
  width: 28%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--b1);
  background: var(--ui-surface2);
  margin-bottom: 3%;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.ms-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.ms-number {
  font-size: 20%;
  font-weight: 900;
  color: var(--b1);
  line-height: 1;
  position: relative;
  z-index: 1;
  opacity: .15;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.ms-milestone {
  font-size: 3%;
  font-weight: 900;
  letter-spacing: 2px;
  color: var(--b2);
  text-transform: uppercase;
  margin-bottom: 1%;
  position: relative;
  z-index: 1;
}
.ms-big-num {
  font-size: 18%;
  font-weight: 900;
  color: var(--b1);
  line-height: 1;
  position: relative;
  z-index: 1;
}
.ms-name {
  font-size: 5%;
  font-weight: 900;
  color: var(--dark);
  text-transform: uppercase;
  position: relative;
  z-index: 1;
  margin: 1% 0;
}
.ms-desc {
  font-size: 3%;
  color: var(--ui-text2);
  text-align: center;
  padding: 0 8%;
  position: relative;
  z-index: 1;
  line-height: 1.5;
}

/* ── Season Preview template ─────────────────────────────── */
.sp-card {
  width: 100%;
  height: 100%;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.sp-bg-diagonal {
  position: absolute;
  top: 0;
  right: 0;
  width: 60%;
  height: 100%;
  background: var(--b1);
  clip-path: polygon(25% 0%, 100% 0%, 100% 100%, 0% 100%);
}
.sp-content {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8% 7%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sp-season-label {
  font-size: 2.8%;
  font-weight: 900;
  letter-spacing: 3px;
  color: var(--b2);
  text-transform: uppercase;
  margin-bottom: 3%;
}
.sp-headline {
  font-size: 4%;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1%;
}
.sp-motto {
  font-size: 9%;
  font-weight: 900;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.1;
  margin-bottom: 5%;
}
.sp-players {
  display: flex;
  gap: 3%;
}
.sp-player {
  text-align: center;
}
.sp-player-photo {
  width: 16%;
  aspect-ratio: 1;
  border-radius: 50%;
  overflow: hidden;
  background: var(--b1m);
  border: 2px solid var(--b2);
  margin: 0 auto 2%;
}
.sp-player-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.sp-player-name { font-size: 2.5%; color: rgba(255,255,255,.8); font-weight: 700; }

/* ── Starting XI template ────────────────────────────────── */
.xi-card {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 26% 52%, rgba(26,74,46,.08), transparent 17%),
    radial-gradient(circle at 108% 42%, rgba(26,74,46,.08), transparent 20%),
    linear-gradient(90deg, #f4f0e8 0 55%, #f8f5ee 55% 100%);
  position: relative;
  overflow: hidden;
  color: var(--b1);
}
.xi-paper-grain {
  position: absolute;
  inset: 0;
  opacity: .16;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(26,74,46,.06) 1px, transparent 1px),
    radial-gradient(circle, rgba(0,0,0,.16) 0 .7px, transparent .8px);
  background-size: 100% 4px, 18px 18px;
  mix-blend-mode: multiply;
}
.xi-brand {
  position: absolute;
  left: 4.4%;
  top: 4%;
  display: flex;
  align-items: center;
  gap: 2.1%;
  width: 44%;
  z-index: 4;
}
.xi-brand img,
.xi-brand span {
  width: 5.4%;
  aspect-ratio: 1;
  object-fit: contain;
  flex-shrink: 0;
}
.xi-brand span {
  display: block;
  border-radius: 50%;
  background: var(--b2);
}
.xi-brand strong {
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 2.8px;
  text-transform: uppercase;
}
.xi-title {
  position: absolute;
  left: 4.2%;
  top: 10.7%;
  z-index: 3;
  display: grid;
  line-height: .9;
}
.xi-title span,
.xi-title strong {
  font-size: 58px;
  font-weight: 900;
  letter-spacing: .5px;
  text-transform: uppercase;
}
.xi-title span { color: var(--b1); }
.xi-title strong { color: var(--b2); }
.xi-title em {
  margin-top: 6%;
  padding-top: 4.5%;
  border-top: 2px solid var(--b2);
  color: var(--b1);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 6px;
  font-style: normal;
}
.xi-matchup {
  position: absolute;
  left: 40.6%;
  top: 20.2%;
  width: 13%;
  display: grid;
  place-items: center;
  gap: 2.2%;
  z-index: 5;
}
.xi-matchup .md-crest {
  width: 74%;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.xi-matchup .md-crest span {
  width: 100%;
  height: 100%;
  border: 2px solid var(--b2);
  border-radius: 8px;
  background: var(--b1);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 15px;
}
.xi-vs {
  color: var(--b1);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 2px;
}
.xi-vs::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin: 9px auto 0;
  background: var(--b2);
}
.xi-photo-panel {
  position: absolute;
  left: -3%;
  bottom: 15%;
  width: 49%;
  height: 43%;
  z-index: 2;
}
.xi-photo-slab {
  position: absolute;
  inset: -8% 7% 7% 8%;
  background: var(--b1);
  transform: rotate(-13deg);
  transform-origin: center;
  opacity: .95;
}
.xi-photo-panel img {
  position: absolute;
  left: 5%;
  bottom: 0;
  width: 95%;
  height: 102%;
  object-fit: cover;
  object-position: center top;
  filter: saturate(.85) contrast(1.05);
  mix-blend-mode: multiply;
}
.xi-team-photo {
  position: absolute;
}
.xi-photo-placeholder {
  position: absolute;
  inset: 16% 10% 0 10%;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.72);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}
.xi-meta {
  position: absolute;
  left: 4.7%;
  bottom: 5.7%;
  width: 41%;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  z-index: 4;
}
.xi-meta div {
  display: grid;
  place-items: center;
  gap: 3px;
  padding: 0 7%;
  border-right: 1px solid var(--b2);
  text-align: center;
}
.xi-meta div:last-child { border-right: 0; }
.xi-meta b { color: var(--b1); font-size: 18px; }
.xi-meta strong { color: var(--b1); font-size: 13px; font-weight: 900; }
.xi-meta span {
  color: var(--b2);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}
.xi-list-panel {
  position: absolute;
  right: 3%;
  top: 3%;
  width: 42.5%;
  height: 88.5%;
  padding: 8.5% 5% 4.2%;
  background:
    radial-gradient(circle at 72% 27%, rgba(255,255,255,.08), transparent 23%),
    linear-gradient(140deg, #0b291a, var(--b1) 45%, #092315);
  box-shadow: -18px 20px 54px rgba(15,23,42,.13);
  z-index: 3;
}
.xi-list-bg-mark {
  position: absolute;
  right: -21%;
  top: 20%;
  width: 68%;
  opacity: .07;
  filter: grayscale(1);
}
.xi-list-bg-mark img { width: 100%; height: auto; }
.xi-dots {
  position: absolute;
  right: 7%;
  top: 3.4%;
  width: 9%;
  aspect-ratio: 1;
  background-image: radial-gradient(circle, var(--b2) 0 1px, transparent 1.6px);
  background-size: 9px 9px;
}
.xi-formation {
  position: absolute;
  top: 3.5%;
  left: 6.2%;
  color: var(--b2);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 2px;
}
.xi-players-list {
  position: relative;
  z-index: 2;
  display: grid;
}
.xi-player-row {
  position: relative;
  display: grid;
  grid-template-columns: 12% 1fr 9%;
  align-items: center;
  min-height: 7.25%;
  border-bottom: 1px solid rgba(201,162,39,.78);
  color: #fff;
}
.xi-player-row span {
  color: var(--b2);
  font-size: 21px;
  font-weight: 900;
}
.xi-player-row strong {
  color: #f8f4eb;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xi-player-row small { color: #fff; font-size: 12px; text-align: right; }
.xi-player-row em {
  position: absolute;
  right: 0;
  color: var(--b2);
  font-size: 18px;
  font-weight: 900;
  font-style: normal;
}
.xi-bench {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 3.6%;
  border: 1px solid rgba(201,162,39,.85);
  padding: 4.6% 4.5% 3.6%;
  color: #fff;
  z-index: 2;
}
.xi-bench strong {
  position: absolute;
  left: 50%;
  top: -13px;
  transform: translateX(-50%);
  background: var(--b2);
  color: var(--b1);
  padding: 4px 18px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 1px;
}
.xi-bench div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.5;
  text-transform: uppercase;
}
.xi-hashtag {
  position: absolute;
  right: 12%;
  bottom: 3.1%;
  color: var(--b1);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 1.4px;
  z-index: 4;
}

/* ── Editor simplified (v5.5) — link to Brand Studio ──── */
.editor-studio-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--ui-surface2);
  border-bottom: 1px solid var(--ui-border);
  font-size: 11.5px;
  color: var(--ui-text3);
  flex-shrink: 0;
}
.editor-studio-link {
  color: var(--b2);
  font-weight: 700;
  text-decoration: none;
  font-size: 11.5px;
}
.editor-studio-link:hover { text-decoration: underline; }
/* Embedded renderer used by Brand Studio previews. */
html.editor-embed,
html.editor-embed body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: transparent;
}

html.editor-embed .topbar,
html.editor-embed .sidebar,
html.editor-embed .ed-header,
html.editor-embed .form-panel,
html.editor-embed .pv-header,
html.editor-embed #previewSizeHint {
  display: none !important;
}

html.editor-embed .app,
html.editor-embed .main-panel,
html.editor-embed .main-panel > div,
html.editor-embed .preview-panel,
html.editor-embed .pv-wrap,
html.editor-embed .pv-canvas-wrap {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

html.editor-embed #cc {
  flex: 0 0 auto;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}
