.templates-workspace {
  padding: 28px clamp(22px, 3vw, 46px) 42px;
}

.templates-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 118px;
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 14px;
  background:
    radial-gradient(circle at 96% 0%, rgba(217, 86, 212, 0.12), transparent 28%),
    #111111;
}

.template-hero-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.templates-hero .open-profile-button {
  white-space: nowrap;
}

.live-save-status {
  display: inline-grid;
  place-items: center;
  min-height: 28px;
  margin-top: 14px;
  border: 1px solid rgba(64, 214, 111, 0.26);
  border-radius: 999px;
  padding: 0 11px;
  background: rgba(64, 214, 111, 0.1);
  color: #bdf7ce;
  font-size: 12px;
  font-weight: 850;
}

.template-kicker {
  margin: 0 0 7px;
  color: #d990ff;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.templates-hero h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.02;
  letter-spacing: 0;
}

.templates-hero p:not(.template-kicker) {
  max-width: 780px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 650;
}

.founder-mode-note {
  display: none;
  width: fit-content;
  margin-top: 12px !important;
  border: 1px solid rgba(255, 210, 98, 0.25);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(255, 210, 98, 0.09);
  color: #ffe2a0 !important;
  font-size: 12px !important;
  font-weight: 850 !important;
}

body.has-founder-access .founder-mode-note,
body.has-staff-access .founder-mode-note {
  display: block;
}

.open-profile-button,
.template-card button,
.template-preview-dialog footer button {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border: 1px solid rgba(217, 86, 212, 0.62);
  border-radius: 999px;
  padding: 0 20px;
  background: linear-gradient(135deg, #62236e, #4d1b55);
  color: #ffffff;
  box-shadow: 0 0 24px rgba(217, 86, 212, 0.17);
}

.template-toolbar {
  margin-top: 26px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  background: #111111;
}

.template-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.template-tab {
  min-height: 42px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  background: transparent;
  color: #ffffff;
  font-weight: 850;
}

.template-tab.active {
  background: rgba(255, 255, 255, 0.075);
}

.template-search-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 220px;
  gap: 12px;
  margin-top: 18px;
}

.template-search input,
.template-search-row select {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 999px;
  padding: 0 18px;
  background: #111111;
  color: #ffffff;
  outline: none;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 420px));
  gap: 24px;
  margin-top: 26px;
  max-width: 1320px;
  align-items: stretch;
}

.template-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.015)),
    #111111;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.34);
  display: grid;
  grid-template-rows: auto 1fr;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.template-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 86, 212, 0.34);
  box-shadow: 0 30px 92px rgba(0, 0, 0, 0.44);
}

.template-card.is-uploaded {
  border-color: rgba(0, 213, 255, 0.24);
}

.template-preview {
  min-height: 315px;
  padding: 20px;
  background: var(--template-bg);
  background-position: center;
  background-size: cover;
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.template-preview *,
.template-preview::before,
.template-preview::after {
  animation-play-state: paused !important;
}

.template-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
  filter: saturate(1.08) brightness(0.82);
}

.template-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 18%, color-mix(in srgb, var(--template-accent) 30%, transparent), transparent 24%),
    radial-gradient(circle at 84% 10%, color-mix(in srgb, var(--template-pink) 26%, transparent), transparent 26%),
    linear-gradient(120deg, transparent 0 42%, rgba(255, 255, 255, 0.08) 46%, transparent 52% 100%);
  z-index: 1;
  opacity: 0.58;
}

.template-preview.is-motion-template::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(115deg, transparent 0 18%, rgba(255, 255, 255, 0.18) 20%, transparent 23% 45%, rgba(0, 213, 255, 0.2) 48%, transparent 54%),
    radial-gradient(circle at 24% 22%, rgba(255, 47, 125, 0.34), transparent 25%),
    radial-gradient(circle at 78% 28%, rgba(0, 213, 255, 0.36), transparent 30%);
  filter: blur(10px) saturate(1.24);
  animation: templateMotionSweep 5.4s linear infinite;
}

.template-preview.is-motion-template .mini-card {
  animation: miniCardFloat 4.8s ease-in-out infinite;
}

.template-preview.is-glass-template .mini-card {
  overflow: hidden;
}

.template-preview.is-glass-template .mini-card::after {
  content: "";
  position: absolute;
  inset: -45%;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.2), transparent 58%);
  animation: templateCardShine 4.2s ease-in-out infinite;
}

