/* SFUG-themed Manifest avatar launcher — matches site gold / DM Mono */

.sfug-ma-preload-root {
  position: fixed;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  left: 0;
  top: 0;
  transform: translateX(-120vw);
  overflow: hidden;
  opacity: 0.01;
  pointer-events: none;
  z-index: -1;
}

.sfug-ma-preload-root .sfug-ma-iframe {
  width: 100%;
  height: calc(100% + 49px + 72px);
  top: -49px;
  position: absolute;
  left: 0;
  border: 0;
}

.sfug-ma-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2147483000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 20px;
  border: 1px solid rgba(201, 169, 110, 0.45);
  border-radius: 0;
  background: rgba(5, 5, 5, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #c9a96e;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  transition:
    background 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sfug-ma-fab:hover {
  background: #c9a96e;
  color: #1a1206;
  border-color: #c9a96e;
}

.sfug-ma-fab:focus-visible {
  outline: 2px solid rgba(201, 169, 110, 0.55);
  outline-offset: 3px;
}

.sfug-ma-fab.is-open {
  background: rgba(5, 5, 5, 0.95);
  color: #f5f3ef;
  border-color: rgba(201, 169, 110, 0.35);
}

.sfug-ma-fab-icon {
  display: none;
}

.sfug-ma-panel {
  display: none;
  position: fixed;
  bottom: 88px;
  right: 24px;
  z-index: 2147483000;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(201, 169, 110, 0.28);
  border-radius: 0;
  background: #050505;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55);
  font-family: "Outfit", sans-serif;
}

.sfug-ma-panel.is-open {
  display: flex;
}

.sfug-ma-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(201, 169, 110, 0.15);
  background: #0d0d0d;
  flex-shrink: 0;
}

.sfug-ma-header-text {
  min-width: 0;
}

.sfug-ma-title {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #f5f3ef;
}

.sfug-ma-status {
  display: block;
  margin-top: 4px;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(201, 169, 110, 0.75);
}

.sfug-ma-close {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(201, 169, 110, 0.25);
  border-radius: 0;
  background: transparent;
  color: rgba(245, 243, 239, 0.7);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.sfug-ma-close:hover {
  border-color: rgba(201, 169, 110, 0.55);
  color: #c9a96e;
  background: rgba(201, 169, 110, 0.08);
}

.sfug-ma-stage-wrap {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #0d0d0d;
}

.sfug-ma-stage-placeholder[hidden],
.sfug-ma-loading-overlay[hidden] {
  display: none !important;
}

.sfug-ma-fab.is-preparing .sfug-ma-fab-prep {
  display: block;
}

.sfug-ma-fab-prep {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c9a96e;
  box-shadow: 0 0 10px rgba(201, 169, 110, 0.65);
  animation: sfug-ma-pulse 1.1s ease-in-out infinite;
}

@keyframes sfug-ma-pulse {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.sfug-ma-panel.is-loading .sfug-ma-iframe {
  opacity: 0 !important;
  pointer-events: none !important;
}

.sfug-ma-panel.is-live .sfug-ma-iframe {
  opacity: 1;
  transition: opacity 0.35s ease;
}

.sfug-ma-loading-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px 24px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(201, 169, 110, 0.08) 0%, transparent 55%),
    rgba(5, 5, 5, 0.94);
  color: rgba(245, 243, 239, 0.88);
  font-size: 13px;
  pointer-events: none;
}

.sfug-ma-loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: min(100%, 260px);
}

.sfug-ma-avatar-skeleton {
  width: 112px;
  height: 148px;
  border-radius: 18px;
  border: 1px solid rgba(201, 169, 110, 0.22);
  background:
    linear-gradient(
      180deg,
      rgba(201, 169, 110, 0.12) 0%,
      rgba(201, 169, 110, 0.04) 45%,
      rgba(255, 255, 255, 0.03) 100%
    );
  position: relative;
  overflow: hidden;
}

.sfug-ma-avatar-skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 70%
  );
  transform: translateX(-120%);
  animation: sfug-ma-shimmer 1.35s ease-in-out infinite;
}

@keyframes sfug-ma-shimmer {
  100% {
    transform: translateX(120%);
  }
}

.sfug-ma-loading-step {
  margin: 0;
  font-family: "DM Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(201, 169, 110, 0.72);
}

.sfug-ma-loading-label {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
  color: rgba(245, 243, 239, 0.9);
}

.sfug-ma-loading-bar {
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.sfug-ma-loading-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #9a7a45, #c9a96e, #f5f3ef);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.sfug-ma-loading-overlay p {
  margin: 0;
}

.sfug-ma-spinner {
  width: 28px;
  height: 28px;
  border: 2px solid rgba(201, 169, 110, 0.22);
  border-top-color: #c9a96e;
  border-radius: 50%;
  animation: sfug-ma-spin 0.75s linear infinite;
}

@keyframes sfug-ma-spin {
  to {
    transform: rotate(360deg);
  }
}

.sfug-ma-stage-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 24px;
  text-align: center;
  color: rgba(245, 243, 239, 0.62);
  font-size: 14px;
  line-height: 1.55;
  pointer-events: none;
}

.sfug-ma-stage-placeholder p {
  margin: 0;
}

.sfug-ma-stage-hint {
  font-size: 12px;
  color: rgba(201, 169, 110, 0.72);
}

.sfug-ma-stage-hint strong {
  color: #c9a96e;
  font-weight: 500;
}

.sfug-ma-iframe {
  position: absolute;
  top: -49px;
  left: 0;
  width: 100%;
  height: calc(100% + 49px + 72px);
  border: 0;
  display: block;
  pointer-events: none;
}

.sfug-ma-panel.is-live .sfug-ma-iframe {
  pointer-events: auto;
}

.sfug-ma-panel .sfug-ma-footer,
footer.sfug-ma-footer {
  display: flex !important;
  gap: 10px;
  padding: 16px 18px !important;
  margin: 0 !important;
  border-top: 1px solid rgba(201, 169, 110, 0.15) !important;
  background: #0d0d0d !important;
  flex-shrink: 0;
}

.sfug-ma-footer {
  display: flex;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid rgba(201, 169, 110, 0.15);
  background: #0d0d0d;
  flex-shrink: 0;
}

.sfug-ma-btn {
  flex: 1;
  padding: 14px 20px;
  border: 0;
  border-radius: 0;
  font-family: "DM Mono", monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition:
    background 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.3s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.sfug-ma-btn--primary {
  background: #c9a96e;
  color: #050505;
}

.sfug-ma-btn--primary:hover:not(:disabled) {
  background: #f5f3ef;
  transform: translateY(-1px);
}

.sfug-ma-btn--primary:disabled {
  opacity: 0.55;
  cursor: wait;
}

.sfug-ma-panel .sfug-ma-btn--ghost,
.sfug-ma-btn--ghost {
  background: transparent !important;
  color: rgba(245, 243, 239, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
}

.sfug-ma-panel .sfug-ma-btn--ghost:hover,
.sfug-ma-btn--ghost:hover {
  color: #c9a96e !important;
  border-color: rgba(201, 169, 110, 0.45) !important;
}

.sfug-ma-btn[hidden] {
  display: none;
}

@media (max-width: 600px) {
  .sfug-ma-fab {
    right: 16px;
    bottom: 16px;
    padding: 10px 16px;
    font-size: 10px;
  }

  .sfug-ma-panel {
    right: 16px;
    bottom: 72px;
    width: calc(100vw - 32px);
    height: min(620px, calc(100vh - 96px));
  }
}