.template-preview.is-motion-template::after {
  content: "MOTION + MUSIC";
  position: absolute;
  right: 18px;
  top: 16px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.mini-card {
  position: relative;
  z-index: 1;
  width: min(100%, 292px);
  border: 1px solid color-mix(in srgb, var(--template-accent) 40%, rgba(255, 255, 255, 0.14));
  border-radius: var(--template-radius);
  padding: 20px;
  background: color-mix(in srgb, var(--template-panel) var(--template-glass), transparent);
  color: var(--template-text);
  box-shadow:
    0 0 calc(var(--template-glow) * 1px) color-mix(in srgb, var(--template-accent) 48%, transparent),
    0 18px 44px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(var(--template-blur));
}

.mini-card.is-uploaded-full-card {
  width: min(100%, 310px);
  padding: 22px;
  text-align: center;
  border-radius: calc(var(--template-radius) + 4px);
  background: color-mix(in srgb, var(--template-panel) calc(var(--template-glass) - 8%), transparent);
  box-shadow:
    0 0 calc(var(--template-glow) * 1.25px) color-mix(in srgb, var(--template-accent) 52%, transparent),
    0 22px 54px rgba(0, 0, 0, 0.42);
}

.mini-card.is-uploaded-full-card .mini-card-top {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.mini-card.is-uploaded-full-card .mini-avatar {
  width: 76px;
  height: 76px;
  margin-inline: auto;
}

.mini-card.is-uploaded-full-card .mini-name strong {
  font-size: 25px;
}

.template-name-effect-glow {
  text-shadow: 0 0 14px rgba(255, 255, 255, 0.62), 0 0 34px color-mix(in srgb, var(--template-accent) 54%, transparent);
}

.template-name-effect-shine,
.template-name-effect-rainbow,
.template-name-effect-cosmic,
.template-name-effect-gold,
.template-name-effect-inferno {
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: templateTextSweep 2.8s linear infinite;
}

.template-name-effect-shine {
  background-image: linear-gradient(110deg, #ffffff 0%, #ffffff 34%, var(--template-pink) 48%, #ffffff 62%, #ffffff 100%);
}

.template-name-effect-rainbow {
  background-image: linear-gradient(90deg, #ff3b3b, #ffd93b, #38ff7a, #38c7ff, #d83bff, #ff3b3b);
}

.template-name-effect-cosmic {
  background-image: linear-gradient(90deg, #9b5cff, #38c7ff, #ff4fd8, #9b5cff);
}

.template-name-effect-gold {
  background-image: linear-gradient(90deg, #7a4b00, #ffd262, #fff2b3, #b07000, #ffd262);
}

.template-name-effect-inferno {
  background-image: linear-gradient(90deg, #3b0000, #ff2e00, #ffb000, #ffffff, #ff2e00);
}

.template-name-effect-typewriter::after {
  content: "|";
  margin-left: 2px;
  animation: templateCaret 720ms step-end infinite;
}

.template-name-effect-glitch {
  text-shadow: 2px 0 #ff1744, -2px 0 #00e5ff;
  animation: templateGlitch 1s steps(2, end) infinite;
}

.template-label {
  position: absolute;
  left: 18px;
  top: 16px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.34);
  color: #ffffff;
  font-size: 11px;
  font-weight: 950;
}

.template-premium-chip {
  position: absolute;
  right: 18px;
  top: 16px;
  z-index: 2;
  border: 1px solid rgba(255, 210, 98, 0.38);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(16, 10, 0, 0.5);
  color: #ffe49a;
  font-size: 11px;
  font-weight: 950;
}

.mini-card-top {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: linear-gradient(135deg, var(--template-accent), var(--template-pink));
  color: #ffffff;
  font-size: 18px;
  font-weight: 950;
}

.mini-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mini-name {
  min-width: 0;
}

.mini-name strong {
  display: block;
  overflow: hidden;
  color: var(--template-text);
  font-size: 18px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-name span {
  display: block;
  margin-top: 3px;
  color: color-mix(in srgb, var(--template-text) 62%, transparent);
  font-size: 12px;
  font-weight: 750;
}

.mini-bio {
  margin: 16px 0 14px;
  color: color-mix(in srgb, var(--template-text) 78%, transparent);
  font-size: 12px;
  line-height: 1.45;
  font-weight: 750;
}

.mini-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 9px;
  margin: 14px 0 0;
}

.mini-social-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 11px;
  background:
    radial-gradient(circle at 30% 18%, rgba(255, 255, 255, 0.18), transparent 34%),
    rgba(0, 0, 0, 0.25);
  color: var(--template-text);
  box-shadow: 0 0 18px color-mix(in srgb, var(--template-accent) 20%, transparent);
}

.mini-social-icon img {
  width: 17px;
  height: 17px;
  object-fit: contain;
}

.mini-social-icon span {
  font-size: 10px;
  font-weight: 950;
}

.mini-reactions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.mini-reactions span {
  min-width: 42px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6px 9px;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.18), transparent 34%),
    rgba(0, 0, 0, 0.24);
  color: var(--template-text);
  font-size: 12px;
  font-weight: 950;
}

.mini-reactions b {
  color: color-mix(in srgb, var(--template-text) 72%, transparent);
  font-size: 10px;
}

.mini-links {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.mini-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.mini-badges span {
  border: 1px solid color-mix(in srgb, var(--template-accent) 38%, rgba(255, 255, 255, 0.12));
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--template-text);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.mini-link {
  min-height: 34px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  gap: 8px;
  border-radius: calc(var(--template-radius) * 0.62);
  padding: 0 10px;
  background: color-mix(in srgb, var(--template-accent) 18%, rgba(255, 255, 255, 0.08));
  color: var(--template-text);
  font-size: 11px;
  font-weight: 900;
}

.mini-link strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-link-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.22);
}

.mini-link-icon img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.mini-audio-row {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  border: 1px solid color-mix(in srgb, var(--template-accent) 28%, rgba(255, 255, 255, 0.11));
  border-radius: calc(var(--template-radius) * 0.72);
  padding: 9px 11px;
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
}

.mini-audio-row span {
  color: color-mix(in srgb, var(--template-text) 62%, transparent);
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.mini-audio-row strong {
  overflow: hidden;
  color: var(--template-text);
  font-size: 11px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-info {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px 20px 20px;
}

.template-info-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.template-info h2 {
  margin: 0;
  overflow: hidden;
  color: #ffffff;
  font-size: 19px;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-info p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.favorite-button {
  min-width: 104px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: #ffffff;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 950;
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.favorite-button b {
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
}

.favorite-button.is-favorite {
  border-color: rgba(255, 47, 125, 0.58);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 47, 125, 0.24), transparent 40%),
    rgba(217, 86, 212, 0.16);
}

.template-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 0;
  color: #aaa0ae;
  font-size: 13px;
  font-weight: 750;
}

.template-tags {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
  margin: 0;
}

.template-tags span {
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(155, 66, 214, 0.22);
  color: #ffffff;
  font-size: 12px;
}

.template-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 2px;
}

.template-upload-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.template-upload-actions button,
.template-edit-actions button {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 999px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.template-upload-actions .danger-template-button,
.template-edit-actions .danger-template-button {
  border-color: rgba(255, 80, 104, 0.34);
  background: rgba(255, 80, 104, 0.12);
  color: #ffc5cf;
}

.template-actions .view-template-button {
  min-height: 42px;
  border-color: rgba(255, 255, 255, 0.12);
  background: #080808;
  padding: 0 18px;
}

.template-card.is-applied {
  border-color: rgba(64, 214, 111, 0.6);
}

.template-card.is-applied .use-template-button {
  border-color: rgba(64, 214, 111, 0.5);
  background: rgba(64, 214, 111, 0.2);
}

.template-empty {
  grid-column: 1 / -1;
  min-height: 170px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  border-radius: 14px;
  color: var(--muted);
  text-align: center;
}

.template-toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 30;
  max-width: 340px;
  border: 1px solid rgba(64, 214, 111, 0.35);
  border-radius: 14px;
  padding: 14px 16px;
  background: #101912;
  color: #ffffff;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.template-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.74);
}

.template-preview-modal[hidden],
.template-toast[hidden] {
  display: none !important;
}

.template-preview-dialog {
  width: min(1480px, calc(100vw - 42px));
  max-height: calc(100vh - 42px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 18px;
  background: #111111;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.template-edit-dialog {
  width: min(620px, 100%);
}

.template-create-dialog {
  width: min(1120px, calc(100vw - 42px));
}

.template-preview-dialog header,
.template-preview-dialog footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
}

.template-preview-dialog h2 {
  margin: 0;
  font-size: 24px;
}

.template-preview-dialog header span {
  color: var(--muted);
  font-size: 13px;
}

#closePreview {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: #080808;
  color: #ffffff;
  padding: 0;
}

#closeEditTemplate,
#closeCreateTemplate {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  background: #080808;
  color: #ffffff;
  padding: 0;
}

.template-create-form {
  display: grid;
  grid-template-columns: minmax(360px, 1.05fr) minmax(320px, 0.95fr);
  gap: 20px;
  padding: 20px;
}

.create-template-snapshot {
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: var(--template-bg, #070707);
  background-position: center;
  background-size: cover;
  position: relative;
}

.create-template-snapshot::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 16%, color-mix(in srgb, var(--template-accent, #9b5cff) 28%, transparent), transparent 28%),
    radial-gradient(circle at 82% 18%, color-mix(in srgb, var(--template-pink, #d956d4) 22%, transparent), transparent 28%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0.34));
}

.create-template-snapshot .mini-card {
  transform: scale(1.08);
}

.create-template-fields {
  display: grid;
  align-content: start;
  gap: 16px;
}

.create-template-fields label {
  display: grid;
  gap: 8px;
}

.create-template-fields label span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
}

.create-template-fields input,
.create-template-fields textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 13px 14px;
  background: #080808;
  color: #ffffff;
  font: inherit;
  outline: none;
}

.create-template-fields textarea {
  min-height: 120px;
  resize: vertical;
}

.create-template-note {
  border: 1px solid rgba(217, 86, 212, 0.24);
  border-radius: 16px;
  padding: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(217, 86, 212, 0.16), transparent 48%),
    rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.create-template-fields button {
  min-height: 48px;
  border: 1px solid rgba(217, 86, 212, 0.62);
  border-radius: 999px;
  background: linear-gradient(135deg, #8b2f9a, #5c1f66);
  color: #ffffff;
  font-weight: 950;
}

.template-edit-form {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.template-edit-form label {
  display: grid;
  gap: 8px;
}

.template-edit-form label span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 850;
}

.template-edit-form input,
.template-edit-form textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 13px 14px;
  background: #080808;
  color: #ffffff;
  font: inherit;
  outline: none;
}

.template-edit-form textarea {
  min-height: 110px;
  resize: vertical;
}

.template-edit-form input:focus,
.template-edit-form textarea:focus {
  border-color: rgba(217, 86, 212, 0.45);
  box-shadow: 0 0 0 4px rgba(217, 86, 212, 0.09);
}

.template-edit-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.template-edit-actions button:last-child {
  border-color: rgba(217, 86, 212, 0.62);
  background: linear-gradient(135deg, #62236e, #4d1b55);
}

.preview-stage {
  height: calc(100vh - 178px);
  min-height: 620px;
  display: grid;
  place-items: center;
  padding: 36px;
  background: var(--template-bg);
  background-position: center;
  background-size: cover;
  position: relative;
  overflow: hidden;
}

.template-profile-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #050505;
}

.template-preview-loading {
  position: relative;
  z-index: 2;
  color: #ffffff;
  font-weight: 950;
}

.full-template-preview {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.full-card-preview-bg,
.full-card-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.full-card-preview-bg {
  background: var(--template-bg);
  background-position: center;
  background-size: cover;
}

.full-card-preview-video {
  object-fit: cover;
  filter: saturate(1.08) brightness(0.78);
}

.full-card-effect {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 18%, color-mix(in srgb, var(--template-accent) 28%, transparent), transparent 28%),
    radial-gradient(circle at 82% 22%, color-mix(in srgb, var(--template-pink) 22%, transparent), transparent 26%),
    rgba(0, 0, 0, 0.18);
}

.full-card-effect-aurora {
  background:
    linear-gradient(110deg, transparent 0 20%, color-mix(in srgb, var(--template-accent) 26%, transparent) 34%, transparent 56%),
    radial-gradient(circle at 78% 20%, color-mix(in srgb, var(--template-pink) 24%, transparent), transparent 32%);
  animation: templateMotionSweep 7s ease-in-out infinite;
}

.full-card-effect-night,
.full-card-effect-particles {
  background-image:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.58) 0 1px, transparent 2px),
    radial-gradient(circle at 42% 8%, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px),
    radial-gradient(circle at 78% 28%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 62% 70%, rgba(255, 255, 255, 0.32) 0 1px, transparent 2px);
  background-size: 180px 180px, 240px 240px, 210px 210px, 260px 260px;
}

.full-card-shell {
  position: relative;
  z-index: 2;
  width: min(420px, calc(100% - 48px));
  display: grid;
  justify-items: center;
  border: 1px solid color-mix(in srgb, var(--template-accent) 36%, rgba(255, 255, 255, 0.16));
  border-radius: calc(var(--template-radius) + 8px);
  padding: 34px;
  background: color-mix(in srgb, var(--template-panel) var(--template-glass), transparent);
  color: var(--template-text);
  box-shadow:
    0 0 calc(var(--template-glow) * 1.35px) color-mix(in srgb, var(--template-accent) 42%, transparent),
    0 28px 90px rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(var(--template-blur));
}

.full-card-avatar {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 2px solid color-mix(in srgb, var(--template-accent) 50%, rgba(255, 255, 255, 0.18));
  border-radius: 50%;
  background: linear-gradient(135deg, var(--template-accent), var(--template-pink));
  color: #ffffff;
  font-size: 34px;
  font-weight: 950;
}

.full-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.full-card-shell h3 {
  margin: 18px 0 0;
  color: var(--template-text);
  font-size: 40px;
  line-height: 1;
  text-align: center;
}

.full-card-handle {
  margin: 7px 0 0;
  color: color-mix(in srgb, var(--template-text) 62%, transparent);
  font-size: 13px;
  font-weight: 850;
}

.full-card-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.full-card-badges span {
  border: 1px solid color-mix(in srgb, var(--template-accent) 38%, rgba(255, 255, 255, 0.16));
  border-radius: 999px;
  padding: 5px 9px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.full-card-bio {
  max-width: 320px;
  margin: 16px 0 0;
  color: color-mix(in srgb, var(--template-text) 78%, transparent);
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  text-align: center;
}

.full-card-socials {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 17px;
}

.full-card-social {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.22), transparent 34%),
    rgba(0, 0, 0, 0.24);
  box-shadow: 0 0 22px color-mix(in srgb, var(--template-accent) 28%, transparent);
}

.full-card-social img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.full-card-social span {
  font-size: 10px;
  font-weight: 950;
}

.full-card-reactions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 15px;
}

.full-card-reactions span {
  min-width: 54px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 7px 11px;
  background: rgba(0, 0, 0, 0.24);
  box-shadow: 0 0 18px color-mix(in srgb, var(--template-accent) 18%, transparent);
  font-size: 13px;
  font-weight: 950;
}

.full-card-reactions b {
  color: color-mix(in srgb, var(--template-text) 72%, transparent);
  font-size: 11px;
}

.full-card-links {
  width: 100%;
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.full-card-link,
.full-card-audio-wrap {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--template-accent) 24%, rgba(255, 255, 255, 0.13));
  border-radius: calc(var(--template-radius) * 0.72);
  background: color-mix(in srgb, var(--template-accent) 13%, rgba(0, 0, 0, 0.22));
  color: var(--template-text);
}

.full-card-link {
  min-height: 44px;
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  padding: 0 13px;
  text-decoration: none;
}

.full-card-link span {
  opacity: 0.7;
  font-size: 10px;
  font-weight: 950;
}

.full-card-link strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 950;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.full-card-audio-wrap {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
}

.full-card-audio-wrap span {
  color: color-mix(in srgb, var(--template-text) 62%, transparent);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.full-card-audio-wrap strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.full-card-audio {
  width: 100%;
  height: 34px;
}

@media (max-width: 1180px) {
  .template-grid {
    grid-template-columns: repeat(2, minmax(250px, 1fr));
  }
}

@media (max-width: 760px) {
  .templates-workspace {
    padding: 24px 16px;
  }

  .templates-hero,
  .template-search-row {
    grid-template-columns: 1fr;
  }

  .templates-hero {
    display: grid;
  }

  .template-grid {
    grid-template-columns: 1fr;
  }

  .template-create-form {
    grid-template-columns: 1fr;
  }

  .create-template-snapshot {
    min-height: 420px;
  }

  .preview-stage {
    min-height: 520px;
    padding: 16px;
  }
}

@keyframes templateMotionSweep {
  0% {
    transform: translate3d(-8%, -2%, 0) rotate(0deg) scale(1.04);
  }

  50% {
    transform: translate3d(8%, 4%, 0) rotate(5deg) scale(1.12);
  }

  100% {
    transform: translate3d(-8%, -2%, 0) rotate(0deg) scale(1.04);
  }
}

@keyframes templateCardShine {
  0%, 46% {
    transform: translateX(-35%) rotate(0deg);
  }

  100% {
    transform: translateX(35%) rotate(0deg);
  }
}

@keyframes templateTextSweep {
  to {
    background-position: 260% 0;
  }
}

@keyframes templateCaret {
  50% {
    opacity: 0;
  }
}

@keyframes templateGlitch {
  0%,
  100% {
    transform: translate(0, 0);
  }

  35% {
    transform: translate(1px, -1px);
  }

  70% {
    transform: translate(-1px, 1px);
  }
}

@keyframes miniCardFloat {
  0%, 100% {
    transform: translateY(0) rotate(-0.4deg);
  }

  50% {
    transform: translateY(-8px) rotate(0.6deg);
  }
}
